Files
mercury/samples/c_interface
Julien Fischer 190b69d4f1 Add a new command line option that causes the compiler to print out the
set of flags that it passes to the linker in order to link against a
selected set of Mercury libraries (the standard libraries plus any others
specified via the --ml option) in the current grade.
This removes the need for using the ml script with standalone interfaces.
(Which is useful on those systems that don't have a proper shell and can't
use that script!)

compiler/compiler_target_code.m:
	Add a predicate that prints out the above information.

	Refactor code in order to to avoid duplication between the new
	functionality and the existing code for invoking the linker.

compiler/mercury_compile.m:
compiler/options.m:
	Add the new option.

doc/user_guide.texi:
	Add an entry for the new option.

samples/c_interface/standalone_c/Makefile:
	Query the compiler directly about what flags to pass to the linker
	rather than using the ml script.

	Query the compiler about what flags to pass to the C compiler as
	well.  (This was implemented a while ago, but this example was
	never updated.)

	Extend this example to optionally work with shared libraries.
2009-01-20 06:24:05 +00:00
..

This directory contains some examples of mixed Mercury/C programs using
the C interface.

short_example.m                 A short example of Mercury code calling C.

mercury_calls_c                 A detailed example of Mercury code
                                calling C code.

c_calls_mercury                 A detailed example of C code calling
                                Mercury code.

mercury_calls_cplusplus         A detailed example of Mercury code
                                calling C++ code.

cplusplus_calls_mercury         A detailed example of C++ code calling
                                Mercury code.

mercury_calls_fortran           This directory contains a detailed
                                example of Mercury code calling Fortran code.

simpler_c_calls_mercury         A simpler example of C code calling Mercury.

simpler_cplusplus_calls_mercury A simpler example of C++ code calling
                                Mercury.

standalone_c			Another example of C code calling Mercury
				code this time use the compiler's 
				`--generate-standalone-interface' option.