summaryrefslogtreecommitdiffstats
path: root/make/configure.py
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/configure.py
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/configure.py')
-rw-r--r--make/configure.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/make/configure.py b/make/configure.py
index 9697fffa5..6f58a78e2 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -1512,7 +1512,12 @@ try:
class Tools:
ar = ToolProbe( 'AR.exe', 'ar', abort=True )
cp = ToolProbe( 'CP.exe', 'cp', abort=True )
- gcc = ToolProbe( 'GCC.gcc', 'gcc', IfHost( 'clang', '*-*-freebsd*' ), IfHost( 'gcc-4', '*-*-cygwin*' ))
+ gcc_tools = ['GCC.gcc',
+ IfHost( os.environ.get('CC', None), '*-*-freebsd*' ),
+ 'gcc',
+ IfHost( 'clang', '*-*-freebsd*' ),
+ IfHost( 'gcc-4', '*-*-cygwin*' )]
+ gcc = ToolProbe(*filter(None, gcc_tools))
if host.match( '*-*-darwin*' ):
gmake = ToolProbe( 'GMAKE.exe', 'make', 'gmake', abort=True )