From 0bbd84e31ec8bbe8d1e28e981c577fd56c8b8664 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 11 May 2019 00:27:06 +0200 Subject: Add SELinux labeling to fstree code Use libselinux to lookup the context attributes from a file. Signed-off-by: David Oberhollenzer --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b138c6f..5b98b7b 100644 --- a/configure.ac +++ b/configure.ac @@ -81,17 +81,29 @@ AC_ARG_WITH([lz4], esac], [AM_CONDITIONAL([WITH_LZ4], [true])]) +AC_ARG_WITH([selinux], + [AS_HELP_STRING([--without-selinux], + [Build without SELinux label file support])], + [case "${withval}" in + yes) AM_CONDITIONAL([WITH_SELINUX], [true]) ;; + no) AM_CONDITIONAL([WITH_SELINUX], [false]) ;; + *) AC_MSG_ERROR([bad value ${withval} for --without-selinux]) ;; + esac], + [AM_CONDITIONAL([WITH_SELINUX], [true])]) + ##### search for dependencies ##### need_zlib="no" need_xz="no" need_lzo="no" need_lz4="no" +need_selinux="no" AM_COND_IF([WITH_GZIP], [need_zlib="yes"]) AM_COND_IF([WITH_XZ], [need_xz="yes"]) AM_COND_IF([WITH_LZO], [need_lzo="yes"]) AM_COND_IF([WITH_LZ4], [need_lz4="yes"]) +AM_COND_IF([WITH_SELINUX], [need_selinux="yes"]) if test "x$need_zlib" = "xyes"; then PKG_CHECK_MODULES(ZLIB, [zlib], [], [AC_MSG_ERROR([cannot find zlib])]) @@ -117,6 +129,16 @@ if test "x$need_lz4" = "xyes"; then [AC_MSG_ERROR([cannot lz4 library])]) fi +if test "x$need_selinux" = "xyes"; then + PKG_CHECK_MODULES(LIBSELINUX, [libselinux], [], + [AC_MSG_ERROR([cannot find libselinux])]) + + AC_CHECK_HEADERS([selinux/selinux.h], [], + [AC_MSG_ERROR([cannot find SELinux system headers])]) + AC_CHECK_HEADERS([selinux/label.h], [], + [AC_MSG_ERROR([cannot find SELinux system headers])]) +fi + ##### generate output ##### AC_CONFIG_HEADERS([config.h]) -- cgit v1.2.3