Whamcloud - gitweb
LU-15652 build: On Debian detect -common kernel headers
[fs/lustre-release.git] / config / lustre-build.m4
index 81e7644..7a764fc 100644 (file)
@@ -49,7 +49,7 @@ AC_DEFUN([LB_ARG_LIBS_INCLUDES], [
 lb_pathvar="m4_bpatsubst([$2], -, _)"
 AC_MSG_CHECKING([for $1])
 AC_ARG_WITH([$2],
-       AC_HELP_STRING([--with-$2=path],
+       AS_HELP_STRING([--with-$2=path],
                [path to $1]),
        [], [withval=$4])
 AS_IF([test "x$withval" = xyes],
@@ -60,7 +60,7 @@ AC_MSG_RESULT([${!lb_pathvar:-no}])
 AS_IF([test "x${!lb_pathvar}" != x -a "x${!lb_pathvar}" != xno], [
        AC_MSG_CHECKING([for $1 includes])
        AC_ARG_WITH([$2-includes],
-               AC_HELP_STRING([--with-$2-includes=path],
+               AS_HELP_STRING([--with-$2-includes=path],
                        [path to $1 includes]),
                [], [withval="yes"])
 
@@ -72,7 +72,7 @@ AS_IF([test "x${!lb_pathvar}" != x -a "x${!lb_pathvar}" != xno], [
 
        AC_MSG_CHECKING([for $1 libs])
        AC_ARG_WITH([$2-libs],
-               AC_HELP_STRING([--with-$2-libs=path],
+               AS_HELP_STRING([--with-$2-libs=path],
                        [path to $1 libs]),
                [], [withval="yes"])
 
@@ -92,7 +92,7 @@ AS_IF([test "x${!lb_pathvar}" != x -a "x${!lb_pathvar}" != xno], [
 AC_DEFUN([LB_PATH_LUSTREIOKIT], [
 AC_MSG_CHECKING([whether to build iokit])
 AC_ARG_ENABLE([iokit],
-       AC_HELP_STRING([--disable-iokit],
+       AS_HELP_STRING([--disable-iokit],
                [disable iokit (default is enable)]),
        [], [enable_iokit="yes"])
 AC_MSG_RESULT([$enable_iokit])
@@ -146,15 +146,17 @@ AC_SUBST(SNMP_SUBDIR)
 AC_DEFUN([LB_CONFIG_MODULES], [
 AC_MSG_CHECKING([whether to build Linux kernel modules])
 AC_ARG_ENABLE([modules],
-       AC_HELP_STRING([--disable-modules],
+       AS_HELP_STRING([--disable-modules],
                [disable building of Lustre kernel modules]),
-       [], [
+       [ AC_DEFINE(HAVE_NATIVE_LINUX_CLIENT, 1, [support native Linux client])], [
                LC_TARGET_SUPPORTED([enable_modules="yes"],
                                    [enable_modules="no"])
        ])
 AC_MSG_RESULT([$enable_modules ($target_os)])
 
 AS_IF([test "x$enable_modules" = xyes], [
+       AS_IF([test "x$FLEX" = "x"], [AC_MSG_ERROR([flex package is required to build kernel modules])])
+       AS_IF([test "x$BISON" = "x"], [AC_MSG_ERROR([bison package is required to build kernel modules])])
        AS_CASE([$target_os],
                [linux*], [
                        # Run serial tests
@@ -193,7 +195,7 @@ AS_IF([test "x$enable_modules" = xyes], [
 AC_DEFUN([LB_CONFIG_UTILS], [
 AC_MSG_CHECKING([whether to build Lustre utilities])
 AC_ARG_ENABLE([utils],
-       AC_HELP_STRING([--disable-utils],
+       AS_HELP_STRING([--disable-utils],
                [disable building of Lustre utility programs]),
        [], [enable_utils="yes"])
 AC_MSG_RESULT([$enable_utils])
@@ -207,7 +209,7 @@ AC_MSG_RESULT([$enable_utils])
 AC_DEFUN([LB_CONFIG_TESTS], [
 AC_MSG_CHECKING([whether to build Lustre tests])
 AC_ARG_ENABLE([tests],
-       AC_HELP_STRING([--disable-tests],
+       AS_HELP_STRING([--disable-tests],
                [disable building of Lustre tests]),
        [], [enable_tests="yes"])
 
@@ -236,7 +238,7 @@ AC_MSG_RESULT([$enable_tests])
 AC_DEFUN([LB_CONFIG_DIST], [
 AC_MSG_CHECKING([whether to configure just enough for make dist])
 AC_ARG_ENABLE([dist],
-       AC_HELP_STRING([--enable-dist],
+       AS_HELP_STRING([--enable-dist],
                        [only configure enough for make dist]),
        [], [enable_dist="no"])
 AC_MSG_RESULT([$enable_dist])
@@ -256,7 +258,7 @@ AS_IF([test "x$enable_dist" != xno], [
 AC_DEFUN([LB_CONFIG_DOCS], [
 AC_MSG_CHECKING([whether to build Lustre docs])
 AC_ARG_ENABLE([doc],
-       AC_HELP_STRING([--disable-doc],
+       AS_HELP_STRING([--disable-doc],
                        [skip creation of pdf documentation]),
        [], [enable_doc="no"])
 AC_MSG_RESULT([$enable_doc])
@@ -273,7 +275,7 @@ AC_SUBST(ENABLE_DOC)
 AC_DEFUN([LB_CONFIG_MANPAGES], [
 AC_MSG_CHECKING([whether to build Lustre manpages])
 AC_ARG_ENABLE([manpages],
-       AC_HELP_STRING([--disable-manpages],
+       AS_HELP_STRING([--disable-manpages],
                        [skip creation and inclusion of man pages (default is enable)]),
        [], [enable_manpages="yes"])
 AC_MSG_RESULT([$enable_manpages])
@@ -344,8 +346,10 @@ AS_IF([test $target_cpu = powerpc64], [
        CC="$CC -m64"
 ])
 
-# libcfs/include for util headers, lnetconfig headers, lustre/include for liblustreapi and friends
-CPPFLAGS="-I$PWD/libcfs/include -I$PWD/lnet/utils -I$PWD/lustre/include $CPPFLAGS"
+# libcfs/include for util headers, lustre/include for liblustreapi and friends
+# UAPI headers from OpenSFS are included if modules support is enabled, otherwise
+# it will use the native kernel implementation.
+CPPFLAGS="-I$PWD/libcfs/include -I$PWD/lnet/utils/ -I$PWD/lustre/include $CPPFLAGS"
 
 CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE"
 AC_SUBST(CCASFLAGS)
@@ -386,7 +390,7 @@ AC_DEFUN([LB_CC_NO_STRINGOP_TRUNCATION], [
        AC_MSG_CHECKING([for -Wno-stringop-truncation support])
 
        saved_flags="$CFLAGS"
-       CFLAGS="$CFLAGS -Wno-stringop-truncation"
+       CFLAGS="$CFLAGS -Werror -Wno-stringop-truncation"
 
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
                EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Wno-stringop-truncation"
@@ -460,6 +464,7 @@ AC_DEFUN([LB_CONFIG_FILES], [
                AC_PACKAGE_TARNAME[-dkms.spec]
                ldiskfs/Makefile
                ldiskfs/autoMakefile
+               lustre/utils/lustre.pc
                lustre-iokit/Makefile
                lustre-iokit/obdfilter-survey/Makefile
                lustre-iokit/ost-survey/Makefile
@@ -475,7 +480,7 @@ AC_DEFUN([LB_CONFIG_FILES], [
 #
 AC_DEFUN([LB_CONFIG_SERVERS], [
 AC_ARG_ENABLE([server],
-       AC_HELP_STRING([--disable-server],
+       AS_HELP_STRING([--disable-server],
                        [disable Lustre server support]), [
                AS_IF([test x$enable_server != xyes -a x$enable_server != xno],
                        [AC_MSG_ERROR([server valid options are "yes" or "no"])])
@@ -625,6 +630,19 @@ AC_SUBST(RPMBUILD_BINARY_ARGS)
 ]) # LB_CONFIG_RPMBUILD_OPTIONS
 
 #
+# LB_CONFIG_CACHE_OPTIONS
+#
+# Propagate config cache option
+#
+AC_DEFUN([LB_CONFIG_CACHE_OPTIONS], [
+CONFIG_CACHE_FILE=
+if test -f "$cache_file"; then
+       CONFIG_CACHE_FILE=$(readlink --canonicalize "$cache_file")
+fi
+AC_SUBST(CONFIG_CACHE_FILE)
+]) # LB_CONFIG_CACHE_OPTIONS
+
+#
 # LB_CONFIGURE
 #
 # main configure steps
@@ -658,10 +676,22 @@ LC_CONFIG_CLIENT
 LB_CONFIG_MPITESTS
 LB_CONFIG_SERVERS
 LC_CONFIG_CRYPTO
+LC_GLIBC_SUPPORT_COPY_FILE_RANGE
 
 # Tests depends from utils (multiop from liblustreapi)
 AS_IF([test "x$enable_utils" = xno], [enable_tests="no"])
 
+AS_IF([test "x$enable_utils" = xyes], [
+       LC_OPENSSL_SSK
+       LC_OPENSSL_GETSEPOL
+       LC_FID2PATH_ANON_UNION
+       LC_IOC_REMOVE_ENTRY
+])
+AS_IF([test "x$enable_tests" = xyes], [
+       LC_HAVE_LIBAIO
+       LC_GLIBC_SUPPORT_FHANDLES
+])
+
 LIBCFS_CONFIG_CDEBUG
 LC_QUOTA
 
@@ -691,6 +721,12 @@ MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.* Modules.symver
 AC_SUBST(MOSTLYCLEANFILES)
 
 LB_CONFIG_RPMBUILD_OPTIONS
+LB_CONFIG_CACHE_OPTIONS
+
+AS_IF([test -d $TEST_DIR], [
+       AC_MSG_NOTICE([remove temporary parallel configure dir $TEST_DIR])
+       rm -rf $TEST_DIR
+])
 
 AC_OUTPUT