Whamcloud - gitweb
LU-11914 build: add a configure check for l_getsepol 83/34183/5
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 5 Feb 2019 14:09:45 +0000 (23:09 +0900)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 Feb 2019 02:02:45 +0000 (02:02 +0000)
l_getsepol requires openssl-devel, so add a configure check for
openssl/evp.h header and EVP_MD_CTX_create function, and disable
building l_getsepol in case they are missing.

Test-Parameters: trivial
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I31ddbc2f5300e9e38db9e00e2b7fbcac7f83d9e5
Reviewed-on: https://review.whamcloud.com/34183
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Thomas Stibor <t.stibor@gsi.de>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/utils/Makefile.am

index 999fb28..18440ef 100644 (file)
@@ -356,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)
@@ -3035,6 +3060,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_GLIBC_SUPPORT_FHANDLES
        LC_CONFIG_GSS
        LC_OPENSSL_SSK
+       LC_OPENSSL_GETSEPOL
 
        # 2.6.32
        LC_BLK_QUEUE_MAX_SEGMENTS
@@ -3546,6 +3572,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
 
 #
index 6ff6dc0..f7655b9 100644 (file)
@@ -43,8 +43,10 @@ sbin_PROGRAMS += lhsmtool_posix
 endif
 
 if SELINUX
+if GETSEPOL
 sbin_PROGRAMS += l_getsepol
 endif
+endif
 
 lib_LIBRARIES =
 noinst_LIBRARIES =