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 JavaCompilation.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 SetupArchive 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 SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \
  80     $(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 $(US_EXPORT_POLICY_JAR_LIMITED): \
  88     $(US_EXPORT_POLICY_JAR_UNLIMITED)
  89         $(ECHO) $(LOG_INFO) \
  90             Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
  91         $(install-file)
  92 
  93 TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED)
  94 
  95 ifeq ($(UNLIMITED_CRYPTO), true)
  96   $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED)
  97         $(install-file)
  98 else
  99   $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED)
 100         $(install-file)
 101 endif 
 102 
 103 ifndef OPENJDK
 104   ifneq ($(UNLIMITED_CRYPTO), true)
 105     $(UNLIMITED_POLICY_DIR)/US_export_policy.jar: \
 106         $(US_EXPORT_POLICY_JAR_UNLIMITED)
 107                 $(install-file)
 108     TARGETS += $(UNLIMITED_POLICY_DIR)/US_export_policy.jar
 109   endif
 110 endif
 111 
 112 POLICY_JARS += $(US_EXPORT_POLICY_JAR_DST)
 113 
 114 ################################################################################
 115 
 116 LOCAL_POLICY_JAR_DST := \
 117     $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/local_policy.jar
 118 
 119 LOCAL_POLICY_JAR_LIMITED := \
 120     $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy.jar
 121 LOCAL_POLICY_JAR_UNLIMITED := \
 122     $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar
 123 
 124 #
 125 # TODO fix so that SetupArchive does not write files into SRCS
 126 # then we don't need this extra copying
 127 #
 128 LOCAL_POLICY_JAR_LIMITED_TMP := \
 129     $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy_jar.tmp
 130 LOCAL_POLICY_JAR_UNLIMITED_TMP := \
 131     $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy_jar.tmp
 132 
 133 $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \
 134     $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
 135         $(install-file)
 136 
 137 $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \
 138     $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
 139         $(install-file)
 140 
 141 $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
 142     $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
 143     $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
 144     SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
 145     SUFFIXES := .policy, \
 146     JAR := $(LOCAL_POLICY_JAR_LIMITED), \
 147     EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
 148     SKIP_METAINF := true))
 149 
 150 $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
 151     $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
 152     SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
 153     SUFFIXES := .policy, \
 154     JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \
 155     EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
 156     SKIP_METAINF := true))
 157 
 158 TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED)
 159 
 160 ifndef OPENJDK
 161   ifneq ($(UNLIMITED_CRYPTO), true)
 162     $(UNLIMITED_POLICY_DIR)/README.txt: \
 163         $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt
 164                 $(install-file)
 165 
 166     TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt
 167   endif
 168 endif
 169 
 170 ifeq ($(UNLIMITED_CRYPTO), true)
 171   $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED)
 172         $(install-file)
 173 else 
 174   $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED)
 175         $(install-file)
 176 endif 
 177 
 178 ifndef OPENJDK
 179   ifneq ($(UNLIMITED_CRYPTO), true)
 180     $(UNLIMITED_POLICY_DIR)/local_policy.jar: \
 181         $(LOCAL_POLICY_JAR_UNLIMITED)
 182                 $(install-file) 
 183     TARGETS += $(UNLIMITED_POLICY_DIR)/local_policy.jar
 184   endif
 185 endif
 186 
 187 POLICY_JARS += $(LOCAL_POLICY_JAR_DST)
 188 TARGETS += $(POLICY_JARS)
 189 
 190 ################################################################################
 191