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 There are two modes of operation, the default one uses the
25 C compiler to create a bundle and requires a complete C and Mono SDK
26 to produced executables. The simple mode (enabled when using the
27 "--simple") command line option does not require this, and also allows
28 for cross compilation.
30 For example, to create a bundle for hello world, use the following
33 $ mkbundle -o hello --simple hello.exe
36 The simple version allows for cross-compiling, this requires a Mono
37 runtime to be installed in the ~/.mono/targets/TARGET/mono to be
38 available. You can use the "--local-targets" to list all available
39 targets, and the "--cross" argument to specify the target, like this:
41 $ mkbundle --local-targets
43 default - Current System Mono
46 $ mkbundle --cross 4.4.0-debian-8-powerpc hello.exe -o hello-debian
49 The above will bundle your native library into hello-debian for
50 a Debian 8 system running on a PowerPC machine.
53 For example, to create a bundle for hello world, use the following
56 $ mkbundle -o hello hello.exe
59 The above will pull hello.exe into a native program called "hello". Notice
60 that the produced image still contains the CIL image and no
61 precompilation is done.
63 In addition, it is possible to control whether \fImkbundle\fP should compile
64 the resulting executable or not with the -c option. This is useful if
65 you want to link additional libraries or control the generated output
66 in more detail. For example, this could be used to link some libraries
69 $ mkbundle -c -o host.c -oo bundles.o --deps hello.exe
71 $ cc host.c bundles.o /usr/lib/libmono.a -lc -lrt
74 You may also use \fImkbundle\fP to generate a bundle you can use when
75 embedding the Mono runtime in a native application. In that case, use
76 both the -c and --nomain options. The resulting host.c file will
77 not have a main() function. Call mono_mkbundle_init() before
78 initializing the JIT in your code so that the bundled assemblies
79 are available to the embedded runtime.
83 Produce the stub file, do not compile the resulting stub.
86 Creates a bundle for the specified target platform. The target
87 must be a directory in ~/.mono/targets/ that contains a "mono"
88 binary. You can fetch various targets using the --fetch-target
92 Places the output on `out'. If the flag -c is specified, this is the
93 C host program. If not, this contains the resulting executable.
96 Specifies the name to be used for the helper object file that contains
100 Adds the `path' do the search list for assemblies. The rules are the
101 same as for the compiler -lib: or -L flags.
103 Specifies that a machine.config file must be bundled as well.
104 Typically this is $prefix/etc/mono/1.0/machine.config or
105 $prefix/etc/mono/2.0/machine.config depending on the profile that you
106 are using (1.0 or 2.0)
109 This option will bundle all of the referenced assemblies for the
110 assemblies listed on the command line option. This is useful to
111 distribute a self-contained image.
113 .I "--fetch-target target"
114 Downloads a precompiled runtime for the specified target from the Mono
118 This is the default: \fImkbundle\fP will only include the assemblies that
119 were specified on the command line to reduce the size of the resulting
123 By default \fImkbundle\fP will delete the temporary files that it uses to
124 produce the bundle. This option keeps the file around.
127 Lists all of the available local cross compilation targets available
128 as precompiled binaries on the Mono distribution server.
131 Lists all of the available local cross compilation targets.
133 .I "--machine-config FILE"
134 Uses the given FILE as the machine.config file for the generated
138 With the -c option, generate the host stub without a main() function.
140 .I "--config-dir DIR"
141 When passed, DIR will be set for the MONO_CFG_DIR environment variable
144 By default \fImkbundle\fP dynamically links to mono and glib. This option
145 causes it to statically link instead.
147 .I "--target-server SERVER"
148 By default the mkbundle tool will download from a Mono server the
149 target runtimes, you can specify a different server to provide
150 cross-compiled runtimes.
153 Compresses the assemblies before embedding. This results in smaller
154 executable files, but increases startup time and requires zlib to be
155 installed on the target system.
157 On Windows systems, it it necessary to have Unix-like toolchain to be
158 installed for \fImkbundle\fP to work. You can use cygwin's and install gcc,
159 gcc-mingw and as packages.
160 .SH ENVIRONMENT VARIABLES
163 Assembler command. The default is "as".
166 C compiler command. The default is "cc" under Linux and "gcc"
169 .I "MONO_BUNDLED_OPTIONS"
170 Options to be passed to the bundled
171 Mono runtime, separated by spaces. See the mono(1) manual page or run mono --help.
173 This program will load referenced assemblies from the Mono assembly
176 Targets are loaded from ~/.mono/targets/TARGETNAME/mono
178 The option "--static" is not supported under Windows.
179 Moreover, a full cygwin environment containing at least "gcc" and "as"
180 is required for the build process. The generated executable does not
183 Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
185 Visit: http://www.mono-project.com for details
187 .BR mcs(1), mono(1), mono-config(5).