buildsystem: Fix libfoo.so links for /lib libraries
authorFrançois Tigeot <ftigeot@wolfpond.org>
Mon, 14 Apr 2014 10:20:43 +0000 (12:20 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Mon, 14 Apr 2014 10:31:56 +0000 (12:31 +0200)
commitaa8dd8466606c653e3695b38e32609a2608ff112
tree9c9dbd044818cd1daabf1921e1d71d1a2de8b644
parent17f97226bbe6d116c13d6150bcec8bce4b9a9895
buildsystem: Fix libfoo.so links for /lib libraries

* When installing to a non-default location by using DESTDIR on the make
  installworld command line, /usr/lib/libfoo.so links pointed to wrong
  locations

* DESTDIR is used both as an installworld parameter and internally by the
  build system and these two cases expect different behaviors

* Symlinks locations in /usr/obj must be relative to the host (builder)
  filesystem namespace
  libc.so -> /usr/obj/usr/src/world_x86_64/lib/libc.so

* Symlinks locations in the final destination directory must be relative to
  the target world filesystem namespace
  libc.so -> /lib/libc.so

* The symlinks themselves must be absolute in order to not break
  installations where /usr is a symlink

Inspired-by: FreeBSD's historical transition to /lib
Makefile.inc1
share/mk/bsd.lib.mk