summaryrefslogtreecommitdiff
blob: 10d923b835b99d8db91f99aa076fef76869ab226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
libdevmapper.so doesn't link to SELinux libraries unless SELinux is enabled.
Adding those libraries to Libs.private unconditionally is wrong.

See bug 270350
---
--- LVM2.2.02.48/configure.in
+++ LVM2.2.02.48/configure.in
@@ -558,18 +558,19 @@
 	if test x$HAVE_SEPOL = xyes; then
 		AC_DEFINE([HAVE_SEPOL], 1,
 		  [Define to 1 if sepol_check_context is available.])
-		LIBS="-lsepol $LIBS"
+		SELINUX_LIBS="-lsepol $SELINUX_LIBS"
 	fi
 
 	AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
 
 	if test x$HAVE_SELINUX = xyes; then
 		AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
-		LIBS="-lselinux $LIBS"
+		SELINUX_LIBS="-lselinux $SELINUX_LIBS"
 	else
 		AC_MSG_WARN(Disabling selinux)
 	fi
 
+	LIBS="$SELINUX_LIBS $LIBS"
 	# With --enable-static_link and selinux enabled, linking
 	# fails on at least Debian unstable due to unsatisfied references
 	# to pthread_mutex_lock and _unlock.  See if we need -lpthread.
@@ -813,6 +814,7 @@
 AC_SUBST(POOL)
 AC_SUBST(QUORUM_CFLAGS)
 AC_SUBST(QUORUM_LIBS)
+AC_SUBST(SELINUX_LIBS)
 AC_SUBST(SNAPSHOTS)
 AC_SUBST(STATICDIR)
 AC_SUBST(STATIC_LINK)
--- LVM2.2.02.48/libdm/libdevmapper.pc.in
+++ LVM2.2.02.48/libdm/libdevmapper.pc.in
@@ -8,4 +8,4 @@
 Version: @DM_LIB_PATCHLEVEL@
 Cflags: -I${includedir} 
 Libs: -L${libdir} -ldevmapper
-Libs.private: -lselinux -lsepol
+Libs.private: @SELINUX_LIBS@