Whamcloud - gitweb
LU-11946 build: no zlib check during configure --enable-dist
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 029a2f5..db957d7 100644 (file)
@@ -123,6 +123,22 @@ AS_IF([test "x$enable_checksum" != xno],
 ]) # LC_CONFIG_CHECKSUM
 
 #
+# LC_CONFIG_FLOCK
+#
+# enable distributed flock by default
+#
+AC_DEFUN([LC_CONFIG_FLOCK], [
+AC_MSG_CHECKING([whether to enable flock by default])
+AC_ARG_ENABLE([flock],
+       AC_HELP_STRING([--disable-flock],
+               [disable flock by default]),
+       [], [enable_flock="yes"])
+AC_MSG_RESULT([$enable_flock])
+AS_IF([test "x$enable_flock" != xno],
+       [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])])
+]) # LC_CONFIG_FLOCK
+
+#
 # LC_CONFIG_HEALTH_CHECK_WRITE
 #
 # Turn off the actual write to the disk
@@ -340,6 +356,31 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 AC_MSG_RESULT([$enable_ssk])
 ]) # LC_OPENSSL_SSK
 
+# LC_OPENSSL_GETSEPOL
+#
+# OpenSSL is needed for l_getsepol
+AC_DEFUN([LC_OPENSSL_GETSEPOL], [
+AC_MSG_CHECKING([whether openssl-devel is present])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+       #include <openssl/evp.h>
+
+       int main(void) {
+               EVP_MD_CTX *mdctx = EVP_MD_CTX_create();
+       }
+])],[
+       AC_DEFINE(HAVE_OPENSSL_GETSEPOL, 1, [openssl-devel is present])
+       enable_getsepol="yes"
+
+],[
+       enable_getsepol="no"
+       AC_MSG_WARN([
+
+No openssk-devel headers found, unable to build l_getsepol and SELinux status checking
+])
+])
+AC_MSG_RESULT([$enable_getsepol])
+]) # LC_OPENSSL_GETSEPOL
+
 # LC_INODE_PERMISION_2ARGS
 #
 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
@@ -1456,6 +1497,21 @@ security_dentry_init_security, [
 ]) # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
 
 #
+# 3.10 exports security_inode_listsecurity
+#
+AC_DEFUN([LC_HAVE_SECURITY_INODE_LISTSECURITY], [
+LB_CHECK_COMPILE([if security_inode_listsecurity() is available/exported],
+security_inode_listsecurity, [
+       #include <linux/security.h>
+],[
+       security_inode_listsecurity(NULL, NULL, 0);
+],[
+       AC_DEFINE(HAVE_SECURITY_INODE_LISTSECURITY, 1,
+                 [security_inode_listsecurity() is available/exported])
+])
+]) # LC_HAVE_SECURITY_INODE_LISTSECURITY
+
+#
 # LC_INVALIDATE_RANGE
 #
 # 3.11 invalidatepage requires the length of the range to invalidate
@@ -2517,6 +2573,28 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_HAVE_XATTR_HANDLER_INODE_PARAM
 
 #
+# LC_D_IN_LOOKUP
+#
+# Kernel version 4.6 commit 85c7f81041d57cfe9dc97f4680d5586b54534a39
+# introduced parallel lookups in the VFS layer. The inline function
+# d_in_lookup was added to notify when the same item was being queried
+# at the same time.
+#
+AC_DEFUN([LC_D_IN_LOOKUP], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if 'd_in_lookup' is defined],
+d_in_lookup, [
+       #include <linux/dcache.h>
+],[
+       d_in_lookup(NULL);
+],[
+       AC_DEFINE(HAVE_D_IN_LOOKUP, 1, [d_in_lookup is defined])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_D_IN_LOOKUP
+
+#
 # LC_DIRECTIO_2ARGS
 #
 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
@@ -2980,6 +3058,26 @@ bi_bdev, [
 ]) # LC_BI_BDEV
 
 #
+# LC_I_PAGES
+#
+# kernel 4.17 commit b93b016313b3ba8003c3b8bb71f569af91f19fc7
+#
+AC_DEFUN([LC_I_PAGES], [
+LB_CHECK_COMPILE([if struct address_space has i_pages],
+i_pages, [
+       #include <linux/fs.h>
+],[
+       struct address_space mapping = {};
+       void *i_pages;
+
+       i_pages = &mapping.i_pages;
+],[
+       AC_DEFINE(HAVE_I_PAGES, 1,
+               [struct address_space has i_pages])
+])
+]) # LC_I_PAGES
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -2990,12 +3088,14 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        LC_CONFIG_PINGER
        LC_CONFIG_CHECKSUM
+       LC_CONFIG_FLOCK
        LC_CONFIG_HEALTH_CHECK_WRITE
        LC_CONFIG_LRU_RESIZE
 
        LC_GLIBC_SUPPORT_FHANDLES
        LC_CONFIG_GSS
        LC_OPENSSL_SSK
+       LC_OPENSSL_GETSEPOL
 
        # 2.6.32
        LC_BLK_QUEUE_MAX_SEGMENTS
@@ -3092,6 +3192,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_HAVE_PROC_REMOVE
        LC_HAVE_PROJECT_QUOTA
        LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
+       LC_HAVE_SECURITY_INODE_LISTSECURITY
 
        # 3.11
        LC_INVALIDATE_RANGE
@@ -3182,6 +3283,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_HAVE_XATTR_HANDLER_INODE_PARAM
 
        # 4.7
+       LC_D_IN_LOOKUP
        LC_DIRECTIO_2ARGS
        LC_GENERIC_WRITE_SYNC_2ARGS
        LC_FOPS_ITERATE_SHARED
@@ -3220,6 +3322,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_PAGEVEC_INIT_ONE_PARAM
        LC_BI_BDEV
 
+       # 4.17
+       LC_I_PAGES
+
        # kernel patch to extend integrity interface
        LC_BIO_INTEGRITY_PREP_FN
 
@@ -3392,12 +3497,14 @@ AC_CHECK_HEADERS([blkid/blkid.h])
 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
 
 # lustre/utils/lfs.c
-AC_CHECK_LIB([z], [crc32], [
-            AC_CHECK_HEADER([zlib.h], [], [
-                            AC_MSG_ERROR([zlib.h not found.])])
-            ], [
-            AC_MSG_ERROR([
-zlib library not found. Please install zlib development package.])
+AS_IF([test "$enable_dist" = "no"], [
+               AC_CHECK_LIB([z], [crc32], [
+                                AC_CHECK_HEADER([zlib.h], [], [
+                                                AC_MSG_ERROR([zlib.h not found.])])
+                                ], [
+                                AC_MSG_ERROR([
+               zlib library not found. Please install zlib development package.])
+               ])
 ])
 
 SELINUX=""
@@ -3506,6 +3613,7 @@ AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
 AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
+AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
 ]) # LC_CONDITIONALS
 
 #
@@ -3542,6 +3650,7 @@ lustre/kernel_patches/targets/3.0-sles11sp4.target
 lustre/kernel_patches/targets/3.12-sles12.target
 lustre/kernel_patches/targets/4.4-sles12.target
 lustre/kernel_patches/targets/4.4-sles12sp3.target
+lustre/kernel_patches/targets/4.12-sles12sp4.target
 lustre/kernel_patches/targets/2.6-fc11.target
 lustre/kernel_patches/targets/2.6-fc12.target
 lustre/kernel_patches/targets/2.6-fc15.target