diff options
author | Marek Habersack <grendel@twistedcode.net> | 2008-08-05 16:13:51 +0400 |
---|---|---|
committer | Marek Habersack <grendel@twistedcode.net> | 2008-08-05 16:13:51 +0400 |
commit | 5d11607a5b6f3b95626931e9a3a9bd43be259a4b (patch) | |
tree | 6b0d4220e6c0dfdf5fba3b60258472fc3d51890b /build-mingw32.sh | |
parent | 115fc0608b4322042314e934aac6e89e0c9ad2b9 (diff) |
2008-08-05 Marek Habersack <mhabersack@novell.com>
* configure.in: added support for cross-compilation
2008-08-05 Marek Habersack <mhabersack@novell.com>
* build-mingw32.sh: added a script to build Mono for Windows on a
Linux host using mingw.
2008-08-05 Marek Habersack <mhabersack@novell.com>
* scripts/Makefile.am: added support for cross-compilation,
including .bat generation for windows targets.
2008-08-05 Marek Habersack <mhabersack@novell.com>
* scripts/smcs.bat.in, scripts/script.bat.in,
scripts/script_umask.bat.in: added .bat templates.
2008-08-05 Marek Habersack <mhabersack@novell.com>
* runtime/Makefile.am: mingw cross-compilation support.
2008-08-05 Marek Habersack <mhabersack@novell.com>
* Makefile.am (GENMDESC_PRG): when cross-compiling use full path
to the genmdesc.pl file
2008-08-05 Marek Habersack <mhabersack@novell.com>
* Makefile.am: added support for cross-compilation
svn path=/trunk/mono/; revision=109671
Diffstat (limited to 'build-mingw32.sh')
-rwxr-xr-x | build-mingw32.sh | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/build-mingw32.sh b/build-mingw32.sh new file mode 100755 index 00000000000..200c5fa7188 --- /dev/null +++ b/build-mingw32.sh @@ -0,0 +1,110 @@ +#!/bin/bash -e +CURDIR="`pwd`" +CROSS_DIR=${1:-/opt/cross/} +MINGW=${1:-i386-mingw32msvc} +CROSS_BIN_DIR="$CROSS_DIR/bin" +CROSS_DLL_DIR="$CROSS_DIR/$MINGW/bin" +CROSS_PKG_CONFIG_DIR=$CROSS_DIR/$MINGW/lib/pkgconfig +COPY_DLLS="libgio*.dll libglib*.dll libgmodule*.dll libgthread*.dll libgobject*.dll" +PATH=$CROSS_BIN_DIR:$PATH +INSTALL_DESTDIR="$CURDIR/mono-win32" +PROFILES="default net_2_0 net_2_1 net_3_5" + +export PATH + +function setup () +{ + if [ -d ./.git/svn ]; then + SVN_INFO='git svn info' + elif [ -d ./.svn ]; then + SVN_INFO='svn info' + else + SVN_INFO="" + fi + + if [ -n "$SVN_INFO" ]; then + MONO_SVN_REVISION=`$SVN_INFO | grep Revision | sed 's/.*: //'` + MONO_BRANCH=`$SVN_INFO | grep URL | sed -e 's;.*source/;;g' -e 's;/mono;;g'` + else + MONO_SVN_REVISION="rUNKNOWN" + MONO_BRANCH="tarball" + fi + + MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'` + MONO_RELEASE="$MONO_VERSION-$MONO_BRANCH-r$MONO_SVN_REVISION" + MONO_PREFIX="/mono-$MONO_RELEASE" + + NOCONFIGURE=yes + export NOCONFIGURE + + echo Mono Win32 installation prefix: $MONO_PREFIX +} + +function build () +{ + ./autogen.sh + + if [ -f ./Makefile ]; then + make distclean + fi + + if [ ! -d "$CURDIR/build-cross-windows" ]; then + mkdir "$CURDIR/build-cross-windows" + fi + + cd "$CURDIR/build-cross-windows" + rm -rf * + ../configure --prefix=$MONO_PREFIX --with-crosspkgdir=$CROSS_PKG_CONFIG_DIR --target=$MINGW --host=$MINGW --enable-parallel-mark --program-transform-name="" + make + cd "$CURDIR" + + if [ ! -d "$CURDIR/build-cross-windows-mcs" ]; then + mkdir "$CURDIR/build-cross-windows-mcs" + fi + cd "$CURDIR/build-cross-windows-mcs" + rm -rf * + ../configure --prefix=$MONO_PREFIX --enable-parallel-mark + make +} + +function doinstall () +{ + if [ -d "$INSTALL_DIR" ]; then + rm -rf "$INSTALL_DIR" + fi + cd "$CURDIR/build-cross-windows" + make DESTDIR="$INSTALL_DESTDIR" USE_BATCH_FILES=yes install + + cd "$CURDIR/../mcs/mcs" + + for p in $PROFILES; do + make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "mcs profile $p installation failed" + done + + cd "$CURDIR/../mcs/class" + for p in $PROFILES; do + make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "class library profile $p installation failed" + done + + cd "$CURDIR/../mcs/tools" + for p in $PROFILES; do + make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "tools profile $p installation failed" + done + + cd "$CURDIR/mono-win32" + for dll in $COPY_DLLS; do + cp -ap "$CROSS_DLL_DIR"/$dll "$INSTALL_DESTDIR/$MONO_PREFIX/bin" + done + + rm -f "$CURDIR/mono-win32-$MONO_RELEASE".zip + zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".zip . + +} + +pushd . > /dev/null + +setup +build +doinstall + +popd > /dev/null |