From 9ddcde90e0d259d820a67f299faf927fc297c906 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Tue, 5 Dec 2017 23:14:35 +0100 Subject: [PATCH] 8192771: Boot JDK jar tool used to construct the modular JAR for java.jnlp Reviewed-by: ihse, psandoz, mchung --- make/CreateJmods.gmk | 5 +++-- make/autoconf/spec.gmk.in | 1 + make/common/JarArchive.gmk | 12 +++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk index d1e05718dcf..0b530bb8b6b 100644 --- a/make/CreateJmods.gmk +++ b/make/CreateJmods.gmk @@ -1,5 +1,4 @@ - -# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2017, 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 @@ -33,6 +32,8 @@ ifeq ($(MODULE), ) $(error MODULE must be set when calling CreateJmods.gmk) endif +$(eval $(call IncludeCustomExtension, CreateJmods.gmk)) + ################################################################################ JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index 84ff78339a5..dda3fbebaca 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -565,6 +565,7 @@ JAVAC_FLAGS?=@JAVAC_FLAGS@ BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@ 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_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc diff --git a/make/common/JarArchive.gmk b/make/common/JarArchive.gmk index 1e1c017ab61..b6487913dd4 100644 --- a/make/common/JarArchive.gmk +++ b/make/common/JarArchive.gmk @@ -56,6 +56,7 @@ FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST # added to the archive. # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. # CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable +# JAR_CMD:=Optionally override the jar command to use when creating the archive. SetupJarArchive = $(NamedParamsMacroTemplate) define SetupJarArchiveBody @@ -65,6 +66,7 @@ define SetupJarArchiveBody $1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess $1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes $1_BIN:=$$(dir $$($1_JAR)) + $$(call SetIfEmpty, $1_JAR_CMD, $$(JAR)) ifeq (,$$($1_SUFFIXES)) # No suffix was set, default to classes. @@ -109,7 +111,7 @@ define SetupJarArchiveBody # Check if this jar needs to have its index generated. ifneq (,$$($1_JARINDEX)) - $1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@)) + $1_JARINDEX = (cd $$(dir $$@) && $$($1_JAR_CMD) -i $$(notdir $$@)) else $1_JARINDEX = true endif @@ -189,7 +191,7 @@ define SetupJarArchiveBody $1_UPDATE_CONTENTS=\ 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 && \ - $(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) # 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! @@ -208,7 +210,7 @@ define SetupJarArchiveBody | $(SED) 's|$$(src)/|-C $$(src) |g' >> \ $$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) ) 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. $1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_JAR)) @@ -226,7 +228,7 @@ define SetupJarArchiveBody endif # 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_INCLUDES) $$($1_EXCLUDES) $$($1_EXCLUDE_FILES) $$($1_EXTRA_FILES) $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), \ $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(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_METAINF) \ $$($1_SUPDATE_CONTENTS) \