summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2015-08-08 08:54:49 +0000
committerrubidium <rubidium@openttd.org>2015-08-08 08:54:49 +0000
commit9cadc0e1504cf979c14e1cb42bfe51a29675dd81 (patch)
treee9c13b3653ad113fdfa29a961b3b863806917f67
parentb40f750243e2892f83d212df6231e26111dd1e5d (diff)
downloadopenttd-9cadc0e1504cf979c14e1cb42bfe51a29675dd81.tar.xz
(svn r27361) -Fix-ish: when attempting to find a host, try gcc/g++ but also CC/CXX appended to the host triple. This to make cross compilation with clang alone easier
-rw-r--r--config.lib23
1 files changed, 20 insertions, 3 deletions
diff --git a/config.lib b/config.lib
index d11e37677..68d8b13a8 100644
--- a/config.lib
+++ b/config.lib
@@ -1942,9 +1942,26 @@ check_compiler() {
log 2 " exit code $ret"
if ( [ -z "$machine" ] && [ "$8" != "3" ] ) || [ "$ret" != "0" ]; then
- log 1 "checking $1... $compiler not found"
- log 1 "I couldn't detect any $6 binary for $3"
- exit 1
+ if [ -z "$5" ]; then
+ log 1 "checking $1... $compiler not found"
+ log 1 "I couldn't detect any $6 binary for $3"
+ exit 1
+ else
+ compiler="$3-$5"
+ fi
+ machine=`eval $compiler $9 2>/dev/null`
+ ret=$?
+ eval "$2=\"$compiler\""
+
+ log 2 "executing $compiler $9"
+ log 2 " returned $machine"
+ log 2 " exit code $ret"
+
+ if ( [ -z "$machine" ] && [ "$8" != "3" ] ) || [ "$ret" != "0" ]; then
+ log 1 "checking $1... $compiler not found"
+ log 1 "I couldn't detect any $5 binary for $3"
+ exit 1
+ fi
fi
if [ "$machine" != "$3" ] && ( [ "$8" = "0" ] || [ "$8" = "1" ] ); then