diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-11 00:27:06 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-19 14:27:34 +0200 |
commit | 0bbd84e31ec8bbe8d1e28e981c577fd56c8b8664 (patch) | |
tree | 67fa887d11c60c126ab04e66f4f970e2dfb66dc0 /configure.ac | |
parent | 7097dda129654a5e054c1d64e72bfd189b4964b2 (diff) |
Add SELinux labeling to fstree code
Use libselinux to lookup the context attributes from a file.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 22 insertions, 0 deletions
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]) |