]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
config: don't hardcode toolchain binaries
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 25 Jun 2019 13:39:44 +0000 (15:39 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Jun 2019 14:46:54 +0000 (15:46 +0100)
Currently the names of the build toolchain binaries are hardcoded in
StdGNU.mk, and the values from the environment are ignored.

Switch StdGNU.mk to use '?=' instead of '=', so that values from the
environment are used if present, else default to the values provided
by the config file.

This change fixes the gitlab CI loop, that was relying on passing
custom values in the environment variables for the compiler and the
linker.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
config/StdGNU.mk

index 039274ea61c706dc5a102af633e657385aff0983..490ebdf23cc33862ea4f0d80ceb426da677aefec 100644 (file)
@@ -1,27 +1,27 @@
-AS         = $(CROSS_COMPILE)as
-LD         = $(CROSS_COMPILE)ld
+AS        ?= $(CROSS_COMPILE)as
+LD        ?= $(CROSS_COMPILE)ld
 ifeq ($(clang),y)
-CC         = $(CROSS_COMPILE)clang
-CXX        = $(CROSS_COMPILE)clang++
-LD_LTO     = $(CROSS_COMPILE)llvm-ld
+CC        ?= $(CROSS_COMPILE)clang
+CXX       ?= $(CROSS_COMPILE)clang++
+LD_LTO    ?= $(CROSS_COMPILE)llvm-ld
 else
-CC         = $(CROSS_COMPILE)gcc
-CXX        = $(CROSS_COMPILE)g++
-LD_LTO     = $(CROSS_COMPILE)ld
+CC        ?= $(CROSS_COMPILE)gcc
+CXX       ?= $(CROSS_COMPILE)g++
+LD_LTO    ?= $(CROSS_COMPILE)ld
 endif
-CPP        = $(CC) -E
-AR         = $(CROSS_COMPILE)ar
-RANLIB     = $(CROSS_COMPILE)ranlib
-NM         = $(CROSS_COMPILE)nm
-STRIP      = $(CROSS_COMPILE)strip
-OBJCOPY    = $(CROSS_COMPILE)objcopy
-OBJDUMP    = $(CROSS_COMPILE)objdump
-SIZEUTIL   = $(CROSS_COMPILE)size
+CPP       ?= $(CC) -E
+AR        ?= $(CROSS_COMPILE)ar
+RANLIB    ?= $(CROSS_COMPILE)ranlib
+NM        ?= $(CROSS_COMPILE)nm
+STRIP     ?= $(CROSS_COMPILE)strip
+OBJCOPY   ?= $(CROSS_COMPILE)objcopy
+OBJDUMP   ?= $(CROSS_COMPILE)objdump
+SIZEUTIL  ?= $(CROSS_COMPILE)size
 
 # Allow git to be wrappered in the environment
 GIT        ?= git
 
-INSTALL      = install
+INSTALL     ?= install
 INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p