1 #
   2 # Copyright (c) 2015, 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 GensrcCommon.gmk
  27 
  28 ################################################################################
  29 # The following modules have their own versions of java.security.Provider:
  30 #    java.naming
  31 #    java.security.jgss
  32 #    java.security.sasl
  33 #    java.smartcardio
  34 #    java.xml.crypto
  35 #    jdk.crypto.ec
  36 #    jdk.crypto.pkcs11
  37 #    jdk.security.jgss
  38 #    jdk.crypto.mscapi (Windows only)
  39 #    jdk.crypto.ucrypto (Solaris only)
  40 #    jdk.deploy.osx (MacOS only)
  41 #
  42 # But ImageBuilder skips duplicate resources, so only the
  43 # java.naming one is kept.
  44 #
  45 # To enable all the providers, we need to assemble the
  46 # java.security.Provider from all of above modules and merge them
  47 # into the java.naming one
  48 
  49 define process-provider
  50         $(MKDIR) -p $(@D)
  51         $(CAT) $^ | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $@
  52 endef
  53 
  54 GENSRC_PROVIDER := $(SUPPORT_OUTPUTDIR)/gensrc/java.naming/META-INF/services/java.security.Provider
  55 
  56 # NOTE: providers in java.base aren't included here as they are instantiated directly
  57 # instead of being loaded by ServiceLoader
  58 
  59 UCRYPTO_PROVIDER_SRC := $(JDK_TOPDIR)/src/jdk.crypto.ucrypto/solaris/classes/META-INF/services/java.security.Provider
  60 SUNPKCS11_PROVIDER_SRC := $(JDK_TOPDIR)/src/jdk.crypto.pkcs11/share/classes/META-INF/services/java.security.Provider
  61 SUNEC_PROVIDER_SRC := $(JDK_TOPDIR)/src/jdk.crypto.ec/share/classes/META-INF/services/java.security.Provider
  62 SUNJGSS_PROVIDER_SRC := $(JDK_TOPDIR)/src/java.security.jgss/share/classes/META-INF/services/java.security.Provider
  63 SUNSASL_PROVIDER_SRC := $(JDK_TOPDIR)/src/java.security.sasl/share/classes/META-INF/services/java.security.Provider
  64 XMLDSIG_PROVIDER_SRC := $(JDK_TOPDIR)/src/java.xml.crypto/share/classes/META-INF/services/java.security.Provider
  65 SUNPCSC_PROVIDER_SRC := $(JDK_TOPDIR)/src/java.smartcardio/share/classes/META-INF/services/java.security.Provider
  66 SUNLDAP_PROVIDER_SRC := $(JDK_TOPDIR)/src/java.naming/share/classes/META-INF/services/java.security.Provider
  67 JDKSASL_PROVIDER_SRC := $(JDK_TOPDIR)/src/jdk.security.jgss/share/classes/META-INF/services/java.security.Provider
  68 MSCAPI_PROVIDER_SRC := $(JDK_TOPDIR)/src/jdk.crypto.mscapi/windows/classes/META-INF/services/java.security.Provider
  69 APPLE_PROVIDER_SRC := $(JDK_TOPDIR)/src/jdk.deploy.osx/macosx/classes/META-INF/services/java.security.Provider
  70 
  71 GENSRC_PROVIDER_OUT := $(JDK_OUTPUTDIR)/modules/java.naming/META-INF/services/java.security.Provider
  72 
  73 $(GENSRC_PROVIDER): $(SUNLDAP_PROVIDER_SRC) $(SUNJGSS_PROVIDER_SRC) $(SUNSASL_PROVIDER_SRC) \
  74     $(SUNPCSC_PROVIDER_SRC) $(XMLDSIG_PROVIDER_SRC) $(SUNEC_PROVIDER_SRC) \
  75     $(SUNPKCS11_PROVIDER_SRC) $(JDKSASL_PROVIDER_SRC) $(MSCAPI_PROVIDER_SRC) \
  76     $(UCRYPTO_PROVIDER_SRC) $(APPLE_PROVIDER_SRC)
  77         $(process-provider)
  78 
  79 $(GENSRC_PROVIDER_OUT): $(GENSRC_PROVIDER)
  80         $(install-file)
  81 
  82 ################################################################################
  83 
  84 java.naming: $(GENSRC_PROVIDER)
  85 
  86 all: java.naming
  87 
  88 .PHONY: all java.naming