Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / cf / linux-test3.m4
CommitLineData
805e021f
CE
1AC_DEFUN([LINUX_NEED_RHCONFIG],[
2RHCONFIG_SP=""
3RHCONFIG_MP=""
4if test "x$enable_redhat_buildsys" = "xyes"; then
5 AC_MSG_WARN(Configured to build from a Red Hat SPEC file)
6else
7 AC_MSG_CHECKING(for redhat kernel configuration)
8 AC_TRY_KBUILD([#include <linux/rhconfig.h>], [],
9 [ac_linux_rhconfig=yes], [ac_linux_rhconfig=no])
10 AC_MSG_RESULT($ac_linux_rhconfig)
11 if test x"$ac_linux_rhconfig" = xyes; then
12 RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0"
13 RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1"
14 AC_MSG_RESULT($ac_linux_rhconfig)
15 if test ! -f "/boot/kernel.h"; then
16 AC_MSG_WARN([/boot/kernel.h does not exist. build may fail])
17 fi
18 fi
19fi
20AC_SUBST(RHCONFIG_SP)
21AC_SUBST(RHCONFIG_MP)
22])
23
24
25dnl This depends on LINUX_CONFIG_H_EXISTS running first!
26
27AC_DEFUN([LINUX_WHICH_MODULES],[
28if test "x$enable_redhat_buildsys" = "xyes"; then
29 MPS=Default
30else
31 save_CPPFLAGS="$CPPFLAGS"
32 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
33 AC_MSG_CHECKING(which kernel modules to build)
34 if test "x$ac_cv_linux_header_config_h" = "xyes"; then
35 CPPFLAGS="-DCONFIG_H_EXISTS $CPPFLAGS"
36 fi
37 if test "x$ac_linux_rhconfig" = "xyes"; then
38 MPS="MP SP"
39 else
40 AC_CACHE_VAL(ac_cv_linux_config_smp, [
41 AC_TRY_KBUILD(
42[#ifdef CONFIG_H_EXISTS
43#include <linux/config.h>
44#endif
45],
46[#ifndef CONFIG_SMP
47lose;
48#endif
49],
50 ac_cv_linux_config_smp=yes,
51 ac_cv_linux_config_smp=no)])
52 dnl AC_MSG_RESULT($ac_cv_linux_config_smp)
53 if test "x$ac_cv_linux_config_smp" = "xyes"; then
54 MPS=MP
55 else
56 MPS=SP
57 fi
58 fi
59 CPPFLAGS=$save_CPPFLAGS
60 AC_MSG_RESULT($MPS)
61fi
62AC_SUBST(MPS)
63])
64