Whamcloud - gitweb
b=5786
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 28a2b2d..30960c2 100644 (file)
@@ -226,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
 #
@@ -382,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
@@ -395,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
@@ -459,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)
 ])
 
 #