diff options
author | Karel Zak | 2012-11-30 12:48:44 +0100 |
---|---|---|
committer | Karel Zak | 2012-11-30 12:48:44 +0100 |
commit | 7e34c79f01c76c383fb4f5d301e81540f9053851 (patch) | |
tree | c66b11b2170030a9d2d0574b1efa46eba6945602 | |
parent | build-sys: add devel-non-docs compile profile (diff) | |
download | kernel-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>
-rw-r--r-- | configure.ac | 20 |
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]) |