+ AC_MSG_RESULT([no])
+fi
+
+AC_MSG_CHECKING([if kernel passes struct file to direct_IO])
+HAVE_DIO_FILE="`grep -c 'direct_IO.*struct file' $LINUX/include/linux/fs.h`"
+if test "$HAVE_DIO_FILE" != 0 ; then
+ AC_DEFINE(HAVE_DIO_FILE, 1, [the kernel passes struct file to direct_IO])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+if test x$enable_modules != xno ; then
+ # ---------- modules? ------------------------
+ AC_MSG_CHECKING([for module support])
+ LUSTRE_MODULE_TRY_COMPILE(
+ [
+ #include <linux/config.h>
+ ],[
+ #ifndef CONFIG_MODULES
+ #error CONFIG_MODULES not #defined
+ #endif
+ ],[
+ AC_MSG_RESULT([yes])
+ ],[
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([module support is required to build Lustre kernel modules.])
+ ])
+
+ # ---------- modversions? --------------------
+ AC_MSG_CHECKING([for MODVERSIONS])
+ LUSTRE_MODULE_TRY_COMPILE(
+ [
+ #include <linux/config.h>
+ ],[
+ #ifndef CONFIG_MODVERSIONS
+ #error CONFIG_MODVERSIONS not #defined
+ #endif
+ ],[
+ AC_MSG_RESULT([yes])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
+
+ if test $BACKINGFS = 'ext3' ; then
+ # --- Check that ext3 and ext3 xattr are enabled in the kernel
+ AC_MSG_CHECKING([that ext3 is enabled in the kernel])
+ LUSTRE_MODULE_TRY_COMPILE(
+ [
+ #include <linux/config.h>
+ ],[
+ #ifndef CONFIG_EXT3_FS
+ #ifndef CONFIG_EXT3_FS_MODULE
+ #error CONFIG_EXT3_FS not #defined
+ #endif
+ #endif
+ ],[
+ AC_MSG_RESULT([yes])
+ ],[
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)])
+ ])
+
+ AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel])
+ LUSTRE_MODULE_TRY_COMPILE(
+ [
+ #include <linux/config.h>
+ ],[
+ #ifndef CONFIG_EXT3_FS_XATTR
+ #error CONFIG_EXT3_FS_XATTR not #defined
+ #endif
+ ],[
+ AC_MSG_RESULT([yes])
+ ],[
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR.)])
+ AC_MSG_WARN([This build may fail.])
+ ])
+ fi # BACKINGFS = ext3
+fi
+
+CPPFLAGS="-include \$(top_builddir)/include/config.h $CPPFLAGS"
+EXTRA_KCFLAGS="-include $PWD/include/config.h $EXTRA_KCFLAGS"
+AC_SUBST(EXTRA_KCFLAGS)
+
+#echo "KCPPFLAGS: $KCPPFLAGS"
+#echo "KCFLAGS: $KCFLAGS"
+#echo "LLCPPFLAGS: $LLCPPFLAGS"
+#echo "LLCFLAGS: $LLCFLAGS"
+#echo "MOD_LINK: $MOD_LINK"
+#echo "CFLAGS: $CFLAGS"
+#echo "CPPFLAGS: $CPPFLAGS"