Copied remotely
[mono.git] / man / mono-config.5
1 .\" 
2 .\" mono-config configuration page.
3 .\" (C) Ximian, Inc. 
4 .\" Author:
5 .\"   Miguel de Icaza (miguel@gnu.org)
6 .\"   Paolo Molaro (lupus@ximian.com)
7 .\"
8 .TH Mono "Mono 1.0"
9 .SH NAME
10 mono-config \- Mono runtime file format configuration
11 .SH DESCRIPTION
12 The Mono runtime will load configuration data from the
13 installation prefix /etc/mono/config file, the ~/.mono/config or from
14 the file pointed by the MONO_CONFIG environment variable.
15 .PP
16 For each assembly loaded a config file with the name:
17 /path/to/the/assembly.exe.config is loaded, too.
18 .PP
19 This file controls the behavior of the runtime.
20 .PP
21 The file contains an XML-like file with various sections, all of them
22 contained inside a 
23 .B<configuration> 
24 section (It actually uses GMarkup
25 to parse the file).
26 .SH <dllmap> directive
27 You use the dllmap directive to map shared libraries referenced by
28 P/Invoke in your assemblies to a different shared library.
29 .PP
30 This is typically used to map Windows libraries to Unix library names.
31 The 
32 .B dllmap
33 element takes two attributes:
34 .TP
35 .I dll
36 This should be the same string used in the DllImport attribute
37 .TP
38 .I target
39 This should be the name of the library where the function can be found: 
40 this name should be suitable for use with the platform native shared library 
41 loading routines (dlopen etc.), so you may want to check the manpages for that, too.
42 .SH <dllentry> directive
43 This directive can be used to map a specific dll/function pair to a different
44 library and also a different function name. It should appear inside a
45 .B dllmap
46 element with only the dll attribute specified.
47 .PP
48 The
49 .B dllentry
50 element takes 3 attributes:
51 .TP
52 .I dll
53 This is the target library, where the function can be found.
54 .TP
55 .I name
56 This is the name of the fuction as it appears in the metadata: it is the name 
57 of the P/Invoke method.
58 .TP
59 .I target
60 This is the name of the function to lookup instead of the name specified in the 
61 P/Invoke method.
62 .SH EXAMPLES
63 The following example maps references to the `cygwin1.dll' shared
64 library to the `libc.so.6' file.  
65 .nf
66 <configuration>
67         <dllmap dll="cygwin1.dll" target="libc.so.6"/>
68 </configuration>
69 .fi
70 .PP
71 This one maps the following C# method:
72 .nf
73         [DllImport ("libc")]
74         static extern void somefunction ();
75 .fi
76 to
77 .B differentfunction
78 in
79 .B libdifferent.so.
80 .nf
81 <configuration>
82         <dllmap dll="libc">
83                 <dllentry dll="libdifferent.so" name="somefunction" target="differentfunction" />
84         </dllmap>
85 </configuration>
86 .fi
87
88 .SH SEE ALSO
89 .BR mono(1), monodis(1), mint(1)