From 18e8a7d4f5259615be5f64139c5d32bef6cfdfdf Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 22 May 2020 10:05:24 +0100 Subject: makefiles: Detect NS_ENV_CC and use that if set Signed-off-by: Daniel Silverstone --- makefiles/Makefile.tools | 17 +++++++++++------ 1 file 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 -- cgit v1.2.3