wscript: check for 64bit using sys.maxsize (closes #3)
[vamp-aubio-plugins.git] / build_mingw32.sh
1 #! /bin/sh
2
3 # cross compile vamp-aubio-plugins using mingw32 toolchain
4
5 echo "ERROR: This script does not produce a binary loadable by sonic visualiser."
6 echo "Comment the following line to run it anyway."
7 exit 1
8
9 . $PWD/VERSION
10 VAMP_AUBIO_VERSION=$VAMP_AUBIO_MAJOR_VERSION.$VAMP_AUBIO_MINOR_VERSION.$VAMP_AUBIO_PATCH_VERSION$VAMP_AUBIO_VERSION_STATUS
11
12 set -e
13 set -x
14
15 if [ "$1" = 'dist' ]
16 then
17   rm -rf contrib/
18 fi
19
20 export CFLAGS="-Os"
21 #export CC="i586-mingw32msvc-gcc"
22 #export CXX="i586-mingw32msvc-g++"
23 export CC="i686-w64-mingw32-gcc"
24 export CXX="i686-w64-mingw32-g++"
25 export STRIP="i686-w64-mingw32-strip"
26 export WAFOPTS="--with-target-platform=win32 --disable-sndfile --disable-samplerate --disable-jack --disable-avcodec --notests"
27
28 # get waf
29 ./scripts/get_waf.sh
30
31 # fetch Vamp SDK
32 ./scripts/get_deps_mingw32.sh
33
34 # fetch and build aubio
35 ./scripts/get_aubio.sh
36
37 # configure and build plugin
38 ./waf configure
39
40 ./waf build -v
41
42 # system-wide installation
43 #./waf install --destdir=dist-win
44
45 if [ "$1" = 'dist' ]
46 then
47   DESTDIR=vamp-aubio-plugins-$VAMP_AUBIO_VERSION-win32
48   rm -rf $DESTDIR $DESTDIR.zip
49   mkdir $DESTDIR
50   cp -prv contrib/aubio*/README.md $DESTDIR/README.aubio.md
51   cp -prv README.md $DESTDIR
52   cp -prv build/vamp-aubio.dll $DESTDIR
53   $STRIP $DESTDIR/vamp-aubio.dll
54   cp -prv vamp-aubio.cat vamp-aubio.n3 $DESTDIR
55   zip -r $DESTDIR.zip $DESTDIR
56 fi