mk/*: improve documentation for "make help"diff -r1.12 -r1.13 pkgsrc/mk/alternatives.mk
(rillig)
@@ -1,72 +1,80 @@ | @@ -1,72 +1,80 @@ | |||
1 | # $NetBSD: alternatives.mk,v 1.12 2015/11/25 13:05:47 jperkin Exp $ | 1 | # $NetBSD: alternatives.mk,v 1.13 2018/05/16 21:23:02 rillig Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment handles the alternatives system, registering a | 3 | # This Makefile fragment handles the alternatives system, registering a | |
4 | # package in the database. | 4 | # package in the database. | |
5 | # | 5 | # | |
6 | # User-settable variables: | 6 | # User-settable variables: | |
7 | # | 7 | # | |
8 | # (none) | 8 | # (none) | |
9 | # | 9 | # | |
10 | # Package-settable variables: | 10 | # Package-settable variables: | |
11 | # | 11 | # | |
12 | # ALTERNATIVES_SRC | 12 | # ALTERNATIVES_SRC | |
13 | # A _single_ file that contains the alternatives provided by the | 13 | # A _single_ file that contains the alternatives provided by the | |
14 | # package. | 14 | # package. | |
15 | # | 15 | # | |
16 | # Default value: The name of the ALTERNATIVES file in the package | 16 | # Default value: The name of the ALTERNATIVES file in the package | |
17 | # directory, if it exists. Otherwise, nothing. | 17 | # directory, if it exists. Otherwise, nothing. | |
18 | # | 18 | # | |
19 | # Each line of the alternatives file contains two filenames, first | 19 | # Each line of the alternatives file contains two filenames: | |
20 | # the wrapper and then the alternative provided by the package. | 20 | # | |
21 | # wrapper alternative | |||
22 | # | |||
23 | # The wrapper is the command that is run by the user. | |||
24 | # The alternative is the implementation of that command that is | |||
25 | # provided by the package. | |||
21 | # Both paths are relative to PREFIX. | 26 | # Both paths are relative to PREFIX. | |
27 | # The paths may use placeholders of the form @VARNAME@, which are | |||
28 | # replaced with the actual values as per FILES_SUBST. | |||
22 | # | 29 | # | |
23 | # Variables defined by this file: | 30 | # Variables defined by this file: | |
24 | # | 31 | # | |
25 | # PKG_ALTERNATIVES | 32 | # PKG_ALTERNATIVES | |
26 | # The path to the pkg_alternatives command. | 33 | # The path to the pkg_alternatives command. | |
27 | # | 34 | # | |
35 | # Keywords: alternatives | |||
28 | 36 | |||
29 | .if !defined(ALTERNATIVES_MK) | 37 | .if !defined(ALTERNATIVES_MK) | |
30 | ALTERNATIVES_MK= # defined | 38 | ALTERNATIVES_MK= # defined | |
31 | 39 | |||
32 | _VARGROUPS+= alternatives | 40 | _VARGROUPS+= alternatives | |
33 | _PKG_VARS.alternatives= ALTERNATIVES_SRC | 41 | _PKG_VARS.alternatives= ALTERNATIVES_SRC | |
34 | _SYS_VARS.alternatives= PKG_ALTERNATIVES | 42 | _SYS_VARS.alternatives= PKG_ALTERNATIVES | |
35 | 43 | |||
36 | .if exists(${.CURDIR}/ALTERNATIVES) | 44 | .if exists(${.CURDIR}/ALTERNATIVES) | |
37 | ALTERNATIVES_SRC?= ${.CURDIR}/ALTERNATIVES | 45 | ALTERNATIVES_SRC?= ${.CURDIR}/ALTERNATIVES | |
38 | .endif | 46 | .endif | |
39 | ALTERNATIVES_SRC?= # none | 47 | ALTERNATIVES_SRC?= # none | |
40 | 48 | |||
41 | .if !empty(ALTERNATIVES_SRC) | 49 | .if !empty(ALTERNATIVES_SRC) | |
42 | 50 | |||
43 | ${WRKDIR}/.altinstall: ${ALTERNATIVES_SRC} | 51 | ${WRKDIR}/.altinstall: ${ALTERNATIVES_SRC} | |
44 | @{ ${ECHO} 'if ${TEST} $${STAGE} = "POST-INSTALL"; then'; \ | 52 | @{ ${ECHO} 'if ${TEST} $${STAGE} = "POST-INSTALL"; then'; \ | |
45 | ${ECHO} '${CAT} >./+ALTERNATIVES <<EOF'; \ | 53 | ${ECHO} '${CAT} >./+ALTERNATIVES <<EOF'; \ | |
46 | ${SED} ${FILES_SUBST_SED} <${ALTERNATIVES_SRC}; \ | 54 | ${SED} ${FILES_SUBST_SED} <${ALTERNATIVES_SRC}; \ | |
47 | ${ECHO} 'EOF'; \ | 55 | ${ECHO} 'EOF'; \ | |
48 | ${ECHO} 'if ${TEST} -x ${PKG_ALTERNATIVES}; then'; \ | 56 | ${ECHO} 'if ${TEST} -x ${PKG_ALTERNATIVES}; then'; \ | |
49 | ${ECHO} '${PKG_ALTERNATIVES} -gs register ./+ALTERNATIVES'; \ | 57 | ${ECHO} '${PKG_ALTERNATIVES} -gs register ./+ALTERNATIVES'; \ | |
50 | ${ECHO} 'fi'; \ | 58 | ${ECHO} 'fi'; \ | |
51 | ${ECHO} 'fi'; \ | 59 | ${ECHO} 'fi'; \ | |
52 | } >${WRKDIR}/.altinstall | 60 | } >${WRKDIR}/.altinstall | |
53 | 61 | |||
54 | ${WRKDIR}/.altdeinstall: ${ALTERNATIVES_SRC} | 62 | ${WRKDIR}/.altdeinstall: ${ALTERNATIVES_SRC} | |
55 | @{ ${ECHO} 'if ${TEST} $${STAGE} = "DEINSTALL"; then'; \ | 63 | @{ ${ECHO} 'if ${TEST} $${STAGE} = "DEINSTALL"; then'; \ | |
56 | ${ECHO} 'if ${TEST} -x ${PKG_ALTERNATIVES}; then'; \ | 64 | ${ECHO} 'if ${TEST} -x ${PKG_ALTERNATIVES}; then'; \ | |
57 | ${ECHO} '${PKG_ALTERNATIVES} -gs unregister ./+ALTERNATIVES'; \ | 65 | ${ECHO} '${PKG_ALTERNATIVES} -gs unregister ./+ALTERNATIVES'; \ | |
58 | ${ECHO} 'fi'; \ | 66 | ${ECHO} 'fi'; \ | |
59 | ${ECHO} '${RM} -f ./+ALTERNATIVES'; \ | 67 | ${ECHO} '${RM} -f ./+ALTERNATIVES'; \ | |
60 | ${ECHO} 'fi'; \ | 68 | ${ECHO} 'fi'; \ | |
61 | } >${WRKDIR}/.altdeinstall | 69 | } >${WRKDIR}/.altdeinstall | |
62 | 70 | |||
63 | PRINT_PLIST_AWK+= /^libdata\/alternatives\// { next; } | 71 | PRINT_PLIST_AWK+= /^libdata\/alternatives\// { next; } | |
64 | 72 | |||
65 | PKG_ALTERNATIVES= ${LOCALBASE}/sbin/pkg_alternatives | 73 | PKG_ALTERNATIVES= ${LOCALBASE}/sbin/pkg_alternatives | |
66 | 74 | |||
67 | INSTALL_TEMPLATES+= ${WRKDIR}/.altinstall | 75 | INSTALL_TEMPLATES+= ${WRKDIR}/.altinstall | |
68 | DEINSTALL_TEMPLATES+= ${WRKDIR}/.altdeinstall | 76 | DEINSTALL_TEMPLATES+= ${WRKDIR}/.altdeinstall | |
69 | 77 | |||
70 | .endif | 78 | .endif | |
71 | 79 | |||
72 | .endif # ALTERNATIVES_MK | 80 | .endif # ALTERNATIVES_MK |
@@ -1,191 +1,206 @@ | @@ -1,191 +1,206 @@ | |||
1 | # $NetBSD: build.mk,v 1.22 2017/06/01 02:15:10 jlam Exp $ | 1 | # $NetBSD: build.mk,v 1.23 2018/05/16 21:23:02 rillig Exp $ | |
2 | # | 2 | # | |
3 | # This file defines what happens in the build phase, excluding the | 3 | # This file defines what happens in the build phase, excluding the | |
4 | # self-test, which is defined in test.mk. | 4 | # self-test, which is defined in test.mk. | |
5 | # | 5 | # | |
6 | # Public targets for developers: | 6 | # Public targets for developers: | |
7 | # | 7 | # | |
8 | # build-env: | 8 | # build-env: | |
9 | # Runs an interactive shell (BUILD_ENV_SHELL) in the environment | 9 | # Runs an interactive shell (BUILD_ENV_SHELL) in the environment | |
10 | # that is used for building the package. | 10 | # that is used for building the package. | |
11 | # | 11 | # | |
12 | # Package-settable variables: | 12 | # Package-settable variables: | |
13 | # | 13 | # | |
14 | # BUILD_MAKE_FLAGS is the list of arguments that is passed to the make | 14 | # BUILD_MAKE_FLAGS is the list of arguments that is passed to the make | |
15 | # process, in addition to the usual MAKE_FLAGS. | 15 | # process, in addition to the usual MAKE_FLAGS. | |
16 | # | 16 | # | |
17 | # BUILD_TARGET is the target from ${MAKE_FILE} that should be invoked | 17 | # BUILD_TARGET is the target from ${MAKE_FILE} that should be invoked | |
18 | # to build the sources. | 18 | # to build the sources. | |
19 | # | 19 | # | |
20 | # MAKE_JOBS_SAFE | 20 | # MAKE_JOBS_SAFE | |
21 | # Whether the package supports parallel builds. If set to yes, | 21 | # Whether the package supports parallel builds. If set to yes, | |
22 | # at most MAKE_JOBS jobs are carried out in parallel. The default | 22 | # at most MAKE_JOBS jobs are carried out in parallel. The default | |
23 | # value is "yes", and packages that don't support it must | 23 | # value is "yes", and packages that don't support it must | |
24 | # explicitly set it to "no". | 24 | # explicitly set it to "no". | |
25 | # | 25 | # | |
26 | # Keywords: parallel | 26 | # Keywords: parallel | |
27 | # | 27 | # | |
28 | # Variables defined in this file: | 28 | # Variables defined in this file: | |
29 | # | 29 | # | |
30 | # BUILD_MAKE_CMD | 30 | # BUILD_MAKE_CMD | |
31 | # This command sets the proper environment for the build phase | 31 | # This command sets the proper environment for the build phase | |
32 | # and runs make(1) on it. It takes a list of make targets and | 32 | # and runs make(1) on it. It takes a list of make targets and | |
33 | # flags as argument. | 33 | # flags as argument. | |
34 | # | 34 | # | |
35 | # See also: | 35 | # See also: | |
36 | # mk/build/test.mk | 36 | # mk/build/test.mk | |
37 | # | 37 | # | |
38 | # Keywords: build make | 38 | # Keywords: build make | |
39 | 39 | |||
40 | _VARGROUPS+= build | 40 | _VARGROUPS+= build | |
41 | _USER_VARS.build= MAKE_JOBS BUILD_ENV_SHELL | 41 | _USER_VARS.build= MAKE_JOBS BUILD_ENV_SHELL | |
42 | _PKG_VARS.build= MAKE_ENV MAKE_FLAGS BUILD_MAKE_FLAGS BUILD_TARGET MAKE_JOBS_SAFE | 42 | _PKG_VARS.build= MAKE_ENV MAKE_FLAGS BUILD_MAKE_FLAGS BUILD_TARGET MAKE_JOBS_SAFE | |
43 | _SYS_VARS.build= BUILD_MAKE_CMD | 43 | _SYS_VARS.build= BUILD_MAKE_CMD | |
44 | 44 | |||
45 | BUILD_MAKE_FLAGS?= # none | 45 | BUILD_MAKE_FLAGS?= # none | |
46 | BUILD_TARGET?= all | 46 | BUILD_TARGET?= all | |
47 | 47 | |||
48 | BUILD_MAKE_CMD= \ | 48 | BUILD_MAKE_CMD= \ | |
49 | ${PKGSRC_SETENV} ${MAKE_ENV} \ | 49 | ${PKGSRC_SETENV} ${MAKE_ENV} \ | |
50 | ${MAKE_PROGRAM} ${_MAKE_JOBS} \ | 50 | ${MAKE_PROGRAM} ${_MAKE_JOBS} \ | |
51 | ${MAKE_FLAGS} ${BUILD_MAKE_FLAGS} \ | 51 | ${MAKE_FLAGS} ${BUILD_MAKE_FLAGS} \ | |
52 | -f ${MAKE_FILE} | 52 | -f ${MAKE_FILE} | |
53 | 53 | |||
54 | .if defined(MAKE_JOBS_SAFE) && !empty(MAKE_JOBS_SAFE:M[nN][oO]) | 54 | .if defined(MAKE_JOBS_SAFE) && !empty(MAKE_JOBS_SAFE:M[nN][oO]) | |
55 | _MAKE_JOBS= # nothing | 55 | _MAKE_JOBS= # nothing | |
56 | .elif defined(MAKE_JOBS) | 56 | .elif defined(MAKE_JOBS) | |
57 | _MAKE_JOBS= -j${MAKE_JOBS} | 57 | _MAKE_JOBS= -j${MAKE_JOBS} | |
58 | .endif | 58 | .endif | |
59 | 59 | |||
60 | ###################################################################### | 60 | ###################################################################### | |
61 | ### build (PUBLIC) | 61 | ### build (PUBLIC) | |
62 | ###################################################################### | 62 | ###################################################################### | |
63 | ### build is a public target to build the sources from the package. | 63 | ### build is a public target to build the sources from the package. | |
64 | ### | 64 | ### | |
65 | _BUILD_TARGETS+= check-vulnerable | 65 | _BUILD_TARGETS+= check-vulnerable | |
66 | _BUILD_TARGETS+= configure | 66 | _BUILD_TARGETS+= configure | |
67 | _BUILD_TARGETS+= acquire-build-lock | 67 | _BUILD_TARGETS+= acquire-build-lock | |
68 | _BUILD_TARGETS+= ${_COOKIE.build} | 68 | _BUILD_TARGETS+= ${_COOKIE.build} | |
69 | _BUILD_TARGETS+= release-build-lock | 69 | _BUILD_TARGETS+= release-build-lock | |
70 | .if ${_USE_NEW_PKGINSTALL:Uno} == "no" | 70 | .if ${_USE_NEW_PKGINSTALL:Uno} == "no" | |
71 | _BUILD_TARGETS+= pkginstall | 71 | _BUILD_TARGETS+= pkginstall | |
72 | .endif | 72 | .endif | |
73 | 73 | |||
74 | .PHONY: build | 74 | .PHONY: build | |
75 | .if !target(build) | 75 | .if !target(build) | |
76 | . if exists(${_COOKIE.build}) | 76 | . if exists(${_COOKIE.build}) | |
77 | build: | 77 | build: | |
78 | @${DO_NADA} | 78 | @${DO_NADA} | |
79 | . elif defined(_PKGSRC_BARRIER) | 79 | . elif defined(_PKGSRC_BARRIER) | |
80 | build: ${_BUILD_TARGETS} | 80 | build: ${_BUILD_TARGETS} | |
81 | . else | 81 | . else | |
82 | build: barrier | 82 | build: barrier | |
83 | . endif | 83 | . endif | |
84 | .endif | 84 | .endif | |
85 | 85 | |||
86 | .PHONY: acquire-build-lock release-build-lock | 86 | .PHONY: acquire-build-lock release-build-lock | |
87 | acquire-build-lock: acquire-lock | 87 | acquire-build-lock: acquire-lock | |
88 | release-build-lock: release-lock | 88 | release-build-lock: release-lock | |
89 | 89 | |||
90 | .if exists(${_COOKIE.build}) | 90 | .if exists(${_COOKIE.build}) | |
91 | ${_COOKIE.build}: | 91 | ${_COOKIE.build}: | |
92 | @${DO_NADA} | 92 | @${DO_NADA} | |
93 | .else | 93 | .else | |
94 | ${_COOKIE.build}: real-build | 94 | ${_COOKIE.build}: real-build | |
95 | .endif | 95 | .endif | |
96 | 96 | |||
97 | ###################################################################### | 97 | ###################################################################### | |
98 | ### rebuild (PUBLIC) | 98 | ### rebuild (PUBLIC) | |
99 | ###################################################################### | 99 | ###################################################################### | |
100 | ### rebuild is a special target to re-run the build target. | 100 | ### rebuild is a special target to re-run the build target. | |
101 | ### | 101 | ### | |
102 | 102 | |||
103 | .PHONY: rebuild | 103 | .PHONY: rebuild | |
104 | rebuild: build-clean | 104 | rebuild: build-clean | |
105 | ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} build | 105 | ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} build | |
106 | 106 | |||
107 | ###################################################################### | 107 | ###################################################################### | |
108 | ### build-clean (PRIVATE) | 108 | ### build-clean (PRIVATE) | |
109 | ###################################################################### | 109 | ###################################################################### | |
110 | ### build-clean removes the state files for the "build" and | 110 | ### build-clean removes the state files for the "build" and | |
111 | ### later phases so that the "build" target may be re-invoked. | 111 | ### later phases so that the "build" target may be re-invoked. | |
112 | ### | 112 | ### | |
113 | .PHONY: build-clean | 113 | .PHONY: build-clean | |
114 | build-clean: install-clean _package-clean | 114 | build-clean: install-clean _package-clean | |
115 | ${RUN} ${RM} -f ${_COOKIE.build} | 115 | ${RUN} ${RM} -f ${_COOKIE.build} | |
116 | 116 | |||
117 | ###################################################################### | 117 | ###################################################################### | |
118 | ### real-build (PRIVATE) | 118 | ### real-build (PRIVATE) | |
119 | ###################################################################### | 119 | ###################################################################### | |
120 | ### real-build is a helper target onto which one can hook all of the | 120 | ### real-build is a helper target onto which one can hook all of the | |
121 | ### targets that do the actual building of the sources. | 121 | ### targets that do the actual building of the sources. | |
122 | ### | 122 | ### | |
123 | _REAL_BUILD_TARGETS+= build-check-interactive | 123 | _REAL_BUILD_TARGETS+= build-check-interactive | |
124 | _REAL_BUILD_TARGETS+= build-message | 124 | _REAL_BUILD_TARGETS+= build-message | |
125 | _REAL_BUILD_TARGETS+= build-vars | 125 | _REAL_BUILD_TARGETS+= build-vars | |
126 | _REAL_BUILD_TARGETS+= pre-build-checks-hook | 126 | _REAL_BUILD_TARGETS+= pre-build-checks-hook | |
127 | _REAL_BUILD_TARGETS+= pre-build | 127 | _REAL_BUILD_TARGETS+= pre-build | |
128 | _REAL_BUILD_TARGETS+= do-build | 128 | _REAL_BUILD_TARGETS+= do-build | |
129 | _REAL_BUILD_TARGETS+= post-build | 129 | _REAL_BUILD_TARGETS+= post-build | |
130 | _REAL_BUILD_TARGETS+= build-cookie | 130 | _REAL_BUILD_TARGETS+= build-cookie | |
131 | _REAL_BUILD_TARGETS+= error-check | 131 | _REAL_BUILD_TARGETS+= error-check | |
132 | 132 | |||
133 | .PHONY: real-build | 133 | .PHONY: real-build | |
134 | real-build: ${_REAL_BUILD_TARGETS} | 134 | real-build: ${_REAL_BUILD_TARGETS} | |
135 | 135 | |||
136 | .PHONY: build-message | 136 | .PHONY: build-message | |
137 | build-message: | 137 | build-message: | |
138 | @${PHASE_MSG} "Building for ${PKGNAME}" | 138 | @${PHASE_MSG} "Building for ${PKGNAME}" | |
139 | 139 | |||
140 | ###################################################################### | 140 | ###################################################################### | |
141 | ### build-check-interactive (PRIVATE) | 141 | ### build-check-interactive (PRIVATE) | |
142 | ###################################################################### | 142 | ###################################################################### | |
143 | ### build-check-interactive checks whether we must do an interactive | 143 | ### build-check-interactive checks whether we must do an interactive | |
144 | ### build or not. | 144 | ### build or not. | |
145 | ### | 145 | ### | |
146 | build-check-interactive: | 146 | build-check-interactive: | |
147 | .if !empty(INTERACTIVE_STAGE:Mbuild) && defined(BATCH) | 147 | .if !empty(INTERACTIVE_STAGE:Mbuild) && defined(BATCH) | |
148 | @${ERROR_MSG} "The build stage of this package requires user interaction" | 148 | @${ERROR_MSG} "The build stage of this package requires user interaction" | |
149 | @${ERROR_MSG} "Please build manually with:" | 149 | @${ERROR_MSG} "Please build manually with:" | |
150 | @${ERROR_MSG} " \"cd ${.CURDIR} && ${MAKE} build\"" | 150 | @${ERROR_MSG} " \"cd ${.CURDIR} && ${MAKE} build\"" | |
151 | ${RUN} ${FALSE} | 151 | ${RUN} ${FALSE} | |
152 | .else | 152 | .else | |
153 | @${DO_NADA} | 153 | @${DO_NADA} | |
154 | .endif | 154 | .endif | |
155 | 155 | |||
156 | ###################################################################### | 156 | ###################################################################### | |
157 | ### pre-build, do-build, post-build (PUBLIC, override) | 157 | ### pre-build, do-build, post-build (PUBLIC, override) | |
158 | ###################################################################### | 158 | ###################################################################### | |
159 | ### {pre,do,post}-build are the heart of the package-customizable | 159 | ### {pre,do,post}-build are the heart of the package-customizable | |
160 | ### build targets, and may be overridden within a package Makefile. | 160 | ### build targets, and may be overridden within a package Makefile. | |
161 | ### | 161 | ### | |
162 | .PHONY: pre-build do-build post-build | 162 | .PHONY: pre-build do-build post-build | |
163 | 163 | |||
164 | .if !target(do-build) | 164 | .if !target(do-build) | |
165 | do-build: | 165 | do-build: | |
166 | . for _dir_ in ${BUILD_DIRS} | 166 | . for _dir_ in ${BUILD_DIRS} | |
167 | ${RUN}${_ULIMIT_CMD} \ | 167 | ${RUN}${_ULIMIT_CMD} \ | |
168 | cd ${WRKSRC} && cd ${_dir_} && \ | 168 | cd ${WRKSRC} && cd ${_dir_} && \ | |
169 | ${BUILD_MAKE_CMD} ${BUILD_TARGET} | 169 | ${BUILD_MAKE_CMD} ${BUILD_TARGET} | |
170 | . endfor | 170 | . endfor | |
171 | .endif | 171 | .endif | |
172 | 172 | |||
173 | .if !target(pre-build) | 173 | .if !target(pre-build) | |
174 | pre-build: | 174 | pre-build: | |
175 | @${DO_NADA} | 175 | @${DO_NADA} | |
176 | .endif | 176 | .endif | |
177 | 177 | |||
178 | .if !target(post-build) | 178 | .if !target(post-build) | |
179 | post-build: | 179 | post-build: | |
180 | @${DO_NADA} | 180 | @${DO_NADA} | |
181 | .endif | 181 | .endif | |
182 | 182 | |||
183 | # build-env: | |||
184 | # Starts an interactive shell in WRKSRC. | |||
185 | # | |||
186 | # This is only used during development and testing of a package | |||
187 | # to work in the same environment as the actual build. | |||
188 | # | |||
189 | # User-settable variables: | |||
190 | # | |||
191 | # BUILD_ENV_SHELL | |||
192 | # The shell to start. | |||
193 | # | |||
194 | # Default: ${SH} | |||
195 | # | |||
196 | # Keywords: debug build | |||
197 | ||||
183 | BUILD_ENV_SHELL?= ${SH} | 198 | BUILD_ENV_SHELL?= ${SH} | |
184 | .if defined(_PKGSRC_BARRIER) | 199 | .if defined(_PKGSRC_BARRIER) | |
185 | build-env: .PHONY configure | 200 | build-env: .PHONY configure | |
186 | @${STEP_MSG} "Entering the build environment for ${PKGNAME}" | 201 | @${STEP_MSG} "Entering the build environment for ${PKGNAME}" | |
187 | ${RUN}${_ULIMIT_CMD} \ | 202 | ${RUN}${_ULIMIT_CMD} \ | |
188 | cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL} | 203 | cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL} | |
189 | .else | 204 | .else | |
190 | build-env: barrier | 205 | build-env: barrier | |
191 | .endif | 206 | .endif |
@@ -1,118 +1,119 @@ | @@ -1,118 +1,119 @@ | |||
1 | # $NetBSD: bin-install.mk,v 1.26 2017/08/19 00:30:19 jlam Exp $ | 1 | # $NetBSD: bin-install.mk,v 1.27 2018/05/16 21:23:02 rillig Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | # This file provides the following targets: | 4 | # This file provides the following targets: | |
5 | # | 5 | # | |
6 | # bin-install: | 6 | # bin-install: | |
7 | # Tries to install a package from a prebuilt binary package, and | 7 | # Tries to install a package from a prebuilt binary package, and | |
8 | # if that doesn't work, builds the package from source. | 8 | # if that doesn't work, builds the package from source. | |
9 | # | 9 | # | |
10 | # === User-settable variables === | 10 | # === User-settable variables === | |
11 | # | 11 | # | |
12 | # PACKAGES | 12 | # PACKAGES | |
13 | # This directory is searched before BINPKG_SITES when trying to | 13 | # This directory is searched before BINPKG_SITES when trying to | |
14 | # install binary packages. | 14 | # install binary packages. | |
15 | # | 15 | # | |
16 | # BINPKG_SITES | 16 | # BINPKG_SITES | |
17 | # A list of URLs where binary packages can be found. | 17 | # A list of URLs where binary packages can be found. | |
18 | # See mk/defaults/mk.conf for details. | 18 | # See mk/defaults/mk.conf for details. | |
19 | # | 19 | # | |
20 | # === Command line variables === | 20 | # === Command line variables === | |
21 | # | 21 | # | |
22 | # PKGNAME_REQD | 22 | # PKGNAME_REQD | |
23 | # The package pattern that is required to be installed. By default, | 23 | # The package pattern that is required to be installed. By default, | |
24 | # any version of this package will do, but when installing | 24 | # any version of this package will do, but when installing | |
25 | # dependencies, a special version may be needed. | 25 | # dependencies, a special version may be needed. | |
26 | 26 | |||
27 | # XXX: This file contains implementation details from the "pkg" format, | 27 | # XXX: This file contains implementation details from the "pkg" format, | |
28 | # for example the All/ directory and the @cwd. | 28 | # for example the All/ directory and the @cwd. | |
29 | 29 | |||
30 | # List of sites carrying binary pkgs. Variables "rel" and "arch" are | 30 | # List of sites carrying binary packages. Shell Variables "rel" and | |
31 | # replaced with OS release ("1.5", ...) and architecture ("mipsel", ...) | 31 | # "arch" are replaced with OS release ("1.5", ...) and architecture | |
32 | # ("mipsel", ...). | |||
32 | .if ${OPSYS} == "NetBSD" | 33 | .if ${OPSYS} == "NetBSD" | |
33 | BINPKG_SITES?= \ | 34 | BINPKG_SITES?= \ | |
34 | http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel} \ | 35 | http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel} \ | |
35 | http://ftp6.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel} | 36 | http://ftp6.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel} | |
36 | .elif ${OPSYS} == "Minix" | 37 | .elif ${OPSYS} == "Minix" | |
37 | BINPKG_SITES?= \ | 38 | BINPKG_SITES?= \ | |
38 | ftp://ftp.minix3.org/pub/minix/packages/$$(${UNAME} -r)/$${arch} | 39 | ftp://ftp.minix3.org/pub/minix/packages/$$(${UNAME} -r)/$${arch} | |
39 | .elif ${OPSYS} == "DragonFly" | 40 | .elif ${OPSYS} == "DragonFly" | |
40 | BINPKG_SITES?= \ | 41 | BINPKG_SITES?= \ | |
41 | http://mirror-master.dragonflybsd.org/packages/$${arch}/DragonFly-$${rel}/stable | 42 | http://mirror-master.dragonflybsd.org/packages/$${arch}/DragonFly-$${rel}/stable | |
42 | .else | 43 | .else | |
43 | BINPKG_SITES?= | 44 | BINPKG_SITES?= | |
44 | .endif | 45 | .endif | |
45 | 46 | |||
46 | PKGNAME_REQD?= ${PKGNAME} | 47 | PKGNAME_REQD?= ${PKGNAME} | |
47 | 48 | |||
48 | .PHONY: bin-install | 49 | .PHONY: bin-install | |
49 | .PHONY: do-bin-install do-bin-install-from-source | 50 | .PHONY: do-bin-install do-bin-install-from-source | |
50 | .PHONY: su-do-bin-install | 51 | .PHONY: su-do-bin-install | |
51 | .PHONY: acquire-bin-install-lock locked-su-do-bin-install release-bin-install-lock | 52 | .PHONY: acquire-bin-install-lock locked-su-do-bin-install release-bin-install-lock | |
52 | 53 | |||
53 | bin-install: \ | 54 | bin-install: \ | |
54 | do-bin-install \ | 55 | do-bin-install \ | |
55 | do-bin-install-from-source | 56 | do-bin-install-from-source | |
56 | 57 | |||
57 | . if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | 58 | . if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | |
58 | do-bin-install: su-do-bin-install | 59 | do-bin-install: su-do-bin-install | |
59 | . else | 60 | . else | |
60 | do-bin-install: su-target | 61 | do-bin-install: su-target | |
61 | . endif | 62 | . endif | |
62 | @${PHASE_MSG} "Binary install for "${PKGNAME_REQD:Q} | 63 | @${PHASE_MSG} "Binary install for "${PKGNAME_REQD:Q} | |
63 | 64 | |||
64 | su-do-bin-install: \ | 65 | su-do-bin-install: \ | |
65 | acquire-bin-install-lock \ | 66 | acquire-bin-install-lock \ | |
66 | locked-su-do-bin-install \ | 67 | locked-su-do-bin-install \ | |
67 | release-bin-install-lock | 68 | release-bin-install-lock | |
68 | 69 | |||
69 | acquire-bin-install-lock: \ | 70 | acquire-bin-install-lock: \ | |
70 | acquire-localbase-lock | 71 | acquire-localbase-lock | |
71 | 72 | |||
72 | release-bin-install-lock: \ | 73 | release-bin-install-lock: \ | |
73 | release-localbase-lock | 74 | release-localbase-lock | |
74 | 75 | |||
75 | # Note: PKGREPOSITORY is usually ${PACKAGES}/All | 76 | # Note: PKGREPOSITORY is usually ${PACKAGES}/All | |
76 | _BIN_INSTALL_PREPARE_CMD= \ | 77 | _BIN_INSTALL_PREPARE_CMD= \ | |
77 | found=`${PKG_BEST_EXISTS} "${PKGWILDCARD}" || ${TRUE}`; \ | 78 | found=`${PKG_BEST_EXISTS} "${PKGWILDCARD}" || ${TRUE}`; \ | |
78 | if [ "$$found" != "" ]; then \ | 79 | if [ "$$found" != "" ]; then \ | |
79 | ${ERROR_MSG} "$$found is already installed - perhaps an older version?"; \ | 80 | ${ERROR_MSG} "$$found is already installed - perhaps an older version?"; \ | |
80 | ${ERROR_MSG} "If so, you may wish to \`\`pkg_delete $$found'' and install"; \ | 81 | ${ERROR_MSG} "If so, you may wish to \`\`pkg_delete $$found'' and install"; \ | |
81 | ${ERROR_MSG} "this package again by \`\`${MAKE} bin-install'' to upgrade it properly."; \ | 82 | ${ERROR_MSG} "this package again by \`\`${MAKE} bin-install'' to upgrade it properly."; \ | |
82 | exit 1; \ | 83 | exit 1; \ | |
83 | fi; \ | 84 | fi; \ | |
84 | rel=${_SHORT_UNAME_R:Q}; \ | 85 | rel=${_SHORT_UNAME_R:Q}; \ | |
85 | arch=${MACHINE_ARCH:Q}; \ | 86 | arch=${MACHINE_ARCH:Q}; \ | |
86 | pkg_path=${PKGREPOSITORY:Q}; \ | 87 | pkg_path=${PKGREPOSITORY:Q}; \ | |
87 | set args ${BINPKG_SITES}; shift; \ | 88 | set args ${BINPKG_SITES}; shift; \ | |
88 | for i in "$$@"; do \ | 89 | for i in "$$@"; do \ | |
89 | pkg_path="$$pkg_path;$$i/All"; \ | 90 | pkg_path="$$pkg_path;$$i/All"; \ | |
90 | done; | 91 | done; | |
91 | 92 | |||
92 | locked-su-do-bin-install: | 93 | locked-su-do-bin-install: | |
93 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | 94 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | |
94 | ${RUN} ${_BIN_INSTALL_PREPARE_CMD} \ | 95 | ${RUN} ${_BIN_INSTALL_PREPARE_CMD} \ | |
95 | ${STEP_MSG} "Installing ${PKGNAME} from $$pkg_path"; \ | 96 | ${STEP_MSG} "Installing ${PKGNAME} from $$pkg_path"; \ | |
96 | if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKGTOOLS_ENV} ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:Q}${PKG_SUFX}; then \ | 97 | if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKGTOOLS_ENV} ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:Q}${PKG_SUFX}; then \ | |
97 | ${ECHO} "Fixing recorded cwd..."; \ | 98 | ${ECHO} "Fixing recorded cwd..."; \ | |
98 | ${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp; \ | 99 | ${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp; \ | |
99 | ${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS; \ | 100 | ${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS; \ | |
100 | ${ECHO} "`${PKG_INFO} -e ${PKGNAME_REQD:Q}` successfully installed."; \ | 101 | ${ECHO} "`${PKG_INFO} -e ${PKGNAME_REQD:Q}` successfully installed."; \ | |
101 | fi | 102 | fi | |
102 | .else | 103 | .else | |
103 | ${RUN} ${_BIN_INSTALL_PREPARE_CMD} \ | 104 | ${RUN} ${_BIN_INSTALL_PREPARE_CMD} \ | |
104 | pkgpattern=${PKGNAME_REQD:Q}; \ | 105 | pkgpattern=${PKGNAME_REQD:Q}; \ | |
105 | ${STEP_MSG} "Installing $$pkgpattern from $$pkg_path"; \ | 106 | ${STEP_MSG} "Installing $$pkgpattern from $$pkg_path"; \ | |
106 | if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKGTOOLS_ENV} ${PKG_ADD} ${_BIN_INSTALL_FLAGS} "$$pkgpattern"; then \ | 107 | if ${PKGSRC_SETENV} PKG_PATH="$$pkg_path" ${PKGTOOLS_ENV} ${PKG_ADD} ${_BIN_INSTALL_FLAGS} "$$pkgpattern"; then \ | |
107 | installed=`${PKG_INFO} -e "$$pkgpattern"`; \ | 108 | installed=`${PKG_INFO} -e "$$pkgpattern"`; \ | |
108 | ${ECHO} "$$installed successfully installed."; \ | 109 | ${ECHO} "$$installed successfully installed."; \ | |
109 | fi | 110 | fi | |
110 | .endif | 111 | .endif | |
111 | 112 | |||
112 | do-bin-install-from-source: | 113 | do-bin-install-from-source: | |
113 | ${RUN} pkgpattern=${PKGNAME_REQD:Q}; \ | 114 | ${RUN} pkgpattern=${PKGNAME_REQD:Q}; \ | |
114 | ${PKG_INFO} -qe "$$pkgpattern" || { \ | 115 | ${PKG_INFO} -qe "$$pkgpattern" || { \ | |
115 | ${STEP_MSG} "No binary package found for $$pkgpattern; installing from source."; \ | 116 | ${STEP_MSG} "No binary package found for $$pkgpattern; installing from source."; \ | |
116 | ${RECURSIVE_MAKE} ${MAKEFLAGS} DEPENDS_TARGET=${DEPENDS_TARGET:Q} package-install \ | 117 | ${RECURSIVE_MAKE} ${MAKEFLAGS} DEPENDS_TARGET=${DEPENDS_TARGET:Q} package-install \ | |
117 | && ${RECURSIVE_MAKE} ${MAKEFLAGS} clean; \ | 118 | && ${RECURSIVE_MAKE} ${MAKEFLAGS} clean; \ | |
118 | } | 119 | } |
@@ -1,184 +1,185 @@ | @@ -1,184 +1,185 @@ | |||
1 | # $NetBSD: can-be-built-here.mk,v 1.8 2015/01/01 06:06:06 dholland Exp $ | 1 | # $NetBSD: can-be-built-here.mk,v 1.9 2018/05/16 21:23:02 rillig Exp $ | |
2 | # | 2 | # | |
3 | # This file checks whether a package can be built in the current pkgsrc | 3 | # This file checks whether a package can be built in the current pkgsrc | |
4 | # environment. It checks the following variables: | 4 | # environment. It checks the following variables: | |
5 | # | 5 | # | |
6 | # * NOT_FOR_COMPILER, ONLY_FOR_COMPILER | 6 | # * NOT_FOR_COMPILER, ONLY_FOR_COMPILER | |
7 | # * NOT_FOR_PLATFORM, ONLY_FOR_PLATFORM | 7 | # * NOT_FOR_PLATFORM, ONLY_FOR_PLATFORM | |
8 | # * BROKEN_ON_PLATFORM, BROKEN_EXCEPT_ON_PLATFORM | 8 | # * BROKEN_ON_PLATFORM, BROKEN_EXCEPT_ON_PLATFORM | |
9 | # * NOT_FOR_BULK_PLATFORM | 9 | # * NOT_FOR_BULK_PLATFORM | |
10 | # * NOT_FOR_UNPRIVILEGED, ONLY_FOR_UNPRIVILEGED | 10 | # * NOT_FOR_UNPRIVILEGED, ONLY_FOR_UNPRIVILEGED | |
11 | # * PKG_FAIL_REASON, PKG_SKIP_REASON | 11 | # * PKG_FAIL_REASON, PKG_SKIP_REASON | |
12 | # | 12 | # | |
13 | # It also depends on the following internal variables: | 13 | # It also depends on the following internal variables: | |
14 | # | 14 | # | |
15 | # NO_SKIP | 15 | # NO_SKIP | |
16 | # When defined, the checks in this file are skipped. It is called | 16 | # When defined, the checks in this file are skipped. It is called | |
17 | # NO_SKIP because the code that skips building the package should | 17 | # NO_SKIP because the code that skips building the package should | |
18 | # _not_ be run. | 18 | # _not_ be run. | |
19 | # | 19 | # | |
20 | # XXX: It's weird to have three negations in such a short variable | 20 | # XXX: It's weird to have three negations in such a short variable | |
21 | # name. | 21 | # name. | |
22 | # | 22 | # | |
23 | # Keywords: compiler broken only platform | |||
23 | 24 | |||
24 | _CBBH_CHECKS= # none, but see below. | 25 | _CBBH_CHECKS= # none, but see below. | |
25 | 26 | |||
26 | # Check NOT_FOR_COMPILER | 27 | # Check NOT_FOR_COMPILER | |
27 | _CBBH_CHECKS+= ncomp | 28 | _CBBH_CHECKS+= ncomp | |
28 | _CBBH_MSGS.ncomp= "This package is not available for these compilers: "${NOT_FOR_COMPILER:Q}"." | 29 | _CBBH_MSGS.ncomp= "This package is not available for these compilers: "${NOT_FOR_COMPILER:Q}"." | |
29 | 30 | |||
30 | _CBBH.ncomp= yes | 31 | _CBBH.ncomp= yes | |
31 | .for c in ${NOT_FOR_COMPILER} | 32 | .for c in ${NOT_FOR_COMPILER} | |
32 | . for pc in ${PKGSRC_COMPILER} | 33 | . for pc in ${PKGSRC_COMPILER} | |
33 | # The left-hand side of the == operator must be a "real" variable. | 34 | # The left-hand side of the == operator must be a "real" variable. | |
34 | _c:= ${c} | 35 | _c:= ${c} | |
35 | . if ${_c} == ${pc} | 36 | . if ${_c} == ${pc} | |
36 | _CBBH.ncomp= no | 37 | _CBBH.ncomp= no | |
37 | . endif | 38 | . endif | |
38 | . endfor | 39 | . endfor | |
39 | .endfor | 40 | .endfor | |
40 | 41 | |||
41 | # Check ONLY_FOR_COMPILER | 42 | # Check ONLY_FOR_COMPILER | |
42 | _CBBH_CHECKS+= ocomp | 43 | _CBBH_CHECKS+= ocomp | |
43 | _CBBH_MSGS.ocomp= "This package is only available for these compilers: "${ONLY_FOR_COMPILER:Q}"." | 44 | _CBBH_MSGS.ocomp= "This package is only available for these compilers: "${ONLY_FOR_COMPILER:Q}"." | |
44 | 45 | |||
45 | _CBBH.ocomp= yes | 46 | _CBBH.ocomp= yes | |
46 | .if defined(ONLY_FOR_COMPILER) && !empty(ONLY_FOR_COMPILER) | 47 | .if defined(ONLY_FOR_COMPILER) && !empty(ONLY_FOR_COMPILER) | |
47 | _CBBH.ocomp= yes | 48 | _CBBH.ocomp= yes | |
48 | # Ignore compilers that only cache or distribute the real work that has | 49 | # Ignore compilers that only cache or distribute the real work that has | |
49 | # to be done (see PR 35173). | 50 | # to be done (see PR 35173). | |
50 | . for pc in ${PKGSRC_COMPILER:Nccache:Ndistcc} | 51 | . for pc in ${PKGSRC_COMPILER:Nccache:Ndistcc} | |
51 | . if empty(ONLY_FOR_COMPILER:M${pc}) | 52 | . if empty(ONLY_FOR_COMPILER:M${pc}) | |
52 | _CBBH.ocomp= no | 53 | _CBBH.ocomp= no | |
53 | . endif | 54 | . endif | |
54 | . endfor | 55 | . endfor | |
55 | .endif | 56 | .endif | |
56 | 57 | |||
57 | # Check NOT_FOR_PLATFORM | 58 | # Check NOT_FOR_PLATFORM | |
58 | _CBBH_CHECKS+= nplat | 59 | _CBBH_CHECKS+= nplat | |
59 | _CBBH_MSGS.nplat= "This package is not available for these platforms: "${NOT_FOR_PLATFORM:Q}"." | 60 | _CBBH_MSGS.nplat= "This package is not available for these platforms: "${NOT_FOR_PLATFORM:Q}"." | |
60 | 61 | |||
61 | _CBBH.nplat= yes | 62 | _CBBH.nplat= yes | |
62 | .for p in ${NOT_FOR_PLATFORM} | 63 | .for p in ${NOT_FOR_PLATFORM} | |
63 | . if !empty(MACHINE_PLATFORM:M${p}) | 64 | . if !empty(MACHINE_PLATFORM:M${p}) | |
64 | _CBBH.nplat= no | 65 | _CBBH.nplat= no | |
65 | . endif | 66 | . endif | |
66 | .endfor | 67 | .endfor | |
67 | 68 | |||
68 | # Check NOT_FOR_BULK_PLATFORM | 69 | # Check NOT_FOR_BULK_PLATFORM | |
69 | _CBBH_CHECKS+= nbplat | 70 | _CBBH_CHECKS+= nbplat | |
70 | _CBBH_MSGS.nbplat= "This package is known to stall the bulk build on these platforms: "${NOT_FOR_BULK_PLATFORM:Q}"." | 71 | _CBBH_MSGS.nbplat= "This package is known to stall the bulk build on these platforms: "${NOT_FOR_BULK_PLATFORM:Q}"." | |
71 | 72 | |||
72 | _CBBH.nbplat= yes | 73 | _CBBH.nbplat= yes | |
73 | .for p in ${NOT_FOR_BULK_PLATFORM} | 74 | .for p in ${NOT_FOR_BULK_PLATFORM} | |
74 | . if defined(BATCH) && !empty(MACHINE_PLATFORM:M${p}) | 75 | . if defined(BATCH) && !empty(MACHINE_PLATFORM:M${p}) | |
75 | _CBBH.nbplat= no | 76 | _CBBH.nbplat= no | |
76 | . endif | 77 | . endif | |
77 | .endfor | 78 | .endfor | |
78 | 79 | |||
79 | # Check ONLY_FOR_PLATFORM | 80 | # Check ONLY_FOR_PLATFORM | |
80 | _CBBH_CHECKS+= oplat | 81 | _CBBH_CHECKS+= oplat | |
81 | _CBBH_MSGS.oplat= "This package is only available for these platforms: "${ONLY_FOR_PLATFORM:Q}"." | 82 | _CBBH_MSGS.oplat= "This package is only available for these platforms: "${ONLY_FOR_PLATFORM:Q}"." | |
82 | 83 | |||
83 | _CBBH.oplat= yes | 84 | _CBBH.oplat= yes | |
84 | .if defined(ONLY_FOR_PLATFORM) && !empty(ONLY_FOR_PLATFORM) | 85 | .if defined(ONLY_FOR_PLATFORM) && !empty(ONLY_FOR_PLATFORM) | |
85 | _CBBH.oplat= no | 86 | _CBBH.oplat= no | |
86 | . for p in ${ONLY_FOR_PLATFORM} | 87 | . for p in ${ONLY_FOR_PLATFORM} | |
87 | . if !empty(MACHINE_PLATFORM:M${p}) | 88 | . if !empty(MACHINE_PLATFORM:M${p}) | |
88 | _CBBH.oplat= yes | 89 | _CBBH.oplat= yes | |
89 | . endif | 90 | . endif | |
90 | . endfor | 91 | . endfor | |
91 | .endif | 92 | .endif | |
92 | 93 | |||
93 | # Check BROKEN_ON_PLATFORM | 94 | # Check BROKEN_ON_PLATFORM | |
94 | _CBBH_CHECKS+= bplat | 95 | _CBBH_CHECKS+= bplat | |
95 | _CBBH_MSGS.bplat= "This package is broken on these platforms: "${BROKEN_ON_PLATFORM:Q}"." | 96 | _CBBH_MSGS.bplat= "This package is broken on these platforms: "${BROKEN_ON_PLATFORM:Q}"." | |
96 | 97 | |||
97 | _CBBH.bplat= yes | 98 | _CBBH.bplat= yes | |
98 | .for p in ${BROKEN_ON_PLATFORM} | 99 | .for p in ${BROKEN_ON_PLATFORM} | |
99 | . if !empty(MACHINE_PLATFORM:M${p}) | 100 | . if !empty(MACHINE_PLATFORM:M${p}) | |
100 | _CBBH.bplat= no | 101 | _CBBH.bplat= no | |
101 | . endif | 102 | . endif | |
102 | .endfor | 103 | .endfor | |
103 | 104 | |||
104 | # Check BROKEN_EXCEPT_ON_PLATFORM | 105 | # Check BROKEN_EXCEPT_ON_PLATFORM | |
105 | _CBBH_CHECKS+= beplat | 106 | _CBBH_CHECKS+= beplat | |
106 | _CBBH_MSGS.beplat= "This package is broken except on these platforms: "${BROKEN_EXCEPT_ON_PLATFORM:Q}"." | 107 | _CBBH_MSGS.beplat= "This package is broken except on these platforms: "${BROKEN_EXCEPT_ON_PLATFORM:Q}"." | |
107 | 108 | |||
108 | _CBBH.beplat= yes | 109 | _CBBH.beplat= yes | |
109 | .if defined(BROKEN_EXCEPT_ON_PLATFORM) && !empty(BROKEN_EXCEPT_ON_PLATFORM) | 110 | .if defined(BROKEN_EXCEPT_ON_PLATFORM) && !empty(BROKEN_EXCEPT_ON_PLATFORM) | |
110 | _CBBH.beplat= no | 111 | _CBBH.beplat= no | |
111 | . for p in ${BROKEN_EXCEPT_ON_PLATFORM} | 112 | . for p in ${BROKEN_EXCEPT_ON_PLATFORM} | |
112 | . if !empty(MACHINE_PLATFORM:M${p}) | 113 | . if !empty(MACHINE_PLATFORM:M${p}) | |
113 | _CBBH.beplat= yes | 114 | _CBBH.beplat= yes | |
114 | . endif | 115 | . endif | |
115 | . endfor | 116 | . endfor | |
116 | .endif | 117 | .endif | |
117 | 118 | |||
118 | # Check NOT_FOR_UNPRIVILEGED | 119 | # Check NOT_FOR_UNPRIVILEGED | |
119 | _CBBH_CHECKS+= nunpriv | 120 | _CBBH_CHECKS+= nunpriv | |
120 | _CBBH_MSGS.nunpriv= "This package is not available in unprivileged mode." | 121 | _CBBH_MSGS.nunpriv= "This package is not available in unprivileged mode." | |
121 | 122 | |||
122 | _CBBH.nunpriv= yes | 123 | _CBBH.nunpriv= yes | |
123 | .if defined(NOT_FOR_UNPRIVILEGED) && !empty(NOT_FOR_UNPRIVILEGED:M[Yy][Ee][Ss]) | 124 | .if defined(NOT_FOR_UNPRIVILEGED) && !empty(NOT_FOR_UNPRIVILEGED:M[Yy][Ee][Ss]) | |
124 | . if !empty(UNPRIVILEGED:M[Yy][Ee][Ss]) | 125 | . if !empty(UNPRIVILEGED:M[Yy][Ee][Ss]) | |
125 | _CBBH.nunpriv= no | 126 | _CBBH.nunpriv= no | |
126 | . endif | 127 | . endif | |
127 | .endif | 128 | .endif | |
128 | 129 | |||
129 | # Check ONLY_FOR_UNPRIVILEGED | 130 | # Check ONLY_FOR_UNPRIVILEGED | |
130 | _CBBH_CHECKS+= ounpriv | 131 | _CBBH_CHECKS+= ounpriv | |
131 | _CBBH_MSGS.ounpriv= "This package is not available in unprivileged mode." | 132 | _CBBH_MSGS.ounpriv= "This package is not available in unprivileged mode." | |
132 | 133 | |||
133 | _CBBH.ounpriv= yes | 134 | _CBBH.ounpriv= yes | |
134 | .if defined(ONLY_FOR_UNPRIVILEGED) && !empty(ONLY_FOR_UNPRIVILEGED:M[Yy][Ee][Ss]) | 135 | .if defined(ONLY_FOR_UNPRIVILEGED) && !empty(ONLY_FOR_UNPRIVILEGED:M[Yy][Ee][Ss]) | |
135 | . if empty(UNPRIVILEGED:M[Yy][Ee][Ss]) | 136 | . if empty(UNPRIVILEGED:M[Yy][Ee][Ss]) | |
136 | _CBBH.ounpriv= no | 137 | _CBBH.ounpriv= no | |
137 | . endif | 138 | . endif | |
138 | .endif | 139 | .endif | |
139 | 140 | |||
140 | # Check PKG_FAIL_REASON | 141 | # Check PKG_FAIL_REASON | |
141 | _CBBH_CHECKS+= fail | 142 | _CBBH_CHECKS+= fail | |
142 | _CBBH_MSGS.fail= "This package has set PKG_FAIL_REASON:" ${PKG_FAIL_REASON} | 143 | _CBBH_MSGS.fail= "This package has set PKG_FAIL_REASON:" ${PKG_FAIL_REASON} | |
143 | 144 | |||
144 | _CBBH.fail= yes | 145 | _CBBH.fail= yes | |
145 | .if defined(PKG_FAIL_REASON) && !empty(PKG_FAIL_REASON) | 146 | .if defined(PKG_FAIL_REASON) && !empty(PKG_FAIL_REASON) | |
146 | _CBBH.fail= no | 147 | _CBBH.fail= no | |
147 | .endif | 148 | .endif | |
148 | 149 | |||
149 | # Check PKG_SKIP_REASON | 150 | # Check PKG_SKIP_REASON | |
150 | _CBBH_CHECKS+= skip | 151 | _CBBH_CHECKS+= skip | |
151 | _CBBH_MSGS.skip= "This package has set PKG_SKIP_REASON:" ${PKG_SKIP_REASON} | 152 | _CBBH_MSGS.skip= "This package has set PKG_SKIP_REASON:" ${PKG_SKIP_REASON} | |
152 | 153 | |||
153 | _CBBH.skip= yes | 154 | _CBBH.skip= yes | |
154 | .if defined(PKG_SKIP_REASON) && !empty(PKG_SKIP_REASON) | 155 | .if defined(PKG_SKIP_REASON) && !empty(PKG_SKIP_REASON) | |
155 | _CBBH.skip= no | 156 | _CBBH.skip= no | |
156 | .endif | 157 | .endif | |
157 | 158 | |||
158 | # Collect and combine the results | 159 | # Collect and combine the results | |
159 | _CBBH= yes | 160 | _CBBH= yes | |
160 | _CBBH_MSGS= # none | 161 | _CBBH_MSGS= # none | |
161 | .for c in ${_CBBH_CHECKS} | 162 | .for c in ${_CBBH_CHECKS} | |
162 | . if ${_CBBH.${c}} != "yes" | 163 | . if ${_CBBH.${c}} != "yes" | |
163 | _CBBH= no | 164 | _CBBH= no | |
164 | _CBBH_MSGS+= ${_CBBH_MSGS.${c}} | 165 | _CBBH_MSGS+= ${_CBBH_MSGS.${c}} | |
165 | . endif | 166 | . endif | |
166 | .endfor | 167 | .endfor | |
167 | 168 | |||
168 | # In the first line, this target prints either "yes" or "no", saying | 169 | # In the first line, this target prints either "yes" or "no", saying | |
169 | # whether this package can be built. If the package can not be built, | 170 | # whether this package can be built. If the package can not be built, | |
170 | # the reasons are given in the following lines. | 171 | # the reasons are given in the following lines. | |
171 | # | 172 | # | |
172 | can-be-built-here: .PHONY | 173 | can-be-built-here: .PHONY | |
173 | @${ECHO} ${_CBBH} | 174 | @${ECHO} ${_CBBH} | |
174 | @:; ${_CBBH_MSGS:@m@${ECHO} ${m} ; @} | 175 | @:; ${_CBBH_MSGS:@m@${ECHO} ${m} ; @} | |
175 | 176 | |||
176 | _cbbh: | 177 | _cbbh: | |
177 | @:; ${_CBBH_MSGS:@m@${ERROR_MSG} ${m} ; @} | 178 | @:; ${_CBBH_MSGS:@m@${ERROR_MSG} ${m} ; @} | |
178 | @${FALSE} | 179 | @${FALSE} | |
179 | 180 | |||
180 | .if !defined(NO_SKIP) && ${_CBBH} == "no" | 181 | .if !defined(NO_SKIP) && ${_CBBH} == "no" | |
181 | # XXX: bootstrap-depends is only used here because it is depended | 182 | # XXX: bootstrap-depends is only used here because it is depended | |
182 | # upon by each of the "main" pkgsrc targets. | 183 | # upon by each of the "main" pkgsrc targets. | |
183 | bootstrap-depends: _cbbh | 184 | bootstrap-depends: _cbbh | |
184 | .endif | 185 | .endif |