8205934: Define jdk -source/-target version in version-numbers file
Reviewed-by: tbell
--- a/make/autoconf/jdk-version.m4 Thu Mar 28 08:37:05 2019 -0700
+++ b/make/autoconf/jdk-version.m4 Thu Mar 28 10:04:27 2019 -0700
@@ -460,6 +460,7 @@
# We could define --with flags for these, if really needed
VERSION_CLASSFILE_MAJOR="$DEFAULT_VERSION_CLASSFILE_MAJOR"
VERSION_CLASSFILE_MINOR="$DEFAULT_VERSION_CLASSFILE_MINOR"
+ JDK_SOURCE_TARGET_VERSION="$DEFAULT_JDK_SOURCE_TARGET_VERSION"
AC_MSG_CHECKING([for version string])
AC_MSG_RESULT([$VERSION_STRING])
@@ -483,5 +484,5 @@
AC_SUBST(VENDOR_VERSION_STRING)
AC_SUBST(VERSION_CLASSFILE_MAJOR)
AC_SUBST(VERSION_CLASSFILE_MINOR)
-
+ AC_SUBST(JDK_SOURCE_TARGET_VERSION)
])
--- a/make/autoconf/spec.gmk.in Thu Mar 28 08:37:05 2019 -0700
+++ b/make/autoconf/spec.gmk.in Thu Mar 28 10:04:27 2019 -0700
@@ -208,6 +208,8 @@
VERSION_CLASSFILE_MAJOR := @VERSION_CLASSFILE_MAJOR@
VERSION_CLASSFILE_MINOR := @VERSION_CLASSFILE_MINOR@
+JDK_SOURCE_TARGET_VERSION := @JDK_SOURCE_TARGET_VERSION@
+
# Convenience CFLAGS settings for passing version information into native programs.
VERSION_CFLAGS := \
-DVERSION_FEATURE=$(VERSION_FEATURE) \
--- a/make/autoconf/version-numbers Thu Mar 28 08:37:05 2019 -0700
+++ b/make/autoconf/version-numbers Thu Mar 28 10:04:27 2019 -0700
@@ -36,6 +36,7 @@
DEFAULT_VERSION_CLASSFILE_MAJOR=57 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="12 13"
+DEFAULT_JDK_SOURCE_TARGET_VERSION=13
LAUNCHER_NAME=openjdk
PRODUCT_NAME=OpenJDK
--- a/make/common/SetupJavaCompilers.gmk Thu Mar 28 08:37:05 2019 -0700
+++ b/make/common/SetupJavaCompilers.gmk Thu Mar 28 10:04:27 2019 -0700
@@ -33,6 +33,9 @@
DISABLE_WARNINGS ?= -Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
+JDK_SOURCE_TARGET_FLAGS := -source $(JDK_SOURCE_TARGET_VERSION) \
+ -target $(JDK_SOURCE_TARGET_VERSION)
+
# If warnings needs to be non-fatal for testing purposes use a command like:
# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
JAVAC_WARNINGS ?= -Xlint:all -Werror
@@ -72,7 +75,7 @@
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
JVM := $(JAVA_JAVAC), \
JAVAC := $(NEW_JAVAC), \
- FLAGS := -source 13 -target 13 --doclint-format html5 \
+ FLAGS := $(JDK_SOURCE_TARGET_FLAGS) --doclint-format html5 \
-encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
@@ -82,7 +85,7 @@
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \
JVM := $(JAVA_JAVAC), \
JAVAC := $(NEW_JAVAC), \
- FLAGS := -source 13 -target 13 \
+ FLAGS := $(JDK_SOURCE_TARGET_FLAGS) \
-encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))