-# LB_LINUX_SYMVERFILE
-# SLES 9 uses a different name for this file - unsure about vanilla kernels
-# around this version, but it matters for servers only.
-AC_DEFUN([LB_LINUX_SYMVERFILE],
- [AC_MSG_CHECKING([name of module symbol version file])
- if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then
- SYMVERFILE=Modules.symvers
- else
- SYMVERFILE=Module.symvers
- fi
- AC_MSG_RESULT($SYMVERFILE)
- AC_SUBST(SYMVERFILE)
-])
-
-#
-# LB_LINUX_CROSS
-#
-# check for cross compilation
-#
-AC_DEFUN([LB_LINUX_CROSS],
- [AC_MSG_CHECKING([for cross compilation])
-AS_IF([test "x$cross_compiling" = xno], [AC_MSG_RESULT([no])],
- [case $host_vendor in
- # The K1OM architecture is an extension of the x86 architecture
- # and in MPSS 2.1 it's defined in $host_vendor. But in MPSS 3.x
- # it's defined in $host_arch. So, try to support both case.
- k1om | mpss)
- AC_MSG_RESULT([Intel(R) Xeon Phi(TM)])
- CC_TARGET_ARCH=`$CC -v 2>&1 | grep Target: | sed -e 's/Target: //'`
- AC_SUBST(CC_TARGET_ARCH)
- if test \( $CC_TARGET_ARCH != x86_64-k1om-linux \
- -a $CC_TARGET_ARCH != k1om-mpss-linux \)
- then
- AC_MSG_ERROR([Cross compiler not found in PATH.])
- fi
- CROSS_VARS="ARCH=k1om CROSS_COMPILE=${CC_TARGET_ARCH}-"
- CROSS_PATH="${CROSS_PATH:=/opt/lustre/${VERSION}/${CC_TARGET_ARCH}}"
- CCAS=$CC
- # need to produce special section for debuginfo extraction
- LDFLAGS="${LDFLAGS} -Wl,--build-id"
- EXTRA_KLDFLAGS="${EXTRA_KLDFLAGS} -Wl,--build-id"
- if test x$enable_server != xno ; then
- AC_MSG_WARN([Disabling server (not supported for k1om architecture).])
- enable_server='no'
- fi
- ;;
- *)
- AC_MSG_RESULT([yes, but no changes])
- ;;
- esac
+#
+# LC_MODULE_LOADING
+#
+# after 2.6.28 CONFIG_KMOD is removed, and only CONFIG_MODULES remains
+# so we test if request_module is implemented or not
+AC_DEFUN([LC_MODULE_LOADING], [
+AC_CACHE_CHECK([if Linux kernel module loading is possible], lb_cv_module_loading, [
+LB_LINUX_TRY_MAKE([
+ #include <linux/kmod.h>
+], [
+ int myretval=ENOSYS ;
+ return myretval;
+], [
+ $makerule LUSTRE_KERNEL_TEST=conftest.i
+], [dnl
+ grep request_module build/conftest.i |dnl
+ grep -v `grep "int myretval=" build/conftest.i |dnl
+ cut -d= -f2 | cut -d" " -f1`dnl
+ >/dev/null dnl
+], [lb_cv_module_loading="yes"], [lb_cv_module_loading="no"])
+])
+AS_IF([test "$lb_cv_module_loading" = yes],
+ [AC_DEFINE(HAVE_MODULE_LOADING_SUPPORT, 1,
+ [kernel module loading is possible])],
+ [AC_MSG_WARN([
+
+Kernel module loading support is highly recommended.
+
+])
+ ])
+])
+
+#
+# LB_PROG_LINUX
+#
+# linux tests
+#
+AC_DEFUN([LB_PROG_LINUX], [
+LB_LINUX_PATH
+LB_LINUX_SYMVERFILE
+
+LB_CHECK_CONFIG([MODULES], [], [
+ AC_MSG_ERROR([
+
+module support is required to build Lustre kernel modules.
+])
+ ])
+
+LB_CHECK_CONFIG([MODVERSIONS])
+
+LB_CHECK_CONFIG([KALLSYMS], [], [
+ AC_MSG_ERROR([
+
+Lustre requires that CONFIG_KALLSYMS is enabled in your kernel.
+])