Index: bsd.port.mk =================================================================== --- bsd.port.mk (revision 329902) +++ bsd.port.mk (working copy) @@ -1130,7 +1130,7 @@ SRC_BASE?= /usr/src USESDIR?= ${PORTSDIR}/Mk/Uses SCRIPTSDIR?= ${PORTSDIR}/Mk/Scripts -LIB_DIRS?= /lib /usr/lib ${LOCALBASE}/lib +LIB_DIRS?= /lib /usr/lib .if defined(FORCE_STAGE) .undef NO_STAGE @@ -2045,6 +2045,13 @@ .include "${USESDIR}/${_f}.mk" .endfor +_TMPLDFLAGS:= ${LDFLAGS} +LDFLAGS= # +.for l in ${LIB_PATH} +LDFLAGS+= -L${l} -Wl,-rpath=${l} +.endfor +LDFLAGS+= ${_TMPLDFLAGS} + .if defined(USE_XORG) # Add explicit X options to avoid problems with false positives in configure .if defined(GNU_CONFIGURE) @@ -5218,7 +5225,7 @@ 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 || : `" ; \ + dirs="${LIB_DIRS} ${LIB_PATH}" ; \ for libdir in $$dirs; do \ test -f $${libdir}/$${lib} || continue; \ if [ -x /usr/bin/file ]; then \