1 # 2 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. 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 # 34 TARGETS += \ 35 $(INCLUDE_DST_DIR)/jni.h \ 36 $(INCLUDE_DST_DIR)/jvmticmlr.h \ 37 $(INCLUDE_DST_DIR)/classfile_constants.h \ 38 $(INCLUDE_DST_OS_DIR)/jni_md.h \ 39 # 40 41 $(INCLUDE_DST_DIR)/%.h: $(JDK_TOPDIR)/src/java.base/share/native/include/%.h 42 $(call install-file) 43 44 $(INCLUDE_DST_OS_DIR)/%.h: \ 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 54 $(LIB_DST_DIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings 55 $(call install-file) 56 57 TARGETS += $(LIB_DST_DIR)/tzmappings 58 59 endif 60 61 ################################################################################ 62 # Copy the microsoft runtime libraries on windows 63 ifeq ($(OPENJDK_TARGET_OS), windows) 64 65 # Chmod to avoid permission issues if bundles are unpacked on unix platforms. 66 define copy-and-chmod 67 $(install-file) 68 $(CHMOD) a+rx $@ 69 endef 70 71 # Use separate macro calls in case the source files are not in the same 72 # directory. 73 $(eval $(call SetupCopyFiles,COPY_MSVCR, \ 74 DEST := $(LIB_DST_DIR), \ 75 FILES := $(MSVCR_DLL), \ 76 MACRO := copy-and-chmod)) 77 78 $(eval $(call SetupCopyFiles,COPY_MSVCP, \ 79 DEST := $(LIB_DST_DIR), \ 80 FILES := $(MSVCP_DLL), \ 81 MACRO := copy-and-chmod)) 82 83 TARGETS += $(COPY_MSVCR) $(COPY_MSVCP) 84 endif 85 86 ################################################################################ 87 # 88 # How to install jvm.cfg. 89 # 90 ifeq ($(call check-jvm-variant, zero zeroshark), true) 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 99 JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/$(JVMCFG_ARCH)/jvm.cfg 100 # Allow override by ALT_JVMCFG_SRC if it exists 101 JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JVMCFG_SRC)) 102 endif 103 JVMCFG_DIR := $(LIB_DST_DIR)$(OPENJDK_TARGET_CPU_LIBDIR) 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. 119 CLIENT_AND_SERVER := $(call check-jvm-variant, client)+$(call check-jvm-variant, server) 120 ifeq ($(CLIENT_AND_SERVER), true+true) 121 COPY_JVM_CFG_FILE := true 122 else 123 # For zero, the default jvm.cfg file is sufficient 124 ifeq ($(call check-jvm-variant, zero zeroshark), true) 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 138 ifeq ($(call check-jvm-variant, server), true) 139 $(PRINTF) "-server KNOWN\n">>$(@) 140 $(PRINTF) "-client ALIASED_TO -server\n">>$(@) 141 ifeq ($(call check-jvm-variant, minimal), true) 142 $(PRINTF) "-minimal KNOWN\n">>$(@) 143 endif 144 else 145 ifeq ($(call check-jvm-variant, client), true) 146 $(PRINTF) "-client KNOWN\n">>$(@) 147 $(PRINTF) "-server ALIASED_TO -client\n">>$(@) 148 ifeq ($(call check-jvm-variant, minimal), true) 149 $(PRINTF) "-minimal KNOWN\n">>$(@) 150 endif 151 else 152 ifeq ($(call check-jvm-variant, minimal), true) 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 161 TARGETS += $(JVMCFG) 162 163 ################################################################################ 164 165 POLICY_SRC := $(JDK_TOPDIR)/src/java.base/share/conf/security/java.policy 166 POLICY_DST := $(CONF_DST_DIR)/security/java.policy 167 168 POLICY_SRC_LIST := $(POLICY_SRC) 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 176 TARGETS += $(POLICY_DST) 177 178 ################################################################################ 179 180 DEF_POLICY_SRC := $(JDK_TOPDIR)/src/java.base/share/lib/security/default.policy 181 DEF_POLICY_DST := $(LIB_DST_DIR)/security/default.policy 182 183 DEF_POLICY_SRC_LIST := $(DEF_POLICY_SRC) 184 DEF_POLICY_SRC_LIST += $(CUSTOM_POLICY_SRC_LIST) 185 186 ifneq ($(filter $(OPENJDK_TARGET_OS), windows solaris), ) 187 DEF_POLICY_SRC_LIST += $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/lib/security/default.policy 188 endif 189 190 # Allow imported modules to modify the java.policy 191 ifneq ($(IMPORT_MODULES_CONF), ) 192 DEF_POLICY_SRC_LIST += $(wildcard $(IMPORT_MODULES_CONF)/java.base/security/java.policy.extra) 193 endif 194 195 $(DEF_POLICY_DST): $(DEF_POLICY_SRC_LIST) 196 $(MKDIR) -p $(@D) 197 $(RM) $@ $@.tmp 198 $(foreach f,$(DEF_POLICY_SRC_LIST),$(CAT) $(f) >> $@.tmp;) 199 $(MV) $@.tmp $@ 200 201 TARGETS += $(DEF_POLICY_DST) 202 203 ################################################################################ 204 205 ifeq ($(CACERTS_FILE), ) 206 CACERTS_FILE := $(JDK_TOPDIR)/src/java.base/share/lib/security/cacerts 207 endif 208 209 CACERTS_DST := $(LIB_DST_DIR)/security/cacerts 210 211 $(CACERTS_DST): $(CACERTS_FILE) 212 $(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@)) 213 $(call install-file) 214 215 TARGETS += $(CACERTS_DST) 216 217 ################################################################################ 218 219 $(eval $(call SetupCopyFiles, COPY_NET_PROPERTIES, \ 220 FILES := $(JDK_TOPDIR)/src/java.base/share/conf/net.properties, \ 221 DEST := $(CONF_DST_DIR), \ 222 )) 223 224 TARGETS += $(COPY_NET_PROPERTIES) 225 226 ifeq ($(OPENJDK_TARGET_OS), solaris) 227 $(eval $(call SetupCopyFiles, COPY_SDP_CONF, \ 228 FILES := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \ 229 DEST := $(CONF_DST_DIR)/sdp, \ 230 )) 231 232 TARGETS += $(COPY_SDP_CONF) 233 endif 234 235 ################################################################################