1 #
   2 # Copyright (c) 2013, 2014, 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 default: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include JarArchive.gmk
  31 
  32 
  33 ################################################################################
  34 
  35 US_EXPORT_POLICY_JAR_DST := \
  36     $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/US_export_policy.jar
  37 
  38 US_EXPORT_POLICY_JAR_LIMITED := \
  39     $(SUPPORT_OUTPUTDIR)/jce/policy/limited/US_export_policy.jar
  40 US_EXPORT_POLICY_JAR_UNLIMITED := \
  41     $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy.jar
  42 
  43 ifndef OPENJDK
  44   #
  45   # In past releases, Oracle JDK has had a separately downloadable set of
  46   # policy files which has been a nightmare for deployment.
  47   #
  48   # Now if we're closed and limited (default for Oracle JDK), create
  49   # an "unlimited_policy" directory that contains the unlimited policy
  50   # files.  It will be up to the user/deployer to make an informed choice
  51   # as to whether they are legally entitled to use the unlimited policy
  52   # file in their environment.  Users/deployers simply need to overwrite
  53   # the files.  Consult README.txt (below) for more info.
  54   #
  55   UNLIMITED_POLICY_DIR := \
  56       $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/unlimited_policy
  57 endif
  58 
  59 #
  60 # TODO fix so that SetupJarArchive does not write files into SRCS
  61 # then we don't need this extra copying
  62 #
  63 # NOTE: We currently do not place restrictions on our limited export
  64 # policy. This was not a typo. This means we are shipping the same file
  65 # for both limited and unlimited US_export_policy.jar.  Only the local
  66 # policy file currently has restrictions.
  67 #
  68 US_EXPORT_POLICY_JAR_SRC_DIR := \
  69     $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
  70 US_EXPORT_POLICY_JAR_TMP := \
  71     $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy_jar.tmp
  72 
  73 $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
  74         $(install-file)
  75 
  76 US_EXPORT_POLICY_JAR_DEPS := \
  77     $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
  78 
  79 $(eval $(call SetupJarArchive, BUILD_US_EXPORT_POLICY_JAR, \
  80     DEPENDENCIES := $(US_EXPORT_POLICY_JAR_DEPS), \
  81     SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
  82     SUFFIXES := .policy, \
  83     JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \
  84     EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
  85     SKIP_METAINF := true, \
  86 ))
  87 
  88 $(US_EXPORT_POLICY_JAR_LIMITED): \
  89     $(US_EXPORT_POLICY_JAR_UNLIMITED)
  90         $(ECHO) $(LOG_INFO) \
  91             Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
  92         $(install-file)
  93 
  94 TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED)
  95 
  96 ifeq ($(UNLIMITED_CRYPTO), true)
  97   $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED)
  98         $(install-file)
  99 else
 100   $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED)
 101         $(install-file)
 102 endif 
 103 
 104 ifndef OPENJDK
 105   ifneq ($(UNLIMITED_CRYPTO), true)
 106     $(UNLIMITED_POLICY_DIR)/US_export_policy.jar: \
 107         $(US_EXPORT_POLICY_JAR_UNLIMITED)
 108                 $(install-file)
 109     TARGETS += $(UNLIMITED_POLICY_DIR)/US_export_policy.jar
 110   endif
 111 endif
 112 
 113 POLICY_JARS += $(US_EXPORT_POLICY_JAR_DST)
 114 
 115 ################################################################################
 116 
 117 LOCAL_POLICY_JAR_DST := \
 118     $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/local_policy.jar
 119 
 120 LOCAL_POLICY_JAR_LIMITED := \
 121     $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy.jar
 122 LOCAL_POLICY_JAR_UNLIMITED := \
 123     $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar
 124 
 125 #
 126 # TODO fix so that SetupJarArchive does not write files into SRCS
 127 # then we don't need this extra copying
 128 #
 129 LOCAL_POLICY_JAR_LIMITED_TMP := \
 130     $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy_jar.tmp
 131 LOCAL_POLICY_JAR_UNLIMITED_TMP := \
 132     $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy_jar.tmp
 133 
 134 $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \
 135     $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
 136         $(install-file)
 137 
 138 $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \
 139     $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
 140         $(install-file)
 141 
 142 $(eval $(call SetupJarArchive, BUILD_LOCAL_POLICY_JAR_LIMITED, \
 143     DEPENDENCIES := $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
 144         $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
 145     SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
 146     SUFFIXES := .policy, \
 147     JAR := $(LOCAL_POLICY_JAR_LIMITED), \
 148     EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
 149     SKIP_METAINF := true, \
 150 ))
 151 
 152 $(eval $(call SetupJarArchive, BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
 153     DEPENDENCIES := $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
 154     SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
 155     SUFFIXES := .policy, \
 156     JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \
 157     EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
 158     SKIP_METAINF := true, \
 159 ))
 160 
 161 TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED)
 162 
 163 ifndef OPENJDK
 164   ifneq ($(UNLIMITED_CRYPTO), true)
 165     $(UNLIMITED_POLICY_DIR)/README.txt: \
 166         $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt
 167                 $(install-file)
 168 
 169     TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt
 170   endif
 171 endif
 172 
 173 ifeq ($(UNLIMITED_CRYPTO), true)
 174   $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED)
 175         $(install-file)
 176 else 
 177   $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED)
 178         $(install-file)
 179 endif 
 180 
 181 ifndef OPENJDK
 182   ifneq ($(UNLIMITED_CRYPTO), true)
 183     $(UNLIMITED_POLICY_DIR)/local_policy.jar: \
 184         $(LOCAL_POLICY_JAR_UNLIMITED)
 185                 $(install-file) 
 186     TARGETS += $(UNLIMITED_POLICY_DIR)/local_policy.jar
 187   endif
 188 endif
 189 
 190 POLICY_JARS += $(LOCAL_POLICY_JAR_DST)
 191 TARGETS += $(POLICY_JARS)
 192 
 193 ################################################################################
 194