[PATCH] build: let the C++ compiler be configurable

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

 



By default, the C compiler is 'gcc' but it can be overridden
on the command line via 'make CC=...'.

However, the C++ compiler (only needed for sparse-llvm) is
hardcoded to 'g++'.

Fix this by allowing to specify the C++ compiler via 'CXX=...'
but keeping 'g++' as the default.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f46654e79642..07de0bc3226e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ OS = linux
 
 
 CC = gcc
+CXX = g++
 LD = $(CC)
 AR = ar
 
@@ -189,7 +190,7 @@ LLVM_VERSION:=$(shell $(LLVM_CONFIG) --version)
 LLVM_VERSION_MAJOR:=$(firstword $(subst ., ,$(LLVM_VERSION)))
 ifeq ($(shell expr "$(LLVM_VERSION_MAJOR)" '>=' 3),1)
 LLVM_PROGS := sparse-llvm
-$(LLVM_PROGS): LD := g++
+$(LLVM_PROGS): LD := $(CXX)
 LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)
 LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cppflags)
 LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs)
-- 
2.27.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux