| @@ -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" |
46 | CHECK_WRKREF?= tools home | | 47 | CHECK_WRKREF?= tools home cross |
47 | .else | | 48 | .else |
48 | CHECK_WRKREF?= no | | 49 | CHECK_WRKREF?= no |
49 | .endif | | 50 | .endif |
50 | CHECK_WRKREF_SKIP?= # none | | 51 | CHECK_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}) |
71 | PKG_FAIL_REASON+= "[check-wrkref.mk] Invalid value \"${d:Q}\" for CHECK_WRKREF." | | 74 | PKG_FAIL_REASON+= "[check-wrkref.mk] Invalid value \"${d:Q}\" for CHECK_WRKREF." |
72 | PKG_FAIL_REASON+= "[check-wrkref.mk] Valid options are:" | | 75 | PKG_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 |
74 | PKG_FAIL_REASON+= "[check-wrkref.mk] ${refvar}" | | 77 | PKG_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*) |
82 | privileged-install-hook: _check-wrkref | | 85 | privileged-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} \ |