#!/bin/sh
# cross compilation Linux -> Win32 script

# host is the destination platform
HOST=i386-mingw32
#HOST=i386-mingw32msvc
# target is the destination architecture
TARGET=i386-mingw32
# build is the local platform
BUILD=i686-pc-linux-gnu
# BUILD=i386-linux

# configuration options
CONFOPTS="--enable-unicode=ucs4 --with-threads"

############### nothing to change from here ##########

CROSSOPTS="--target=$TARGET --host=$HOST --build=$BUILD"
CC=/usr/bin/i586-mingw32msvc-gcc \
  CXX=/usr/bin/i586-mingw32msvc-g++ \
  AR=/usr/bin/i586-mingw32msvc-ar \
  RANLIB=/usr/bin/i586-mingw32msvc-ranlib \
 ./configure $CROSSOPTS $CONFOPTS 2>&1 | \
tee crossbuild.log
make 2>&1 | tee --append crossbuild.log
echo "finished cross-compiling library and executable of python for $HOST"
