2 .\" mkbundle manual page.
3 .\" (C) 2004 Ximian, Inc.
5 .\" Miguel de Icaza (miguel@gnu.org)
7 .de Sp \" Vertical space (when we can't use .PP)
11 .TH mkbundle "mkbundle 1.0"
13 mkbundle, mkbundle2 \- Creates a bundled executable.
16 .B mkbundle [options] assembly1 [assembly2 ...]
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.
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
28 For example, to create a bundle for hello world, use the following
31 $ mkbundle -o hello hello.exe
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.
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
44 $ mkbundle -c -o host.c -oo bundles.o --deps hello.exe
46 $ cc host.c bundles.o /usr/lib/libmono.a -lc -lrt
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.
58 Produce the stub file, do not compile the resulting stub.
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.
65 Specifies the name to be used for the helper object file that contains
69 Adds the `path' do the search list for assemblies. The rules are the
70 same as for the compiler -lib: or -L flags.
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)
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
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.
88 By default \fImkbundle\fP will delete the temporary files that it uses to
89 produce the bundle. This option keeps the file around.
91 .I "--machine-config FILE"
92 Uses the given FILE as the machine.config file for the generated
96 With the -c option, generate the host stub without a main() function.
99 When passed, DIR will be set for the MONO_CFG_DIR environment variable
102 By default \fImkbundle\fP dynamically links to mono and glib. This option
103 causes it to statically link instead.
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.
110 If you want to use this for commercial licenses, you must obtain a
111 proprietary license for Mono from mono@novell.com
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.
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
124 Assembler command. The default is "as".
127 C compiler command. The default is "cc" under Linux and "gcc -mno-cygwin"
130 This program will load referenced assemblies from the Mono assembly
133 The option "--static" is not supported under Windows.
134 Moreover, a full cygwin environment containing at least "gcc" and "as"
135 is required for the build process. The generated executable does not
138 Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
140 Visit: http://www.mono-project.com for details
142 .BR mcs(1), mono(1), mono-config(5).