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