Skip to content

Commit 97fb1c2

Browse files
author
Dave Huseby
committed
adding fallback to clang if gcc not available
1 parent 4de71c7 commit 97fb1c2

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

configure

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -861,16 +861,6 @@ then
861861
CFG_DISABLE_JEMALLOC=1
862862
fi
863863

864-
if [ $CFG_OSTYPE = unknown-freebsd ]
865-
then
866-
CFG_FREEBSD_GCC_VERSION=$("CFG_GCC" --version 2>&1)
867-
if [ $? -ne 0 ]
868-
then
869-
step_msg "GCC not installed on FreeBSD, forcing clang"
870-
CFG_ENABLE_CLANG=1
871-
fi
872-
fi
873-
874864
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
875865
# system, so if we find that gcc is clang, we should just use clang directly.
876866
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
@@ -909,6 +899,18 @@ then
909899
fi
910900
fi
911901

902+
# If the clang isn't already enabled, check for GCC, and if it is missing, turn
903+
# on clang as a backup.
904+
if [ -z "$CFG_ENABLE_CLANG" ]
905+
then
906+
CFG_GCC_VERSION=$("CFG_GCC" --version 2>&1)
907+
if [ $? -ne 0 ]
908+
then
909+
step_msg "GCC not installed, will try using Clang"
910+
CFG_ENABLE_CLANG=1
911+
fi
912+
fi
913+
912914
# Okay, at this point, we have made up our minds about whether we are
913915
# going to force CFG_ENABLE_CLANG or not; save the setting if so.
914916
if [ ! -z "$CFG_ENABLE_CLANG" ]

0 commit comments

Comments
 (0)