compiling 7.8 KB

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