mkbundle.1 4.9 KB

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