Date: Fri, 15 Nov 2019 16:43:37 +0000 (UTC) From: Alex Richardson <arichardson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354736 - head/share/mk Message-ID: <201911151643.xAFGhbiJ023972@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arichardson Date: Fri Nov 15 16:43:36 2019 New Revision: 354736 URL: https://svnweb.freebsd.org/changeset/base/354736 Log: 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 Modified: head/share/mk/bsd.compiler.mk head/share/mk/bsd.linker.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Fri Nov 15 16:40:55 2019 (r354735) +++ head/share/mk/bsd.compiler.mk Fri Nov 15 16:43:36 2019 (r354736) @@ -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) Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Fri Nov 15 16:40:55 2019 (r354735) +++ head/share/mk/bsd.linker.mk Fri Nov 15 16:43:36 2019 (r354736) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911151643.xAFGhbiJ023972>