summaryrefslogtreecommitdiff
path: root/common.mk
diff options
context:
space:
mode:
Diffstat (limited to 'common.mk')
-rw-r--r--common.mk19
1 files changed, 15 insertions, 4 deletions
diff --git a/common.mk b/common.mk
index e3e084b..d43a010 100644
--- a/common.mk
+++ b/common.mk
@@ -33,15 +33,26 @@ ifeq ($(SYSTEM),Linux)
ASFLAGS =
STRIP = strip --strip-unneeded
- GCC_VERSION := $(shell g++ -dumpversion)
- GCC_VERSION_4 := $(shell expr `g++ -dumpversion | cut -f1 -d.` \>= 4)
- GCC_VERSION_x_8 := $(shell expr `g++ -dumpversion | cut -f2 -d.` \>= 8)
+ GCC_VERSION := $(shell g++ --version | head -1 | sed "s/.*\([0-9]\.[0-9]\.[0-9]\).*/\1/")
+ GCC_VERSION_4 := $(shell expr `echo $(GCC_VERSION) | cut -f1 -d.` \>= 4)
+ GCC_VERSION_x_7 := $(shell expr `echo $(GCC_VERSION) | cut -f2 -d.` \>= 7)
+ GCC_VERSION_x_8 := $(shell expr `echo $(GCC_VERSION) | cut -f2 -d.` \>= 8)
+ GCC_VERSION_x_x_2 := $(shell expr `echo $(GCC_VERSION) | cut -f3 -d.` \>= 2)
+ CLANG_VERSION := $(shell clang --version | head -1 | sed "s/.*\([0-9]\.[0-9]\).*/\1/")
+ CLANG_VERSION_3 := $(shell expr `echo $(CLANG_VERSION) | cut -f1 -d.` \>= 3)
+ CLANG_VERSION_x_1 := $(shell expr `echo $(CLANG_VERSION) | cut -f2 -d.` \>= 1)
ifneq ($(GCC_VERSION_4),1)
USE_CLANG = true
else
- ifneq ($(GCC_VERSION_x_8),1)
+ ifneq ($(GCC_VERSION_x_7),1)
USE_CLANG = true
+ else
+ ifneq ($(GCC_VERSION_x_8),1)
+ ifneq ($(GCC_VERSION_x_x_2),1)
+ USE_CLANG = true
+ endif
+ endif
endif
endif