medit/plat/win32/mingw-configure

120 lines
3.3 KiB
Plaintext
Raw Normal View History

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
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++"
elif [ -e /usr/bin/i686-pc-mingw32-gcc ]; then
_mingw_tool_prefix="/usr/bin/i686-pc-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
case "$mgwconfig" in
debug) :
2012-08-03 23:58:34 -07:00
_def_cflags='-gstabs+' ;;
reldbg) :
2012-08-03 23:58:34 -07:00
_def_cflags='-gstabs+ -O2' ;;
release) :
_def_cflags='-O2' ;;
*) :
echo "oops"; exit 1 ;;
esac
2010-09-10 00:47:09 -07:00
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
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
if $mgwlinux; then
_configure_build=i686-pc-linux-gnu
_configure_target=i586-pc-mingw32msvc
elif $mgwcygwin; then
_configure_build=i686-pc-cygwin
_configure_target=i686-pc-mingw32
else
echo "*** oops, neither mgwlinux nor mgwcygwin are set ***"
fi
configure_args="--build=$_configure_build --host=$_configure_target --target=$_configure_target \
2010-09-10 00:47:09 -07:00
AR=$AR RANLIB=$RANLIB STRIP=$STRIP AS=$AS DLLTOOL=$DLLTOOL OBJDUMP=$OBJDUMP NM=$NM WINDRES=$WINDRES RC=$RC \
2012-07-29 20:11:01 -07:00
INSTALL=`which install-check` MOO_WIN32_CONFIG=$mgwconfig \
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 "$@"