make/copy/Copy-java.base.gmk
changeset 49537 149dc554808c
parent 48355 4944950606ef
child 50073 35b22ca681d1
--- a/make/copy/Copy-java.base.gmk	Thu Apr 05 20:31:57 2018 +0000
+++ b/make/copy/Copy-java.base.gmk	Thu Apr 05 23:46:05 2018 +0200
@@ -24,6 +24,7 @@
 #
 
 include CopyCommon.gmk
+include Modules.gmk
 include TextFileProcessing.gmk
 
 $(eval $(call IncludeCustomExtension, copy/Copy-java.base.gmk))
@@ -224,13 +225,28 @@
 
 $(eval $(call SetupCopyFiles, COPY_JDK_NOTICES, \
     FILES := $(JDK_LICENSE) $(JDK_NOTICE) $(JDK_ADDITIONAL_LICENSE_INFO), \
-    DEST := $(LEGAL_DST_DIR), \
+    DEST := $(COMMON_LEGAL_DST_DIR), \
     FLATTEN := true, \
 ))
 
 TARGETS += $(COPY_JDK_NOTICES)
 
 ################################################################################
+#
+# Copy and filter the legal files depending on what 3rd party components are
+# bundled or linked from the OS.
+#
+ifeq ($(USE_EXTERNAL_LIBZ), true)
+  LEGAL_EXCLUDES += zlib.md
+endif
+
+$(eval $(call SetupCopyLegalFiles, COPY_LEGAL, \
+    EXCLUDES := $(LEGAL_EXCLUDES), \
+))
+
+TARGETS += $(COPY_LEGAL)
+
+################################################################################
 # Optionally copy libffi.so.? into the the image
 
 ifeq ($(ENABLE_LIBFFI_BUNDLING), true)