scripts/build_mingw: add script to cross-compile using mingw
authorPaul Brossier <piem@piem.org>
Mon, 9 May 2016 18:16:38 +0000 (20:16 +0200)
committerPaul Brossier <piem@piem.org>
Mon, 9 May 2016 18:16:38 +0000 (20:16 +0200)
scripts/build_mingw [new file with mode: 0755]

diff --git a/scripts/build_mingw b/scripts/build_mingw
new file mode 100755 (executable)
index 0000000..8c02894
--- /dev/null
@@ -0,0 +1,28 @@
+#! /bin/bash
+
+# This script cross compiles aubio for windows using mingw, both for 32 and 64
+# bits. Built binaries will be placed in ./dist-win32 and ./dist-win64.
+
+# On debian or ubuntu, you will want to 'apt-get install gcc-mingw-w64'
+
+set -e
+set -x
+
+WAFOPTS="-v --disable-avcodec --disable-samplerate --disable-jack --disable-sndfile"
+
+[ -d dist-win32 ] && rm -rf dist-win32
+[ -d dist-win64 ] && rm -rf dist-win64
+
+CFLAGS="-Os" \
+  LDFLAGS="" \
+  CC=x86_64-w64-mingw32-gcc \
+  ./waf distclean configure build install --destdir=$PWD/dist-win64 \
+    --testcmd="echo %s" \
+    $WAFOPTS --with-target-platform=win64
+
+CFLAGS="-Os" \
+  LDFLAGS="" \
+  CC=i686-w64-mingw32-gcc \
+  ./waf distclean configure build install --destdir=$PWD/dist-win32 \
+    --testcmd="echo %s" \
+    $WAFOPTS --with-target-platform=win32