#!/bin/sh
# $Id: cfg-mingw32,v 1.7 2013/10/20 14:12:57 tom Exp $
# configure to cross-compile using mingw32 using 32-bits

BUILD_CC=${CC:-gcc}
unset CC
unset CXX

TARGET=`choose-mingw32`

if test -n "$TARGET"
then
	SYS=/usr/$TARGET/sys-root/mingw
	if test -d $SYS/include
	then
		echo "...adding $SYS/include to CFLAGS"
		CFLAGS="$CFLAGS -I$SYS/include"
		export CFLAGS
	fi
	if test -d $SYS/lib
	then
		echo "...adding $SYS/lib to LDFLAGS"
		LDFLAGS="$LDFLAGS -L$SYS/lib"
		export LDFLAGS
	fi
	cfg-normal --with-build-cc=$BUILD_CC --host=$TARGET --target=$TARGET "$@"
else
	echo "? cannot find MinGW-32 compiler in path"
	exit 1
fi
