jdk/make/java/security/Makefile
changeset 20177 8ea486a4f36e
parent 14758 d6b75b5d550e
child 20774 330ea6efa3fd
--- a/jdk/make/java/security/Makefile	Wed Sep 18 14:10:24 2013 +0100
+++ b/jdk/make/java/security/Makefile	Wed Sep 18 21:37:45 2013 +0800
@@ -70,9 +70,13 @@
 CACERTS_SRC =	$(CACERTS_FILE)
 CACERTS_BUILD = $(LIBDIR)/security/cacerts
 
+BLACKLISTED_CERTS_SRC =	$(TOPDIR)/src/share/lib/security/blacklisted.certs
+BLACKLISTED_CERTS_BUILD = $(LIBDIR)/security/blacklisted.certs
+
 ifndef OPENJDK
   BLACKLIST_SRC =	$(CLOSED_SHARE_SRC)/lib/security/blacklist
   BLACKLIST_BUILD = $(LIBDIR)/security/blacklist
+  BLACKLISTED_CERTS_SRC +=	$(wildcard $(CLOSED_SHARE_SRC)/lib/security/blacklisted.certs)
   TRUSTEDLIBS_SRC = $(CLOSED_SHARE_SRC)/lib/security/trusted.libraries
   TRUSTEDLIBS_BUILD = $(LIBDIR)/security/trusted.libraries
 endif
@@ -85,9 +89,9 @@
 include $(BUILDDIR)/common/Rules.gmk
 
 ifdef OPENJDK
-build: properties policy cacerts
+build: properties policy cacerts blacklisted-certs
 else
-build: properties policy cacerts blacklist trustedlibs
+build: properties policy cacerts blacklist blacklisted-certs trustedlibs
 endif
 
 install: all
@@ -100,6 +104,8 @@
 
 blacklist: classes $(BLACKLIST_BUILD)
 
+blacklisted-certs: classes $(BLACKLISTED_CERTS_BUILD)
+
 trustedlibs: classes $(TRUSTEDLIBS_BUILD)
 
 $(PROPS_BUILD): $(PROPS_SRC)
@@ -114,12 +120,25 @@
 $(BLACKLIST_BUILD): $(BLACKLIST_SRC)
 	$(install-file)
 
+$(BLACKLISTED_CERTS_BUILD): $(BLACKLISTED_CERTS_SRC)
+	$(MKDIR) -p $(@D)
+	$(CAT) $^ | $(SED) '/^$$/d' | $(SORT) | $(UNIQ) > $@.tmp
+	$(GREP) -i Algorithm $@.tmp > $@
+	if [ `$(SED) -n -e "$$=" $@` != 1 ]; then \
+	   $(ECHO) "Different algorithms defined in $^"; \
+	   $(RM) $@ $@.tmp; \
+	   false; \
+	fi
+	$(GREP) -iv Algorithm $@.tmp >> $@
+	$(RM) $@.tmp
+
 $(TRUSTEDLIBS_BUILD): $(TRUSTEDLIBS_SRC)
 	$(install-file)
 
 clean clobber:: .delete.classlist
 	$(RM) -r $(CLASSBINDIR)/java/security
-	$(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD) $(BLACKLIST_BUILD) $(TRUSTEDLIBS_BUILD)
+	$(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD) $(BLACKLIST_BUILD) \
+	      $(BLACKLISTED_CERTS_BUILD) $(TRUSTEDLIBS_BUILD)
 
 # Additional Rule for building sun.security.util
 $(CLASSBINDIR)/%.class: $(SHARE_SRC)/sun/%.java