diff options
-rw-r--r-- | configure.ac | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index 1879dd9780..c0789de29f 100644 --- a/configure.ac +++ b/configure.ac @@ -115,21 +115,15 @@ PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.3.2 ]) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) -have_selinux=no -AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support])) -if test "x$enable_selinux" != "xno"; then - # not using PKG_CHECK_MODULES as for some reason libselinux didn't - # install any pkg-config modules here - AC_SEARCH_LIBS([getcon], [selinux], - [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 +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]) fi -AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"]) +AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes) +AC_SUBST(SELINUX_CFLAGS) +AC_SUBST(SELINUX_LIBS) AC_ARG_ENABLE([tcpwrap], AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]), |