This commit is contained in:
Lana Steuck 2016-12-01 21:39:43 +00:00
commit 2272fb14a6
17 changed files with 301 additions and 236 deletions

@ -3,8 +3,7 @@
^.idea/
nbproject/private/
^webrev
^.hgtip
^.bridge2
^.src-rev$
^.jib/
.DS_Store
.metadata/

@ -5093,7 +5093,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1479997904
DATE_WHEN_GENERATED=1480601517
###############################################################################
#
@ -31198,6 +31198,12 @@ $as_echo "$as_me: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\"
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
fi
# Workaround for using different imported module-info.java in Jake due to a
# change in format. Remove once new format is standard in JDK 9 and javafx
# delivers just that.
if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
fi
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
fi
@ -33578,9 +33584,11 @@ $as_echo "$as_me: Please use --enable-ccache instead of providing a wrapped comp
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
# cc -V output typically looks like
# cc: Sun C 5.12 Linux_i386 2011/11/16
# or
# cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31
COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1`
# Check that this is likely to be the Solaris Studio cc.
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null
if test $? -ne 0; then
ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1`
{ $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5
@ -34875,9 +34883,11 @@ $as_echo "$as_me: Please use --enable-ccache instead of providing a wrapped comp
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
# cc -V output typically looks like
# cc: Sun C 5.12 Linux_i386 2011/11/16
# or
# cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31
COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1`
# Check that this is likely to be the Solaris Studio cc.
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null
if test $? -ne 0; then
ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1`
{ $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5
@ -46956,9 +46966,11 @@ $as_echo "$as_me: Rewriting BUILD_STRIP to \"$new_complete\"" >&6;}
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
# cc -V output typically looks like
# cc: Sun C 5.12 Linux_i386 2011/11/16
# or
# cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31
COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1`
# Check that this is likely to be the Solaris Studio cc.
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null
if test $? -ne 0; then
ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1`
{ $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5
@ -47076,9 +47088,11 @@ $as_echo "$as_me: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILE
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
# cc -V output typically looks like
# cc: Sun C 5.12 Linux_i386 2011/11/16
# or
# cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31
COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1`
# Check that this is likely to be the Solaris Studio cc.
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null
if test $? -ne 0; then
ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1`
{ $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5

@ -126,6 +126,12 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_IMPORT_MODULES],
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
fi
# Workaround for using different imported module-info.java in Jake due to a
# change in format. Remove once new format is standard in JDK 9 and javafx
# delivers just that.
if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
fi
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
fi

@ -333,9 +333,11 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
# cc -V output typically looks like
# cc: Sun C 5.12 Linux_i386 2011/11/16
# or
# cc: Studio 12.5 Sun C 5.14 SunOS_sparc 2016/05/31
COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1`
# Check that this is likely to be the Solaris Studio cc.
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.* Sun $COMPILER_NAME" > /dev/null
if test $? -ne 0; then
ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1`
AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.])

@ -1295,8 +1295,8 @@ if [ "$SKIP_DEFAULT" != "true" ]; then
OTHER_JDK="$OTHER/images/jdk"
OTHER_JRE="$OTHER/images/jre"
echo "Selecting jdk images for compare"
elif [ -d "$(ls -d $THIS/licensee-src/build/*/images/jdk)" ] \
&& [ -d "$(ls -d $OTHER/licensee-src/build/*/images/jdk)" ]
elif [ -d "$(ls -d $THIS/licensee-src/build/*/images/jdk 2> /dev/null)" ] \
&& [ -d "$(ls -d $OTHER/licensee-src/build/*/images/jdk 2> /dev/null)" ]
then
echo "Selecting licensee images for compare"
# Simply override the THIS and OTHER dir with the build dir from

@ -427,7 +427,7 @@ var getJibProfilesDependencies = function (input, common) {
jtreg: {
server: "javare",
revision: "4.2",
build_number: "b03",
build_number: "b04",
checksum_file: "MD5_VALUES",
file: "jtreg_bin-4.2.zip",
environment_name: "JT_HOME",

@ -1,55 +0,0 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
default: all
include $(SPEC)
include MakeBase.gmk
define SetupCreateHgtip
$$(strip $1)/$(HGTIP_FILENAME): FRC
$(HG) tip --repository $$(strip $1) --template '{node|short}\n' > $$@.tmp
if [ ! -f $$@ ] || [ "`$(CAT) $$@`" != "`$(CAT) $$@.tmp`" ]; then \
$(MV) $$@.tmp $$@ ; \
else \
$(RM) $$@.tmp ; \
fi
TARGETS += $$(strip $1)/$(HGTIP_FILENAME)
endef
# Only try to create the tips if finding an actual hg repository. This will be
# false if building from a source bundle.
$(foreach r, $(call FindAllReposAbs), \
$(if $(wildcard $r/.hg), $(eval $(call SetupCreateHgtip, $r))) \
)
all: $(TARGETS)
FRC:
.PHONY: all

@ -60,8 +60,8 @@ TOOL_GENMODULEINFOSOURCE = $(JAVA_SMALL) \
################################################################################
# Name of data file. Keep module-info.java.ext until javafx has changed.
MOD_FILENAME := module-info.java.extra module-info.java.ext
# Name of modification file.
MOD_FILENAME := module-info.java.extra
# Construct all possible src directories for the module.
MODULE_CLASSES_DIRS := $(call FindModuleSrcDirs, $(MODULE))
@ -74,74 +74,24 @@ ifneq ($(MOD_FILES), )
# Only make this call if modification files are found for this module
ALL_MODULES := $(call FindAllModules)
# Read the contents of all the files into a variable. Replace space with / to
# let space represent new lines in the variable as $(shell) normalizes all
# whitespace.
$(foreach f, $(MOD_FILES), \
$(eval MOD_FILE_CONTENTS += $(shell $(GREP) -v -e ".\*" -e "//" $f | $(TR) ' ' '/')))
# Separate the modifications into qualified exports and the rest
MODS_QUALIFIED_EXPORTS := $(call containing, /to/, $(MOD_FILE_CONTENTS))
MODS_REST := $(filter-out $(MODS_QUALIFIED_EXPORTS), $(MOD_FILE_CONTENTS))
# Filter the contents for modules that are actually being built
ALL_MODULES_FILTER := $(addprefix %/, $(addsuffix ;, $(ALL_MODULES)))
MODIFICATIONS := $(filter $(ALL_MODULES_FILTER), $(MODS_QUALIFIED_EXPORTS)) \
$(MODS_REST)
# Returns non empty if the package exists in the current module
# Param 1 - Name of package with dots
PackageExists = \
$(strip $(wildcard $(addsuffix $(subst .,/,/$(strip $1)), \
$(MODULE_CLASSES_DIRS) \
$(addsuffix /$(MODULE), $(IMPORT_MODULES_CLASSES)) \
$(JDK_OUTPUTDIR)/modules/$(MODULE) \
)))
# Convert the modification lines into arguments for the modification tool.
# Filter out modifications for non existing to-modules.
$(foreach line, $(MODIFICATIONS), \
$(eval split_line := $(subst /,$(SPACE),$(line))) \
$(eval command := $(word 1, $(split_line))) \
$(if $(filter $(command), exports), \
$(eval package := $(patsubst %;,%,$(word 2, $(split_line)))) \
$(if $(call PackageExists, $(package)), \
$(eval to_module := $(patsubst %;,%,$(word 4, $(split_line)))) \
$(if $(to_module), \
$(eval ARGS += -$(command) $(package)/$(to_module)) \
, \
$(eval ARGS += -$(command) $(package)) \
) \
) \
, \
$(if $(filter $(command), provides), \
$(eval provider := $(patsubst %;,%,$(word 2, $(split_line)))) \
$(eval class := $(patsubst %;,%,$(word 4, $(split_line)))) \
$(eval ARGS += -$(command) $(provider)/$(class)) \
, \
$(error A module-info.extra in $(MODULE) contains invalid command $(command)) \
) \
) \
)
ifneq ($(ARGS), )
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java: \
$(firstword $(call FindAllModuleInfos, $(MODULE))) \
$(BUILD_TOOLS_JDK) \
$(call DependOnVariable, ARGS)
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java: \
$(firstword $(call FindAllModuleInfos, $(MODULE))) \
$(BUILD_TOOLS_JDK) \
$(MOD_FILES) \
$(call DependOnVariable, ALL_MODULES)
$(MKDIR) -p $(@D)
$(RM) $@ $@.tmp
$(TOOL_GENMODULEINFOSOURCE) $(ARGS) -o $@.tmp $<
$(TOOL_GENMODULEINFOSOURCE) -o $@.tmp \
--source-file $< \
--modules $(call CommaList, $(ALL_MODULES)) \
$(MOD_FILES)
$(MV) $@.tmp $@
TARGETS += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java
endif
TARGETS += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java
endif
# If no modifications are found for this module, remove any module-info.java
# created by a previous build since that is no longer valid.
ifeq ($(MODIFICATIONS), )
else
# If no modifications are found for this module, remove any module-info.java
# created by a previous build since that is no longer valid.
ifneq ($(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java), )
$(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java)
endif

@ -48,7 +48,8 @@ JRE_MODULES += $(filter $(ALL_MODULES), $(BOOT_MODULES) \
JDK_MODULES += $(ALL_MODULES)
# Compact builds have additional modules
COMPACT1_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec
COMPACT1_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec \
jdk.unsupported
COMPACT2_EXTRA_MODULES := jdk.xml.dom jdk.httpserver
COMPACT3_EXTRA_MODULES := java.smartcardio jdk.management \
jdk.naming.dns jdk.naming.rmi jdk.sctp jdk.security.auth
@ -64,47 +65,9 @@ JRE_COMPACT2_MODULES_LIST := $(call CommaList, $(JRE_COMPACT2_MODULES))
JRE_COMPACT3_MODULES_LIST := $(call CommaList, $(JRE_COMPACT3_MODULES))
################################################################################
# Release file
BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
# Common way to emit a line into the release or info file
define info-file-item # name value
$(PRINTF) '%s="%s"\n' $1 $2 >> $@
endef
# Param 1 - The file containing the MODULES list
define create-info-file
$(if $(JDK_ARCH_ABI_PROP_NAME), \
$(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
$(call info-file-item, "SOURCE", "$(strip $(ALL_SOURCE_TIPS))")
endef
# Param 1 - The file containing the MODULES list
define prepare-info-file
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(MKDIR) -p $(@D)
$(RM) $@
endef
define info-file
$(call prepare-info-file)
$(call create-info-file)
endef
# Create a variable dependency file common for all release info files.
INFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)
ALL_SOURCE_TIPS = $(shell \
if [ -f $(SUPPORT_OUTPUTDIR)/source_tips ] ; then \
$(CAT) $(SUPPORT_OUTPUTDIR)/source_tips ; \
fi)
$(BASE_RELEASE_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
$(info-file)
################################################################################
JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod)
# Use this file inside the image as target for make rule
@ -124,7 +87,8 @@ JLINK_ORDER_RESOURCES += \
/jdk.localedata/** \
#
JLINK_TOOL := $(JLINK) --module-path $(IMAGES_OUTPUTDIR)/jmods \
JLINK_TOOL := $(JLINK) -J-Djlink.debug=true \
--module-path $(IMAGES_OUTPUTDIR)/jmods \
--endian $(OPENJDK_BUILD_CPU_ENDIAN) \
--release-info $(BASE_RELEASE_FILE) \
--order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES)) \
@ -399,16 +363,6 @@ $(eval $(call SetupCopyFiles, COPY_SAMPLES, \
JDK_TARGETS += $(COPY_SAMPLES)
################################################################################
# jrt-fs.jar
$(eval $(call SetupCopyFiles,COPY_JRTFS_JAR, \
SRC := $(SUPPORT_OUTPUTDIR), \
DEST := $(JDK_IMAGE_DIR), \
FILES := $(SUPPORT_OUTPUTDIR)/jrt-fs.jar))
JDK_TARGETS += $(COPY_JRTFS_JAR)
################################################################################
# Code coverage data files

@ -33,7 +33,7 @@ include MakeBase.gmk
# Allow custom to overwrite.
JAVADOC_SOURCE_DIRS = \
$(SUPPORT_OUTPUTDIR)/gensrc/* \
$(if $(IMPORT_MODULES_SRC), $(IMPORT_MODULES_SRC)/*) \
$(addsuffix /*, $(IMPORT_MODULES_SRC)) \
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \
$(JDK_TOPDIR)/src/*/share/classes \

@ -65,7 +65,7 @@ $(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \
$(eval $(call SetupJarArchive,BUILD_JRTFS_JAR, \
DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \
SRCS := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
JAR := $(SUPPORT_OUTPUTDIR)/jrt-fs.jar, \
JAR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar, \
MANIFEST := $(SUPPORT_OUTPUTDIR)/java-main-manifest.mf, \
))

@ -284,16 +284,11 @@ ALL_TARGETS += $(JMOD_TARGETS)
################################################################################
# Images targets
# Stores the tips for each repository. This file is be used when constructing
# the jdk image and can be used to track the exact sources used to build that
# image.
source-tips: $(SUPPORT_OUTPUTDIR)/source_tips
$(SUPPORT_OUTPUTDIR)/source_tips: FRC
$(call MakeDir, $(@D))
$(call GetSourceTips)
store-source-revision:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk store-source-revision)
create-hgtip-files:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CreateHgtipFiles.gmk)
create-source-revision-tracker:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk create-source-revision-tracker)
BOOTCYCLE_TARGET := product-images
bootcycle-images:
@ -329,13 +324,16 @@ profiles:
mac-bundles-jdk:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
release-file:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ReleaseFile.gmk)
exploded-image-optimize:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ExplodedImageOptimize.gmk)
ALL_TARGETS += source-tips create-hgtip-files bootcycle-images zip-security \
ALL_TARGETS += store-source-revision create-source-revision-tracker bootcycle-images zip-security \
zip-source jrtfs-jar jdk-image jre-image \
symbols-image profiles mac-bundles-jdk \
exploded-image-optimize
release-file exploded-image-optimize
################################################################################
# Docs targets
@ -608,12 +606,12 @@ else
jdk.jdeps-gendata: java rmic
# Declare dependencies between jmod targets. Only java.base jmod needs access
# to the other jmods to be built.
# Declare dependencies between jmod targets.
# java.base jmod needs jrt-fs.jar and access to the other jmods to be built.
# When creating a BUILDJDK, we don't need to add hashes to java.base, thus
# we don't need to depend on all other jmods
ifneq ($(CREATING_BUILDJDK), true)
java.base-jmod: $(filter-out java.base-jmod \
java.base-jmod: jrtfs-jar $(filter-out java.base-jmod \
$(addsuffix -jmod, $(call FindAllUpgradeableModules)), $(JMOD_TARGETS))
endif
@ -684,10 +682,12 @@ else
java.base-jmod jdk-image jre-image: generate-link-opt-data
endif
jdk-image: jmods zip-source source-tips demos samples jrtfs-jar
jre-image: jmods source-tips jrtfs-jar
release-file: create-source-revision-tracker
profiles: jmods zip-source source-tips jrtfs-jar
jdk-image: jmods zip-source demos samples release-file
jre-image: jmods release-file
profiles: jmods release-file
mac-bundles-jdk: jdk-image jre-image
@ -794,7 +794,7 @@ samples: samples-jdk
# The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
exploded-image-base: $(ALL_MODULES)
exploded-image: exploded-image-base
exploded-image: exploded-image-base release-file
# When cross compiling, no need to optimize the exploded image since it won't
# be runnable on the host platform anyway.
ifneq ($(COMPILE_TYPE), cross)

86
make/ReleaseFile.gmk Normal file

@ -0,0 +1,86 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
default: all
include $(SPEC)
include MakeBase.gmk
################################################################################
# This makefile generates the "release" file into the exploded image. Jlink is
# then responsible for using this as the base for release files in each linked
# image.
#
################################################################################
BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
# Common way to emit a line into the release or info file
define info-file-item # name value
$(PRINTF) '%s="%s"\n' $1 $2 >> $@
endef
# Param 1 - The file containing the MODULES list
define create-info-file
$(if $(JDK_ARCH_ABI_PROP_NAME), \
$(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
$(call info-file-item, "SOURCE", "$(strip $(SOURCE_REVISION))")
endef
# Param 1 - The file containing the MODULES list
define prepare-info-file
$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call MakeDir, $(@D))
$(RM) $@
endef
define info-file
$(call prepare-info-file)
$(call create-info-file)
endef
# Create a variable dependency file common for all release info files.
INFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)
SOURCE_REVISION = $(shell \
if [ -f $(SOURCE_REVISION_TRACKER) ] ; then \
$(CAT) $(SOURCE_REVISION_TRACKER) ; \
fi)
# The SOURCE_REVISION_TRACKER file may not exist. Only depend on it if it does.
$(BASE_RELEASE_FILE): $(INFO_FILE_VARDEPS) $(wildcard $(SOURCE_REVISION_TRACKER))
$(info-file)
TARGETS += $(BASE_RELEASE_FILE)
################################################################################
$(eval $(call IncludeCustomExtension, , ReleaseFile.gmk))
################################################################################
all: $(TARGETS)
.PHONY: all default

131
make/SourceRevision.gmk Normal file

@ -0,0 +1,131 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
default: all
include $(SPEC)
include MakeBase.gmk
################################################################################
# Keep track of what source revision is used to create the build, by creating
# a tracker file in the output directory. This tracker file is included in the
# image, and can be used to recreate the source revision used.
#
# We're either building directly from a mercurial forest, and if so, use the
# current revision from mercurial. Otherwise, we are building from a source
# bundle. As a part of creating this source bundle, the current mercurial
# revisions of all repos will be stored in a file in the top dir, which is then
# used when creating the tracker file.
STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev
# Are we using mercurial?
ifneq ($(and $(HG), $(wildcard $(TOPDIR)/.hg)), )
# Verify that the entire forest is consistent
$(foreach repo, $(call FindAllReposRel), \
$(if $(wildcard $(TOPDIR)/$(repo)/.hg),, \
$(error Inconsistent revision control: $(repo) is missing .hg directory)) \
)
# Replace "." with "_top" and "/" with "-"
MakeFilenameFromRepo = \
$(strip $(subst .,top, $(subst /,-, $1)))
################################################################################
# SetupGetRevisionForRepo defines a make rule for creating a file containing
# the name of the repository and the output of "hg id" for that repository.
# Argument 1 is the relative path to the repository from the top dir.
#
SetupGetRevisionForRepo = $(NamedParamsMacroTemplate)
define SetupGetRevisionForRepoBody
$1_REPO_PATH := $$(TOPDIR)/$$(strip $1)
$1_FILENAME := $$(call MakeFilenameFromRepo, $1)
$$(SUPPORT_OUTPUTDIR)/src-rev/$$($1_FILENAME): FRC
$$(call MakeDir, $$(@D))
$$(ECHO) $$(strip $1):`$$(HG) id -i --repository $$($1_REPO_PATH)` > $$@
REPO_REVISIONS += $$(SUPPORT_OUTPUTDIR)/src-rev/$$($1_FILENAME)
endef
# Setup rules for all repos. This makes sure all the "hg id" calls are made
# in parallel.
$(foreach repo, $(call FindAllReposRel), \
$(eval $(call SetupGetRevisionForRepo, $(repo))) \
)
# Create a complete source revision output file from all repos
# Param 1: The output file
define CreateSourceRevisionFile
$1: $$(REPO_REVISIONS)
$$(call MakeDir, $$(@D))
$$(ECHO) `$$(CAT) $$(REPO_REVISIONS)` > $$@.tmp
if [ ! -f $$@ ] || [ "`$$(CAT) $$@`" != "`$$(CAT) $$@.tmp`" ]; then \
$$(MV) $$@.tmp $$@ ; \
else \
$$(RM) $$@.tmp ; \
fi
endef
$(eval $(call CreateSourceRevisionFile, $(STORED_SOURCE_REVISION)))
store-source-revision: $(STORED_SOURCE_REVISION)
$(eval $(call CreateSourceRevisionFile, $(SOURCE_REVISION_TRACKER)))
create-source-revision-tracker: $(SOURCE_REVISION_TRACKER)
else
# Not using HG
ifneq ($(wildcard $(STORED_SOURCE_REVISION)), )
# We have a stored source revision (.src-rev)
store-source-revision:
$(call LogWarn, Warning: No mercurial configuration present, not updating .src-rev)
$(SOURCE_REVISION_TRACKER): $(STORED_SOURCE_REVISION)
$(install-file)
create-source-revision-tracker: $(SOURCE_REVISION_TRACKER)
else
# We don't have a stored source revision. Can't do anything, really.
store-source-revision:
$(call LogWarn, Error: No mercurial configuration present, cannot create .src-rev)
exit 2
create-source-revision-tracker:
$(call LogWarn, Warning: No mercurial configuration present and no .src-rev)
endif
endif
all: store-source-revision create-source-revision-tracker
FRC: # Force target
.PHONY: all store-source-revision create-source-revision-tracker

@ -337,44 +337,21 @@ else # HAS_FILE_FUNCTION = false
endif # HAS_FILE_FUNCTION
################################################################################
# The source tips can come from the Mercurial repository, or in the files
# $(HGTIP_FILENAME) which contains the tip but is also positioned in the same
# directory as the original .hg directory. The hgtip files are created in
# CreateHgtipFiles.gmk.
HGTIP_FILENAME := .hgtip
# A file containing a way to uniquely identify the source code revision that
# the build was created from
SOURCE_REVISION_TRACKER := $(SUPPORT_OUTPUTDIR)/src-rev/source-revision-tracker
# Locate all hg repositories included in the forest, as absolute paths
FindAllReposAbs = \
$(strip $(sort $(dir $(filter-out $(SRC_ROOT)/build/%, $(wildcard \
$(addprefix $(SRC_ROOT)/, \
.hg */.hg */*/.hg */*/.hg */*/*/.hg \
.hgtip */.hgtip */*/.hgtip */*/.hgtip */*/*/.hgtip \
) \
$(addprefix $(SRC_ROOT)/, .hg */.hg */*/.hg */*/*/.hg) \
)))))
# Locate all hg repositories included in the forest, as relative paths
FindAllReposRel = \
$(strip $(subst $(SRC_ROOT)/,.,$(patsubst $(SRC_ROOT)/%/, %, $(FindAllReposAbs))))
# Emit the repo:tip pairs to $@, but only if they changed since last time
define GetSourceTips
$(CD) $(SRC_ROOT) ; \
for i in $(FindAllReposRel) IGNORE ; do \
if [ "$${i}" = "IGNORE" ] ; then \
continue; \
elif [ -d $${i}/.hg -a "$(HG)" != "" ] ; then \
$(PRINTF) " %s:%s" \
"$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \
elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \
$(PRINTF) " %s:%s" \
"$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \
fi; \
done > $@.tmp
$(PRINTF) "\n" >> $@.tmp
if [ ! -f $@ ] || [ "`$(CAT) $@`" != "`$(CAT) $@.tmp`" ]; then \
$(MV) $@.tmp $@ ; \
else \
$(RM) $@.tmp ; \
fi
endef
################################################################################
define SetupLogging

@ -171,12 +171,15 @@ SRC_SUBDIRS += share/classes
# Find all module-info.java files for the current build target platform and
# configuration.
# TODO: The $(firstword call is part of a workaround for using different
# imported module-info.java in Jake due to a change in format. Remove once
# new format is standard in JDK 9 and javafx delivers just that.
# Param 1 - Module to find for, set to * for finding all
FindAllModuleInfos = \
$(wildcard \
$(foreach sub, $(SRC_SUBDIRS), \
$(patsubst %,%/$(strip $1)/$(sub)/module-info.java, $(TOP_SRC_DIRS))) \
$(patsubst %,%/$(strip $1)/module-info.java, $(IMPORT_MODULES_SRC)))
$(patsubst %,%/$(strip $1)/module-info.java, $(firstword $(IMPORT_MODULES_SRC))))
# Find module-info.java files in the specific source dir
# Param 1 - Src dir to find module-info.java files in
@ -244,7 +247,7 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
/requires/ { sub(/;/, ""); \
sub(/requires/, ""); \
sub(/public/, ""); \
sub(/transitive/, ""); \
sub(/\/\/.*/, ""); \
sub(/\/\*.*\*\//, ""); \
gsub(/^ +\*.*/, ""); \

@ -453,8 +453,6 @@ public class WhiteBox {
Object[] packages);
public native void AddModuleExports(Object from_module, String pkg, Object to_module);
public native void AddReadsModule(Object from_module, Object source_module);
public native boolean CanReadModule(Object asking_module, Object source_module);
public native boolean IsExportedToModule(Object from_module, String pkg, Object to_module);
public native void AddModulePackage(Object module, String pkg);
public native void AddModuleExportsToAllUnnamed(Object module, String pkg);
public native void AddModuleExportsToAll(Object module, String pkg);