diff options
author | jlam <jlam> | 2005-05-09 05:06:55 +0000 |
---|---|---|
committer | jlam <jlam> | 2005-05-09 05:06:55 +0000 |
commit | c34608ae916ed78ce7d48d4642faf538caec14e2 (patch) | |
tree | 3bff071687c8b973f251436d751c2dc954d88ba6 /mk/buildlink3/bsd.buildlink3.mk | |
parent | 2fe098a1c1aa36d5b7c5ceafeb584a0208f9d74a (diff) | |
download | pkgsrc-c34608ae916ed78ce7d48d4642faf538caec14e2.tar.gz |
Teach bsd.pkg.mk to create a phase-specific "makevars.mk" file that
caches variable definitions that were computed by make. These variables
are specified by listing them in MAKE_VARS, e.g.,
.if !defined(FOO)
FOO!= very_time_consuming_command
.endif
MAKE_VARS+= FOO
bsd.pkg.mk will include only the one generated during the most recent
phase. A particular phase's makevars.mk file consists of variable
definitions that are a superset of all of the ones produced in previous
phases of the build.
The caching is useful because bsd.pkg.mk invokes make recursively,
which in the example above has the potential to run the very time-consuming
command each time unless we cause FOO to be defined for the sub-make
processes. We don't cache via MAKE_FLAGS because MAKE_FLAGS isn't
consistently applied to every invocation of make, and also because
MAKE_FLAGS can overflow the maximum length of a make variable very
quickly if we add many values to it.
One important and desirable property of variables cached via MAKE_VARS
is that they only apply to the current package, and not to any
dependencies whose builds may have been triggered by the current
package.
The makevars.mk files are generated by new targets fetch-vars,
extract-vars, patch-vars, etc., and these targets are built during
the corresponding real-* target to ensure that they are being invoked
with PKG_PHASE set to the proper value.
Also, remove the variables cache file that bsd.wrapper.mk was generating
since the new makevars.mk files provide the same functionality at a
higher level. Change all WRAPPER_VARS definitions that were used by
the old wrapper-phase cache file into MAKE_VARS definitions.
Diffstat (limited to 'mk/buildlink3/bsd.buildlink3.mk')
-rw-r--r-- | mk/buildlink3/bsd.buildlink3.mk | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk index 283c9ac1c27..4d47c72ea5b 100644 --- a/mk/buildlink3/bsd.buildlink3.mk +++ b/mk/buildlink3/bsd.buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink3.mk,v 1.168 2005/02/17 12:15:44 seb Exp $ +# $NetBSD: bsd.buildlink3.mk,v 1.169 2005/05/09 05:06:55 jlam Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -313,9 +313,9 @@ _BLNK_PKG_DBDIR.${_pkg_}!= \ ${ECHO} $$dir . endif . endfor -. if empty(_BLNK_PKG_DBDIR.${_pkg_}:M*not_found) -WRAPPER_VARS+= _BLNK_PKG_DBDIR.${_pkg_} -. endif +. endif +. if empty(_BLNK_PKG_DBDIR.${_pkg_}:M*not_found) +MAKE_VARS+= _BLNK_PKG_DBDIR.${_pkg_} . endif . if empty(_BLNK_PKG_DBDIR.${_pkg_}:M*not_found) @@ -344,9 +344,9 @@ BUILDLINK_PREFIX.${_pkg_}!= \ BUILDLINK_PREFIX.${_pkg_}= BUILDLINK_PREFIX.${_pkg_}_not_found . endif . endif -. if empty(BUILDLINK_PREFIX.${_pkg_}:M*not_found) -WRAPPER_VARS+= BUILDLINK_PREFIX.${_pkg_} -. endif +. endif +. if empty(BUILDLINK_PREFIX.${_pkg_}:M*not_found) +MAKE_VARS+= BUILDLINK_PREFIX.${_pkg_} . endif BUILDLINK_AUTO_VARS.${_pkg_}?= yes @@ -865,8 +865,8 @@ _BLNK_PHYSICAL_PATH.${_var_}!= \ else \ ${ECHO} ${${_var_}}; \ fi -WRAPPER_VARS+= _BLNK_PHYSICAL_PATH.${_var_} . endif +MAKE_VARS+= _BLNK_PHYSICAL_PATH.${_var_} .endfor # Transform all references to the physical paths to some important |