Tue Jun 27 10:27:54 2023 UTC ()
check-wrkref: Check for TOOLBASE references when it's not LOCALBASE.

No change for native compilation, where TOOLBASE = LOCALBASE.


(riastradh)
diff -r1.27 -r1.28 pkgsrc/mk/check/check-wrkref.mk

cvs diff -r1.27 -r1.28 pkgsrc/mk/check/check-wrkref.mk (expand / switch to unified diff)

--- pkgsrc/mk/check/check-wrkref.mk 2023/03/04 23:03:34 1.27
+++ pkgsrc/mk/check/check-wrkref.mk 2023/06/27 10:27:54 1.28
@@ -1,86 +1,89 @@ @@ -1,86 +1,89 @@
1# $NetBSD: check-wrkref.mk,v 1.27 2023/03/04 23:03:34 rillig Exp $ 1# $NetBSD: check-wrkref.mk,v 1.28 2023/06/27 10:27:54 riastradh Exp $
2# 2#
3# This file checks that the installed files don't contain any strings 3# This file checks that the installed files don't contain any strings
4# that point to the directory where the package had been built, to make 4# that point to the directory where the package had been built, to make
5# sure that the package still works after the working directory has been 5# sure that the package still works after the working directory has been
6# cleaned up. 6# cleaned up.
7# 7#
8# User-settable variables: 8# User-settable variables:
9# 9#
10# CHECK_WRKREF 10# CHECK_WRKREF
11# The list of directory names that must not appear in installed files. 11# The list of directory names that must not appear in installed files.
12# 12#
13# tools the tool wrappers 13# tools the tool wrappers
14# wrappers the compiler wrappers 14# wrappers the compiler wrappers
15# home FAKEHOMEDIR 15# home FAKEHOMEDIR
16# wrksrc WRKSRC 16# wrksrc WRKSRC
17# work WRKDIR 17# work WRKDIR
18# wrkobjdir WRKOBJDIR 18# wrkobjdir WRKOBJDIR
19# pkgsrc PKGSRCDIR 19# pkgsrc PKGSRCDIR
20# buildlink BUILDLINK_DIR and BUILDLINK_X11_DIR 20# buildlink BUILDLINK_DIR and BUILDLINK_X11_DIR
21# extra see CHECK_WRKREF_EXTRA_DIRS 21# extra see CHECK_WRKREF_EXTRA_DIRS
 22# cross TOOLBASE (only if distinct from LOCALBASE)
22# 23#
23# Default value: "tools home" for PKG_DEVELOPERs, "no" otherwise. 24# Default value: "tools home cross" for PKG_DEVELOPERs, "no" otherwise.
24# 25#
25# The "buildlink" option works best in combination with 26# The "buildlink" option works best in combination with
26# STRIP_DEBUG=yes. 27# STRIP_DEBUG=yes.
27# 28#
28# CHECK_WRKREF_EXTRA_DIRS 29# CHECK_WRKREF_EXTRA_DIRS
29# A list of additional directories (or other strings) that must 30# A list of additional directories (or other strings) that must
30# not appear in the installed files. For pbulk builds, the 31# not appear in the installed files. For pbulk builds, the
31# location where the pbulk tools are installed should be added 32# location where the pbulk tools are installed should be added
32# here. 33# here.
33# 34#
34# Package-settable variables: 35# Package-settable variables:
35# 36#
36# CHECK_WRKREF_SKIP 37# CHECK_WRKREF_SKIP
37# The list of filename patterns that should be excluded from this 38# The list of filename patterns that should be excluded from this
38# test, either absolute or relative to PREFIX. 39# test, either absolute or relative to PREFIX.
39# 40#
40 41
41_VARGROUPS+= check-wrkref 42_VARGROUPS+= check-wrkref
42_USER_VARS.check-wrkref= CHECK_WRKREF CHECK_WRKREF_EXTRA_DIRS 43_USER_VARS.check-wrkref= CHECK_WRKREF CHECK_WRKREF_EXTRA_DIRS
43_PKG_VARS.check-wrkref= CHECK_WRKREF_SKIP 44_PKG_VARS.check-wrkref= CHECK_WRKREF_SKIP
44 45
45.if ${PKG_DEVELOPER:Uno} != "no" 46.if ${PKG_DEVELOPER:Uno} != "no"
46CHECK_WRKREF?= tools home 47CHECK_WRKREF?= tools home cross
47.else 48.else
48CHECK_WRKREF?= no 49CHECK_WRKREF?= no
49.endif 50.endif
50CHECK_WRKREF_SKIP?= # none 51CHECK_WRKREF_SKIP?= # none
51 52
52_CHECK_WRKREF_FILELIST_CMD?= ${PKG_FILELIST_CMD} 53_CHECK_WRKREF_FILELIST_CMD?= ${PKG_FILELIST_CMD}
53 54
54_CHECK_WRKREF_DIR.no= # none 55_CHECK_WRKREF_DIR.no= # none
55_CHECK_WRKREF_DIR.work= ${WRKDIR} 56_CHECK_WRKREF_DIR.work= ${WRKDIR}
56_CHECK_WRKREF_DIR.tools= ${TOOLS_DIR} 57_CHECK_WRKREF_DIR.tools= ${TOOLS_DIR}
57_CHECK_WRKREF_DIR.wrappers= ${WRAPPER_DIR} 58_CHECK_WRKREF_DIR.wrappers= ${WRAPPER_DIR}
58_CHECK_WRKREF_DIR.home= ${FAKEHOMEDIR} 59_CHECK_WRKREF_DIR.home= ${FAKEHOMEDIR}
59_CHECK_WRKREF_DIR.wrkobjdir= ${WRKOBJDIR} 60_CHECK_WRKREF_DIR.wrkobjdir= ${WRKOBJDIR}
60_CHECK_WRKREF_DIR.wrksrc= ${WRKSRC} 61_CHECK_WRKREF_DIR.wrksrc= ${WRKSRC}
61_CHECK_WRKREF_DIR.pkgsrc= ${PKGSRCDIR} 62_CHECK_WRKREF_DIR.pkgsrc= ${PKGSRCDIR}
62_CHECK_WRKREF_DIR.buildlink= ${BUILDLINK_DIR} 63_CHECK_WRKREF_DIR.buildlink= ${BUILDLINK_DIR}
63.if defined(USE_X11) && ${X11_TYPE} != "modular" 64.if defined(USE_X11) && ${X11_TYPE} != "modular"
64_CHECK_WRKREF_DIR.buildlink+= ${BUILDLINK_X11_DIR} 65_CHECK_WRKREF_DIR.buildlink+= ${BUILDLINK_X11_DIR}
65.endif 66.endif
66_CHECK_WRKREF_DIR.extra= ${CHECK_WRKREF_EXTRA_DIRS} 67_CHECK_WRKREF_DIR.extra= ${CHECK_WRKREF_EXTRA_DIRS}
 68_CHECK_WRKREF_DIR.cross= \
 69 ${${TOOLBASE} != ${LOCALBASE}:?${TOOLBASE}:}
67 70
68_CHECK_WRKREF_DIRS= # none 71_CHECK_WRKREF_DIRS= # none
69.for d in ${CHECK_WRKREF} 72.for d in ${CHECK_WRKREF}
70. if !defined(_CHECK_WRKREF_DIR.${d}) 73. if !defined(_CHECK_WRKREF_DIR.${d})
71PKG_FAIL_REASON+= "[check-wrkref.mk] Invalid value \"${d:Q}\" for CHECK_WRKREF." 74PKG_FAIL_REASON+= "[check-wrkref.mk] Invalid value \"${d:Q}\" for CHECK_WRKREF."
72PKG_FAIL_REASON+= "[check-wrkref.mk] Valid options are:" 75PKG_FAIL_REASON+= "[check-wrkref.mk] Valid options are:"
73. for refvar in work tools wrappers home wrkobjdir wrksrc pkgsrc buildlink extra 76. for refvar in work tools wrappers home wrkobjdir wrksrc pkgsrc buildlink extra cross
74PKG_FAIL_REASON+= "[check-wrkref.mk] ${refvar}" 77PKG_FAIL_REASON+= "[check-wrkref.mk] ${refvar}"
75. endfor 78. endfor
76. else 79. else
77_CHECK_WRKREF_DIRS+= ${_CHECK_WRKREF_DIR.${d}} 80_CHECK_WRKREF_DIRS+= ${_CHECK_WRKREF_DIR.${d}}
78. endif 81. endif
79.endfor 82.endfor
80 83
81.if empty(CHECK_WRKREF:M[nN][oO]) && !empty(_CHECK_WRKREF_DIRS:M*) 84.if empty(CHECK_WRKREF:M[nN][oO]) && !empty(_CHECK_WRKREF_DIRS:M*)
82privileged-install-hook: _check-wrkref 85privileged-install-hook: _check-wrkref
83.endif 86.endif
84 87
85_check-wrkref: error-check .PHONY 88_check-wrkref: error-check .PHONY
86 ${RUN} \ 89 ${RUN} \