[runtime] Document mkbundle AOT options in man pages
[mono.git] / man / mkbundle.1
index 160786d94f6a2643fba63837e3f12cdc5826658b..1d9870606bfc1d4018c38d9e6bf980d99b739323 100644 (file)
@@ -8,7 +8,7 @@
 .if t .sp .5v
 .if n .sp
 ..
-.TH mkbundle "mkbundle 1.0"
+.TH Mono "mkbundle"
 .SH NAME
 mkbundle, mkbundle2 \- Creates a bundled executable.
 .SH SYNOPSIS
@@ -24,7 +24,8 @@ dependencies referenced, use the "--deps" command line option.
 There are two modes of operation, one uses an existing Mono binary or
 a server-hosted list of binaries and is enabled when you use either
 the 
-.B --cross
+.B --cross,
+.B --sdk
 or the
 .B --runtime
 command line options.   
@@ -40,6 +41,16 @@ command:
        $ mkbundle -o hello --simple hello.exe
 
 .fi
+.PP
+You can configure options to be passed to the Mono runtime directly
+into your executable, for this, use the 
+.I --options
+flag.  For example, the following disables inlining, by passing the
+"-O=-inline" command line option to the embedded executable:
+.nf
+
+       $ mkbundle -o hello --options -O=-inline --simple hello.exe
+
 .PP
 The simple version allows for cross-compiling, this requires a Mono
 runtime to be installed in the ~/.mono/targets/TARGET/mono to be
@@ -109,16 +120,31 @@ are using (1.0 or 2.0)
 When passed, DIR will be set for the MONO_CFG_DIR environment variable
 .TP
 .I "--cross target"
-Creates a bundle for the specified target platform.   The target
-must be a directory in ~/.mono/targets/ that contains a "mono"
-binary.   You can fetch various targets using the --fetch-target
-command line option.
+Use this to request mkbundle generate a cross-compiled binary.  It
+Creates a bundle for the specified target platform.  The target must
+be a directory in ~/.mono/targets/ that contains an SDK installation
+as produced by the mono-package-runtime tool.  You can get a list of
+the precompiled versions of the runtime using --list-targets and you
+can fetch a specific target using the --fetch-target command line
+option.
+.Sp
+This flag is mutually exclusive with 
+.I --sdk
+which is used to specify an absolute path to resolve the Mono runtime
+from and the --runtime option which is used to manually construct the
+cross-platform package.
 .TP
 .I "--deps"
 This option will bundle all of the referenced assemblies for the
 assemblies listed on the command line option.  This is useful to
 distribute a self-contained image.
 .TP
+.I "--env KEY=VALUE"
+Use this to hardcode an environment variable at runtime for KEY to be
+mapped to VALUE.   This is useful in scenarios where you want to
+enable certain Mono runtime configuration options that are controlled
+by environment variables.
+.TP
 .I "--fetch-target target"
 Downloads a precompiled runtime for the specified target from the Mono
 distribution site.
@@ -143,10 +169,16 @@ flag to bundle all available encodings.
 Or you can use a comma delimited list of the workds CJK, MidWest,
 Other, Rare and West to specificy which encoding assemblies to distribute.
 .TP
-.TP
 .I "-L path"
 Adds the `path' do the search list for assemblies.  The rules are the
 same as for the compiler -lib: or -L flags.
+.TP
+.I "--library [LIB,]PATH"
+Embeds the dynamic library file pointed to by `PATH' and optionally
+give it the name `LIB' into the bundled executable.   This is used to
+ship native library dependencies that are unpacked at startup and
+loaded from the runtime.
+.TP
 .I "--lists-targets"
 Lists all of the available local cross compilation targets available
 as precompiled binaries on the Mono distribution server.
@@ -154,6 +186,18 @@ as precompiled binaries on the Mono distribution server.
 .I "--local-targets"
 Lists all of the available local cross compilation targets.
 .TP
+.I "--cil-strip PATH"
+Provides a CIL stripper that mkbundle will use if able to.
+The intended use is to help reduce file size on AOT.
+.TP
+.I "--in-tree path/to/mono/source/root"
+Provides mkbundle with a mono source repository from which to pull the necessary headers for compilation.
+This allows mkbundle to run out of the project's source tree, useful for working with multiple runtimes and for
+testing without installing.
+.TP
+.I "--managed-linker PATH"
+Provides mkbundle access to a managed linker to preprocess the assemblies.
+.TP
 .I "--machine-config FILE"
 Uses the given FILE as the machine.config file for the generated
 application.   
@@ -167,6 +211,41 @@ image created.
 Places the output on `out'.  If the flag -c is specified, this is the
 C host program.  If not, this contains the resulting executable.
 .TP
+.I "--options OPTS"
+Since the resulting executable will be treated as a standalone
+program, you can use this option to pass configuration options to the
+Mono runtime and bake those into the resulting executable.  These
+options are specified as 
+.I OPTS.
+.Sp
+You can use the above to configure options that you would typically
+pass on the command line to Mono, before the main program is
+executed.   
+.Sp
+Additionally, users of your binary can still configure their own
+options by setting the 
+.I MONO_ENV_OPTIONS
+environment variable.
+.TP
+.I "--sdk SDK_PATH"
+Use this flag to specify a path from which mkbundle will resolve the
+Mono SDK from.   The SDK path should be the prefix path that you used
+to configure a Mono installation.   And would typically contain files
+lik
+.I SDK_PATH/bin/mono
+,
+.I SDK_PATH/lib/mono/4.5
+and so on.
+.Sp
+When this flag is specified,
+.I mkbundle
+will resolve the runtime, the framework libraries, unmanaged resources
+and configuration files from the files located in this directory.
+.Sp
+This flag is mutually exlusive with 
+.I --cross
+.
+.TP
 .I "--target-server SERVER"
 By default the mkbundle tool will download from a Mono server the
 target runtimes, you can specify a different server to provide
@@ -239,6 +318,25 @@ causes it to statically link instead.
 Compresses the assemblies before embedding. This results in smaller
 executable files, but increases startup time and requires zlib to be
 installed on the target system.
+
+.SH AOT Options
+These options support an mkbundle using AOT compilation with static linking. A native compiler
+toolchain is required.
+.TP
+.I "--aot-runtime PATH"
+Provide the path to the mono runtime to use for AOTing assemblies.
+.TP
+.I "--aot-dedup"
+(Experimental) Deduplicate AOT'ed methods based on a unique mangling of method names.
+.TP
+.I "--aot-mode MODE"
+MODE can be either "full" or "llvmonly" at this time.
+Currently, mkbundle supports three AOT modes. The default mode (this option unset)
+will AOT methods but will fall back on runtime codegen where it is much faster or offers
+a more full compatibility profile. The "full" setting will generate the necessary stubs to
+not require runtime code generation. The "llvmonly" setting does the same, but forces all codegen
+to go through the llvm backend.
+
 .SH WINDOWS
 If you are using the old embedding on Windows systems, it it necessary
 to have Unix-like toolchain to be installed for \fImkbundle\fP to