1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Refined the appropriate C++ compiler in OS X selection

Allows CC to be prefixed another path or command, e.g., ccache.
This commit is contained in:
Nobuyoshi Nakada 2019-08-26 11:04:11 +09:00
parent b4dfac2c12
commit 5e10cb04e8
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -198,15 +198,20 @@ AS_CASE([$CC],
[gcc_prefix= gcc_suffix=])
dnl Select the appropriate C++ compiler in OS X
AS_CASE(["$build_os"],
[darwin1*.*], [
AS_CASE(["x$CC"],
[xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
[xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
[xcc|x/usr/bin/cc], [: ${CXX=c++}],
[xicc], [: ${CXX=icpc}],
[xclang|x/usr/bin/clang], [: ${CXX=clang++}])
])
AS_CASE(["$build_os:${CXX}"],
[darwin1*.*:], [
AC_MSG_CHECKING([CXX for $CC])
AS_CASE(["/$CC "],
[*" gcc-4.2 "*|*"/gcc-4.2 "*], [pat='gcc-4\.2' =g++-4.2],
[*" gcc "*|*"/gcc "*], [pat=gcc CXX=g++],
[*" cc "*|*"/cc "*], [pat=cc CXX=c++],
[*" icc "*|*"/icc "*], [pat=icc CXX=icpc],
[*" clang "*|*"/clang "*], [pat=clang CXX=clang++])
AS_IF([test "${CXX}"], [
CXX=`echo "/$CC " | sed ["s:\([ /]\)${pat}:\1$CXX:; s:^/::; s: *$::"]`
])
AC_MSG_RESULT([$CXX])
])
test -z "$CXX" || ac_cv_prog_CXX="$CXX"
AS_CASE(["$target_os"],