summaryrefslogtreecommitdiffstatshomepage
path: root/makefile
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2019-02-17 15:02:34 +0100
committer couriersud <couriersud@gmx.org>2019-02-17 16:01:45 +0100
commit764f04c31727f1e377a6b8447a017f670ce22e8a (patch)
treec68c62ba869efbdba23792bf414fb812997e597b /makefile
parent6eb3ffebae64d4b0d2ce4a6c70381d2adc6aecab (diff)
Use OVERRIDE_CC if defined to determine GCC_VERSION. (nw)
Fixes some cross-compilation issues and most likely edge case using OVERRIDE_CC.
Diffstat (limited to 'makefile')
-rw-r--r--makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/makefile b/makefile
index 7370284f881..d5dc79988f3 100644
--- a/makefile
+++ b/makefile
@@ -971,7 +971,11 @@ FASTBUILD_PARAMS += $(FASTBUILD_TARGET)-x32
endif
endif
else
+ifdef OVERRIDE_CC
+GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(OVERRIDE_CC)) -dumpversion 2> /dev/null)
+else
GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> /dev/null)
+endif
ifneq ($(OS),solaris)
CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> /dev/null | head -n 1 | grep -e 'version [0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?' -o | grep -e '[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?' -o | tail -n 1)
endif