summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-05-22 10:05:24 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-05-22 10:05:24 +0100
commit18e8a7d4f5259615be5f64139c5d32bef6cfdfdf (patch)
tree409480c7ed29f147d7999cf72fabc3ec743caa86
parent3246c9f04267b117b4f464d9eef39b7ef7a70a7f (diff)
downloadbuildsystem-18e8a7d4f5259615be5f64139c5d32bef6cfdfdf.tar.gz
buildsystem-18e8a7d4f5259615be5f64139c5d32bef6cfdfdf.tar.bz2
makefiles: Detect NS_ENV_CC and use that if set
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--makefiles/Makefile.tools17
1 files changed, 11 insertions, 6 deletions
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index c0e96d5..d998953 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -121,12 +121,17 @@ ifeq ($(BUILD),$(HOST))
else
# Cross compiling
- # Make first-stab at identity of CC
- CC__ := $(CC)
- # Improve our guess at the identity of CC
- # (only if CC was not specified by the user)
- ifeq ($(origin CC),default)
- CC__ := $(HOST)-gcc
+ ifneq ($(NS_ENV_CC),)
+ # If we have a CC specified by env.sh, start with that
+ CC__ := $(NS_ENV_CC)
+ else
+ # Make first-stab at identity of CC
+ CC__ := $(CC)
+ # Improve our guess at the identity of CC
+ # (only if CC was not specified by the user)
+ ifeq ($(origin CC),default)
+ CC__ := $(HOST)-gcc
+ endif
endif
# Search the path for the compiler