summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2013-10-11 16:52:48 -0300
committerBrian Fraser <fraserbn@gmail.com>2014-01-17 11:35:46 -0300
commit083b43b68e72059c75d05f62a6183e677a4a0ace (patch)
tree1ecb8a420fd3bb7eb7b5ac81b26afc30557d94eb /Configure
parentbda0aa4ad2c2109bf684a899b547be1e4dc44d7b (diff)
downloadperl-083b43b68e72059c75d05f62a6183e677a4a0ace.tar.gz
Configure: When cross-compiling, look for *-gcc* instead of *-*-gcc
Ditto with g++. This allows us to use, for example, ntox86-gcc or x86_64-w64-mingw32-g++.exe to cross-compile, and have Configure detect most things automatically.
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure14
1 files changed, 8 insertions, 6 deletions
diff --git a/Configure b/Configure
index c402975503..f6fc4c90c8 100755
--- a/Configure
+++ b/Configure
@@ -2825,12 +2825,14 @@ $define|true|[yY]*)
$echo "Cross-compiling..."
croak=''
case "$cc" in
- *-*-gcc) # A cross-compiling gcc, probably.
- targetarch=`$echo $cc|$sed 's/-gcc$//'`
- ar=$targetarch-ar
- # leave out ld, choosing it is more complex
- nm=$targetarch-nm
- ranlib=$targetarch-ranlib
+ *-gcc*|*-g++*) # A cross-compiling gcc, probably.
+ # arm-linux-androideabi-gcc -> arm-linux-androideabi
+ # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
+ targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
+ ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
+ # leave out ld, choosing it is more complex
+ nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
+ ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
;;
esac
case "$targetarch" in