medit/mingw-configure

106 lines
3.8 KiB
Plaintext
Raw Normal View History

2005-06-22 11:20:32 -07:00
#!/bin/sh
2007-01-04 02:40:07 -08:00
write_pkg_config()
{
rm -f $1
cat > $1 << ENDSRIPT
#!/bin/sh
2007-01-04 02:40:07 -08:00
export PKG_CONFIG_LIBDIR="$GTK_PREFIX/lib/pkgconfig":"$PYTHON_PREFIX/Lib/pkgconfig"
export PKG_CONFIG_PATH=\$PKG_CONFIG_LIBDIR
2005-06-22 11:20:32 -07:00
# pkg-config doesn't like --define-variable with these
if [ "x\`echo "\$*" | grep -- --atleast-pkgconfig-version\`" != x -o \\
"x\`echo "\$*" | grep -- --atleast-version\`" != x ]; then
2007-01-04 02:40:07 -08:00
exec "$PKG_CONFIG_PROGRAM" \$*
else
exec "$PKG_CONFIG_PROGRAM" --define-variable=prefix="$GTK_PREFIX" \$*
2005-06-22 11:20:32 -07:00
fi
2007-01-04 02:40:07 -08:00
ENDSRIPT
chmod +x $1
}
2005-06-22 11:20:32 -07:00
PKG_CONFIG_PROGRAM=${PKG_CONFIG_PROGRAM:-/usr/bin/pkg-config}
MINGW_TOOL_PREFIX=${MINGW_TOOL_PREFIX:-/usr/bin/i586-mingw32msvc-}
2006-08-01 12:49:57 -07:00
export GTK_PREFIX=${GTK_PREFIX:-/usr/local/win/gtk}
if [ "x$1" = "x--with-python=2.5" -o "x$2" = "x--with-python=2.5" ]; then
export PYTHON_PREFIX=${PYTHON_PREFIX:-/usr/local/win/Python25}
export PYTHON25_HOME=$PYTHON_PREFIX
else
export PYTHON_PREFIX=${PYTHON_PREFIX:-/usr/local/win/Python24}
export PYTHON24_HOME=$PYTHON_PREFIX
2006-08-01 12:49:57 -07:00
fi
export PYTHON_HOME=$PYTHON_PREFIX
export PYTHON24_HOME=${PYTHON24_HOME:-/usr/local/win/Python24}
export PYTHON25_HOME=${PYTHON25_HOME:-/usr/local/win/Python25}
2005-06-22 11:20:32 -07:00
if [ x$CONFIGURE = x ]; then
CONFIGURE="configure"
if [ ! -e $CONFIGURE ]; then
CONFIGURE=`dirname $0`/configure
fi
if [ ! -e $CONFIGURE ]; then
echo "Can't find configure script"
exit 1
fi
2006-06-08 08:48:20 -07:00
configure_dir=`dirname "$CONFIGURE"`
configure_dir=`cd "$configure_dir" && pwd`
CONFIGURE="$configure_dir"/configure
2007-01-04 02:40:07 -08:00
CONFIG_GUESS="$configure_dir"/config.guess
2005-06-22 11:20:32 -07:00
fi
# autoconf is not intelligent enough to guess that
# i586-pc-mingw32msvc target has anything to do with
# debian /usr/bin/i586-mingw32msvc-gcc or freebsd
# /usr/local/mingw32/bin/gcc, hence these variables
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 AR="${MINGW_TOOL_PREFIX}ar"
export RANLIB="${MINGW_TOOL_PREFIX}ranlib"
export STRIP="${MINGW_TOOL_PREFIX}strip"
2005-06-22 11:20:32 -07:00
export LDFLAGS="-L$GTK_PREFIX/lib -mno-cygwin"
export CPPFLAGS="-I$GTK_PREFIX/include"
export CFLAGS="${CFLAGS:-"-O2"} -I$GTK_PREFIX/include -mno-cygwin -mms-bitfields -march=i686"
export CXXFLAGS="${CFLAGS:-"-O2"} -I$GTK_PREFIX/include -mno-cygwin -mms-bitfields -march=i686"
2005-06-22 11:20:32 -07:00
2007-01-04 02:40:07 -08:00
mkdir -p fake-bin
write_pkg_config fake-bin/pkg-config
export PKG_CONFIG="`pwd`/fake-bin/pkg-config"
export PATH=`pwd`/fake-bin:$MINGW_BIN:/usr/i586-mingw32msvc/bin:/usr/local/mingw32/bin:$PATH
2005-06-22 11:20:32 -07:00
TARGET=i586-pc-mingw32msvc
2005-06-22 11:20:32 -07:00
echo sh $CONFIGURE --build=`$CONFIG_GUESS` --host=$TARGET --target=$TARGET \
--enable-all-warnings --enable-maintainer-mode \
PKG_CONFIG="$PKG_CONFIG" GTK_PREFIX="$GTK_PREFIX" \
PYTHON_PREFIX="$PYTHON_PREFIX" PYTHON_HOME="$PYTHON_HOME" \
PYTHON24_HOME="$PYTHON24_HOME" PYTHON25_HOME="$PYTHON25_HOME" \
AR="$AR" RANLIB="$RANLIB" STRIP="$STRIP" AS="$AS" DLLTOOL="$DLLTOOL" \
OBJDUMP="$OBJDUMP" NM="$NM" $@
exec sh $CONFIGURE --build=`$CONFIG_GUESS` --host=$TARGET --target=$TARGET \
--enable-all-warnings --enable-maintainer-mode \
PKG_CONFIG="$PKG_CONFIG" GTK_PREFIX="$GTK_PREFIX" \
PYTHON_PREFIX="$PYTHON_PREFIX" PYTHON_HOME="$PYTHON_HOME" \
PYTHON24_HOME="$PYTHON24_HOME" PYTHON25_HOME="$PYTHON25_HOME" \
AR="$AR" RANLIB="$RANLIB" STRIP="$STRIP" AS="$AS" DLLTOOL="$DLLTOOL" \
OBJDUMP="$OBJDUMP" NM="$NM" $@