medit/mingw-configure

75 lines
2.4 KiB
Bash
Executable File

#!/bin/sh
PKG_CONFIG_PROGRAM=${PKG_CONFIG_PROGRAM:-/usr/bin/pkg-config}
MINGW_TOOL_PREFIX=${MINGW_TOOL_PREFIX:-/usr/bin/i586-mingw32msvc}
if [ -z $GTK_PREFIX ]; then
export GTK_PREFIX=/usr/local/win/gtk
fi
export PKG_CONFIG_PATH=$GTK_PREFIX/lib/pkgconfig
export PKG_CONFIG_LIBDIR=$GTK_PREFIX/lib/pkgconfig
############################################################################
if [ x`basename $0` = xfake-pkg-config ]; then
if [ "x$1" = "x--atleast-pkgconfig-version" ]; then
exec $PKG_CONFIG_PROGRAM --atleast-pkgconfig-version $2
else
exec $PKG_CONFIG_PROGRAM --define-variable=prefix=$GTK_PREFIX $*
fi
fi
############################################################################
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
configure_dir=`dirname "$CONFIGURE"`
configure_dir=`cd "$configure_dir" && pwd`
CONFIGURE="$configure_dir"/configure
fi
export ADDR2LINE="$MINGW_TOOL_PREFIX-addr2line"
export AR="$MINGW_TOOL_PREFIX-ar"
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 RANLIB="$MINGW_TOOL_PREFIX-ranlib"
export READELF="$MINGW_TOOL_PREFIX-readelf"
export SIZE="$MINGW_TOOL_PREFIX-size"
export STRINGS="$MINGW_TOOL_PREFIX-strings"
export STRIP="$MINGW_TOOL_PREFIX-strip"
export WINDRES="$MINGW_TOOL_PREFIX-windres"
export CPATH=$GTK_PREFIX/include
export LDFLAGS="-L$GTK_PREFIX/lib $LDFLAGS"
export CFLAGS="${CFLAGS:-"-O2 -g"} -I$GTK_PREFIX/include -mms-bitfields -march=i686"
export CXXFLAGS="${CFLAGS:-"-O2 -g"} -I$GTK_PREFIX/include -mms-bitfields -march=i686"
export PATH=$MINGW_BIN:/usr/i586-mingw32msvc/bin:/usr/local/mingw32/bin:$PATH
if [ -L fake-pkg-config ]; then
rm fake-pkg-config
fi
ln -s $0 fake-pkg-config
export PKG_CONFIG="./fake-pkg-config"
TARGET=i586-pc-mingw32msvc
exec sh $CONFIGURE --target=$TARGET --host=$TARGET --enable-all-gcc-warnings $*