summaryrefslogtreecommitdiff
path: root/makefiles/Makefile.tools
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2014-11-16 11:52:46 +0000
committerJohn-Mark Bell <jmb@netsurf-browser.org>2014-11-16 11:53:13 +0000
commit786c69ed1dff78590f64d0165a61dc2e83ea0bc0 (patch)
treeee98eeaadfb5b93b4fc481580e380c79651af335 /makefiles/Makefile.tools
parent9be80ac0132a195d3028b7b0534c29a760821545 (diff)
downloadbuildsystem-786c69ed1dff78590f64d0165a61dc2e83ea0bc0.tar.gz
buildsystem-786c69ed1dff78590f64d0165a61dc2e83ea0bc0.tar.bz2
Do not guess identity of CC for native builds
Diffstat (limited to 'makefiles/Makefile.tools')
-rw-r--r--makefiles/Makefile.tools15
1 files 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_),)