From af38028d111e5f45fffdb4d0b7ec46e20a4d149d Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 27 Jun 2015 23:28:56 +0000 Subject: [PATCH] Make all shared library a relative symlink This makes sysroot usable for cross building, it also removes the need for _SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no time to test it) Differential Revision: https://reviews.freebsd.org/D2920 Submitted by: imp, adrian Tested by: adrian --- Makefile.inc1 | 3 --- share/mk/bsd.lib.mk | 2 +- share/mk/bsd.own.mk | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 04f91f7ce76d..a080836118c8 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -297,7 +297,6 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \ # world stage WMAKEENV= ${CROSSENV} \ - _SHLIBDIRPREFIX=${WORLDTMP} \ _LDSCRIPTROOT= \ VERSION="${VERSION}" \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ @@ -439,7 +438,6 @@ LIB32FLAGS+= --sysroot=${WORLDTMP} # Yes, the flags are redundant. LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \ - _SHLIBDIRPREFIX=${LIB32TMP} \ _LDSCRIPTROOT=${LIB32TMP} \ VERSION="${VERSION}" \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ @@ -2123,7 +2121,6 @@ XDTP?=/usr/${XDDIR} CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ - _SHLIBDIRPREFIX=${XDDESTDIR} \ TOOLS_PREFIX=${XDTP} CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \ --sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \ diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index f70cc95d2553..b8159ded23fc 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -362,7 +362,7 @@ _libinstall: .if ${_SHLIBDIR} == ${_LIBDIR} ${INSTALL_SYMLINK} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else - ${INSTALL_SYMLINK} ${_SHLIBDIRPREFIX}${_SHLIBDIR}/${SHLIB_NAME} \ + ${INSTALL_RSYMLINK} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME}) -chflags noschg ${DESTDIR}${_LIBDIR}/${SHLIB_NAME} diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 20c66c4162be..b46357563c4b 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -222,9 +222,11 @@ INCLUDEDIR?= /usr/include # HRDLINK?= -l h SYMLINK?= -l s +RSYMLINK?= -l rs INSTALL_LINK?= ${INSTALL} ${HRDLINK} INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} +INSTALL_RSYMLINK?= ${INSTALL} ${RSYMLINK} # Common variables .if !defined(DEBUG_FLAGS)