Changeset View
Changeset View
Standalone View
Standalone View
head/share/mk/bsd.compiler.mk
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | |||||
.if ${cc} == "CC" || !empty(XCC) | .if ${cc} == "CC" || !empty(XCC) | ||||
# Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. | # Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. | ||||
# The value is only used/exported for the same environment that impacts | # The value is only used/exported for the same environment that impacts | ||||
# CC and COMPILER_* settings here. | # CC and COMPILER_* settings here. | ||||
_exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION \ | _exported_vars= ${X_}COMPILER_TYPE ${X_}COMPILER_VERSION \ | ||||
${X_}COMPILER_FREEBSD_VERSION ${X_}COMPILER_RESOURCE_DIR | ${X_}COMPILER_FREEBSD_VERSION ${X_}COMPILER_RESOURCE_DIR | ||||
${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} | ${X_}_cc_hash= ${${cc}}${MACHINE}${PATH} | ||||
${X_}_cc_hash:= ${${X_}_cc_hash:hash} | ${X_}_cc_hash:= ${${X_}_cc_hash:hash} | ||||
# Only import if none of the vars are set somehow else. | # Only import if none of the vars are set differently somehow else. | ||||
_can_export= yes | _can_export= yes | ||||
.for var in ${_exported_vars} | .for var in ${_exported_vars} | ||||
.if defined(${var}) | .if defined(${var}) && (!defined(${var}__${${X_}_cc_hash}) || ${${var}__${${X_}_cc_hash}} != ${${var}}) | ||||
.if defined(${var}__${${X_}_ld_hash}) | |||||
.info "Cannot import ${X_}COMPILER variables since cached ${var} is different: ${${var}__${${X_}_cc_hash}} != ${${var}}" | |||||
.endif | |||||
_can_export= no | _can_export= no | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
.if ${_can_export} == yes | .if ${_can_export} == yes | ||||
.for var in ${_exported_vars} | .for var in ${_exported_vars} | ||||
.if defined(${var}__${${X_}_cc_hash}) | .if defined(${var}__${${X_}_cc_hash}) | ||||
${var}= ${${var}__${${X_}_cc_hash}} | ${var}= ${${var}__${${X_}_cc_hash}} | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |