summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-02-08 11:44:38 +0100
committerLennart Poettering <lennart@poettering.net>2011-02-08 11:46:18 +0100
commit591622d7efbc828f00f190d91b6608148b967ff5 (patch)
tree12fffb27ff43d79ce8fc9e2b4f0b23cfa1365486
parent990d8b885badec2e0398b5f69457af2c7c84e518 (diff)
build-sys: ensure selinux configure check follows logic of other optional features
-rw-r--r--configure.ac21
1 files changed, 12 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index c0789de29f..08f36469a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,15 +115,18 @@ PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.3.2 ])
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
-PKG_CHECK_MODULES(SELINUX, libselinux,
- have_selinux=yes,
- have_selinux=no)
-if test "x$have_selinux" = "xyes" ; then
- AC_DEFINE(HAVE_SELINUX, [], [Define if SELINUX is available])
+have_selinux=no
+AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
+if test "x$enable_selinux" != "xno"; then
+ PKG_CHECK_MODULES(SELINUX, [ libselinux ],
+ [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
+ AC_SUBST(SELINUX_CFLAGS)
+ AC_SUBST(SELINUX_LIBS)
+ if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
+ AC_MSG_ERROR([*** SELinux support requested but libraries not found])
+ fi
fi
-AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
-AC_SUBST(SELINUX_CFLAGS)
-AC_SUBST(SELINUX_LIBS)
+AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
AC_ARG_ENABLE([tcpwrap],
AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
@@ -230,7 +233,7 @@ if test "x$enable_libcryptsetup" != "xno"; then
AC_SUBST(LIBCRYPTSETUP_CFLAGS)
AC_SUBST(LIBCRYPTSETUP_LIBS)
if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
- AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
+ AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
fi
fi
AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])