make the Make rules for compiler versioning be more portable with fewer shell calls

This commit is contained in:
Vincent Sanders 2012-12-14 10:53:43 +00:00
parent 4448722425
commit 7c5f9ed8cd
1 changed files with 3 additions and 2 deletions

View File

@ -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