From eeae3cb28d50e1b0c7e911165c627650b7a6e46e Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Fri, 20 Dec 2019 14:42:09 +0100 Subject: [PATCH] cross-mingw: new script to cross compile for mingw Closes #3 --- Makefile.am | 2 +- cross-mingw | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 cross-mingw diff --git a/Makefile.am b/Makefile.am index b0e5668..6617dc6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -bin_SCRIPTS = cross-android cross-ios +bin_SCRIPTS = cross-android cross-ios cross-mingw diff --git a/cross-mingw b/cross-mingw new file mode 100755 index 0000000..b887265 --- /dev/null +++ b/cross-mingw @@ -0,0 +1,32 @@ +#!/bin/sh +set -e + +if [ $# -lt 1 ]; then + echo "$0 x86_64 [.../]configure [args...]" 1>&2 + exit 1 +fi + +architecture=$1 +shift + +if [ "$architecture" != "x86_64" ]; then + echo "$0: unsupported architecture: $architecture" 1>&2 + exit 1 +fi +configureflags="--host=x86_64-w64-mingw32" + +set -x +export AR="x86_64-w64-mingw32-ar" +export AS="x86_64-w64-mingw32-as" +export CC="x86_64-w64-mingw32-gcc" +export CFLAGS="-Wall -O2" +export CPP="x86_64-w64-mingw32-cpp" +export CXX="x86_64-w64-mingw32-g++" +export CXXFLAGS="-Wall -O2" +export LD="x86_64-w64-mingw32-ld" +export NM="x86_64-w64-mingw32-nm" +export PATH="/usr/local/bin:/usr/bin:/bin" +export RANLIB="x86_64-w64-mingw32-ranlib" +export STRIP="x86_64-w64-mingw32-strip" + +$@ $configureflags