--- old/jdk/makefiles/CompileJavaClasses.gmk 2013-08-16 09:23:12.810278634 +0200 +++ new/jdk/makefiles/CompileJavaClasses.gmk 2013-08-16 09:23:12.540232030 +0200 @@ -277,6 +277,17 @@ EXCLUDES+= com/apple/jobjc endif +# The security classes should not end up in the classes directory as that will prevent them +# from working when running the exploded jdk image. Compile them separately to a different +# directory from where the jars can be created. +SECURITY_PKGS := sun/security/pkcs11 \ + com/sun/crypto/provider \ + javax/crypto \ + sun/security/internal \ + sun/security/mscapi \ + com/oracle/security/ucrypto \ + sun/security/ec + # The exception handling of swing beaninfo # These resources violates the convention of having code and resources together under # $(JDK_TOPDIR)/src/.../classes directories @@ -289,6 +300,13 @@ # space separated list. JDK_USER_DEFINED_FILTER:=$(strip $(subst $(COMMA),$(SPACE),$(JDK_FILTER))) +ifeq ($(ENABLE_SJAVAC),yes) + # With sjavac enabled, excluded sources are not even considered for linking. + # Explicitly add the security sources to sourcepath for linking. + BUILD_JDK_SOURCEPATH:=$(patsubst %,-i$(SPACE)%.*,$(subst /,.,$(SECURITY_PKGS))) \ + -sourcepath $(JDK_TOPDIR)/src/share/classes +endif + $(eval $(call SetupJavaCompilation,BUILD_JDK,\ SETUP:=GENERATE_JDKBYTECODE,\ SRC:=$(JDK_TOPDIR)/src/share/classes \ @@ -298,13 +316,30 @@ $(JDK_OUTPUTDIR)/gensrc_no_srczip \ $(CLOSED_SRC_DIRS),\ INCLUDES:=$(JDK_USER_DEFINED_FILTER),\ - EXCLUDES:=$(EXCLUDES),\ + EXCLUDES:=$(EXCLUDES) $(SECURITY_PKGS),\ EXCLUDE_FILES:=$(EXFILES),\ BIN:=$(JDK_OUTPUTDIR)/classes,\ COPY:=$(COPY_PATTERNS),\ COPY_FILES:=$(COPY_FILES),\ + HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers,\ + ADD_JAVAC_FLAGS:=$(BUILD_JDK_SOURCEPATH))) + +########################################################################################## + +$(eval $(call SetupJavaCompilation,BUILD_SECURITY,\ + SETUP:=GENERATE_JDKBYTECODE,\ + SRC:=$(JDK_TOPDIR)/src/share/classes \ + $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \ + $(MACOSX_SRC_DIRS) \ + $(CLOSED_SRC_DIRS),\ + INCLUDES:=$(SECURITY_PKGS),\ + EXCLUDES:=$(EXCLUDES),\ + EXCLUDE_FILES:=$(EXFILES),\ + BIN:=$(JDK_OUTPUTDIR)/classes_security,\ HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers)) +$(BUILD_SECURITY): $(BUILD_JDK) + ########################################################################################## ifndef OPENJDK @@ -402,7 +437,8 @@ ########################################################################################## -all: $(BUILD_JDK) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \ +all: $(BUILD_JDK) $(BUILD_SECURITY) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) \ + $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \ $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \ $(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \ $(BUILD_ACCESSBRIDGE_LEGACY)