2005-12-29 00:04:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-07-01 16:29:43 +00:00
|
|
|
# Note: This works in Linux and cygwin
|
|
|
|
|
2013-03-21 15:47:55 +00:00
|
|
|
if [ "$ARCH" = "x86_64" ];
|
|
|
|
then
|
|
|
|
CMD_PREFIX="amd64-mingw32msvc x86_64-w64-mingw32"
|
|
|
|
else
|
|
|
|
CMD_PREFIX="i586-mingw32msvc i686-w64-mingw32"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CC" = "cc" ] || [ "$CC" = "gcc" ];
|
|
|
|
then
|
|
|
|
CC=
|
|
|
|
fi
|
2011-07-18 22:27:25 +00:00
|
|
|
|
|
|
|
if [ "X$CC" = "X" ]; then
|
|
|
|
for check in $CMD_PREFIX; do
|
|
|
|
full_check="${check}-gcc"
|
2012-07-01 16:29:43 +00:00
|
|
|
which "$full_check" > /dev/null 2>&1
|
|
|
|
if [ "$?" = "0" ]; then
|
|
|
|
export CC="$full_check"
|
|
|
|
fi
|
2011-07-18 22:27:25 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "X$WINDRES" = "X" ]; then
|
|
|
|
for check in $CMD_PREFIX; do
|
|
|
|
full_check="${check}-windres"
|
2012-07-01 16:29:43 +00:00
|
|
|
which "$full_check" > /dev/null 2>&1
|
|
|
|
if [ "$?" = "0" ]; then
|
|
|
|
export WINDRES="$full_check"
|
|
|
|
fi
|
2011-07-18 22:27:25 +00:00
|
|
|
done
|
2011-06-16 22:50:33 +00:00
|
|
|
fi
|
|
|
|
|
2011-07-18 22:27:25 +00:00
|
|
|
if [ "X$WINDRES" = "X" -o "X$CC" = "X" ]; then
|
|
|
|
echo "Error: Must define or find WINDRES and CC"
|
|
|
|
exit 1
|
2010-10-19 06:48:02 +00:00
|
|
|
fi
|
2011-06-16 22:50:33 +00:00
|
|
|
|
|
|
|
export PLATFORM=mingw32
|
|
|
|
|
2005-12-29 00:04:41 +00:00
|
|
|
exec make $*
|