[m-rev.] for review: installing extra C headers with Mercury libraries
Julien Fischer
juliensf at csse.unimelb.edu.au
Tue Sep 2 00:51:18 AEST 2008
On Mon, 1 Sep 2008, Julien Fischer wrote:
>
> For review by anyone.
>
> Estimated hours taken: 1
> Branches: main
>
> Add a mechanism that allows extra C header files to be installed as part
> of a Mercury library, in the same location as the header files generated
> by the Mercury compiler. This is useful when writing Mercury bindings
> to C++ libraries since these often require an interface from C++ to C to
> be written (at least where one does not already exist) and this usually
> involves one or more header files that are then referenced from foreign_decl
> pragmas on the Mercury side of things.
>
> compiler/options.m:
> Add a new option, --install-extra-header, that specifies extra
> header files to install.
>
> compiler/make.program_target.m:
> When installing a library installing any extra header files.
>
> doc/user_guide.texi:
> Document the new option.
I've changed the name of the new option to --extra-library-header.
The rest of the diff is unchanged. Relative diff below.
Julien.
diff -u compiler/make.program_target.m compiler/make.program_target.m
--- compiler/make.program_target.m 1 Sep 2008 13:50:49 -0000
+++ compiler/make.program_target.m 1 Sep 2008 14:40:55 -0000
@@ -1200,7 +1200,7 @@
:- pred install_extra_headers(bool::out, io::di, io::uo) is det.
install_extra_headers(ExtraHdrsSucceeded, !IO) :-
- globals.io_lookup_accumulating_option(install_extra_header, ExtraHdrs,
+ globals.io_lookup_accumulating_option(extra_library_header, ExtraHdrs,
!IO),
globals.io_lookup_string_option(install_prefix, Prefix, !IO),
IncDir = Prefix / "lib" / "mercury" / "inc",
diff -u compiler/options.m compiler/options.m
--- compiler/options.m 1 Sep 2008 13:50:50 -0000
+++ compiler/options.m 1 Sep 2008 14:40:56 -0000
@@ -876,7 +876,7 @@
; use_search_directories_for_intermod
; libgrade_install_check
; show_make_times
- ; install_extra_header
+ ; extra_library_header
% Miscellaneous Options
; filenames_from_stdin
@@ -1706,7 +1706,7 @@
use_search_directories_for_intermod - bool(yes),
libgrade_install_check - bool(yes),
show_make_times - bool(no),
- install_extra_header - accumulating([])
+ extra_library_header - accumulating([])
]).
option_defaults_2(miscellaneous_option, [
% Miscellaneous Options
@@ -2581,7 +2581,8 @@
use_search_directories_for_intermod).
long_option("libgrade-install-check", libgrade_install_check).
long_option("show-make-times", show_make_times).
-long_option("install-extra-header", install_extra_header).
+long_option("extra-lib-header", extra_library_header).
+long_option("extra-library-header", extra_library_header).
% misc options
long_option("typecheck-ambiguity-warn-limit",
@@ -5256,8 +5257,9 @@
"\t`mmc --make'.)",
"--show-make-times",
"\tReport run times for commands executed by `mmc --make'.",
- "--install-extra-header <file>",
- "\tInstall the specified C header file with a Mercury library.",
+ "--extra-library-header <file>, --extra-lib-header <file>",
+ "\tInstall the specified C header file with along with",
+ "\ta Mercury library.",
"\t(This option is only supported by `mmc --make'.)"
]).
diff -u doc/user_guide.texi doc/user_guide.texi
--- doc/user_guide.texi 1 Sep 2008 13:50:51 -0000
+++ doc/user_guide.texi 1 Sep 2008 14:40:57 -0000
@@ -8967,9 +8967,11 @@
Report run times for commands executed by @samp{mmc --make}.
@sp 1
- at item --install-extra-header @var{file}
- at findex --install-extra-header
-Install the specified C header file with a Mercury library.
+ at item --extra-library-header @var{file}
+ at item --extra-lib-header @var{file}
+ at findex --extra-library-header
+ at findex --extra-lib-header
+Install the specified C header file along with a Mercury library.
(This option is only supported by @samp{mmc --make})
@end table
--------------------------------------------------------------------------
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