summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-08-10 03:37:06 +0200
committerGuillem Jover <guillem@debian.org>2014-08-15 03:41:58 +0200
commit464ebf59ed3b91684e01255c4070f3eb7ea63af9 (patch)
treea018b128990cad8a03f126c3161a996817d1784a
parent1878855c4a3eaa5a544c81e24b5a990d6139ff7b (diff)
downloaddpkg-464ebf59ed3b91684e01255c4070f3eb7ea63af9.tar.gz
libcompat: Only build the compatibility selinux code if requested
If we are not using libselinux, then we cannot build the selinux compatibility code as it requires the library. Also fixes build failures on non-Linux systems, where the library is not available. Closes: #757637
-rw-r--r--debian/changelog5
-rw-r--r--lib/compat/Makefile.am7
-rw-r--r--m4/dpkg-libs.m45
3 files changed, 14 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index 2b7551048..0359f7110 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,10 @@
dpkg (1.17.12) UNRELEASED; urgency=low
+ [ Guillem Jover ]
+ * Only build the compatibility selinux code if libselinux is available or
+ the user requested it. Also fixes build failures on non-Linux systems.
+ Closes: #757637
+
[ Updated programs translations ]
* German (Sven Joachim).
diff --git a/lib/compat/Makefile.am b/lib/compat/Makefile.am
index 72c50b23b..b1c19e11d 100644
--- a/lib/compat/Makefile.am
+++ b/lib/compat/Makefile.am
@@ -10,7 +10,6 @@ noinst_LTLIBRARIES = libcompat-test.la libcompat.la
libcompat_test_la_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_LIBCOMPAT=1
libcompat_test_la_SOURCES = \
compat.h \
- selinux.c \
strnlen.c \
strndup.c \
strerror.c \
@@ -21,6 +20,10 @@ libcompat_test_la_SOURCES = \
scandir.c \
unsetenv.c
+if WITH_SELINUX
+libcompat_test_la_SOURCES += selinux.c
+endif
+
libcompat_la_SOURCES = \
empty.c \
compat.h \
@@ -57,9 +60,11 @@ if !HAVE_STRSIGNAL
libcompat_la_SOURCES += strsignal.c
endif
+if WITH_SELINUX
if !HAVE_SETEXECFILECON
libcompat_la_SOURCES += selinux.c
endif
+endif
if !HAVE_C99_SNPRINTF
libcompat_la_SOURCES += snprintf.c vsnprintf.c
diff --git a/m4/dpkg-libs.m4 b/m4/dpkg-libs.m4
index 156da2f0b..5c45b0f0b 100644
--- a/m4/dpkg-libs.m4
+++ b/m4/dpkg-libs.m4
@@ -92,14 +92,15 @@ if test "x$with_selinux" != "xno"; then
[AC_DEFINE([HAVE_SETEXECFILECON], [1],
[Define to 1 if SELinux setexecfilecon is present])
])
- AM_CONDITIONAL(HAVE_SETEXECFILECON,
- [test "x$ac_cv_lib_selinux_setexecfilecon" = "xyes"])
AC_CHECK_HEADER([selinux/selinux.h],,
[if test -n "$with_selinux"; then
AC_MSG_FAILURE([selinux header not found])
fi])
fi
+AM_CONDITIONAL(WITH_SELINUX, [test "x$with_selinux" = "xyes"])
+AM_CONDITIONAL(HAVE_SETEXECFILECON,
+ [test "x$ac_cv_lib_selinux_setexecfilecon" = "xyes"])
])# DPKG_LIB_SELINUX
# _DPKG_CHECK_LIB_CURSES_NARROW