Update: a tutorial on building Mono on Windows by Andreia Gaita is available here (http://shana.worldofcoding.com/en/mono_cygwin_tutorial.html).
There are two ways of building Mono on Windows, both do require a Cygwin setup which provides some tools required by Mono at build time. First, download and install Cygwin from www.cygwin.com.
Make sure you select the following packages when installing:
* autoconf * automake * bison * gcc-mingw-core * gcc-mingw-g++ * libtool * make * python
A proper make version (v3.80, recent Cygwin version are broken) is available from here (http://www.go-mono.com/archive/helper/make-3.80-1.tar.bz2).
Select some handy utils for later use:
* unzip (needed for the relocation script below) * wget * zip
Some other tools that are nice:
* cvs * patch * openssh or PuTTY * subversion, alternatively TortoiseSVN * vim
At this point, you can do a VisualStudio build or you can continue reading the instructions for a cygwin build.
Now it's time to get some other dependencies:
* ftp://ftp.gtk.org/pub/gtk/v2.6/win32/glib-2.6.6.zip * ftp://ftp.gtk.org/pub/gtk/v2.6/win32/glib-dev-2.6.6.zip * http://www.gimp.org/~tml/gimp/win32/pkgconfig-0.15.zip * http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.bin.woe32.zip * http://www.gimp.org/~tml/gimp/win32/gettext-0.14.5.zip * http://www.gimp.org/~tml/gimp/win32/gettext-dev-0.14.5.zip
Do some path relocation on these dependencies with this script:
do-install-zip-pkgs (http://anonsvn.mono-project.com/viewvc/trunk/release/packaging/do-install-zip-pkgs?view=co)
Note: utils.py (http://anonsvn.mono-project.com/viewvc/trunk/release/pyutils/utils.py?view=co) needs to be in the same dir as do-install-zip-pkgs
Call it like this from within Cygwin's bash:
./do-install-zip-pkg <dest> <dest> <path_to_zip_files>/*.zip
Example:
./do-install-zip-pkg /tmp/build_deps /tmp/build_deps /tmp/*.zip
This will extract the zip files to /tmp/build_deps and change the pkg-config .pc files to use /tmp/build_deps as well as set up a script called env.sh that will set up some environment variables
Note: this script also does relocation for other things not necessarily needed in the above zip files, but it should work fine for our purposes here. If you want to change the .pc files manually, that's also fine. Just make sure you set up your environment as well (PATH and PKG_CONFIG_PATH).
If you used the script, load the environment:
. /tmp/build_deps/env.sh
Very important: notice that this is the "dot followed by a space followed by the command" syntax. This syntax means "execute the script in the current shell without using a child process". This is required to set the environment variables in the currently executing shell.
Download the Mono source code from the released tarballs (http://ftp.novell.com/pub/mono/sources-stable/) or Anonymous SVN.
If you download the tarball, extract it with:
tar -zxvf mono-x.x.x.x.tar.gz
Add mono to your path. This could be either a previous build of Mono, or an install from the Mono Windows Combined Installer from Downloads. Using the installer is probably the easiest for most cases.
export PATH=$PATH:<path to installed mono>/bin
In the mono source directory, run the following:
./configure --prefix=/tmp/install
Feel free to use any prefix you like. Continue with:
make make install
If everything goes well, you will have a compiled mono in an hour or two.
Note: There are several ways to get the glib dependencies. For example, they come with the Mono Combined Installer. The above details and instructions are shown in order to demonstrate how the Mono Combined Installer is built.



