svn commit: r1933796 - subversion/trunk/build/ac-macros

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <177786116072.2346569.4589967964192994893@svn03-he-fi>
Author: brane
Date: Mon May  4 02:19:20 2026
New Revision: 1933796

Log:
Silence JavaHL compiler warnings about missing bootstrap classpath.
Use the --release option instead of -source and -target if the Java
compiler supports it.

* build/ac-macros/java.m4
  (SVN_FIND_JDK): Check the javac version and adjust flags accordingly.
   If debugging is enabled, silence warnings about the target JVM version
   8 (1.8) being deprecated.

Modified:
   subversion/trunk/build/ac-macros/java.m4

Modified: subversion/trunk/build/ac-macros/java.m4
==============================================================================
--- subversion/trunk/build/ac-macros/java.m4	Mon May  4 00:35:48 2026	(r1933795)
+++ subversion/trunk/build/ac-macros/java.m4	Mon May  4 02:19:20 2026	(r1933796)
@@ -166,12 +166,27 @@ AC_DEFUN(SVN_FIND_JDK,
     # The release for "-source" could actually be greater than that
     # of "-target", if we want to cross-compile for lesser JVMs.
     if test -z "$JAVAC_FLAGS"; then
-      JAVAC_FLAGS="-target $JAVA_OLDEST_WORKING_VER -source 1.8"
+      java_version=[`"$JDK/bin/javac" -version 2>&1 | $SED -e 's/^[^0-9]*//' -e 's/\.[^.]*$//'`]
+      java_major=[`echo $java_version | $SED -e 's/\.[^.]*$//'`]
+      java_minor=[`echo $java_version | $SED -e 's/^[^.]*\.//'`]
+      if test "$java_major" -eq 1 && test "$java_minor" -lt 9; then
+        JAVAC_FLAGS="-target $JAVA_OLDEST_WORKING_VER -source 1.8"
+      else
+        java_release=[`echo $JAVA_OLDEST_WORKING_VER | $SED -e 's/^[^.]*\.//'`]
+        JAVAC_FLAGS="--release $java_release"
+      fi
+
       if test "$enable_debugging" = "yes"; then
         JAVAC_FLAGS="-g -Xlint -Xlint:unchecked -Xlint:serial -Xlint:path $JAVAC_FLAGS"
         if test -z "$JAVAC_COMPAT_FLAGS"; then
           JAVAC_COMPAT_FLAGS="$JAVAC_FLAGS -Xlint:-unchecked -Xlint:-deprecation -Xlint:-dep-ann -Xlint:-rawtypes"
         fi
+      else
+        dnl Ignore warnings about deprecated version 8 (from --release 8)
+        JAVAC_FLAGS="-Xlint:options"
+        if test -z "$JAVAC_COMPAT_FLAGS"; then
+          JAVAC_COMPAT_FLAGS="$JAVAC_FLAGS"
+        fi
       fi
     fi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.