From: Bruno Haible Date: Sat, 24 Mar 2018 15:20:03 +0000 (+0100) Subject: Add support for recent Java versions. X-Git-Tag: v0.20~415 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=071d155f83e2c9c917db43f5452822a6dc30250a;p=thirdparty%2Fgettext.git Add support for recent Java versions. Reported by Emmanuel Bourg at via Santiago Vila. * gettext-runtime/configure.ac: Require a Java compiler that supports source-version 1.5 and target-version 1.6 (such as Java 6 or newer, or GCJ 4.3 or newer). * gettext-tools/src/write-java.c (msgdomain_write_java): Likewise * gettext-tools/examples/hello-java-qtjambi/configure.ac: Likewise. * gettext-tools/configure.ac: Require a Java compiler that supports source-version 1.5 (such as Java 5 or newer, or GCJ 4.3 or newer). * gettext-tools/examples/hello-java/configure.ac: Likewise. * gettext-tools/examples/hello-java-awt/configure.ac: Likewise. * gettext-tools/examples/hello-java-swing/configure.ac: Likewise. * NEWS: Mention the change. --- diff --git a/NEWS b/NEWS index bb6c85d42..7e59f2eaf 100644 --- a/NEWS +++ b/NEWS @@ -14,8 +14,11 @@ xgettext now supports single-quotes in number tokens, as specified in C++14. - Java: - xgettext now supports UTF-8 encoded .properties files (a new feature - of Java 9). + o xgettext now supports UTF-8 encoded .properties files (a new feature + of Java 9). + o The build system and tools now support Java 9 and 10. On the other + hand, support for old versions of Java (Java 5 and older, GCJ 4.2.x + and older) has been dropped. - Perl: o Native support for context functions (pgettext, dpgettext, dcpgettext, npgettext, dnpgettext, dcnpgettext). diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index 88d5c98f0..beed677ca 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -35,7 +35,7 @@ AC_PROG_YACC gt_JAVA_CHOICE -gt_JAVACOMP([1.3], [1.1]) +gt_JAVACOMP([1.5], [1.6]) AC_CHECK_PROG([JAR], [jar], [jar]) if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then BUILDJAVA=yes diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index ca6934c21..270e36d8f 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -36,7 +36,7 @@ AC_PROG_YACC gt_JAVA_CHOICE gt_JAVAEXEC -gt_JAVACOMP([1.3]) +gt_JAVACOMP([1.5]) AC_CHECK_PROG([JAR], [jar], [jar]) if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then BUILDJAVA=yes diff --git a/gettext-tools/examples/hello-java-awt/configure.ac b/gettext-tools/examples/hello-java-awt/configure.ac index dfb1a859a..9cbadfdd1 100644 --- a/gettext-tools/examples/hello-java-awt/configure.ac +++ b/gettext-tools/examples/hello-java-awt/configure.ac @@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE(hello-java-awt, 0) dnl Check whether we can execute Java programs. gt_JAVAEXEC([TestAWT], [$srcdir/m4]) dnl Check whether we can build Java programs. -gt_JAVACOMP([1.3]) +gt_JAVACOMP([1.5]) AC_CHECK_PROG(JAR, jar, jar) if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then BUILDJAVA=yes diff --git a/gettext-tools/examples/hello-java-qtjambi/configure.ac b/gettext-tools/examples/hello-java-qtjambi/configure.ac index ca4a5ce49..2a5c1f4f0 100644 --- a/gettext-tools/examples/hello-java-qtjambi/configure.ac +++ b/gettext-tools/examples/hello-java-qtjambi/configure.ac @@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE(hello-java-qtjambi, 0) dnl Check whether we can execute Java programs. gt_JAVAEXEC([Test15], [$srcdir/m4]) dnl Check whether we can build Java programs. -gt_JAVACOMP([1.5], [1.5]) +gt_JAVACOMP([1.5], [1.6]) AC_CHECK_PROG(JAR, jar, jar) if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then BUILDJAVA=yes diff --git a/gettext-tools/examples/hello-java-swing/configure.ac b/gettext-tools/examples/hello-java-swing/configure.ac index 4d3295d37..fa9dd5348 100644 --- a/gettext-tools/examples/hello-java-swing/configure.ac +++ b/gettext-tools/examples/hello-java-swing/configure.ac @@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE(hello-java-swing, 0) dnl Check whether we can execute Java programs. gt_JAVAEXEC([TestAWT], [$srcdir/m4]) dnl Check whether we can build Java programs. -gt_JAVACOMP([1.3]) +gt_JAVACOMP([1.5]) AC_CHECK_PROG(JAR, jar, jar) if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then BUILDJAVA=yes diff --git a/gettext-tools/examples/hello-java/configure.ac b/gettext-tools/examples/hello-java/configure.ac index 031c13099..29da82452 100644 --- a/gettext-tools/examples/hello-java/configure.ac +++ b/gettext-tools/examples/hello-java/configure.ac @@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE(hello-java, 0) dnl Check whether we can execute Java programs. gt_JAVAEXEC dnl Check whether we can build Java programs. -gt_JAVACOMP([1.3]) +gt_JAVACOMP([1.5]) AC_CHECK_PROG(JAR, jar, jar) if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then BUILDJAVA=yes diff --git a/gettext-tools/src/write-java.c b/gettext-tools/src/write-java.c index 9ddfac868..942141c3c 100644 --- a/gettext-tools/src/write-java.c +++ b/gettext-tools/src/write-java.c @@ -1,5 +1,5 @@ /* Writing Java ResourceBundles. - Copyright (C) 2001-2003, 2005-2010, 2015-2016 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2010, 2015-2016, 2018 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -1208,7 +1208,7 @@ msgdomain_write_java (message_list_ty *mlp, const char *canon_encoding, Java compilers create the class files in the source file's directory - which is in a temporary directory in our case. */ java_sources[0] = java_file_name; - if (compile_java_class (java_sources, 1, NULL, 0, "1.3", "1.1", directory, + if (compile_java_class (java_sources, 1, NULL, 0, "1.5", "1.6", directory, true, false, true, verbose > 0)) { if (!verbose)