#!/bin/sh

target=i386--mingw32
host=`scripts/config.guess`

CC="${target}-gcc"
CPP="${target}-gcc -E"
RANLIB="${target}-ranlib"

cc_version=`$CC --version`
if ! echo "$cc_version" | egrep '[0-9]+wk[0-9]+' ; then
   echo "gcc version $cc_version is not supported" >&2
   echo "see doc/README.W32 for instructions" >&2
   exit 1
fi

if [ -f config.h ]; then
   if grep HAVE_DOSISH_SYSTEM config.h | grep undef >/dev/null; then
   	echo "Pease run a 'make distclean' first" >&2
	exit 1
   fi
fi

export CC CPP RANLIB
./configure --host=${host} --target=${target} $*


