Skip to content

Commit 460a966

Browse files
committed
Use clang instead of gcc on OS X 10.9
Apple replaced gcc with clang, but kept around a stub gcc to call clang. This adds a check in `configure` to detect when gcc is really clang, and switch to using clang in this situation. Closes #10811.
1 parent bea3ec3 commit 460a966

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

configure

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,19 @@ then
549549
err "either clang or gcc is required"
550550
fi
551551

552+
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
553+
# system, so if we find that gcc is clang, we should just use clang directly.
554+
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
555+
then
556+
CFG_OSX_GCC_VERSION=$("$CFG_GCC" --version 2>&1 | grep "Apple LLVM version")
557+
if [ $? -eq 0 ]
558+
then
559+
step_msg "on OS X 10.9, forcing use of clang"
560+
CFG_ENABLE_CLANG=1
561+
putvar CFG_ENABLE_CLANG
562+
fi
563+
fi
564+
552565
if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
553566
then
554567
step_msg "using custom LLVM at $CFG_LLVM_ROOT"

0 commit comments

Comments
 (0)