Pick an installation directory where you want your new copy of Mono to be installed. Lets call that location DIR. Your Mono installation and its dependencies will be installed there. For example, I like to use the directory /mono, so I would replace DIR with /mono in the following discussion.
If you have more than one Mono installation (for example to keep multiple versions around), you will want to read the document on Parallel Mono Environments on how to keep your various Mono installations separate.
It is strongly advised not to install Mono from source in /usr, /usr/local or any other "standard" directories unless you know what you are doing.
Building the Mono Components
Prerequisite: the OSX build expects autotools and dependency libraries from Xcode's standard toolchain. If you have macports or fink installed, disable them when you are building mono. (e.g. remove /opt/local/bin from PATH)
To build mono for OSX from a tarball or svn is now a simple process. However, if you are using an SVN checkout of Mono, you will need to have an existing Mono installation installed (as you will need a C# compiler to bootstrap). NLS is disabled as the default Mac OS X install doesn't provide the msgfmt tool.
$ tar xvf mono-XXX.tar.gz $ cd mono-XXX $ ./configure --prefix=DIR --enable-nls=no --build=i386-apple-darwin11.2.0 $ make $ make install
If you wish to compile Mono in 64 bit mode instead use this:
$ tar xvf mono-XXX.tar.gz $ cd mono-XXX $ ./configure --prefix=DIR --enable-nls=no $ make $ make install
(Use ./autogen.sh instead of ./configure in case you're building from git instead of from a tarball.)
If you receive an error like:
ld: warning: in /usr/local/lib/libiconv.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
This means that configure was able to resolve some optional dependencies in your environment (gettext or glib primarily) that have been compiled for 64-bit when you are building a 32-bit mono or vice-versa. To resolve this either rebuild the dependency to be a universal binary or build a mono that matches your dependencies.