1mkbundle(mkbundle 1.0)                                  mkbundle(mkbundle 1.0)
2
3
4

NAME

6       mkbundle, mkbundle2 - Creates a bundled executable.
7

SYNOPSIS

9       mkbundle [options] assembly1 [assembly2 ...]
10

DESCRIPTION

12       mkbundle  generates  an  executable  program  that  will contain static
13       copies of the assemblies listed on the command line.  By  default  only
14       the  assemblies  specified  in the command line will be included in the
15       bundle.  To automatically include all of the  dependencies  referenced,
16       use the "--deps" command line option.
17
18       Use mkbundle when you want the startup runtime to load the 1.0 profile,
19       and use mkbundle2 when you want the startup runtime  to  load  the  2.0
20       profile.
21
22       For example, to create a bundle for hello world, use the following com‐
23       mand:
24            $ mkbundle -o hello hello.exe
25
26       The above will pull hello.exe into a  native  program  called  "hello".
27       Notice that the produced image still contains the CIL image and no pre‐
28       compilation is done.
29
30       In addition, it is possible to control whether mkbundle should  compile
31       the  resulting executable or not with the -c option.  This is useful if
32       you want to link additional libraries or control the  generated  output
33       in  more detail. For example, this could be used to link some libraries
34       statically:
35            $ mkbundle -c -o host.c -oo bundles.o --deps hello.exe
36
37            $ cc host.c bundles.o /usr/lib/libmono.a -lc -lrt
38
39       You may also use mkbundle to generate a bundle you can use when  embed‐
40       ding  the Mono runtime in a native application.  In that case, use both
41       the -c and --nomain options.  The resulting host.c file will not have a
42       main() function.  Call mono_mkbundle_init() before initializing the JIT
43       in your code so that the bundled assemblies are available to the embed‐
44       ded runtime.
45

OPTIONS

47       -c     Produce the stub file, do not compile the resulting stub.
48
49       -o filename
50              Places  the  output on `out'.  If the flag -c is specified, this
51              is the C host program.  If not, this contains the resulting exe‐
52              cutable.
53
54       -oo filename
55              Specifies  the  name  to be used for the helper object file that
56              contains the bundle.
57
58       -L path
59              Adds the `path' do the search list for  assemblies.   The  rules
60              are the same as for the compiler -lib: or -L flags.
61
62       Specifies that a machine.config file must be bundled as well.
63              Typically  this  is $prefix/etc/mono/1.0/machine.config or $pre‐
64              fix/etc/mono/2.0/machine.config depending on  the  profile  that
65              you are using (1.0 or 2.0)
66
67       --nodeps
68              This  is  the default: mkbundle will only include the assemblies
69              that were specified on the command line to reduce  the  size  of
70              the resulting image created.
71
72       --deps This option will bundle all of the referenced assemblies for the
73              assemblies listed on the command line option.  This is useful to
74              distribute a self-contained image.
75
76       --keeptemp
77              By default mkbundle will delete the temporary files that it uses
78              to produce the bundle.  This option keeps the file around.
79
80       --machine-config FILE
81              Uses the given FILE as the machine.config file for the generated
82              application.
83
84       --nomain
85              With  the  -c  option,  generate  the host stub without a main()
86              function.
87
88       --config-dir DIR
89              When passed, DIR will be set for  the  MONO_CFG_DIR  environment
90              variable
91
92       --static
93              By  default  mkbundle  dynamically links to mono and glib.  This
94              option causes it to statically link instead.
95
96       Important:
97              Since the Mono runtime is licensed under the LGPL, even  if  you
98              use  static  you  should  transfer  the  component pieces of the
99              mkbundle to your users so they are able to upgrade the Mono run‐
100              time on their own.
101
102       If you want to use this for commercial licenses, you must obtain a
103              proprietary license for Mono from mono@novell.com
104
105       -z     Compresses  the  assemblies  before  embedding.  This results in
106              smaller  executable  files,  but  increases  startup  time   and
107              requires zlib to be installed on the target system.
108

WINDOWS

110       On  Windows systems, it it necessary to have  Unix-like toolchain to be
111       installed for mkbundle to work.  You can use cygwin's and install  gcc,
112       gcc-mingw and as packages.
113

ENVIRONMENT VARIABLES

115       AS     Assembler command. The default is "as".
116
117       CC     C  compiler  command.  The  default is "cc" under Linux and "gcc
118              -mno-cygwin" under Windows.
119
120       MONO_BUNDLED_OPTIONS
121              Options to be passed to the bundled Mono runtime,  separated  by
122              spaces. See the mono(1) manual page or run mono --help.
123

FILES

125       This  program  will  load  referenced assemblies from the Mono assembly
126       cache.
127

BUGS

129       The option "--static" is not supported under Windows.  Moreover, a full
130       cygwin  environment  containing at least "gcc" and "as" is required for
131       the build process. The generated executable does not depend on cygwin.
132

MAILING LISTS

134       Visit   http://lists.ximian.com/mailman/listinfo/mono-devel-list    for
135       details.
136

WEB SITE

138       Visit: http://www.mono-project.com for details
139

SEE ALSO

141       mcs(1),mono(1),mono-config(5).
142
143
144
145
146
147                                                        mkbundle(mkbundle 1.0)
Impressum