Merge pull request #717 from mono/client_websockets_impl
[mono.git] / man / mkbundle.1
1 .\" 
2 .\" mkbundle manual page.
3 .\" (C) 2004 Ximian, Inc. 
4 .\" Author:
5 .\"   Miguel de Icaza (miguel@gnu.org)
6 .\"
7 .de Sp \" Vertical space (when we can't use .PP)
8 .if t .sp .5v
9 .if n .sp
10 ..
11 .TH mkbundle "mkbundle 1.0"
12 .SH NAME
13 mkbundle, mkbundle2 \- Creates a bundled executable.
14 .SH SYNOPSIS
15 .PP
16 .B mkbundle [options] assembly1 [assembly2 ...]
17 .SH DESCRIPTION
18 \fImkbundle\fP generates an executable program that will contain
19 static copies of the assemblies listed on the command line.  By
20 default only the assemblies specified in the command line will be
21 included in the bundle.  To automatically include all of the
22 dependencies referenced, use the "--deps" command line option.
23 .PP
24 Use \fImkbundle\FP when you want the startup runtime to load the 1.0
25 profile, and use \fImkbundle2\fP when you want the startup runtime to load
26 the 2.0 profile.
27 .PP
28 For example, to create a bundle for hello world, use the following
29 command:
30 .nf
31         $ mkbundle -o hello hello.exe
32 .fi
33 .PP
34 The above will pull hello.exe into a native program called "hello".  Notice
35 that the produced image still contains the CIL image and no
36 precompilation is done.
37 .PP
38 In addition, it is possible to control whether \fImkbundle\fP should compile
39 the resulting executable or not with the -c option.  This is useful if
40 you want to link additional libraries or control the generated output
41 in more detail. For example, this could be used to link some libraries
42 statically:
43 .nf
44         $ mkbundle -c -o host.c -oo bundles.o --deps hello.exe
45
46         $ cc host.c bundles.o /usr/lib/libmono.a -lc -lrt
47 .fi
48 .PP
49 You may also use \fImkbundle\fP to generate a bundle you can use when
50 embedding the Mono runtime in a native application.  In that case, use
51 both the -c and --nomain options.  The resulting host.c file will
52 not have a main() function.  Call mono_mkbundle_init() before
53 initializing the JIT in your code so that the bundled assemblies
54 are available to the embedded runtime.
55 .SH OPTIONS
56 .TP
57 .I "-c"
58 Produce the stub file, do not compile the resulting stub.
59 .TP
60 .I "-o filename"
61 Places the output on `out'.  If the flag -c is specified, this is the
62 C host program.  If not, this contains the resulting executable.
63 .TP
64 .I "-oo filename"
65 Specifies the name to be used for the helper object file that contains
66 the bundle.
67 .TP
68 .I "-L path"
69 Adds the `path' do the search list for assemblies.  The rules are the
70 same as for the compiler -lib: or -L flags.
71 .TP "--config FILE"
72 Specifies that a machine.config file must be bundled as well.
73 Typically this is $prefix/etc/mono/1.0/machine.config or
74 $prefix/etc/mono/2.0/machine.config depending on the profile that you
75 are using (1.0 or 2.0)
76 .TP
77 .I  "--nodeps"
78 This is the default: \fImkbundle\fP will only include the assemblies that
79 were specified on the command line to reduce the size of the resulting
80 image created.
81 .TP
82 .I "--deps"
83 This option will bundle all of the referenced assemblies for the
84 assemblies listed on the command line option.  This is useful to
85 distribute a self-contained image.
86 .TP
87 .I "--keeptemp"
88 By default \fImkbundle\fP will delete the temporary files that it uses to
89 produce the bundle.  This option keeps the file around.
90 .TP
91 .I "--machine-config FILE"
92 Uses the given FILE as the machine.config file for the generated
93 application.   
94 .TP
95 .I "--nomain"
96 With the -c option, generate the host stub without a main() function.
97 .TP
98 .I "--config-dir DIR"
99 When passed, DIR will be set for the MONO_CFG_DIR environment variable
100 .TP
101 .I "--static"
102 By default \fImkbundle\fP dynamically links to mono and glib.  This option
103 causes it to statically link instead.
104 .TP
105 .B Important:
106 Since the Mono runtime is licensed under the LGPL, even if you use
107 static you should transfer the component pieces of the mkbundle to
108 your users so they are able to upgrade the Mono runtime on their own.
109 .TP
110 If you want to use this for commercial licenses, you must obtain a
111 proprietary license for Mono from mono@novell.com
112 .TP
113 .I "-z"
114 Compresses the assemblies before embedding. This results in smaller
115 executable files, but increases startup time and requires zlib to be
116 installed on the target system.
117 .SH WINDOWS
118 On Windows systems, it it necessary to have  Unix-like toolchain to be
119 installed for \fImkbundle\fP to work.  You can use cygwin's and install gcc,
120 gcc-mingw and as packages. 
121 .SH ENVIRONMENT VARIABLES
122 .TP
123 .I "AS"
124 Assembler command. The default is "as".
125 .TP
126 .I "CC"
127 C compiler command. The default is "cc" under Linux and "gcc"
128 under Windows.
129 .TP
130 .I "MONO_BUNDLED_OPTIONS"
131 Options to be passed to the bundled
132 Mono runtime, separated by spaces. See the mono(1) manual page or run mono --help.
133 .SH FILES
134 This program will load referenced assemblies from the Mono assembly
135 cache. 
136 .SH BUGS
137 The option "--static" is not supported under Windows.
138 Moreover, a full cygwin environment containing at least "gcc" and "as"
139 is required for the build process. The generated executable does not
140 depend on cygwin.
141 .SH MAILING LISTS
142 Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
143 .SH WEB SITE
144 Visit: http://www.mono-project.com for details
145 .SH SEE ALSO
146 .BR mcs(1), mono(1), mono-config(5).
147
148