Fri Apr 12 19:55:29 2024 UTC (44d)
mk/pkgformat/pkg: Handle OBJECT_FMT mismatch in cross builds.

No change to native builds because OBJECT_FMT = NATIVE_OBJECT_FMT in
native builds.


(riastradh)
diff -r1.20 -r1.21 pkgsrc/mk/pkgformat/pkg/depends.mk

cvs diff -r1.20 -r1.21 pkgsrc/mk/pkgformat/pkg/depends.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/pkg/depends.mk 2024/04/12 19:54:44 1.20
+++ pkgsrc/mk/pkgformat/pkg/depends.mk 2024/04/12 19:55:29 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: depends.mk,v 1.20 2024/04/12 19:54:44 riastradh Exp $ 1# $NetBSD: depends.mk,v 1.21 2024/04/12 19:55:29 riastradh Exp $
2 2
3# This command prints out the dependency patterns for all full (run-time) 3# This command prints out the dependency patterns for all full (run-time)
4# dependencies of the package. 4# dependencies of the package.
5# 5#
6# This is used in install.mk and metadata.mk. 6# This is used in install.mk and metadata.mk.
7# 7#
8 8
9# ${_DEPENDS_FILE} contains all the dependency information 9# ${_DEPENDS_FILE} contains all the dependency information
10# for the package. The format of each line of the file is: 10# for the package. The format of each line of the file is:
11# 11#
12# <depends_type> <pattern> <directory> 12# <depends_type> <pattern> <directory>
13# 13#
14# Valid dependency types are "bootstrap", "tool", "build", "test" and "full". 14# Valid dependency types are "bootstrap", "tool", "build", "test" and "full".
@@ -152,36 +152,38 @@ _DEPENDS_INSTALL_CMD= \ @@ -152,36 +152,38 @@ _DEPENDS_INSTALL_CMD= \
152 pkg=`${_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;; \ 152 pkg=`${_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;; \
153 esac; \ 153 esac; \
154 case "$$pkg" in \ 154 case "$$pkg" in \
155 "") ${ERROR_MSG} "[depends.mk] A package matching \`\`$$pattern'' should"; \ 155 "") ${ERROR_MSG} "[depends.mk] A package matching \`\`$$pattern'' should"; \
156 ${ERROR_MSG} " be installed, but one cannot be found. Perhaps there is a"; \ 156 ${ERROR_MSG} " be installed, but one cannot be found. Perhaps there is a"; \
157 ${ERROR_MSG} " stale work directory for $$dir?"; \ 157 ${ERROR_MSG} " stale work directory for $$dir?"; \
158 exit 1; \ 158 exit 1; \
159 esac; \ 159 esac; \
160 ${STEP_MSG} "Returning to build of ${PKGNAME}"; \ 160 ${STEP_MSG} "Returning to build of ${PKGNAME}"; \
161 ;; \ 161 ;; \
162 *) \ 162 *) \
163 case $$type in \ 163 case $$type in \
164 bootstrap|tool) \ 164 bootstrap|tool) \
165 objfmt=`${HOST_PKG_INFO} -Q OBJECT_FMT "$$pkg"`;; \ 165 objfmt=`${HOST_PKG_INFO} -Q OBJECT_FMT "$$pkg"`; \
 166 needobjfmt=${NATIVE_OBJECT_FMT:Q};; \
166 build|test|full) \ 167 build|test|full) \
167 objfmt=`${PKG_INFO} -Q OBJECT_FMT "$$pkg"`;; \ 168 objfmt=`${PKG_INFO} -Q OBJECT_FMT "$$pkg"`; \
 169 needobjfmt=${OBJECT_FMT:Q};; \
168 esac; \ 170 esac; \
169 case "$$objfmt" in \ 171 case "$$objfmt" in \
170 "") ${WARNING_MSG} "[depends.mk] Unknown object format for installed package $$pkg" ;; \ 172 "") ${WARNING_MSG} "[depends.mk] Unknown object format for installed package $$pkg" ;; \
171 ${OBJECT_FMT}) ;; \ 173 $$needobjfmt) ;; \
172 *) ${ERROR_MSG} "[depends.mk] Installed package $$pkg has an"; \ 174 *) ${ERROR_MSG} "[depends.mk] Installed package $$pkg has an"; \
173 ${ERROR_MSG} " object format \`\`$$objfmt'' which differs from \`\`${OBJECT_FMT}''. Please"; \ 175 ${ERROR_MSG} " object format \`\`$$objfmt'' which differs from \`\`$$needobjfmt''. Please"; \
174 ${ERROR_MSG} " update the $$pkg package to ${OBJECT_FMT}."; \ 176 ${ERROR_MSG} " update the $$pkg package to $$needobjfmt."; \
175 exit 1; \ 177 exit 1; \
176 ;; \ 178 ;; \
177 esac; \ 179 esac; \
178 silent=${_BOOTSTRAP_VERBOSE:Dyes}; \ 180 silent=${_BOOTSTRAP_VERBOSE:Dyes}; \
179 if ${TEST} -z "$${silent}"; then \ 181 if ${TEST} -z "$${silent}"; then \
180 ${STEP_MSG} "$$Type dependency $$pattern: found $$pkg"; \ 182 ${STEP_MSG} "$$Type dependency $$pattern: found $$pkg"; \
181 fi; \ 183 fi; \
182 ;; \ 184 ;; \
183 esac 185 esac
184 186
185${_DEPENDS_FILE}: 187${_DEPENDS_FILE}:
186 ${RUN} \ 188 ${RUN} \
187 ${TEST} -d ${.TARGET:H} || ${MKDIR} ${.TARGET:H}; \ 189 ${TEST} -d ${.TARGET:H} || ${MKDIR} ${.TARGET:H}; \