configure: Enable clang for older OSX gcc versions

OSX often has a more recent version of clang than it does for GCC. When an older
version of gcc is detected on OSX, the --enable-clang flag is implicitly
enabled.
This commit is contained in:
Alex Crichton 2014-04-14 10:27:16 -07:00
parent 32a81d1e16
commit 682c401045

6
configure vendored
View File

@ -578,6 +578,11 @@ then
step_msg "on OS X 10.9, forcing use of clang"
CFG_ENABLE_CLANG=1
putvar CFG_ENABLE_CLANG
else
if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then
step_msg "older GCC found, using clang instead"
CFG_ENABLE_CLANG=1
putvar CFG_ENABLE_CLANG
else
# on OS X, with xcode 5 and newer, certain developers may have
# cc, gcc and g++ point to a mixture of clang and gcc
@ -601,6 +606,7 @@ To resolve this problem, either fix your PATH or run configure with --enable-cl
fi
fi
fi
if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
then