java: Don't try to set -source 1.5 in options.

There was some code in configure.ac dating back to 2009
(commit b9014d6a0d) which attempted to
add the javac option `-source 1.5'.  I don't think this code ever
worked.

However, if -source 1.5 is added, then you get this warning:

warning: [options] bootstrap class path not set in conjunction with -source 1.5
warning: [options] source value 1.5 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

and that's very hard to reliably fix because you have to know somehow
a magic path.  For more details, see:

https://blogs.oracle.com/darcy/entry/bootclasspath_older_source
https://blogs.oracle.com/darcy/entry/how_to_cross_compile_for

Anyway, remove the voodoo from configure.ac.

As a side effect, this allows you to set the EXTRA_JAVAC_FLAGS
environment variable before ./configure with any extra javac flags
that you want.
This commit is contained in:
Richard W.M. Jones
2016-08-25 14:12:42 +01:00
parent 473a753382
commit c39d5e89c3

View File

@@ -123,16 +123,6 @@ if test "x$with_java" != "xno"; then
fi
AC_MSG_RESULT([$JNI_CFLAGS])
dnl Need extra version flag?
AC_MSG_CHECKING([extra javac flags])
EXTRA_JAVAC_FLAGS=
javac_version=`$JAVAC -version 2>&1`
case "$javac_version" in
*Eclipse*)
EXTRA_JAVAC_FLAGS="-source 1.5" ;;
esac
AC_MSG_RESULT([$EXTRA_JAVAC_FLAGS])
dnl Extra lint flags?
AC_MSG_CHECKING([extra javac lint flags])
if $JAVAC -X >/dev/null 2>&1 && \