From 8a780ba3ae17782092aabd2126b50ba5ecf4b545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20P=C3=B6chtrager?= Date: Sun, 2 Jun 2019 09:40:04 +0200 Subject: [PATCH] Although it may work, GCC shouldn't be built by clang --- tools/tools.sh | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/tools/tools.sh b/tools/tools.sh index e536e52..52b2ffb 100644 --- a/tools/tools.sh +++ b/tools/tools.sh @@ -20,25 +20,6 @@ if [ $PLATFORM == CYGWIN* ]; then exit 1 fi -if [[ $PLATFORM == *BSD ]] || [ $PLATFORM == "DragonFly" ]; then - MAKE=gmake - SED=gsed -else - MAKE=make - SED=sed -fi - -if [ -z "$CC" ]; then - export CC="clang" -fi - -if [ -z "$CXX" ]; then - export CXX="clang++" -fi - -if [ -z "$CMAKE" ]; then - CMAKE="cmake" -fi function require() { @@ -58,9 +39,36 @@ function require() set -e } +if [[ $PLATFORM == *BSD ]] || [ $PLATFORM == "DragonFly" ]; then + MAKE=gmake + SED=gsed +else + MAKE=make + SED=sed +fi + +if [ -z "$USESYSTEMCOMPILER" ]; then + if [ -z "$CC" ]; then + export CC="clang" + fi + + if [ -z "$CXX" ]; then + export CXX="clang++" + fi +fi + +if [ -z "$CMAKE" ]; then + CMAKE="cmake" +fi + +if [ -n "$CC" ]; then + require $CC +fi + +if [ -n "$CXX" ]; then + require $CXX +fi -require $CC -require $CXX require $SED require $MAKE require $CMAKE