+
+# ---------- Red Hat 2.4.21 backports some more 2.5 bits --------
+
+AC_MSG_CHECKING(if kernel defines PDE)
+HAVE_PDE="`grep -c 'proc_dir_entry..PDE' $LINUX/include/linux/proc_fs.h`"
+if test "$HAVE_PDE" != 0 ; then
+ CPPFLAGS="$CPPFLAGS -DHAVE_PDE"
+ AC_MSG_RESULT(yes)
+else
+ 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
+ CPPFLAGS="$CPPFLAGS -DHAVE_DIO_FILE"
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+# --- Check that ext3 and ext3 xattr are enabled in the kernel
+if test "$host_cpu" != "lib" ; then
+ AC_MSG_CHECKING([that ext3 is enabled in the kernel])
+ AC_TRY_COMPILE([
+#define __KERNEL__
+#include <linux/config.h>
+ ],
+ [
+#ifdef CONFIG_EXT3_FS
+ return 0;
+#else
+#error CONFIG_EXT3_FS not #defined
+#endif
+ ],[AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)])
+ ])
+# disable this check until our xattr patches define it!
+# AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel])
+# AC_TRY_COMPILE([
+##define __KERNEL__
+##include <linux/config.h>
+# ],
+# [
+##ifdef CONFIG_EXT3_FS_XATTR
+# return 0;
+##else
+##error CONFIG_EXT3_FS_XATTR not #defined
+##endif
+# ],[AC_MSG_RESULT([yes])],
+# [AC_MSG_RESULT([no])
+# AC_MSG_ERROR([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR)])
+# ])
+fi
+