adding fallback to clang if gcc not available

This commit is contained in:
Dave Huseby 2015-06-10 11:49:07 -07:00
parent 4de71c7ef6
commit 97fb1c241c

22
configure vendored
View File

@ -861,16 +861,6 @@ then
CFG_DISABLE_JEMALLOC=1 CFG_DISABLE_JEMALLOC=1
fi fi
if [ $CFG_OSTYPE = unknown-freebsd ]
then
CFG_FREEBSD_GCC_VERSION=$("CFG_GCC" --version 2>&1)
if [ $? -ne 0 ]
then
step_msg "GCC not installed on FreeBSD, forcing clang"
CFG_ENABLE_CLANG=1
fi
fi
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build # OS X 10.9, gcc is actually clang. This can cause some confusion in the build
# system, so if we find that gcc is clang, we should just use clang directly. # system, so if we find that gcc is clang, we should just use clang directly.
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ] if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
@ -909,6 +899,18 @@ then
fi fi
fi fi
# If the clang isn't already enabled, check for GCC, and if it is missing, turn
# on clang as a backup.
if [ -z "$CFG_ENABLE_CLANG" ]
then
CFG_GCC_VERSION=$("CFG_GCC" --version 2>&1)
if [ $? -ne 0 ]
then
step_msg "GCC not installed, will try using Clang"
CFG_ENABLE_CLANG=1
fi
fi
# Okay, at this point, we have made up our minds about whether we are # Okay, at this point, we have made up our minds about whether we are
# going to force CFG_ENABLE_CLANG or not; save the setting if so. # going to force CFG_ENABLE_CLANG or not; save the setting if so.
if [ ! -z "$CFG_ENABLE_CLANG" ] if [ ! -z "$CFG_ENABLE_CLANG" ]