aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2013-07-05 22:10:55 +0800
committerbapt <bapt@FreeBSD.org>2013-07-05 22:10:55 +0800
commitf49bba165d1dd9840812705ad7e32d34575d03ee (patch)
tree311482504dbe82820af1227e25cdbf20726041a5 /Mk/bsd.port.mk
parent5b1e61da76661f9cd7ef981ddfc0c12f72f12fad (diff)
downloadfreebsd-ports-graphics-f49bba165d1dd9840812705ad7e32d34575d03ee.tar.gz
freebsd-ports-graphics-f49bba165d1dd9840812705ad7e32d34575d03ee.tar.zst
freebsd-ports-graphics-f49bba165d1dd9840812705ad7e32d34575d03ee.zip
Add new LIB_DEPENDS syntax:
libname.so:${PORTSDIR}/devel/name libname.so.0.1.2:${PORTSDIR}/devel/name This syntax is support to replace the old syntax and code which has multiple weakness: It was replying on ldconfig -r which arbritrary limited our valid library to name of the following form: libname.so[.X] where X can be a number foo.3 could match both libfoo.3.do and libfoo.so.3 Reviewed by: bdrewery, danfe, miwi
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk30
1 files changed, 29 insertions, 1 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 361fed521a6..bb4cc800d4b 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1128,6 +1128,7 @@ _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
INDEXDIR?= ${PORTSDIR}
SRC_BASE?= /usr/src
USESDIR?= ${PORTSDIR}/Mk/Uses
+LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib
# make sure bmake treats -V as expected
.MAKE.EXPAND_VARIABLES= yes
@@ -5056,7 +5057,34 @@ ${deptype:L}-depends:
lib-depends:
.if defined(LIB_DEPENDS) && !defined(NO_DEPENDS)
- @set -e ; for i in ${LIB_DEPENDS}; do \
+ @set -e ; \
+ for i in ${LIB_DEPENDS:M*.so*\:*}; do \
+ lib=$${i%%:*} ; \
+ dir=$${i#*:} ; \
+ target="${DEPENDS_TARGET}"; \
+ depends_args="${DEPENDS_ARGS}"; \
+ ${ECHO_MSG} -n "====> ${PKGNAME} depends on shared library: $${lib}:" ; \
+ found=0 ; \
+ dirs="${LIB_DIRS} `${CAT} ${LOCALBASE}/libdata/ldconfig/* 2>/dev/null || : `" ; \
+ for libdir in $$dirs; do \
+ test -f $${libdir}/$${lib} || continue; \
+ if [ -x /usr/bin/file ]; then \
+ [ `file -b -L --mime-type $${libdir}/$${lib}` = "application/x-sharedlib" ] || continue ; \
+ fi ; \
+ found=1 ; \
+ ${ECHO_MSG} " - found"; \
+ done ; \
+ if [ $${found} -eq 0 ]; then \
+ ${ECHO_MSG} " - not found"; \
+ ${ECHO_MSG} "===> Verifying for $$lib in $$dir"; \
+ if [ ! -d "$$dir" ] ; then \
+ ${ECHO_MSG} " => No directory for $$lib. Skipping.."; \
+ else \
+ ${_INSTALL_DEPENDS} \
+ fi ; \
+ fi ; \
+ done
+ @set -e ; for i in ${LIB_DEPENDS:N*.so*\:*}; do \
lib=$${i%%:*}; \
pattern="`${ECHO_CMD} $$lib | ${SED} -E -e 's/\./\\\\./g' -e 's/(\\\\)?\+/\\\\+/g'`"\
dir=$${i#*:}; \