#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
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
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
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
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
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
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
#include <linux/module.h> /* early to avoid printf->printk mapping */
#include <linux/fs.h>
-#ifdef EXPORTFS_H_EXISTS
+#ifdef HAVE_LINUX_EXPORTFS_H
#include <linux/exportfs.h>
#endif
#include "afs/sysincludes.h"
#endif
#include <linux/version.h>
#include <linux/sched.h>
-#ifdef CONFIG_H_EXISTS
+#ifdef HAVE_LINUX_CONFIG_H
# include <linux/config.h>
#endif
#include <linux/linkage.h>
#include <linux/module.h> /* early to avoid printf->printk mapping */
-#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H
+#ifdef HAVE_LINUX_SEQ_FILE_H
#include <linux/seq_file.h>
#endif
#include "afs/sysincludes.h"
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;
};
-#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
return len;
}
-#endif /* HAVE_KERNEL_LINUX_SEQ_FILE_H */
+#endif /* HAVE_LINUX_SEQ_FILE_H */
void
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;
#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)
#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 <linux/freezer.h>
#endif
#include "afs/afs_stats.h" /* afs statistics */
#include <linux/sysctl.h>
-#ifdef CONFIG_H_EXISTS
+#ifdef HAVE_LINUX_CONFIG_H
#include <linux/config.h>
#endif
#endif
#include <linux/version.h>
#include <linux/sched.h>
-#ifdef CONFIG_H_EXISTS
+#ifdef HAVE_LINUX_CONFIG_H
#include <linux/config.h>
#endif
#include <linux/linkage.h>
#include <linux/module.h> /* early to avoid printf->printk mapping */
-#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H
+#ifdef HAVE_LINUX_SEQ_FILE_H
#include <linux/seq_file.h>
#endif
#include "afs/sysincludes.h"
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;
};
-#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
return len;
}
-#endif /* HAVE_KERNEL_LINUX_SEQ_FILE_H */
+#endif /* HAVE_LINUX_SEQ_FILE_H */
void
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;
#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)
#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 <linux/freezer.h>
#endif
#include "afs/afs_stats.h" /* afs statistics */
#include <linux/sysctl.h>
-#ifdef CONFIG_H_EXISTS
+#ifdef HAVE_LINUX_CONFIG_H
#include <linux/config.h>
#endif
#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;
#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 */
#elif defined(AFS_LINUX22_ENV)
# include <linux/version.h>
-# ifdef CONFIG_H_EXISTS
+# ifdef HAVE_LINUX_CONFIG_H
# include <linux/config.h>
# endif
# include <linux/linkage.h>
# if defined(LINUX_KEYRING_SUPPORT)
# include <linux/rwsem.h>
# include <linux/key.h>
-# if defined(KEY_TYPE_H_EXISTS)
+# if defined(HAVE_LINUX_KEY_TYPE_H)
# include <linux/key-type.h>
# endif
# ifndef KEY_ALLOC_IN_QUOTA
# include <linux/mm.h>
# include <linux/slab.h>
# include <linux/string.h>
-# if defined(LINUX_SEMAPHORE_H)
+# if defined(HAVE_LINUX_SEMAPHORE_H)
# include <linux/semaphore.h>
# else
# include <asm/semaphore.h>
# include <linux/mutex.h>
# endif
# include <linux/errno.h>
-# ifdef COMPLETION_H_EXISTS
+# ifdef HAVE_LINUX_COMPLETION_H
# include <linux/completion.h>
# endif
# if defined(LINUX_USE_FH)
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 <linux/$1>],
+ [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])])
+ ])
+
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
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 <linux/config.h>],
-[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 <linux/version.h>
#include <linux/completion.h>],
[struct completion _c;
#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 <linux/exportfs.h>],
-[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])
AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
AC_TRY_KBUILD(
[#include <linux/sched.h>
-#ifdef FREEZER_H_EXISTS
+#ifdef HAVE_LINUX_FREEZER_H
#include <linux/freezer.h>
#endif],
[refrigerator(PF_FREEZE);],
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 <linux/key-type.h>],
-[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 <linux/rwsem.h>
-#ifdef KEY_TYPE_H_EXISTS
+#ifdef HAVE_LINUX_KEY_TYPE_H
#include <linux/key-type.h>
#endif
#include <linux/key.h>
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 <linux/freezer.h>],
-[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], [
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 <linux/semaphore.h>],
-[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], [
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 <linux/key-type.h>
#endif
#include <linux/key.h>],
#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"