From 55f1ee14c32d7055cd5d01384a23ab4b835cf893 Mon Sep 17 00:00:00 2001 From: rillig Date: Thu, 15 Mar 2007 01:06:02 +0000 Subject: The CHECK_WRKREF variable has changed type: It is now a list of directory aliases. That makes it possible to check for references into TOOLS_DIR and WRKSRC, but to leave out the other infrastructure directories. On IRIX, x11/gtk2 failed to build because of an unknown library -lharfbuzz. That library turned out to be an internal dependency of graphics/cairo, which had made it into the installed libpangocairo.la file. With this change, that bug would have been caught earlier. --- mk/check/check-wrkref.mk | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'mk') diff --git a/mk/check/check-wrkref.mk b/mk/check/check-wrkref.mk index 7155519cc85..af0001765ef 100644 --- a/mk/check/check-wrkref.mk +++ b/mk/check/check-wrkref.mk @@ -1,4 +1,4 @@ -# $NetBSD: check-wrkref.mk,v 1.11 2007/01/07 11:21:24 rillig Exp $ +# $NetBSD: check-wrkref.mk,v 1.12 2007/03/15 01:06:02 rillig Exp $ # # This file checks that the installed files don't contain any strings # that point to the directory where the package had been built, to make @@ -8,10 +8,10 @@ # User-settable variables: # # CHECK_WRKREF: -# The kind of directory that must not appear in installed files. +# The list of directory names that must not appear in installed files. # -# * "no" to disable this check at all # * "tools" for the tool wrapper directory +# * "wrksrc" for WRKSRC # * "work" for WRKDIR # * "wrkobjdir" for WRKOBJDIR # @@ -36,13 +36,19 @@ _CHECK_WRKREF_DIR.no= # none _CHECK_WRKREF_DIR.work= ${WRKDIR} _CHECK_WRKREF_DIR.tools= ${TOOLS_DIR} _CHECK_WRKREF_DIR.wrkobjdir= ${WRKOBJDIR} +_CHECK_WRKREF_DIR.wrksrc= ${WRKSRC} -.if !defined(_CHECK_WRKREF_DIR.${CHECK_WRKREF}) -PKG_FAIL_REASON+= "[check-wrkref.mk] CHECK_WRKREF must be one of { no tools work objwrkdir }." -.endif -_CHECK_WRKREF_DIR= ${_CHECK_WRKREF_DIR.${CHECK_WRKREF}} +_CHECK_WRKREF_DIRS= # none +.for d in ${CHECK_WRKREF} +. if !defined(_CHECK_WRKREF_DIR.${d}) +PKG_FAIL_REASON+= "[check-wrkref.mk] Invalid value "${d:Q}" for CHECK_WRKREF." +PKG_FAIL_REASON+= "[check-wrkref.mk] Try one of { tools wrksrc work objwrkdir } instead." +. else +_CHECK_WRKREF_DIRS+= ${_CHECK_WRKREF_DIR.${d}} +. endif +.endfor -.if empty(CHECK_WRKREF:M[nN][oO]) +.if empty(CHECK_WRKREF:M[nN][oO]) && !empty(_CHECK_WRKREF_DIRS:M*) privileged-install-hook: _check-wrkref .endif @@ -59,16 +65,12 @@ _check-wrkref: error-check .PHONY *) ;; \ esac; \ ${SHCOMMENT} "[$$file]"; \ - case ${_CHECK_WRKREF_DIR:Q}"" in \ - "") ${ERROR_MSG} "[check-wrkref.mk] The directory to check is empty."; \ - exit 1; \ - ;; \ - *) grep ${_CHECK_WRKREF_DIR:Q}"" "$$file" 2>/dev/null | \ + for d in ${_CHECK_WRKREF_DIRS}; do \ + grep "$$d" "$$file" 2>/dev/null | \ sed -e "s|^|$$file: |"; \ - ;; \ - esac; \ + done; \ done - ${_PKG_SILENT}${_PKG_DEBUG} \ + ${RUN} \ exec 1>>${ERROR_DIR}/${.TARGET}; \ if ${_NONZERO_FILESIZE_P} ${ERROR_DIR}/${.TARGET}; then \ ${ECHO} "*** The above files still have references to the build directory."; \ -- cgit v1.2.3