summaryrefslogtreecommitdiff
path: root/config.lib
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2018-05-10 01:05:40 +0100
committerPeterN <peter@fuzzle.org>2018-07-22 15:15:54 +0100
commit8fc15175157db469ea6d70afabc49f9245a589a1 (patch)
treed72b462e803a5d255a40c46f7f44b1e17dd5e585 /config.lib
parentbc1b34d1a24d7640753584dfd256526f2e84a6f8 (diff)
downloadopenttd-8fc15175157db469ea6d70afabc49f9245a589a1.tar.xz
Codechange: detect native Apple clang correctly in config.lib #6773
Fixes: 00c16032569d943e4fac5c5b6218dfce47479716
Diffstat (limited to 'config.lib')
-rw-r--r--config.lib6
1 files changed, 3 insertions, 3 deletions
diff --git a/config.lib b/config.lib
index 755544018..2decb19fd 100644
--- a/config.lib
+++ b/config.lib
@@ -1229,14 +1229,14 @@ make_compiler_cflags() {
# $5 - name of the features variable
# Get the compiler to tell us who it is
- compiler="`$1 --version | head -n1 | cut -d' ' -f1`"
+ version_line="`$1 --version | head -n1`"
eval eval "flags=\\\$$2"
eval eval "cxxflags=\\\$$3"
eval eval "ldflags=\\\$$4"
eval eval "features=\\\$$5"
- if [ "$compiler" = "icc" ]; then
+ if [ `echo "$version_line" | cut -d' ' -f1` = "icc" ]; then
# Enable some things only for certain ICC versions
cc_version=`$1 -dumpversion | cut -c 1-4 | sed s@\\\.@@g`
@@ -1323,7 +1323,7 @@ make_compiler_cflags() {
features="$features lto"
fi
fi
- elif [ "$compiler" = "clang" ]; then
+ elif echo "$version_line" | grep -q "clang"; then
# Enable some things only for certain clang versions
cc_version="`$1 -v 2>&1 | head -n 1 | sed s@[^0-9]@@g | cut -c 1-2`"