])
#
+#
# LB_LINUX_PATH
#
# Find paths for linux, handling kernel-source rpms
$LINUX_OBJ/include/linux/version.h
],[],
[AC_MSG_ERROR([Run make config in $LINUX.])])
-#
-LB_CHECK_FILE([$LINUX_OBJ/include/linux/config.h],
- [ AC_DEFINE(HAVE_KERNEL_CONFIG_H, 1,
- [kernel modules need to include config.h])
- ]
-)
# ------------ rhconfig.h includes runtime-generated bits --
# red hat kernel-source checks
AC_MSG_RESULT([no])
AC_MSG_WARN([Consult config.log for details.])
AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult build/README.kernel-source])
- AC_MSG_ERROR([Kernel modules cannot be build.])
+ AC_MSG_ERROR([Kernel modules cannot be built.])
])
LB_LINUX_RELEASE
+]) # end of LB_LINUX_PATH
+
+#
+#
+# LB_LINUX_MODPOST
+#
+# Find modpost and check it
+#
+AC_DEFUN([LB_LINUX_MODPOST],
+[
+# Find the modpost utility
+AC_CHECK_FILE([$LINUX_OBJ/scripts/mod/modpost],
+ [MODPOST=$LINUX_OBJ/scripts/mod/modpost],
+ [AC_CHECK_FILE([$LINUX_OBJ/scripts/modpost],
+ [MODPOST=$LINUX_OBJ/scripts/modpost],
+ AC_MSG_ERROR([modpost not found.])
+ )]
+)
+AC_SUBST(MODPOST)
+
+# Ensure it can run
+AC_MSG_CHECKING([if modpost can be run])
+if $MODPOST ; then
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_ERROR([modpost can not be run.])
+fi
+
+# Check if modpost supports (and therefore requires) -m
+AC_MSG_CHECKING([if modpost supports -m])
+if $MODPOST -m 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ MODPOST_ARGS=-m
+else
+ AC_MSG_RESULT([no])
+ MODPOST_ARGS=""
+fi
+AC_SUBST(MODPOST_ARGS)
])
#
])
#
+# LB_LINUX_ARCH
+#
+# Determine the kernel's idea of the current architecture
+#
+AC_DEFUN([LB_LINUX_ARCH],
+ [AC_MSG_CHECKING([Linux kernel architecture])
+ AS_IF([rm -f $PWD/build/arch
+ make -s --no-print-directory echoarch -f $PWD/build/Makefile \
+ LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -C $LINUX_OBJ $ARCH_UM \
+ ARCHFILE=$PWD/build/arch && LINUX_ARCH=`cat $PWD/build/arch`],
+ [AC_MSG_RESULT([$LINUX_ARCH])],
+ [AC_MSG_ERROR([Could not determine the kernel architecture.])])
+ rm -f build/arch])
+
+#
# LB_LINUX_TRY_COMPILE
#
# like AC_TRY_COMPILE
AC_DEFUN([LB_LINUX_CONFIG],
[AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
LB_LINUX_TRY_COMPILE([
-#ifdef HAVE_KERNEL_CONFIG_H
+#ifndef AUTOCONF_INCLUDED
#include <linux/config.h>
#endif
],[