[m-rev.] for review: add --output-cflags option
Julien Fischer
juliensf at csse.unimelb.edu.au
Tue Jan 29 12:04:19 AEDT 2008
On Fri, 25 Jan 2008, Julien Fischer wrote:
> Estimated hours taken: 1.5
> Branches: main
>
> Add a new option, `--output-cflags', that causes the compiler to print
> out the flags it will pass to the C compiler. This addition is intended
> to simplify the use of stand-alone interfaces and remove their current
> dependence on the mgnuc script.
>
> The idea is that users who have C files that make calls to exported
> Mercury code should be able to add something like the following to
> their Makefiles,
>
> CC := $(shell mmc --output-cc)
> CFLAGS := $(shell mmc --output-cflags)
>
> CFLAGS will then contain the appropriate -I and -D options to process the
> code in any Mercury headers #included in the C file.
>
> XXX we also need something similar for linking. The documentation and
> samples for stand-alone interfaces also need to be updated. I will do
> both of those things as separate changes.
>
> compiler/options.m:
> Add the --output-cflags option.
>
> compiler/mercury_compile.m:
> Implement the option.
>
> compiler/compile_target_code.m:
> Factor out the code that determines what flags are passed to the
> C compiler, based on grade settings and alike, into a separate
> predicate, gather_c_compiler_flags/4.
>
> Export a new predicate, output_c_compiler_flags/3, that is
> called when --output-cflags is given. This predicate just
> prints out the result of gather_c_compiler_flags/4 to the
> specified output stream.
>
> doc/user_guide.texi:
> Document the new option.
I've committed this, as I need it to be installed in order to continue
work on some G12 stuff. I'll deal with any review comments separately.
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list