[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 1/4] build: set HOST{CC/CXX}, clang and gcc in StdGNU.mk



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@xxxxxxxxxx>
---
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Julien Grall <julien.grall@xxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Cc: Wei Liu <wl@xxxxxxx>
---
 Config.mk        | 18 ------------------
 config/StdGNU.mk | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/Config.mk b/Config.mk
index 0fa4591379..57a6c934b3 100644
--- 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)
 
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 039274ea61..7a6159021b 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -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
-- 
2.22.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.