author | alanb |
Fri, 13 Oct 2017 14:17:10 +0100 | |
changeset 47335 | e8bd8e969070 |
parent 47314 | 743814386712 |
child 47355 | 8cf060fad8a8 |
permissions | -rw-r--r-- |
25859 | 1 |
# |
44117
7108a2c20885
8170884: Clean up post-jlink file copying to the images
ihse
parents:
42759
diff
changeset
|
2 |
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. |
25859 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
include CopyCommon.gmk |
|
27 |
||
47314 | 28 |
$(eval $(call IncludeCustomExtension, copy/Copy-java.base.gmk)) |
25859 | 29 |
|
30 |
################################################################################ |
|
31 |
# |
|
32 |
# Copy exported header files to outputdir. |
|
33 |
# |
|
27565 | 34 |
TARGETS += \ |
26191
a0ff4b39d34b
8055188: General cleanup of minor issues from source restructure
erikj
parents:
25859
diff
changeset
|
35 |
$(INCLUDE_DST_DIR)/jni.h \ |
a0ff4b39d34b
8055188: General cleanup of minor issues from source restructure
erikj
parents:
25859
diff
changeset
|
36 |
$(INCLUDE_DST_DIR)/jvmticmlr.h \ |
a0ff4b39d34b
8055188: General cleanup of minor issues from source restructure
erikj
parents:
25859
diff
changeset
|
37 |
$(INCLUDE_DST_DIR)/classfile_constants.h \ |
a0ff4b39d34b
8055188: General cleanup of minor issues from source restructure
erikj
parents:
25859
diff
changeset
|
38 |
$(INCLUDE_DST_OS_DIR)/jni_md.h \ |
25859 | 39 |
# |
40 |
||
47217 | 41 |
$(INCLUDE_DST_DIR)/%.h: $(TOPDIR)/src/java.base/share/native/include/%.h |
25859 | 42 |
$(call install-file) |
43 |
||
26191
a0ff4b39d34b
8055188: General cleanup of minor issues from source restructure
erikj
parents:
25859
diff
changeset
|
44 |
$(INCLUDE_DST_OS_DIR)/%.h: \ |
47217 | 45 |
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_EXPORT_DIR)/native/include/%.h |
25859 | 46 |
$(call install-file) |
47 |
||
48 |
################################################################################ |
|
49 |
||
50 |
ifneq ($(findstring $(OPENJDK_TARGET_OS), windows aix),) |
|
51 |
||
47217 | 52 |
TZMAPPINGS_SRC := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf |
25859 | 53 |
|
26191
a0ff4b39d34b
8055188: General cleanup of minor issues from source restructure
erikj
parents:
25859
diff
changeset
|
54 |
$(LIB_DST_DIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings |
25859 | 55 |
$(call install-file) |
56 |
||
27565 | 57 |
TARGETS += $(LIB_DST_DIR)/tzmappings |
25859 | 58 |
|
59 |
endif |
|
60 |
||
61 |
################################################################################ |
|
28984
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
62 |
# Copy the microsoft runtime libraries on windows |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
63 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
25859 | 64 |
|
65 |
# Chmod to avoid permission issues if bundles are unpacked on unix platforms. |
|
28984
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
66 |
define copy-and-chmod |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
67 |
$(install-file) |
25859 | 68 |
$(CHMOD) a+rx $@ |
28984
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
69 |
endef |
27565 | 70 |
|
28984
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
71 |
# Use separate macro calls in case the source files are not in the same |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
72 |
# directory. |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
73 |
$(eval $(call SetupCopyFiles,COPY_MSVCR, \ |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
74 |
DEST := $(LIB_DST_DIR), \ |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
75 |
FILES := $(MSVCR_DLL), \ |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
76 |
MACRO := copy-and-chmod)) |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
77 |
|
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
78 |
$(eval $(call SetupCopyFiles,COPY_MSVCP, \ |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
79 |
DEST := $(LIB_DST_DIR), \ |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
80 |
FILES := $(MSVCP_DLL), \ |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
81 |
MACRO := copy-and-chmod)) |
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
82 |
|
12031ba2dc38
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
27799
diff
changeset
|
83 |
TARGETS += $(COPY_MSVCR) $(COPY_MSVCP) |
25859 | 84 |
endif |
85 |
||
86 |
################################################################################ |
|
87 |
# |
|
88 |
# How to install jvm.cfg. |
|
89 |
# |
|
37525 | 90 |
ifeq ($(call check-jvm-variant, zero zeroshark), true) |
25859 | 91 |
JVMCFG_ARCH := zero |
92 |
else |
|
93 |
JVMCFG_ARCH := $(OPENJDK_TARGET_CPU_LEGACY) |
|
94 |
endif |
|
95 |
||
96 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
47217 | 97 |
JVMCFG_SRC := $(TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg |
25859 | 98 |
else |
47217 | 99 |
JVMCFG_SRC := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/$(JVMCFG_ARCH)/jvm.cfg |
29718
d0e9a4ece867
8072740: move closed jvm.cfg files out of open repo
dholmes
parents:
28984
diff
changeset
|
100 |
# Allow override by ALT_JVMCFG_SRC if it exists |
37525 | 101 |
JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JVMCFG_SRC)) |
25859 | 102 |
endif |
42753
40f61533b93d
8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents:
41833
diff
changeset
|
103 |
JVMCFG := $(LIB_DST_DIR)/jvm.cfg |
25859 | 104 |
|
105 |
# To do: should this also support -zeroshark? |
|
106 |
||
107 |
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) |
|
108 |
COPY_JVM_CFG_FILE := true |
|
109 |
else |
|
110 |
# On 32-bit machines we have three potential VMs: client, server and minimal. |
|
111 |
# Historically we usually have both client and server and so that is what the |
|
112 |
# committed jvm.cfg expects (including platform specific ergonomics switches |
|
113 |
# to decide whether to use client or server by default). So when we have anything |
|
114 |
# other than client and server we need to define a new jvm.cfg file. |
|
115 |
# The main problem is deciding whether to use aliases for the VMs that are not |
|
116 |
# present and the current position is that we add aliases for client and server, but |
|
117 |
# not for minimal. |
|
37525 | 118 |
CLIENT_AND_SERVER := $(call check-jvm-variant, client)+$(call check-jvm-variant, server) |
119 |
ifeq ($(CLIENT_AND_SERVER), true+true) |
|
25859 | 120 |
COPY_JVM_CFG_FILE := true |
121 |
else |
|
122 |
# For zero, the default jvm.cfg file is sufficient |
|
37525 | 123 |
ifeq ($(call check-jvm-variant, zero zeroshark), true) |
25859 | 124 |
COPY_JVM_CFG_FILE := true |
125 |
endif |
|
126 |
endif |
|
127 |
endif |
|
128 |
||
129 |
ifeq ($(COPY_JVM_CFG_FILE), true) |
|
130 |
$(JVMCFG): $(JVMCFG_SRC) |
|
131 |
$(call install-file) |
|
132 |
else |
|
133 |
$(JVMCFG): |
|
134 |
$(MKDIR) -p $(@D) |
|
135 |
$(RM) $(@) |
|
136 |
# Now check for other permutations |
|
37525 | 137 |
ifeq ($(call check-jvm-variant, server), true) |
25859 | 138 |
$(PRINTF) "-server KNOWN\n">>$(@) |
139 |
$(PRINTF) "-client ALIASED_TO -server\n">>$(@) |
|
37525 | 140 |
ifeq ($(call check-jvm-variant, minimal), true) |
25859 | 141 |
$(PRINTF) "-minimal KNOWN\n">>$(@) |
142 |
endif |
|
143 |
else |
|
37525 | 144 |
ifeq ($(call check-jvm-variant, client), true) |
25859 | 145 |
$(PRINTF) "-client KNOWN\n">>$(@) |
146 |
$(PRINTF) "-server ALIASED_TO -client\n">>$(@) |
|
37525 | 147 |
ifeq ($(call check-jvm-variant, minimal), true) |
25859 | 148 |
$(PRINTF) "-minimal KNOWN\n">>$(@) |
149 |
endif |
|
150 |
else |
|
37525 | 151 |
ifeq ($(call check-jvm-variant, minimal), true) |
25859 | 152 |
$(PRINTF) "-minimal KNOWN\n">>$(@) |
153 |
$(PRINTF) "-server ALIASED_TO -minimal\n">>$(@) |
|
154 |
$(PRINTF) "-client ALIASED_TO -minimal\n">>$(@) |
|
155 |
endif |
|
156 |
endif |
|
157 |
endif |
|
158 |
endif |
|
159 |
||
27565 | 160 |
TARGETS += $(JVMCFG) |
25859 | 161 |
|
162 |
################################################################################ |
|
163 |
||
47217 | 164 |
POLICY_SRC := $(TOPDIR)/src/java.base/share/conf/security/java.policy |
27565 | 165 |
POLICY_DST := $(CONF_DST_DIR)/security/java.policy |
25859 | 166 |
|
39884
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
167 |
POLICY_SRC_LIST := $(POLICY_SRC) |
25859 | 168 |
|
169 |
$(POLICY_DST): $(POLICY_SRC_LIST) |
|
170 |
$(MKDIR) -p $(@D) |
|
171 |
$(RM) $@ $@.tmp |
|
172 |
$(foreach f,$(POLICY_SRC_LIST),$(CAT) $(f) >> $@.tmp;) |
|
173 |
$(MV) $@.tmp $@ |
|
174 |
||
27565 | 175 |
TARGETS += $(POLICY_DST) |
25859 | 176 |
|
177 |
################################################################################ |
|
178 |
||
47217 | 179 |
DEF_POLICY_SRC := $(TOPDIR)/src/java.base/share/lib/security/default.policy |
39884
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
180 |
DEF_POLICY_DST := $(LIB_DST_DIR)/security/default.policy |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
181 |
|
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
182 |
DEF_POLICY_SRC_LIST := $(DEF_POLICY_SRC) |
42230
8b75662a3762
8170242: jdk.desktop needs package access to sun.awt.
prr
parents:
41833
diff
changeset
|
183 |
DEF_POLICY_SRC_LIST += $(CUSTOM_POLICY_SRC_LIST) |
39884
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
184 |
|
40401
47a0de15f8b6
8164071: Default.policy file missing content for solaris
mullan
parents:
40253
diff
changeset
|
185 |
ifneq ($(filter $(OPENJDK_TARGET_OS), windows solaris), ) |
47217 | 186 |
DEF_POLICY_SRC_LIST += $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/lib/security/default.policy |
39884
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
187 |
endif |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
188 |
|
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
189 |
# Allow imported modules to modify the java.policy |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
190 |
ifneq ($(IMPORT_MODULES_CONF), ) |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
191 |
DEF_POLICY_SRC_LIST += $(wildcard $(IMPORT_MODULES_CONF)/java.base/security/java.policy.extra) |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
192 |
endif |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
193 |
|
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
194 |
$(DEF_POLICY_DST): $(DEF_POLICY_SRC_LIST) |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
195 |
$(MKDIR) -p $(@D) |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
196 |
$(RM) $@ $@.tmp |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
197 |
$(foreach f,$(DEF_POLICY_SRC_LIST),$(CAT) $(f) >> $@.tmp;) |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
198 |
$(MV) $@.tmp $@ |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
199 |
|
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
200 |
TARGETS += $(DEF_POLICY_DST) |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
201 |
|
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
202 |
################################################################################ |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
203 |
|
25859 | 204 |
ifeq ($(CACERTS_FILE), ) |
47217 | 205 |
CACERTS_FILE := $(TOPDIR)/src/java.base/share/lib/security/cacerts |
25859 | 206 |
endif |
35241 | 207 |
|
27565 | 208 |
CACERTS_DST := $(LIB_DST_DIR)/security/cacerts |
25859 | 209 |
|
210 |
$(CACERTS_DST): $(CACERTS_FILE) |
|
47253
92fd0e04e0e1
8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents:
47217
diff
changeset
|
211 |
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%, %, $@)) |
25859 | 212 |
$(call install-file) |
213 |
||
27565 | 214 |
TARGETS += $(CACERTS_DST) |
25859 | 215 |
|
216 |
################################################################################ |
|
217 |
||
35241 | 218 |
$(eval $(call SetupCopyFiles, COPY_NET_PROPERTIES, \ |
47217 | 219 |
FILES := $(TOPDIR)/src/java.base/share/conf/net.properties, \ |
35241 | 220 |
DEST := $(CONF_DST_DIR), \ |
221 |
)) |
|
25859 | 222 |
|
35241 | 223 |
TARGETS += $(COPY_NET_PROPERTIES) |
25859 | 224 |
|
225 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
35241 | 226 |
$(eval $(call SetupCopyFiles, COPY_SDP_CONF, \ |
47217 | 227 |
FILES := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \ |
35241 | 228 |
DEST := $(CONF_DST_DIR)/sdp, \ |
229 |
)) |
|
25859 | 230 |
|
35241 | 231 |
TARGETS += $(COPY_SDP_CONF) |
25859 | 232 |
endif |
233 |
||
234 |
################################################################################ |
|
42670
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
235 |
|
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
236 |
# JDK license and assembly exception files to be packaged in JMOD |
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
237 |
|
44264
8ff59e9e832c
8176849: jdk9 BCL builds fail after cleaning up temporary file ASSEMBLY_EXCEPTION
erikj
parents:
44117
diff
changeset
|
238 |
# The license files may not be present if the source has been obtained using a |
8ff59e9e832c
8176849: jdk9 BCL builds fail after cleaning up temporary file ASSEMBLY_EXCEPTION
erikj
parents:
44117
diff
changeset
|
239 |
# different license. |
8ff59e9e832c
8176849: jdk9 BCL builds fail after cleaning up temporary file ASSEMBLY_EXCEPTION
erikj
parents:
44117
diff
changeset
|
240 |
JDK_LICENSE ?= $(wildcard $(TOPDIR)/LICENSE) |
8ff59e9e832c
8176849: jdk9 BCL builds fail after cleaning up temporary file ASSEMBLY_EXCEPTION
erikj
parents:
44117
diff
changeset
|
241 |
JDK_NOTICE ?= $(wildcard $(TOPDIR)/ASSEMBLY_EXCEPTION) |
42670
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
242 |
|
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
243 |
$(eval $(call SetupCopyFiles, COPY_JDK_NOTICES, \ |
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
244 |
FILES := $(JDK_LICENSE) $(JDK_NOTICE), \ |
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
245 |
DEST := $(LEGAL_DST_DIR), \ |
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
246 |
FLATTEN := true, \ |
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
247 |
)) |
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
248 |
|
d833113eb7d7
8169925: Organize licenses by module in source, JMOD file, and run-time image
mchung
parents:
42230
diff
changeset
|
249 |
TARGETS += $(COPY_JDK_NOTICES) |