Next: , Previous: Optimization options, Up: Invocation


9.13 Target code compilation options

If you are using Mmake, you need to pass these options to the target code compiler (e.g. ‘mgnuc’) rather than to ‘mmc’.

     
     
--target-debug
Enable debugging of the generated target code. If the target language is C, this has the same effect as ‘--c-debug’ (see below). If the target language is IL or C#, this causes the compiler to pass ‘/debug’ to the IL assembler or C# compiler.
     
     

--cc compiler-name
Specify which C compiler to use.
     
     

--c-include-directory dir
--c-include-dir dir
Append dir to the list of directories to be searched for C header files. Note that if you want to override this list, rather than append to it, then you can set the ‘MERCURY_MC_ALL_C_INCL_DIRS’ environment variable to a sequence of ‘--c-include-directory’ options.
     
     

--c-debug
Pass the ‘-g’ flag to the C compiler, to enable debugging of the generated C code, and also disable stripping of C debugging information from the executable. Since the generated C code is very low-level, this option is not likely to be useful to anyone except the Mercury implementors, except perhaps for debugging code that uses Mercury's C interface extensively.
     
     

--no-c-optimize
Don't enable the C compiler's optimizations.
     
     

--no-ansi-c
Don't specify to the C compiler that the ANSI dialect of C should be used. Use the full contents of system headers, rather than the ANSI subset.
     
     

--inline-alloc
Inline calls to ‘GC_malloc()’. This can improve performance a fair bit, but may significantly increase code size. This option has no effect if ‘--gc boehm’ is not set or if the C compiler is not GNU C.
     
     

--cflags options
--cflag option
Specify options to be passed to the C compiler. ‘--cflag’ should be used for single words which need to be quoted when passed to the shell.
     
     

--javac compiler-name
--java-compiler compiler-name
Specify which Java compiler to use. The default is ‘javac’.
     
     

--java-interpreter interpreter-name
Specify which Java interpreter to use. The default is ‘java’.
     
     

--java-flags options
--java-flag option
Specify options to be passed to the Java compiler. ‘--java-flag’ should be used for single words which need to be quoted when passed to the shell.
     
     

--java-classpath dir
Set the classpath for the Java compiler.
     
     

--java-object-file-extension extension
Specify an extension for Java object (bytecode) files. By default this is ‘.class’.
     
     

--csharp-compiler compiler-name
Specify which C# compiler to use. The default is ‘csc’.
     
     

--csharp-flags options
--csharp-flag option
Specify options to be passed to the C# compiler. ‘--csharp-flag’ should be used for single words which need to be quoted when passed to the shell.
     
     

--cil-interpreter interpreter-name
Specify the program that implements the Common Language Infrastructure (CLI) execution environment, e.g. ‘mono’.
     
     

--erlang-compiler compiler-name
Specify which Erlang compiler to use. The default is ‘erlc’.
     
     

--erlang-interpreter interpreter-name
Specify which Erlang interpreter to use. The default is ‘erl’.
     
     

--erlang-flags options
--erlang-flag option
Specify options to be passed to the Erlang compiler. ‘--erlang-flag’ should be used for single words which need to be quoted when passed to the shell.
     
     

--erlang-include-directory dir
--erlang-include-dir dir
Append dir to the list of directories to be searched for Erlang header files (.hrl).
     
     

--erlang-native-code
Add ‘+native’ to the start of flags passed to the Erlang compiler. Cancelled out by ‘--no-erlang-native-code’ so it's useful when you wish to enable native code generation for all modules except for a select few.
     
     

--no-erlang-inhibit-trivial-warnings
Do not add ‘+nowarn_unused_vars +nowarn_unused_function’ to the list of flags passed to the Erlang compiler.