]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Only move shared libraries to /lib if they exists
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 12 Jun 2014 20:10:27 +0000 (22:10 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Jun 2014 12:53:09 +0000 (14:53 +0200)
In several Makemodule.am, there is a install-exec-hook-<library>
target whose role is to move the shared library from /usr/lib to /lib,
while keeping a symbolic link /usr/lib/libuuid.so ->
../../lib/<library>.so.<version>.

However, when util-linux is built with --enable-static
--disable-shared (as is needed on noMMU platforms that don't support
shared libraries), no <library>.so is built, but the
install-exec-hook-libuuid creates an invalid /usr/lib/<library>.so
symbolic link, pointing to ../../lib (yes, the directory). This causes
troubles later one when other libraries/programs are compiled with
-l<library>, as gcc thinks a shared library is available because
there's a file named /usr/lib/<library>.so.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
libblkid/src/Makemodule.am
libmount/src/Makemodule.am
libuuid/src/Makemodule.am

index 013877e609e493c38799f13d2de4084415f3205f..d9f927655c8348e8914c5fb78c181882ad7fafe4 100644 (file)
@@ -220,7 +220,7 @@ endif # BUILD_LIBBLKID_TESTS
 
 # move lib from $(usrlib_execdir) to $(libdir) if needed
 install-exec-hook-libblkid:
-       if test "$(usrlib_execdir)" != "$(libdir)"; then \
+       if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libblkid.so"; then \
                mkdir -p $(DESTDIR)$(libdir); \
                mv $(DESTDIR)$(usrlib_execdir)/libblkid.so.* $(DESTDIR)$(libdir); \
                so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libblkid.so); \
index 9101811f5ba942b7ca519a91524049988f7c6622..54ab51d3e6d62cc74ba66922019ddb04a9a8107b 100644 (file)
@@ -123,7 +123,7 @@ endif # BUILD_LIBMOUNT_TESTS
 
 # move lib from $(usrlib_execdir) to $(libdir) if needed
 install-exec-hook-libmount:
-       if test "$(usrlib_execdir)" != "$(libdir)"; then \
+       if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libmount.so"; then \
                mkdir -p $(DESTDIR)$(libdir); \
                mv $(DESTDIR)$(usrlib_execdir)/libmount.so.* $(DESTDIR)$(libdir); \
                so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libmount.so); \
index a20cb4ccb6f15757927706e23e2426677078a2f1..a5fd561cf2fc957f781ec11ea53a183a20514476 100644 (file)
@@ -44,7 +44,7 @@ EXTRA_DIST += libuuid/src/uuid.sym
 
 # move lib from $(usrlib_execdir) to $(libdir) if needed
 install-exec-hook-libuuid:
-       if test "$(usrlib_execdir)" != "$(libdir)"; then \
+       if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libuuid.so"; then \
                mkdir -p $(DESTDIR)$(libdir); \
                mv $(DESTDIR)$(usrlib_execdir)/libuuid.so.* $(DESTDIR)$(libdir); \
                so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libuuid.so); \