summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
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])