diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index fbde35d4e972..58bce19512b8 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -209,6 +209,10 @@ _libinstall: ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} .if defined(SHLIB_LINK) ln -fs ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK} +.if (${LIBDIR} != ${SHLIBDIR}) + 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)