Whamcloud - gitweb
Branch: HEAD
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 61c5ab2..7d67458 100644 (file)
@@ -59,6 +59,7 @@ AC_DEFUN([LC_CONFIG_EXT3],
 LB_LINUX_CONFIG([EXT3_FS_XATTR],[$1],[$3])
 ])
 
+
 #
 # LC_FSHOOKS
 #
@@ -79,7 +80,17 @@ AC_DEFUN([LC_FSHOOKS],
        ])
 $1
 ],[
+LB_LINUX_TRY_COMPILE([
+        #include <linux/version.h>
+],[
+       #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
+       #error "linux version < 2.6.10, only support 2.6.7"
+       #endif
+],[
 $2
+],[
+$3 
+])
 ])
 ])
 
@@ -215,6 +226,29 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+
+#
+# LC_FUNC_DEV_SET_RDONLY
+#
+# check for the old-style dev_set_rdonly which took an extra "devno" param
+# and can only set a single device to discard writes at one time
+#
+AC_DEFUN([LC_FUNC_DEV_SET_RDONLY],
+[AC_MSG_CHECKING([if kernel has old single-device dev_set_rdonly])
+HAVE_OLD_DSR="`grep -c -s 'dev_set_rdonly.*no_write' $LINUX/drivers/block/ll_rw_blk.c`"
+if test x$HAVE_OLD_DSR != "x1" ; then
+        HAVE_OLD_DSR="`grep -c -s 'dev_set_rdonly.*no_write' $LINUX/drivers/block/blkpg.c`"
+fi
+if test x$HAVE_OLD_DSR = "x1" ; then
+        AC_DEFINE(HAVE_OLD_DEV_SET_RDONLY, 1,
+                [kernel has old single-device dev_set_rdonly])
+        AC_MSG_RESULT(yes)
+else
+        AC_MSG_RESULT(no)
+fi
+])
+
+
 #
 # LC_CONFIG_BACKINGFS
 #
@@ -273,8 +307,11 @@ case $BACKINGFS in
                LC_FSHOOKS([
                        LDISKFS_SERIES="2.6-suse.series"
                ],[
-                       LDISKFS_SERIES="2.6-vanilla.series"
-               ])
+                       LDISKFS_SERIES="2.6-fc3.series"
+               ],[
+                       LDISKFS_SERIES="2.6-vanilla.series"             
+               ]
+               )
                AC_SUBST(LDISKFS_SERIES)
                ;;
 esac # $BACKINGFS
@@ -368,7 +405,9 @@ AC_MSG_RESULT([$enable_smfs])
 # Lustre linux kernel checks
 #
 AC_DEFUN([LC_PROG_LINUX],
-[LC_CONFIG_BACKINGFS
+[if test x$enable_server = xyes ; then
+       LC_CONFIG_BACKINGFS
+fi
 LC_CONFIG_PINGER
 LC_CONFIG_GSS
 LC_CONFIG_SNAPFS
@@ -381,9 +420,30 @@ LC_FUNC_PDE
 LC_FUNC_DIRECT_IO
 LC_HEADER_MM_INLINE
 LC_STRUCT_INODE
+LC_FUNC_DEV_SET_RDONLY
 ])
 
 #
+# LC_CONFIG_CLIENT_SERVER
+#
+# Build client/server sides of Lustre
+#
+AC_DEFUN([LC_CONFIG_CLIENT_SERVER],
+[AC_MSG_CHECKING([whether to build Lustre server support])
+AC_ARG_ENABLE([server],
+       AC_HELP_STRING([--disable-server],
+                       [disable Lustre server support]),
+       [],[enable_server='yes'])
+AC_MSG_RESULT([$enable_server])
+
+AC_MSG_CHECKING([whether to build Lustre client support])
+AC_ARG_ENABLE([client],
+       AC_HELP_STRING([--disable-client],
+                       [disable Lustre client support]),
+       [],[enable_client='yes'])
+AC_MSG_RESULT([$enable_client])])
+
+#
 # LC_CONFIG_LIBLUSTRE
 #
 # whether to build liblustre
@@ -445,6 +505,8 @@ AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
 AM_CONDITIONAL(LIBLUSTRE, test x$enable_liblustre = xyes)
 AM_CONDITIONAL(LIBLUSTRE_TESTS, test x$enable_liblustre_tests = xyes)
 AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
+AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
+AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
 ])
 
 #
@@ -466,6 +528,13 @@ lustre/doc/Makefile
 lustre/include/Makefile
 lustre/include/linux/Makefile
 lustre/include/lustre/Makefile
+lustre/kernel_patches/targets/2.6-fc3.target
+lustre/kernel_patches/targets/2.6-suse.target
+lustre/kernel_patches/targets/2.6-vanilla.target
+lustre/kernel_patches/targets/hp_pnnl-2.4.target
+lustre/kernel_patches/targets/rh-2.4.target
+lustre/kernel_patches/targets/rhel-2.4.target
+lustre/kernel_patches/targets/suse-2.4.21-2.target
 lustre/ldiskfs/Makefile
 lustre/ldiskfs/autoMakefile
 lustre/ldlm/Makefile