]> Savannah Git Hosting - gnulib.git/commit
javacomp-script, javacomp: Add support for javac versions > 11.
authorBruno Haible <bruno@clisp.org>
Sun, 11 Jun 2023 01:13:29 +0000 (03:13 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Jun 2023 01:14:42 +0000 (03:14 +0200)
commit66f9edfa59dc1ae55a189fb9b647b7319b2a1b02
treea467a0eea81e8f3000dd39cd71f5068059b0909d
parent16047d4c26c75adcf9c77696cdac38915658deb0
javacomp-script, javacomp: Add support for javac versions > 11.

Reported by Adrian Bunk <bunk-gnu@fs.tum.de> in
<https://savannah.gnu.org/bugs/?63385>.

* m4/javacomp.m4 (gt_JAVACOMP): When the java version is > 11, use that
version as target_version, not 11. When the java version is > 17, don't
warn. Remove goodcode, failcode variables. Don't bail out if the
source-version argument or the target-version argument is in the range
12..99. Use a heuristic that works with javac versions 11..20 at least.
Update comments.
* lib/javacomp.h (compile_java_class): State that source-version and
target-version may be larger than 11.
* lib/javacomp.c (default_target_version): Accommodate versions up to
99.
(SOURCE_VERSION_BOUND): Increase to 94.
(source_version_index): Accept versions up to 99.
(get_goodcode_snippet, get_failcode_snippet): Remove functions.
(TARGET_VERSION_BOUND): Increase to 94.
(target_version_index): Accept versions up to 99.
(corresponding_classfile_version): Remove function.
(execute_and_read_line): New function, based on lib/javaversion.c.
(get_compiler_version): New function.
(is_envjavac_usable): Add parameters source_option_out,
target_option_out. Use a heuristic that works with javac versions 11..20
at least. Call cleanup_temp_dir.
(is_javac_usable): Likewise.
(compile_java_class): Update.
ChangeLog
lib/javacomp.c
lib/javacomp.h
m4/javacomp.m4