#!/bin/bash

# Cross-compile from Linux to Win32 using the MinGW cross-compiler as
# provided by Debian.  The fftw3.a static-built library should be
# found under libs.  This only requires double (not float or long long
# double).  

COPT="-O6 -s -Wall"
OPT="$COPT -DT_MINGW -I /usr/i586-mingw32msvc/include -I./libs"
GCC=i586-mingw32msvc-gcc
LIBDIR=/usr/i586-mingw32msvc/lib
LIBS="libs/xmingw-fftw3.a"

$GCC $OPT bavsa.c $LIBS -L$LIBDIR -lm -lmingw32 -lwinmm -o ../bavsa.exe ||
{ echo "FAILED"; exit 1; }
