linux-kbuild-test-fixes-20070119
authorJeffrey Hutzelman <jhutz@cmu.edu>
Fri, 19 Jan 2007 19:31:05 +0000 (19:31 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 19 Jan 2007 19:31:05 +0000 (19:31 +0000)
fixes to build for linux when doing objdir builds

acinclude.m4
src/cf/linux-test1.m4
src/cf/linux-test4.m4

index 5ff83ef..c5bb1a9 100644 (file)
@@ -624,12 +624,15 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO
                 LINUX_GET_SB_HAS_STRUCT_VFSMOUNT
                 LINUX_STATFS_TAKES_DENTRY
+                LINUX_FREEZER_H_EXISTS
+                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
                 LINUX_DO_SYNC_READ
                 LINUX_GENERIC_FILE_AIO_READ
-                LINUX_FREEZER_H_EXISTS
                 LINUX_INIT_WORK_HAS_DATA
                  LINUX_EXPORTS_SYS_CHDIR
                  LINUX_EXPORTS_SYS_CLOSE
@@ -824,9 +827,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
                  AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
                 fi
-                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
                 if test "x$ac_cv_linux_init_work_has_data" = "xyes" ; then
                  AC_DEFINE(INIT_WORK_HAS_DATA, 1, [define if INIT_WORK takes a data (3rd) argument])
                 fi
index 2a99105..b55e9e7 100644 (file)
@@ -9,6 +9,11 @@ CFLAGS += $CPPFLAGS
 obj-m += conftest.o
 _ACEOF
     cat >conftest.dir/conftest.c <<\_ACEOF &&
+/* confdefs.h */
+_ACEOF
+    cat confdefs.h >>conftest.dir/conftest.c &&
+    cat >>conftest.dir/conftest.c <<\_ACEOF &&
+/* end confdefs.h */
 #include <linux/module.h>
 $1
 
@@ -46,7 +51,7 @@ AC_DEFUN([AC_TRY_KBUILD24], [
 #               [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
 #
 AC_DEFUN([AC_TRY_KBUILD], [
-  if test -f $LINUX_KERNEL_PATH/scripts/Makefile.build; then
+  if test $AFS_SYSKVERS -ge 26 ; then
     AC_TRY_KBUILD26([$1], [$2], [$3], [$4])
   else
     AC_TRY_KBUILD24([$1], [$2], [$3], [$4])
@@ -54,6 +59,10 @@ AC_DEFUN([AC_TRY_KBUILD], [
 
 AC_DEFUN([LINUX_KERNEL_COMPILE_WORKS], [
   AC_MSG_CHECKING([for linux kernel module build works])
-  AC_TRY_KBUILD([],[],:,AC_MSG_RESULT(no)
+  AC_TRY_KBUILD(
+[#include <linux/sched.h>
+#include <linux/fs.h>
+#include <linux/namei.h>],
+    [],:,AC_MSG_RESULT(no)
     AC_MSG_FAILURE([Fix problem or use --disable-kernel-module...]))
   AC_MSG_RESULT(yes)])
index 7aa7bb9..61b92c8 100644 (file)
@@ -562,7 +562,10 @@ AC_DEFUN([LINUX_REFRIGERATOR], [
   AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
   AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
     AC_TRY_KBUILD(
-[#include <linux/sched.h>],
+[#include <linux/sched.h>
+#ifdef FREEZER_H_EXISTS
+#include <linux/freezer.h>
+#endif],
 [refrigerator(PF_FREEZE);],
       ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
       ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])