Observe the following:

VAR=	a
	PTR=	VAR
	${PTR}?= b

Given these definitions, ${VAR} == "b" (unintuitively).  We can work
around this by doing:

	VAR=	a
	PTR=	VAR
	.for _v_ in ${PTR}
	${_v_}?= b
	.endfor

In this case, ${VAR} == "a" (as expected).

Use the second form of assignment in this changeset so that the expected
behavior happens for the "TOOL" name variables.  This fixes "recursively
defined" errors for some of the "TOOL" variables when the pkgsrc tool
replaces the system-supplied one.
This commit is contained in:
jlam 2005-05-12 03:57:40 +00:00
parent 714ab3325d
commit a136d7cc68
2 changed files with 10 additions and 4 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: defaults.mk,v 1.9 2005/05/10 19:52:30 jlam Exp $ # $NetBSD: defaults.mk,v 1.10 2005/05/12 03:57:40 jlam Exp $
.if !defined(TOOLS_DEFAULTS_MK) .if !defined(TOOLS_DEFAULTS_MK)
TOOLS_DEFAULTS_MK= defined TOOLS_DEFAULTS_MK= defined
@ -92,7 +92,10 @@ _TOOLS_VARNAME.yacc= YACC
.for _t_ in ${PKGSRC_USE_TOOLS:O:u} .for _t_ in ${PKGSRC_USE_TOOLS:O:u}
. if defined(_TOOLS_VARNAME.${_t_}) && \ . if defined(_TOOLS_VARNAME.${_t_}) && \
defined(TOOLS_PLATFORM.${_t_}) && !empty(TOOLS_PLATFORM.${_t_}) defined(TOOLS_PLATFORM.${_t_}) && !empty(TOOLS_PLATFORM.${_t_})
${_TOOLS_VARNAME.${_t_}}?= ${TOOLS_PLATFORM.${_t_}} . for _v_ in ${_TOOLS_VARNAME.${_t_}}
${_v_}?= ${TOOLS_PLATFORM.${_t_}}
. endfor
. undef _v_
. endif . endif
.endfor .endfor
.undef _t_ .undef _t_

View file

@ -1,4 +1,4 @@
# $NetBSD: replace.mk,v 1.68 2005/05/11 22:08:18 jlam Exp $ # $NetBSD: replace.mk,v 1.69 2005/05/12 03:57:40 jlam Exp $
# #
# This Makefile fragment handles "replacements" of system-supplied # This Makefile fragment handles "replacements" of system-supplied
# tools with pkgsrc versions. # tools with pkgsrc versions.
@ -975,7 +975,10 @@ TOOLS_${_TOOLS_VARNAME.${_t_}}= ${_TOOLS_VARNAME.${_t_}}_not_defined_
. endif . endif
. if defined(_TOOLS_VARNAME.${_t_}) . if defined(_TOOLS_VARNAME.${_t_})
. if defined(TOOLS_${_TOOLS_VARNAME.${_t_}}) . if defined(TOOLS_${_TOOLS_VARNAME.${_t_}})
${_TOOLS_VARNAME.${_t_}}?= ${TOOLS_${_TOOLS_VARNAME.${_t_}}} . for _v_ in ${_TOOLS_VARNAME.${_t_}}
${_v_}?= ${TOOLS_${_TOOLS_VARNAME.${_t_}}}
. endfor
. undef _v_
. endif . endif
. endif . endif
.endfor .endfor