Install relative links to the soname.
authorAndre Noll <maan@systemlinux.org>
Mon, 11 Aug 2014 09:13:25 +0000 (11:13 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 11 Aug 2014 09:13:25 +0000 (11:13 +0200)
On make install, the library is installed to $(libdir)/$(realname)
(e.g. /usr/local/lib/libosl.so.0.1.2), and a link is created to
map $(linkername) to $(soname) (e.g. /usr/local/lib/libosl.so ->
/usr/local/lib/libosl.so.0).

This changes the ln command to create a relative link rather than an
absolute link. For example, /usr/local/lib/libosl.so now points to
libosl.so.0 without the leading directory. This shouldn't matter much
but it allows to move both files elsewhere without breaking the link.

Makefile

index 3f12b09d2819e966e2d5d2793bad2aa7cc7f3b49..09ad34b3edcde8ab57ef140ed1ee35e32c61179f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -190,7 +190,7 @@ install-man: $(man_pages)
 install-lib: $(realname) $(headers)
        $(MKDIR) $(libdir) $(includedir)
        $(RM) $(libdir)/$(linkername)
-       $(LN) -s $(libdir)/$(soname) $(libdir)/$(linkername)
+       $(LN) -s $(soname) $(libdir)/$(linkername)
        $(INSTALL) -m 755 $(realname) $(libdir)
        $(INSTALL) -m 644 $(headers) $(includedir)