New test.
[mono.git] / mcs / INSTALL.txt
1 Basic Installation
2 ==================
3
4 The Mono project has developed mono, a CLI runtime. The build process
5 of each of these depends on nothing more than a C compiler and glib2.
6
7 However, to provide a working runtime environment, these programs must
8 be supplemented by the class libraries, which are written in C#.  This
9 package contains the components written in C#: class libraries,
10 compilers and tools.
11
12 *********************************************************************
13 *                                                                   *
14 *                            NOTICE                                 *
15 *                                                                   *
16 *       Unless you are developing the class libraries, you should   *
17 *       not need to do any build steps in this directory.           *
18 *                                                                   *
19 *       Go to ../mono and read the README file to compile and       *
20 *       install.                                                    *
21 *                                                                   *
22 *       ../mono is where you have your `mono' source download       *
23 *                                                                   *
24 *********************************************************************
25
26 If you only want to build a snapshot or a fresh CVS checkout of the
27 sources, you should go into the `mono' sibling directory and issue the
28 make command, like this:
29
30           cd ../mono
31           ./autogen.sh --prefix=/usr/local
32           make
33           make install
34
35 The compilation is bundled with the build due to dependencies on the
36 class libraries on the runtime.
37
38 Build Features for Developers of Mono.
39 ======================================
40
41 These instructions apply to both Linux and Windows. To build this
42 package, you must already have a C# compiler installed.  This means
43 that to build on Linux, you need to get a distribution of the MCS
44 binaries; these are called monocharges. They can be found at
45 www.go-mono.com/daily. On Windows, you can just use the
46 Microsoft compiler. You also need GNU make to build the software (on
47 Windows, you will need for example the Cygwin environment setup).
48
49 You can customize your MCS configuration by using:
50
51     ./configure [--prefix=PREFIX] [--profile=PROFILE] 
52
53 If you do not run the above, the defaults are /usr/local for the
54 prefix, and `default' for the profile.
55
56 To build the compiler and class libraries, run:
57
58     make
59
60 The libraries will be placed in the directory class/lib/ and the mcs
61 compiler executable in mcs/.
62
63 To install them, run the following:
64
65     make install
66
67 If you get "corlib out of sync" errors, try
68
69     make PROFILE="atomic"
70
71 A better alternative would be to fire off a 'make' from a sibling or
72 parent 'mono/' tree.
73
74 Troubleshooting
75 ===============
76
77 We try to maintain the CVS tree such that it is bootstrapable from the
78 latest released version of mono and mcs.  Occasionally, something in the
79 compiler or runtime changes enough that an existing installation cannot
80 complete a bootstrap from cvs.  In this case, go to
81 http://go-mono.com/daily and download a monocharge or monolite tarball.
82 Unpack and copy the .dlls to $prefix/lib and .exes to $prefix/bin/.
83 Then you should be able to complete the build normally (i.e. using make
84 bootstrap).
85
86         wget http://go-mono.com/daily/monolite-20040505.tar.gz
87         tar -zxvf monolite-20040505.tar.gz
88         cd monolite-20040505
89         env prefix=/usr/local sh recharge.sh
90
91 Monocharges
92 ===========
93
94 If you are tracking Mono's development, you may sometimes need to share
95 the compiled libraries with others, you can do:
96
97     make monocharge
98
99 Or a light version, which contains only the essential libraries and
100 results in a much smaller file:
101
102     make monocharge-lite
103
104 Configuration
105 =============
106
107 If you want to change the configuration options for the build process,
108 place your configuration options in build/config.make
109
110 A list of variables that control the build are listed in the file
111 build/config-default.make.
112
113 Build profiles? What?
114 ======================
115
116 Don't worry about them too much. If you're wondering which to use:
117 use the default if you can (that's why it's the default!) and use
118 the atomic if you have to.
119
120 The default profile uses the C# compiler and class libaries as they
121 are built. This lets you build MCS without needing to have already 
122 installed it, but can fail if the libraries change significantly.
123 (This is the source of the dreaded "corlib out of sync" warning, most
124 of the time.)
125
126 The atomic profile tries to use the system compiler and preexisting
127 MCS libraries. New libaries are built against this constant reference 
128 point, so if a newly built library has a binary incompatibility, the
129 rest of your build can proceed.
130
131 If you want to always use the atomic profile, run this command:
132
133        ./configure --profile=atomic
134
135 More About the Build System
136 ===========================
137
138 More information is found in build/README.*. Here's a quick rundown
139 of the features:
140
141         * Unified build system for Windows and Linux. Windows is still
142           fairly untested, but "should work." Unfortunately I don't
143           have a Windows machine to test on, but Gonzalo can get
144           corlib to build I think and that's about as complicated as
145           it gets.
146
147         * Profile support. 'make PROFILE=profilename' or 'export
148           PROFILE=profilename ; make' will work. Profiles are defined
149           in build/profiles/profilename.make ; right now there isn't
150           too much going on. The 'bootstrap' profile will build the
151           way makefile.gnu did on Linux, by setting MONO_PATH and
152           using mcs/mcs.exe; the default profile will build against
153           the existing system libraries and compile with 'mcs', which
154           should reduce a lot of 'corlib out of sync' warnings.
155
156         * Important variables are shared among makefiles now; you can
157           edit build/config.make (see build/config-default.make for a
158           template) and give global settings, or just have a much
159           saner time of writing new makefiles.
160
161         * Response files, stamps, and other build trivia now all land
162           in build/deps/, making the library build directories
163           cleaner.
164
165         * Test libraries now live in class/Library/Library_test.dll,
166           not class/Library/Test. 'make test' will build the test DLL,
167           'make run-test' will actually run the nunit tests. Set the
168           variable TEST_HARNESS to run with a program other than
169           nunit-console (for example, nunit-gtk).
170
171         * Standardized recursive targets: all, clean, install, test,
172           run-test.  Read build/README.makefiles for definitions of
173           what they should do
174
175         * (Relatively) sane 'make dist' target; 'make distcheck'
176           support; cute 'make monocharge' and 'make monocharge-lite'
177           targets. They're made possible because 'make install' now
178           supports DESTDIR a la automake, which I'm sure someone cares
179           about.