C2INIT(1)
π« C2INIT(1) β Create Mercury initialization file π«
okay so this is C2INIT(1) from the General Commands Manual, and we're about to make Mercury init files make sense, bestie. Buckle up, it's giving βcompiler internals but make it cuteβ π
πΈ NAME πΈ
c2init β Create Mercury initialization file.
β¨ SYNOPSIS β¨
c2init [options] *.c *.init ...
π NOTES π
c2init is one of the development tools that are part of the Mercury distribution.
This manual page is limited to a brief summary. For further information see the Mercury User's Guide.
π OPTIONS π
-h,--helpβ Print this help message.
π©Ί DIAGNOSTICS OPTIONS π©Ί
-v,--verboseβ Print each command before executing it.--no-demangleβ Don't pipe the output of the linker through the Mercury demangler.--allow-undef,--allow-undefinedβ Don't report an error if there are unresolved symbols. This option is only used if you are building a shared library (with--make-shared-lib); when building executables, unresolved symbols are always errors. This option is useful when building shared libraries that are not intended to be self-contained.--print-gradeβ Compute the grade of the Mercury libraries to link with based on the command line options, print it to the standard output, and then exit (don't actually link anything).--print-gc-gradeβ Compute the base name of the garbage collection library to link with based on the command line options, print it to the standard output, and then exit (don't actually link anything).--print-link-commandβ Print the command used to link executables.--print-shared-lib-link-commandβ Print the command used to link shared libraries.--print-mapβ Print a link map, viald --print-map.
π¦ DYNAMIC/STATIC LINKING OPTIONS π¦
--mercury-libs {shared, static, none}β Specify which version of the standard Mercury libraries to link with.sharedlinks with the shared libraries (*.so) if possible, otherwise with the static ones.staticlinks with the static libraries (*.a).nonedisables linking with the Mercury standard libraries.-shared,--sharedβ Similar to--mercury-libs shared, but applies to all libraries, not just the standard Mercury libraries.-static,--staticβ Similar to--mercury-libs static, but applies to all libraries, not just the standard Mercury libraries.--make-shared-libβ Produce a shared library, rather than an executable.
π DIRECTORY OPTIONS π
--mercury-standard-library-directory <directory>,--mercury-stdlib-dir <directory>β The directory in which to find the Mercury standard library.--no-mercury-standard-library-directory,--no-mercury-stdlib-dirβ Same as--mercury-libs none.--mercury-config-directory <directory>,--mercury-config-dir <directory>β The location of an alternative configuration (created withmercury_config) to use.-L <directory>,--lib-dir <directory>β Include<directory>in the list of directories that the linker will use to search for libraries.-R <directory>,--shared-lib-dir <directory>β Include<directory>in the list of directories that the dynamic linker will use to search for shared libraries.--leave-shared-lib-dirs-relativeβ Don't convert relative shared library directory names into absolute paths.--no-leave-shared-lib-dirs-relativeβ Convert relative shared library directory names into absolute paths. This is the default.
π§ DEBUGGING OPTIONS π§
-t,--traceβ Link in the Mercury debugging libraries. This option is needed if any of the modules being linked were compiled with tracing enabled. However,--debugimplies--trace, so if you're using--debug, then you don't need to explicitly specify--trace. Note that--traceis incompatible with--staticon some platforms (e.g.sparc-sun-solaris2.6). Implies--include-initialization-code.-r-,--no-readlineβ Don't link in the GPL'd GNU Readline Library.-g,--c-debug,--no-stripβ Do not strip C debugging information.
π«Ά INITIALIZATION OPTIONS π«Ά
--no-main,--libraryβ Don't generate amain()function. Instead, generate a functionmercury_main(int argc, char **argv);(declared in"mercury_init.h") that can be called from C code. (A more fine-grained interface is also available; see"mercury_init.h"for details.)-I <directory>,--init-file-directory <directory>β Include<directory>in the list of directories searched to locate.initfiles.-w <label>,--entry-point <label>β Set entry point to<label>. (Default value corresponds tomain/2.)--runtime-flags <flags>β Add<flags>to the list of flags to pass to the Mercury runtime. Flags can also be passed at runtime in theMERCURY_OPTIONSenvironment variable. For the list of available flags, see the documentation forMERCURY_OPTIONSin the"Environment"chapter of the Mercury User's Guide.--experimental-complexity <filename>β Set up for the experimental determination of the complexity of the procedures listed in the given file.--init-c-file <filename>β Output the generated C initialization program to the specified file, rather than sending it to the standard output.-A <funcname>β Always execute the named void function (which must take no arguments) when the Mercury runtime is initialized.-x,--extra-initsβ Search.cfiles for extra initialization functions. (This may be necessary if the C files contain hand-coded C code withINITcomments, rather than containing only C code that was automatically generated by the Mercury compiler.)
π THREADS OPTIONS π
--use-thread-libsβ Link with the POSIX thread libraries. This option is useful if a C library being linked with uses threads, but the Mercury code being linked doesn't.
π GRADE OPTIONS π
The original page lists these under GRADE OPTIONS with one big pointer to the docs, so here's the exact roster, bestie:
-s <grade>,--grade <grade>--target {c, csharp, java}--asm-labels--gcc-non-local-gotos--gcc-global-registers-H,--high-level-code--parallel--gc {boehm, boehm_debug, hgc, accurate, none}-p,--profiling--profile-calls--profile-time--profile-memory--profile-deep--record-term-sizes-as-words--record-term-sizes-as-cells--use-trail--use-trail-segments--reserve-tag--use-minimal-model-stack-copy--use-minimal-model-own-stacks--minimal-model-debug--single-prec-float--pic-reg--no-stack-trace--debug--decl-debug--ss-debug--low-level-debug--extend-stacks-when-needed--stack-segments--use-regions
See the documentation in the "Invocation" section of the Mercury User's Guide.
π ENVIRONMENT VARIABLES π
These are the exact env vars named by the page:
MERCURY_DEFAULT_GRADEMERCURY_C_COMPILERMERCURY_NONSHARED_LIB_DIRMERCURY_MKINIT
π AUTHORS π
The Mercury team.
π COPYRIGHT π
This program and its documentation are copyright by the University of Melbourne and the Mercury team. They may be copied only under the terms of the GNU General Public License - see the file COPYING in the Mercury distribution.
β SEE ALSO β
The Mercury User's Guide.
<http://www.mercurylang.org/information/documentation.html>
Cute sign-off time: this was the C2INIT(1) page from the Mercury Programmer's Manual, dated 2026-04-24. Bye bestie, go slay those init files π
β¨
π¦ where this page comes from
- alpine 3.24: mercury-doc 22.01.8-r1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms