From 4de71c7ef6c4a71af7f0e5fe3fe47b017ec9a791 Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Wed, 10 Jun 2015 11:27:08 -0700 Subject: [PATCH 1/3] allowing fallback to clang on freebsd when needed --- configure | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure b/configure index d72fe075983..25ef8013f33 100755 --- a/configure +++ b/configure @@ -861,6 +861,16 @@ then CFG_DISABLE_JEMALLOC=1 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 # 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" ] From 97fb1c241c1356f6695ba24eab0085535688ae85 Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Wed, 10 Jun 2015 11:49:07 -0700 Subject: [PATCH 2/3] adding fallback to clang if gcc not available --- configure | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 25ef8013f33..6dc401a8823 100755 --- a/configure +++ b/configure @@ -861,16 +861,6 @@ then CFG_DISABLE_JEMALLOC=1 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 # 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" ] @@ -909,6 +899,18 @@ then 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 # going to force CFG_ENABLE_CLANG or not; save the setting if so. if [ ! -z "$CFG_ENABLE_CLANG" ] From 44d487d37ca2a29c26ca46106955d85482b3754f Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Wed, 24 Jun 2015 12:48:08 -0700 Subject: [PATCH 3/3] stupid missing dollar sign --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 6dc401a8823..891f524a706 100755 --- a/configure +++ b/configure @@ -903,7 +903,7 @@ fi # on clang as a backup. if [ -z "$CFG_ENABLE_CLANG" ] then - CFG_GCC_VERSION=$("CFG_GCC" --version 2>&1) + CFG_GCC_VERSION=$("$CFG_GCC" --version 2>&1) if [ $? -ne 0 ] then step_msg "GCC not installed, will try using Clang"