From ee8ae61a4d9610fea16473d87b471cd4fc128804 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Thu, 9 Nov 2006 23:10:51 +0000 Subject: [PATCH] linux-config-h-died-20061109 FIXES 42662 config.h vanished. deal. --- acinclude.m4 | 1 + src/afs/LINUX/osi_probe.c | 2 ++ src/afs/LINUX/osi_sysctl.c | 2 ++ src/cf/linux-test3.m4 | 12 ++++++++++-- src/cf/linux-test4.m4 | 14 ++++++++++++++ src/config/param.linux26.h | 2 -- 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 53ea841c1..7f7fd6bcd 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -576,6 +576,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)] ) + LINUX_CONFIG_H_EXISTS LINUX_COMPLETION_H_EXISTS LINUX_DEFINES_FOR_EACH_PROCESS LINUX_DEFINES_PREV_TASK diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c index 06364ca68..c2d3ce4a1 100644 --- a/src/afs/LINUX/osi_probe.c +++ b/src/afs/LINUX/osi_probe.c @@ -59,7 +59,9 @@ #include "afsincludes.h" #endif #include +#ifdef CONFIG_H_EXISTS #include +#endif #include #include #include diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c index 081e560ad..387056329 100644 --- a/src/afs/LINUX/osi_sysctl.c +++ b/src/afs/LINUX/osi_sysctl.c @@ -14,7 +14,9 @@ #include "afs/afs_stats.h" /* afs statistics */ #include +#ifdef CONFIG_H_EXISTS #include +#endif /* From afs_util.c */ extern afs_int32 afs_new_inum; diff --git a/src/cf/linux-test3.m4 b/src/cf/linux-test3.m4 index 2c9ea9903..8c3b296f9 100644 --- a/src/cf/linux-test3.m4 +++ b/src/cf/linux-test3.m4 @@ -33,6 +33,9 @@ AC_SUBST(RHCONFIG_SP) AC_SUBST(RHCONFIG_MP) ]) + +dnl This depends on LINUX_CONFIG_H_EXISTS running first! + AC_DEFUN([LINUX_WHICH_MODULES],[ if test "x$enable_redhat_buildsys" = "xyes"; then MPS=Default @@ -40,12 +43,17 @@ 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 + CPPFLAGS="-DCONFIG_H_EXISTS $CPPFLAGS" + fi if test "x$ac_linux_rhconfig" = "xyes"; then MPS="MP SP" else AC_CACHE_VAL(ac_cv_linux_config_smp, [ - AC_TRY_COMPILE( -[#include + AC_TRY_KBUILD( +[#ifdef CONFIG_H_EXISTS +#include +#endif ], [#ifndef CONFIG_SMP lose; diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index d7f627a4f..261c82d4e 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -1,3 +1,17 @@ +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], [ diff --git a/src/config/param.linux26.h b/src/config/param.linux26.h index 0f353eb89..524509027 100644 --- a/src/config/param.linux26.h +++ b/src/config/param.linux26.h @@ -33,8 +33,6 @@ #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */ #if defined(__KERNEL__) && !defined(KDUMP_KERNEL) -#include -#include #define AFS_GLOBAL_SUNLOCK #endif /* __KERNEL__ && !DUMP_KERNEL */ -- 2.39.5