summaryrefslogtreecommitdiff
path: root/m4/dpkg-libs.m4
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-09-13 03:40:51 +0200
committerGuillem Jover <guillem@debian.org>2016-10-29 16:02:50 +0200
commita65b903c5b4303f85573df0f511151afc5c375fa (patch)
tree4b1a654ae0eccba786bab6a17c1b883318a7b0a7 /m4/dpkg-libs.m4
parent4ccdc11f30a1a5a87f0172449ffce546275c6dc5 (diff)
downloaddpkg-a65b903c5b4303f85573df0f511151afc5c375fa.tar.gz
build: Fix and update libselinux check
Require libselinux 2.0.99, which introduced the selinux_status_* API. Switch to use the pkg-config file unconditionally, introduced in libselinux 2.0.89. Remove the static linking support. Perform refinement checks only if libselinux is available.
Diffstat (limited to 'm4/dpkg-libs.m4')
-rw-r--r--m4/dpkg-libs.m438
1 files changed, 12 insertions, 26 deletions
diff --git a/m4/dpkg-libs.m4 b/m4/dpkg-libs.m4
index ce39717ce..50519d679 100644
--- a/m4/dpkg-libs.m4
+++ b/m4/dpkg-libs.m4
@@ -97,42 +97,28 @@ AC_DEFUN([DPKG_LIB_SELINUX], [
[AS_HELP_STRING([--with-libselinux],
[use selinux library to set security contexts])],
[], [with_libselinux=check])
+ SELINUX_MIN_VERSION=2.0.99
have_libselinux="no"
AS_IF([test "x$with_libselinux" != "xno"], [
- AC_CHECK_LIB([selinux], [is_selinux_enabled], [
- AC_DEFINE([WITH_LIBSELINUX], [1],
- [Define to 1 to compile in SELinux support])
- PKG_CHECK_EXISTS([libselinux], [
- AS_IF([test "x$with_libselinux" = "xstatic"], [
- dpkg_selinux_libs="-Wl,-Bstatic "$($PKG_CONFIG --static --libs libselinux)" -Wl,-Bdynamic"
- ], [
- dpkg_selinux_libs=$($PKG_CONFIG --libs libselinux)
- ])
+ PKG_CHECK_MODULES([SELINUX], [libselinux >= $SELINUX_MIN_VERSION], [
+ AC_CHECK_HEADER([selinux/selinux.h], [
+ AC_DEFINE([WITH_LIBSELINUX], [1],
+ [Define to 1 to compile in SELinux support])
+ have_libselinux="yes"
], [
- AS_IF([test "x$with_libselinux" = "xstatic"], [
- dpkg_selinux_libs="-Wl,-Bstatic -lselinux -lsepol -Wl,-Bdynamic"
- ], [
- dpkg_selinux_libs="-lselinux"
- ])
- ])
- SELINUX_LIBS="${SELINUX_LIBS:+$SELINUX_LIBS }$dpkg_selinux_libs"
-
- AC_CHECK_HEADER([selinux/selinux.h], [], [
AS_IF([test "x$with_libselinux" != "xcheck"], [
- AC_MSG_FAILURE([selinux header not found])
+ AC_MSG_FAILURE([libselinux header not found])
])
])
-
- have_libselinux="yes"
+ AC_CHECK_LIB([selinux], [setexecfilecon], [
+ AC_DEFINE([HAVE_SETEXECFILECON], [1],
+ [Define to 1 if SELinux setexecfilecon is present])
+ ])
], [
AS_IF([test "x$with_libselinux" != "xcheck"], [
- AC_MSG_FAILURE([selinux library not found])
+ AC_MSG_FAILURE([libselinux at least $SELINUX_MIN_VERSION not found])
])
])
- AC_CHECK_LIB([selinux], [setexecfilecon], [
- AC_DEFINE([HAVE_SETEXECFILECON], [1],
- [Define to 1 if SELinux setexecfilecon is present])
- ])
])
AM_CONDITIONAL([WITH_LIBSELINUX], [test "x$have_libselinux" = "xyes"])
AM_CONDITIONAL([HAVE_SETEXECFILECON],