diff --git a/acinclude.m4 b/acinclude.m4 index 99947094cc..0d09c77fff 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -659,6 +659,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_DEFINE(FREEZER_H_EXISTS, 1, [define if you have linux/freezer.h]) fi LINUX_REFRIGERATOR + LINUX_KEY_TYPE_H_EXISTS + if test "x$ac_cv_linux_key_type_h_exists" = "xyes" ; then + AC_DEFINE(KEY_TYPE_H_EXISTS, 1, [define if you have linux/key-type.h]) + fi LINUX_LINUX_KEYRING_SUPPORT LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK LINUX_DO_SYNC_READ diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index ed7516c673..184a3e35c6 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -17,6 +17,9 @@ #include "afs/param.h" #ifdef LINUX_KEYRING_SUPPORT #include +#if KEY_TYPE_H_EXISTS +#include +#endif #endif RCSID diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index cc3bc48413..5644fe93a6 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -728,11 +728,28 @@ extern int vfs_statfs(struct dentry *, struct kstatfs *); ac_cv_linux_statfs_takes_dentry=no)]) AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)]) + +AC_DEFUN([LINUX_KEY_TYPE_H_EXISTS], [ + AC_MSG_CHECKING([for linux/key-type.h existance]) + AC_CACHE_VAL([ac_cv_linux_key_type_h_exists], [ + AC_TRY_KBUILD( +[#include ], +[return;], + ac_cv_linux_key_type_h_exists=yes, + ac_cv_linux_key_type_h_exists=no)]) + AC_MSG_RESULT($ac_cv_linux_key_type_h_exists) + if test "x$ac_cv_linux_key_type_h_exists" = "xyes"; then + AC_DEFINE([KEY_TYPE_H_EXISTS], 1, [define if linux/key-type.h exists]) + fi]) + AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [ AC_MSG_CHECKING([for linux kernel keyring support]) AC_CACHE_VAL([ac_cv_linux_keyring_support], [ AC_TRY_KBUILD( [#include +#ifdef KEY_TYPE_H_EXISTS +#include +#endif #include #include ], [#ifdef CONFIG_KEYS @@ -769,7 +786,7 @@ AC_DEFUN([LINUX_DO_SYNC_READ], [ AC_MSG_CHECKING([for linux do_sync_read()]) AC_CACHE_VAL([ac_cv_linux_do_sync_read], [ save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration" + EXTRA_FLAGS="$CPPFLAGS -Werror-implicit-function-declaration" AC_TRY_KBUILD( [#include ], [do_sync_read(NULL, NULL, 0, NULL);],