Whamcloud - gitweb
LU-1199 build: Remove unused LB_LDISKFS_RELEASE macros
[fs/lustre-release.git] / ldiskfs / config / ldiskfs-build.m4
index 429bb8c..be144de 100644 (file)
@@ -495,7 +495,7 @@ AS_VAR_POPDEF([lb_File])dnl
 # add -include config.h
 #
 AC_DEFUN([LB_CONFIG_HEADERS],[
-       AC_CONFIG_HEADERS([config.h])
+       AC_CONFIG_HEADERS([config.h ldiskfs/ldiskfs_config.h])
        CPPFLAGS="-include $PWD/config.h $CPPFLAGS"
        EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
        AC_SUBST(EXTRA_KCFLAGS)
@@ -608,28 +608,6 @@ and kernel-debuginfo-common-<arch> packages are installed.
 fi
 ])
 
-#
-# LB_LDISKFS_DEFINE_OPTIONS
-#
-# Enable config options related to ldiskfs.  These are used by ldiskfs,
-# lvfs, and the osd-ldiskfs code (which includes ldiskfs headers.)
-#
-AC_DEFUN([LB_LDISKFS_DEFINE_OPTIONS],
-[
-AC_DEFINE(CONFIG_LDISKFS_FS_XATTR, 1,
-       [enable extended attributes for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1,
-       [enable posix acls for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFS_FS_SECURITY, 1,
-       [enable fs security for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFSDEV_FS_POSIX_ACL, 1,
-       [enable posix acls for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFSDEV_FS_XATTR, 1,
-       [enable extented attributes for ldiskfs])
-AC_DEFINE(CONFIG_LDISKFSDEV_FS_SECURITY, 1,
-       [enable fs security for ldiskfs])
-])
-
 AC_DEFUN([LB_LDISKFS_SYMVERS],
 [
 AC_MSG_CHECKING([ldiskfs module symbols])
@@ -649,80 +627,70 @@ AC_MSG_RESULT([$LDISKFS_SYMBOLS])
 AC_SUBST(LDISKFS_SYMBOLS)
 ])
 
-AC_DEFUN([LB_LDISKFS_RELEASE],
-[
-AC_MSG_CHECKING([ldiskfs source release])
-if test -r $LDISKFS_OBJ/config.h; then
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-I$LDISKFS_DIR $EXTRA_KCFLAGS"
-       LB_LINUX_TRY_MAKE([
-               #undef PACKAGE_NAME
-               #undef PACKAGE_TARNAME
-               #undef PACKAGE_VERSION
-               #undef PACKAGE_STRING
-               #undef PACKAGE_BUGREPORT
-               #undef PACKAGE
-               #undef VERSION
-               #undef STDC_HEADERS
-
-               #include <$LDISKFS_OBJ/config.h>
-       ],[
-               char *LDISKFS_RELEASE;
-               LDISKFS_RELEASE=VERSION;
-       ],[
-               $makerule LUSTRE_KERNEL_TEST=conftest.i
-       ],[
-               test -s build/conftest.i
-       ],[
-               eval $(grep "LDISKFS_RELEASE=" build/conftest.i)
-       ],[
-               AC_MSG_RESULT([unknown])
-               AC_MSG_ERROR([Could not preprocess test program.])
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-       rm build/conftest.i
-elif test -r $LDISKFS_DIR/configure.ac; then
-       LDISKFS_RELEASE=$(awk '/AC\_INIT/ { print [$]3 }' \
-                $LDISKFS_DIR/configure.ac | tr ',' '\n')
-else
-       AC_MSG_RESULT([unknown])
-       AC_MSG_ERROR([Could not locate config.h, META, or configure.ac to check release.])
-fi
-
-if test x$LDISKFS_RELEASE = x; then
-       AC_MSG_RESULT([unknown])
-       AC_MSG_ERROR([Could not determine ldiskfs release.])
-fi
-
-AC_MSG_RESULT([$LDISKFS_RELEASE])
-AC_SUBST(LDISKFS_RELEASE)
-])
-
 AC_DEFUN([LB_LDISKFS_SERIES],
 [
-if $1; then
+LDISKFS_SERIES=
+AS_IF([$1], [
        AC_MSG_CHECKING([which ldiskfs series to use])
-       case $LINUXRELEASE in
-       2.6.32*)
-               if test x$RHEL_KERNEL = xyes; then
-                       LDISKFS_SERIES="2.6-rhel6.series"
-               fi
-               if test x$SUSE_KERNEL = xyes; then
-                       LDISKFS_SERIES="2.6-sles11.series"
-               fi
-               ;;
-       *)
-               AC_MSG_WARN([Unknown kernel version $LINUXRELEASE])
-               LDISKFS_SERIES=
-               ;;
-       esac
+
+       SER=
+       AS_IF([test x$RHEL_KERNEL = xyes], [
+               AS_VERSION_COMPARE([$LINUXRELEASE],[2.6.32-343],[
+               AS_VERSION_COMPARE([$LINUXRELEASE],[2.6.32],[],
+               [SER="2.6-rhel6.series"],[SER="2.6-rhel6.series"])],
+               [SER="2.6-rhel6.4.series"],[SER="2.6-rhel6.4.series"])
+       ], [test x$SUSE_KERNEL = xyes], [
+               AS_VERSION_COMPARE([$LINUXRELEASE],[3.0.0],[
+               AS_VERSION_COMPARE([$LINUXRELEASE],[2.6.32],[],
+               [SER="2.6-sles11.series"],[SER="2.6-sles11.series"])],
+               [SER="3.0-sles11.series"],[SER="3.0-sles11.series"])
+       ])
+       LDISKFS_SERIES=$SER
+
+       AS_IF([test -z "$LDISKFS_SERIES"],
+               [AC_MSG_WARN([Unknown kernel version $LINUXRELEASE])])
        AC_MSG_RESULT([$LDISKFS_SERIES])
-else
-       LDISKFS_SERIES=
-fi
+])
 AC_SUBST(LDISKFS_SERIES)
 ])
 
+#
+# 2.6.32-rc7 ext4_free_blocks requires struct buffer_head
+#
+AC_DEFUN([LB_EXT_FREE_BLOCKS_WITH_BUFFER_HEAD],
+[AC_MSG_CHECKING([if ext4_free_blocks needs struct buffer_head])
+ LB_LINUX_TRY_COMPILE([
+       #include <linux/fs.h>
+       #include "$EXT_DIR/ext4.h"
+],[
+       ext4_free_blocks(NULL, NULL, NULL, 0, 0, 0);
+],[
+       AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_EXT_FREE_BLOCK_WITH_BUFFER_HEAD, 1,
+                 [ext4_free_blocks do not require struct buffer_head])
+],[
+       AC_MSG_RESULT([no])
+])
+])
+
+#
+# 2.6.35 renamed ext_pblock to ext4_ext_pblock(ex)
+#
+AC_DEFUN([LB_EXT_PBLOCK],
+[AC_MSG_CHECKING([if kernel has ext_pblocks])
+ LB_LINUX_TRY_COMPILE([
+       #include <linux/fs.h>
+       #include "$EXT_DIR/ext4_extents.h"
+],[
+       ext_pblock(NULL);
+],[
+       AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_EXT_PBLOCK, 1,
+                 [kernel has ext_pblocks])
+],[
+       AC_MSG_RESULT([no])
+])
+])
 
 #
 # LDISKFS_AC_PATCH_PROGRAM