summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorKarel Zak2012-11-30 12:48:44 +0100
committerKarel Zak2012-11-30 12:48:44 +0100
commit7e34c79f01c76c383fb4f5d301e81540f9053851 (patch)
treec66b11b2170030a9d2d0574b1efa46eba6945602 /configure.ac
parentbuild-sys: add devel-non-docs compile profile (diff)
downloadkernel-qcow2-util-linux-7e34c79f01c76c383fb4f5d301e81540f9053851.tar.gz
kernel-qcow2-util-linux-7e34c79f01c76c383fb4f5d301e81540f9053851.tar.xz
kernel-qcow2-util-linux-7e34c79f01c76c383fb4f5d301e81540f9053851.zip
build-sys: use pkg-config for selinux
- we need libselinux 2.x (where is security_get_initial_context()) - the latest selinux versions are linked with -lpcre Reported-by: Gregory Nietsky <gregory@distrotech.co.za> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 8 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 727113a53..30fb5e2de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -543,21 +543,17 @@ AC_ARG_WITH([selinux],
if test "x$with_selinux" = xno; then
AM_CONDITIONAL(HAVE_SELINUX, false)
else
- UL_CHECK_LIB(selinux, getprevcon)
+ PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0],
+ [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
+ UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
+ AM_CONDITIONAL(HAVE_SELINUX, true)
+ have_selinux=yes],
+ [have_selinux=no])
+
case "$with_selinux:$have_selinux" in
- yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found]);;
+ yes:no) AC_MSG_ERROR([SELinux selected but libselinux not found or too old]);;
esac
fi
-
-if test "x$have_selinux" = xyes; then
- SELINUX_LIBS="-lselinux -lsepol"
- SELINUX_LIBS_STATIC="-lselinux -lsepol"
- old_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $SELINUX_LIBS"
- # This function is missing in old libselinux 1.xx versions
- AC_CHECK_FUNCS([security_get_initial_context])
- LDFLAGS="$old_LDFLAGS"
-fi
AC_SUBST([SELINUX_LIBS])
AC_SUBST([SELINUX_LIBS_STATIC])