summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-07-18 22:27:25 +0000
committerTim Angus <tim@ngus.net>2013-01-10 22:33:36 +0000
commit9ea5566eb376f8bb954d0614d141ea63fa390064 (patch)
treef1fb50dbabf8a559271b08f4c6f872234a57511c
parentfa0bfdb9c50362fab391c932b6e75a60cce531c0 (diff)
Bug 5084 - [patch] add support for Debian cross compiling, by q3urt.undead@gmail.com
-rwxr-xr-xcross-make-mingw.sh27
-rwxr-xr-xcross-make-mingw64.sh27
2 files changed, 42 insertions, 12 deletions
diff --git a/cross-make-mingw.sh b/cross-make-mingw.sh
index 4707c772..e4b1b13e 100755
--- a/cross-make-mingw.sh
+++ b/cross-make-mingw.sh
@@ -1,13 +1,28 @@
#!/bin/sh
-if [ !$CC ]
-then
- export CC=i586-mingw32msvc-gcc
+CMD_PREFIX="i586-mingw32msvc i686-w64-mingw32";
+
+if [ "X$CC" = "X" ]; then
+ for check in $CMD_PREFIX; do
+ full_check="${check}-gcc"
+ if [ ! $(which "$full_check") = "" ]; then
+ export CC="$full_check"
+ fi
+ done
+fi
+
+if [ "X$WINDRES" = "X" ]; then
+ for check in $CMD_PREFIX; do
+ full_check="${check}-windres"
+ if [ ! $(which "$full_check") = "" ]; then
+ export WINDRES="$full_check"
+ fi
+ done
fi
-if [ !$WINDRES ]
-then
- export WINDRES=i586-mingw32msvc-windres
+if [ "X$WINDRES" = "X" -o "X$CC" = "X" ]; then
+ echo "Error: Must define or find WINDRES and CC"
+ exit 1
fi
export PLATFORM=mingw32
diff --git a/cross-make-mingw64.sh b/cross-make-mingw64.sh
index 97f68943..d480c266 100755
--- a/cross-make-mingw64.sh
+++ b/cross-make-mingw64.sh
@@ -1,13 +1,28 @@
#!/bin/sh
-if [ !$CC ]
-then
- export CC=amd64-mingw32msvc-gcc
+CMD_PREFIX="amd64-mingw32msvc x86_64-w64-mingw32";
+
+if [ "X$CC" = "X" ]; then
+ for check in $CMD_PREFIX; do
+ full_check="${check}-gcc"
+ if [ ! $(which "$full_check") = "" ]; then
+ export CC="$full_check"
+ fi
+ done
+fi
+
+if [ "X$WINDRES" = "X" ]; then
+ for check in $CMD_PREFIX; do
+ full_check="${check}-windres"
+ if [ ! $(which "$full_check") = "" ]; then
+ export WINDRES="$full_check"
+ fi
+ done
fi
-if [ !$WINDRES ]
-then
- export WINDRES=amd64-mingw32msvc-windres
+if [ "X$WINDRES" = "X" -o "X$CC" = "X" ]; then
+ echo "Error: Must define or find WINDRES and CC"
+ exit 1
fi
export PLATFORM=mingw32