annotate make/CreateSecurityJars.gmk @ 8875:ed979f9b40cd

8022212: Intermittent test failures in java/net Reviewed-by: chegar
author tyan
date Thu, 21 Nov 2013 13:42:54 +0000
parents 348ffbd19feb
children 427c78c88229 d92379723173
rev   line source
erikj@5507 1 #
erikj@8498 2 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
erikj@5507 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
erikj@5507 4 #
erikj@5507 5 # This code is free software; you can redistribute it and/or modify it
erikj@5507 6 # under the terms of the GNU General Public License version 2 only, as
erikj@5507 7 # published by the Free Software Foundation. Oracle designates this
erikj@5507 8 # particular file as subject to the "Classpath" exception as provided
erikj@5507 9 # by Oracle in the LICENSE file that accompanied this code.
erikj@5507 10 #
erikj@5507 11 # This code is distributed in the hope that it will be useful, but WITHOUT
erikj@5507 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
erikj@5507 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
erikj@5507 14 # version 2 for more details (a copy is included in the LICENSE file that
erikj@5507 15 # accompanied this code).
erikj@5507 16 #
erikj@5507 17 # You should have received a copy of the GNU General Public License version
erikj@5507 18 # 2 along with this work; if not, write to the Free Software Foundation,
erikj@5507 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
erikj@5507 20 #
erikj@5507 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
erikj@5507 22 # or visit www.oracle.com if you need additional information or have any
erikj@5507 23 # questions.
erikj@5507 24 #
erikj@5507 25
erikj@8498 26 default: all
erikj@8498 27
erikj@5507 28 include $(SPEC)
erikj@5507 29 include MakeBase.gmk
erikj@5507 30 include JavaCompilation.gmk
erikj@5507 31 include Setup.gmk
erikj@5507 32
erikj@8498 33 # The jars created in this file are required for the exploded jdk image to function and
erikj@8498 34 # cannot wait to be built in the images target.
erikj@5507 35
erikj@5507 36 ##########################################################################################
erikj@6141 37 # Create manifest for security jars
erikj@6141 38 #
erikj@6141 39 # Include these extra attributes for now, should probably take out.
erikj@6141 40 #
ihse@8845 41 MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
erikj@8498 42 JCE_MANIFEST := $(JDK_OUTPUTDIR)/lib/_the.security.manifest.mf
erikj@8498 43
erikj@6141 44 $(JCE_MANIFEST): $(MAINMANIFEST)
erikj@6141 45 $(MKDIR) -p $(@D)
erikj@6141 46 $(RM) $@ $@.tmp
ihse@8330 47 $(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \
ihse@8330 48 -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
ihse@8330 49 $(MAINMANIFEST) >> $@.tmp
erikj@6141 50 $(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
erikj@6141 51 $(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
erikj@6141 52 $(MV) $@.tmp $@
erikj@6141 53
erikj@6141 54 ##########################################################################################
sla@7571 55 # For security and crypto jars, always build the jar, but for closed, install the prebuilt
sla@7571 56 # signed version instead of the newly built jar. Unsigned jars are treated as intermediate
sla@7571 57 # targets and explicitly added to the JARS list. For open, signing is not needed. See
erikj@7314 58 # SignJars.gmk for more information.
erikj@7314 59 #
erikj@7314 60 # The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
erikj@7314 61 # variable is set to no if these jars can't be built to skip that step of the build.
sla@7571 62 # Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
erikj@7314 63 # other way to get the jars than to build them.
erikj@5507 64
erikj@8498 65 SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
erikj@8498 66 SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunpkcs11.jar
erikj@6356 67
ihse@8330 68 $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
erikj@8498 69 SRCS := $(JDK_OUTPUTDIR)/classes_security, \
ihse@8330 70 SUFFIXES := .class, \
ihse@8330 71 INCLUDES := sun/security/pkcs11, \
ihse@8330 72 JAR := $(SUNPKCS11_JAR_UNSIGNED), \
ihse@8330 73 MANIFEST := $(JCE_MANIFEST), \
ihse@8330 74 SKIP_METAINF := true))
erikj@6356 75
erikj@6356 76 $(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
erikj@5507 77
ohair@5819 78 ifndef OPENJDK
ihse@8330 79 SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
ihse@8330 80 $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC)
ohair@6025 81 @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
erikj@6145 82 $(install-file)
ohair@5819 83 else
ihse@8330 84 $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
erikj@6356 85 $(install-file)
ohair@5819 86 endif
erikj@5507 87
erikj@8498 88 JARS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
erikj@5507 89
erikj@5507 90 ##########################################################################################
erikj@5507 91
erikj@8498 92 SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
erikj@8498 93 SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunec.jar
erikj@6356 94
ihse@8330 95 $(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
erikj@8498 96 SRCS := $(JDK_OUTPUTDIR)/classes_security, \
ihse@8330 97 SUFFIXES := .class, \
ihse@8330 98 INCLUDES := sun/security/ec, \
ihse@8330 99 JAR := $(SUNEC_JAR_UNSIGNED), \
ihse@8330 100 MANIFEST := $(JCE_MANIFEST), \
ihse@8330 101 SKIP_METAINF := true))
erikj@6356 102
erikj@6356 103 $(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
erikj@5507 104
erikj@5507 105 ifndef OPENJDK
ihse@8330 106 SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
ihse@8330 107 $(SUNEC_JAR_DST): $(SUNEC_JAR_SRC)
ohair@6025 108 @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
erikj@6145 109 $(install-file)
erikj@5507 110 else
ihse@8330 111 $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
erikj@6356 112 $(install-file)
erikj@5507 113 endif
erikj@5507 114
erikj@8498 115 JARS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
erikj@5507 116
erikj@5507 117 ##########################################################################################
erikj@5507 118
erikj@8498 119 SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
erikj@8498 120 SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunjce_provider.jar
erikj@6356 121
ihse@8330 122 ifneq ($(BUILD_CRYPTO), no)
ihse@8330 123 $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
erikj@8498 124 SRCS := $(JDK_OUTPUTDIR)/classes_security, \
ihse@8330 125 SUFFIXES := .class, \
ihse@8330 126 INCLUDES := com/sun/crypto/provider, \
ihse@8330 127 JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \
ihse@8330 128 MANIFEST := $(JCE_MANIFEST), \
ihse@8330 129 SKIP_METAINF := true))
erikj@6356 130
erikj@7314 131 $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
erikj@7314 132
erikj@7314 133 JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
erikj@7314 134 endif
erikj@5507 135
erikj@5507 136 ifndef OPENJDK
ihse@8330 137 SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
ihse@8330 138 $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC)
ohair@6025 139 @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
erikj@6145 140 $(install-file)
erikj@6356 141 else
ihse@8330 142 $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
erikj@6356 143 $(install-file)
erikj@6356 144 endif
erikj@6145 145
erikj@8498 146 JARS += $(SUNJCE_PROVIDER_JAR_DST)
erikj@8498 147
erikj@6356 148 ##########################################################################################
erikj@6356 149
erikj@8498 150 JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
erikj@8498 151 JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/jce.jar
erikj@6356 152
ihse@8330 153 ifneq ($(BUILD_CRYPTO), no)
ihse@8330 154 $(eval $(call SetupArchive,BUILD_JCE_JAR, , \
erikj@8498 155 SRCS := $(JDK_OUTPUTDIR)/classes_security, \
ihse@8330 156 SUFFIXES := .class, \
ihse@8330 157 INCLUDES := javax/crypto sun/security/internal, \
ihse@8330 158 JAR := $(JCE_JAR_UNSIGNED), \
ihse@8330 159 MANIFEST := $(JCE_MANIFEST), \
ihse@8330 160 SKIP_METAINF := true))
erikj@6141 161
erikj@7314 162 $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
erikj@7314 163
ihse@8330 164 JARS += $(JCE_JAR_UNSIGNED)
erikj@7314 165 endif
erikj@5507 166
erikj@5507 167 ifndef OPENJDK
erikj@7314 168 JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
ihse@8330 169 $(JCE_JAR_DST): $(JCE_JAR_SRC)
ohair@6025 170 @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
erikj@6145 171 $(install-file)
erikj@5507 172 else
ihse@8330 173 $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
erikj@6356 174 $(install-file)
erikj@5507 175 endif
erikj@5507 176
erikj@8498 177 JARS += $(JCE_JAR_DST)
erikj@8498 178
erikj@5507 179 ##########################################################################################
erikj@5507 180
erikj@8498 181 US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar
erikj@8498 182 US_EXPORT_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/US_export_policy.jar
erikj@6356 183
ihse@8330 184 ifneq ($(BUILD_CRYPTO), no)
erikj@7314 185 #
erikj@7314 186 # TODO fix so that SetupArchive does not write files into SRCS
ihse@8330 187 # then we don't need this extra copying
erikj@8498 188 #
ihse@8330 189 # NOTE: We currently do not place restrictions on our limited export
ihse@8330 190 # policy. This was not a typo.
erikj@7314 191 #
ihse@8845 192 US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
erikj@8498 193 US_EXPORT_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/US_export_policy_jar.tmp
erikj@7314 194
ihse@8330 195 $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
erikj@6356 196 $(install-file)
erikj@6356 197
erikj@7314 198 US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
erikj@6356 199
ihse@8330 200 $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \
ihse@8330 201 SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
ihse@8330 202 SUFFIXES := .policy, \
ihse@8330 203 JAR := $(US_EXPORT_POLICY_JAR_UNSIGNED), \
ihse@8330 204 EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
ihse@8330 205 SKIP_METAINF := true))
erikj@5507 206
erikj@7314 207 JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED)
erikj@7314 208 endif
erikj@7314 209
erikj@6145 210 ifndef OPENJDK
erikj@7314 211 $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
erikj@6145 212 $(ECHO) $(LOG_INFO) Copying $(@F)
erikj@6145 213 $(install-file)
erikj@6145 214 else
erikj@7314 215 $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED)
erikj@6145 216 $(install-file)
erikj@6145 217 endif
erikj@6145 218
erikj@8498 219 JARS += $(US_EXPORT_POLICY_JAR_DST)
erikj@8498 220
erikj@5507 221 ##########################################################################################
erikj@5507 222
erikj@8498 223 LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
erikj@8498 224 LOCAL_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/local_policy.jar
erikj@6356 225
ihse@8330 226 ifneq ($(BUILD_CRYPTO), no)
erikj@7314 227 #
erikj@7314 228 # TODO fix so that SetupArchive does not write files into SRCS
ihse@8330 229 # then we don't need this extra copying
erikj@7314 230 #
erikj@8498 231 LOCAL_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/local_policy_jar.tmp
erikj@6356 232
erikj@7314 233 ifeq ($(UNLIMITED_CRYPTO), true)
ihse@8845 234 LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
erikj@6356 235 LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
erikj@6356 236 LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
erikj@7314 237 else
ihse@8845 238 LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/limited
erikj@6356 239 LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
ihse@8330 240 $(LOCAL_POLICY_JAR_TMP)/default_local.policy
erikj@6356 241 LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
erikj@7314 242 endif
erikj@6356 243
ihse@8330 244 $(LOCAL_POLICY_JAR_TMP)/%: $(LOCAL_POLICY_JAR_SRC_DIR)/%
erikj@6356 245 $(install-file)
erikj@6356 246
ihse@8330 247 $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR, $(LOCAL_POLICY_JAR_DEPS), \
ihse@8330 248 SRCS := $(LOCAL_POLICY_JAR_TMP), \
ihse@8330 249 SUFFIXES := .policy, \
ihse@8330 250 JAR := $(LOCAL_POLICY_JAR_UNSIGNED), \
ihse@8330 251 EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
ihse@8330 252 SKIP_METAINF := true))
erikj@5507 253
erikj@7314 254 JARS += $(LOCAL_POLICY_JAR_UNSIGNED)
erikj@7314 255 endif
erikj@7314 256
erikj@6145 257 ifndef OPENJDK
erikj@7314 258 $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
erikj@6145 259 $(ECHO) $(LOG_INFO) Copying $(@F)
erikj@6145 260 $(install-file)
erikj@6028 261 else
erikj@7314 262 $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED)
erikj@6145 263 $(install-file)
erikj@6145 264 endif
erikj@6145 265
erikj@8498 266 JARS += $(LOCAL_POLICY_JAR_DST)
erikj@8498 267
erikj@5507 268 ##########################################################################################
erikj@5507 269
ihse@8330 270 ifeq ($(OPENJDK_TARGET_OS), windows)
erikj@5507 271
erikj@8498 272 SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
erikj@8498 273 SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunmscapi.jar
erikj@5507 274
ihse@8330 275 $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
erikj@8498 276 SRCS := $(JDK_OUTPUTDIR)/classes_security, \
ihse@8330 277 SUFFIXES := .class, \
ihse@8330 278 INCLUDES := sun/security/mscapi, \
ihse@8330 279 JAR := $(SUNMSCAPI_JAR_UNSIGNED), \
ihse@8330 280 MANIFEST := $(JCE_MANIFEST), \
ihse@8330 281 SKIP_METAINF := true))
erikj@6356 282
ihse@8330 283 $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
erikj@6365 284
ihse@8330 285 ifndef OPENJDK
erikj@6356 286 SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
ihse@8330 287 $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
erikj@6356 288 @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
erikj@6356 289 $(install-file)
ihse@8330 290 else
ihse@8330 291 $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
erikj@6356 292 $(install-file)
ihse@8330 293 endif
erikj@5507 294
erikj@8498 295 JARS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
erikj@5507 296
erikj@5507 297 endif
erikj@5507 298
erikj@5507 299 ##########################################################################################
erikj@5507 300
ihse@8330 301 ifeq ($(OPENJDK_TARGET_OS), solaris)
ihse@8330 302 ifndef OPENJDK
erikj@5507 303
erikj@8498 304 UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
erikj@8498 305 UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/ucrypto.jar
ihse@8330 306 UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
erikj@5507 307
ihse@8330 308 $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
erikj@8498 309 SRCS := $(JDK_OUTPUTDIR)/classes_security, \
ihse@8330 310 SUFFIXES := .class, \
ihse@8330 311 INCLUDES := com/oracle/security/ucrypto, \
ihse@8330 312 JAR := $(UCRYPTO_JAR_UNSIGNED), \
ihse@8330 313 MANIFEST := $(JCE_MANIFEST), \
ihse@8330 314 SKIP_METAINF := true))
erikj@6356 315
ihse@8330 316 $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
erikj@6356 317
ihse@8330 318 $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
ohair@6025 319 @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
erikj@6145 320 $(install-file)
erikj@5507 321
erikj@8498 322 JARS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
erikj@5507 323
ihse@8330 324 endif
erikj@5507 325 endif
erikj@5507 326
erikj@5507 327 all: $(JARS)
erikj@5507 328
erikj@5507 329 .PHONY: default all