[m-rev.] diff: add --java-archive-command
Peter Wang
novalazy at gmail.com
Tue Jul 7 11:11:57 AEST 2009
Branches: main
compiler/options.m:
doc/user_guide.texi:
compiler/compile_target_code.m:
Add --java-archive-command option to specify the tool to
use to produce Java archive files (JARs).
diff --git a/compiler/compile_target_code.m b/compiler/compile_target_code.m
index 07e3cab..f65e0ae 100644
--- a/compiler/compile_target_code.m
+++ b/compiler/compile_target_code.m
@@ -2330,8 +2330,7 @@ create_archive(ErrorStream, LibFileName, Quote,
ObjectList, Succeeded, !IO) :-
list(file_name)::in, bool::out, io::di, io::uo) is det.
create_java_archive(ErrorStream, JarFileName, ObjectList, Succeeded, !IO) :-
- % XXX Maybe these should be set up as options:
- Jar = "jar",
+ globals.io_lookup_string_option(java_archive_command, Jar, !IO),
list_class_files_for_jar(ObjectList, ClassSubDir, ListClassFiles, !IO),
(
diff --git a/compiler/options.m b/compiler/options.m
index 14b538c..1ad77d5 100644
--- a/compiler/options.m
+++ b/compiler/options.m
@@ -880,6 +880,7 @@
; shlib_linker_use_install_name
; shlib_linker_install_name_flag
; shlib_linker_install_name_path
+ ; java_archive_command
% Build system options
; make
@@ -1718,7 +1719,8 @@ option_defaults_2(link_option, [
linker_error_undefined_flag - string("-Wl,-no-undefined"),
shlib_linker_use_install_name - bool(no),
shlib_linker_install_name_flag - string("-install_name "),
- shlib_linker_install_name_path - string("")
+ shlib_linker_install_name_path - string(""),
+ java_archive_command - string("jar")
]).
option_defaults_2(build_system_option, [
% Build System Options
@@ -2607,6 +2609,7 @@ long_option("linker-error-undefined-flag",
linker_error_undefined_flag).
long_option("shlib-linker-use-install-name", shlib_linker_use_install_name).
long_option("shlib-linker-install-name-flag", shlib_linker_install_name_flag).
long_option("shlib-linker-install-name-path", shlib_linker_install_name_path).
+long_option("java-archive-command", java_archive_command).
% build system options
long_option("make", make).
@@ -5255,7 +5258,10 @@ options_help_link -->
"\tan executable.",
"--link-shared-lib-command <command>",
"\tSpecify the command used to invoke the linker when linking",
- "\ta shared library."
+ "\ta shared library.",
+
+ "--java-archive-command <command>",
+ "\tSpecify the command used to produce Java archive (JAR) files."
% The --shared-library-extension,
% --library-extension, --executable-file-extension
diff --git a/doc/user_guide.texi b/doc/user_guide.texi
index ae0fc76..26dcdd0 100644
--- a/doc/user_guide.texi
+++ b/doc/user_guide.texi
@@ -9467,6 +9467,11 @@ Specify the command used to invoke the linker
when linking an executable.
@findex --link-shared-lib-command
Specify the command used to invoke the linker when linking a shared library.
+ at sp 1
+ at item --java-archive-command @var{command}
+ at findex --java-archive-command
+Specify the command used to produce Java archive (JAR) files.
+
@end table
@c ----------------------------------------------------------------------------
--------------------------------------------------------------------------
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