author | erikj |
Wed, 02 Nov 2016 10:43:48 +0100 | |
changeset 41833 | 9a8760507dcf |
parent 40401 | 47a0de15f8b6 |
child 42230 | 8b75662a3762 |
child 42753 | 40f61533b93d |
permissions | -rw-r--r-- |
25859 | 1 |
# |
37525 | 2 |
# Copyright (c) 2014, 2016, 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 |
||
28 |
$(eval $(call IncludeCustomExtension, jdk, copy/Copy-java.base.gmk)) |
|
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 |
||
26191
a0ff4b39d34b
8055188: General cleanup of minor issues from source restructure
erikj
parents:
25859
diff
changeset
|
41 |
$(INCLUDE_DST_DIR)/%.h: $(JDK_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: \ |
25859 | 45 |
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_EXPORT_DIR)/native/include/%.h |
46 |
$(call install-file) |
|
47 |
||
48 |
################################################################################ |
|
49 |
||
50 |
ifneq ($(findstring $(OPENJDK_TARGET_OS), windows aix),) |
|
51 |
||
52 |
TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/conf |
|
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) |
|
97 |
JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg |
|
98 |
else |
|
27736
8c9bd4be4a86
8058631: Rename posix to unix in build system to match file name changes
ihse
parents:
27286
diff
changeset
|
99 |
JVMCFG_SRC := $(JDK_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 |
27565 | 103 |
JVMCFG_DIR := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR) |
25859 | 104 |
JVMCFG := $(JVMCFG_DIR)/jvm.cfg |
105 |
||
106 |
# To do: should this also support -zeroshark? |
|
107 |
||
108 |
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) |
|
109 |
COPY_JVM_CFG_FILE := true |
|
110 |
else |
|
111 |
# On 32-bit machines we have three potential VMs: client, server and minimal. |
|
112 |
# Historically we usually have both client and server and so that is what the |
|
113 |
# committed jvm.cfg expects (including platform specific ergonomics switches |
|
114 |
# to decide whether to use client or server by default). So when we have anything |
|
115 |
# other than client and server we need to define a new jvm.cfg file. |
|
116 |
# The main problem is deciding whether to use aliases for the VMs that are not |
|
117 |
# present and the current position is that we add aliases for client and server, but |
|
118 |
# not for minimal. |
|
37525 | 119 |
CLIENT_AND_SERVER := $(call check-jvm-variant, client)+$(call check-jvm-variant, server) |
120 |
ifeq ($(CLIENT_AND_SERVER), true+true) |
|
25859 | 121 |
COPY_JVM_CFG_FILE := true |
122 |
else |
|
123 |
# For zero, the default jvm.cfg file is sufficient |
|
37525 | 124 |
ifeq ($(call check-jvm-variant, zero zeroshark), true) |
25859 | 125 |
COPY_JVM_CFG_FILE := true |
126 |
endif |
|
127 |
endif |
|
128 |
endif |
|
129 |
||
130 |
ifeq ($(COPY_JVM_CFG_FILE), true) |
|
131 |
$(JVMCFG): $(JVMCFG_SRC) |
|
132 |
$(call install-file) |
|
133 |
else |
|
134 |
$(JVMCFG): |
|
135 |
$(MKDIR) -p $(@D) |
|
136 |
$(RM) $(@) |
|
137 |
# Now check for other permutations |
|
37525 | 138 |
ifeq ($(call check-jvm-variant, server), true) |
25859 | 139 |
$(PRINTF) "-server KNOWN\n">>$(@) |
140 |
$(PRINTF) "-client ALIASED_TO -server\n">>$(@) |
|
37525 | 141 |
ifeq ($(call check-jvm-variant, minimal), true) |
25859 | 142 |
$(PRINTF) "-minimal KNOWN\n">>$(@) |
143 |
endif |
|
144 |
else |
|
37525 | 145 |
ifeq ($(call check-jvm-variant, client), true) |
25859 | 146 |
$(PRINTF) "-client KNOWN\n">>$(@) |
147 |
$(PRINTF) "-server ALIASED_TO -client\n">>$(@) |
|
37525 | 148 |
ifeq ($(call check-jvm-variant, minimal), true) |
25859 | 149 |
$(PRINTF) "-minimal KNOWN\n">>$(@) |
150 |
endif |
|
151 |
else |
|
37525 | 152 |
ifeq ($(call check-jvm-variant, minimal), true) |
25859 | 153 |
$(PRINTF) "-minimal KNOWN\n">>$(@) |
154 |
$(PRINTF) "-server ALIASED_TO -minimal\n">>$(@) |
|
155 |
$(PRINTF) "-client ALIASED_TO -minimal\n">>$(@) |
|
156 |
endif |
|
157 |
endif |
|
158 |
endif |
|
159 |
endif |
|
160 |
||
27565 | 161 |
TARGETS += $(JVMCFG) |
25859 | 162 |
|
163 |
################################################################################ |
|
164 |
||
165 |
POLICY_SRC := $(JDK_TOPDIR)/src/java.base/share/conf/security/java.policy |
|
27565 | 166 |
POLICY_DST := $(CONF_DST_DIR)/security/java.policy |
25859 | 167 |
|
39884
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
168 |
POLICY_SRC_LIST := $(POLICY_SRC) |
25859 | 169 |
|
170 |
$(POLICY_DST): $(POLICY_SRC_LIST) |
|
171 |
$(MKDIR) -p $(@D) |
|
172 |
$(RM) $@ $@.tmp |
|
173 |
$(foreach f,$(POLICY_SRC_LIST),$(CAT) $(f) >> $@.tmp;) |
|
174 |
$(MV) $@.tmp $@ |
|
175 |
||
27565 | 176 |
TARGETS += $(POLICY_DST) |
25859 | 177 |
|
178 |
################################################################################ |
|
179 |
||
39884
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
180 |
DEF_POLICY_SRC := $(JDK_TOPDIR)/src/java.base/share/lib/security/default.policy |
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
181 |
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
|
182 |
|
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
183 |
DEF_POLICY_SRC_LIST := $(DEF_POLICY_SRC) |
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), ) |
39884
9a543219d0bb
8159752: Grant de-privileged module permissions by default with java.security.policy override option
mullan
parents:
37525
diff
changeset
|
186 |
DEF_POLICY_SRC_LIST += $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/lib/security/default.policy |
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), ) |
40253
08809866c0bc
8162739: Create new keytool option to access cacerts file
weijun
parents:
39884
diff
changeset
|
205 |
CACERTS_FILE := $(JDK_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) |
|
35241 | 211 |
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@)) |
25859 | 212 |
$(call install-file) |
213 |
||
27565 | 214 |
TARGETS += $(CACERTS_DST) |
25859 | 215 |
|
216 |
################################################################################ |
|
217 |
||
35241 | 218 |
$(eval $(call SetupCopyFiles, COPY_NET_PROPERTIES, \ |
219 |
FILES := $(JDK_TOPDIR)/src/java.base/share/conf/net.properties, \ |
|
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, \ |
227 |
FILES := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \ |
|
228 |
DEST := $(CONF_DST_DIR)/sdp, \ |
|
229 |
)) |
|
25859 | 230 |
|
35241 | 231 |
TARGETS += $(COPY_SDP_CONF) |
25859 | 232 |
endif |
233 |
||
234 |
################################################################################ |