* Compiling Mono
This document describes how to compile and install Mono from
its source code. If you are only interested in running Mono,
you might want to install Mono from packages, which have been
tested.
The core of Mono is split in two components:
* C components (available in the mono package)
* C# components (available in the mcs package).
Mono is also available in various forms:
- Officially released packages.
-
This is the format of choice for people to use, since these
have been tested and are known to build and work.
- Daily packages.
-
This is a service offered for people who want to try out the
daily changes. Baked daily.
- CVS source code.
-
These are available to Mono developers and
also for enthusiasts through anonymous CVS.
- CVS snapshots.
-
Available for curious developers which do not necessarily want to
install the CVS source. Baked daily.
* Compiling the code
There are a number of ways of compiling Mono
(which is an easy way to get the latest CVS information)
* Compiling with scripts
These scripts should be used for installing from packages, specially
on Windows, where dependencies have not always been installed.
There are scripts to help build mono for both Unix and Windows. Get
mono-build.sh for Unix, or mono-build-w32.sh for Windows.
These scripts automate the installation of GLIB and pkgconfig
(building from source on Unix, and using binary packages
provided by the GIMP for Windows project on Windows.) To use
the script, follow these simple steps:
* Save the script for your platform somewhere (e.g. /usr/local/bin)
* Make the script executable (i.e chmod 755 /usr/local/bin/mono-build.sh)
* Create a directory to hold the mono source, and the compiled binaries (e.g. mkdir ~/mono)
* Change to the new directory (i.e. cd ~/mono)
* run the script (i.e. /usr/local/bin/mono-build.sh)
The script requires wget on either platform, and building the
software requires make, gcc, automake, autoconf, and libtool.
You should install these packages from your distribution or
with the cygwin installer. You should also take care of setting
the right environment variables as the PKG_CONFIG_FLAGS, etc.
The script will download required packages from
www.go-mono.com and do a cvs checkout of mono in the current
directory. IMPORTANT!: The cvs server chosen defaults to
anonymous cvs;
set your CVSROOT environment variable before running the script to
select a particular cvs server.
** Building the software manually
You will need to obtain the Mono dependencies first: glib 2.x and
pkg-config.
*** Building From Packages
This applies to both the officially released packages, as well as the
daily tarball packages.
Unpack the Mono runtime distribution:
tar xzvf mono-X.XX.tar.gz
cd mono-X.XX
Then configure, compile and install:
./configure --prefix=/usr/local
make
make install
This will give you a runtime, C# compiler and runtime
libraries.
If you want to recompile the runtime and the compiler,
follow these steps, first unpack the MCS package:
tar xzvf mcs-X.XX.tar.gz
Then use the following command to compile and install:
./configure --profile=atomic
make
You can change /usr/local to something else if you want.
*** Building from CVS
To upgrade your Mono installation from CVS, it is very
important that you update your Mono and MCS modules from CVS
at the same time. Failure to do so might result in a
problematic installation as the runtime and the class
libraries will be out of sync.
Run the following commands to update your CVS tree (more
details in Cvs and Mono and the AnonCVS and Mono pages).
(cd mono; cvs update -dP .)
(cd mcs; cvs update -dP .)
Then you can run:
(cd mono; make bootstrap)
Now you can install the result:
(cd mono; make install)
Notice that following the above procedure does not require you
to manually install the software in the `mcs' directory, as
the relevant files will be copied by the `mono' makefiles.
* Software resources and notes
The required and additional software can be downloaded here:
* Microsoft's .NET Framework SDK from
msdn.microsoft.com/downloads.
* Cygwin and the GNU Make tools from
www.cygwin.com.
Some people observed problems with autoconf 2.52. Installing
autoconf 2.13 helped in those cases.
* Precompiled GLIB 2.0 and pkg-config packages (and
their dependencies) by the GIMP for Windows project from
http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
http://www.go-mono.com/archive/libiconv-1.7.zip
http://www.go-mono.com/archive/libiconv-dev-1.7-20020101.zip
http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
* Download the Mono source code from the
packaged versions or
the
nightly snapshots or the
Anonymous CVS. The nightly snapshots are done every
night at 10pm EST (Boston Time). The nightly snapshots are
not guaranteed to build, but most of the time they should.
*** Notes on compiling GLIB 2.0 and pkg-config from source:
* Some people observed problems with autoconf 2.52. Installing
autoconf 2.13 helped in those cases (don't forget to do a
`make maintainer-clean' after the update).
* Download, compile and install pkg-config from source.
(I had to change line 674 of
pkg-config-0.8.0/glib-1.2.8/gstrfuncs.c from
extern char *strsignal (int sig); to
extern const char *strsignal (int sig);.
tar xzvf pkg-config-0.8.0.tar.gz
cd pkg-config-0.8.0
./configure --prefix=/usr
make
make install
* Download, compile and install libiconv from source.
If you dont have MS Visual C/C++ 4.0 or 5.0 or 6.0 you can also try
the binary package available at
http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.bin.woe32.zip
* Download, compile and install the
glib 2.0 from source.