11#
2- # Copyright (c) 2011, 2019 , Oracle and/or its affiliates. All rights reserved.
2+ # Copyright (c) 2011, 2021 , Oracle and/or its affiliates. All rights reserved.
33# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44#
55# This code is free software; you can redistribute it and/or modify it
@@ -193,7 +193,7 @@ define SetupJarArchiveBody
193193 $1_UPDATE_CONTENTS=\
194194 if [ "`$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'`" -gt "0" ]; then \
195195 $(ECHO) " updating" `$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
196- $$($1_JAR_CMD) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents; \
196+ $$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents; \
197197 fi $$(NEWLINE)
198198 # The s-variants of the above macros are used when the jar is created from scratch.
199199 # NOTICE: please leave the parentheses space separated otherwise the AIX build will break!
@@ -212,25 +212,27 @@ define SetupJarArchiveBody
212212 | $(SED) 's|$$(src)/|-C $$(src) |g' >> \
213213 $$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
214214 endif
215- $1_SUPDATE_CONTENTS=$$($1_JAR_CMD) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)
215+ $1_SUPDATE_CONTENTS=$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)
216216
217217 # Use a slightly shorter name for logging, but with enough path to identify this jar.
218218 $1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_JAR))
219219
220+ # If reproducible build and the boot jdk jar supports --date option
221+ # then specify the --date using SOURCE_DATE in ISO-8601
222+ $1_JAR_OPTIONS :=
223+ ifeq ($$(ENABLE_REPRODUCIBLE_BUILD), true)
224+ ifeq ($$(BOOT_JDK_JAR_SUPPORTS_DATE), true)
225+ $1_JAR_OPTIONS += --date $(SOURCE_DATE_ISO_8601)
226+ endif
227+ endif
220228 ifneq (,$$($1_CHECK_COMPRESS_JAR))
221- $1_JAR_CREATE_OPTIONS := c0fm
222- $1_JAR_UPDATE_OPTIONS := u0f
223- ifeq ($(COMPRESS_JARS), true)
224- $1_JAR_CREATE_OPTIONS := cfm
225- $1_JAR_UPDATE_OPTIONS := uf
229+ ifneq ($(COMPRESS_JARS), true)
230+ $1_JAR_OPTIONS += --no-compress
226231 endif
227- else
228- $1_JAR_CREATE_OPTIONS := cfm
229- $1_JAR_UPDATE_OPTIONS := uf
230232 endif
231233
232234 # Include all variables of significance in the vardeps file
233- $1_VARDEPS := $$($1_JAR_CMD) $$($1_JAR_CREATE_OPTIONS ) $$($1_MANIFEST) \
235+ $1_VARDEPS := $$($1_JAR_CMD) $$($1_JAR_OPTIONS ) $$($1_MANIFEST) \
234236 $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR) $$($1_ORIG_DEPS) $$($1_SRCS) \
235237 $$($1_INCLUDES) $$($1_EXCLUDES) $$($1_EXCLUDE_FILES) $$($1_EXTRA_FILES)
236238 $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$$($1_JARNAME).vardeps)
@@ -255,7 +257,7 @@ define SetupJarArchiveBody
255257 $$(if $$($1_EXTRA_MANIFEST_ATTR), \
256258 $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
257259 $(ECHO) Creating $$($1_NAME) $$(NEWLINE) \
258- $$($1_JAR_CMD) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \
260+ $$($1_JAR_CMD) --create $$($1_JAR_OPTIONS) --file $$@ --manifest $$($1_MANIFEST_FILE) $$(NEWLINE) \
259261 $$($1_SCAPTURE_CONTENTS) \
260262 $$($1_SCAPTURE_METAINF) \
261263 $$($1_SUPDATE_CONTENTS) \
0 commit comments