]> xenbits.xensource.com Git - xen.git/commitdiff
Config.mk: introduce cc-ifversion
authorWei Liu <wei.liu2@citrix.com>
Wed, 5 Oct 2016 14:25:42 +0000 (15:25 +0100)
committerWei Liu <wei.liu2@citrix.com>
Sat, 3 Dec 2016 15:55:34 +0000 (15:55 +0000)
It returns different string depending on compiler version.

No user yet.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Config.mk

index 4ccf12c48a2b6f5f6a7dd1bd87290d67ee6fa3c2..2ed32eb7ae9541800a8252e33ea5b0b339dee99f 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -129,6 +129,11 @@ define cc-ver-check-closure
     endif
 endef
 
+# cc-ifversion: Check compiler version and take branch accordingly
+# Usage $(call cc-ifversion,lt,0x040700,string_if_y,string_if_n)
+cc-ifversion = $(shell [ $(call cc-ver,$(CC),$(1),$(2)) = "y" ] \
+                               && echo $(3) || echo $(4))
+
 # Require GCC v4.1+
 check-$(gcc) = $(call cc-ver-check,CC,0x040100,"Xen requires at least gcc-4.1")
 $(eval $(check-y))