]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: reverse shlibs installation
authorKay Sievers <kay.sievers@vrfy.org>
Fri, 3 Jul 2009 21:18:36 +0000 (23:18 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 3 Jul 2009 22:16:10 +0000 (00:16 +0200)
[kzak@redhat.com:

Unfortunately, libtool does not provide a way how to install real
libraries to /lib and devel libs (symlinks) to /usr/lib. We have
to use install hooks to move these files.

Currently we install to /lib and move devel files to /usr/lib. This
concept is wrong, because the libdir= in .la libtool files must to
match with the place where we install the devel .so libs. It means we
have to install everything to /usr/lib and then move (by install hook)
the real .so libs to /lib.

This change is necessary to fix "make install", otherwise the install
process will not work in clean change root. ]

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/Makefile.am
shlibs/uuid/src/Makefile.am

index 8b1f46be7ba3698119ff54274891ccd030fbe3ad..2771f3e81588de928d28d65a57d13189c9ebc394 100644 (file)
@@ -21,7 +21,7 @@ AM_CPPFLAGS += -I$(ul_libblkid_srcdir) $(common_cflags)
 blkidincdir = $(includedir)/blkid
 blkidinc_HEADERS = blkid.h
 
-lib_LTLIBRARIES = libblkid.la
+usrlibexec_LTLIBRARIES = libblkid.la
 libblkid_la_SOURCES = cache.c dev.c devname.c devno.c getsize.c llseek.c  \
                     probe.c read.c resolve.c save.c tag.c version.c verify.c \
                     encode.c blkid.h list.h blkidP.h probers/probers.h \
@@ -49,19 +49,15 @@ test_%: %.c
        $(COMPILE) -DTEST_PROGRAM $< .libs/libblkid.a -o $@ $(common_ldadd)
 
 
-# move devel files from $(libdir) to $(usrlibexecdir) if needed
+# move lib from $(usrlibexecdir) to $(libdir) if needed
 install-data-hook:
-       rm  $(DESTDIR)$(libdir)/$(lib_LTLIBRARIES)
        if test "$(usrlibexecdir)" != "$(libdir)"; then \
-               mkdir -p $(DESTDIR)$(usrlibexecdir); \
-               mv $(DESTDIR)$(libdir)/libblkid.a $(DESTDIR)$(usrlibexecdir)/; \
-               so_img_name=$$(readlink $(DESTDIR)$(libdir)/libblkid.so); \
-               rm $(DESTDIR)$(libdir)/libblkid.so; \
+               mkdir -p $(DESTDIR)$(libdir); \
+               mv $(DESTDIR)$(usrlibexecdir)/libblkid.so.* $(DESTDIR)$(libdir); \
+               so_img_name=$$(readlink $(DESTDIR)$(usrlibexecdir)/libblkid.so); \
                so_img_rel_target=$$(echo $(usrlibexecdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
-               ln -sf  $$so_img_rel_target$(libdir)/$$so_img_name \
-                       $(DESTDIR)$(usrlibexecdir)/libblkid.so; \
+               ln -sf  $$so_img_rel_target$(libdir)/$$so_img_name $(DESTDIR)$(usrlibexecdir)/libblkid.so; \
        fi
 
 uninstall-hook:
-       rm -f $(DESTDIR)$(usrlibexecdir)/libblkid.a
-       rm -f $(DESTDIR)$(usrlibexecdir)/libblkid.so*
+       rm -f $(DESTDIR)$(libdir)/libblkid.so*
index fff115263605bf605f82c520b29c39ca6c95699c..ddb55921c86648a7acc6cb6ced3614f5108c22bb 100644 (file)
@@ -10,7 +10,7 @@ tst_uuid_CFLAGS = -I$(ul_libuuid_srcdir)
 uuidincdir = $(includedir)/uuid
 uuidinc_HEADERS = uuid.h
 
-lib_LTLIBRARIES = libuuid.la
+usrlibexec_LTLIBRARIES = libuuid.la
 libuuid_la_SOURCES = clear.c compare.c copy.c gen_uuid.c \
            isnull.c pack.c parse.c unpack.c unparse.c uuidd.h \
            uuidd.h uuidP.h uuid_time.c $(uuidinc_HEADERS)
@@ -30,20 +30,16 @@ test_%: %.c
        $(COMPILE) -DTEST_PROGRAM $< .libs/libuuid.a -o $@
 
 
-# move devel files from $(libdir) to $(usrlibexecdir) if needed
+# move lib from $(usrlibexecdir) to $(libdir) if needed
 install-data-hook:
-       rm  $(DESTDIR)$(libdir)/$(lib_LTLIBRARIES)
        if test "$(usrlibexecdir)" != "$(libdir)"; then \
-               mkdir -p $(DESTDIR)$(usrlibexecdir); \
-               mv $(DESTDIR)$(libdir)/libuuid.a $(DESTDIR)$(usrlibexecdir)/; \
-               so_img_name=$$(readlink $(DESTDIR)$(libdir)/libuuid.so); \
-               rm $(DESTDIR)$(libdir)/libuuid.so; \
+               mkdir -p $(DESTDIR)$(libdir); \
+               mv $(DESTDIR)$(usrlibexecdir)/libuuid.so.* $(DESTDIR)$(libdir); \
+               so_img_name=$$(readlink $(DESTDIR)$(usrlibexecdir)/libuuid.so); \
                so_img_rel_target=$$(echo $(usrlibexecdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
-               ln -sf  $$so_img_rel_target$(libdir)/$$so_img_name \
-                       $(DESTDIR)$(usrlibexecdir)/libuuid.so; \
+               ln -sf  $$so_img_rel_target$(libdir)/$$so_img_name $(DESTDIR)$(usrlibexecdir)/libuuid.so; \
        fi
 
 uninstall-hook:
-       rm -f $(DESTDIR)$(usrlibexecdir)/libuuid.a
-       rm -f $(DESTDIR)$(usrlibexecdir)/libuuid.so*
+       rm -f $(DESTDIR)$(libdir)/libuuid.so*