Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
cross-mingw: new script to cross compile for mingw
Browse files Browse the repository at this point in the history
Closes #3
  • Loading branch information
bassosimone committed Dec 20, 2019
1 parent 7e30516 commit eeae3cb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bin_SCRIPTS = cross-android cross-ios
bin_SCRIPTS = cross-android cross-ios cross-mingw
32 changes: 32 additions & 0 deletions cross-mingw
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit eeae3cb

Please sign in to comment.