summaryrefslogtreecommitdiffstats
path: root/make/include
diff options
context:
space:
mode:
authorYuichiro NAITO <[email protected]>2018-11-17 17:23:53 +0900
committerBradley Sepos <[email protected]>2018-11-26 17:59:40 -0500
commit9e71ecc64729fa852e270e7f0b46827897603c74 (patch)
tree111c0779d0d686f8cfcd88d2eafae43a0ea44eaa /make/include
parentda1f90d8427d444386b269a3ae21a7420e9d81cb (diff)
build: Respect CC environment variable on FreeBSD.
Fixes #1674. We use the compiler that CC environment variable indicates. If CC is ommited, use gcc or clang which is installed. If gcc is chosen, we need to add `-Wl,-rpath` option to make runtime linker linking gcc's runtime libraries from installed path. For example, gcc7's runtime libraries are installed in `/usr/local/lib/gcc7` by default. And we also need to link libc++ first to make libc++ initializer is called on runtime.
Diffstat (limited to 'make/include')
-rw-r--r--make/include/gcc.defs4
1 files changed, 2 insertions, 2 deletions
diff --git a/make/include/gcc.defs b/make/include/gcc.defs
index adb86ad46..83b26aafa 100644
--- a/make/include/gcc.defs
+++ b/make/include/gcc.defs
@@ -1,5 +1,5 @@
GCC.gcc = gcc
-GCC.gxx = $(dir $(GCC.gcc))$(subst clang,clang++,$(subst gcc,g++,$(notdir $(GCC.gcc))))
+GCC.gxx = $(dir $(GCC.gcc))$(subst cc,c++,$(subst clang,clang++,$(subst gcc,g++,$(notdir $(GCC.gcc)))))
GCC.strip = $$(if $$(filter none,$$(GCC.g)),1)
GCC.dylib = 1
@@ -91,7 +91,7 @@ GCC.args.extra.exe++ = $(LDFLAGS)
define import.GCC
$(1).GCC.gcc = $$(GCC.gcc)
- $(1).GCC.gxx = $$(dir $$($(1).GCC.gcc))$$(subst clang,clang++,$$(subst gcc,g++,$$(notdir $$($(1).GCC.gcc))))
+ $(1).GCC.gxx = $$(dir $$($(1).GCC.gcc))$$(subst cc,c++,$$(subst clang,clang++,$$(subst gcc,g++,$$(notdir $$($(1).GCC.gcc)))))
$(1).GCC.pipe = $$(GCC.pipe)
$(1).GCC.c_std = $$(GCC.c_std)