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