From 9e71ecc64729fa852e270e7f0b46827897603c74 Mon Sep 17 00:00:00 2001 From: Yuichiro NAITO Date: Sat, 17 Nov 2018 17:23:53 +0900 Subject: 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. --- make/configure.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'make/configure.py') 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 ) -- cgit v1.2.3