changeset 7972:3846282d50e9

8074726: Update source and target version used when compiling hotspot class files Summary: Use BOOT_JDK_SOURCETARGET from top level, or fall back to -source 8 -target 8 Reviewed-by: dholmes, sla
author mikael
date Tue, 10 Mar 2015 09:42:23 -0700
parents e0c6eb5fce97
children 98e38530135c 471b684ff43e
files make/aix/makefiles/rules.make make/bsd/makefiles/rules.make make/defs.make make/linux/makefiles/rules.make make/solaris/makefiles/rules.make make/windows/makefiles/rules.make
diffstat 6 files changed, 52 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/make/aix/makefiles/rules.make	Tue Mar 10 04:53:58 2015 -0700
+++ b/make/aix/makefiles/rules.make	Tue Mar 10 09:42:23 2015 -0700
@@ -126,10 +126,17 @@
 RUN.JAR$(MAKE_VERBOSE) += >/dev/null
 
 # Settings for javac
-BOOT_SOURCE_LANGUAGE_VERSION = 6
-BOOT_TARGET_CLASS_VERSION = 6
 JAVAC_FLAGS = -g -encoding ascii
-BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
+
+# Prefer BOOT_JDK_SOURCETARGET if it's set (typically by the top build system)
+# Fall back to the values here if it's not set (hotspot only builds)
+ifeq ($(BOOT_JDK_SOURCETARGET),)
+BOOTSTRAP_SOURCETARGET := -source 8 -target 8
+else
+BOOTSTRAP_SOURCETARGET := $(BOOT_JDK_SOURCETARGET)
+endif
+
+BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) $(BOOTSTRAP_SOURCETARGET)
 
 # With parallel makes, print a message at the end of compilation.
 ifeq    ($(findstring j,$(MFLAGS)),j)
--- a/make/bsd/makefiles/rules.make	Tue Mar 10 04:53:58 2015 -0700
+++ b/make/bsd/makefiles/rules.make	Tue Mar 10 09:42:23 2015 -0700
@@ -126,10 +126,17 @@
 RUN.JAR$(MAKE_VERBOSE) += >/dev/null
 
 # Settings for javac
-BOOT_SOURCE_LANGUAGE_VERSION = 6
-BOOT_TARGET_CLASS_VERSION = 6
 JAVAC_FLAGS = -g -encoding ascii
-BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
+
+# Prefer BOOT_JDK_SOURCETARGET if it's set (typically by the top build system)
+# Fall back to the values here if it's not set (hotspot only builds)
+ifeq ($(BOOT_JDK_SOURCETARGET),)
+BOOTSTRAP_SOURCETARGET := -source 8 -target 8
+else
+BOOTSTRAP_SOURCETARGET := $(BOOT_JDK_SOURCETARGET)
+endif
+
+BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) $(BOOTSTRAP_SOURCETARGET)
 
 # With parallel makes, print a message at the end of compilation.
 ifeq    ($(findstring j,$(MFLAGS)),j)
--- a/make/defs.make	Tue Mar 10 04:53:58 2015 -0700
+++ b/make/defs.make	Tue Mar 10 09:42:23 2015 -0700
@@ -347,6 +347,8 @@
 # includes this make/defs.make file.
 MAKE_ARGS += HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION)
 
+MAKE_ARGS += BOOT_JDK_SOURCETARGET="$(BOOT_JDK_SOURCETARGET)"
+
 # Various export sub directories
 EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include
 EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs
--- a/make/linux/makefiles/rules.make	Tue Mar 10 04:53:58 2015 -0700
+++ b/make/linux/makefiles/rules.make	Tue Mar 10 09:42:23 2015 -0700
@@ -126,10 +126,17 @@
 RUN.JAR$(MAKE_VERBOSE) += >/dev/null
 
 # Settings for javac
-BOOT_SOURCE_LANGUAGE_VERSION = 6
-BOOT_TARGET_CLASS_VERSION = 6
 JAVAC_FLAGS = -g -encoding ascii
-BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
+
+# Prefer BOOT_JDK_SOURCETARGET if it's set (typically by the top build system)
+# Fall back to the values here if it's not set (hotspot only builds)
+ifeq ($(BOOT_JDK_SOURCETARGET),)
+BOOTSTRAP_SOURCETARGET := -source 8 -target 8
+else
+BOOTSTRAP_SOURCETARGET := $(BOOT_JDK_SOURCETARGET)
+endif
+
+BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) $(BOOTSTRAP_SOURCETARGET)
 
 # With parallel makes, print a message at the end of compilation.
 ifeq    ($(findstring j,$(MFLAGS)),j)
--- a/make/solaris/makefiles/rules.make	Tue Mar 10 04:53:58 2015 -0700
+++ b/make/solaris/makefiles/rules.make	Tue Mar 10 09:42:23 2015 -0700
@@ -118,10 +118,17 @@
 RUN.JAR$(MAKE_VERBOSE) += >/dev/null
 
 # Settings for javac
-BOOT_SOURCE_LANGUAGE_VERSION = 6
-BOOT_TARGET_CLASS_VERSION = 6
 JAVAC_FLAGS = -g -encoding ascii
-BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
+
+# Prefer BOOT_JDK_SOURCETARGET if it's set (typically by the top build system)
+# Fall back to the values here if it's not set (hotspot only builds)
+ifeq ($(BOOT_JDK_SOURCETARGET),)
+BOOTSTRAP_SOURCETARGET := -source 8 -target 8
+else
+BOOTSTRAP_SOURCETARGET := $(BOOT_JDK_SOURCETARGET)
+endif
+
+BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) $(BOOTSTRAP_SOURCETARGET)
 
 # With parallel makes, print a message at the end of compilation.
 ifeq    ($(findstring j,$(MFLAGS)),j)
--- a/make/windows/makefiles/rules.make	Tue Mar 10 04:53:58 2015 -0700
+++ b/make/windows/makefiles/rules.make	Tue Mar 10 09:42:23 2015 -0700
@@ -44,10 +44,17 @@
 !endif
 
 # Settings for javac
-BOOT_SOURCE_LANGUAGE_VERSION=6
-BOOT_TARGET_CLASS_VERSION=6
 JAVAC_FLAGS=-g -encoding ascii
-BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
+
+# Prefer BOOT_JDK_SOURCETARGET if it's set (typically by the top build system)
+# Fall back to the values here if it's not set (hotspot only builds)
+!ifndef BOOT_JDK_SOURCETARGET
+BOOTSTRAP_SOURCETARGET=-source 8 -target 8
+!else
+BOOTSTRAP_SOURCETARGET=$(BOOT_JDK_SOURCETARGET)
+!endif
+
+BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) $(BOOTSTRAP_SOURCETARGET)
 
 # VS2012 and VS2013 loads VS10 projects just fine (and will
 # upgrade them automatically to VS2012 format).