From 3d7f3b48c8d3483bc5df7391c27c8500c50bc999 Mon Sep 17 00:00:00 2001 From: Gordon Tetlow Date: Sun, 17 Aug 2003 07:42:50 +0000 Subject: [PATCH] Handle the case where SHLIBDIR != LIBDIR. When creating links, we need relative pathing to work correctly. This is s necessary step for putting libraries in /lib while the .so symlinks still live in /usr/lib. This should be a big NOOP in the case where SHLIBDIR == LIBDIR. --- share/mk/bsd.lib.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index f4d6437eed9b..19cbbe16915a 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -206,7 +206,12 @@ _libinstall: ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} .if defined(SHLIB_LINK) - ln -fs ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK} +.if (${LIBDIR} == ${SHLIBDIR}) + ln -fs ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK} +.else + ln -fs ${LIBDIR:C|/[^/]+|/..|g:S|^/||}${SHLIBDIR}/${SHLIB_NAME} \ + ${DESTDIR}${LIBDIR}/${SHLIB_LINK} +.endif .endif .endif .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)