From 5caffe3f8660d140087c8e94ce3378fb396d34f3 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 19 Jun 2024 12:12:18 +0100 Subject: [PATCH] Fix compiler detection (#2817) Compiler detection was changed in #2798 but did not take locale into account. This PR fixes the problem using `LANG=C` as recommended in #2816. Also if a failure occurs the command output accompanies the error message to make diagnosis a little easier next time. --- Sming/build.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sming/build.mk b/Sming/build.mk index 99b31cba90..c932ff78cd 100644 --- a/Sming/build.mk +++ b/Sming/build.mk @@ -211,7 +211,7 @@ ifndef MAKE_CLEAN # Detect compiler version and name DEBUG_VARS += COMPILER_VERSION_FULL COMPILER_VERSION COMPILER_NAME -COMPILER_VERSION_FULL := $(shell $(CC) -v 2>&1 | $(AWK) -F " version " '/ version /{ a=$$1; gsub(/ +/, "-", a); print a, $$2}') +COMPILER_VERSION_FULL := $(shell LANG=C $(CC) -v 2>&1 | $(AWK) -F " version " '/ version /{ a=$$1; gsub(/ +/, "-", a); print a, $$2}') COMPILER_NAME := $(word 1,$(COMPILER_VERSION_FULL)) COMPILER_VERSION := $(word 2,$(COMPILER_VERSION_FULL)) @@ -224,6 +224,7 @@ CPPFLAGS += -fstrict-volatile-bitfields COMPILER_VERSION_MIN := 8 else ifeq (,$(findstring clang,$(COMPILER_NAME))) +$(shell LANG=C $(CC) -v) $(error Compiler '$(COMPILER_VERSION_FULL)' not recognised. Please install GCC tools.) endif COMPILER_VERSION_MIN := 15