Use __ as the separator for the exported vars in bsd.compiler/linker.mk

By using '__' instead of '.' as the separator we can also support systems
that use dash as /bin/sh (it's the default shell on Ubuntu/Debian). Dash
will unset any environment variables that use a non alphanumeric+undedscore
character and therefore submakes will fail to import the COMPILER_*
variables if we use '.' as the separator.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D22381
This commit is contained in:
Alex Richardson 2019-11-15 16:43:36 +00:00
parent 5526318062
commit dc3c6ad63c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=354736
2 changed files with 10 additions and 10 deletions

View File

@ -155,8 +155,8 @@ _can_export= no
.endfor
.if ${_can_export} == yes
.for var in ${_exported_vars}
.if defined(${var}.${${X_}_cc_hash})
${var}= ${${var}.${${X_}_cc_hash}}
.if defined(${var}__${${X_}_cc_hash})
${var}= ${${var}__${${X_}_cc_hash}}
.endif
.endfor
.endif
@ -229,9 +229,9 @@ X_COMPILER_FEATURES= ${COMPILER_FEATURES}
# Export the values so sub-makes don't have to look them up again, using the
# hash key computed above.
.for var in ${_exported_vars}
${var}.${${X_}_cc_hash}:= ${${var}}
.export-env ${var}.${${X_}_cc_hash}
.undef ${var}.${${X_}_cc_hash}
${var}__${${X_}_cc_hash}:= ${${var}}
.export-env ${var}__${${X_}_cc_hash}
.undef ${var}__${${X_}_cc_hash}
.endfor
.endif # ${cc} == "CC" || !empty(XCC)

View File

@ -50,8 +50,8 @@ _can_export= no
.endfor
.if ${_can_export} == yes
.for var in ${_exported_vars}
.if defined(${var}.${${X_}_ld_hash})
${var}= ${${var}.${${X_}_ld_hash}}
.if defined(${var}__${${X_}_ld_hash})
${var}= ${${var}__${${X_}_ld_hash}}
.endif
.endfor
.endif
@ -101,9 +101,9 @@ X_LINKER_FREEBSD_VERSION= ${LINKER_FREEBSD_VERSION}
# Export the values so sub-makes don't have to look them up again, using the
# hash key computed above.
.for var in ${_exported_vars}
${var}.${${X_}_ld_hash}:= ${${var}}
.export-env ${var}.${${X_}_ld_hash}
.undef ${var}.${${X_}_ld_hash}
${var}__${${X_}_ld_hash}:= ${${var}}
.export-env ${var}__${${X_}_ld_hash}
.undef ${var}__${${X_}_ld_hash}
.endfor
.endif # ${ld} == "LD" || !empty(XLD)