mkbundle: Added --nomain option.
[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 \- 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 For example, to create a bundle for hello world, use the following
25 command:
26 .nf
27         $ mkbundle -o hello hello.exe
28 .fi
29 .PP
30 The above will pull hello.exe into a native program called "hello".  Notice
31 that the produced image still contains the CIL image and no
32 precompilation is done.
33 .PP
34 In addition, it is possible to control whether mkbundle should compile
35 the resulting executable or not with the -c option.  This is useful if
36 you want to link additional libraries or control the generated output
37 in more detail. For example, this could be used to link some libraries
38 statically:
39 .nf
40         $ mkbundle -c -o host.c -oo bundles.o --deps hello.exe
41
42         $ cc host.c bundles.o /usr/lib/libmono.a -lc -lrt
43 .fi
44 .PP
45 You may also use mkbundle to generate a bundle you can use when
46 embedding the Mono runtime in a native application.  In that case, use
47 both the -c and --nomain options.  The resulting host.c file will
48 not have a main() function.  Call mono_mkbundle_init() before
49 initializing the JIT in your code so that the bundled assemblies
50 are available to the embedded runtime.
51 .SH OPTIONS
52 .TP
53 .I "-c"
54 Produce the stub file, do not compile the resulting stub.
55 .TP
56 .I "-o filename"
57 Places the output on `out'.  If the flag -c is specified, this is the
58 C host program.  If not, this contains the resulting executable.
59 .TP
60 .I "-oo filename"
61 Specifies the name to be used for the helper object file that contains
62 the bundle.
63 .TP
64 .I "-L path"
65 Adds the `path' do the search list for assemblies.  The rules are the
66 same as for the compiler -lib: or -L flags.
67 .TP "--config FILE"
68 Specifies that a machine.config file must be bundled as well.
69 Typically this is $prefix/etc/mono/1.0/machine.config or
70 $prefix/etc/mono/2.0/machine.config depending on the profile that you
71 are using (1.0 or 2.0)
72 .TP
73 .I  "--nodeps"
74 This is the default: mkbundle will only include the assemblies that
75 were specified on the command line to reduce the size of the resulting
76 image created.
77 .TP
78 .I "--deps"
79 This option will bundle all of the referenced assemblies for the
80 assemblies listed on the command line option.  This is useful to
81 distribute a self-contained image.
82 .TP
83 .I "--keeptemp"
84 By default mkbundle will delete the temporary files that it uses to
85 produce the bundle.  This option keeps the file around.
86 .TP
87 .I "--static"
88 By default mkbundle dynamically links to mono and glib.  This option
89 causes it to statically link instead.
90 .TP
91 .I "--nomain"
92 With the -c option, generate the host stub without a main() function.
93 .TP
94 .I "--config-dir DIR"
95 When passed, DIR will be set for the MONO_CFG_DIR environment variable
96 .TP
97 .I "-z"
98 Compresses the assemblies before embedding. This results in smaller
99 executable files, but increases startup time and requires zlib to be
100 installed on the target system.
101 .SH WINDOWS
102 On Windows systems, it it necessary to have  Unix-like toolchain to be
103 installed for mkbundle to work.  You can use cygwin's and install gcc,
104 gcc-mingw and as packages. 
105 .SH ENVIRONMENT VARIABLES
106 .TP
107 .I "AS"
108 Assembler command. The default is "as".
109 .TP
110 .I "CC"
111 C compiler command. The default is "cc" under Linux and "gcc -mno-cygwin"
112 under Windows.
113 .SH FILES
114 This program will load referenced assemblies from the Mono assembly
115 cache. 
116 .SH BUGS
117 The option "--static" is not supported under Windows.
118 Moreover, a full cygwin environment containing at least "gcc" and "as"
119 is required for the build process. The generated executable does not
120 depend on cygwin.
121 .SH MAILING LISTS
122 Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
123 .SH WEB SITE
124 Visit: http://www.mono-project.com for details
125 .SH SEE ALSO
126 .BR mcs(1), mono(1), mono-config(5).
127
128