aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/tools/common-build-host-funcs.sh57
-rwxr-xr-xsources/host-tools/make-3.81/build-make.sh2
2 files changed, 18 insertions, 41 deletions
diff --git a/build/tools/common-build-host-funcs.sh b/build/tools/common-build-host-funcs.sh
index 68bc17f38..65923e88d 100644
--- a/build/tools/common-build-host-funcs.sh
+++ b/build/tools/common-build-host-funcs.sh
@@ -125,7 +125,7 @@ bh_tag_to_config_triplet ()
linux-x86_64) RET=x86_64-linux-gnu;;
darwin-x86) RET=i686-apple-darwin;;
darwin-x86_64) RET=x86_64-apple-darwin;;
- windows|windows-x86) RET=i586-pc-mingw32msvc;;
+ windows|windows-x86) RET=i686-w64-mingw32;;
windows-x86_64) RET=x86_64-w64-mingw32;;
android-arm) RET=arm-linux-androideabi;;
android-arm64) RET=aarch64-linux-android;;
@@ -407,6 +407,7 @@ EOF
# where $BH_HOST_CONFIG is a GNU configuration name.
#
# Important: this script might redefine $BH_HOST_CONFIG to a different value!
+# (This behavior previously happened with MinGW, but doesn't anymore.)
#
# $1: NDK system tag (e.g. linux-x86)
#
@@ -519,42 +520,31 @@ _bh_select_toolchain_for_host ()
windows|windows-x86)
case $BH_BUILD_OS in
linux)
+ # Prefer the prebuilt cross-compiler.
+ _bh_try_host_fullprefix "$(dirname $ANDROID_NDK_ROOT)/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8" x86_64-w64-mingw32 -m32
# We favor these because they are more recent, and because
# we have a script to rebuild them from scratch. See
- # build-mingw64-toolchain.sh.
- _bh_try_host_prefix x86_64-w64-mingw32 -m32
+ # build-mingw64-toolchain.sh. Typically provided by the
+ # 'mingw-w64' package on Debian and Ubuntu systems.
_bh_try_host_prefix i686-w64-mingw32
- # Typically provided by the 'mingw32' package on Debian
- # and Ubuntu systems.
- _bh_try_host_prefix i586-mingw32msvc
+ _bh_try_host_prefix x86_64-w64-mingw32 -m32
# Special note for Fedora: this distribution used
# to have a mingw32-gcc package that provided a 32-bit
# only cross-toolchain named i686-pc-mingw32.
# Later versions of the distro now provide a new package
# named mingw-gcc which provides i686-w64-mingw32 and
# x86_64-w64-mingw32 instead.
- _bh_try_host_prefix i686-pc-mingw32
if [ -z "$HOST_FULLPREFIX" ]; then
dump "There is no Windows cross-compiler. Ensure that you"
dump "have one of these installed and in your path:"
- dump " x86_64-w64-mingw32-gcc (see build-mingw64-toolchain.sh)"
dump " i686-w64-mingw32-gcc (see build-mingw64-toolchain.sh)"
- dump " i586-mingw32msvc-gcc ('mingw32' Debian/Ubuntu package)"
- dump " i686-pc-mingw32 (on Fedora)"
+ dump " x86_64-w64-mingw32-gcc (see build-mingw64-toolchain.sh)"
dump ""
exit 1
fi
- # Adjust $HOST to match the toolchain to ensure proper builds.
- # I.e. chose configuration triplets that are known to work
- # with the gmp/mpfr/mpc/binutils/gcc configure scripts.
- case $HOST_FULLPREFIX in
- *-mingw32msvc-*|i686-pc-mingw32)
- BH_HOST_CONFIG=i586-pc-mingw32msvc
- ;;
- *)
- BH_HOST_CONFIG=i686-w64-mingw32msvc
- ;;
- esac
+ if [ "$BH_HOST_CONFIG" != i686-w64-mingw32 ]; then
+ panic "Unexpected value of BH_HOST_CONFIG: $BH_HOST_CONFIG"
+ fi
;;
*) panic "Sorry, this script only supports building windows binaries on Linux."
;;
@@ -566,33 +556,20 @@ _bh_select_toolchain_for_host ()
windows-x86_64)
case $BH_BUILD_OS in
linux)
- # See comments above for windows-x86
+ # Prefer the prebuilt cross-compiler.
+ # See comments above for windows-x86.
+ _bh_try_host_fullprefix "$(dirname $ANDROID_NDK_ROOT)/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8" x86_64-w64-mingw32
_bh_try_host_prefix x86_64-w64-mingw32
- _bh_try_host_prefix i686-w64-mingw32 -m64
- # Beware that this package is completely broken on many
- # versions of no vinegar Ubuntu (i.e. it fails at building trivial
- # programs).
- _bh_try_host_prefix amd64-mingw32msvc
- # There is no x86_64-pc-mingw32 toolchain on Fedora.
if [ -z "$HOST_FULLPREFIX" ]; then
dump "There is no Windows cross-compiler in your path. Ensure you"
dump "have one of these installed and in your path:"
dump " x86_64-w64-mingw32-gcc (see build-mingw64-toolchain.sh)"
- dump " i686-w64-mingw32-gcc (see build-mingw64-toolchain.sh)"
- dump " amd64-mingw32msvc-gcc (Debian/Ubuntu - broken until Ubuntu 11.10)"
dump ""
exit 1
fi
- # See comment above for windows-x86
- case $HOST_FULLPREFIX in
- *-mingw32msvc*)
- # Actually, this has never been tested.
- BH_HOST=amd64-pc-mingw32msvc
- ;;
- *)
- BH_HOST=x86_64-w64-mingw32
- ;;
- esac
+ if [ "$BH_HOST_CONFIG" != x86_64-w64-mingw32 ]; then
+ panic "Unexpected value of BH_HOST_CONFIG: $BH_HOST_CONFIG"
+ fi
;;
*) panic "Sorry, this script only supports building windows binaries on Linux."
diff --git a/sources/host-tools/make-3.81/build-make.sh b/sources/host-tools/make-3.81/build-make.sh
index edee4a5fd..12c8dd415 100755
--- a/sources/host-tools/make-3.81/build-make.sh
+++ b/sources/host-tools/make-3.81/build-make.sh
@@ -79,7 +79,7 @@ BUILD_DIR=$BUILD_DIR/build
CONFIGURE_FLAGS="--disable-nls --disable-rpath"
if [ "$MINGW" = "yes" ]; then
# Required for a proper mingw cross compile
- CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --host=i586-pc-mingw32"
+ CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --host=i686-w64-mingw32"
fi
if [ "$DARWIN" = "yes" ]; then