2010-04-16 Sebastien Pouliot <sebastien@ximian.com>
[mono/afaerber.git] / web / compiling
blob95281a93683b63120272fb9b8edc1914a76695f2
1 * Compiling Mono
3         This document describes how to compile and install Mono from
4         its source code.  If you are only interested in running Mono,
5         you might want to install Mono from packages, which have been
6         tested.
8         The core of Mono is split in two components:
10         <ul>
11                 * C components (available in the mono package)
13                 * C# components (available in the mcs package).
14         </ul>
16         Mono is also available in various forms:
18         <dl>
19                 <dt>Officially <a href="download.html">released</a> packages.</dt>
20                 <dd>
21                   <p>This is the format of choice for people to use, since these
22                   have been tested and are known to build and work. 
23                 </dd>
24                 <dt><a href="daily">Daily</a> packages.</dt>
25                 <dd>
26                   <p>This is a service offered for people who want to try out the
27                   daily changes. Baked daily.</dd>
28                 <dt>CVS source code.</dt>
29                 <dd>
30                   <p>These are available to Mono <a href="ccvs.html">developers</a> and
31                   also for enthusiasts through <a href="anoncvs.html">anonymous CVS</a>. 
32                 </dd>
33                 <dt>CVS snapshots.</dt>
34                 <dd>
35                   <p>Available for curious developers which do not necessarily want to 
36                   install the CVS source.  Baked daily.
37                 </dd>
38         </dl>
40 * Compiling the code
42         There are a number of ways of compiling Mono
44         <ul>
45                 <li>From the <a href="#scripts">scripts</A>
47                 <LI><a href="#install">Manually</a> for the first time. 
49                 <li>Manually, <a href="#upgrade">while upgrading</a> to CVS
50         </ul>
52         (which is an easy way to get the latest CVS information)
54 <a name="scripts">
55 * Compiling with scripts
57         These scripts should be used for installing from packages, specially
58         on Windows, where dependencies have not always been installed.
60         There are scripts to help build mono for both Unix and Windows.  Get
61         <a href="mono-build.sh">mono-build.sh</a> for Unix, or <a
62         href="mono-build-w32.sh">mono-build-w32.sh</a> for Windows.
63         These scripts automate the installation of GLIB and pkgconfig
64         (building from source on Unix, and using binary packages
65         provided by the GIMP for Windows project on Windows.)  To use
66         the script, follow these simple steps:
68         <ul>
69                 * Save the script for your platform somewhere (e.g. /usr/local/bin)
70                 * Make the script executable (i.e chmod 755 /usr/local/bin/mono-build.sh)
71                 * Create a directory to hold the mono source, and the compiled binaries (e.g. mkdir ~/mono)
72                 * Change to the new directory (i.e. cd ~/mono)
73                 * run the script (i.e. /usr/local/bin/mono-build.sh)
74         </ul>
76         The script requires wget on either platform, and building the
77         software requires make, gcc, automake, autoconf, and libtool.
78         You should install these packages from your distribution or
79         with the cygwin installer. You should also take care of setting
80         the right environment variables as the PKG_CONFIG_FLAGS, etc.
82         The script will download required packages from
83         www.go-mono.com and do a cvs checkout of mono in the current
84         directory.  <b>IMPORTANT!:</b> The cvs server chosen defaults to 
85         anonymous cvs;
86         set your CVSROOT environment variable before running the script to
87         select a particular cvs server.
89 <a name="install">
91 ** Building the software manually
93         You will need to obtain the Mono dependencies first: <a
94         href="http://www.gtk.org">glib 2.x</a> and 
95         <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a>.
97 *** Building From Packages
99         This applies to both the officially released packages, as well as the
100         daily tarball packages.
102         <ul>
103                 Unpack the Mono runtime distribution:
104                 <pre class="shell">
105                 tar xzvf mono-X.XX.tar.gz
106                 cd mono-X.XX</pre>
107                 <p>
109                 Then configure, compile and install:
111                 <pre class="shell">
112                 ./configure --prefix=/usr/local
113                 make
114                 make install</pre>
116                 This will give you a runtime, C# compiler and runtime
117                 libraries.  
119                 If you want to recompile the runtime and the compiler,
120                 follow these steps, first unpack the MCS package:
122                 <pre class="shell">
123                 tar xzvf mcs-X.XX.tar.gz</pre>
125                 Then use the following command to compile and install:
127                 <pre class="shell">
128                 ./configure --profile=atomic 
129                 make</pre>
131                 You can change /usr/local to something else if you want.
132         </ul>
134 *** Building from CVS
136         To upgrade your Mono installation from CVS, it is very
137         important that you update your Mono and MCS modules from CVS
138         at the same time.  Failure to do so might result in a
139         problematic installation as the runtime and the class
140         libraries will be out of sync.
142         Run the following commands to update your CVS tree (more
143         details in <a href="ccvs.html">Cvs and Mono</a> and the <A
144         href="anoncvs.html">AnonCVS and Mono</a> pages). 
146         <pre>
147         (cd mono; cvs update -dP .)
148         (cd mcs; cvs update -dP .)
149         </pre>
151         Then you can run:
153         <pre>
154         (cd mono; make bootstrap)
155         </pre>
157         Now you can install the result:
159         <pre>
160         (cd mono; make install)
161         </pre>
163         Notice that following the above procedure does not require you
164         to manually install the software in the `mcs' directory, as
165         the relevant files will be copied by the `mono' makefiles.
167 * Software resources and notes
169                 The required and additional software can be downloaded here:
171                 * Microsoft's .NET Framework SDK from 
172                   <a href="http://msdn.microsoft.com/downloads">
173                   msdn.microsoft.com/downloads</a>.
175                 * Cygwin and the GNU Make tools from  
176                   <a href="http://www.cygwin.com">www.cygwin.com</a>.
177                   Some people observed problems with autoconf 2.52. Installing 
178                   autoconf 2.13 helped in those cases.
180                 * Precompiled GLIB 2.0 and pkg-config packages (and
181                   their dependencies) by the <a href="http://www.gimp.org/~tml/gimp/win32//index.html">GIMP for Windows</a> project from
182                   <a href="http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip">http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip</a><br>
183                   <a href="http://www.go-mono.com/archive/glib-2.0.4-20020703.zip">http://www.go-mono.com/archive/glib-2.0.4-20020703.zip</a> <br>
184                   <a href="http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip">http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip</a> <br>
185                   <a href="http://www.go-mono.com/archive/libiconv-1.7.zip">http://www.go-mono.com/archive/libiconv-1.7.zip</a> <br>
186                   <a href="http://www.go-mono.com/archive/libiconv-dev-1.7.zip">http://www.go-mono.com/archive/libiconv-dev-1.7-20020101.zip</a> <br>
187                   <a href="http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip">http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip</a><br>
190                 * Download the Mono source code from the
191                   <a href="download.html">packaged versions</a> or
192                   the <a href="http://www.go-mono.com/snapshots">
193                   nightly snapshots</a> or the <a href="anoncvs.html">
194                   Anonymous CVS</a>.  The nightly snapshots are done every 
195                   night at 10pm EST (Boston Time). The nightly snapshots are 
196                   not guaranteed to build, but most of the time they should.
197         </ul>
200 *** Notes on compiling GLIB 2.0 and pkg-config from source:
203         <ul>
205                 * Some people observed problems with autoconf 2.52. Installing 
206                   autoconf 2.13 helped in those cases (don't forget to do a
207                   `make maintainer-clean' after the update).
209                 * Download, compile and install <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a> from source.
210               (I had to change line 674 of
211               <nobr><tt>pkg-config-0.8.0/glib-1.2.8/gstrfuncs.c</tt></nobr> from 
212                   <nobr><tt>extern char *strsignal (int sig);</tt></nobr> to
213                   <nobr><tt>extern const char *strsignal (int sig);</tt></nobr>.
215 <pre class="shell">
216 tar xzvf pkg-config-0.8.0.tar.gz
217 cd pkg-config-0.8.0
218 ./configure --prefix=/usr
219 make
220 make install
221 </pre>
223                 * Download, compile and install <a href="ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.7.tar.gz">libiconv</a> from source.<br>
224                   If you dont have MS Visual C/C++ 4.0 or 5.0 or 6.0 you can also try
225                   the binary package available at <a
226                   href="http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.bin.woe32.zip">
227                   http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.bin.woe32.zip</a>
230                 * Download, compile and install the 
231                   <a href="ftp://ftp.gtk.org/pub/gtk/v2.0/glib-2.0.6.tar.gz">
232                   glib 2.0</a> from source.
234         </ul>