From 96f2214c0ebb7a9503ae57c61b77a54e8967677b Mon Sep 17 00:00:00 2001 From: Yvan Janssens Date: Thu, 26 Sep 2019 13:21:48 +0100 Subject: [PATCH] Auto-detect appropriate toolchain The Unix-based build script assumes GCC to build Open Watcom. However, some operating systems (notably FreeBSD and Darwin/macOS) do not ship with GCC anymore, resulting in the build failing. This commit adds a rudimentary form of auto-detection based on the host's `uname` value to determine a suitable default toolchain. --- setvars.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/setvars.sh b/setvars.sh index 69650133c2..15d4b85223 100755 --- a/setvars.sh +++ b/setvars.sh @@ -15,9 +15,22 @@ export OWROOT=$(realpath `pwd`) -# Set this entry to identify your toolchain used by build process -# supported values are WATCOM GCC CLANG -export OWTOOLS=GCC +# Automatically try to determine appropriate toolchain + +case `uname` in + FreeBSD) + # FreeBSD does not ship with GCC anymore by default so needs clang + export OWTOOLS=CLANG + ;; + Darwin) + # Darwin/macOS does not ship with GCC anymore so needs clang. + export OWTOOLS=CLANG + ;; + *) + export OWTOOLS=GCC + ;; +esac + # Build control related variables ##################################