4 CROSS_DIR
=/opt
/cross
/$MINGW
5 COPY_DLLS
="libgio*.dll libglib*.dll libgmodule*.dll libgthread*.dll libgobject*.dll"
6 INSTALL_DESTDIR
="$CURDIR/mono-win32"
7 PROFILES
="default net_2_0 net_3_5 net_4_0 moonlight"
8 TEMPORARY_PKG_CONFIG_DIR
=/tmp
/$RANDOM-pkg-config-$RANDOM
11 export CPPFLAGS_FOR_EGLIB CFLAGS_FOR_EGLIB CPPFLAGS_FOR_LIBGC CFLAGS_FOR_LIBGC
15 if [ -d "$TEMPORARY_PKG_CONFIG_DIR" ]; then
16 rm -rf "$TEMPORARY_PKG_CONFIG_DIR"
24 CROSS_BIN_DIR
="$CROSS_DIR/bin"
25 CROSS_DLL_DIR
="$CROSS_DIR/bin"
26 CROSS_PKG_CONFIG_DIR
=$CROSS_DIR/lib
/pkgconfig
27 PATH
=$CROSS_BIN_DIR:$PATH
30 if [ -d .
/.git
/svn
]; then
31 SVN_INFO
='git svn info'
32 elif [ -d .
/.svn
]; then
38 if [ -n "$SVN_INFO" ]; then
39 MONO_SVN_REVISION
=`$SVN_INFO | grep Revision | sed 's/.*: //'`
40 MONO_BRANCH
=`$SVN_INFO | grep URL | sed -e 's;.*source/;;g' -e 's;/mono;;g'`
42 MONO_SVN_REVISION
="rUNKNOWN"
46 MONO_VERSION
=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
47 MONO_RELEASE
="$MONO_VERSION-$MONO_BRANCH-r$MONO_SVN_REVISION"
48 MONO_PREFIX
="/mono-$MONO_RELEASE"
53 if [ -d "$CROSS_PKG_CONFIG_DIR" ]; then
54 install -d -m 755 "$TEMPORARY_PKG_CONFIG_DIR"
55 for pc
in "$CROSS_PKG_CONFIG_DIR"/*.pc
; do
56 pcname
="`basename $pc`"
57 sed -e "s;^prefix=.*;prefix=$CROSS_DIR;g" < $pc > "$TEMPORARY_PKG_CONFIG_DIR"/$pcname
59 CROSS_PKG_CONFIG_DIR
="$TEMPORARY_PKG_CONFIG_DIR"
62 echo Mono Win32 installation prefix
: $MONO_PREFIX
69 BUILD
="`./config.guess`"
71 if [ -f .
/Makefile
]; then
76 if [ ! -d "$CURDIR/build-cross-windows" ]; then
77 mkdir
"$CURDIR/build-cross-windows"
80 cd "$CURDIR/build-cross-windows"
82 ..
/configure
--prefix=$MONO_PREFIX --with-crosspkgdir=$CROSS_PKG_CONFIG_DIR --build=$BUILD --target=$MINGW --host=$MINGW --enable-parallel-mark --program-transform-name="" --with-tls=none
--disable-mcs-build --disable-embed-check --enable-win32-dllmain=yes --with-libgc-threads=win32
--with-profile4=yes
86 if [ ! -d "$CURDIR/build-cross-windows-mcs" ]; then
87 mkdir
"$CURDIR/build-cross-windows-mcs"
94 cd "$CURDIR/build-cross-windows-mcs"
96 ..
/configure
--prefix=$MONO_PREFIX --enable-parallel-mark
100 function doinstall
()
102 if [ -d "$INSTALL_DIR" ]; then
103 rm -rf "$INSTALL_DIR"
105 cd "$CURDIR/build-cross-windows"
106 make DESTDIR
="$INSTALL_DESTDIR" USE_BATCH_FILES
=yes install
108 cd "$CURDIR/../mcs/mcs"
110 for p
in $PROFILES; do
111 make DESTDIR
="$INSTALL_DESTDIR" PROFILE
=$p install ||
echo "mcs profile $p installation failed"
114 cd "$CURDIR/../mcs/class"
115 for p
in $PROFILES; do
116 make DESTDIR
="$INSTALL_DESTDIR" PROFILE
=$p install ||
echo "class library profile $p installation failed"
119 cd "$CURDIR/../mcs/tools"
120 for p
in $PROFILES; do
121 make DESTDIR
="$INSTALL_DESTDIR" PROFILE
=$p install ||
echo "tools profile $p installation failed"
124 cd "$CURDIR/mono-win32"
125 for dll
in $COPY_DLLS; do
126 cp -ap "$CROSS_DLL_DIR"/$dll "$INSTALL_DESTDIR/$MONO_PREFIX/bin"
129 rm -f "$CURDIR/mono-win32-$MONO_RELEASE".
zip
130 zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".
zip .
137 Usage: build-mingw32.sh [OPTIONS]
141 -d DIR Sets the location of directory where MINGW is installed [$CROSS_DIR]
142 -m MINGW Sets the MINGW target name to be passed to configure [$MINGW]
152 while getopts "d:m:h" opt
; do
154 d
) CROSS_DIR
="$OPTARG" ;;
155 m
) MINGW
="$OPTARG" ;;