[PATCH 3/3] devmapper - cleanup lists of linked libs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- trunk.orig/dmsetup/Makefile.in
+++ trunk/dmsetup/Makefile.in
@@ -18,7 +18,7 @@
 
 TARGETS = dmsetup
 INSTALL_TYPE = install_dynamic
-LIB_PTHREAD = @LIB_PTHREAD@
+LDFLAGS_STATIC = @LDFLAGS_SELINUX_STATIC@
 
 ifeq ("@STATIC_LINK@", "yes")
   TARGETS += dmsetup.static
@@ -32,12 +32,11 @@
 
 dmsetup: $(OBJECTS) $(interfacedir)/libdevmapper.$(LIB_SUFFIX)
 	$(CC) -o $@ $(OBJECTS) $(CFLAGS) $(LDFLAGS) \
-	      -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS)
+	      -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper
 
 dmsetup.static: $(OBJECTS) $(interfacedir)/libdevmapper.a
 	$(CC) -o $@ $(OBJECTS) $(CFLAGS) $(LDFLAGS) -static \
-	      -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LIBS) \
-	      $(LIB_PTHREAD)
+	      -L$(interfacedir) -L$(DESTDIR)/lib -ldevmapper $(LDFLAGS_STATIC)
 
 install: $(INSTALL_TYPE)
 
--- trunk.orig/configure.in
+++ trunk/configure.in
@@ -229,29 +229,18 @@
 
 	if test x$HAVE_SEPOL = xyes; then
 		AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
-		LIBS="-lsepol $LIBS"
+		LDFLAGS_SEPOL="-lsepol"
 	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 if selinux is available.])
-		LIBS="-lselinux $LIBS"
+		LDFLAGS_SELINUX="-lselinux"
+		LDFLAGS_SELINUX_STATIC="$LDFLAGS_SELINUX $LDFLAGS_SEPOL -lpthread"
 	else
 		AC_MSG_WARN(Disabling selinux)
 	fi
-
-	# With --enable-static_link and selinux enabled, linking dmsetup
-	# fails on at least Debian unstable due to unsatisfied references
-	# to pthread_mutex_lock and _unlock.  See if we need -lpthread.
-	if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
-		dm_saved_libs=$LIBS
-		LIBS="$LIBS -static"
-		AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
-		  [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
-				LIB_PTHREAD=-lpthread])
-		LIBS=$dm_saved_libs
-	fi
 fi
 
 ################################################################################
@@ -402,7 +390,8 @@
 AC_SUBST(STATIC_LINK)
 AC_SUBST(OWNER)
 AC_SUBST(GROUP)
-AC_SUBST(LIBS)
+AC_SUBST(LDFLAGS_SELINUX)
+AC_SUBST(LDFLAGS_SELINUX_STATIC)
 AC_SUBST(interface)
 AC_SUBST(kerneldir)
 AC_SUBST(missingkernel)
@@ -426,7 +416,6 @@
 AC_SUBST(DEVICE_MODE)
 AC_SUBST(DMEVENTD)
 AC_SUBST(PKGCONFIG)
-AC_SUBST([LIB_PTHREAD])
 
 ################################################################################
 dnl -- First and last lines should not contain files to generate in order to 
--- trunk.orig/dmeventd/Makefile.in
+++ trunk/dmeventd/Makefile.in
@@ -35,7 +35,7 @@
 
 dmeventd: $(LIB_SHARED) dmeventd.o
 	$(CC) -o $@ dmeventd.o $(CFLAGS) $(LDFLAGS) \
-	-L. -ldevmapper-event $(LIBS) -rdynamic
+	-L. -ldevmapper-event
 
 .PHONY: install_dynamic install_static install_include \
 	install_pkgconfig install_dmeventd
--- trunk.orig/lib/Makefile.in
+++ trunk/lib/Makefile.in
@@ -43,6 +43,8 @@
 endif
 VERSIONED_SHLIB = libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
 
+LDFLAGS += @LDFLAGS_SELINUX@
+
 DEFS += -DDEVICE_UID=@DEVICE_UID@ -DDEVICE_GID=@DEVICE_GID@ \
 	-DDEVICE_MODE=@DEVICE_MODE@
 
--- trunk.orig/make.tmpl.in
+++ trunk/make.tmpl.in
@@ -23,7 +23,6 @@
 INSTALL = @INSTALL@
 MSGFMT = @MSGFMT@
 LN_S = @LN_S@
-LIBS = @LIBS@
 DEFS += @DEFS@
 CFLAGS += @CFLAGS@
 CLDFLAGS += @CLDFLAGS@
@@ -75,7 +74,6 @@
 endif
 
 LDFLAGS += -L$(interfacedir)
-CLDFLAGS += -L$(interfacedir)
 
 ifeq ("@COMPAT@", "yes")
   DEFS += -DDM_COMPAT
@@ -89,7 +87,6 @@
 #DEFS += -DBOUNDS_CHECK
 
 #CFLAGS += -pg
-#LDFLAGS += -pg
 
 STRIP=
 #STRIP = -s
@@ -163,13 +160,13 @@
 ifeq ("@LIB_SUFFIX@","so")
 $(LIB_SHARED): $(OBJECTS) $(LDDEPS)
 	$(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \
-	$(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
+	$(CFLAGS) $(LDFLAGS) $(CLDFLAGS) $(OBJECTS) -o $@
 endif
 
 ifeq ("@LIB_SUFFIX@","dylib")
 $(LIB_SHARED): $(OBJECTS) $(LDDEPS)
 	$(CC) -dynamiclib -dylib_current_version,$(LIB_VERSION) \
-	$(CFLAGS) $(CLDFLAGS) $(OBJECTS) $(LIBS) -o $@
+	$(CFLAGS) $(LDFLAGS) $(CLDFLAGS) $(OBJECTS) -o $@
 endif
 
 $(LIB_STATIC): $(OBJECTS)
-- 
Respect is a rational process
		-- McCoy, "The Galileo Seven", stardate 2822.3

Attachment: signature.asc
Description: Digital signature

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux