Whamcloud - gitweb
LU-15967 build: configure script does not check for required build tools
[fs/lustre-release.git] / config / lustre-build.m4
index f2007de..fdae513 100644 (file)
@@ -148,13 +148,15 @@ AC_MSG_CHECKING([whether to build Linux kernel modules])
 AC_ARG_ENABLE([modules],
        AC_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
@@ -344,8 +346,10 @@ AS_IF([test $target_cpu = powerpc64], [
        CC="$CC -m64"
 ])
 
-# UAPI headers, libcfs/include for util headers, lustre/include for liblustreapi and friends
-CPPFLAGS="-I$PWD/libcfs/include -I$PWD/lnet/utils/ -I$PWD/lnet/include/uapi -I$PWD/lustre/include -I$PWD/lustre/include/uapi $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)
@@ -626,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
@@ -667,6 +684,8 @@ AS_IF([test "x$enable_utils" = xyes], [
        LC_GLIBC_SUPPORT_COPY_FILE_RANGE
        LC_OPENSSL_SSK
        LC_OPENSSL_GETSEPOL
+       LC_FID2PATH_ANON_UNION
+       LC_IOC_REMOVE_ENTRY
 ])
 AS_IF([test "x$enable_tests" = xyes], [
        LC_HAVE_LIBAIO
@@ -702,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