]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
build: set HOST{CC/CXX}, clang and gcc in StdGNU.mk
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 28 Jun 2019 13:37:44 +0000 (15:37 +0200)
committerRoger Pau Monne <roger.pau@citrix.com>
Fri, 26 Jul 2019 10:44:53 +0000 (12:44 +0200)
This is a preparatory change for simplifying the setting of
HOST{CC/CXX} and allowing the Xen build system to pick the toolchain
variables from the environment.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wl@xen.org>
Config.mk
config/StdGNU.mk

index 0fa4591379911e56049eef5684a2d7f08995b7b3..57a6c934b31dc80e31acf040600d85ef70976774 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -39,24 +39,6 @@ DESTDIR     ?= /
 # Allow phony attribute to be listed as dependency rather than fake target
 .PHONY: .phony
 
-# If we are not cross-compiling, default HOSTC{C/XX} to C{C/XX}
-ifeq ($(XEN_TARGET_ARCH), $(XEN_COMPILE_ARCH))
-HOSTCC ?= $(CC)
-HOSTCXX ?= $(CXX)
-endif
-
-# Use Clang/LLVM instead of GCC?
-clang ?= n
-ifeq ($(clang),n)
-gcc := y
-HOSTCC ?= gcc
-HOSTCXX ?= g++
-else
-gcc := n
-HOSTCC ?= clang
-HOSTCXX ?= clang++
-endif
-
 DEPS_INCLUDE = $(addsuffix .d2, $(basename $(wildcard $(DEPS))))
 DEPS_RM = $(DEPS) $(DEPS_INCLUDE)
 
index 039274ea61c706dc5a102af633e657385aff0983..7a6159021bca4b6fadeeff9dc6374e8d66615b7e 100644 (file)
@@ -1,14 +1,30 @@
+# Use Clang/LLVM instead of GCC?
+clang     ?= n
+
+# If we are not cross-compiling, default HOSTC{C/XX} to C{C/XX}
+ifeq ($(XEN_TARGET_ARCH), $(XEN_COMPILE_ARCH))
+HOSTCC    ?= $(CC)
+HOSTCXX   ?= $(CXX)
+endif
+
 AS         = $(CROSS_COMPILE)as
 LD         = $(CROSS_COMPILE)ld
 ifeq ($(clang),y)
+gcc       := n
 CC         = $(CROSS_COMPILE)clang
 CXX        = $(CROSS_COMPILE)clang++
 LD_LTO     = $(CROSS_COMPILE)llvm-ld
+HOSTCC    ?= clang
+HOSTCXX   ?= clang++
 else
+gcc       := y
 CC         = $(CROSS_COMPILE)gcc
 CXX        = $(CROSS_COMPILE)g++
 LD_LTO     = $(CROSS_COMPILE)ld
+HOSTCC    ?= gcc
+HOSTCXX   ?= g++
 endif
+
 CPP        = $(CC) -E
 AR         = $(CROSS_COMPILE)ar
 RANLIB     = $(CROSS_COMPILE)ranlib