8192771: Boot JDK jar tool used to construct the modular JAR for java.jnlp

Reviewed-by: ihse, psandoz, mchung
This commit is contained in:
Erik Joelsson 2017-12-05 23:14:35 +01:00
parent 18129b7776
commit 9ddcde90e0
3 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,4 @@
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -33,6 +32,8 @@ ifeq ($(MODULE), )
$(error MODULE must be set when calling CreateJmods.gmk) $(error MODULE must be set when calling CreateJmods.gmk)
endif endif
$(eval $(call IncludeCustomExtension, CreateJmods.gmk))
################################################################################ ################################################################################
JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods

View File

@ -565,6 +565,7 @@ JAVAC_FLAGS?=@JAVAC_FLAGS@
BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@ BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS) BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)
BUILD_JAR=@FIXPATH@ $(BUILD_JDK)/bin/jar
# Interim langtools and rmic modules and arguments # Interim langtools and rmic modules and arguments
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc

View File

@ -56,6 +56,7 @@ FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
# added to the archive. # added to the archive.
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
# CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable # CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable
# JAR_CMD:=Optionally override the jar command to use when creating the archive.
SetupJarArchive = $(NamedParamsMacroTemplate) SetupJarArchive = $(NamedParamsMacroTemplate)
define SetupJarArchiveBody define SetupJarArchiveBody
@ -65,6 +66,7 @@ define SetupJarArchiveBody
$1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess $1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess
$1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes $1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes
$1_BIN:=$$(dir $$($1_JAR)) $1_BIN:=$$(dir $$($1_JAR))
$$(call SetIfEmpty, $1_JAR_CMD, $$(JAR))
ifeq (,$$($1_SUFFIXES)) ifeq (,$$($1_SUFFIXES))
# No suffix was set, default to classes. # No suffix was set, default to classes.
@ -109,7 +111,7 @@ define SetupJarArchiveBody
# Check if this jar needs to have its index generated. # Check if this jar needs to have its index generated.
ifneq (,$$($1_JARINDEX)) ifneq (,$$($1_JARINDEX))
$1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@)) $1_JARINDEX = (cd $$(dir $$@) && $$($1_JAR_CMD) -i $$(notdir $$@))
else else
$1_JARINDEX = true $1_JARINDEX = true
endif endif
@ -189,7 +191,7 @@ define SetupJarArchiveBody
$1_UPDATE_CONTENTS=\ $1_UPDATE_CONTENTS=\
if [ "`$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'`" -gt "0" ]; then \ if [ "`$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'`" -gt "0" ]; then \
$(ECHO) " updating" `$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \ $(ECHO) " updating" `$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
$(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents; \ $$($1_JAR_CMD) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents; \
fi $$(NEWLINE) fi $$(NEWLINE)
# The s-variants of the above macros are used when the jar is created from scratch. # The s-variants of the above macros are used when the jar is created from scratch.
# NOTICE: please leave the parentheses space separated otherwise the AIX build will break! # NOTICE: please leave the parentheses space separated otherwise the AIX build will break!
@ -208,7 +210,7 @@ define SetupJarArchiveBody
| $(SED) 's|$$(src)/|-C $$(src) |g' >> \ | $(SED) 's|$$(src)/|-C $$(src) |g' >> \
$$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) ) $$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
endif endif
$1_SUPDATE_CONTENTS=$(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE) $1_SUPDATE_CONTENTS=$$($1_JAR_CMD) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)
# Use a slightly shorter name for logging, but with enough path to identify this jar. # Use a slightly shorter name for logging, but with enough path to identify this jar.
$1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_JAR)) $1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_JAR))
@ -226,7 +228,7 @@ define SetupJarArchiveBody
endif endif
# Include all variables of significance in the vardeps file # Include all variables of significance in the vardeps file
$1_VARDEPS := $(JAR) $$($1_JAR_CREATE_OPTIONS) $$($1_MANIFEST) \ $1_VARDEPS := $$($1_JAR_CMD) $$($1_JAR_CREATE_OPTIONS) $$($1_MANIFEST) \
$$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR) $$($1_ORIG_DEPS) $$($1_SRCS) \ $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR) $$($1_ORIG_DEPS) $$($1_SRCS) \
$$($1_INCLUDES) $$($1_EXCLUDES) $$($1_EXCLUDE_FILES) $$($1_EXTRA_FILES) $$($1_INCLUDES) $$($1_EXCLUDES) $$($1_EXCLUDE_FILES) $$($1_EXTRA_FILES)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps) $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps)
@ -250,7 +252,7 @@ define SetupJarArchiveBody
$$(if $$($1_EXTRA_MANIFEST_ATTR), \ $$(if $$($1_EXTRA_MANIFEST_ATTR), \
$(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \ $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
$(ECHO) Creating $$($1_NAME) $$(NEWLINE) \ $(ECHO) Creating $$($1_NAME) $$(NEWLINE) \
$(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \ $$($1_JAR_CMD) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \
$$($1_SCAPTURE_CONTENTS) \ $$($1_SCAPTURE_CONTENTS) \
$$($1_SCAPTURE_METAINF) \ $$($1_SCAPTURE_METAINF) \
$$($1_SUPDATE_CONTENTS) \ $$($1_SUPDATE_CONTENTS) \