2010-09-10 00:47:09 -07:00
|
|
|
#! /bin/sh
|
2012-07-29 06:12:48 +01:00
|
|
|
# -%- lang:sh; indent-width:2 -%-
|
2010-09-10 00:47:09 -07:00
|
|
|
|
|
|
|
builddir=`pwd`
|
|
|
|
srcdir=`dirname $0`/../..
|
|
|
|
srcdir=`cd $srcdir && pwd`
|
|
|
|
if [ ! -e $srcdir/configure ]; then
|
|
|
|
echo "configure script not found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2010-09-30 23:12:08 -07:00
|
|
|
if [ -e /usr/bin/i586-mingw32msvc-gcc ]; then
|
|
|
|
_mingw_tool_prefix="/usr/bin/i586-mingw32msvc"
|
|
|
|
STATIC_LIBGCC=
|
|
|
|
elif [ -e /usr/bin/i486-mingw32-gcc ]; then
|
|
|
|
_mingw_tool_prefix="/usr/bin/i486-mingw32"
|
|
|
|
STATIC_LIBGCC="-static-libgcc -static-libstdc++"
|
|
|
|
else
|
|
|
|
echo "don't know where mingw compiler is"
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-09-10 00:47:09 -07:00
|
|
|
|
|
|
|
export mgwdir=`dirname $0`/gtk-win
|
|
|
|
. $mgwdir/config.sh || exit 1
|
|
|
|
|
2010-09-23 03:32:21 -07:00
|
|
|
en_only=false
|
|
|
|
if [ "$1" = "--en" ]; then
|
|
|
|
en_only=true
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
|
|
|
destdir=$mgwdestdir
|
|
|
|
if $en_only; then
|
|
|
|
destdir=$destdir-en
|
|
|
|
fi
|
|
|
|
|
2010-09-10 00:47:09 -07:00
|
|
|
if [ "$mgwconfig" = "debug" ]; then
|
|
|
|
_def_cflags='-gstabs'
|
|
|
|
else
|
|
|
|
_def_cflags='-O2'
|
|
|
|
fi
|
|
|
|
|
|
|
|
export ADDR2LINE=$_mingw_tool_prefix-addr2line
|
|
|
|
export AS=$_mingw_tool_prefix-as
|
|
|
|
export CC=$_mingw_tool_prefix-gcc
|
|
|
|
export CPP=$_mingw_tool_prefix-cpp
|
|
|
|
export CPPFILT=$_mingw_tool_prefix-c++filt
|
|
|
|
export CXX=$_mingw_tool_prefix-g++
|
|
|
|
export DLLTOOL=$_mingw_tool_prefix-dlltool
|
|
|
|
export DLLWRAP=$_mingw_tool_prefix-dllwrap
|
|
|
|
export GCOV=$_mingw_tool_prefix-gcov
|
|
|
|
export LD=$_mingw_tool_prefix-ld
|
|
|
|
export NM=$_mingw_tool_prefix-nm
|
|
|
|
export OBJCOPY=$_mingw_tool_prefix-objcopy
|
|
|
|
export OBJDUMP=$_mingw_tool_prefix-objdump
|
|
|
|
export READELF=$_mingw_tool_prefix-readelf
|
|
|
|
export SIZE=$_mingw_tool_prefix-size
|
|
|
|
export STRINGS=$_mingw_tool_prefix-strings
|
|
|
|
export WINDRES=$_mingw_tool_prefix-windres
|
|
|
|
export RC=$_mingw_tool_prefix-windres
|
|
|
|
export AR=$_mingw_tool_prefix-ar
|
|
|
|
export RANLIB=$_mingw_tool_prefix-ranlib
|
|
|
|
export STRIP=$_mingw_tool_prefix-strip
|
|
|
|
|
2010-09-30 23:12:08 -07:00
|
|
|
export LDFLAGS="$STATIC_LIBGCC -L$mgwtargetdir/lib"
|
2010-09-10 00:47:09 -07:00
|
|
|
export CPPFLAGS="-I$mgwtargetdir/include"
|
|
|
|
export CFLAGS="-mms-bitfields -march=i686 $_def_cflags"
|
|
|
|
export CXXFLAGS="-mms-bitfields -march=i686 $_def_cflags"
|
|
|
|
export OBJCFLAGS="-mms-bitfields -march=i686 $_def_cflags"
|
|
|
|
|
|
|
|
export PKG_CONFIG_LIBDIR="$mgwtargetdir/lib/pkgconfig"
|
|
|
|
export PKG_CONFIG_PATH="$mgwtargetdir/lib/pkgconfig"
|
|
|
|
|
2010-12-08 01:30:44 -08:00
|
|
|
export PYTHON_INCLUDES="-I$mgwtargetdir/include/python"
|
2010-12-14 22:14:38 -08:00
|
|
|
export PYTHON_LIBS="-lpython$mgwpythonver"
|
2011-04-16 12:31:54 -07:00
|
|
|
export PYTHON_VERSION=$mgwpythondotver
|
2010-12-08 01:30:44 -08:00
|
|
|
|
2010-09-10 00:47:09 -07:00
|
|
|
configure_args="--build=i686-pc-linux-gnu --host=i586-pc-mingw32msvc --target=i586-pc-mingw32msvc \
|
|
|
|
AR=$AR RANLIB=$RANLIB STRIP=$STRIP AS=$AS DLLTOOL=$DLLTOOL OBJDUMP=$OBJDUMP NM=$NM WINDRES=$WINDRES RC=$RC \
|
2010-09-20 00:31:28 -07:00
|
|
|
INSTALL=`which install-check` \
|
2011-09-28 23:02:23 -07:00
|
|
|
--prefix=$destdir"
|
2010-09-23 03:32:21 -07:00
|
|
|
|
|
|
|
if $en_only; then
|
|
|
|
moo_nls_flags='--disable-nls'
|
|
|
|
else
|
|
|
|
moo_nls_flags=
|
|
|
|
fi
|
2010-09-10 00:47:09 -07:00
|
|
|
|
|
|
|
if [ "$mgwconfig" = "debug" ]; then
|
|
|
|
moo_configure_args='--enable-debug'
|
|
|
|
else
|
|
|
|
moo_configure_args='--enable-dev-mode'
|
|
|
|
fi
|
|
|
|
|
2011-04-16 12:31:54 -07:00
|
|
|
if [ "$1" = "--python" ]; then
|
|
|
|
shift
|
|
|
|
moo_configure_args="$moo_configure_args --enable-moo-module --enable-shared --disable-static"
|
|
|
|
fi
|
|
|
|
|
2010-09-23 03:32:21 -07:00
|
|
|
echo $srcdir/configure $configure_args $moo_configure_args $moo_nls_flags "$@"
|
|
|
|
exec $srcdir/configure $configure_args $moo_configure_args $moo_nls_flags "$@"
|