From be6de3db9cace327b3d34870417c96c2ac705313 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Tue, 5 Feb 2019 23:09:45 +0900 Subject: [PATCH] LU-11914 build: add a configure check for l_getsepol 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 Change-Id: I31ddbc2f5300e9e38db9e00e2b7fbcac7f83d9e5 Reviewed-on: https://review.whamcloud.com/34183 Reviewed-by: Andreas Dilger Reviewed-by: Thomas Stibor Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 27 +++++++++++++++++++++++++++ lustre/utils/Makefile.am | 2 ++ 2 files changed, 29 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 999fb28..18440ef 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -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 + + 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 # diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am index 6ff6dc0..f7655b9 100644 --- a/lustre/utils/Makefile.am +++ b/lustre/utils/Makefile.am @@ -43,8 +43,10 @@ sbin_PROGRAMS += lhsmtool_posix endif if SELINUX +if GETSEPOL sbin_PROGRAMS += l_getsepol endif +endif lib_LIBRARIES = noinst_LIBRARIES = -- 1.8.3.1