From ef8bd5a29b937a1211540aa60398ee966470a712 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 26 Apr 2010 21:34:17 +0100 Subject: [PATCH] Linux: Simplify header file checks Provide an autoconf macro to perform tests for the existence of Linux kernel header files. Use this to standardise the naming of header file presence #defines, and to simplify the linux tests. Change-Id: I49629679db56c5f9a39487bd78fc2e59d5da0269 Reviewed-on: http://gerrit.openafs.org/1844 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- acinclude.m4 | 36 ++++------------ src/afs/LINUX/osi_export.c | 2 +- src/afs/LINUX/osi_probe.c | 2 +- src/afs/LINUX/osi_proc.c | 12 +++--- src/afs/LINUX/osi_sleep.c | 3 +- src/afs/LINUX/osi_sysctl.c | 2 +- src/afs/LINUX24/osi_probe.c | 2 +- src/afs/LINUX24/osi_proc.c | 12 +++--- src/afs/LINUX24/osi_sleep.c | 2 +- src/afs/LINUX24/osi_sysctl.c | 2 +- src/afs/afs_call.c | 4 +- src/afs/sysincludes.h | 8 ++-- src/cf/linux-test1.m4 | 16 ++++++++ src/cf/linux-test3.m4 | 2 +- src/cf/linux-test4.m4 | 79 ++++-------------------------------- src/rx/rx_kcommon.h | 2 +- 16 files changed, 59 insertions(+), 127 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 88be3f559e..59aa9abc01 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -51,7 +51,6 @@ AH_BOTTOM([ #undef AFS_NAMEI_ENV #undef BITMAP_LATER #undef FAST_RESTART -#undef COMPLETION_H_EXISTS #undef DEFINED_FOR_EACH_PROCESS #undef DEFINED_PREV_TASK #undef EXPORTED_KALLSYMS_SYMBOL @@ -823,10 +822,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID LINUX_D_PATH_TAKES_STRUCT_PATH LINUX_NEW_EXPORT_OPS - LINUX_CONFIG_H_EXISTS - LINUX_COMPLETION_H_EXISTS - LINUX_SEMAPHORE_H_EXISTS - LINUX_EXPORTFS_H_EXISTS + AC_CHECK_LINUX_HEADER([config.h]) + AC_CHECK_LINUX_HEADER([completion.h]) + AC_CHECK_LINUX_HEADER([semaphore.h]) + AC_CHECK_LINUX_HEADER([exportfs.h]) LINUX_DEFINES_FOR_EACH_PROCESS LINUX_DEFINES_PREV_TASK LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE @@ -848,14 +847,14 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_FS_STRUCT_FOP_HAS_FLOCK LINUX_FS_STRUCT_FOP_HAS_SENDFILE LINUX_FS_STRUCT_FOP_HAS_SPLICE - LINUX_KERNEL_LINUX_SEQ_FILE_H + AC_CHECK_LINUX_HEADER([seq_file.h]) LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG LINUX_POSIX_TEST_LOCK_RETURNS_CONFLICT LINUX_POSIX_TEST_LOCK_CONFLICT_ARG LINUX_KERNEL_SOCK_CREATE LINUX_KERNEL_PAGE_FOLLOW_LINK LINUX_KERNEL_HLIST_UNHASHED - LINUX_KEY_TYPE_H_EXISTS + AC_CHECK_LINUX_HEADER([key-type.h]) LINUX_EXPORTS_KEY_TYPE_KEYRING LINUX_KEYS_HAVE_SESSION_TO_PARENT LINUX_NEED_RHCONFIG @@ -874,11 +873,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_EXPORTS_TASKLIST_LOCK LINUX_GET_SB_HAS_STRUCT_VFSMOUNT LINUX_STATFS_TAKES_DENTRY - LINUX_FREEZER_H_EXISTS + AC_CHECK_LINUX_HEADER([freezer.h]) LINUX_HAVE_SVC_ADDR_IN - if test "x$ac_cv_linux_freezer_h_exists" = "xyes" ; then - AC_DEFINE(FREEZER_H_EXISTS, 1, [define if you have linux/freezer.h]) - fi LINUX_REFRIGERATOR LINUX_LINUX_KEYRING_SUPPORT LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK @@ -960,18 +956,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS, 1, [define if your linux kernel exports kallsyms address]) fi - if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then - AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists]) - fi - if test "x$ac_cv_linux_config_h_exists" = "xyes" ; then - AC_DEFINE(CONFIG_H_EXISTS, 1, [define if config.h exists]) - fi - if test "x$ac_cv_linux_exportfs_h_exists" = "xyes"; then - AC_DEFINE(EXPORTFS_H_EXISTS, 1, [define if linux/exportfs.h exists]) - fi - if test "x$ac_cv_linux_key_type_h_exists" = "xyes" ; then - AC_DEFINE(KEY_TYPE_H_EXISTS, 1, [define if key-type.h exists]) - fi if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then AC_DEFINE(DEFINED_FOR_EACH_PROCESS, 1, [define if for_each_process defined]) fi @@ -1011,9 +995,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_kernel_hlist_unhashed" = "xyes" ; then AC_DEFINE(HAVE_KERNEL_HLIST_UNHASHED, 1, [define if your linux kernel provides hlist_unhashed]) fi - if test "x$ac_linux_seq_file" = "xyes" ; then - AC_DEFINE(HAVE_KERNEL_LINUX_SEQ_FILE_H, 1, [define if your linux kernel has linux/seq_file.h]) - fi if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then AC_DEFINE(STRUCT_TASK_STRUCT_HAS_PARENT, 1, [define if your struct task_struct has parent]) fi @@ -1056,9 +1037,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument]) fi - if test "x$ac_cv_linux_func_refrigerator_takes_pf_freeze" = "xyes" ; then - AC_DEFINE(LINUX_REFRIGERATOR_TAKES_PF_FREEZE, 1, [define if your refrigerator takes PF_FREEZE]) - fi if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument]) fi diff --git a/src/afs/LINUX/osi_export.c b/src/afs/LINUX/osi_export.c index 992cc94390..59a84db5ba 100644 --- a/src/afs/LINUX/osi_export.c +++ b/src/afs/LINUX/osi_export.c @@ -17,7 +17,7 @@ #include /* early to avoid printf->printk mapping */ #include -#ifdef EXPORTFS_H_EXISTS +#ifdef HAVE_LINUX_EXPORTFS_H #include #endif #include "afs/sysincludes.h" diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c index 9d6da56b46..5f87b709e3 100644 --- a/src/afs/LINUX/osi_probe.c +++ b/src/afs/LINUX/osi_probe.c @@ -62,7 +62,7 @@ #endif #include #include -#ifdef CONFIG_H_EXISTS +#ifdef HAVE_LINUX_CONFIG_H # include #endif #include diff --git a/src/afs/LINUX/osi_proc.c b/src/afs/LINUX/osi_proc.c index 53478bdecd..ca83ca056a 100644 --- a/src/afs/LINUX/osi_proc.c +++ b/src/afs/LINUX/osi_proc.c @@ -16,7 +16,7 @@ #include /* early to avoid printf->printk mapping */ -#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H +#ifdef HAVE_LINUX_SEQ_FILE_H #include #endif #include "afs/sysincludes.h" @@ -37,7 +37,7 @@ struct proc_dir_entry *openafs_procfs; -#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H +#ifdef HAVE_LINUX_SEQ_FILE_H static void *c_start(struct seq_file *m, loff_t *pos) { struct afs_q *cq, *tq; @@ -245,7 +245,7 @@ static struct file_operations afs_unixuser_fops = { }; -#else /* HAVE_KERNEL_LINUX_SEQ_FILE_H */ +#else /* HAVE_LINUX_SEQ_FILE_H */ static int csdbproc_info(char *buffer, char **start, off_t offset, int @@ -314,7 +314,7 @@ done: return len; } -#endif /* HAVE_KERNEL_LINUX_SEQ_FILE_H */ +#endif /* HAVE_LINUX_SEQ_FILE_H */ void osi_proc_init(void) @@ -330,7 +330,7 @@ osi_proc_init(void) sprintf(path, "fs/%s", PROC_FSDIRNAME); openafs_procfs = proc_mkdir(path, NULL); #endif -#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H +#ifdef HAVE_LINUX_SEQ_FILE_H entry = create_proc_entry("unixusers", 0, openafs_procfs); if (entry) { entry->proc_fops = &afs_unixuser_fops; @@ -357,7 +357,7 @@ osi_proc_clean(void) #endif remove_proc_entry(PROC_CELLSERVDB_NAME, openafs_procfs); -#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H +#ifdef HAVE_LINUX_SEQ_FILE_H remove_proc_entry("unixusers", openafs_procfs); #endif #if defined(EXPORTED_PROC_ROOT_FS) diff --git a/src/afs/LINUX/osi_sleep.c b/src/afs/LINUX/osi_sleep.c index 84882bfcb5..45464d775b 100644 --- a/src/afs/LINUX/osi_sleep.c +++ b/src/afs/LINUX/osi_sleep.c @@ -14,8 +14,7 @@ #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ #include "afs/afs_stats.h" /* afs statistics */ - -#if defined(FREEZER_H_EXISTS) +#if defined(HAVE_LINUX_FREEZER_H) #include #endif diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c index 472562f02a..c8b5bfbd3f 100644 --- a/src/afs/LINUX/osi_sysctl.c +++ b/src/afs/LINUX/osi_sysctl.c @@ -14,7 +14,7 @@ #include "afs/afs_stats.h" /* afs statistics */ #include -#ifdef CONFIG_H_EXISTS +#ifdef HAVE_LINUX_CONFIG_H #include #endif diff --git a/src/afs/LINUX24/osi_probe.c b/src/afs/LINUX24/osi_probe.c index 1b670b3d2d..a731490742 100644 --- a/src/afs/LINUX24/osi_probe.c +++ b/src/afs/LINUX24/osi_probe.c @@ -61,7 +61,7 @@ #endif #include #include -#ifdef CONFIG_H_EXISTS +#ifdef HAVE_LINUX_CONFIG_H #include #endif #include diff --git a/src/afs/LINUX24/osi_proc.c b/src/afs/LINUX24/osi_proc.c index 4beed2a294..02d0d09ce5 100644 --- a/src/afs/LINUX24/osi_proc.c +++ b/src/afs/LINUX24/osi_proc.c @@ -16,7 +16,7 @@ #include /* early to avoid printf->printk mapping */ -#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H +#ifdef HAVE_LINUX_SEQ_FILE_H #include #endif #include "afs/sysincludes.h" @@ -37,7 +37,7 @@ struct proc_dir_entry *openafs_procfs; -#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H +#ifdef HAVE_LINUX_SEQ_FILE_H static void *c_start(struct seq_file *m, loff_t *pos) { struct afs_q *cq, *tq; @@ -245,7 +245,7 @@ static struct file_operations afs_unixuser_fops = { }; -#else /* HAVE_KERNEL_LINUX_SEQ_FILE_H */ +#else /* HAVE_LINUX_SEQ_FILE_H */ static int csdbproc_info(char *buffer, char **start, off_t offset, int @@ -314,7 +314,7 @@ done: return len; } -#endif /* HAVE_KERNEL_LINUX_SEQ_FILE_H */ +#endif /* HAVE_LINUX_SEQ_FILE_H */ void osi_proc_init(void) @@ -330,7 +330,7 @@ osi_proc_init(void) sprintf(path, "fs/%s", PROC_FSDIRNAME); openafs_procfs = proc_mkdir(path, NULL); #endif -#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H +#ifdef HAVE_LINUX_SEQ_FILE_H entry = create_proc_entry("unixusers", 0, openafs_procfs); if (entry) { entry->proc_fops = &afs_unixuser_fops; @@ -357,7 +357,7 @@ osi_proc_clean(void) #endif remove_proc_entry(PROC_CELLSERVDB_NAME, openafs_procfs); -#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H +#ifdef HAVE_LINUX_SEQ_FILE_H remove_proc_entry("unixusers", openafs_procfs); #endif #if defined(EXPORTED_PROC_ROOT_FS) diff --git a/src/afs/LINUX24/osi_sleep.c b/src/afs/LINUX24/osi_sleep.c index c820f1e038..3833b8ed4f 100644 --- a/src/afs/LINUX24/osi_sleep.c +++ b/src/afs/LINUX24/osi_sleep.c @@ -15,7 +15,7 @@ #include "afsincludes.h" /* Afs-based standard headers */ #include "afs/afs_stats.h" /* afs statistics */ -#if defined(FREEZER_H_EXISTS) +#if defined(HAVE_LINUX_FREEZER_H) #include #endif diff --git a/src/afs/LINUX24/osi_sysctl.c b/src/afs/LINUX24/osi_sysctl.c index 4ee95a4b14..89bd63d031 100644 --- a/src/afs/LINUX24/osi_sysctl.c +++ b/src/afs/LINUX24/osi_sysctl.c @@ -14,7 +14,7 @@ #include "afs/afs_stats.h" /* afs statistics */ #include -#ifdef CONFIG_H_EXISTS +#ifdef HAVE_LINUX_CONFIG_H #include #endif diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index cb04f37a31..64ae4367a3 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -246,7 +246,7 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5, #endif -#if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS) +#if defined(AFS_LINUX24_ENV) && defined(HAVE_LINUX_COMPLETION_H) struct afsd_thread_info { #if defined(AFS_LINUX26_ENV) && !defined(INIT_WORK_HAS_DATA) struct work_struct tq; @@ -523,7 +523,7 @@ afs_syscall_call(long parm, long parm2, long parm3, #ifdef AFS_DARWIN80_ENV put_vfs_context(); #endif -#if ((defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS)) || defined(AFS_DARWIN80_ENV)) && !defined(UKERNEL) +#if ((defined(AFS_LINUX24_ENV) && defined(HAVE_LINUX_COMPLETION_H)) || defined(AFS_DARWIN80_ENV)) && !defined(UKERNEL) #if defined(AFS_DARWIN80_ENV) if (parm == AFSOP_BKG_HANDLER) { /* if afs_uspc_param grows this should be checked */ diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index 2cda2a157b..0daeca60fb 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -53,7 +53,7 @@ #elif defined(AFS_LINUX22_ENV) # include -# ifdef CONFIG_H_EXISTS +# ifdef HAVE_LINUX_CONFIG_H # include # endif # include @@ -75,7 +75,7 @@ # if defined(LINUX_KEYRING_SUPPORT) # include # include -# if defined(KEY_TYPE_H_EXISTS) +# if defined(HAVE_LINUX_KEY_TYPE_H) # include # endif # ifndef KEY_ALLOC_IN_QUOTA @@ -108,7 +108,7 @@ struct xfs_inode_info { # include # include # include -# if defined(LINUX_SEMAPHORE_H) +# if defined(HAVE_LINUX_SEMAPHORE_H) # include # else # include @@ -117,7 +117,7 @@ struct xfs_inode_info { # include # endif # include -# ifdef COMPLETION_H_EXISTS +# ifdef HAVE_LINUX_COMPLETION_H # include # endif # if defined(LINUX_USE_FH) diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 index 0b40eb75a5..c52a1f8b99 100644 --- a/src/cf/linux-test1.m4 +++ b/src/cf/linux-test1.m4 @@ -84,3 +84,19 @@ AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [ ac_linux_kbuild_requires_extra_cflags=yes) CPPFLAGS="$save_CPPFLAGS" AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)]) + +dnl AC_CHECK_LINUX_HEADER(header) +AC_DEFUN([AC_CHECK_LINUX_HEADER], + [AS_VAR_PUSHDEF([ac_linux_header], [ac_cv_linux_header_$1])dnl + AC_CACHE_CHECK([for linux/$1], [ac_linux_header], + [AC_TRY_KBUILD([#include ], + [return;], + AS_VAR_SET([ac_linux_header], [yes]), + AS_VAR_SET([ac_linux_header], [no])) + ]) + AS_IF([test AS_VAR_GET([ac_linux_header]) = yes], + [AC_DEFINE(AS_TR_CPP(HAVE_LINUX_$1), + 1, + [Define if your kernel has linux/$1])]) + ]) + diff --git a/src/cf/linux-test3.m4 b/src/cf/linux-test3.m4 index eba97c47dc..577adfaf9d 100644 --- a/src/cf/linux-test3.m4 +++ b/src/cf/linux-test3.m4 @@ -31,7 +31,7 @@ else save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS" AC_MSG_CHECKING(which kernel modules to build) - if test "x$ac_cv_linux_config_h_exists" = "xyes"; then + if test "x$ac_cv_linux_header_config_h" = "xyes"; then CPPFLAGS="-DCONFIG_H_EXISTS $CPPFLAGS" fi if test "x$ac_linux_rhconfig" = "xyes"; then diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index e442ee1a5c..cd1d643f20 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -13,24 +13,9 @@ read_lock(&tasklist_lock); AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)]) -AC_DEFUN([LINUX_CONFIG_H_EXISTS], [ - AC_MSG_CHECKING([for linux/config.h existance]) - AC_CACHE_VAL([ac_cv_linux_config_h_exists], [ - AC_TRY_KBUILD( -[#include ], -[return;], - ac_cv_linux_config_h_exists=yes, - ac_cv_linux_config_h_exists=no)]) - AC_MSG_RESULT($ac_cv_linux_config_h_exists) - if test "x$ac_cv_linux_config_h_exists" = "xyes"; then - AC_DEFINE([CONFIG_H_EXISTS], 1, [define if linux/config.h exists]) - fi]) - - AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [ - AC_MSG_CHECKING([for linux/completion.h existance]) - AC_CACHE_VAL([ac_cv_linux_completion_h_exists], [ - AC_TRY_KBUILD( + AC_CACHE_CHECK([for linux/completion.h], [ac_cv_linux_completion_h_exists], + [AC_TRY_KBUILD( [#include #include ], [struct completion _c; @@ -39,17 +24,10 @@ lose #endif], ac_cv_linux_completion_h_exists=yes, ac_cv_linux_completion_h_exists=no)]) - AC_MSG_RESULT($ac_cv_linux_completion_h_exists)]) - -AC_DEFUN([LINUX_EXPORTFS_H_EXISTS], [ - AC_MSG_CHECKING([for linux/exportfs.h existence]) - AC_CACHE_VAL([ac_cv_linux_exportfs_h_exists], [ - AC_TRY_KBUILD( -[#include ], -[return;], - ac_cv_linux_exportfs_h_exists=yes, - ac_cv_linux_exportfs_h_exists=no)]) - AC_MSG_RESULT($ac_cv_linux_exportfs_h_exists)]) + AS_IF([test "x$ac_linux_completion_h_exists" = xyes], + [AC_DEFINE(HAVE_LINUX_COMPLETION_H, 1, + [Define if your kernel has a usable linux/completion.h])]) +]) AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [ AC_MSG_CHECKING([for defined for_each_process]) @@ -499,7 +477,7 @@ AC_DEFUN([LINUX_REFRIGERATOR], [ AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [ AC_TRY_KBUILD( [#include -#ifdef FREEZER_H_EXISTS +#ifdef HAVE_LINUX_FREEZER_H #include #endif], [refrigerator(PF_FREEZE);], @@ -606,25 +584,12 @@ extern int vfs_statfs(struct dentry *, struct kstatfs *); 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 +#ifdef HAVE_LINUX_KEY_TYPE_H #include #endif #include @@ -746,19 +711,6 @@ AC_DEFUN([LINUX_HAVE_D_ALLOC_ANON], [ AC_DEFINE([HAVE_LINUX_D_ALLOC_ANON], 1, [define if your kernel has d_alloc_anon()]) fi]) -AC_DEFUN([LINUX_FREEZER_H_EXISTS], [ - AC_MSG_CHECKING([for linux/freezer.h existance]) - AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [ - AC_TRY_KBUILD( -[#include ], -[return;], - ac_cv_linux_freezer_h_exists=yes, - ac_cv_linux_freezer_h_exists=no)]) - AC_MSG_RESULT($ac_cv_linux_freezer_h_exists) - if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then - AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists]) - fi]) - AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [ AC_MSG_CHECKING([for todo in struct task_struct]) AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [ @@ -1018,19 +970,6 @@ _eops.fh_to_parent(NULL, NULL, 0, 0);], AC_DEFINE([NEW_EXPORT_OPS], 1, [define if kernel uses new export ops]) fi]) -AC_DEFUN([LINUX_SEMAPHORE_H_EXISTS], [ - AC_MSG_CHECKING([for linux/semaphore.h existance]) - AC_CACHE_VAL([ac_cv_linux_semaphore_h_exists], [ - AC_TRY_KBUILD( -[#include ], -[return;], - ac_cv_linux_semaphore_h_exists=yes, - ac_cv_linux_semaphore_h_exists=no)]) - AC_MSG_RESULT($ac_cv_linux_semaphore_h_exists) - if test "x$ac_cv_linux_semaphore_h_exists" = "xyes"; then - AC_DEFINE([LINUX_SEMAPHORE_H], 1, [define if linux/semaphore.h exists]) - fi]) - AC_DEFUN([LINUX_HAVE_BDI_INIT], [ AC_MSG_CHECKING([for linux bdi_init()]) AC_CACHE_VAL([ac_cv_linux_bdi_init], [ @@ -1162,7 +1101,7 @@ AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [ AC_CACHE_VAL([ac_cv_linux_exports_key_type_keyring], [ AC_TRY_KBUILD( [ -#ifdef KEY_TYPE_H_EXISTS +#ifdef HAVE_LINUX_KEY_TYPE_H #include #endif #include ], diff --git a/src/rx/rx_kcommon.h b/src/rx/rx_kcommon.h index 249db800f5..cabb289e3a 100644 --- a/src/rx/rx_kcommon.h +++ b/src/rx/rx_kcommon.h @@ -112,7 +112,7 @@ typedef unsigned short etap_event_t; #endif #ifdef AFS_LINUX22_ENV #include "h/sched.h" -#if defined(FREEZER_H_EXISTS) +#if defined(HAVE_LINUX_FREEZER_H) #include "h/freezer.h" #endif #include "h/netdevice.h"