summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk15
1 files changed, 14 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index c724302daa4..a9bea62fdd5 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1683 2005/06/01 17:05:19 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1684 2005/06/01 17:27:22 jlam Exp $
#
# This file is in the public domain.
#
@@ -4836,6 +4836,19 @@ ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR}
.endfor
.undef _phase_
+# *.makevars.mk doesn't exist until after ${WRKDIR} is created, which
+# doesn't happen until after the package is extracted. Prior to
+# extraction, cache the variables named in MAKEVARS using MAKEFLAGS
+# instead.
+#
+.if !exists(${EXTRACT_COOKIE})
+. for _var_ in ${MAKEVARS:O:u}
+. if defined(${_var_})
+MAKEFLAGS+= ${_var_}=${${_var_}:Q}
+. endif
+. endfor
+.endif
+
# show-tools emits a /bin/sh shell script that defines all known tools
# to the values they have in the pkgsrc infrastructure.
#