summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1f83cba58..2d61411c7 100644
--- a/Makefile
+++ b/Makefile
@@ -283,8 +283,9 @@ else
endif
# compiler versioning to adjust warning flags
-CC_MAJOR := $(shell $(CC) -dumpversion | cut -f1 -d. )
-CC_MINOR := $(shell $(CC) -dumpversion | cut -f2 -d. )
+CC_VERSION := $(shell $(CC) -dumpversion)
+CC_MAJOR := $(word 1,$(subst ., ,$(CC_VERSION)))
+CC_MINOR := $(word 2,$(subst ., ,$(CC_VERSION)))
define cc_ver_ge
$(shell expr $(CC_MAJOR) \>= $(1) \& $(CC_MINOR) \>= $(2))
endef