#!/bin/sh
svn up
STAT=$(svn status)
test "x$STAT" == "x" || PLUS="+"
REV=$(svn info | grep Revision | cut -d' ' -f2)$PLUS
export CFLAGS="-I../../portaudio/include/ -I../../pthreads-w32-2-8-0-release/ -DPORTAUDIO -DREV='\"r$REV\"'"
export LDFLAGS='-L../../pthreads-w32-2-8-0-release -L../../portaudio/lib/.libs'

./configure --host=i386-mingw32 --enable-nls
make clean
make
cd src
i386-mingw32-windres -i lingot.rc -o lingotrc.o
/bin/sh ../libtool --tag=CC --mode=link i386-mingw32-gcc $CFLAGS -o lingot.exe *.o $LDFLAGS -lgdk_pixbuf-2.0 -lz -lm -lgdk-win32-2.0 -lglib-2.0 -lgobject-2.0 -lpango-1.0 -lgtk-win32-2.0 -lpthreadGC2 -lportaudio -mwindows
cp .libs/lingot.exe ../../build/lingot.exe
cd ..
strip ../build/lingot.exe
