diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-06-12 22:10:27 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2014-06-16 14:53:09 +0200 |
commit | 6e90f2b479ed03f48e429bb7164fc7e9f402e1de (patch) | |
tree | 9bca226447acc21481d3167f37803c98ea02d052 | |
parent | 9123621450b4e16a3a5e3e2c94692d41c6b8e856 (diff) | |
download | util-linux-6e90f2b479ed03f48e429bb7164fc7e9f402e1de.tar.gz |
Only move shared libraries to /lib if they exists
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>
-rw-r--r-- | libblkid/src/Makemodule.am | 2 | ||||
-rw-r--r-- | libmount/src/Makemodule.am | 2 | ||||
-rw-r--r-- | libuuid/src/Makemodule.am | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/libblkid/src/Makemodule.am b/libblkid/src/Makemodule.am index 013877e60..d9f927655 100644 --- a/libblkid/src/Makemodule.am +++ b/libblkid/src/Makemodule.am @@ -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); \ diff --git a/libmount/src/Makemodule.am b/libmount/src/Makemodule.am index 9101811f5..54ab51d3e 100644 --- a/libmount/src/Makemodule.am +++ b/libmount/src/Makemodule.am @@ -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); \ diff --git a/libuuid/src/Makemodule.am b/libuuid/src/Makemodule.am index a20cb4ccb..a5fd561cf 100644 --- a/libuuid/src/Makemodule.am +++ b/libuuid/src/Makemodule.am @@ -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); \ |