diff options
author | agc <agc@pkgsrc.org> | 2003-07-22 10:12:47 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 2003-07-22 10:12:47 +0000 |
commit | 1672441254ac9f350df56beebddb923a5af12d28 (patch) | |
tree | 40278d713f9b39bd5896dd08e4d30be0cf695460 /mk/bsd.pkg.mk | |
parent | 99fc976b2d3ccf5767312fe429cb28afdb6d4b3d (diff) | |
download | pkgsrc-1672441254ac9f350df56beebddb923a5af12d28.tar.gz |
As part of the build information, record the full pathnames of the
shared object "provides" and "requires" information. This is only
turned on just now if ${CHECK_SHLIBS} is set to "YES".
Example output:
% pkg_info -B libutf | grep '^PROVIDES'
PROVIDES=/usr/pkg/lib/libutf.so.2
% pkg_info -B ssam | grep '^REQUIRES'
REQUIRES=/usr/lib/libc.so.12
REQUIRES=/usr/pkg/lib/libutf.so.2
%
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r-- | mk/bsd.pkg.mk | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 5918b9107c0..0738e28ea3a 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1218 2003/07/19 02:50:22 dmcmahill Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1219 2003/07/22 10:12:47 agc Exp $ # # This file is in the public domain. # @@ -4231,6 +4231,29 @@ fake-pkg: ${PLIST} ${DESCR} ${MESSAGE} . ifdef USE_GMAKE @${ECHO} "GMAKE=`${GMAKE} --version | ${GREP} Make`" >> ${BUILD_INFO_FILE} . endif +. if ${CHECK_SHLIBS} == "YES" + ${_PKG_SILENT}${_PKG_DEBUG} \ + case "${OBJECT_FMT}" in \ + ELF) bins=`${SETENV} PREFIX=${PREFIX} ${AWK} '/^(bin|sbin|libexec)\// { print ENVIRON["PREFIX"] "/" $$0 }' ${PLIST} || ${TRUE}`; \ + libs=`${SETENV} PREFIX=${PREFIX} ${AWK} '/^lib\/lib.*\.so\.[0-9]+$$/ { print ENVIRON["PREFIX"] "/" $$0 }' ${PLIST} || ${TRUE}`; \ + for i in "" $$libs; do \ + ${TEST} "$$i" = "" && continue; \ + ${ECHO} "PROVIDES=$$i" >> ${BUILD_INFO_FILE}; \ + done; \ + case "${LDD}" in \ + "") ldd=`${TYPE} ldd | ${AWK} '{ print $$NF }'`;; \ + *) ldd="${LDD}"; \ + esac; \ + if ${TEST} "$$bins" != "" -o "$$libs" != ""; then \ + requires=`($$ldd $$bins $$libs || ${TRUE}) | ${AWK} 'NF == 3 { print $$3 }' | ${SORT} -u`; \ + for req in "" $$requires; do \ + ${TEST} "$$req" = "" && continue; \ + ${ECHO} "REQUIRES=$$req" >> ${BUILD_INFO_FILE}; \ + done; \ + fi; \ + ;; \ + esac +. endif ${_PKG_SILENT}${_PKG_DEBUG} \ ${ECHO} "_PKGTOOLS_VER=${PKGTOOLS_VERSION}" >> ${BUILD_INFO_FILE} ${_PKG_SILENT}${_PKG_DEBUG} \ |