From 786c69ed1dff78590f64d0165a61dc2e83ea0bc0 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 16 Nov 2014 11:52:46 +0000 Subject: Do not guess identity of CC for native builds --- makefiles/Makefile.tools | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools index febfe8c..86ab68b 100644 --- a/makefiles/Makefile.tools +++ b/makefiles/Makefile.tools @@ -55,17 +55,13 @@ HOST_CC ?= cc # Host/build platform detection ############################################################################### -# Autodetect build or CC -CC__ := $(CC) +# Autodetect build ifeq ($(BUILD),) BUILD := $(shell $(CC) -dumpmachine) ifeq ($(BUILD),) $(error "Failed to guess BUILD") endif else - ifeq ($(origin CC),default) - CC__ := $(BUILD)-gcc - endif endif # Autodetect host if necessary @@ -76,6 +72,9 @@ ifeq ($(HOST),) endif endif +# Make first-stab at identity of CC +CC__ := $(CC) + ifeq ($(HOST),$(BUILD)) # Native build @@ -104,6 +103,12 @@ ifeq ($(HOST),$(BUILD)) else # Cross compiling + # Improve our guess at the identity of CC + # (only if CC was not specified by the user) + ifeq ($(origin CC),default) + CC__ := $(BUILD)-gcc + endif + # Search the path for the compiler toolpath_ := $(shell /bin/which $(CC__)) ifeq ($(toolpath_),) -- cgit v1.2.3