Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2016 16:21:05 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300904 - head/share/mk
Message-ID:  <201605281621.u4SGL5Bd081401@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Sat May 28 16:21:05 2016
New Revision: 300904
URL: https://svnweb.freebsd.org/changeset/base/300904

Log:
  Always export X_* vars.
  
  This fixes CROSS_TOOLCHAIN builds after r300886 since it
  relies on X_COMPILER_TYPE being set.
  
  The X_* vars will only represent the external compiler
  being used.
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.compiler.mk

Modified: head/share/mk/bsd.compiler.mk
==============================================================================
--- head/share/mk/bsd.compiler.mk	Sat May 28 16:06:07 2016	(r300903)
+++ head/share/mk/bsd.compiler.mk	Sat May 28 16:21:05 2016	(r300904)
@@ -108,8 +108,10 @@ ccache-print-options: .PHONY
 # CC and COMPILER_* settings here.
 _exported_vars=	${X_}COMPILER_TYPE ${X_}COMPILER_VERSION \
 		${X_}COMPILER_FREEBSD_VERSION
-${X_}_cc_hash=	${${cc}}${MACHINE}${PATH}
-${X_}_cc_hash:=	${${X_}_cc_hash:hash}
+# Handle importing cached vars, but not for X_ vars.
+.if ${X_} == ""
+_cc_hash=	${${cc}}${MACHINE}${PATH}
+_cc_hash:=	${_cc_hash:hash}
 # Only import if none of the vars are set somehow else.
 _can_export=	yes
 .for var in ${_exported_vars}
@@ -119,11 +121,12 @@ _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}.${_cc_hash})
+${var}=	${${var}.${_cc_hash}}
 .endif
 .endfor
 .endif
+.endif	# ${X_} == ""
 
 .if ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC})
 .if ${MACHINE} == "common"
@@ -183,9 +186,14 @@ 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}
+.if ${X_} == ""
+${var}.${_cc_hash}:=	${${var}}
+.export-env ${var}.${_cc_hash}
+.undef ${var}.${_cc_hash}
+.else
+# Always export X_ vars.
+.export-env ${var}
+.endif
 .endfor
 
 .endif	# ${cc} == "CC" || !empty(XCC)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605281621.u4SGL5Bd081401>