changeset 5509:b3246687c369 jdk8-b43

Merge
author katleman
date Wed, 13 Jun 2012 16:57:34 -0700
parents cd195e5d2c07 e00f450a3c5f
children db471a7af031
files makefiles/altclasses/Makefile makefiles/apple/Makefile makefiles/apple/applescript/Makefile makefiles/com/Makefile makefiles/com/apple/Makefile makefiles/com/apple/osx/Makefile makefiles/com/apple/osxui/Makefile makefiles/com/oracle/Makefile makefiles/com/oracle/jfr/Makefile makefiles/com/oracle/security/ucrypto/FILES_c.gmk makefiles/com/oracle/security/ucrypto/Makefile makefiles/com/oracle/security/ucrypto/mapfile-vers makefiles/com/sun/Makefile makefiles/common/shared/Defs-utils.gmk makefiles/java/fdlibm/FILES_c.gmk makefiles/java/fdlibm/Makefile makefiles/java/instrument/Makefile makefiles/java/instrument/mapfile-vers makefiles/java/java/Exportedfiles.gmk makefiles/java/java/FILES_c.gmk makefiles/java/java/FILES_java.gmk makefiles/java/java/Makefile makefiles/java/java/localelist.sh makefiles/java/java/mapfile-vers makefiles/java/java/reflect/Makefile makefiles/java/java/reorder-i586 makefiles/java/java/reorder-sparc makefiles/java/java/reorder-sparcv9 makefiles/java/java_crw_demo/Makefile makefiles/java/java_crw_demo/mapfile-vers makefiles/java/java_hprof_demo/Makefile makefiles/java/java_hprof_demo/mapfile-vers makefiles/java/jexec/Makefile makefiles/java/jli/Makefile makefiles/java/jli/mapfile-vers makefiles/java/jobjc/Makefile makefiles/java/jvm/Makefile makefiles/java/main/Makefile makefiles/java/main/java/Makefile makefiles/java/main/java/mapfile-amd64 makefiles/java/main/java/mapfile-i586 makefiles/java/main/java/mapfile-sparc makefiles/java/main/java/mapfile-sparcv9 makefiles/java/main/javaw/Makefile makefiles/java/management/Exportedfiles.gmk makefiles/java/management/FILES_c.gmk makefiles/java/management/Makefile makefiles/java/management/mapfile-vers makefiles/java/net/FILES_c.gmk makefiles/java/net/Makefile makefiles/java/net/mapfile-vers makefiles/java/nio/Exportedfiles.gmk makefiles/java/nio/FILES_c.gmk makefiles/java/nio/FILES_java.gmk makefiles/java/nio/Makefile makefiles/java/nio/addNotices.sh makefiles/java/nio/genBuffer.sh makefiles/java/nio/genCharsetProvider.sh makefiles/java/nio/genCoder.sh makefiles/java/nio/genExceptions.sh makefiles/java/nio/mapfile-bsd makefiles/java/nio/mapfile-linux makefiles/java/nio/mapfile-solaris makefiles/java/nio/reorder-i586 makefiles/java/nio/reorder-sparc makefiles/java/nio/reorder-sparcv9 makefiles/java/npt/Makefile makefiles/java/npt/mapfile-vers makefiles/java/redist/fonts/Makefile makefiles/java/security/Makefile makefiles/java/sun_nio/FILES_java.gmk makefiles/java/sun_nio/Makefile makefiles/java/util/FILES_java.gmk makefiles/java/util/FILES_properties.gmk makefiles/java/util/Makefile makefiles/java/verify/Makefile makefiles/java/verify/mapfile-vers makefiles/java/verify/reorder-i586 makefiles/java/verify/reorder-sparc makefiles/java/verify/reorder-sparcv9 makefiles/javax/Makefile makefiles/javax/imageio/Makefile makefiles/javax/management/Makefile makefiles/javax/sound/FILES_c.gmk makefiles/javax/sound/Makefile makefiles/javax/sound/SoundDefs.gmk makefiles/javax/sound/jsoundalsa/Makefile makefiles/javax/sound/jsoundalsa/mapfile-vers makefiles/javax/sound/jsoundds/Makefile makefiles/javax/sound/mapfile-vers makefiles/javax/sql/Makefile makefiles/javax/swing/FILES.gmk makefiles/javax/swing/Makefile makefiles/javax/swing/beaninfo/FILES.gmk makefiles/javax/swing/beaninfo/Makefile makefiles/javax/swing/beaninfo/SwingBeans.gmk makefiles/javax/swing/beaninfo/manifest makefiles/javax/swing/html32dtd/Makefile makefiles/javax/swing/plaf/FILES.gmk makefiles/javax/swing/plaf/Makefile makefiles/sun/Makefile makefiles/sun/awt/CondenseRules.awk makefiles/sun/awt/Depend.mak makefiles/sun/awt/Depend.sed makefiles/sun/awt/FILES_c_macosx.gmk makefiles/sun/awt/FILES_c_unix.gmk makefiles/sun/awt/FILES_c_windows.gmk makefiles/sun/awt/FILES_export_macosx.gmk makefiles/sun/awt/FILES_export_unix.gmk makefiles/sun/awt/FILES_export_windows.gmk makefiles/sun/awt/Makefile makefiles/sun/awt/README makefiles/sun/awt/make.depend makefiles/sun/awt/mapfile-mawt-vers makefiles/sun/awt/mapfile-vers makefiles/sun/awt/mapfile-vers-linux makefiles/sun/awt/mawt.gmk makefiles/sun/cmm/Makefile makefiles/sun/cmm/kcms/FILES_c_unix.gmk makefiles/sun/cmm/kcms/FILES_c_windows.gmk makefiles/sun/cmm/kcms/Makefile makefiles/sun/cmm/kcms/mapfile-vers makefiles/sun/dcpr/FILES_c.gmk makefiles/sun/dcpr/Makefile makefiles/sun/dcpr/mapfile-vers makefiles/sun/headless/Makefile makefiles/sun/headless/mapfile-vers makefiles/sun/headless/reorder-i586 makefiles/sun/headless/reorder-sparc makefiles/sun/headless/reorder-sparcv9 makefiles/sun/image/Makefile makefiles/sun/image/generic/FILES_c.gmk makefiles/sun/image/generic/Makefile makefiles/sun/image/generic/mapfile-vers makefiles/sun/image/vis/FILES_c.gmk makefiles/sun/image/vis/Makefile makefiles/sun/javazic/Makefile makefiles/sun/jdbc/Makefile makefiles/sun/jdga/Makefile makefiles/sun/jdga/mapfile-vers makefiles/sun/lwawt/FILES_c_macosx.gmk makefiles/sun/lwawt/FILES_export_macosx.gmk makefiles/sun/lwawt/Makefile makefiles/sun/nio/Makefile makefiles/sun/nio/cs/FILES_java.gmk makefiles/sun/nio/cs/Makefile makefiles/sun/org/Makefile makefiles/sun/org/mozilla/Makefile makefiles/sun/org/mozilla/javascript/Makefile makefiles/sun/osxapp/Makefile makefiles/sun/security/Makefile makefiles/sun/security/ec/FILES_c.gmk makefiles/sun/security/ec/mapfile-vers makefiles/sun/security/jgss/Makefile makefiles/sun/security/jgss/wrapper/FILES_c.gmk makefiles/sun/security/jgss/wrapper/Makefile makefiles/sun/security/jgss/wrapper/mapfile-vers makefiles/sun/security/krb5/FILES_c_windows.gmk makefiles/sun/security/krb5/Makefile makefiles/sun/security/mscapi/FILES_cpp.gmk makefiles/sun/security/mscapi/Makefile makefiles/sun/security/other/Makefile makefiles/sun/security/smartcardio/FILES_c.gmk makefiles/sun/security/smartcardio/Makefile makefiles/sun/security/smartcardio/mapfile-vers makefiles/sun/security/tools/Makefile makefiles/sun/security/util/Makefile makefiles/sun/splashscreen/FILES_c.gmk makefiles/sun/splashscreen/Makefile makefiles/sun/splashscreen/mapfile-vers makefiles/sun/xawt/FILES_c_unix.gmk makefiles/sun/xawt/FILES_export_unix.gmk makefiles/sun/xawt/Makefile makefiles/sun/xawt/mapfile-vers
diffstat 266 files changed, 11050 insertions(+), 19827 deletions(-) [+]
line wrap: on
line diff
--- a/makefiles/CompileDemos.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/CompileDemos.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -134,9 +134,9 @@
 			$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/,$7)))
     ifneq ($7,)
         $(JDK_OUTPUTDIR)/newdemo/$2/$1/% : $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
-		mkdir -p $$(@D)
-		cp $$< $$@
-		chmod -f ug+w $$@
+		$(MKDIR) -p $$(@D)
+		$(CP) $$< $$@
+		$(CHMOD) -f ug+w $$@
 
         BUILD_DEMOS += $$($1_COPY_TARGETS)
     endif
@@ -155,7 +155,7 @@
 		cd META-INF/services && \
 		$(JAR) uf $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
 	$(RM) -r $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.tmp
-	touch $@
+	$(TOUCH) $@
 
 BUILD_DEMOS+=$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.services
 
@@ -167,12 +167,12 @@
 $(eval $(call SetupDemo,SwingApplet,jfc,,SwingApplet,,,README* *.html))
 $(eval $(call SetupDemo,TableExample,jfc,,TableExample,,,README*))
 $(eval $(call SetupDemo,TransparentRuler,jfc,,transparentruler.Ruler,,,README*))
-$(eval $(call SetupDemo,jconsole-plugin,scripting,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,,,,*.xml *.txt))
+$(eval $(call SetupDemo,jconsole-plugin,scripting,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,,,,*.xml *.txt,,,,Main-Class: \n))
 $(eval $(call SetupDemo,FullThreadDump,management,,FullThreadDump,,,README*))
 $(eval $(call SetupDemo,JTop,management,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,JTop,,,README*))
 $(eval $(call SetupDemo,MemoryMonitor,management,,MemoryMonitor,,,README*))
 $(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*))
-$(eval $(call SetupDemo,zipfs,nio,,,,,README* *.java))
+$(eval $(call SetupDemo,zipfs,nio,,,,,README* *.java,,,,Main-Class: \n))
 
 ifndef OPENJDK
     $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
@@ -188,9 +188,9 @@
 			$(JDK_OUTPUTDIR)/newdemo/nbproject/%,\
 			$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/demo/nbproject/ -type f))
     $(JDK_OUTPUTDIR)/newdemo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
-		mkdir -p $(@D)
-		cp $< $@
-		chmod -f ug+w $@
+		$(MKDIR) -p $(@D)
+		$(CP) $< $@
+		$(CHMOD) -f ug+w $@
 endif
 
 ##################################################################################################
@@ -231,6 +231,7 @@
 		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
 		LANG:=$$(BUILD_DEMO_JVMTI_$1_LANG),\
 		CFLAGS:=$(CFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3,\
+		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3,\
 		LDFLAGS:=$(LDFLAGS_JDKLIB),\
 		LDFLAGS_SUFFIX:=$$($1_EXTRA_CXX),\
 		LDFLAGS_SUFFIX_posix:=$5,\
@@ -255,7 +256,7 @@
 		BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/jvmti/$1,\
 		COPY:=$(PATTERNS_TO_COPY),\
 		JAR:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar,\
-		JARMAIN:=,\
+		EXTRA_MANIFEST_ATTR:=Main-Class: \n,\
 		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf))
 
          BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar
@@ -290,11 +291,11 @@
 JPDA_FILES:=$(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))
 
 $(JDK_OUTPUTDIR)/newdemo/jpda/src.zip : $(JPDA_SOURCES)
-		mkdir -p $(@D)
+		$(MKDIR) -p $(@D)
 		(cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*")
 
 $(JDK_OUTPUTDIR)/newdemo/jpda/examples.jar : $(JPDA_SOURCES)
-		mkdir -p $(@D)
+		$(MKDIR) -p $(@D)
 		$(RM) $(@D)/_the.sources
 		$(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources)
 		$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
@@ -304,7 +305,7 @@
 		(cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README)
 
 $(JDK_OUTPUTDIR)/newdemo/jpda/com/sun/tools/example/README : $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
-		mkdir -p $(@D)
+		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
 
@@ -314,12 +315,12 @@
 ##################################################################################################
 
 $(JDK_OUTPUTDIR)/newdemo/management/index.html : $(JDK_TOPDIR)/src/share/demo/management/index.html
-		mkdir -p $(@D)
+		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
 
 $(JDK_OUTPUTDIR)/newdemo/jvmti/index.html : $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
-		mkdir -p $(@D)
+		$(MKDIR) -p $(@D)
 		$(CP) $< $@
 		$(CHMOD) -f ug+w $@
 
@@ -329,24 +330,102 @@
 ##################################################################################################
 
 # The netbeans project files are copied into the demo directory.
+BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%,\
+		$(JDK_OUTPUTDIR)/newdemo/nbproject/%,\
+		$(shell $(FIND) $(JDK_TOPDIR)/src/share/demo/nbproject/ -type f))
 
-NETBEANS_DEMO_PROJECTS_FILES=$(shell $(FIND) $(JDK_TOPDIR)/src/share/demo/nbproject -type f)
-
-$(JDK_OUTPUTDIR)/newdemo/_the.nbproject: $(NETBEANS_DEMO_PROJECTS_FILES)
-	$(MKDIR) -p $(JDK_OUTPUTDIR)/newdemo
-	$(RM) -rf $(JDK_OUTPUTDIR)/newdemo/nbproject
-	echo Copying Netbeans demo projects
-	(cd $(JDK_TOPDIR)/src/share/demo && cp -r nbproject $(JDK_OUTPUTDIR)/newdemo)
-	touch $@
+$(JDK_OUTPUTDIR)/newdemo/nbproject/% : $(JDK_TOPDIR)/src/share/demo/nbproject/%
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+	$(CHMOD) -f ug+w $@
 
 ##################################################################################################
 
-$(JDK_OUTPUTDIR)/newdemo/README : $(JDK_TOPDIR)/src/share/demo/README
-	mkdir -p $(@D)
-	cp $< $@
+$(JDK_OUTPUTDIR)/newdemo/README: $(JDK_TOPDIR)/src/share/demo/README
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/README
 
 ##################################################################################################
 
-all: $(BUILD_DEMOS) $(JDK_OUTPUTDIR)/newdemo/_the.nbproject $(JDK_OUTPUTDIR)/newdemo/README
+ifeq ($(PLATFORM), solaris)
+
+$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
+		$(MKDIR) -p $(@D)
+		$(CP) $< $@
+		$(CHMOD) -f ug+w $@
+
+$(JDK_OUTPUTDIR)/newdemo/jni/Poller/README.txt : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
+		$(MKDIR) -p $(@D)
+		$(CP) $< $@
+		$(CHMOD) -f ug+w $@
+
+$(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar : \
+  $(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/Poller.c
+
+$(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR,\
+		SETUP:=GENERATE_USINGJDKBYTECODE, \
+		SRC:=$(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
+		BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
+		HEADERS:=$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
+		JAR:=$(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar, \
+		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf, \
+		SRCZIP:=$(JDK_OUTPUTDIR)/newdemo/jni/Poller/src.zip, \
+		COPY := README.txt Poller.c, \
+		JARMAIN := Client))
+
+
+
+BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/newdemo/jni/Poller/src.zip \
+               $(JDK_OUTPUTDIR)/newdemo/jni/Poller/README.txt
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER,\
+		SRC:=$(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
+		LANG := C, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        -I$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB), \
+		BIN:=$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller,\
+		LIB:=$(JDK_OUTPUTDIR)/newdemoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)))
+
+#
+# We can only compile native code after jar has been build (since we depend on generated .h files)
+#
+$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller/Poller.o : $(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar
+
+$(JDK_OUTPUTDIR)/newdemo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) : \
+  $(JDK_OUTPUTDIR)/newdemoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
+
+endif
+
+##################################################################################################
+
+ifndef OPENJDK
+    DB_DEMO_ZIPFILE := $(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*demo*.zip")
+
+    $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
+	$(MKDIR) -p $(@D)
+	$(RM) -rf $(JDK_OUTPUTDIR)/newdemo/db $(JDK_OUTPUTDIR)/newdemo/demo
+	$(CD) $(JDK_OUTPUTDIR)/newdemo && $(UNZIP) -o $<
+	$(MV) $(JDK_OUTPUTDIR)/newdemo/demo $(JDK_OUTPUTDIR)/newdemo/db
+	$(TOUCH) $@
+
+#    Copy this after the unzip above to avoid race with directory creation and mv command.
+     $(JDK_OUTPUTDIR)/newdemo/db/README-JDK-DEMOS.html: \
+		$(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
+		| $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped
+	$(MKDIR) -p $(@D)
+	$(CP) '$<' '$@'
+     BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped $(JDK_OUTPUTDIR)/newdemo/db/README-JDK-DEMOS.html
+endif
+
+##################################################################################################
+
+all: $(BUILD_DEMOS)
 
 .PHONY: all
--- a/makefiles/CompileJavaClasses.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/CompileJavaClasses.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -32,36 +32,44 @@
 # Setup the java compilers for the JDK build.
 include Setup.gmk
 
-EXCLUDES:=	sun/dc \
-		sun/security/pkcs11 \
-		com/sun/pept \
+JARS :=
+EXFILES :=
+EXCLUDES :=
+
+##########################################################################################
+
+EXCLUDES +=	com/sun/pept \
 		com/sun/tools/example/trace\
 		com/sun/tools/example/debug/bdi\
 		com/sun/tools/example/debug/event\
 		com/sun/tools/example/debug/gui \
-		javax/crypto \
 		com/oracle/security
 
+ifeq ($(PLATFORM)-$(ARCH_DATA_MODEL),windows-64)
+     EXCLUDES += sun/security/pkcs11
+endif
+
 ifdef OPENJDK
-    EXCLUDES+=	com/sun/jmx/snmp \
+    EXCLUDES+=	sun/dc \
+		com/sun/jmx/snmp \
 		sun/management/snmp \
 		com/sun/script
 endif
 
+ifndef OPENJDK
+   # There exists two versions of this file...
+   EXFILES := $(JDK_TOPDIR)/src/share/classes/javax/crypto/JarVerifier.java
+endif
+
 ifneq ($(PLATFORM),solaris)
    # Exclude Solaris nio and two security related files in src/share/classes
-   EXFILES:=SolarisAclFileAttributeView.java \
+   EXFILES += SolarisAclFileAttributeView.java \
 	SolarisFileStore.java \
 	SolarisFileSystem.java \
 	SolarisFileSystemProvider.java \
 	SolarisNativeDispatcher.java \
 	SolarisUserDefinedFileAttributeView.java \
 	SolarisWatchService.java \
-	DevPollArrayWrapper.java \
-	DevPollSelectorImpl.java \
-	DevPollSelectorProvider.java \
-	SolarisAsynchronousChannelProvider.java \
-	SolarisEventPort.java \
 	SolarisAclFileAttributeView.java \
 	SolarisFileStore.java \
 	SolarisFileSystem.java \
@@ -75,8 +83,11 @@
 	sun/tools/attach/SolarisVirtualMachine.java
 endif
 
-# Why?
-EXFILES+=WrapperGenerator.java
+# In the old build, this isn't excluded on macosx, even though it probably
+# should be.
+ifneq ($(PLATFORM),macosx)
+	EXFILES+=WrapperGenerator.java
+endif
 
 ifneq ($(PLATFORM),windows)
     # Exclude Window security related files in src/share/classes
@@ -86,14 +97,20 @@
 endif
 
 ifeq ($(PLATFORM),windows)
-    # Does nio channels exist on Windows?
-    EXCLUDES+=sun/nio/ch
+    # Don't build GTK L&F on Windows
+    EXCLUDES+=	com/sun/java/swing/plaf/gtk
 endif
 
 ifneq ($(PLATFORM),linux)
-    EXCLUDES+=com/sun/java/swing/plaf/gtk
     EXFILES+=sun/tools/attach/LinuxAttachProvider.java \
-	sun/tools/attach/LinuxVirtualMachine.java
+	sun/tools/attach/LinuxVirtualMachine.java \
+	sun/nio/fs/LinuxDosFileAttributeView.java \
+	sun/nio/fs/LinuxFileStore.java \
+	sun/nio/fs/LinuxFileSystem.java \
+	sun/nio/fs/LinuxFileSystemProvider.java \
+	sun/nio/fs/LinuxNativeDispatcher.java \
+	sun/nio/fs/LinuxUserDefinedFileAttributeView.java \
+	sun/nio/fs/LinuxWatchService.java
 endif
 
 ifneq ($(PLATFORM),macosx)
@@ -105,19 +122,6 @@
              sun/tools/attach/BsdVirtualMachine.java
 endif
 
-# Generated nimbus files that apparently should not be compiled...
-EXFILES+=InternalFrameTitlePanePainter.java \
-	OptionPaneMessageAreaPainter.java \
-        ScrollBarPainter.java \
-	SliderPainter.java \
-	SpinnerPainter.java \
-	SplitPanePainter.java \
-	TabbedPanePainter.java
-
-# New class /java/lang/annotation/ContainerAnnotation.java is not included in old 
-# build
-EXFILES+=java/lang/annotation/ContainerAnnotation.java
-
 # Exclude BreakIterator classes that are just used in compile process to generate
 # data files and shouldn't go in the product
 EXFILES+=sun/text/resources/BreakIteratorRules.java \
@@ -130,16 +134,17 @@
 
 ifdef OPENJDK
     EXCLUDES+=sun/java2d/cmm/kcms
-else
-    EXCLUDES+=sun/java2d/cmm/lcms
 endif
 
-# Not used on windows
-ifneq ($(PLATFORM), windows)
+# Used on windows and macosx
+ifeq (,$(filter $(PLATFORM), windows macosx))
     EXFILES+=sun/awt/AWTCharset.java
 endif
 
-# Exclude some generated AWT files that were implicitly not included by the old build.
+ifneq ($(PLATFORM), macosx)
+#
+# Not in rt.jar on solaris and linux...(windows not checked)
+#     in rt.jar on macosx ??
 EXFILES+=sun/awt/X11/ScreenFormat.java \
          sun/awt/X11/XArc.java \
          sun/awt/X11/XChar2b.java \
@@ -182,19 +187,15 @@
          sun/awt/X11/XdbeSwapInfo.java \
          sun/awt/X11/XmbTextItem.java \
          sun/awt/X11/XwcTextItem.java
-
-# Exclude sun/security files that should go in a separate jar
-EXFILES+=sun/security/ec/ECDHKeyAgreement.java \
-         sun/security/ec/ECDSASignature.java \
-         sun/security/ec/ECKeyPairGenerator.java \
-         sun/security/ec/SunEC$1.java \
-         sun/security/ec/SunEC.java \
-         sun/security/ec/SunECEntries.java
+endif
 
 # Exclude another implicitly not included file.
 EXFILES+=sun/util/locale/AsciiUtil.java
 
-ifeq ($(PLATFORM), linux)
+ifeq (,$(filter $(PLATFORM), solaris macosx))
+#
+# only solaris and macosx
+#
     EXFILES+=sun/nio/fs/PollingWatchService.java
 endif
 
@@ -205,11 +206,42 @@
 
 # TODO: Is this necessary?
 ifeq ($(PLATFORM), windows)
+    EXFILES+=sun/nio/ch/AbstractPollSelectorImpl.java \
+	sun/nio/ch/DevPollArrayWrapper.java \
+	sun/nio/ch/DevPollSelectorImpl.java \
+        sun/nio/ch/DevPollSelectorProvider.java \
+	sun/nio/ch/InheritedChannel.java \
+        sun/nio/ch/PollSelectorProvider.java \
+        sun/nio/ch/PollSelectorImpl.java \
+	sun/nio/ch/Port.java \
+	sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \
+	sun/nio/ch/SolarisAsynchronousChannelProvider.java \
+	sun/nio/ch/SolarisEventPort.java \
+	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
+	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
     EXFILES+=sun/net/sdp/SdpProvider.java
 else
     EXFILES+=sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java
 endif
 
+ifdef DISABLE_NIMBUS
+    # TODO: need to check when it happens
+    # Exclude nimus if disabled
+    EXCLUDES+=	javax/swing/plaf/nimbus \
+		com/sun/java/swing/plaf/nimbus
+else
+#
+# These are never put into rt.jar
+#
+EXFILES+=  javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
+           javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
+           javax/swing/plaf/nimbus/ScrollBarPainter.java \
+           javax/swing/plaf/nimbus/SliderPainter.java \
+           javax/swing/plaf/nimbus/SpinnerPainter.java \
+           javax/swing/plaf/nimbus/SplitPanePainter.java \
+           javax/swing/plaf/nimbus/TabbedPanePainter.java
+endif
+
 # Acquire a list of files that should be copied straight over to the classes.
 include CopyIntoClasses.gmk
 # Now we have COPY_PATTERNS, COPY_FILES and COPY_EXTRA
@@ -219,25 +251,105 @@
 		     $(JDK_TOPDIR)/src/closed/$(LEGACY_HOST_OS_API)/classes
 endif
 
+MACOSX_SRC_DIRS :=
+ifeq ($(PLATFORM),macosx)
+     MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/classes
+
+     # this files are duplicated in MACOSX_SRC_DIRS
+     EXFILES+= $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java \
+               $(JDK_TOPDIR)/src/solaris/classes/sun/java2d/BackBufferCapsProvider.java \
+               $(JDK_TOPDIR)/src/solaris/classes/java/net/DefaultInterface.java \
+	       $(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java
+endif
+
+# The exception handling of swing beaninfo
+# These resources violates the convention of having code and resources together under
+# $(JDK_TOPDIR)/src/.../classes directories
+$(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo/images/%.gif
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
 $(eval $(call SetupJavaCompilation,BUILD_JDK,\
                 SETUP:=GENERATE_JDKBYTECODE,\
 		SRC:=$(JDK_TOPDIR)/src/share/classes \
 		     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes \
+		     $(MACOSX_SRC_DIRS) \
 		     $(JDK_OUTPUTDIR)/gensrc \
+		     $(JDK_OUTPUTDIR)/gensrc_swing/javax/swing/beaninfo \
 		     $(CLOSED_SRC_DIRS),\
 		EXCLUDES:=$(EXCLUDES),\
 		EXCLUDE_FILES:=$(EXFILES),\
-		BIN:=$(JDK_OUTPUTDIR)/newclasses,\
+		BIN:=$(JDK_OUTPUTDIR)/classes,\
 		COPY:=$(COPY_PATTERNS),\
 		COPY_FILES:=$(COPY_FILES),\
-		JAR:=$(JDK_OUTPUTDIR)/newrt.jar,\
 		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers))
 
+##########################################################################################
+# Special handling of header file generation for classes in the jigsaw base module which
+# currently can't add the annotaion GenerateNativeHeaders. For these specific classes the
+# java file and the class have the same names which enables shortcutting the dependencies.
+
+JDK_BASE_HEADER_CLASSES:=java.lang.Integer \
+			 java.lang.Long \
+			 java.net.SocketOptions \
+			 sun.nio.ch.IOStatus
+
+JDK_BASE_HEADER_JAVA_FILES:=$(patsubst %,$(JDK_TOPDIR)/src/share/classes/%.java,\
+				$(subst .,/,$(JDK_BASE_HEADER_CLASSES)))
+
+ifeq ($(PLATFORM),windows)
+    JDK_BASE_HEADER_CLASSES_WINDOWS:=sun.nio.ch.PollArrayWrapper
+    JDK_BASE_HEADER_CLASSES+=$(JDK_BASE_HEADER_CLASSES_WINDOWS)
+    JDK_BASE_HEADER_JAVA_FILES+=$(patsubst %,$(JDK_TOPDIR)/src/windows/classes/%.java,\
+				$(subst .,/,$(JDK_BASE_HEADER_CLASSES_WINDOWS)))
+endif
+
+# Set prereqs to the java files since make doesn't know about the class files. Add BUILD_JDK
+# as an order only dependency to avoid race with the java compilation.
+$(JDK_OUTPUTDIR)/classes/_the.jdk.base.headers: $(JDK_BASE_HEADER_JAVA_FILES) | $(BUILD_JDK)
+	$(ECHO) Generating headers for jdk base classes
+	$(JAVAH) -bootclasspath $(JDK_OUTPUTDIR)/classes -d $(JDK_OUTPUTDIR)/gensrc_headers \
+		$(JDK_BASE_HEADER_CLASSES)
+	$(TOUCH) $@
+
+##########################################################################################
+
+#
+# This is an empty jar (only contains manifest) and fits poorly into framework...
+#   create simple rule instead
+#
+MANAGEMENT_AGENT_JAR_DEPS := $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
+
+$(JDK_OUTPUTDIR)/lib/management-agent.jar : $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
+	$(JAR) cfm $@ $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
+
+JARS += $(JDK_OUTPUTDIR)/lib/management-agent.jar
+
+##########################################################################################
+
+ifndef OPENJDK
+
+$(eval $(call SetupJavaCompilation,BUILD_ALTCLASSES_JAR,\
+		SETUP:=GENERATE_JDKBYTECODE,\
+		SRC:=$(JDK_TOPDIR)/src/closed/share/altclasses, \
+		BIN:=$(JDK_OUTPUTDIR)/altclasses_classes,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/alt-rt.jar))
+
+$(BUILD_ALTCLASSES_JAR): $(BUILD_JDK)
+JARS += $(JDK_OUTPUTDIR)/lib/alt-rt.jar
+
+endif
+
+##########################################################################################
+
+$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
+	$(MKDIR) -p $(@D)
+	$(TOUCH) $@
+
+##########################################################################################
+
 # copy with -a to preserve timestamps so dependencies down the line aren't messed up
-all: $(BUILD_JDK) $(JDK_OUTPUTDIR)/newrt.jar $(COPY_EXTRA)
-	(cd $(JDK_OUTPUTDIR); \
-		$(CP) -rp newclasses/* classes; \
-		$(FIND) classes -name "_the.*" $(FIND_DELETE); \
-		$(TOUCH) $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin)
+all: $(BUILD_JDK) $(JARS) $(COPY_EXTRA) $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
+	$(JDK_OUTPUTDIR)/classes/_the.jdk.base.headers
 
 .PHONY: all
--- a/makefiles/CompileLaunchers.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/CompileLaunchers.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -41,6 +41,16 @@
     # Parameter 3 are extra LDFLAGS
     # Parameter 4 are extra LDFLAGS_SUFFIX_posix
     # Parameter 5 are extra LDFLAGS_SUFFIX_winapi
+
+    $1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/jli.lib
+    ifneq ($6,)
+        $1_WINDOWS_JLI_LIB:=$6
+    endif
+    $1_VERSION_INFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc
+    ifneq ($8,)
+        $1_VERSION_INFO_RESOURCE:=$8
+    endif
+
     $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
 	SRC:=$(JDK_TOPDIR)/src/share/bin,\
 	INCLUDE_FILES:=main.c,\
@@ -61,19 +71,22 @@
                  $(call SET_SHARED_LIBRARY_ORIGIN,../lib/$(LIBARCH)/jli) \
                  $(call SET_SHARED_LIBRARY_ORIGIN,../jre/lib/$(LIBARCH)/jli) \
 		 $3,\
-        LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/launchers/mapfile-$(ARCH)),\
+	MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(ARCH), \
         LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX),\
 	LDFLAGS_SUFFIX_posix:=$4 -lc,\
-	LDFLAGS_SUFFIX_winapi:=$5,\
-	BIN:=$(JDK_OUTPUTDIR)/newobjs/$1_objs,\
-	EXE:=$(JDK_OUTPUTDIR)/newobjs/$1$(EXE_SUFFIX),\
-	VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
+	LDFLAGS_SUFFIX_winapi:=$$($1_WINDOWS_JLI_LIB) \
+			       $(JDK_OUTPUTDIR)/objs/java.lib advapi32.lib $5,\
+	BIN:=$(JDK_OUTPUTDIR)/objs/$1_objs,\
+	EXE:=$(JDK_OUTPUTDIR)/objs/$1$(EXE_SUFFIX),\
+	VERSIONINFO_RESOURCE:=$$($1_VERSION_INFO_RESOURCE),\
 	RC_FLAGS:=$(RC_FLAGS)\
 		  /D "JDK_FNAME=$1$(EXE_SUFFIX)" \
 		  /D "JDK_INTERNAL_NAME=$1" \
-		  /D "JDK_FTYPE=0x1L")
+		  /D "JDK_FTYPE=0x1L" \
+		  $7,\
+	MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest)
 
-    BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/newobjs/$1$(EXE_SUFFIX) $(JDK_OUTPUTDIR)/bin/$1$(EXE_SUFFIX)
+    BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/$1$(EXE_SUFFIX)
 endef
 
 ##########################################################################################
@@ -84,8 +97,23 @@
     XLIBS:=
 endif
 
+ifdef OPENJDK
+    JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/windows/resource/icons"
+else
+    JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
+endif
+
 $(eval $(call SetupLauncher,java,\
-    -DEXPAND_CLASSPATH_WILDCARDS))
+    -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
+    $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
+    $(JDK_TOPDIR)/src/windows/resource/java.rc))
+
+ifeq ($(HOST_OS),windows)
+    $(eval $(call SetupLauncher,javaw,\
+        -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
+        $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
+        $(JDK_TOPDIR)/src/windows/resource/java.rc))
+endif
 
 ifeq ($(PLATFORM),solaris)
     THREAD_LIB:=-lthread
@@ -257,58 +285,111 @@
 ##########################################################################################
 # The order of the object files on the link command line affects the size of the resulting
 # binary (at least on linux) which causes the size to differ between old and new build.
-UNPACKEXE_ZIPOBJS = 	$(JDK_OUTPUTDIR)/newobjs/libzip/zcrc32$(OBJ_SUFFIX) \
-		     	$(JDK_OUTPUTDIR)/newobjs/libzip/deflate$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/trees$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/zadler32$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/compress$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/zutil$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/inflate$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/infback$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/inftrees$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/inffast$(OBJ_SUFFIX)
+ifeq ($(USE_EXTERNAL_LIBZ), true)
+UNPACKEXE_ZIPOBJS := -lz
+else
+UNPACKEXE_ZIPOBJS := 	$(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
+		     	$(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
+
+
+$(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX): $(UNPACKEXE_ZIPOBJS)
+
+endif
 
 $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
 		EXCLUDE_FILES:=jni.cpp,\
-		LANG:=C++,\
+		LANG:=C,\
 		CFLAGS:=$(CXXFLAGS_JDKEXE) $(CXX_O_FLAG_NORM) \
 			 -DFULL \
 			 -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5,\
 		CFLAGS_release:=-DPRODUCT,\
 		CFLAGS_linux:=-fPIC,\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200, \
 		LDFLAGS:=$(LDFLAGS_JDKEXE) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libunpack/mapfile-vers-unpack200) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN), \
 		LDFLAGS_SUFFIX:=$(UNPACKEXE_ZIPOBJS) $(LIBCXX),\
 		LDFLAGS_SUFFIX_solaris:=-lc,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/unpackexe,\
-		EXE:=$(JDK_OUTPUTDIR)/newobjs/unpack200$(EXE_SUFFIX),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/unpackexe,\
+		EXE:=$(JDK_OUTPUTDIR)/objs/unpack200$(EXE_SUFFIX),\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  /D "JDK_FNAME=unpack200.exe" \
 			  /D "JDK_INTERNAL_NAME=unpack200" \
-			  /D "JDK_FTYPE=0x1L"))
+			  /D "JDK_FTYPE=0x1L",\
+		MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
 
-$(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX): $(UNPACKEXE_ZIPOBJS)
+BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
 
-ifeq ($(HOST_OS_API),winapi)
-    UNPACK_MANIFEST:=$(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest
-    IMVERSIONVALUE=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
-    SED_ALL_MANIFEST=$(SED) -e 's%IMVERSION%$(IMVERSIONVALUE)%g'
+##########################################################################################
 
-    $(UNPACK_MANIFEST): $(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest
-	$(CAT) $< | $(SED_ALL_MANIFEST) > $@
 
-    # Adding a dependency to spec file might be a good idea here, to force rerun on version change.
-    $(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest.mt: $(UNPACK_MANIFEST)
-	$(MT) /manifest $< /outputresource:$(JDK_OUTPUTDIR)/newobjs/unpack200$(EXE_SUFFIX);#1
-	touch $@
+BUILD_JEXEC := 
+BUILD_JEXEC_SRC :=
+BUILD_JEXEC_INC :=
+BUILD_JEXEC_DST := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/jexec$(EXE_SUFFIX)
 
-    $(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest.mt: $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
+#
+# UNHANDLED:
+# - COMPILE_APPROACH = normal
+#
+
+#
+# jdk/make/java/Makefile
+#
+ifeq ($(PLATFORM), solaris)
+	ifeq ($(ARCH_DATA_MODEL), 32)
+		BUILD_JEXEC := 1
+	endif
 endif
 
-BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
+ifeq ($(PLATFORM), linux)
+	BUILD_JEXEC := 1
+endif # PLATFORM
+
+#
+# jdk/make/java/jexec/Makefile
+#
+ifeq ($(BUILD_JEXEC), 1)
+
+	ifeq ($(PLATFORM),windows)
+	else ifeq ($(PLATFORM),macosx)
+		BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/macosx/bin
+	else
+		BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/solaris/bin
+	endif
+
+	ifeq ($(PLATFORM), linux)
+		BUILD_JEXEC_DST := $(JDK_OUTPUTDIR)/lib/jexec$(EXE_SUFFIX)
+		BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/share/bin
+	endif
+endif
+
+#
+# Note that the two Makefile's seems to contradict each other,
+#   and that src/macosx/bin/jexec.c seems unused
+#
+ifneq ($(BUILD_JEXEC_SRC),)
+        $(eval $(call SetupNativeCompilation,BUILD_JEXEC,\
+		SRC:=$(BUILD_JEXEC_SRC),\
+		INCLUDE_FILES:=jexec.c,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKEXE) $(C_O_FLAG_NORM) \
+                        $(BUILD_JEXEC_INC), \
+		LDFLAGS:=$(LDFLAGS_JDKEXE), \
+		BIN:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
+		EXE:=$(BUILD_JEXEC_DST)))
+
+	BUILD_LAUNCHERS += $(BUILD_JEXEC_DST)
+endif
 
 ##########################################################################################
 
@@ -335,22 +416,25 @@
 ifeq ($(HOST_OS_API),winapi)
     $(eval $(call SetupLauncher,java-rmi,\
         -DEXPAND_CLASSPATH_WILDCARDS,\
-        $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/java/main/java/mapfile-$(ARCH))))
+        $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(ARCH))))
 
-    $(JAVA_RMI_CGI): $(JDK_OUTPUTDIR)/newobjs/java-rmi$(EXE_SUFFIX)
+    $(JAVA_RMI_CGI): $(JDK_OUTPUTDIR)/objs/java-rmi$(EXE_SUFFIX)
+	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
     BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
 else
     $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
+	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 	$(CHMOD) a+x $@
 endif
 
 ##########################################################################################
 
-$(JDK_OUTPUTDIR)/bin/% : $(JDK_OUTPUTDIR)/newobjs/%
-	echo Copying $(@F)
+$(JDK_OUTPUTDIR)/bin/% : $(JDK_OUTPUTDIR)/objs/%
+	$(ECHO) Copying $(@F)
+	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
 $(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
--- a/makefiles/CompileNativeLibraries.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/CompileNativeLibraries.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -52,8 +52,8 @@
     INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/bin
 endif
 
-$(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX) : $(JDK_OUTPUTDIR)/newobjs/%$(SHARED_LIBRARY_SUFFIX)
-	echo Copying $(@F)
+$(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX) : $(JDK_OUTPUTDIR)/objs/%$(SHARED_LIBRARY_SUFFIX)
+	$(ECHO) Copying $(@F)
 	$(CP) $< $@
 
 BUILD_LIBRARIES=
@@ -70,28 +70,64 @@
 
 ##########################################################################################
 
+BUILD_LIBZIP_FILES := \
+        CRC32.c \
+	Adler32.c \
+	Deflater.c \
+	Inflater.c \
+	ZipFile.c \
+	zip_util.c
+
+ifeq ($(USE_EXTERNAL_LIBZ),true)
+	LIBZ := -lz
+else
+BUILD_LIBZIP_FILES += \
+	compress.c \
+	deflate.c \
+	gzclose.c \
+	gzlib.c \
+	gzread.c \
+	gzwrite.c \
+	infback.c \
+	inffast.c \
+	inflate.c \
+	inftrees.c \
+	trees.c \
+	uncompr.c \
+	zadler32.c \
+	zcrc32.c \
+	zutil.c
+	LIBZ_INCLUDE := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
+endif
+
 $(eval $(call SetupNativeCompilation,BUILD_LIBZIP,\
-                SRC:=$(JDK_TOPDIR)/src/share/native/java/util/zip,\
+                SRC:=$(JDK_TOPDIR)/src/share/native/java/util/zip \
+                     $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5,\
+		INCLUDE_FILES := $(BUILD_LIBZIP_FILES), \
 		LANG:=C,\
 		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
-                        -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 \
+                        $(LIBZ_INCLUDE) \
 		        -I$(JDK_TOPDIR)/src/share/native/java/io \
                         -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/io,\
-		CFLAGS_posix:=-DUSE_MMAP,\
+		CFLAGS_posix:=-DUSE_MMAP -UDEBUG,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(EXPORT_ZIP_FUNCS) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libzip/mapfile-vers),\
+			 $(EXPORT_ZIP_FUNCS), \
 		LDFLAGS_winapi:=-export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
-                                -export:ZIP_ReadEntry -export:ZIP_GetNextEntry,\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libzip,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX)))
+                                -export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \
+                                java.lib,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBZ),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libzip,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
 
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX)
 
 ##########################################################################################
 
-LIBUNPACK_LIB_FILE := $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)
+LIBUNPACK_LIB_FILE := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK,\
                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
@@ -100,13 +136,14 @@
 		CFLAGS:=$(CXXFLAGS_JDKLIB) $(CXX_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
 			 -DNO_ZLIB -DUNPACK_JNI -DFULL,\
 		CFLAGS_release:=-DPRODUCT,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB)\
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libunpack/mapfile-vers) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_winapi:=-map:$(JDK_OUTPUTDIR)/newobjs/unpack.map /debug,\
+		LDFLAGS_winapi:=-map:$(JDK_OUTPUTDIR)/objs/unpack.map /debug \
+				jvm.lib java.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
 		LDFLAGS_SUFFIX_posix:=$(LIBCXX),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libunpack,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libunpack,\
 		LIB:=$(LIBUNPACK_LIB_FILE),\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
@@ -114,46 +151,60 @@
 			  /D "JDK_INTERNAL_NAME=unpack" \
 			  /D "JDK_FTYPE=0x2L"))
 
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)
 
 ifeq ($(HOST_OS_API),winapi)
     $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(LIBUNPACK_LIB_FILE)
-	echo Copying $(@F)
+	$(ECHO) Copying $(@F)
 	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.map,$<) $@
 
     $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(LIBUNPACK_LIB_FILE)
-	echo Copying $(@F)
+	$(ECHO) Copying $(@F)
 	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.pdb,$<) $@
 endif
 
 ##########################################################################################
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY,\
-                SRC:=$(JDK_TOPDIR)/src/share/native/common,\
-		EXCLUDE_FILES:=check_version.c jdk_util.c jio.c jni_util.c verify_stub.c,\
-		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) ${C_O_FLAG_HI} $(SHARED_LIBRARY_FLAGS), \
-		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libverify/mapfile-vers),\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libverify,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX)))
-
-BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX)
-
-##########################################################################################
-
+BUILD_LIBFDLIBM_OPTIMIZATION:= $(C_O_FLAG_HI)
+
+ifneq ($(PLATFORM), solaris)
+      BUILD_LIBFDLIBM_OPTIMIZATION := $(C_O_FLAG_NONE)
+endif
+
+ifneq ($(PLATFORM),macosx)
 $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM,\
                 SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) ${C_O_FLAG_NONE}\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFDLIBM_OPTIMIZATION) \
 			-I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\
 		CFLAGS_winapi_debug:=-DLOGGING,\
 		ARFLAGS:=$(ARFLAGS),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libfdlibm,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)))
-
-BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
+		BIN:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)))
+else
+#
+# On macosx they do partial (incremental) linking of fdlibm
+#   code it here...rather than add support to NativeCompilation
+#   as this is firt time I see it
+$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM,\
+                SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFDLIBM_OPTIMIZATION) \
+			-I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\
+		LDFLAGS := -nostdlib -r,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) : \
+	$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(SHARED_LIBRARY_SUFFIX)
+	$(CP) -a $< $@
+endif
+
+
+BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
 
 ##########################################################################################
 
@@ -173,14 +224,17 @@
 		EXCLUDE_FILES:=$(LIBATTACH_EXCLUDE_FILES),\
 		LANG:=C,\
 		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libattach/mapfile-$(PLATFORM), \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libattach/mapfile-$(PLATFORM)) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_solaris:=-ldoor,\
-		LDFLAGS_winapi:=psapi.lib advapi32.lib,\
+		LDFLAGS_winapi:=psapi.lib advapi32.lib java.lib jvm.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libattach,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX)))
+		BIN:=$(JDK_OUTPUTDIR)/objs/libattach,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
 
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX)
 
@@ -196,14 +250,17 @@
 		        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/socket \
                         -I$(JDK_TOPDIR)/src/share/back/export \
                         -I$(JDK_TOPDIR)/src/share/back,\
-		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libdt_socket/mapfile-vers),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdt_socket/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB), \
 		LDFLAGS_SUFFIX_linux:=-lpthread,\
 		LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket,\
 		LDFLAGS_SUFFIX_winapi:=-export:jdwpTransport_OnLoad ws2_32.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libdt_socket,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX)))
+		BIN:=$(JDK_OUTPUTDIR)/objs/libdt_socket,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
 
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX)
 
@@ -224,8 +281,8 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB),\
 		LDFLAGS_winapi:=-export:jdwpTransport_OnLoad,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libdt_shmem,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)dt_shmem$(SHARED_LIBRARY_SUFFIX)))
+		BIN:=$(JDK_OUTPUTDIR)/objs/libdt_shmem,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)dt_shmem$(SHARED_LIBRARY_SUFFIX)))
 
   BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)dt_shmem$(SHARED_LIBRARY_SUFFIX)
 
@@ -246,45 +303,55 @@
                  -I$(JDK_TOPDIR)/src/share/back \
                  -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/back \
 		 -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers,\
-		LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libjdwp/mapfile-vers),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdwp/mapfile-vers, \
+		LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)), \
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		LDFLAGS_SUFFIX_linux:=-ldl,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libjdwp,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX)))
+		LDFLAGS_SUFFIX_linux:=$(LIBDL),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjdwp,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
 
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX)
 
 ##########################################################################################
 
+LIBJAAS_MAPFILE :=
 ifneq ($(PLATFORM),solaris)
    LIBJAAS_EXCLUDE_FILES:=Solaris.c
+else
+   # only on solaris...wonder why
+   LIBJAAS_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjaas/mapfile-vers
 endif
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJAAS,\
                 SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/com/sun/security/auth/module,\
 		LANG:=C,\
 		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS),\
+		MAPFILE := $(LIBJAAS_MAPFILE),\
 		LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_winapi:=netapi32.lib user32.lib mpr.lib advapi32.lib,\
-		LDFLAGS_solaris:=$(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libjaas/mapfile-vers),\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
 		EXCLUDE_FILES:=$(LIBJAAS_EXCLUDE_FILES),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libjaas,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX)))
-
-BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX)
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjaas,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX)
 
 # Oddly enough, it is called jaas_nt.dll under winapi and libjaas_unix.so under posix.
 ifeq ($(PLATFORM),windows)
-    $(INSTALL_LIBRARIES_HERE)/jaas_nt.dll : $(JDK_OUTPUTDIR)/newobjs/jaas.dll
-	echo Copying $(@F)
+    $(INSTALL_LIBRARIES_HERE)/jaas_nt.dll : $(JDK_OUTPUTDIR)/objs/jaas.dll
+	$(ECHO) Copying $(@F)
 	$(CP) $< $@
     BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/jaas_nt.dll
 else
-    $(INSTALL_LIBRARIES_HERE)/libjaas_unix$(SHARED_LIBRARY_SUFFIX) : $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX)
-	echo Copying $(@F)
+    $(INSTALL_LIBRARIES_HERE)/libjaas_unix$(SHARED_LIBRARY_SUFFIX) : $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jaas$(SHARED_LIBRARY_SUFFIX)
+	$(ECHO) Copying $(@F)
 	$(CP) $< $@
     BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/libjaas_unix$(SHARED_LIBRARY_SUFFIX)
 endif
@@ -294,9 +361,7 @@
 ifeq ($(HOST_OS_API),posix)
   # TODO make this work on macosx
   ifneq ($(HOST_OS),macosx)
-#
-# NOTE: Change -L flag to point to new lib location after converting libnio. Also
-#       add dependency on nio from sctp.
+
     $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP,\
                 SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/ch/sctp,\
 		LANG:=C,\
@@ -307,18 +372,20 @@
 			-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/ch \
 			-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/net,\
 		CFLAGS_linux:=-Werror,\
-		LDFLAGS:=$(LDFLAGS_JDKLIB) -L$(JDK_OUTPUTDIR)/lib/$(LIBARCHDIR)\
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libsctp/mapfile-vers) \
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsctp/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_SUFFIX_linux:=-lpthread,\
-		LDFLAGS_SUFFIX_posix:=-ldl -lnio -lnet,\
+		LDFLAGS_SUFFIX_posix:=$(LIBDL) -lnio -lnet,\
 		LDFLAGS_SUFFIX_solaris:=-lsocket,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
 		INCLUDE_FILES:=SctpNet.c SctpChannelImpl.c SctpServerChannelImpl.c,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libsctp,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX)))
+		BIN:=$(JDK_OUTPUTDIR)/objs/libsctp,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX)))
 
     BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX)
+
+    $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX)
   endif
 endif
 
@@ -330,12 +397,15 @@
 		LANG:=C,\
 		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS)\
 			-I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsdt/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libjsdt/mapfile-vers) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) -ldl,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libjsdt,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX)))
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjsdt,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
 
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX)
 
@@ -360,42 +430,36 @@
 			-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug,\
 		CFLAGS_solaris:=-xc99=no_lib,\
 		CFLAGS_winapi:=-DCMS_IS_WINDOWS_,\
-		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/liblcms/mapfile-vers),\
-		LDFLAGS_posix:=-L$(JDK_OUTPUTDIR)/lib/$(LIBARCHDIR)xawt,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/liblcms/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB), \
 		LDFLAGS_solaris:=/usr/lib$(ISA_DIR)/libm.so.2,\
-		LDFLAGS_winapi:=$(JDK_OUTPUTDIR)/tmp/sun/sun.awt/awt/$(OBJDIRNAME)/awt.lib,\
+		LDFLAGS_winapi:=awt.lib java.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
 		LDFLAGS_SUFFIX_posix:=-lawt,\
 		LDFLAGS_SUFFIX_linux:=-lm,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/liblcms,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)lcms$(SHARED_LIBRARY_SUFFIX)))
+		BIN:=$(JDK_OUTPUTDIR)/objs/liblcms,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)lcms$(SHARED_LIBRARY_SUFFIX)))
 
     BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)lcms$(SHARED_LIBRARY_SUFFIX)
+
+    $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)lcms$(SHARED_LIBRARY_SUFFIX) : \
+	$(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX)
 endif
 
 ##########################################################################################
 
 ifdef OPENJDK
-    BUILD_LIBJPEG_MAPFILE := makefiles/mapfiles/libjpeg/mapfile-vers
+    BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers
 else
-    BUILD_LIBJPEG_MAPFILE := makefiles/mapfiles/libjpeg/mapfile-vers-closed
+    BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers-closed
     BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
     BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
 endif
 
+BUILD_LIBJPEG_REORDER :=
 ifeq ($(PLATFORM), solaris)
     ifneq ($(ARCH), amd64)
         BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(ARCH)
-        $(JDK_OUTPUTDIR)/newobjs/libjpeg/mapfile-vers : $(JDK_TOPDIR)/$(BUILD_LIBJPEG_MAPFILE) \
-							$(BUILD_LIBJPEG_REORDER)
-		$(MKDIR) -p $(@D)
-		$(CAT) $(JDK_TOPDIR)/$(BUILD_LIBJPEG_MAPFILE) > $@
-		$(SED) -e 's=OUTPUTDIR=$(JDK_OUTPUTDIR)=' $(BUILD_LIBJPEG_REORDER) >> $@
-        LIBJPEG_MAPFILE:=$(JDK_OUTPUTDIR)/newobjs/libjpeg/mapfile-vers
-
-        $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX): \
-			$(JDK_OUTPUTDIR)/newobjs/libjpeg/mapfile-vers
     endif
 endif
 
@@ -418,29 +482,205 @@
                 SRC:=$(BUILD_LIBJPEG_CLOSED_SRC) \
 		     $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(SHARED_LIBRARY_FLAGS) \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HIGHEST) $(SHARED_LIBRARY_FLAGS) \
 			$(BUILD_LIBJPEG_CLOSED_INCLUDES) \
 			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
-		CFLAGS_solaris:=-xF,\
+		MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,$(BUILD_LIBJPEG_MAPFILE))\
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_linux:=-ldl,\
+		LDFLAGS_linux:=$(LIBDL),\
+		LDFLAGS_winapi:=java.lib jvm.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libjpeg,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX)))
+		REORDER := $(BUILD_LIBJPEG_REORDER),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjpeg,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
 
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX)
 
 ##########################################################################################
 
+BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib
+BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
+			-I$(BUILD_LIBMLIB_SRC) \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt/medialib 
+
+BUILD_LIBMLIB_LDLIBS :=
+BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libmlib_image/mapfile-vers
+
+ifneq ($(PLATFORM), sparc)
+	BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
+endif
+
+ifeq ($(ARCH_DATA_MODEL), 64)
+	BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
+endif
+
+ifneq ($(PLATFORM), windows)
+	BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE,\
+		SRC:=$(BUILD_LIBMLIB_SRC),\
+		EXCLUDE_FILES:=awt_ImagingLib.c mlib_c_ImageBlendTable.c,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HIGHEST) $(SHARED_LIBRARY_FLAGS) \
+                        $(BUILD_LIBMLIB_CFLAGS),\
+		MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+                         $(BUILD_LIBMLIB_LDLIBS) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+                LDFLAGS_SUFFIX_posix := -lm,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libmlib_image,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)mlib_image$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)mlib_image$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)mlib_image$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+ifeq ($(PLATFORM),solaris)
+ifeq ($(ARCH),sparc)
+	BUILD_LIBMLIB_IMAGE_V := 1
+else ifeq ($(ARCH), sparcv9)
+	BUILD_LIBMLIB_IMAGE_V := 1
+endif
+endif
+
+ifeq ($(BUILD_LIBMLIB_IMAGE_V), 1)
+
+BUILD_LIBMLIB_IMAGE_V_FILES :=  \
+        mlib_v_ImageLookUp.c \
+        mlib_ImageCreate.c \
+        mlib_ImageAffine.c \
+        mlib_ImageConvMxN.c \
+        mlib_ImageConvKernelConvert.c \
+        mlib_sys.c \
+        mlib_ImageLookUp_64.c \
+        mlib_ImageLookUp_Bit.c \
+        mlib_ImageColorTrue2Index.c \
+        mlib_c_ImageThresh1_U8.c \
+        mlib_v_ImageLookUpS16S16Func.c \
+        mlib_v_ImageLookUpS16S32Func.c \
+        mlib_v_ImageLookUpS16U16Func.c \
+        mlib_v_ImageLookUpS16U8Func.c \
+        mlib_v_ImageLookUpS32S16Func.c \
+        mlib_v_ImageLookUpS32S32Func.c \
+        mlib_v_ImageLookUpS32U16Func.c \
+        mlib_v_ImageLookUpS32U8Func.c \
+        mlib_v_ImageLookUpSIS16S16Func.c \
+        mlib_v_ImageLookUpSIS16S32Func.c \
+        mlib_v_ImageLookUpSIS16U16Func.c \
+        mlib_v_ImageLookUpSIS16U8Func.c \
+        mlib_v_ImageLookUpSIS32S16Func.c \
+        mlib_v_ImageLookUpSIS32S32Func.c \
+        mlib_v_ImageLookUpSIS32U16Func.c \
+        mlib_v_ImageLookUpSIS32U8Func.c \
+        mlib_v_ImageLookUpSIU16S16Func.c \
+        mlib_v_ImageLookUpSIU16S32Func.c \
+        mlib_v_ImageLookUpSIU16U16Func.c \
+        mlib_v_ImageLookUpSIU16U8Func.c \
+        mlib_v_ImageLookUpSIU8S16Func.c \
+        mlib_v_ImageLookUpSIU8S32Func.c \
+        mlib_v_ImageLookUpSIU8U16Func.c \
+        mlib_v_ImageLookUpSIU8U8Func.c \
+        mlib_v_ImageLookUpU16S16Func.c \
+        mlib_v_ImageLookUpU16S32Func.c \
+        mlib_v_ImageLookUpU16U16Func.c \
+        mlib_v_ImageLookUpU16U8Func.c \
+        mlib_v_ImageLookUpU8S16Func.c \
+        mlib_v_ImageLookUpU8S32Func.c \
+        mlib_v_ImageLookUpU8U16Func.c \
+        mlib_v_ImageLookUpU8U8Func.c \
+        mlib_v_ImageAffineIndex_BC.c \
+        mlib_v_ImageAffine_BC.c \
+        mlib_v_ImageAffine_BC_S16.c \
+        mlib_v_ImageAffine_BC_U16.c \
+        mlib_v_ImageAffine_BL.c \
+        mlib_v_ImageAffine_BL_S16.c \
+        mlib_v_ImageAffine_BL_U16.c \
+        mlib_v_ImageAffine_NN.c \
+        mlib_v_ImageFilters.c \
+        mlib_ImageAffineEdge.c \
+        mlib_ImageAffine_BC_D64.c \
+        mlib_ImageAffine_BC_F32.c \
+        mlib_ImageAffine_BC_S32.c \
+        mlib_ImageAffine_BL_D64.c \
+        mlib_ImageAffine_BL_F32.c \
+        mlib_ImageAffine_BL_S32.c \
+        mlib_ImageAffine_NN.c \
+        mlib_ImageAffine_NN_Bit.c \
+        mlib_ImageFilters.c \
+        mlib_ImageScanPoly.c \
+        mlib_ImageConv_8nw.c \
+        mlib_ImageConv_8ext.c \
+        mlib_ImageConv_16nw.c \
+        mlib_ImageConv_16ext.c \
+        mlib_ImageConv_u16nw.c \
+        mlib_ImageConv_u16ext.c \
+        mlib_ImageConv_32nw.c \
+        mlib_ImageConv_F32nw.c \
+        mlib_ImageConvMxN_Fp.c \
+        mlib_ImageConvMxN_ext.c \
+        mlib_ImageConv_D64nw.c \
+        mlib_ImageClipping.c \
+        mlib_ImageConvCopyEdge_Bit.c \
+        mlib_ImageConvClearEdge_Bit.c \
+        mlib_ImageConv2x2_f.c \
+        mlib_ImageConvClearEdge_Fp.c \
+        mlib_v_ImageConvMxN_8.c \
+        mlib_v_ImageConvClearEdge.c \
+        mlib_v_ImageConvCopyEdge.c \
+        mlib_v_ImageConvMxN_8ext.c \
+        mlib_v_ImageConvVersion.c \
+        mlib_v_ImageConv_8nw.c \
+        mlib_ImageConvCopyEdge_Fp.c \
+        mlib_v_ImageChannelInsert_1.c \
+        mlib_v_ImageChannelExtract_43.c \
+        mlib_v_ImageChannelExtract_1.c \
+        mlib_ImageCopy_Bit.c \
+        mlib_v_ImageCopy_f.c \
+        mlib_ImageUtils.c \
+        mlib_ImageDivTables.c
+
+#
+# TODO
+#
+# ASFLAGS += -P
+# INLINE = $(PLATFORM_SRC)/native/sun/awt/medialib/vis_$(ARCH_DATA_MODEL).il
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V,\
+		SRC:=$(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
+		     $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib,\
+		LANG:=C,\
+		INCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_FILES),\
+		CFLAGS:=$(BUILD_LIBMLIB_CFLAGS) \
+                        $(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(SHARED_LIBRARY_FLAGS) \
+		MAPFILE := $(JDK_TOPDIR)/$(BUILD_LIBMLIB_IMAGE_MAPFILE), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+                         $(BUILD_LIBMLIB_LDLIBS) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libmlib_image_v,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)mlib_image_v$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)mlib_image_v$(SHARED_LIBRARY_SUFFIX)
+
+endif
+
+##########################################################################################
+
 ifndef OPENJDK
     FONT_HEADERS := -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
-    BUILD_LIBFONTMANAGER_MAPFILE := makefiles/mapfiles/libfontmanager/mapfile-vers
+    BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
     LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
 else
     FONT_HEADERS := $(FREETYPE2_CFLAGS)
-    BUILD_LIBFONTMANAGER_MAPFILE := makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
+    BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
     BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE2_LIBS)
 endif
 
@@ -478,18 +718,25 @@
 		CFLAGS_windows=$(C_O_FLAG_NORM)\
 				-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/windows \
 				-DCC_NOEX, \
+		MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
 		LDFLAGS:=$(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,$(BUILD_LIBFONTMANAGER_MAPFILE)) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_solaris:=-L$(JDK_OUTPUTDIR)/lib/$(LIBARCHDIR)headless,\
-		LDFLAGS_windows:=advapi32.lib user32.lib gdi32.lib $(JDK_OUTPUTDIR)/tmp/sun/sun.awt/awt/$(OBJDIRNAME)/awt.lib,\
+		LDFLAGS_windows:=advapi32.lib user32.lib gdi32.lib awt.lib java.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) \
 				$(BUILD_LIBFONTMANAGER_FONTLIB),\
 		LDFLAGS_SUFFIX_linux:=-lawt $(LIBM) $(LIBCXX),\
 		LDFLAGS_SUFFIX_solaris:=-lawt -lawt_xawt -lc $(LIBM) $(LIBCXX),\
 		LDFLAGS_SUFFIX_macosx:=-lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libfontmanager,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX)))
+		BIN:=$(JDK_OUTPUTDIR)/objs/libfontmanager,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) : \
+	$(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX)
+
+ifneq (,$(findstring $(PLATFORM),solaris macosx))
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) : \
+	$(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX)
+endif
 
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX)
 
@@ -525,26 +772,35 @@
 		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON) $(CXX_O_FLAG_HI),\
 		CFLAGS_windows=-DCC_NOEX, \
 		CXXFLAGS_windows=-DCC_NOEX, \
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libt2k/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libt2k/mapfile-vers) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_windows:=user32.lib $(JDK_OUTPUTDIR)/newobjs/fontmanager.lib,\
+		LDFLAGS_windows:=user32.lib $(JDK_OUTPUTDIR)/objs/fontmanager.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		LDFLAGS_SUFFIX_linux:=$(LIBCXX) $(LIBM) -L$(INSTALL_LIBRARIES_HERE) -lfontmanager,\
-		LDFLAGS_SUFFIX_solaris:=$(LIBCXX) $(LIBM) -L$(INSTALL_LIBRARIES_HERE) -lfontmanager -lawt \
+		LDFLAGS_SUFFIX_macosx:=$(LIBCXX) $(LIBM) -lfontmanager,\
+		LDFLAGS_SUFFIX_linux:=$(LIBCXX) $(LIBM) -lfontmanager,\
+		LDFLAGS_SUFFIX_solaris:=$(LIBCXX) $(LIBM) -lfontmanager -lawt \
 					-lawt_xawt,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libt2k,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX)))
+		BIN:=$(JDK_OUTPUTDIR)/objs/libt2k,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX)))
 
     # t2k is linked against fontmanager
-    $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX): \
-	$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX)
+    $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX): \
+	$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX)
 
     BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX)
 endif
 
 ##########################################################################################
 
+#
+# TODO replace with X_FLAGS / X_LIBS
+#   and add them to configure
+#
+OPENWIN_LIB := $(OPENWIN_HOME)/lib
+
+BUILD_LIBJAWT_LIB := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX)
+
 ifeq ($(PLATFORM), windows)
     ifeq ($(ARCH_DATA_MODEL), 32)
         KERNEL32_LIB := kernel32.lib
@@ -561,41 +817,59 @@
 			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
 			-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d/windows, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) $(KERNEL32_LIB) \
-			 advapi32.lib $(JDK_OUTPUTDIR)/tmp/sun/sun.awt/awt/$(OBJDIRNAME)/awt.lib,\
+			 advapi32.lib awt.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libjawt,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX)))
-
-$(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): \
-		$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX)
-	echo Copying $(@F)
-	$(CP) $(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@	
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjawt,\
+		LIB:=$(BUILD_LIBJAWT_LIB)))
+
+$(BUILD_LIBJAWT_LIB) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT_LIB)
+	$(ECHO) Copying $(@F)
+	$(CP) $< $@
 
 BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 
 else # PLATFORM not windows
 
+    JAWT_LIBS := -lawt
     ifndef BUILD_HEADLESS_ONLY
-        MAWT_AWT_LIB =-lawt_xawt
+        JAWT_LIBS += -lawt_xawt
     else
-        MAWT_AWT_LIB =-lawt_headless
+        JAWT_LIBS += -lawt_headless
         HEADLESS_CFLAG += -DHEADLESS
     endif
 
+    JAWT_FILES := jawt.c
+    ifeq ($(PLATFORM), macosx)
+	JAWT_FILES := jawt.m
+	JAWT_LIBS := -lawt_lwawt
+    endif
+
     $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\
-                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt,\
-		INCLUDE_FILES:=jawt.c,\
+                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt \
+                     $(JDK_TOPDIR)/src/macosx/native/sun/awt,\
+		INCLUDE_FILES:=$(JAWT_FILES),\
 		LANG:=C,\
 		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM), \
 		CFLAGS_linux:=$(HEADLESS_CFLAG),\
+		CFLAGS_macosx := -I$(JDK_TOPDIR)/src/solaris/native/sun/awt ,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjawt/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libjawt/mapfile-vers) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_solaris:=-L/usr/openwin/sfw/lib$(ISA_DIR) -L/usr/openwin/lib$(ISA_DIR),\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(MAWT_AWT_LIB) -lawt,\
+		LDFLAGS_solaris:=-L$(OPENWIN_HOME)/sfw/lib$(ISA_DIR) -L$(OPENWIN_LIB)$(ISA_DIR),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(JAWT_LIBS),\
 		LDFLAGS_SUFFIX_solaris:=-lXrender,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/libjawt,\
-		LIB:=$(JDK_OUTPUTDIR)/newobjs/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX)))
+		LDFLAGS_SUFFIX_macosx:= -framework Cocoa, \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjawt,\
+		LIB:=$(BUILD_LIBJAWT_LIB)))
+
+ifndef BUILD_HEADLESS_ONLY
+$(BUILD_LIBJAWT_LIB) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX)
+else
+$(BUILD_LIBJAWT_LIB) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
+endif
+
 endif # PLATFORM
 
 BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX)
@@ -603,6 +877,2180 @@
 
 ##########################################################################################
 
+BUILD_LIBVERIFY_SRC := check_code.c check_format.c
+
+ifeq ($(PLATFORM), solaris)
+	ifneq ($(ARCH), amd64)
+		BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libverify/reorder-$(ARCH)
+	endif
+endif
+
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY,\
+		SRC:=$(JDK_TOPDIR)/src/share/native/common,\
+		INCLUDE_FILES:=$(BUILD_LIBVERIFY_SRC),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(SHARED_LIBRARY_FLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libverify/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX_posix:=-ljvm -lc,\
+		LDFLAGS_SUFFIX_windows:=jvm.lib,\
+		REORDER := $(BUILD_LIBVERIFY_REORDER),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libverify,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+ifndef OPENJDK
+ifneq ($(PLATFORM), macosx)
+
+BUILD_LIBJDBCODBC_DIR     := $(JDK_OUTPUTDIR)/objs/libjdbcodbc
+BUILD_LIBJDBCODBC_NAME    := $(LIBRARY_PREFIX)JdbcOdbc$(SHARED_LIBRARY_SUFFIX)
+BUILD_LIBJDBCODBC_CFLAGS  := 
+BUILD_LIBJDBCODBC_TARGET  := $(JDK_OUTPUTDIR)/objs/$(BUILD_LIBJDBCODBC_NAME)
+BUILD_LIBJDBCODBC_LIBS    :=
+BUILD_LIBJDBCODBC_LDFLAGS :=
+
+ifeq ($(PLATFORM), windows)
+	BUILD_LIBJDBCODBC_LDFLAGS := $(LDFLAGS_JDKLIB)
+	BUILD_LIBJDBCODBC_LIBS += odbc32.lib odbccp32.lib java.lib advapi32.lib
+else
+	BUILD_LIBJDBCODBC_CFLAGS := -DUNIX
+
+#
+# This mimics "current" build system exactly. Link against fake -lodbcinst -lodbc
+#   but...those are linked with the -soname, causing the dependency to be dropped on linux (gnu ld)
+#   but kept with other linker (solaris)
+#
+# IMO very weird behaviour...very weird
+#
+	BUILD_LIBJDBCODBC_LDFLAGS += $(patsubst defs,nodefs,$(LDFLAGS_JDKLIB)) \
+				      -Xlinker -z -Xlinker nodefs
+	BUILD_LIBJDBCODBC_LIBS += -L$(BUILD_LIBJDBCODBC_DIR) -lodbcinst -lodbc
+	BUILD_LIBJDBCODBC_FAKE_LIBS := $(BUILD_LIBJDBCODBC_DIR)/$(LIBRARY_PREFIX)odbcinst$(SHARED_LIBRARY_SUFFIX) \
+                                       $(BUILD_LIBJDBCODBC_DIR)/$(LIBRARY_PREFIX)odbc$(SHARED_LIBRARY_SUFFIX)
+
+	BUILD_LIBJDBCODBC_SONAME := $(call SET_SHARED_LIBRARY_NAME,$(BUILD_LIBJDBCODBC_NAME))
+endif
+
+ifneq ($(PLATFORM), windows)
+
+$(eval $(call SetupNativeCompilation,BUILD_FAKEODBCINST,\
+		SRC:=$(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc,\
+		INCLUDE_FILES := dummyodbc1.c,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS),\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN) $(BUILD_LIBJDBCODBC_LDFLAGS),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(BUILD_LIBJDBCODBC_SONAME),\
+		BIN:=$(BUILD_LIBJDBCODBC_DIR),\
+		LIB:=$(BUILD_LIBJDBCODBC_DIR)/$(LIBRARY_PREFIX)odbcinst$(SHARED_LIBRARY_SUFFIX)))
+
+$(eval $(call SetupNativeCompilation,BUILD_FAKEODBC,\
+		SRC:=$(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc,\
+		INCLUDE_FILES := dummyodbc2.c,\
+		LANG:=C,\
+		CFLAGS:=$(BUILD_LIBJDBCODBC_CFLAGS) $(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS),\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN) $(BUILD_LIBJDBCODBC_LDFLAGS),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(BUILD_LIBJDBCODBC_SONAME),\
+		BIN:=$(BUILD_LIBJDBCODBC_DIR),\
+		LIB:=$(BUILD_LIBJDBCODBC_DIR)/$(LIBRARY_PREFIX)odbc$(SHARED_LIBRARY_SUFFIX)))
+
+$(BUILD_LIBJDBCODBC_FAKE_LIBS) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+$(BUILD_LIBJDBCODBC_TARGET) : $(BUILD_LIBJDBCODBC_FAKE_LIBS)
+
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJDBCODBC,\
+		SRC:=$(JDK_TOPDIR)/src/closed/share/classes/sun/jdbc/odbc,\
+		EXCLUDE_FILES := dummyodbc.c,\
+		LANG:=C,\
+		CFLAGS:=$(BUILD_LIBJDBCODBC_CFLAGS) $(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) \
+			$(SHARED_LIBRARY_FLAGS),\
+		LDFLAGS:=$(BUILD_LIBJDBCODBC_LDFLAGS) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN) $(BUILD_LIBJDBCODBC_LIBS),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(BUILD_LIBJDBCODBC_SONAME),\
+		BIN:=$(BUILD_LIBJDBCODBC_DIR),\
+		LIB:=$(BUILD_LIBJDBCODBC_TARGET)))
+
+$(BUILD_LIBJDBCODBC_TARGET) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JdbcOdbc$(SHARED_LIBRARY_SUFFIX)
+
+endif
+endif
+
+##########################################################################################
+
+BUILD_LIBINSTRUMENT_SRC     := $(JDK_TOPDIR)/src/share/instrument \
+                               $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/io \
+                               $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/instrument
+
+BUILD_LIBINSTRUMENT_FILES   := \
+	EncodingSupport.c \
+	EncodingSupport_md.c \
+	FileSystemSupport_md.c \
+	InstrumentationImplNativeMethods.c \
+	InvocationAdapter.c \
+	JarFacade.c \
+	JPLISAgent.c \
+	JPLISAssert.c \
+	JavaExceptions.c \
+	PathCharsValidator.c \
+	Reentrancy.c \
+	Utilities.c \
+	canonicalize_md.c
+
+BUILD_LIBINSTRUMENT_DIR     := $(JDK_OUTPUTDIR)/objs/libinstrument
+BUILD_LIBINSTRUMENT_NAME    := $(LIBRARY_PREFIX)instrument$(SHARED_LIBRARY_SUFFIX)
+BUILD_LIBINSTRUMENT_CFLAGS  := -I$(JDK_TOPDIR)/src/share/instrument \
+                               -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/instrument \
+                               -I$(JDK_TOPDIR)/src/share/bin
+
+BUILD_LIBINSTRUMENT_TARGET  := $(JDK_OUTPUTDIR)/objs/$(BUILD_LIBINSTRUMENT_NAME)
+BUILD_LIBINSTRUMENT_LDFLAGS :=
+BUILD_LIBINSTRUMENT_LDFLAGS_SUFFIX :=
+
+ifeq ($(PLATFORM), windows)
+  BUILD_LIBINSTRUMENT_LDFLAGS += jli_static.lib java.lib \
+				 -export:Agent_OnAttach
+  # equivalent of strcasecmp is stricmp on Windows
+  BUILD_LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
+else
+
+ifneq (,$(findstring $(PLATFORM), macosx))
+	ifneq ($(ARCH), universal)
+		BUILD_LIBINSTRUMENT_LDFLAGS += -Wl,-all_load
+	endif
+
+	BUILD_LIBINSTRUMENT_LDFLAGS += $(JDK_OUTPUTDIR)/objs/libjli_static.a
+	BUILD_LIBINSTRUMENT_LDFLAGS += -liconv
+	BUILD_LIBINSTRUMENT_LDFLAGS += -framework Cocoa -framework Security -framework ApplicationServices
+	BUILD_LIBINSTRUMENT_LDFLAGS += $(LIBZ)
+else
+	BUILD_LIBINSTRUMENT_LDFLAGS_SUFFIX += -ljli $(LIBDL)
+endif
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT,\
+		SRC:=$(BUILD_LIBINSTRUMENT_SRC),\
+		INCLUDE_FILES:=$(BUILD_LIBINSTRUMENT_FILES),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        $(BUILD_LIBINSTRUMENT_CFLAGS),\
+		CFLAGS_debug := -DJPLIS_LOGGING,\
+		CFLAGS_release := -DNO_JPLIS_LOGGING,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libinstrument/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN,jli) \
+                         $(BUILD_LIBINSTRUMENT_LDFLAGS),\
+		LDFLAGS_SUFFIX:=$(LIBZ) $(BUILD_LIBINSTRUMENT_LDFLAGS_SUFFIX),\
+		BIN:=$(BUILD_LIBINSTRUMENT_DIR),\
+		LIB:=$(BUILD_LIBINSTRUMENT_TARGET)))
+
+$(BUILD_LIBINSTRUMENT_TARGET) : $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
+$(BUILD_LIBINSTRUMENT_TARGET) : $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
+$(BUILD_LIBINSTRUMENT_TARGET) : $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX)
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(BUILD_LIBINSTRUMENT_NAME)
+
+##########################################################################################
+
+BUILD_LIBMANAGEMENT_SRC := $(JDK_TOPDIR)/src/share/native/sun/management \
+                           $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/management \
+                           $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/com/sun/management
+
+BUILD_LIBMANAGEMENT_EXCLUDES :=
+
+BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/management
+
+ifneq ($(PLATFORM), windows)
+	BUILD_LIBMANAGEMENT_EXCLUDES += OperatingSystem_md.c
+else
+	BUILD_LIBMANAGEMENT_EXCLUDES += UnixOperatingSystem_md.c
+endif
+
+ifneq ($(PLATFORM),solaris)
+	BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c
+endif
+
+ifneq ($(PLATFORM),linux)
+	BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c
+endif
+
+ifneq ($(PLATFORM),macosx)
+	BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c
+endif
+
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT,\
+		SRC:=$(BUILD_LIBMANAGEMENT_SRC),\
+		EXCLUDE_FILES:=$(BUILD_LIBMANAGEMENT_EXCLUDES),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(SHARED_LIBRARY_FLAGS) $(BUILD_LIBMANAGEMENT_CFLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libmanagement/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_windows := java.lib jvm.lib advapi32.lib psapi.lib,\
+		LDFLAGS_solaris := -lkstat,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libmanagement,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+BUILD_LIBHPROF_SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/hprof $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/demo/jvmti/hprof
+BUILD_LIBHPROF_CFLAGS := -I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \
+                         -I$(JDK_TOPDIR)/src/share/npt \
+                         -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt \
+                         -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo
+
+BUILD_LIBHPROF_LDFLAGS :=
+
+ifeq ($(PLATFORM),solaris)
+     BUILD_LIBHPROF_LDFLAGS += -lsocket -lnsl
+endif
+
+ifneq ($(PLATFORM),windows)
+     BUILD_LIBHPROF_LDFLAGS += $(LIBDL)
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBHPROF,\
+		SRC:=$(BUILD_LIBHPROF_SRC),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HIGHEST) $(SHARED_LIBRARY_FLAGS) \
+                         $(BUILD_LIBHPROF_CFLAGS),\
+		CFLAGS_debug := -DHPROF_LOGGING,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libhprof/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_windows:=wsock32.lib winmm.lib advapi32.lib,\
+		LDFLAGS_SUFFIX:=$(BUILD_LIBHPROF_LDFLAGS),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libhprof,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)hprof$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)hprof$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO,\
+		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjava_crw_demo/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX:=,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjava_crw_demo,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)java_crw_demo$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java_crw_demo$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBNPT,\
+		SRC:=$(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        -I$(JDK_TOPDIR)/src/share/npt \
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnpt/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_macosx := -liconv,\
+		LDFLAGS_SUFFIX_windows := -export:nptInitialize -export:nptTerminate,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libnpt,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+BUILD_LIBNIO_SRC := \
+        $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/nio \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/ch \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/fs
+
+BUILD_LIBNIO_CFLAGS := \
+	-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
+	-I$(JDK_TOPDIR)/src/share/native/java/io \
+	-I$(JDK_TOPDIR)/src/share/native/java/net \
+        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/net
+
+BUILD_LIBNIO_FILES := \
+        DatagramChannelImpl.c \
+        DatagramDispatcher.c \
+	FileChannelImpl.c \
+	FileDispatcherImpl.c \
+	FileKey.c \
+	IOUtil.c \
+        MappedByteBuffer.c \
+	Net.c \
+	ServerSocketChannelImpl.c \
+	SocketChannelImpl.c \
+	SocketDispatcher.c
+
+ifeq ($(PLATFORM), windows)
+	BUILD_LIBNIO_FILES += \
+		Iocp.c \
+		RegistryFileTypeDetector.c \
+		WindowsAsynchronousFileChannelImpl.c \
+		WindowsAsynchronousServerSocketChannelImpl.c \
+		WindowsAsynchronousSocketChannelImpl.c \
+		WindowsNativeDispatcher.c \
+	        WindowsSelectorImpl.c
+endif
+
+ifeq ($(PLATFORM), linux)
+	BUILD_LIBNIO_LDFLAGS_SUFFIX := -lpthread $(LIBDL)
+	BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-linux
+	BUILD_LIBNIO_FILES += \
+		EPoll.c \
+		EPollArrayWrapper.c \
+		EPollPort.c \
+		InheritedChannel.c \
+		NativeThread.c \
+	        PollArrayWrapper.c \
+		UnixAsynchronousServerSocketChannelImpl.c \
+		UnixAsynchronousSocketChannelImpl.c \
+		GnomeFileTypeDetector.c \
+		LinuxNativeDispatcher.c \
+		LinuxWatchService.c \
+		UnixCopyFile.c \
+		UnixNativeDispatcher.c
+endif
+
+ifeq ($(PLATFORM), macosx)
+	BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-bsd
+	BUILD_LIBNIO_SRC += $(JDK_TOPDIR)/src/macosx/native/sun/nio/ch
+	BUILD_LIBNIO_FILES += \
+		InheritedChannel.c \
+		NativeThread.c \
+	        PollArrayWrapper.c \
+		UnixAsynchronousServerSocketChannelImpl.c \
+		UnixAsynchronousSocketChannelImpl.c \
+		GnomeFileTypeDetector.c \
+		BsdNativeDispatcher.c \
+		UnixCopyFile.c \
+		UnixNativeDispatcher.c \
+		KQueue.c \
+		KQueuePort.c \
+		KQueueArrayWrapper.c
+endif
+
+ifeq ($(PLATFORM), solaris)
+	BUILD_LIBNIO_LDFLAGS_SUFFIX := $(LIBDL)
+	BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-solaris
+	BUILD_LIBNIO_FILES += \
+		DevPollArrayWrapper.c \
+		InheritedChannel.c \
+		NativeThread.c \
+		PollArrayWrapper.c \
+		SolarisEventPort.c \
+		UnixAsynchronousServerSocketChannelImpl.c \
+		UnixAsynchronousSocketChannelImpl.c \
+		GnomeFileTypeDetector.c \
+		SolarisNativeDispatcher.c \
+		SolarisWatchService.c \
+		UnixCopyFile.c \
+		UnixNativeDispatcher.c
+endif
+
+BUILD_LIBNIO_LDFLAGS :=
+ifeq ($(PLATFORM),windows)
+	BUILD_LIBNIO_LDFLAGS += \
+		java.lib net.lib advapi32.lib jvm.lib ws2_32.lib\
+		$(JDK_OUTPUTDIR)/objs/libjava/io_util.obj \
+		$(JDK_OUTPUTDIR)/objs/libjava/FileDescriptor_md.obj
+endif
+
+ifeq ($(PLATFORM), linux)
+	BUILD_LIBNIO_LDFLAGS_SUFFIX += -ljava -lnet -lpthread $(LIBDL)
+endif
+ifeq ($(PLATFORM), macosx)
+	BUILD_LIBNIO_LDFLAGS_SUFFIX += -ljava -lnet -pthread
+endif
+
+ifeq ($(PLATFORM), solaris)
+	BUILD_LIBNIO_LDFLAGS_SUFFIX += $(JVMLIB) $(LIBSOCKET) -lposix4 $(LIBDL) -lsendfile \
+				       -ljava -lnet
+endif # PLATFORM
+
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBNIO,\
+		SRC:=$(BUILD_LIBNIO_SRC),\
+		INCLUDE_FILES := $(BUILD_LIBNIO_FILES), \
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(SHARED_LIBRARY_FLAGS) \
+                        $(BUILD_LIBNIO_CFLAGS),\
+		MAPFILE := $(BUILD_LIBNIO_MAPFILE), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(BUILD_LIBNIO_LDFLAGS_SUFFIX),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libnio,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX) $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+
+##########################################################################################
+
+LIBNET_SRC_DIRS := $(JDK_TOPDIR)/src/share/native/java/net \
+                   $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/net \
+                   $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/net/dns \
+                   $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/net/www/protocol/http/ntlm \
+                   $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/net/sdp \
+                   $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/net/spi
+
+LIBNET_CFLAGS := $(foreach dir,$(LIBNET_SRC_DIRS),-I$(dir))
+
+LIBNET_EXCLUDE_FILES:=
+ifneq ($(PLATFORM),linux)
+	LIBNET_EXCLUDE_FILES += linux_close.c
+endif
+
+ifneq ($(PLATFORM),macosx)
+	LIBNET_EXCLUDE_FILES += bsd_close.c
+endif
+
+ifeq ($(PLATFORM),windows)
+	LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c
+else
+	LIBNET_EXCLUDE_FILES += TwoStacksPlainSocketImpl.c DualStackPlainSocketImpl.c \
+                                TwoStacksPlainDatagramSocketImpl.c DualStackPlainDatagramSocketImpl.c \
+				NTLMAuthSequence.c NetworkInterface_winXP.c
+endif
+
+LIBNET_LDFLAGS_SUFFIX :=
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBNET,\
+		SRC:=$(LIBNET_SRC_DIRS),\
+		EXCLUDE_FILES := $(LIBNET_EXCLUDE_FILES), \
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        $(LIBNET_CFLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnet/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBNET_LDFLAGS_SUFFIX),\
+		LDFLAGS_SUFFIX_solaris := -lnsl -lsocket $(LIBDL) ,\
+		LDFLAGS_SUFFIX_linux := $(LIBDL) -lpthread ,\
+		LDFLAGS_SUFFIX_windows := ws2_32.lib $(JVMLIB) secur32.lib iphlpapi.lib \
+					  delayimp.lib java.lib jvm.lib advapi32.lib \
+                                          /DELAYLOAD:secur32.dll /DELAYLOAD:iphlpapi.dll, \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libnet,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties
+	$(ECHO) Copying $(@F)
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
+
+ifeq ($(PLATFORM), solaris)
+$(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template : $(JDK_TOPDIR)/src/${LEGACY_HOST_OS_API}/lib/sdp/sdp.conf.template
+	$(ECHO) Copying $(@F)
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
+endif
+
+##########################################################################################
+
+LIBJAVA_SRC_DIRS := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/lang \
+		$(JDK_TOPDIR)/src/share/native/java/lang \
+		$(JDK_TOPDIR)/src/share/native/java/lang/ref \
+		$(JDK_TOPDIR)/src/share/native/java/lang/reflect \
+		$(JDK_TOPDIR)/src/share/native/java/io \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/io \
+		$(JDK_TOPDIR)/src/share/native/java/nio \
+		$(JDK_TOPDIR)/src/share/native/java/security \
+		$(JDK_TOPDIR)/src/share/native/common \
+		$(JDK_TOPDIR)/src/share/native/sun/misc \
+		$(JDK_TOPDIR)/src/share/native/sun/reflect \
+		$(JDK_TOPDIR)/src/share/native/java/sql \
+		$(JDK_TOPDIR)/src/share/native/java/util \
+		$(JDK_TOPDIR)/src/share/native/java/util/concurrent/atomic \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/common \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/java/util \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/provider \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/io
+
+LIBJAVA_CFLAGS := $(foreach dir,$(LIBJAVA_SRC_DIRS),-I$(dir)) \
+		  -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \
+                  -DARCHPROPNAME='"$(ARCH)"'
+
+LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
+                  -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
+                  -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
+                  -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"' 
+
+ifneq (,$(JDK_UPDATE_VERSION))
+	LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
+endif
+
+LIBJAVA_EXCLUDE_FILES:= check_code.c check_format.c
+
+ifneq ($(PLATFORM),macosx)
+	LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
+else
+	BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
+endif
+
+ifeq ($(PLATFORM),windows)
+        LIBJAVA_EXCLUDE_FILES += \
+		UNIXProcess_md.c \
+		UnixFileSystem_md.c \
+		FileSystemPreferences.c
+else
+	LIBJAVA_EXCLUDE_FILES += \
+		ProcessImpl_md.c \
+		Win32FileSystem_md.c \
+		WinNTFileSystem_md.c \
+		dirent_md.c \
+		WindowsPreferences.c \
+		sun/security/provider/WinCAPISeedGenerator.c \
+		sun/io/Win32ErrorMode.c
+endif
+
+ifeq ($(PLATFORM), solaris)
+    ifneq ($(ARCH), amd64)
+        LIBJAVA_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjava/reorder-$(ARCH)
+    endif
+endif
+
+LIBJAVA_FDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
+LIBJAVA_VERIFY := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)verify$(STATIC_LIBRARY_SUFFIX)
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA,\
+		SRC:=$(LIBJAVA_SRC_DIRS),\
+		EXCLUDES := fdlibm/src zip, \
+		EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(SHARED_LIBRARY_FLAGS) \
+                        $(LIBJAVA_CFLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjava/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_windows:=-export:winFileHandleOpen -export:handleLseek \
+				 $(LIBJAVA_FDLIBM) $(LIBJAVA_VERIFY) jvm.lib \
+				 shell32.lib delayimp.lib /DELAYLOAD:shell32.dll \
+				 advapi32.lib,\
+		LDFLAGS_SUFFIX_posix:=-ljvm -lverify, \
+		LDFLAGS_SUFFIX_solaris := -lnsl -lsocket -lscf $(LIBDL) $(LIBJAVA_FDLIBM) -lc,\
+		LDFLAGS_SUFFIX_linux := $(LIBDL) $(LIBJAVA_FDLIBM),\
+		LDFLAGS_SUFFIX_macosx := $(LIBJAVA_FDLIBM) \
+                                         -framework CoreFoundation \
+                                         -framework Security -framework SystemConfiguration, \
+		REORDER := $(LIBJAVA_REORDER), \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjava,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) : $(LIBJLI_BINARY)
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) : $(LIBJAVA_FDLIBM)
+
+##########################################################################################
+
+BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin
+BUILD_LIBJLI_CFLAGS := $(foreach dir,$(BUILD_LIBJLI_SRC_DIRS),-I$(dir))
+
+BUILD_LIBJLI_FILES := \
+	java.c \
+	splashscreen_stubs.c \
+	parse_manifest.c \
+	version_comp.c \
+	wildcard.c \
+	jli_util.c
+
+ifeq ($(JVM_VARIANT_ZERO), true)
+	ERGO_FAMILY := zero
+else # !ZERO_BUILD
+	ifneq (,$(findstring $(ARCH), amd64 x86_64))
+		ERGO_FAMILY := i586
+	else # !X86 FAMILY
+		ERGO_FAMILY := $(ARCH)
+	endif #ARCH_FAMILY
+endif # ZERO_BUILD
+
+ifeq ($(PLATFORM), macosx)
+	BUILD_LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin
+	BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin
+	BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
+
+	BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
+	BUILD_LIBJLI_A_java_md_macosx.c_CFLAGS := -x objective-c
+endif
+
+ifeq ($(PLATFORM), windows)
+	BUILD_LIBJLI_FILES += java_md.c
+else ifneq ($(PLATFORM), macosx)
+
+	BUILD_LIBJLI_FILES += java_md_common.c
+	BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c 
+
+	ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
+
+        # if the architecture specific ergo file exists then
+        # use it, else use the generic definitions from ergo.c
+	ifneq ($(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/$(ERGO_ARCH_FILE)),)
+		BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
+	else # !ERGO_ARCH_FILE
+		BUILD_LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
+	endif # ERGO_ARCH_FILE
+endif #WINDOWS
+
+# Names of arch directories
+BUILD_LIBJLI_CFLAGS += -DLIBARCHNAME='"$(LIBARCH)"'
+ifeq ($(PLATFORM), solaris)
+	ifneq (,$(findstring $(ARCH),sparc))
+		BUILD_LIBJLI_CFLAGS += -DLIBARCH32NAME='"sparc"'
+		BUILD_LIBJLI_CFLAGS += -DLIBARCH64NAME='"sparcv9"'
+	else
+		BUILD_LIBJLI_CFLAGS += -DLIBARCH32NAME='"i386"'
+		BUILD_LIBJLI_CFLAGS += -DLIBARCH64NAME='"amd64"'
+	endif
+endif # PLATFORM
+
+ifeq ($(PLATFORM), macosx)
+	BUILD_LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
+endif
+
+ifneq ($(USE_EXTERNAL_LIBZ),true)
+	BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
+	BUILD_LIBJLI_CFLAGS += $(LIBZ_INCLUDE)
+	BUILD_LIBJLI_FILES += \
+		inflate.c \
+		inftrees.c \
+		inffast.c \
+		zadler32.c \
+		zcrc32.c \
+		zutil.c
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJLI,\
+		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
+		INCLUDE_FILES := $(BUILD_LIBJLI_FILES),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(SHARED_LIBRARY_FLAGS) $(BUILD_LIBJLI_CFLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjli/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX := $(LIBZ),\
+		LDFLAGS_SUFFIX_posix := $(LIBDL) -lc,\
+		LDFLAGS_SUFFIX_linux := -lpthread,\
+		LDFLAGS_SUFFIX_windows := \
+			-export:JLI_Launch \
+			-export:JLI_ManifestIterate \
+			-export:JLI_SetTraceLauncher \
+			-export:JLI_ReportErrorMessage \
+			-export:JLI_ReportErrorMessageSys \
+			-export:JLI_ReportMessage \
+			-export:JLI_ReportExceptionDescription \
+			advapi32.lib \
+			comctl32.lib \
+			user32.lib,\
+		LDFLAGS_SUFFIX_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjli,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)))
+
+ifeq ($(HOST_OS), windows)
+    LIBJLI_BINARY := $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
+else
+    LIBJLI_BINARY := $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
+
+    $(LIBJLI_BINARY) : $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
+	$(MKDIR) -p $(@D)
+	$(ECHO) Copying $(@F)
+	$(CP) $< $@
+endif
+BUILD_LIBRARIES += $(LIBJLI_BINARY)
+
+# On windows, the static library has the same suffix as the import library created by
+# with the shared library, so the static library is given a different name. No harm
+# in doing it for all platform to reduce complexity.
+ifneq ($(HOST_OS),macosx)
+    $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
+		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
+		INCLUDE_FILES := $(BUILD_LIBJLI_FILES),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(STATIC_LIBRARY_FLAGS) $(BUILD_LIBJLI_CFLAGS),\
+		ARFLAGS:=$(ARFLAGS),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjli_static,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)))
+else
+    #
+    # On macosx they do partial (incremental) linking of fdlibm
+    #   code it here...rather than add support to NativeCompilation
+    #   as this is first time I see it
+    $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_A,\
+		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
+		INCLUDE_FILES := $(BUILD_LIBJLI_FILES),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HI) $(BUILD_LIBJLI_CFLAGS),\
+		LDFLAGS := -nostdlib -r,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjli_static,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)))
+endif
+
+BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+ifndef OPENJDK
+ifndef JAVASE_EMBEDDED
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJFR,\
+		SRC:=$(JDK_TOPDIR)/src/closed/share/native/oracle/jfr,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjfr/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjfr,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX)
+
+endif
+endif
+
+##########################################################################################
+
+ifndef OPENJDK
+
+BUILD_LIBKCMS_EXCLUDE_FILES :=
+ifeq ($(PLATFORM),windows)
+	BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c
+else
+	BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBKCMS,\
+		SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms,\
+		LANG:=C,\
+		EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES),\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST,\
+		CFLAGS_linux := -Wno-missing-field-initializers,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libkcms/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX_linux := -lpthread,\
+		LDFLAGS_SUFFIX_windows := java.lib advapi32.lib user32.lib version.lib, \
+		LDFLAGS_SUFFIX:= -lm $(LDFLAGS_JDKLIB_SUFFIX),\
+		VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libkcms,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)kcms$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)kcms$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)kcms$(SHARED_LIBRARY_SUFFIX)
+
+endif
+
+##########################################################################################
+
+ifndef OPENJDK
+ifeq ($(PLATFORM), solaris)
+ifneq ($(ARCH), amd64)
+
+ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
+
+SUNWJDGA_MAPFILE :=
+ifneq (,$(findstring $(ARCH),sparc))
+	SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdga/mapfile-vers
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
+		SRC:=$(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
+		LANG:=C, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			-I$(JDK_TOPDIR)/src/share/javavm/export \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/javavm/export \
+			-I$(OPENWIN_HOME)/include, \
+		MAPFILE := $(SUNWJDGA_MAPFILE), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX:= -L$(OPENWIN_LIB)$(ISA_DIR) -R$(OPENWIN_LIB)$(ISA_DIR) -ldga -lX11 $(LIBDL) -lc, \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libsunwjdga, \
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)sunwjdga$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)sunwjdga$(SHARED_LIBRARY_SUFFIX)
+
+endif
+endif
+endif
+endif
+
+##########################################################################################
+
+ifeq ($(BUILD_HEADLESS), true)
+ifneq ($(PLATFORM), windows)
+
+# TODO!!
+X11_PATH := /usr/X11R6
+
+LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \
+                        $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
+			$(JDK_TOPDIR)/src/solaris/native/sun/font \
+			$(JDK_TOPDIR)/src/solaris/native/sun/awt \
+			$(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
+			$(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
+
+LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \
+                          -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
+			  $(CUPS_CFLAGS) \
+			  -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
+			  -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d \
+			  -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
+			  -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
+			  -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
+			  -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
+			  -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+			  -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/jdga \
+                          $(foreach dir,$(LIBAWT_HEADLESS_DIRS),-I$(dir))
+
+LIBAWT_HEADLESS_FILES := \
+	awt_Font.c \
+	HeadlessToolkit.c \
+	fontpath.c \
+	VDrawingArea.c \
+	X11Color.c \
+	X11Renderer.c \
+	X11PMBlitLoops.c \
+	X11SurfaceData.c \
+	X11FontScaler_md.c \
+	X11TextRenderer_md.c \
+        OGLBlitLoops.c \
+        OGLBufImgOps.c \
+        OGLContext.c \
+        OGLFuncs.c \
+        OGLMaskBlit.c \
+        OGLMaskFill.c \
+        OGLPaints.c \
+        OGLRenderQueue.c \
+        OGLRenderer.c \
+        OGLSurfaceData.c \
+        OGLTextRenderer.c \
+        OGLVertexCache.c \
+        GLXGraphicsConfig.c \
+        GLXSurfaceData.c \
+        AccelGlyphCache.c \
+	CUPSfuncs.c
+
+LIBAWT_HEADLESS_LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) -lawt -lm
+
+LIBAWT_HEADLESS_REORDER := 
+ifeq ($(PLATFORM), solaris)
+	ifneq ($(ARCH), amd64)
+		LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/reorder-$(ARCH)
+	endif
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS,\
+		SRC:=$(LIBAWT_HEADLESS_DIRS),\
+		INCLUDE_FILES := $(LIBAWT_HEADLESS_FILES),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) $(LIBAWT_HEADLESS_CFLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		REORDER := $(LIBAWT_HEADLESS_REORDER), \
+		LDFLAGS_SUFFIX := $(LIBAWT_HEADLESS_LDFLAGS_SUFFIX),\
+		LDFLAGS_SUFFIX_posix := $(LIBDL),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libawt_headless,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX) : \
+	$(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX)
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
+
+endif
+endif
+
+##########################################################################################
+
+ifneq ($(PLATFORM), windows)
+ifndef BUILD_HEADLESS_ONLY
+
+LIBAWT_XAWT_DIRS := \
+		$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+		$(JDK_TOPDIR)/src/share/native/sun/awt/utility \
+		$(JDK_TOPDIR)/src/share/native/sun/font \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/font \
+		$(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d/opengl \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d/x11 \
+		$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/xawt \
+
+LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \
+        -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
+	$(CUPS_CFLAGS) \
+	$(foreach dir,$(LIBAWT_XAWT_DIRS),-I$(dir)) \
+	-I$(JDK_TOPDIR)/src/share/native/sun/java2d \
+	-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d \
+	-I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
+	-I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
+	-I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
+	-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
+	-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+	-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/jdga
+
+ifeq ($(PLATFORM),solaris)
+	LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
+endif
+
+ifeq ($(MILESTONE),internal)
+	LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
+endif
+
+LIBAWT_XAWT_FILES := \
+	XlibWrapper.c \
+	XWindow.c \
+	XToolkit.c \
+	X11Color.c \
+	X11SurfaceData.c \
+	awt_GraphicsEnv.c \
+	awt_InputMethod.c \
+	robot_common.c \
+	awt_Robot.c \
+        list.c \
+        multiVis.c \
+	initIDs.c \
+	awt_util.c \
+	awt_Desktop.c \
+	awt_UNIXToolkit.c \
+	X11FontScaler_md.c \
+	X11TextRenderer_md.c \
+	fontpath.c \
+	awt_Insets.c \
+	awt_Event.c \
+	X11Renderer.c \
+	X11PMBlitLoops.c \
+	OGLBlitLoops.c \
+	OGLBufImgOps.c \
+	OGLContext.c \
+	OGLFuncs.c \
+	OGLMaskBlit.c \
+	OGLMaskFill.c \
+	OGLPaints.c \
+	OGLRenderQueue.c \
+	OGLRenderer.c \
+	OGLSurfaceData.c \
+	OGLTextRenderer.c \
+	OGLVertexCache.c \
+	GLXGraphicsConfig.c \
+	GLXSurfaceData.c \
+	AccelGlyphCache.c \
+	awt_Font.c \
+	multi_font.c \
+	awt_AWTEvent.c \
+	awt_DrawingSurface.c \
+	jawt.c \
+	CUPSfuncs.c \
+	debug_assert.c \
+	debug_mem.c \
+	debug_trace.c \
+	debug_util.c \
+	awt_Plugin.c \
+	gtk2_interface.c \
+        swing_GTKEngine.c \
+        swing_GTKStyle.c \
+        rect.c \
+	sun_awt_X11_GtkFileDialogPeer.c \
+	XRSurfaceData.c \
+	XRBackendNative.c
+
+LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi  -ljava -lverify -ljvm -lc
+
+ifeq ($(PLATFORM), linux)
+	LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
+endif
+
+ifeq ($(PLATFORM), macosx)
+	LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT,\
+		SRC:=$(LIBAWT_XAWT_DIRS),\
+		INCLUDE_FILES := $(LIBAWT_XAWT_FILES),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) $(LIBAWT_XAWT_CFLAGS) \
+                        $(X_CFLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_xawt/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN) \
+			 $(X_LIBS),\
+		LDFLAGS_solaris:=-L$(OPENWIN_HOME)/sfw/lib$(ISA_DIR) -L$(OPENWIN_LIB)$(ISA_DIR) \
+				 -R$(OPENWIN_HOME)/sfw/lib$(ISA_DIR) -R$(OPENWIN_LIB)$(ISA_DIR) \
+				 -R/usr/dt/lib$(ISA_DIR),\
+		LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libawt_xawt,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX) : \
+	$(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX) : \
+	$(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX)
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX)
+
+endif
+endif
+
+##########################################################################################
+
+ifndef BUILD_HEADLESS_ONLY
+LIBSPLASHSCREEN_DIRS := \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/giflib \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen \
+        $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt/splashscreen
+
+LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
+	$(foreach dir,$(LIBSPLASHSCREEN_DIRS),-I$(dir))
+
+ifeq ($(PLATFORM), macosx)
+	LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
+                                  $(LIBSPLASHSCREEN_CFLAGS) \
+                                  -F/System/Library/Frameworks/JavaVM.framework/Frameworks
+	LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
+	LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
+
+	LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
+	LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
+	LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
+	LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
+	LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
+	LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
+	LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
+
+else ifneq ($(PLATFORM), windows)
+	LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
+else
+	LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
+endif
+
+LIBSPLASHSCREEN_FILES := \
+	java_awt_SplashScreen.c \
+	splashscreen_gfx_impl.c \
+	splashscreen_gif.c \
+	splashscreen_impl.c \
+	splashscreen_jpeg.c \
+	splashscreen_png.c \
+	png.c \
+	pngerror.c \
+	pngget.c \
+	pngmem.c  \
+	pngpread.c \
+	pngread.c \
+	pngrio.c \
+	pngrtran.c \
+	pngrutil.c \
+	pngset.c \
+	pngtrans.c \
+	pngwio.c \
+	pngwrite.c \
+	pngwtran.c \
+	pngwutil.c \
+	dgif_lib.c \
+	gif_err.c \
+	gifalloc.c \
+	jcomapi.c \
+	jdapimin.c \
+	jdapistd.c \
+	jdcoefct.c \
+	jdcolor.c \
+	jddctmgr.c \
+	jdhuff.c \
+	jdinput.c \
+	jdmainct.c \
+	jdmarker.c \
+	jdmaster.c \
+	jdmerge.c \
+	jdphuff.c \
+	jdpostct.c \
+	jdsample.c \
+	jerror.c \
+	jidctflt.c \
+	jidctfst.c \
+	jidctint.c \
+	jidctred.c \
+	jmemmgr.c \
+	jmemnobs.c \
+	jquant1.c \
+	jquant2.c \
+	jutils.c \
+	jcapimin.c \
+	jcapistd.c \
+	jccoefct.c \
+	jccolor.c \
+	jcdctmgr.c \
+	jchuff.c \
+	jcinit.c \
+	jcmainct.c \
+	jcmarker.c \
+	jcmaster.c \
+	jcparam.c \
+	jcphuff.c \
+	jcprepct.c \
+	jcsample.c \
+	jctrans.c \
+	jdtrans.c \
+	jfdctflt.c \
+	jfdctfst.c \
+	jfdctint.c
+
+ifneq ($(PLATFORM), macosx)
+LIBSPLASHSCREEN_FILES += splashscreen_sys.c
+else
+LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
+LIBSPLASHSCREEN_FILES += splashscreen_sys.m
+endif
+
+LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=
+
+ifneq ($(USE_EXTERNAL_LIBZ),true)
+	LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
+	LIBSPLASHSCREEN_CFLAGS += $(LIBZ_INCLUDE)
+	LIBSPLASHSCREEN_FILES += \
+		compress.c \
+		deflate.c \
+		gzclose.c \
+		gzlib.c \
+		gzread.c \
+		gzwrite.c \
+		infback.c \
+		inffast.c \
+		inflate.c \
+		inftrees.c \
+		trees.c \
+		uncompr.c \
+		zadler32.c \
+		zcrc32.c \
+		zutil.c
+endif
+
+ifeq ($(PLATFORM), macosx)
+	LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
+				  -framework ApplicationServices \
+				  -framework Foundation \
+				  -framework Cocoa \
+                                  -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+				  -framework JavaNativeFoundation
+else ifneq ($(PLATFORM), windows)
+	LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(ISA_DIR) -lX11 -lXext $(LIBM) -lpthread $(LIBDL)
+else # PLATFORM
+	LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll
+endif # PLATFORM
+
+$(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\
+		SRC:=$(LIBSPLASHSCREEN_DIRS),\
+		INCLUDE_FILES := $(LIBSPLASHSCREEN_FILES),\
+		LANG:=C,\
+		CFLAGS:= $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
+		LDFLAGS:= $(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libsplashscreen,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)splashscreen$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)splashscreen$(SHARED_LIBRARY_SUFFIX)
+
+ifeq ($(PLATFORM),macosx)
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)splashscreen$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX) 
+endif
+
+endif
+
+##########################################################################################
+
+LIBAWT_DIRS := \
+	$(JDK_TOPDIR)/src/share/native/sun/awt \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/image \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/image/gif \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/shell \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/utility \
+	$(JDK_TOPDIR)/src/share/native/sun/java2d \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d \
+	$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
+	$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
+	$(JDK_TOPDIR)/src/share/native/sun/awt/image \
+	$(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d/opengl \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d/x11 \
+	$(JDK_TOPDIR)/src/share/native/sun/font \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/windows \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d/windows \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d/d3d
+
+
+LIBAWT_CFLAGS := -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
+	$(foreach dir,$(LIBAWT_DIRS),-I$(dir))
+
+LIBAWT_FILES := \
+	gifdecoder.c \
+	imageInitIDs.c \
+	img_globals.c \
+	SurfaceData.c \
+	Region.c \
+	BufImgSurfaceData.c \
+	Disposer.c \
+	Trace.c \
+	GraphicsPrimitiveMgr.c \
+	Blit.c \
+	BlitBg.c \
+	ScaledBlit.c \
+	FillRect.c \
+	FillSpans.c \
+	FillParallelogram.c \
+	DrawParallelogram.c \
+	DrawLine.c \
+	DrawRect.c \
+	DrawPolygons.c \
+	DrawPath.c \
+	FillPath.c \
+	ProcessPath.c \
+	MaskBlit.c \
+	MaskFill.c \
+	TransformHelper.c \
+	AlphaMath.c \
+	AlphaMacros.c \
+	AnyByte.c \
+	ByteBinary1Bit.c \
+	ByteBinary2Bit.c \
+	ByteBinary4Bit.c \
+	ByteIndexed.c \
+	ByteGray.c \
+	Index8Gray.c \
+	Index12Gray.c \
+	AnyShort.c \
+	Ushort555Rgb.c \
+	Ushort565Rgb.c \
+	Ushort4444Argb.c \
+	Ushort555Rgbx.c \
+	UshortGray.c \
+	UshortIndexed.c \
+	Any3Byte.c \
+	ThreeByteBgr.c \
+	AnyInt.c \
+	IntArgb.c \
+	IntArgbPre.c \
+	IntArgbBm.c \
+	IntRgb.c \
+	IntBgr.c \
+	IntRgbx.c \
+	Any4Byte.c \
+	FourByteAbgr.c \
+	FourByteAbgrPre.c \
+	BufferedMaskBlit.c \
+	BufferedRenderPipe.c \
+	ShapeSpanIterator.c \
+	SpanClipRenderer.c \
+	awt_ImageRep.c \
+	awt_ImagingLib.c \
+	awt_Mlib.c \
+	awt_parseImage.c \
+	DataBufferNative.c \
+	dither.c \
+	debug_assert.c \
+	debug_mem.c \
+	debug_trace.c \
+	debug_util.c
+
+ifneq (,$(filter $(PLATFORM), solaris linux))
+	LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c
+endif
+
+ifeq ($(PLATFORM),macosx)
+	LIBAWT_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/apple/resources
+	LIBAWT_FILES += awt_LoadLibrary.c MacOSXResourceBundle.m
+	LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
+
+	LIBAWT_MacOSXResourceBundle.m_CFLAGS := -O0
+endif
+
+ifeq ($(PLATFORM)-$(ARCH_FAMILY), solaris-sparc)
+#
+# TODO...
+#
+
+#	FILES_c += $(FILES_2D_vis)
+#	ASFLAGS += -P
+#	FILES_s += mlib_v_ImageCopy_blk.s
+#	INLINE_VIS = $(PLATFORM_SRC)/native/sun/awt/medialib/vis_$(ARCH_DATA_MODEL).il
+#	CFLAGS_sparcv9 = -DMLIB_OS64BIT
+#	CFLAGS += $(CFLAGS_$(ARCH)) -DMLIB_ADD_SUFF $(INLINE_VIS)
+else
+	LIBAWT_FILES += MapAccelFunc.c
+endif
+
+ifneq ($(PLATFORM),solaris)
+	LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
+endif
+
+LIBAWT_LANG := C
+
+ifeq ($(PLATFORM),windows)
+	LIBAWT_FILES += AccelGlyphCache.c \
+			ShaderList.c \
+			CmdIDList.cpp \
+			Hashtable.cpp \
+			GDIHashtable.cpp \
+			Devices.cpp \
+			ObjectList.cpp \
+			GDIBlitLoops.cpp \
+			GDIRenderer.cpp \
+			GDIWindowSurfaceData.cpp \
+			WindowsFlags.cpp \
+			WPrinterJob.cpp \
+			awt_%.cpp \
+			D3DBlitLoops.cpp \
+			D3DBufImgOps.cpp \
+			D3DContext.cpp \
+			D3DGlyphCache.cpp \
+			D3DGraphicsDevice.cpp \
+			D3DMaskBlit.cpp \
+			D3DMaskCache.cpp \
+			D3DMaskFill.cpp \
+			D3DPipelineManager.cpp \
+			D3DPaints.cpp \
+			D3DRenderer.cpp \
+			D3DRenderQueue.cpp \
+			D3DResourceManager.cpp \
+			D3DSurfaceData.cpp \
+			D3DTextRenderer.cpp \
+			D3DVertexCacher.cpp \
+			ShellFolder2.cpp \
+			ThemeReader.cpp \
+			ComCtl32Util.cpp \
+			DllUtil.cpp \
+			initIDs.cpp \
+			MouseInfo.cpp \
+			rect.c
+	LIBAWT_LANG := C++
+	LIBAWT_CFLAGS += $(GX_OPTION) -DUNICODE -D_UNICODE
+	ifeq ($(ARCH_DATA_MODEL), 64)
+		LIBAWT_CFLAGS += -DMLIB_OS64BIT
+	endif
+
+	ifdef OPENJDK
+		LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/windows/resource/icons"
+	else
+		LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
+	endif
+	LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/windows/awt.rc
+endif
+
+ifeq ($(MILESTONE), internal)
+	LIBAWT_CFLAGS += -DINTERNAL_BUILD
+endif
+
+LIBAWT_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt/mapfile-vers
+ifeq ($(PLATFORM),linux)
+	LIBAWT_MAPFILE :=
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBAWT,\
+		SRC:=$(LIBAWT_DIRS),\
+		INCLUDE_FILES := $(LIBAWT_FILES),\
+		LANG:=$(LIBAWT_LANG),\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) $(LIBAWT_CFLAGS),\
+		MAPFILE := $(LIBAWT_MAPFILE), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_windows:=advapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
+				 imm32.lib ole32.lib uuid.lib shell32.lib \
+				 comdlg32.lib winmm.lib comctl32.lib \
+				 shlwapi.lib delayimp.lib java.lib jvm.lib \
+				 /DELAYLOAD:user32.dll /DELAYLOAD:gdi32.dll \
+				 /DELAYLOAD:shell32.dll /DELAYLOAD:winmm.dll \
+				 /DELAYLOAD:winspool.drv /DELAYLOAD:imm32.dll \
+				 /DELAYLOAD:ole32.dll /DELAYLOAD:comdlg32.dll \
+				 /DELAYLOAD:comctl32.dll /DELAYLOAD:shlwapi.dll,\
+		LDFLAGS_macosx :=-framework Cocoa \
+				 -framework OpenGL \
+				 -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+				 -framework JavaNativeFoundation \
+				 -framework JavaRuntimeSupport \
+				 -framework ApplicationServices \
+				 -framework AudioToolbox,\
+		LDFLAGS_solaris := -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_LIB)$(ISA_DIR),\
+		LDFLAGS_SUFFIX_posix := -ljvm $(LIBM) -ljava $(LIBDL),\
+		VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE),\
+		RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
+			  /D "JDK_FNAME=awt.dll" \
+			  /D "JDK_INTERNAL_NAME=awt" \
+			  /D "JDK_FTYPE=0x2L",\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libawt,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+ifndef OPENJDK
+
+LIBDCPR_SRC_DIRS := \
+	$(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \
+	$(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \
+	$(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \
+	$(JDK_TOPDIR)/src/closed/share/native/sun/dc/util
+
+LIBDCPR_CFLAGS := $(foreach dir,$(LIBDCPR_SRC_DIRS),-I$(dir)) \
+	          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBDCPR,\
+		SRC:=$(LIBDCPR_SRC_DIRS),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			$(LIBDCPR_CFLAGS), \
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdcpr/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(LIBM)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX_posix := $(LIBDL) -lm,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libdcpr,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)dcpr$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)dcpr$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)dcpr$(SHARED_LIBRARY_SUFFIX)
+
+endif
+
+##########################################################################################
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC,\
+		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
+                     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/smartcardio,\
+		LANG:=C,\
+		CFLAGS_posix:= -D__sun_jdk,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                     -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
+                     -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/smartcardio\
+                     -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/smartcardio/MUSCLE,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2pcsc/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX_posix := $(LIBDL), \
+		LDFLAGS_SUFFIX_windows := winscard.lib,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libj2pcsc,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)j2pcsc$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)j2pcsc$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+ifneq ($(PLATFORM), windows)
+$(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
+		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
+                     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/jgss/wrapper,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                     -I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
+                     -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/jgss/wrapper,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2gss/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX := $(LIBDL), \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libj2gss,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)j2gss$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)j2gss$(SHARED_LIBRARY_SUFFIX)
+endif
+
+##########################################################################################
+
+BUILD_LIBKRB5_NAME :=
+ifeq ($(PLATFORM), windows)
+     BUILD_LIBKRB5_NAME := w2k_lsa_auth
+     BUILD_LIBKRB5_FILES := NativeCreds.c WindowsDirectory.c
+     BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/krb5
+     BUILD_LIBKRB5_LIBS := Secur32.lib netapi32.lib \
+	kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
+	advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib \
+	odbccp32.lib wsock32.lib
+else ifeq ($(PLATFORM), macosx)
+     BUILD_LIBKRB5_NAME := osxkrb5
+     BUILD_LIBKRB5_FILES := nativeccache.c
+     BUILD_LIBKRB5_LIBS := -framework Kerberos
+endif
+
+ifneq ($(BUILD_LIBKRB5_NAME),)
+$(eval $(call SetupNativeCompilation,BUILD_LIBKRB5,\
+		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
+                     $(BUILD_LIBKRB5_SRC) ,\
+		INCLUDE_FILES := $(BUILD_LIBKRB5_FILES),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		        -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/krb5 ,\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS) ,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libkrb5,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)$(BUILD_LIBKRB5_NAME)$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)$(BUILD_LIBKRB5_NAME)$(SHARED_LIBRARY_SUFFIX)
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM), windows)
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI,\
+		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/mscapi \
+		     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/mscapi,\
+		INCLUDE_FILES := security.cpp, \
+		LANG:=C++,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		        -I$(JDK_TOPDIR)/src/share/native/sun/security/mscapi \
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/mscapi ,\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX := Crypt32.Lib advapi32.lib,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libsunmscapi,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)sunmscapi$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)sunmscapi$(SHARED_LIBRARY_SUFFIX)
+endif
+
+##########################################################################################
+
+ifneq ($(PLATFORM)-$(ARCH_DATA_MODEL), windows-64)
+$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11,\
+		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
+                     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/pkcs11 \
+                     $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
+                     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/pkcs11/wrapper,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		        -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
+		        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/pkcs11 \
+		        -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/pkcs11/wrapper,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2pkcs11/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX_posix := $(LIBDL), \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libj2pkcs11,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)j2pkcs11$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)j2pkcs11$(SHARED_LIBRARY_SUFFIX)
+endif
+
+##########################################################################################
+
+ifndef DISABLE_INTREE_EC
+#
+# TODO Set DISABLE_INTREE_EC in configure if src/share/native/sun/security/ec/impl
+#      is not present
+#
+BUILD_LIBSUNEC_FLAGS := -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B \
+                        -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \
+                        -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC,\
+		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/ec \
+                     $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \
+		LANG := C++, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) $(BUILD_LIBSUNEC_FLAGS),\
+		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(CXX_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) $(BUILD_LIBSUNEC_FLAGS),\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsunec/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX := $(LIBCXX),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libsunec,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)sunec$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)sunec$(SHARED_LIBRARY_SUFFIX)
+endif
+
+##########################################################################################
+
+LIBJSOUND_SRC_DIRS := \
+	$(JDK_TOPDIR)/src/share/native/com/sun/media/sound \
+	$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/com/sun/media/sound
+
+LIBJSOUND_SRC_FILES := Utilities.c Platform.c
+
+LIBJSOUND_LANG := C
+LIBJSOUND_CFLAGS := $(foreach dir,$(LIBJSOUND_SRC_DIRS),-I$(dir))
+
+EXTRA_SOUND_JNI_LIBS := 
+
+LIBJSOUND_MIDIFILES := \
+	MidiInDevice.c \
+	MidiInDeviceProvider.c \
+	MidiOutDevice.c \
+	MidiOutDeviceProvider.c \
+	PlatformMidi.c
+
+# files needed for ports
+LIBJSOUND_PORTFILES := \
+	PortMixerProvider.c \
+	PortMixer.c
+
+# files needed for direct audio
+LIBJSOUND_DAUDIOFILES := \
+	DirectAudioDeviceProvider.c \
+	DirectAudioDevice.c
+
+ifeq ($(PLATFORM), windows)
+	EXTRA_SOUND_JNI_LIBS += jsoundds
+	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \
+                            -DUSE_PLATFORM_MIDI_OUT=TRUE \
+                            -DUSE_PLATFORM_MIDI_IN=TRUE \
+                            -DUSE_PORTS=TRUE
+	LIBJSOUND_SRC_FILES += \
+		PLATFORM_API_WinOS_MidiIn.cpp \
+		PLATFORM_API_WinOS_MidiOut.c \
+		PLATFORM_API_WinOS_Util.c \
+		PLATFORM_API_WinOS_Ports.c
+	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
+	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
+endif # PLATFORM windows
+
+ifeq ($(PLATFORM), linux)
+	EXTRA_SOUND_JNI_LIBS += jsoundalsa
+	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
+endif # PLATFORM linux
+
+ifeq ($(PLATFORM), macosx)
+	LIBJSOUND_LANG := C++
+	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \
+                            -DUSE_PORTS=TRUE \
+                            -DUSE_DAUDIO=TRUE \
+                            -DUSE_PLATFORM_MIDI_OUT=TRUE \
+                            -DUSE_PLATFORM_MIDI_IN=TRUE
+	LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/sun/media/sound
+	LIBJSOUND_SRC_FILES += \
+		PLATFORM_API_MacOSX_Utils.cpp \
+		PLATFORM_API_MacOSX_PCM.cpp \
+		PLATFORM_API_MacOSX_Ports.cpp \
+                PLATFORM_API_MacOSX_MidiIn.c \
+                PLATFORM_API_MacOSX_MidiOut.c \
+                PLATFORM_API_MacOSX_MidiUtils.c
+	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
+	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
+	LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
+endif # PLATFORM macosx
+
+ifeq ($(PLATFORM), solaris)
+	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \
+                            -DUSE_PORTS=TRUE \
+                            -DUSE_DAUDIO=TRUE
+	LIBJSOUND_SRC_FILES += \
+		PLATFORM_API_SolarisOS_Utils.c \
+		PLATFORM_API_SolarisOS_Ports.c \
+		PLATFORM_API_SolarisOS_PCM.c
+	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
+	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
+	LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
+endif # PLATFORM solaris
+
+
+ifeq ($(JVM_VARIANT_ZERO), true)
+	LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO
+else
+  ifeq ($(ARCH), i586)
+	LIBJSOUND_CFLAGS += -DX_ARCH=X_I586
+  endif # ARCH i586
+
+  ifeq ($(ARCH), sparc)
+	LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC
+  endif # ARCH sparc
+
+  ifeq ($(ARCH), sparcv9)
+	LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9
+  endif # ARCH sparcv9
+
+  ifeq ($(ARCH), amd64)
+	LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64
+  endif # ARCH amd64
+
+  ifeq ($(ARCH), arm)
+	LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM
+  endif # ARCH arm
+
+  ifeq ($(ARCH), ppc)
+	LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC
+  endif # ARCH ppc
+endif
+
+LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND,\
+		SRC:=$(LIBJSOUND_SRC_DIRS),\
+		INCLUDE_FILES := $(LIBJSOUND_SRC_FILES),\
+		LANG:=$(LIBJSOUND_LANG),\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			$(LIBJSOUND_CFLAGS), \
+		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(CXX_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			$(LIBJSOUND_CFLAGS), \
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsound/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_windows:=java.lib advapi32.lib winmm.lib,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX_solaris:=-lc ,\
+		LDFLAGS_SUFFIX_macosx := -framework CoreAudio -framework CoreFoundation \
+             -framework CoreServices -framework AudioUnit $(LIBCXX) \
+             -framework CoreMIDI -framework AudioToolbox ,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjsound,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jsound$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jsound$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jsound$(SHARED_LIBRARY_SUFFIX)
+
+##########################################################################################
+
+ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)),)
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
+		SRC:=$(LIBJSOUND_SRC_DIRS),\
+		INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
+                                $(LIBJSOUND_DAUDIOFILES) \
+				PLATFORM_API_LinuxOS_ALSA_CommonUtils.c   \
+				PLATFORM_API_LinuxOS_ALSA_PCM.c     \
+				PLATFORM_API_LinuxOS_ALSA_PCMUtils.c   \
+				PLATFORM_API_LinuxOS_ALSA_MidiIn.c  \
+				PLATFORM_API_LinuxOS_ALSA_MidiOut.c \
+				PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \
+				PLATFORM_API_LinuxOS_ALSA_Ports.c,\
+		LANG := C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			$(LIBJSOUND_CFLAGS) \
+			-DUSE_DAUDIO=TRUE \
+			-DUSE_PORTS=TRUE  \
+			-DUSE_PLATFORM_MIDI_OUT=TRUE \
+			-DUSE_PLATFORM_MIDI_IN=TRUE, \
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) -lasound,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjsoundalsa,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jsoundalsa$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jsoundalsa$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jsoundalsa$(SHARED_LIBRARY_SUFFIX)
+
+endif
+
+##########################################################################################
+
+ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)),)
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS,\
+		SRC:=$(LIBJSOUND_SRC_DIRS),\
+		INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \
+				PLATFORM_API_WinOS_DirectSound.cpp, \
+		LANG := C++,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			$(LIBJSOUND_CFLAGS) \
+			-DUSE_DAUDIO=TRUE, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libjsoundds,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jsoundds$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jsoundds$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)jsoundds$(SHARED_LIBRARY_SUFFIX)
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM), solaris)
+ifndef OPENJDK
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO,\
+		SRC:=$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto,\
+		LANG := C,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			-I$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto ,\
+		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2ucrypto/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX:=$(LIBDL),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libj2ucrypto,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)j2ucrypto$(SHARED_LIBRARY_SUFFIX)))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)j2ucrypto$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)j2ucrypto$(SHARED_LIBRARY_SUFFIX)
+
+endif
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM), macosx)
+
+LIBAPPLESCRIPTENGINE_FILES := \
+	AppleScriptEngine.m \
+        AppleScriptExecutionContext.m \
+        AS_NS_ConversionUtils.m \
+        NS_Java_ConversionUtils.m
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE,\
+		SRC:=$(JDK_TOPDIR)/src/macosx/native/apple/applescript,\
+		LANG := C,\
+		INCLUDE_FILES:=$(LIBAPPLESCRIPTENGINE_FILES),\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			-I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
+			-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+                        -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX:= \
+    -framework Cocoa \
+    -framework Carbon \
+    -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+    -framework JavaNativeFoundation, \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libAppleScriptEngine,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)AppleScriptEngine$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)AppleScriptEngine$(SHARED_LIBRARY_SUFFIX)
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM), macosx)
+
+LIBOSXAPP_FILES := \
+	NSApplicationAWT.m \
+	QueuingApplicationDelegate.m \
+	PropertiesUtilities.m \
+	ThreadUtilities.m
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP,\
+		SRC:=$(JDK_TOPDIR)/src/macosx/native/sun/osxapp,\
+		LANG := C,\
+		INCLUDE_FILES:=$(LIBOSXAPP_FILES),\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+			-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
+                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+                        -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX_macosx := \
+	-framework Accelerate \
+	-framework ApplicationServices \
+	-framework AudioToolbox \
+	-framework Carbon \
+	-framework Cocoa \
+	-framework Security \
+	-framework ExceptionHandling \
+        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+	-framework JavaNativeFoundation \
+	-framework JavaRuntimeSupport \
+	-framework OpenGL \
+	-framework IOSurface \
+	-framework QuartzCore, \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libosxapp,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM), macosx)
+
+LIBOSX_FILES := \
+    Dispatch.m \
+    CFileManager.m \
+    KeystoreImpl.m \
+    JavaAppLauncher.m \
+    MacOSXPreferencesFile.m \
+    SCDynamicStoreConfig.m
+
+LIBOSX_DIRS := \
+  $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \
+  $(JDK_TOPDIR)/src/macosx/native/java/util \
+  $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \
+  $(JDK_TOPDIR)/src/macosx/native/apple/security \
+  $(JDK_TOPDIR)/src/macosx/native/apple/launcher
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBOSX,\
+		SRC:=$(LIBOSX_DIRS),\
+		LANG := C,\
+		INCLUDE_FILES:=$(LIBOSX_FILES),\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        $(foreach dir,$(LIBOSX_DIRS),-I$(dir)) \
+                        -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
+                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+                        -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX_macosx := \
+    -losxapp \
+    -framework Cocoa \
+    -framework ApplicationServices \
+    -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+    -framework JavaNativeFoundation \
+    -framework JavaRuntimeSupport \
+    -framework Security \
+    -framework SystemConfiguration \
+    $(LDFLAGS_JDKLIB_SUFFIX), \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libosx,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osx$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osx$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osx$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX) 
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osx$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM), macosx)
+
+LIBAWT_LWAWT_FILES := \
+        awt.m \
+        ApplicationDelegate.m \
+        CFRetainedResource.m \
+        CGLGraphicsConfig.m \
+        CGLSurfaceData.m \
+        CGLLayer.m \
+        CGraphicsConfig.m \
+        CGraphicsDevice.m \
+        CGraphicsEnv.m \
+        CCharToGlyphMapper.m \
+        CSystemColors.m \
+        AWTFont.m \
+        CGGlyphOutlines.m \
+        CGGlyphImages.m \
+        CoreTextSupport.m \
+        AWTStrike.m \
+        InitIDs.m \
+        AWTEvent.m \
+        AWTView.m \
+        AWTWindow.m \
+        AWTSurfaceLayers.m \
+        CCursorManager.m \
+        CClipboard.m \
+        CDataTransferer.m \
+        CDragSource.m \
+        CDragSourceContextPeer.m \
+        CDropTarget.m \
+        CDropTargetContextPeer.m \
+        CInputMethod.m \
+        CDesktopPeer.m \
+        OSVersion.m \
+        DnDUtilities.m \
+        CFileDialog.m \
+        CImage.m \
+        CMenu.m \
+        CMenuBar.m \
+        CMenuComponent.m \
+        CMenuItem.m \
+        CPopupMenu.m \
+        CRobot.m \
+        CTrayIcon.m \
+        CWrapper.m \
+        JavaAccessibilityAction.m \
+        JavaAccessibilityUtilities.m \
+        JavaComponentAccessibility.m \
+        JavaTextAccessibility.m \
+        LWCToolkit.m \
+        GeomUtilities.m \
+        CPrinterJob.m \
+        PrintModel.m \
+        PrinterSurfaceData.m \
+        PrinterView.m \
+        QuartzSurfaceData.m \
+        QuartzRenderer.m \
+        CTextPipe.m \
+        ImageSurfaceData.m \
+        awt_DrawingSurface.m \
+        \
+        OGLBlitLoops.c \
+        OGLBufImgOps.c \
+        OGLContext.c \
+        OGLFuncs.c \
+        OGLMaskBlit.c \
+        OGLMaskFill.c \
+        OGLPaints.c \
+        OGLRenderQueue.c \
+        OGLRenderer.c \
+        OGLSurfaceData.c \
+        OGLTextRenderer.c \
+        OGLVertexCache.c \
+        AccelGlyphCache.c \
+        CUPSfuncs.c
+
+
+LIBAWT_LWAWT_DIRS := \
+  $(JDK_TOPDIR)/src/macosx/native/sun/awt \
+  $(JDK_TOPDIR)/src/macosx/native/sun/font \
+  $(JDK_TOPDIR)/src/macosx/native/sun/java2d/opengl \
+  $(JDK_TOPDIR)/src/solaris/native/sun/awt \
+  $(JDK_TOPDIR)/src/share/native/sun/font \
+  $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT,\
+		SRC:=$(LIBAWT_LWAWT_DIRS),\
+		LANG := C,\
+		INCLUDE_FILES:=$(LIBAWT_LWAWT_FILES),\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        $(foreach dir,$(LIBAWT_LWAWT_DIRS),-I$(dir)) \
+                        -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
+                        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
+                        -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d \
+                        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
+                        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
+                        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
+                        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
+                        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+                        -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX_macosx := \
+	-lawt -lmlib_image -losxapp $(LDFLAGS_JDKLIB_SUFFIX) $(LIBM) \
+	-framework Accelerate \
+	-framework ApplicationServices \
+	-framework AudioToolbox \
+	-framework Carbon \
+	-framework Cocoa \
+	-framework Security \
+	-framework ExceptionHandling \
+        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+	-framework JavaNativeFoundation \
+	-framework JavaRuntimeSupport \
+	-framework OpenGL \
+        -framework QuartzCore ,\
+		BIN:=$(JDK_OUTPUTDIR)/objs/libawt_lwawt,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX) 
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)mlib_image$(SHARED_LIBRARY_SUFFIX) 
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX) 
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM), macosx)
+
+LIBOSXUI_FILES := \
+        AquaFileView.m \
+        AquaLookAndFeel.m \
+        AquaNativeResources.m \
+        JRSUIConstantSync.m \
+        JRSUIController.m \
+        JRSUIFocus.m \
+        ScreenPopupFactory.m \
+        ScreenMenu.m
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI,\
+		SRC:=$(JDK_TOPDIR)/src/macosx/native/com/apple/laf,\
+		LANG := C,\
+		INCLUDE_FILES:=$(LIBOSXUI_FILES),\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+                        -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
+			-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
+			-I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
+                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX_macosx := \
+    -lawt -losxapp -lawt_lwawt \
+    -framework Cocoa \
+    -framework Carbon \
+    -framework ApplicationServices \
+    -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+    -framework JavaNativeFoundation \
+    -framework JavaRuntimeSupport, \
+		BIN:=$(JDK_OUTPUTDIR)/objs/libosxui,\
+		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osxui$(SHARED_LIBRARY_SUFFIX)))
+
+BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxui$(SHARED_LIBRARY_SUFFIX)
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osxui$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX) 
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osxui$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX) 
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osxui$(SHARED_LIBRARY_SUFFIX) : \
+  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX) 
+
+#$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)osxui$(SHARED_LIBRARY_SUFFIX) : \
+#  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) 
+
+endif
+
+##########################################################################################
+
 all: $(COPY_FILES) $(BUILD_LIBRARIES)
 
 .PHONY: all
--- a/makefiles/CopyFiles.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/CopyFiles.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -24,9 +24,15 @@
 #
 
 INCLUDEDIR = $(JDK_OUTPUTDIR)/include
-# TODO: Platform dir needs to be "win32" on windows /erikj
+
 PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM)
 
+ifeq ($(PLATFORM), windows)
+     PLATFORM_INCLUDE = $(INCLUDEDIR)/win32
+else ifeq ($(PLATFORM), macosx)
+     PLATFORM_INCLUDE = $(INCLUDEDIR)/darwin
+endif
+
 #
 # Copy exported header files to outputdir.
 #
@@ -41,12 +47,12 @@
 
 $(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 $(PLATFORM_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/javavm/export/%.h
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 COPY_FILES = $(H_TARGET_FILES)
@@ -58,7 +64,7 @@
 
 $(SERVICETAG_LIBDIR)/jdk_header.png: $(JDK_TOPDIR)/src/share/classes/com/sun/servicetag/resources/jdk_header.png
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 	$(CHMOD) 444 $@
 
@@ -73,13 +79,13 @@
 
 $(MGMT_LIBDIR)/management.properties: $(MGMT_LIB_SRC)/management.properties
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 	$(CHMOD) 644 $@
 
 $(MGMT_LIBDIR)/%: $(MGMT_LIB_SRC)/%
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 	$(CHMOD) 444 $@
 
@@ -91,7 +97,7 @@
 
 $(LIBDIR)/logging.properties: $(LOGGING_LIB_SRC)/logging.properties
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 COPY_FILES += $(LIBDIR)/logging.properties
@@ -104,9 +110,9 @@
 PSFONTPROPFILE_SRCS = $(wildcard $(PSFONTPROPFILE_SRC_DIR)/*.properties*)
 PSFONTPROPFILE_TARGET_FILES = $(subst $(PSFONTPROPFILE_SRC_DIR),$(LIBDIR),$(PSFONTPROPFILE_SRCS))
 
-$(PSFONTPROPFILE_TARGET_FILES): $(PSFONTPROPFILE_SRCS)
+$(LIBDIR)/%: $(PSFONTPROPFILE_SRC_DIR)/%
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES)
@@ -119,7 +125,7 @@
 
 $(LIBDIR)/flavormap.properties: $(PLATFORM_LIB_SRC)/flavormap.properties
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 COPY_FILES += $(LIBDIR)/flavormap.properties
@@ -129,7 +135,7 @@
 
 $(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_PLATFORM_LIB_SRC)/cursors.properties
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 COPY_FILES += $(CURSORS_DEST_DIR)/cursors.properties
@@ -142,9 +148,9 @@
 endif # PLATFORM
 CURSORS_TARGET_FILES =  $(subst $(CURSORS_LIB_SRC),$(CURSORS_DEST_DIR),$(CURSORS_SRC_FILES))
 
-$(CURSORS_TARGET_FILES): $(CURSORS_SRC_FILES)
+$(CURSORS_DEST_DIR)/%: $(CURSORS_LIB_SRC)/%
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 COPY_FILES += $(CURSORS_TARGET_FILES)
@@ -155,13 +161,39 @@
 
 $(LIBDIR)/content-types.properties: $(CONTENT_TYPES_SRC)/content-types.properties
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 COPY_FILES += $(LIBDIR)/content-types.properties
 
 ##########################################################################################
 
+CALENDARS_SRC := $(JDK_TOPDIR)/src/share/lib
+
+$(LIBDIR)/calendars.properties: $(CALENDARS_SRC)/calendars.properties
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+
+COPY_FILES += $(LIBDIR)/calendars.properties
+
+##########################################################################################
+
+ifeq ($(PLATFORM),windows)
+
+TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib
+
+$(LIBDIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+
+COPY_FILES += $(LIBDIR)/tzmappings
+
+endif
+
+##########################################################################################
+
 ICCPROFILE_DEST_DIR := $(LIBDIR)/cmm
 
 ifdef OPENJDK
@@ -175,7 +207,7 @@
 
 $(ICCPROFILE_DEST_DIR)%.pf: $(ICCPROFILE_SRC_DIR)%.pf
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 	$(CHMOD) 444 $@
 
@@ -209,8 +241,11 @@
         endif
     endif 
 
-    $(FREETYPE_LIB):
+    $(FREETYPE_LIB): $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype)
 	$(CP) $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@
+    ifeq ($(BUILD_OS), windows)
+	$(CHMOD) +rx $@
+    endif
 
     COPY_FILES += $(FREETYPE_LIB)
 endif
@@ -223,10 +258,336 @@
     MSVCRNN_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCRNN_DLL))
     $(MSVCRNN_TARGET): $(MSVCRNN_DLL)
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
     COPY_FILES += $(MSVCRNN_TARGET)
 endif
 
 ##########################################################################################
+
+HPROF_SRC=$(JDK_TOPDIR)/src/share/demo/jvmti/hprof/jvm.hprof.txt
+
+$(LIBDIR)/jvm.hprof.txt : $(HPROF_SRC)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+
+COPY_FILES += $(LIBDIR)/jvm.hprof.txt
+
+##########################################################################################
+
+#
+# How to install jvm.cfg.
+#
+ifeq ($(JVM_VARIANT_ZERO), true)
+JVMCFG_ARCH := zero
+else
+    JVMCFG_ARCH := $(ARCH)
+endif
+
+ifeq ($(PLATFORM),macosx)
+  ifeq ($(JVMCFG_ARCH),amd64)
+      JVMCFG_ARCH := x86_64
+  endif
+  JVMCFG_SRC := $(JDK_TOPDIR)/src/macosx/bin/$(JVMCFG_ARCH)/jvm.cfg
+  JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib
+else
+  JVMCFG_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/$(JVMCFG_ARCH)/jvm.cfg
+  JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)
+endif
+
+JVMCFG := $(JVMCFG_DIR)/jvm.cfg
+
+
+ifeq ($(ARCH_DATA_MODEL),32)
+    # On 32 bit machines, we can have client and/or server libjvms installed.
+    # Since the currently committed jvm.cfg expects clientANDserver, we need 
+    # to patch the jvm.cfg when we have built only a client or only a server.
+    # This should also support -kernel, -zero and -zeroshark.
+    ifeq ($(JVM_VARIANTS),$(COMMA)client$(COMMA))
+        # Create a patched jvm.cfg to use -client by default and alias -server to -client.
+        $(JVMCFG):
+		$(MKDIR) -p $(@D)
+		$(RM) -f $(JVMCFG)
+		$(PRINTF) "-client KNOWN\n">$(JVMCFG)
+		$(PRINTF) "-server IGNORE\n">>$(JVMCFG)
+		$(PRINTF) "-hotspot ALIASED_TO -client\n">>$(JVMCFG)
+		$(PRINTF) "-classic WARN\n">>$(JVMCFG)
+		$(PRINTF) "-native ERROR\n">>$(JVMCFG)
+		$(PRINTF) "-green ERROR\n">>$(JVMCFG)
+
+    else
+        ifeq ($(JVM_VARIANTS),$(COMMA)server$(COMMA))
+            # Create a patched jvm.cfg to use -server by default and alias -client to -server.
+
+            $(JVMCFG):
+		$(MKDIR) -p $(@D)
+		$(RM) -f $(JVMCFG)
+		$(PRINTF) "-server KNOWN\n">$(JVMCFG)
+		$(PRINTF) "-client IGNORE\n">>$(JVMCFG)
+		$(PRINTF) "-hotspot IGNORE\n">>$(JVMCFG)
+		$(PRINTF) "-classic WARN\n">>$(JVMCFG)
+		$(PRINTF) "-native ERROR\n">>$(JVMCFG)
+		$(PRINTF) "-green ERROR\n">>$(JVMCFG)
+        else
+            # Use the default jvm.cfg for this 32 bit setup. 
+            $(JVMCFG): $(JVMCFG_SRC)
+	    	$(MKDIR) -p $(@D)
+		$(RM) -f $@
+		$(CP) $< $@
+        endif
+    endif
+else
+    # Use the default jvm.cfg for this 64 bit setup.
+    $(JVMCFG): $(JVMCFG_SRC)
+		$(MKDIR) -p $(@D)
+		$(RM) -f $@
+		$(CP) $< $@
+endif
+
+COPY_FILES += $(JVMCFG)
+
+##########################################################################################
+
+PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security
+PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security
+
+ifeq ($(PLATFORM), solaris)
+	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-solaris
+endif
+
+ifeq ($(PLATFORM), windows)
+	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-windows
+endif
+
+ifeq ($(PLATFORM), macosx)
+	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-macosx
+endif
+
+$(PROPS_DST): $(PROPS_SRC)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+
+COPY_FILES += $(PROPS_DST)
+
+##########################################################################################
+
+POLICY_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.policy
+POLICY_DST := $(JDK_OUTPUTDIR)/lib/security/java.policy
+
+$(POLICY_DST): $(POLICY_SRC)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+
+COPY_FILES += $(POLICY_DST)
+
+##########################################################################################
+
+CACERTS_SRC := $(CACERTS_FILE)
+CACERTS_DST := $(JDK_OUTPUTDIR)/lib/security/cacerts
+
+$(CACERTS_DST): $(CACERTS_SRC)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+
+COPY_FILES += $(CACERTS_DST)
+
+##########################################################################################
+
+ifndef OPENJDK
+
+BLACKLIST_SRC   := $(JDK_TOPDIR)/src/closed/share/lib/security/blacklist
+BLACKLIST_DST   := $(JDK_OUTPUTDIR)/lib/security/blacklist
+
+TRUSTEDLIBS_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/trusted.libraries
+TRUSTEDLIBS_DST := $(JDK_OUTPUTDIR)/lib/security/trusted.libraries
+
+$(BLACKLIST_DST): $(BLACKLIST_SRC)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+
+COPY_FILES += $(BLACKLIST_DST)
+
+$(TRUSTEDLIBS_DST): $(TRUSTEDLIBS_SRC)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+
+COPY_FILES += $(TRUSTEDLIBS_DST)
+
+endif
+
+##########################################################################################
+
+ifndef OPENJDK
+
+SHARED_FONTS_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/fonts
+SHARED_FONTS_DST_DIR := $(JDK_OUTPUTDIR)/lib/fonts
+SHARED_FONTS_FILES   := \
+	LucidaTypewriterRegular.ttf	\
+	LucidaTypewriterBold.ttf        \
+	LucidaBrightRegular.ttf         \
+	LucidaBrightDemiBold.ttf        \
+	LucidaBrightItalic.ttf          \
+	LucidaBrightDemiItalic.ttf	\
+	LucidaSansRegular.ttf       	\
+	LucidaSansDemiBold.ttf       	\
+
+SHARED_FONTS_SRC := $(foreach F,$(SHARED_FONTS_FILES),$(SHARED_FONTS_SRC_DIR)/$(F))
+SHARED_FONTS_DST := $(foreach F,$(SHARED_FONTS_FILES),$(SHARED_FONTS_DST_DIR)/$(F))
+
+$(SHARED_FONTS_DST_DIR)/%.ttf : $(SHARED_FONTS_SRC_DIR)/%.ttf
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+$(SHARED_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.fonts.dir
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+COPY_FILES += $(SHARED_FONTS_DST) $(SHARED_FONTS_DST_DIR)/fonts.dir
+
+ifeq ($(PLATFORM), linux)
+
+# The oblique fonts are only needed/wanted on Linux.
+
+OBL_FONTS_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/lib/fonts/oblique
+OBL_FONTS_DST_DIR := $(JDK_OUTPUTDIR)/lib/oblique-fonts
+OBL_FONTS_FILES   := LucidaTypewriterOblique.ttf LucidaTypewriterBoldOblique.ttf \
+                    LucidaSansOblique.ttf LucidaSansDemiOblique.ttf
+
+OBL_FONTS_SRC := $(foreach F,$(OBL_FONTS_FILES),$(OBL_FONTS_SRC_DIR)/$(F))
+OBL_FONTS_DST := $(foreach F,$(OBL_FONTS_FILES),$(OBL_FONTS_DST_DIR)/$(F))
+
+$(OBL_FONTS_DST_DIR)/%.ttf : $(OBL_FONTS_SRC_DIR)/%.ttf
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+$(OBL_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.oblique-fonts.dir
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+COPY_FILES += $(OBL_FONTS_DST) $(OBL_FONTS_DST_DIR)/fonts.dir
+
+endif # linux
+endif # OPENJDK
+
+##########################################################################################
+
+ifndef OPENJDK
+
+JS_RESOURCES_FILES := Messages.properties Messages_fr.properties
+JS_RESOURCES_SRC_DIR := $(JDK_TOPDIR)/src/closed/share/classes/sun/org/mozilla/javascript/internal/resources
+JS_RESOURCES_DST_DIR := $(JDK_OUTPUTDIR)/classes/sun/org/mozilla/javascript/internal/resources
+
+JS_RESOURCES_SRC := $(foreach F,$(JS_RESOURCES_FILES),$(JS_RESOURCES_SRC_DIR)/$(F))
+JS_RESOURCES_DST := $(foreach F,$(JS_RESOURCES_FILES),$(JS_RESOURCES_DST_DIR)/$(F))
+
+$(JS_RESOURCES_DST_DIR)/% : $(JS_RESOURCES_SRC_DIR)/%
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+COPY_FILES += $(JS_RESOURCES_DST)
+
+endif
+
+##########################################################################################
+
+ifndef OPENJDK
+
+#
+# Solaris X11 Direct Graphics Access library
+#
+
+_DGALIBS_sparc = \
+	libxinerama.so \
+	libjdgaSUNWcg6.so \
+	libjdgaSUNWffb.so \
+	libjdgaSUNWm64.so \
+	libjdgaSUNWafb.so
+
+_DGALIBS_sparcv9 = \
+	libxinerama.so \
+	libjdgaSUNWcg6.so \
+	libjdgaSUNWffb.so \
+	libjdgaSUNWm64.so \
+	libjdgaSUNWafb.so
+
+_DGALIBS_i586 = 	# no i586 library yet
+
+_DGALIBS_amd64 = 	# no amd64 library yet
+
+DGALIBS = $(_DGALIBS_$(ARCH):%=$(JDK_OUTPUTDIR)/lib/$(LIBARCH)/%)
+
+$(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libxinerama.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(ARCH)/libxinerama.so
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+$(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNW%.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(ARCH)/libjdgaSUNW%.so
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+$(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNWafb.so: $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNWffb.so
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(LN) -s $< $@
+
+COPY_FILES += $(DGALIBS)
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM), solaris)
+
+SUNPKCS11_CFG_SRC := $(JDK_TOPDIR)/src/share/lib/security/sunpkcs11-solaris.cfg
+SUNPKCS11_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/sunpkcs11-solaris.cfg
+
+$(SUNPKCS11_CFG_DST) : $(SUNPKCS11_CFG_SRC)
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+COPY_FILES += $(SUNPKCS11_CFG_DST)
+
+endif
+
+##########################################################################################
+
+ifndef OPENJDK
+ifeq ($(PLATFORM), solaris)
+
+UCRYPTO_CFG_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/ucrypto-solaris.cfg
+UCRYPTO_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/ucrypto-solaris.cfg
+
+$(UCRYPTO_CFG_DST) : $(UCRYPTO_CFG_SRC)
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $@
+
+COPY_FILES += $(UCRYPTO_CFG_DST)
+
+endif
+endif
+
+##########################################################################################
+
+$(JDK_OUTPUTDIR)/lib/sound.properties : $(JDK_TOPDIR)/src/share/lib/sound.properties
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $(@)
+
+COPY_FILES += $(JDK_OUTPUTDIR)/lib/sound.properties
+
+##########################################################################################
--- a/makefiles/CopyIntoClasses.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/CopyIntoClasses.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -83,6 +83,83 @@
 COPY_FILES += \
   $(JDK_TOPDIR)/src/share/classes/sun/net/idn/uidna.spp
 
+#
+# Swing plaf resources
+#
+SWING_PLAF_WINDOWS_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows
+COPY_FILES += \
+  $(wildcard $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/*.gif) \
+  $(wildcard $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/*.png)
+
+ifndef OPENJDK
+  SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/com/sun/java/swing/plaf/windows
+  # Filter out JavaCup32.png from OpenJDK
+  COPY_FILES := $(filter-out $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/JavaCup32.png, $(COPY_FILES))
+  # Alter JavaCup32.png from ClosedJDK
+  COPY_FILES += \
+    $(SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED)/icons/JavaCup32.png
+endif
+
+SWING_PLAF_BASIC_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/basic
+COPY_FILES += \
+  $(wildcard $(SWING_PLAF_BASIC_RESOURCES_DIR)/icons/*.png)
+
+ifndef OPENJDK
+  SWING_PLAF_BASIC_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/javax/swing/plaf/basic
+  # Filter out JavaCup16.png from OpenJDK
+  COPY_FILES := $(filter-out $(SWING_PLAF_BASIC_RESOURCES_DIR)/icons/JavaCup16.png, $(COPY_FILES))
+  # Alter JavaCup16.png from ClosedJDK
+  COPY_FILES += \
+    $(SWING_PLAF_BASIC_RESOURCES_DIR_CLOSED)/icons/JavaCup16.png
+endif
+
+ifdef OPENJDK
+  SWING_PLAF_MOTIF_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif
+  COPY_FILES += \
+    $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.gif) \
+    $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.png)
+else
+  SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/com/sun/java/swing/plaf/motif
+  COPY_FILES += \
+    $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED)/icons/*.gif) \
+    $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED)/icons/*.png)
+endif
+
+SWING_PLAF_METAL_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/metal
+COPY_FILES += \
+  $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/*.gif) \
+  $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/*.png) \
+  $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.gif) \
+  $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.png) \
+  $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/sounds/*.wav)
+
+ifneq ($(PLATFORM), windows)
+  # Only copy GTK resources on Solaris/Linux
+  SWING_PLAF_GTK_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk
+  COPY_FILES += \
+    $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/icons/*.gif) \
+    $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/icons/*.png) \
+    $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/resources/metacity/SwingFallbackTheme/metacity-1/*.xml)
+endif
+# END: Swing plaf resources
+
+# The exception handling of swing beaninfo
+# These resources violates the convention of having code and resources together under
+# $(JDK_TOPDIR)/src/.../classes directories 
+SWING_BEANINFO_RESOURCES_SRC_DIR = $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo/images
+SWING_BEANINFO_RESOURCES_SRC = $(wildcard $(SWING_BEANINFO_RESOURCES_SRC_DIR)/*.gif)
+OUT_BEANINFO_RESOURCES = $(addprefix $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/,\
+	$(shell $(PRINTF) "$(SWING_BEANINFO_RESOURCES_SRC)\n" | $(SED) -e 's|/[^ ]*/beaninfo/images/||g'))
+
+COPY_EXTRA += $(OUT_BEANINFO_RESOURCES)
+# END: Swing beaninfo resources
+
+# Swing text resources
+SWING_TEXT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/text
+COPY_FILES += \
+  $(SWING_TEXT_RESOURCEDIR)/html/default.css \
+  $(wildcard $(SWING_TEXT_RESOURCEDIR)/rtf/charsets/*.txt)
+
 ##########################################################################################
 #
 # Copy the META-INF/services configuration files that are scattered around the source tree
@@ -94,7 +171,7 @@
 # are uncommented and the configuration file is stored in the output META-INF directory.
 
 # Make sure the output directory is created.
-$(shell $(MKDIR) -p $(JDK_OUTPUTDIR)/newclasses/META-INF/services)
+$(shell $(MKDIR) -p $(JDK_OUTPUTDIR)/classes/META-INF/services)
 # Find all META-INF/services/* files
 ALL_META-INF_DIRS_share:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF)
 ALL_META-INF_DIRS_hostapi:=$(shell $(FIND) $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes -type d -a -name META-INF)
@@ -107,12 +184,22 @@
     ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_share)
 endif
 # Filter out META-INF dirs that shouldn't be included
-ALL_META-INF_DIRS:=$(filter-out %sun/nio/cs/ext/META-INF,$(ALL_META-INF_DIRS))
 ifdef OPENJDK
   ALL_META-INF_DIRS:=$(filter-out %com/sun/script/javascript/META-INF,$(ALL_META-INF_DIRS))
 endif
 
+ifndef OPENJDK
+ifneq ($(PLATFORM), macosx)
+    ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/jdbc/odbc/META-INF
+endif
+endif
+
+ifndef OPENJDK
+    ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/java2d/cmm/kcms/META-INF
+endif
+
 SRC_SERVICES_FILES:=$(wildcard $(addsuffix /services/*,$(ALL_META-INF_DIRS)))
+
 ifdef OPENJDK
     SRC_SERVICES_FILES:=$(filter-out %sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine,$(SRC_SERVICES_FILES))
     SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.PCMM,$(SRC_SERVICES_FILES))
@@ -120,16 +207,17 @@
     SRC_SERVICES_FILES:=$(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine,$(SRC_SERVICES_FILES))
     SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.PCMM,$(SRC_SERVICES_FILES))
 endif
+
 # The number of services files are relatively few. If the increase in numbers, then
 # we have to use ListPathsSafelyNow here.
-# Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/newclasses/META-INF/services/yyyy
+# Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy
 # The \n in the printf command is needed to make sed work on Solaris.
-OUT_SERVICES_FILES:=$(addprefix $(JDK_OUTPUTDIR)/newclasses/META-INF/services/,\
+OUT_SERVICES_FILES:=$(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,\
 	$(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
 OUT_SERVICES_FILES_COLON:=$(addsuffix :,$(OUT_SERVICES_FILES))
 # Exception handling for print services with no META-INF directory
 SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/print/services/*)
-OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/newclasses/META-INF/services/,\
+OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,\
 	$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/print/services/%,%,\
 		$(SRC_SERVICES_FILES_PRINT)))
 OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :,$(OUT_SERVICES_FILES_PRINT))
@@ -148,3 +236,45 @@
 
 COPY_EXTRA += $(OUT_SERVICES_FILES)
 COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT)
+
+###
+
+$(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat : $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs/ext/sjis0213.dat
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(CP) $< $(@)
+
+COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat
+
+###
+
+JAVAX_SOUND_SRC := $(JDK_TOPDIR)/src/share/classes/com/sun/media/sound/services
+
+JAVAX_SOUND_SRC_FILES := \
+            javax.sound.midi.spi.MidiDeviceProvider \
+            javax.sound.midi.spi.MidiFileReader \
+            javax.sound.midi.spi.MidiFileWriter \
+            javax.sound.midi.spi.SoundbankReader \
+            javax.sound.sampled.spi.AudioFileReader \
+            javax.sound.sampled.spi.AudioFileWriter \
+            javax.sound.sampled.spi.FormatConversionProvider
+
+COPY_EXTRA += $(foreach F,$(notdir $(JAVAX_SOUND_SRC_FILES)),$(JDK_OUTPUTDIR)/classes/META-INF/services/${F})
+
+ifeq ($(PLATFORM)-$(ARCH),windows-ia64)
+	JAVAX_SOUND_SRC_FILES += windows-ia64/javax.sound.sampled.spi.MixerProvider
+	COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/META-INF/services/javax.sound.sampled.spi.MixerProvider
+else ifeq ($(PLATFORM),windows)
+	JAVAX_SOUND_SRC_FILES += windows-i586/javax.sound.sampled.spi.MixerProvider
+	COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/META-INF/services/javax.sound.sampled.spi.MixerProvider
+else ifeq ($(PLATFORM)-$(ARCH),linux-i586)
+	JAVAX_SOUND_SRC_FILES += linux-i586/javax.sound.sampled.spi.MixerProvider
+	COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/META-INF/services/javax.sound.sampled.spi.MixerProvider
+else
+	JAVAX_SOUND_SRC_FILES += javax.sound.sampled.spi.MixerProvider
+	COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/META-INF/services/javax.sound.sampled.spi.MixerProvider
+endif
+
+JAVAX_SOUND_RULES := $(foreach F,$(JAVAX_SOUND_SRC_FILES),$(JDK_OUTPUTDIR)/classes/META-INF/services/$(notdir $F):$(JAVAX_SOUND_SRC)/$F)
+
+$(foreach R,$(JAVAX_SOUND_RULES),$(eval $(call addto_meta-inf_services,$R)))
--- a/makefiles/CopySamples.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/CopySamples.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -46,7 +46,7 @@
     SAMPLE_TARGET += $(SAMPLE_CLOSED_TARGET)
 endif
 
-ifeq ($(PLATFORM),solaris)
+ifneq (, $(filter $(PLATFORM), solaris macosx))
     SAMPLE_SOLARIS_SOURCE := $(shell $(FIND) $(SAMPLE_SOLARIS_SOURCE_DIR) -type f -print)
     SAMPLE_SOLARIS_TARGET := $(subst $(SAMPLE_SOLARIS_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOLARIS_SOURCE))
     SAMPLE_TARGET += $(SAMPLE_SOLARIS_TARGET)
@@ -54,17 +54,17 @@
 
 $(SAMPLE_TARGET_DIR)/dtrace/%: $(SAMPLE_SOLARIS_SOURCE_DIR)/dtrace/%
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 $(SAMPLE_TARGET_DIR)/webservices/%: $(SAMPLE_CLOSED_SOURCE_DIR)/webservices/%
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 $(SAMPLE_TARGET_DIR)/%: $(SAMPLE_SOURCE_DIR)/%
 	$(MKDIR) -p $(@D)
-	rm -f $@
+	$(RM) -f $@
 	$(CP) $< $@
 
 COPY_FILES += $(SAMPLE_TARGET)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/CreateJars.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,809 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include Setup.gmk
+
+default: all
+
+include Tools.gmk
+
+
+MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
+BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest
+
+JARS:=
+
+##########################################################################################
+
+JCONSOLE_JAR_DEPS := \
+  $(shell $(FIND) $(JDK_OUTPUTDIR)/classes/sun/tools/jconsole/ -name "_the.package") \
+  $(shell $(FIND) $(JDK_OUTPUTDIR)/classes/com/sun/tools/jconsole/ -name "_the.package")
+
+$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,$(JCONSOLE_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/classes,\
+		SUFFIXES:=.class .gif .png,\
+		INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
+		JARMAIN:=sun.tools.jconsole.JConsole,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/jconsole.jar,\
+		SKIP_METAINF:=true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/jconsole.jar
+
+##########################################################################################
+
+DNS_JAR_DEPS := \
+  $(shell $(FIND) $(JDK_OUTPUTDIR)/classes/sun/net/spi/nameservice/dns/ -name "_the.package") \
+
+$(eval $(call SetupArchive,BUILD_DNS_JAR,$(DNS_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/classes,\
+		INCLUDES:=sun/net/spi/nameservice/dns,\
+		EXTRA_FILES:=META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/ext/dnsns.jar,\
+		SKIP_METAINF:=true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/ext/dnsns.jar
+
+##########################################################################################
+
+LOCALEDATA_INCLUDE_PATTERNS := \
+	sun/text/resources/*_ar* \
+	sun/text/resources/*_hi* \
+	sun/text/resources/*_iw* \
+	sun/text/resources/*_iw* \
+	sun/text/resources/*_ja* \
+	sun/text/resources/*_ko* \
+	sun/text/resources/*_th.* \
+	sun/text/resources/*_th_* \
+	sun/text/resources/*_vi* \
+	sun/text/resources/*_zh* \
+	sun/text/resources/*Data_th \
+	sun/text/resources/thai_dict \
+	sun/util/resources/*_ar* \
+	sun/util/resources/*_hi* \
+	sun/util/resources/*_iw* \
+	sun/util/resources/*_iw* \
+	sun/util/resources/*_ja* \
+	sun/util/resources/*_ko* \
+	sun/util/resources/*_th_* \
+	sun/util/resources/*_th.* \
+	sun/util/resources/*_vi* \
+	sun/util/resources/*_zh*
+
+LOCALEDATA_INCLUDES := $(patsubst $(JDK_OUTPUTDIR)/classes/%,%,\
+	$(foreach i,$(LOCALEDATA_INCLUDE_PATTERNS), $(wildcard $(JDK_OUTPUTDIR)/classes/$i)))
+
+$(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes,\
+		SUFFIXES:=.class _dict _th,\
+		INCLUDES:=$(LOCALEDATA_INCLUDES),\
+		JAR:=$(JDK_OUTPUTDIR)/lib/ext/localedata.jar,\
+		SKIP_METAINF:=true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/ext/localedata.jar
+
+##########################################################################################
+# rt.jar and resources.jar are being built in the same way as in the old build. They require
+# the files to be in a certain order and converting that is not easy and will not be needed
+# in jigsaw anyway.
+
+# Exclude list for rt.jar and resources.jar
+RT_JAR_EXCLUDES := \
+	com/sun/javadoc \
+	com/sun/jdi \
+	com/sun/jarsigner \
+	com/sun/source \
+	com/sun/istack/internal/tools \
+	META-INF/services/com.sun.jdi.connect.Connector \
+	META-INF/services/com.sun.jdi.connect.spi.TransportService \
+	META-INF/services/com.sun.tools.xjc.Plugin \
+	com/sun/tools \
+	sun/jvmstat \
+	sun/nio/cs/ext \
+	sun/awt/HKSCS.class \
+	sun/awt/motif/X11GB2312\$$$$Decoder.class \
+	sun/awt/motif/X11GB2312\$$$$Encoder.class \
+	sun/awt/motif/X11GB2312.class \
+	sun/awt/motif/X11GBK\$$$$Encoder.class \
+	sun/awt/motif/X11GBK.class \
+	sun/awt/motif/X11KSC5601\$$$$Decoder.class \
+	sun/awt/motif/X11KSC5601\$$$$Encoder.class \
+	sun/awt/motif/X11KSC5601.class \
+	META-INF/services/java.nio.charset.spi.CharsetProvider \
+	sun/rmi/rmic \
+	sun/tools/asm \
+	sun/tools/java \
+	sun/tools/javac \
+	com/sun/tools/classfile \
+	com/sun/tools/javap \
+	sun/tools/jcmd \
+	sun/tools/jconsole \
+	sun/tools/jps \
+	sun/tools/jstat \
+	sun/tools/jstatd \
+	sun/tools/native2ascii \
+	sun/tools/serialver \
+	sun/tools/tree \
+	sun/tools/util \
+	sun/security/tools/JarBASE64Encoder.class \
+	sun/security/tools/JarSigner.class \
+	sun/security/tools/JarSignerParameters.class \
+	sun/security/tools/JarSignerResources.class \
+	sun/security/tools/JarSignerResources_ja.class \
+	sun/security/tools/JarSignerResources_zh_CN.class \
+	sun/security/tools/SignatureFile\$$$$Block.class \
+	sun/security/tools/SignatureFile.class \
+	sun/security/tools/TimestampedSigner.class \
+	sun/security/provider/Sun.class \
+	sun/security/rsa/SunRsaSign.class \
+	sun/security/ssl \
+	sun/security/ec/ECDHKeyAgreement.class \
+	sun/security/ec/ECDSASignature\$$$$Raw.class \
+	sun/security/ec/ECDSASignature\$$$$SHA1.class \
+	sun/security/ec/ECDSASignature\$$$$SHA224.class \
+	sun/security/ec/ECDSASignature\$$$$SHA256.class \
+	sun/security/ec/ECDSASignature\$$$$SHA384.class \
+	sun/security/ec/ECDSASignature\$$$$SHA512.class \
+	sun/security/ec/ECDSASignature.class \
+	sun/security/ec/ECKeyPairGenerator.class \
+	sun/security/ec/SunEC\$$$$1.class \
+	sun/security/ec/SunEC.class \
+	sun/security/ec/SunECEntries.class \
+	sun/security/pkcs11 \
+	com/sun/net/ssl/internal/ssl \
+	javax/crypto \
+	sun/security/internal \
+	com/sun/crypto/provider \
+	META-INF/services/com.sun.tools.attach.spi.AttachProvider \
+	com/sun/tools/attach \
+	org/relaxng/datatype \
+	com/sun/codemodel \
+	com/sun/xml/internal/dtdparser \
+	com/sun/xml/internal/rngom \
+	com/sun/xml/internal/xsom \
+	com/sun/tools/script/shell \
+	sun/tools/attach \
+	sun/tools/jstack \
+	sun/tools/jinfo \
+	sun/tools/jmap \
+	sun/net/spi/nameservice/dns \
+	META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor \
+	javax/swing/beaninfo \
+	javax/swing/AbstractButtonBeanInfo.class \
+	javax/swing/BoxBeanInfo.class \
+	javax/swing/JAppletBeanInfo.class \
+	javax/swing/JButtonBeanInfo.class \
+	javax/swing/JCheckBoxBeanInfo.class \
+	javax/swing/JCheckBoxMenuItemBeanInfo.class \
+	javax/swing/JColorChooserBeanInfo.class \
+	javax/swing/JComboBoxBeanInfo.class \
+	javax/swing/JComponentBeanInfo.class \
+	javax/swing/JDesktopPaneBeanInfo.class \
+	javax/swing/JDialogBeanInfo.class \
+	javax/swing/JEditorPaneBeanInfo.class \
+	javax/swing/JFileChooserBeanInfo.class \
+	javax/swing/JFormattedTextFieldBeanInfo.class \
+	javax/swing/JFrameBeanInfo.class \
+	javax/swing/JInternalFrameBeanInfo.class \
+	javax/swing/JLabelBeanInfo.class \
+	javax/swing/JLayeredPaneBeanInfo.class \
+	javax/swing/JListBeanInfo.class \
+	javax/swing/JMenuBarBeanInfo.class \
+	javax/swing/JMenuBeanInfo.class \
+	javax/swing/JMenuItemBeanInfo.class \
+	javax/swing/JOptionPaneBeanInfo.class \
+	javax/swing/JPanelBeanInfo.class \
+	javax/swing/JPasswordFieldBeanInfo.class \
+	javax/swing/JPopupMenuBeanInfo.class \
+	javax/swing/JProgressBarBeanInfo.class \
+	javax/swing/JRadioButtonBeanInfo.class \
+	javax/swing/JRadioButtonMenuItemBeanInfo.class \
+	javax/swing/JScrollBarBeanInfo.class \
+	javax/swing/JScrollPaneBeanInfo.class \
+	javax/swing/JSeparatorBeanInfo.class \
+	javax/swing/JSliderBeanInfo.class \
+	javax/swing/JSpinnerBeanInfo.class \
+	javax/swing/JSplitPaneBeanInfo.class \
+	javax/swing/JTabbedPaneBeanInfo.class \
+	javax/swing/JTableBeanInfo.class \
+	javax/swing/JTextAreaBeanInfo.class \
+	javax/swing/JTextFieldBeanInfo.class \
+	javax/swing/JTextPaneBeanInfo.class \
+	javax/swing/JToggleButtonBeanInfo.class \
+	javax/swing/JToolBarBeanInfo.class \
+	javax/swing/JTreeBeanInfo.class \
+	javax/swing/JWindowBeanInfo.class \
+	javax/swing/SwingBeanInfoBase.class \
+	javax/swing/text/JTextComponentBeanInfo.class \
+	sun/swing/BeanInfoUtils.class \
+	$(LOCALEDATA_INCLUDES)
+
+ifndef OPENJDK
+ifndef JAVASE_EMBEDDED
+RT_JAR_EXCLUDES += \
+	com/oracle/jrockit/jfr \
+	oracle/jrockit/jfr
+endif
+endif
+
+# Find all files in the classes dir to use as dependencies. This could be more fine granular.
+ALL_FILES_IN_CLASSES := $(shell $(FIND) $(JDK_OUTPUTDIR)/classes -type f \
+			| $(GREP) -v -e '/_the\.*' -e '^_the\.*')
+
+RT_JAR_MANIFEST_FILE := $(JDK_OUTPUTDIR)/lib/_the.rt.jar_manifest
+RESOURCE_JAR_MANIFEST_FILE := $(JDK_OUTPUTDIR)/lib/_the.resources.jar_manifest
+
+$(RT_JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
+	$(MKDIR) -p $(@D)
+	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
+	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
+	       $(MAINMANIFEST) >> $@
+	$(ECHO) >> $@
+	$(CAT) $(BEANMANIFEST) >> $@
+
+$(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
+	$(MKDIR) -p $(@D)
+	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
+	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
+	       $(MAINMANIFEST) >> $@
+
+$(JDK_OUTPUTDIR)/lib/_the.jars.exclude:
+	$(MKDIR) -p $(@D)
+	$(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@)
+
+$(JDK_OUTPUTDIR)/lib/_the.jars.contents: $(BUILD_TOOLS) $(JDK_OUTPUTDIR)/lib/_the.jars.exclude \
+					 $(ALL_FILES_IN_CLASSES)
+	$(MKDIR) -p $(@D)
+	$(RM) $@.temp
+	($(CD) $(JDK_OUTPUTDIR)/classes && \
+	    $(TOOL_JARREORDER) \
+		-o  $@.temp $(JDK_OUTPUTDIR)/lib/classlist $(JDK_OUTPUTDIR)/lib/_the.jars.exclude . )
+	$(MV) $@.temp $@
+
+$(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents: $(JDK_OUTPUTDIR)/lib/_the.jars.contents
+	$(GREP) -e '\.class$$' $(JDK_OUTPUTDIR)/lib/_the.jars.contents > $@
+
+$(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents: $(JDK_OUTPUTDIR)/lib/_the.jars.contents
+	$(GREP) -v -e '\.class$$' -e '/_the\.*' -e '^_the\.*' $(JDK_OUTPUTDIR)/lib/_the.jars.contents > $@
+
+$(JDK_OUTPUTDIR)/lib/rt.jar: $(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE)
+	$(ECHO) Creating rt.jar
+	$(CD) $(JDK_OUTPUTDIR)/classes && \
+	    $(JAR) cfm $@ $(RT_JAR_MANIFEST_FILE) \
+	        @$(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents
+
+$(JDK_OUTPUTDIR)/lib/resources.jar: $(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents \
+				    $(RESOURCE_JAR_MANIFEST_FILE)
+	$(ECHO) Creating resources.jar
+	$(CD) $(JDK_OUTPUTDIR)/classes && \
+	    $(JAR) cfm $@ $(RESOURCE_JAR_MANIFEST_FILE) \
+	        @$(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents
+
+JARS+=$(JDK_OUTPUTDIR)/lib/rt.jar $(JDK_OUTPUTDIR)/lib/resources.jar
+
+##########################################################################################
+
+CHARSETS_JAR_DEPS :=
+
+ifneq ($(HOST_OS), windows)
+    CHARSETS_EXTRA_FILES:=sun/awt/motif/X11GBK.class \
+                          sun/awt/motif/X11GB2312\$$$$Decoder.class \
+                          sun/awt/motif/X11GB2312.class \
+                          sun/awt/motif/X11KSC5601\$$$$Decoder.class \
+                          sun/awt/motif/X11KSC5601\$$$$Encoder.class \
+                          sun/awt/motif/X11GB2312\$$$$Encoder.class \
+                          sun/awt/motif/X11GBK\$$$$Encoder.class \
+                          sun/awt/motif/X11KSC5601.class
+endif
+
+$(eval $(call SetupArchive,BUILD_CHARSETS_JAR,$(CHARSETS_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class .dat,\
+		INCLUDES:=sun/nio/cs/ext,\
+		EXTRA_FILES := sun/awt/HKSCS.class \
+			       $(CHARSETS_EXTRA_FILES) \
+                               META-INF/services/java.nio.charset.spi.CharsetProvider, \
+		JAR:=$(JDK_OUTPUTDIR)/lib/charsets.jar, \
+		SKIP_METAINF := true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/charsets.jar
+
+##########################################################################################
+
+ifndef OPENJDK
+    $(eval $(call SetupArchive,BUILD_JFR_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes,\
+		INCLUDES:=com/oracle/jrockit/jfr \
+			  oracle/jrockit/jfr,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/jfr.jar,\
+		SKIP_METAINF:=true,\
+		MANIFEST:=$(MAINMANIFEST)))
+
+    JARS+=$(JDK_OUTPUTDIR)/lib/jfr.jar
+endif
+
+##########################################################################################
+
+$(eval $(call SetupArchive,BUILD_JSSE_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes,\
+		INCLUDES:=sun/security/provider/Sun.class \
+			  sun/security/rsa/SunRsaSign.class \
+			  sun/security/ssl \
+			  com/sun/net/ssl/internal/ssl,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/jsse.jar,\
+		SKIP_METAINF:=true,\
+		MANIFEST:=$(MAINMANIFEST)))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/jsse.jar
+
+##########################################################################################
+
+ifneq ($(PLATFORM)-$(ARCH_DATA_MODEL),windows-64)
+    SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
+
+    ifndef OPENJDK
+
+        SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
+
+        $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
+		@$(ECHO) "\n>>>Installing prebuilt SunPKCS11 provider..."
+		$(RM) $@
+		$(CP) $< $@
+
+    else
+
+         $(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,$(SUNPKCS11_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class,\
+		INCLUDES:=sun/security/pkcs11,\
+		JAR:=$(SUNPKCS11_JAR_DST), \
+		SKIP_METAINF := true))
+
+    endif
+
+    JARS += $(SUNPKCS11_JAR_DST)
+endif
+
+##########################################################################################
+
+SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
+
+ifndef OPENJDK
+
+SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
+
+$(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
+	@$(ECHO) "\n>>>Installing prebuilt SunEC provider..."
+	$(RM) $@
+	$(CP) $< $@
+
+else
+
+$(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class,\
+		INCLUDES:=sun/security/ec,\
+		EXCLUDE_FILES := sun/security/ec/ECKeyFactory.class \
+			sun/security/ec/ECParameters.class \
+			sun/security/ec/ECPrivateKeyImpl.class \
+			sun/security/ec/ECPublicKeyImpl.class \
+			sun/security/ec/NamedCurve.class \
+			sun/security/ec/ECKeyFactory*,\
+		JAR:=$(SUNEC_JAR_DST), \
+		SKIP_METAINF := true))
+
+endif
+
+JARS += $(SUNEC_JAR_DST)
+
+##########################################################################################
+
+$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/classes,\
+		SUFFIXES:=BeanInfo.class .gif,\
+		INCLUDES:=javax/swing sun/swing,\
+		EXCLUDES:=javax/swing/plaf,\
+		EXTRA_FILES:=javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/dt.jar,\
+		SKIP_METAINF:=true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/dt.jar
+
+##########################################################################################
+
+SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
+
+ifndef OPENJDK
+    SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
+
+    $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_SRC)
+	@$(ECHO) "\n>>>Installing prebuilt SunJCE provider..."
+	$(RM) $@
+	$(CP) $< $@
+else
+
+    $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR,$(SUNJCE_PROVIDER_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class,\
+		INCLUDES:= com/sun/crypto/provider,\
+		JAR:=$(SUNJCE_PROVIDER_JAR_DST), \
+		MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
+		EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
+		SKIP_METAINF := true))
+endif
+
+JARS += $(SUNJCE_PROVIDER_JAR_DST)
+
+JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
+
+ifndef OPENJDK
+
+JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
+
+$(JCE_JAR_DST) : $(JCE_JAR_SRC)
+	@$(ECHO) "\n>>>Installing prebuilt jce.jar..."
+	$(RM) $@
+	$(CP) $< $@
+
+else
+
+$(eval $(call SetupArchive,BUILD_JCE_JAR,$(JCE_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class,\
+		INCLUDES:= javax/crypto sun/security/internal,\
+		JAR:=$(JCE_JAR_DST), \
+		MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
+		EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
+		SKIP_METAINF := true))
+endif
+
+JARS += $(JCE_JAR_DST)
+
+##########################################################################################
+
+ifdef OPENJDK
+
+#
+# TODO fix so that SetupArchive does not write files into SRCS
+#   then we don't need this extra copying
+#
+US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar
+US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
+US_EXPORT_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/US_export_policy_jar.tmp
+
+$(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
+
+$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
+		SRCS:=$(US_EXPORT_POLICY_JAR_TMP), \
+		SUFFIXES:= .policy,\
+		JAR:=$(US_EXPORT_POLICY_JAR_DST), \
+		EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+		SKIP_METAINF := true))
+
+JARS += $(US_EXPORT_POLICY_JAR_DST)
+
+endif
+
+##########################################################################################
+
+
+ifdef OPENJDK
+
+#
+# TODO fix so that SetupArchive does not write files into SRCS
+#   then we don't need this extra copying
+#
+LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
+LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
+LOCAL_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/local_policy_jar.tmp
+
+LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy $(LOCAL_POLICY_JAR_TMP)/default_local.policy
+
+$(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
+		SRCS:=$(LOCAL_POLICY_JAR_TMP),\
+		SUFFIXES:= .policy,\
+		JAR:=$(LOCAL_POLICY_JAR_DST), \
+		EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
+		SKIP_METAINF := true))
+
+JARS += $(LOCAL_POLICY_JAR_DST)
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM),windows)
+
+SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
+
+ifndef OPENJDK
+SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
+
+$(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_SRC)
+	@$(ECHO) "\n>>>Installing prebuilt SunMSCAPI provider..."
+	$(RM) $@
+	$(CP) $< $@
+
+else
+
+$(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR,$(SUNMSCAPI_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/classes, \
+		SUFFIXES:=.class,\
+		INCLUDES:= sun/security/mscapi,\
+		JAR:=$(SUNMSCAPI_JAR_DST), \
+		MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
+		EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
+		SKIP_METAINF := true))
+endif
+
+JARS += $(SUNMSCAPI_JAR_DST)
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM),solaris)
+ifndef OPENJDK
+
+UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
+UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
+
+$(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
+	@$(ECHO) "\n>>>Installing prebuilt OracleUcrypto provider..."
+	$(RM) $@
+	$(CP) $< $@
+
+JARS += $(UCRYPTO_JAR_DST)
+
+endif
+endif
+
+##########################################################################################
+
+TOOLS_JAR_INCLUDES := \
+	sun/tools/asm		\
+	sun/tools/jar		\
+	sun/tools/java		\
+	sun/tools/javac		\
+	sun/tools/jcmd		\
+	sun/tools/jps		\
+	sun/tools/jstat		\
+	sun/tools/jstatd	\
+	sun/tools/native2ascii	\
+	sun/tools/serialver	\
+	sun/tools/tree		\
+	sun/tools/util		\
+	sun/security/tools/JarBASE64Encoder.class \
+	sun/security/tools/JarSigner.class \
+	sun/security/tools/JarSignerParameters.class \
+	sun/security/tools/JarSignerResources.class \
+	sun/security/tools/JarSignerResources_ja.class \
+	sun/security/tools/JarSignerResources_zh_CN.class \
+	sun/security/tools/SignatureFile* \
+	sun/security/tools/TimestampedSigner.class \
+	sun/rmi/rmic		\
+	sun/applet		\
+	sun/jvmstat		\
+	com/sun/javadoc		\
+	com/sun/jdi		\
+	com/sun/jarsigner	\
+	com/sun/source          \
+	com/sun/tools/classfile \
+	com/sun/tools/doclets   \
+	com/sun/tools/example/debug/expr \
+	com/sun/tools/example/debug/tty  \
+	com/sun/tools/extcheck  \
+	com/sun/tools/hat       \
+	com/sun/tools/javac     \
+	com/sun/tools/javadoc   \
+	com/sun/tools/javah     \
+	com/sun/tools/javap     \
+	com/sun/tools/corba     \
+	com/sun/tools/internal/xjc       \
+	com/sun/tools/internal/ws       \
+	com/sun/istack/internal/tools       \
+	com/sun/tools/internal/jxc/ap   \
+	com/sun/tools/internal/ws/wscompile/plugin/at_generated \
+        com/sun/codemodel       \
+        com/sun/tools/internal/jxc             \
+        com/sun/xml/internal/rngom       \
+        com/sun/xml/internal/xsom       \
+        org/relaxng/datatype   \
+	com/sun/xml/internal/dtdparser \
+	com/sun/tools/jdi	\
+	com/sun/tools/script/shell	\
+	com/sun/tools/attach	\
+	sun/tools/attach	\
+	sun/tools/jstack        \
+	sun/tools/jinfo         \
+	sun/tools/jmap
+
+$(eval $(call SetupArchive,BUILD_TOOLS_JAR,$(TOOLS_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/classes,\
+		SUFFIXES:=.class .prp .gif .properties .xml .css .xsd .js .html .txt .java \
+			  Tool aliasmap options,\
+		INCLUDES:=$(TOOLS_JAR_INCLUDES),\
+		EXTRA_FILES:=META-INF/services/com.sun.jdi.connect.Connector \
+			     META-INF/services/com.sun.jdi.connect.spi.TransportService \
+			     META-INF/services/com.sun.tools.attach.spi.AttachProvider \
+			     META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
+			     META-INF/services/com.sun.tools.internal.xjc.Plugin,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/tools.jar,\
+		SKIP_METAINF:=true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/tools.jar
+
+##########################################################################################
+
+include $(JDK_TOPDIR)/makefiles/docs/CORE_PKGS.gmk
+include $(JDK_TOPDIR)/makefiles/docs/NON_CORE_PKGS.gmk
+
+# The compiler should not issue a "Proprietary" warning when compiling
+# classes in the com.sun.java.swing.plaf packages, since we've always
+# allowed, and even advocated, extending them (see bug 6476749).
+#
+# This approach is NOT to be used as a general purpose way to avoid such
+# compiler warnings for non-core packages. The correct way is to document
+# the packages in NON_CORE_PKGS.gmk, and include them in the NON_CORE_PKGS
+# definition.
+#
+# Swing has taken this approach only as a temporary measure to avoid
+# the compiler warnings until we can properly document these packages.
+# This is covered under 6491853.
+EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows  \
+                        com.sun.java.swing.plaf.motif    \
+                        com.sun.java.swing.plaf.gtk
+
+#
+# Include the exported private packages in ct.sym.
+# This is an interim solution until the ct.sym is replaced
+# with a new module system (being discussed for JDK 8).
+#
+EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
+                        com.oracle.net \
+                        com.oracle.nio
+
+$(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(JDK_OUTPUTDIR)/lib/rt.jar
+	$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
+	$(JAVA) \
+		-Xbootclasspath/a:$(JDK_OUTPUTDIR)/classes \
+		$(JAVAC_JARS) \
+	    -XDprocess.packages -proc:only \
+	    -processor com.sun.tools.javac.sym.CreateSymbols \
+	    -Acom.sun.tools.javac.sym.Jar=$(JDK_OUTPUTDIR)/lib/rt.jar \
+	    -Acom.sun.tools.javac.sym.Dest=$(IMAGES_OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
+	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
+	$(TOUCH) $@
+
+MAKE_SURE_DIR_EXISTS_DUMMY := $(shell $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols)
+$(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols,\
+		SRCS:=$(IMAGES_OUTPUTDIR)/symbols,\
+		INCLUDES:=META-INF/sym,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/ct.sym))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/ct.sym
+
+##########################################################################################
+
+SRC_ZIP_INCLUDES = \
+	java/applet			\
+	java/awt			\
+	java/beans			\
+	java/io				\
+	java/lang			\
+	java/math			\
+	java/net			\
+	java/nio			\
+	java/rmi			\
+	java/security			\
+	java/sql			\
+	java/text			\
+	java/util			\
+	com/sun/corba			\
+	com/sun/image/codec/jpeg	\
+	com/sun/imageio                 \
+	com/sun/java/swing		\
+	com/sun/javadoc			\
+	com/sun/jmx			\
+	com/sun/source			\
+	com/sun/naming			\
+	com/sun/security/auth		\
+	com/sun/security/jgss		\
+	javax/accessibility		\
+	javax/annotation		\
+	javax/script			\
+	javax/imageio			\
+	javax/lang			\
+	javax/management		\
+	javax/naming			\
+	javax/print			\
+	javax/rmi			\
+	javax/security			\
+	javax/sound			\
+	javax/sql			\
+	javax/swing			\
+	javax/tools			\
+	javax/xml			\
+	com/sun/org/apache		\
+	com/sun/java_cup		\
+	com/sun/jlex	        	\
+	org/ietf			\
+	org/omg				\
+	org/w3c/dom			\
+	org/xml/sax			\
+	sunw
+
+SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes
+SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
+SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/impsrc
+SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gendocsrc_rmic
+ifndef OPENJDK
+  SRC_ZIP_SRCS += $(JDK_TOPDIR)/src/closed/share/classes
+endif
+
+# Need to copy launcher src files into desired directory structure
+# before zipping the sources.
+LAUNCHER_SRC_FILES := $(wildcard $(JDK_TOPDIR)/src/share/bin/*) \
+                      $(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/java_md*)
+LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
+		    $(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
+			$(LAUNCHER_SRC_FILES)))
+
+$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/%
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+$(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)
+
+# This dir needs to exsist before macro is evaluated to avoid warning from find.
+MAKE_SURE_DIR_EXISTS_DUMMY := $(shell $(MKDIR) -p $(IMAGES_OUTPUTDIR)/src)
+$(eval $(call SetupZipArchive,BUILD_SRC_ZIP,\
+		SRC:=$(SRC_ZIP_SRCS) $(IMAGES_OUTPUTDIR)/src,\
+		INCLUDES:=$(SRC_ZIP_INCLUDES) launcher,\
+		SUFFIXES:=.java .c .h,\
+		ZIP:=$(IMAGES_OUTPUTDIR)/src.zip,\
+		EXTRA_DEPS:=$(LAUNCHER_ZIP_SRC)))
+
+JARS+=$(IMAGES_OUTPUTDIR)/src.zip
+
+##########################################################################################
+
+all: $(JARS)
+
+.PHONY: default all
--- a/makefiles/GendataBreakIterator.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GendataBreakIterator.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -62,7 +62,7 @@
 UNICODEDATA  = $(JDK_TOPDIR)/make/tools/UnicodeData/UnicodeData.txt
 
 # output
-DATA_PKG_DIR = $(JDK_OUTPUTDIR)/newclasses/sun/text/resources
+DATA_PKG_DIR = $(JDK_OUTPUTDIR)/classes/sun/text/resources
 BIFILES	= 	$(DATA_PKG_DIR)/CharacterBreakIteratorData \
 		$(DATA_PKG_DIR)/WordBreakIteratorData \
 		$(DATA_PKG_DIR)/LineBreakIteratorData \
@@ -75,23 +75,23 @@
 $(BREAK_ITERATOR_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
 	$(ECHO) "Generating BreakIteratorData"
 	$(MKDIR) -p  $(DATA_PKG_DIR)
-	rm -f $(BIFILES)
+	$(RM) -f $(BIFILES)
 	$(TOOL_GENERATEBREAKITERATORDATA) \
 		-o $(DATA_PKG_DIR) \
 		-spec $(UNICODEDATA)
-	touch $@
+	$(TOUCH) $@
 
 $(BIFILES_TH): $(BREAK_ITERATOR_DIR)/_the.bifiles_th
 $(BREAK_ITERATOR_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
 $(BREAK_ITERATOR_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
 	$(ECHO) "Generating BreakIteratorData_th"
 	$(MKDIR) -p  $(DATA_PKG_DIR)
-	rm -f $(BIFILES_TH)
+	$(RM) -f $(BIFILES_TH)
 	$(TOOL_GENERATEBREAKITERATORDATA) \
 		-o $(DATA_PKG_DIR) \
 		-spec $(UNICODEDATA) \
 		-language th
-	touch $@
+	$(TOUCH) $@
 
 
 BREAK_ITERATOR += $(BIFILES) $(BIFILES_TH)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GendataFontConfig.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,84 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENDATA_FONT_CONFIG_DST := $(JDK_OUTPUTDIR)/lib
+
+ifeq ($(PLATFORM), windows)
+GENDATA_FONT_CONFIG_SRC_DIR    := $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows
+GENDATA_FONT_CONFIG_SRC_FILES  := fontconfig.properties
+GENDATA_FONT_CONFIG_SRC_PREFIX := 
+endif
+
+ifeq ($(PLATFORM), linux)
+GENDATA_FONT_CONFIG_SRC_PREFIX := linux.
+ifdef OPENJDK
+GENDATA_FONT_CONFIG_SRC_DIR   := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/fontconfigs
+GENDATA_FONT_CONFIG_SRC_FILES := \
+	fontconfig.properties \
+	fontconfig.SuSE.properties \
+	fontconfig.Ubuntu.properties \
+	fontconfig.Fedora.properties
+else
+GENDATA_FONT_CONFIG_SRC_DIR   := $(JDK_TOPDIR)/src/closed/solaris/classes/sun/awt/fontconfigs
+GENDATA_FONT_CONFIG_SRC_FILES := \
+	fontconfig.properties				\
+	fontconfig.RedHat.5.properties			\
+	fontconfig.RedHat.6.properties			\
+	fontconfig.Turbo.properties			\
+	fontconfig.SuSE.10.properties                   \
+	fontconfig.SuSE.11.properties
+endif
+endif
+
+ifeq ($(PLATFORM), solaris)
+GENDATA_FONT_CONFIG_SRC_DIR    := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/fontconfigs
+GENDATA_FONT_CONFIG_SRC_FILES  := fontconfig.properties
+GENDATA_FONT_CONFIG_SRC_PREFIX := solaris.
+endif
+
+ifeq ($(PLATFORM), macosx)
+GENDATA_FONT_CONFIG_SRC_DIR    := $(JDK_TOPDIR)/src/macosx/classes/sun/awt/fontconfigs
+GENDATA_FONT_CONFIG_SRC_FILES  := fontconfig.properties
+GENDATA_FONT_CONFIG_SRC_PREFIX := macosx.
+endif # PLATFORM
+
+###
+
+$(GENDATA_FONT_CONFIG_DST)/%.src : $(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+$(GENDATA_FONT_CONFIG_DST)/%.bfc : $(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%.properties
+	$(MKDIR) -p $(@D)
+	$(TOOL_COMPILEFONTCONFIG) $< $@
+
+###
+
+GENDATA_FONT_CONFIGS := $(GENDATA_FONT_CONFIG_SRC_FILES:%=$(GENDATA_FONT_CONFIG_DST)/%.src)
+GENDATA_BFONT_CONFIGS := $(GENDATA_FONT_CONFIG_SRC_FILES:%.properties=$(GENDATA_FONT_CONFIG_DST)/%.bfc)
+
+GENDATA_FONT_CONFIG := $(GENDATA_FONT_CONFIGS) $(GENDATA_BFONT_CONFIGS)
+
+###
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GendataHtml32dtd.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENDATA_HTML32DTD := 
+
+HTML32DTD = $(JDK_OUTPUTDIR)/classes/javax/swing/text/html/parser/html32.bdtd
+$(HTML32DTD): $(BUILD_TOOLS)
+	$(ECHO) "Generating HTML DTD file"
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	($(TOOL_DTDBUILDER) html32 > $@) || exit 1
+
+GENDATA_HTML32DTD += $(HTML32DTD)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GendataTimeZone.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,56 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENDATA_TIMEZONE :=
+
+# TODO: read from make/sun/javazic/tzdata/VERSION
+GENDATA_TIMEZONE_VERSION := tzdata2012c
+
+GENDATA_TIMEZONE_DST := $(JDK_OUTPUTDIR)/lib/zi
+GENDATA_TIMEZONE_TMP := $(JDK_OUTPUTDIR)/gendata_timezone
+
+TZFILE0 := \
+    africa antarctica asia australasia europe northamerica \
+    pacificnew southamerica backward \
+    etcetera solar87 solar88 solar89 systemv
+
+TZFILE1 := \
+    gmt jdk11_backward
+
+TZFILES := \
+    $(addprefix $(JDK_TOPDIR)/make/sun/javazic/tzdata/,$(TZFILE0)) \
+    $(addprefix $(JDK_TOPDIR)/make/sun/javazic/tzdata_jdk/,$(TZFILE1))
+
+GENDATA_TIMEZONE_MAPFILE:=ZoneInfoMappings
+
+$(GENDATA_TIMEZONE_DST)/$(GENDATA_TIMEZONE_MAPFILE) : $(TZFILES)
+	$(RM) -rf $(GENDATA_TIMEZONE_TMP)
+	$(MKDIR) -p $(GENDATA_TIMEZONE_TMP)
+	$(RM) -rf $(GENDATA_TIMEZONE_DST)
+	$(MKDIR) -p $(GENDATA_TIMEZONE_DST)
+	$(TOOL_JAVAZIC) -V "$(GENDATA_TIMEZONE_VERSION)" -d $(GENDATA_TIMEZONE_TMP) $(TZFILES)
+	$(CP) -r $(GENDATA_TIMEZONE_TMP)/* $(GENDATA_TIMEZONE_DST)/
+
+GENDATA_TIMEZONE += $(GENDATA_TIMEZONE_DST)/$(GENDATA_TIMEZONE_MAPFILE)
--- a/makefiles/GenerateClasses.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GenerateClasses.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -30,12 +30,9 @@
 include RMICompile.gmk
 
 CLASSES_DIR := $(JDK_OUTPUTDIR)/classes
-# Depend on files in newclasses for now to avoid bad dependency handling caused by
-# copy always updating timestamps in classes.
-NEWCLASSES_DIR := $(JDK_OUTPUTDIR)/newclasses
-# Generate classes into separate dir for now. Can't drop in same dir as JavaCompilation 
-# macros as that will mess up recompile deps.
-STUB_CLASSES_DIR := $(JDK_OUTPUTDIR)/newrmicclasses
+# NOTE: If the smart javac dependency management is reintroduced, these classes risk 
+# interfering with the dependency checking. In that case they will need to be kept separate.
+STUB_CLASSES_DIR := $(JDK_OUTPUTDIR)/rmicclasses
 RMIC_GENSRC_DIR := $(JDK_OUTPUTDIR)/gendocsrc_rmic
 
 GENCLASSES :=
@@ -49,7 +46,7 @@
 		CLASSES:=sun.rmi.server.Activation$$$$ActivationSystemImpl\
 			 java.rmi.activation.ActivationGroup\
 			 com.sun.jndi.rmi.registry.ReferenceWrapper,\
-		CLASSES_DIR:=$(NEWCLASSES_DIR),\
+		CLASSES_DIR:=$(CLASSES_DIR),\
 		STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\
 		RUN_V12:=true))
 GENCLASSES += $(RMI_12)
@@ -57,7 +54,7 @@
 $(eval $(call SetupRMICompilation,RMI_11,\
 		CLASSES:=sun.rmi.registry.RegistryImpl\
 			 sun.rmi.transport.DGCImpl,\
-		CLASSES_DIR:=$(NEWCLASSES_DIR),\
+		CLASSES_DIR:=$(CLASSES_DIR),\
 		STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\
 		RUN_V11:=true))
 GENCLASSES += $(RMI_11)
@@ -69,7 +66,7 @@
 		  javax.management.remote.rmi.RMIServerImpl
 $(eval $(call SetupRMICompilation,RMI_IIOP,\
 		CLASSES:=$(JMAN_RMI_CLASSES),\
-		CLASSES_DIR:=$(NEWCLASSES_DIR),\
+		CLASSES_DIR:=$(CLASSES_DIR),\
 		STUB_CLASSES_DIR:=$(STUB_CLASSES_DIR),\
 		RUN_V12:=true,\
 		RUN_IIOP:=true,\
@@ -80,7 +77,7 @@
 # so that javadoc can include them in the API (4997471)
 $(eval $(call SetupRMICompilation,RMI_SRC,\
 		CLASSES:=$(JMAN_RMI_CLASSES),\
-		CLASSES_DIR:=$(NEWCLASSES_DIR),\
+		CLASSES_DIR:=$(CLASSES_DIR),\
 		STUB_CLASSES_DIR:=$(RMIC_GENSRC_DIR),\
 		RUN_V12:=true,\
 		KEEP_GENERATED:=true))
--- a/makefiles/GenerateData.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GenerateData.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -35,11 +35,43 @@
 include Tools.gmk
 
 # Now include all the rules that generate data resources.
-# These are written directly into newclasses dir.
+# These are written directly into classes dir.
+GENDATA :=
 
 include GendataBreakIterator.gmk
 GENDATA += $(BREAK_ITERATOR)
 
+include GendataFontConfig.gmk
+GENDATA += $(GENDATA_FONT_CONFIG)
+
+include GendataTimeZone.gmk
+GENDATA += $(GENDATA_TIMEZONE)
+
+include GendataHtml32dtd.gmk
+GENDATA += $(GENDATA_HTML32DTD)
+
+##########################################################################################
+
+GENDATA_UNINAME := $(JDK_OUTPUTDIR)/classes/java/lang/uniName.dat
+
+$(GENDATA_UNINAME): $(JDK_TOPDIR)/make/tools/UnicodeData/UnicodeData.txt $(BUILD_TOOLS)
+	$(MKDIR) -p $(@D)
+	$(TOOL_CHARACTERNAME) $< $@
+
+GENDATA += $(GENDATA_UNINAME)
+
+##########################################################################################
+
+GENDATA_CURDATA := $(JDK_OUTPUTDIR)/lib/currency.data
+
+$(GENDATA_CURDATA): $(JDK_TOPDIR)/src/share/classes/java/util/CurrencyData.properties $(BUILD_TOOLS)
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(TOOL_GENERATECURRENCYDATA) -o $@.temp < $<
+	$(MV) $@.temp $@
+
+GENDATA += $(GENDATA_CURDATA)
+
 ##########################################################################################
 
 $(GENDATA) : $(BUILD_TOOLS)
--- a/makefiles/GenerateJavaSources.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GenerateJavaSources.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -53,16 +53,57 @@
 include GensrcMisc.gmk
 GENSRC += $(GENSRC_MISC)
 
+include GensrcCharsetMapping.gmk
+GENSRC += $(GENSRC_CHARSETMAPPING)
+
+include GensrcCharsetCoder.gmk
+GENSRC += $(GENSRC_CHARSETCODER)
+
+include GensrcBuffer.gmk
+GENSRC += $(GENSRC_BUFFER)
+
+include GensrcExceptions.gmk
+GENSRC += $(GENSRC_EXCEPTIONS)
+
+ifneq ($(HOST_OS),windows)
+include GensrcIcons.gmk
+GENSRC += $(GENSRC_ICONS)
+
+include GensrcX11Wrappers.gmk
+GENSRC += $(GENSRC_X11WRAPPERS)
+endif
+
+include GensrcSwing.gmk
+ifndef DISABLE_NIMBUS
+  GENSRC += $(GENSRC_SWING_NIMBUS)
+endif
+
 $(GENSRC) : $(BUILD_TOOLS)
 
-all: $(GENSRC)
+# The exception handling of swing beaninfo
+# gensrc_swing/javax/swing/beaninfo/* have not be in src.zip
+all: $(GENSRC) $(GENSRC_SWING_BEANINFO)
 	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc
 	(cd $(JDK_OUTPUTDIR) && \
-		chmod -R u+rw gensrc && \
-		cp -rp gensrc_characterdata/* gensrc && \
-		cp -rp gensrc_properties/* gensrc && \
-		cp -rp gensrc_localedatametainfo/* gensrc && \
-		cp -rp gensrc_jdwp/* gensrc && \
-		cp -rp gensrc_misc/* gensrc)
+		$(CHMOD) -R u+rw gensrc && \
+		$(CP) -rp gensrc_characterdata/* gensrc && \
+		$(CP) -rp gensrc_properties/* gensrc && \
+		$(CP) -rp gensrc_localedatametainfo/* gensrc && \
+		$(CP) -rp gensrc_jdwp/* gensrc && \
+		$(CP) -rp gensrc_misc/* gensrc && \
+		$(CP) -rp gensrc_charsetmapping/* gensrc && \
+		$(CP) -rp gensrc_charsetcoder/* gensrc && \
+		$(CP) -rp gensrc_exceptions/* gensrc && \
+		$(CP) -rp gensrc_buffer/* gensrc)
+	if [ -d  $(JDK_OUTPUTDIR)/gensrc_swing/javax/swing/plaf ] ; then \
+		(cd $(JDK_OUTPUTDIR) && \
+		$(MKDIR) -p gensrc/javax/swing/plaf && \
+		$(CP) -rp gensrc_swing/javax/swing/plaf/* gensrc/javax/swing/plaf) \
+	fi
+ifneq ($(HOST_OS),windows)
+	(cd $(JDK_OUTPUTDIR) && \
+		$(CP) -rp gensrc_icons/* gensrc && \
+		$(CP) -rp gensrc_x11wrappers/classes/* gensrc)
+endif
 
 .PHONY: all
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GensrcBuffer.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,371 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENSRC_BUFFER :=
+
+GENSRC_BUFFER_TMP := $(JDK_OUTPUTDIR)/gensrc_buffer
+GENSRC_BUFFER_DST := $(JDK_OUTPUTDIR)/gensrc_buffer/java/nio
+
+GENSRC_BUFFER_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
+
+###
+
+$(GENSRC_BUFFER_DST)/_the.dir :
+	$(ECHO) "Generating buffer classes"
+	$(MKDIR) -p $(@D)
+	$(TOUCH) $@
+
+define fixRw
+	$1_RW := $2
+	$1_rwkey := rw
+	ifeq (R,$2)
+		 $1_rwkey := ro
+	endif
+endef
+
+define typesAndBits
+        # param 1 target
+        # param 2 type
+        # param 3 BO
+	$1_a := a
+	$1_A := A
+
+	$1_type := $2
+
+	ifeq ($2, byte)
+		$1_x        := b
+		$1_Type     := Byte
+		$1_fulltype := byte
+		$1_Fulltype := Byte
+		$1_category := integralType
+		$1_LBPV     := 0
+	endif
+
+	ifeq ($2, char)
+		$1_x        := c
+		$1_Type     := Char
+		$1_fulltype := character
+		$1_Fulltype := Character
+		$1_category := integralType
+		$1_LBPV     := 1
+	endif
+
+	ifeq ($2, short)
+		$1_x        := s
+		$1_Type     := Short
+		$1_fulltype := short
+		$1_Fulltype := Short
+		$1_category := integralType
+		$1_LBPV     := 1
+	endif
+
+	ifeq ($2, int)
+		$1_a := an
+		$1_A := An
+		$1_x        := i
+		$1_Type     := Int
+		$1_fulltype := integer
+		$1_Fulltype := Integer
+		$1_category := integralType
+		$1_LBPV     := 2
+	endif
+
+	ifeq ($2, long)
+		$1_x        := l
+		$1_Type     := Long
+		$1_fulltype := long
+		$1_Fulltype := Long
+		$1_category := integralType
+		$1_LBPV     := 3
+	endif
+
+	ifeq ($2, float)
+		$1_x        := f
+		$1_Type     := Float
+		$1_fulltype := float
+		$1_Fulltype := Float
+		$1_category := floatingPointType
+		$1_LBPV     := 2
+	endif
+
+	ifeq ($2, double)
+		$1_x        := d
+		$1_Type     := Double
+		$1_fulltype := double
+		$1_Fulltype := Double
+		$1_category := floatingPointType
+		$1_LBPV     := 3
+	endif
+
+	$1_Swaptype := $$($1_Type)
+	$1_memtype := $2
+	$1_Memtype := $$($1_Type)
+
+	ifeq ($2, float)
+		$1_memtype := int
+		$1_Memtype := Int
+		ifneq ($3,U)
+			$1_Swaptype := Int
+			$1_fromBits := Float.intBitsToFloat
+			$1_toBits   := Float.floatToRawIntBits
+		endif
+	endif
+
+	ifeq ($2, double)
+		$1_memtype := long
+		$1_Memtype := Long
+		ifneq ($3,U)
+			$1_Swaptype := Long
+			$1_fromBits := Double.longBitsToDouble
+			$1_toBits   := Double.doubleToRawLongBits
+		endif
+	endif
+
+	ifeq ($3, S)
+		$1_swap := Bits.swap
+	endif
+endef
+
+define genBinOps
+        # param 1 target
+        # param 2 type
+        # param 3 BO
+        # param 4 RW
+        # param 5 nbytes
+        # param 6 nbytesButOne
+	$(call typesAndBits,$1,$2,$3)
+	$(call fixRw,$1,$4)
+	$1_nbytes := $5
+	$1_nbytesButOne := $6
+	$1_CMD := $(TOOL_SPP) \
+		-Dtype=$$($1_type) \
+		-DType=$$($1_Type) \
+		-Dfulltype=$$($1_fulltype) \
+		-Dmemtype=$$($1_memtype) \
+		-DMemtype=$$($1_Memtype) \
+		-DfromBits=$$($1_fromBits) \
+		-DtoBits=$$($1_toBits) \
+		-DLG_BYTES_PER_VALUE=$$($1_LBPV) \
+		-DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
+		-Dnbytes=$$($1_nbytes) \
+		-DnbytesButOne=$$($1_nbytesButOne) \
+		-DRW=$$($1_RW) \
+		-K$$($1_rwkey) \
+		-Da=$$($1_a) \
+		-be
+endef
+
+define SetupGenBuffer
+        # param 1 is for output file
+        # param 2 is template dependency
+        # param 3-9 are named args.
+        #   type :=
+        #   BIN  :=
+        #   RW   := Mutability (R)ead-only (W)ritable
+        #   BO   := (U)nswapped/(S)wapped/(L)ittle/(B)ig
+        #
+	$(if $3,$1_$(strip $3))
+	$(if $4,$1_$(strip $4))
+	$(if $5,$1_$(strip $5))
+	$(if $6,$1_$(strip $6))
+	$(if $7,$1_$(strip $7))
+	$(if $8,$1_$(strip $8))
+	$(if $9,$1_$(strip $9))
+	$(if $(10),$1_$(strip $(10)))
+	$(if $(11),$1_$(strip $(11)))
+	$(if $(12),$1_$(strip $(12)))
+	$(if $(13),$1_$(strip $(13)))
+	$(if $(14),$1_$(strip $(14)))
+
+	$(call fixRw,$1,$$($1_RW))
+	$(call typesAndBits,$1,$$($1_type),$$($1_BO))
+
+	$1_DST     := $(GENSRC_BUFFER_DST)/$1.java
+	$1_SRC     := $(GENSRC_BUFFER_SRC)/$(strip $2).java.template
+	$1_SRC_BIN := $(GENSRC_BUFFER_SRC)/$(strip $2)-bin.java.template
+
+	$1_DEP := $$($1_SRC)
+	ifneq ($$($1_BIN),1)
+		$1_DEP := $$($1_SRC)
+		$1_OUT := $$($1_DST)
+	else
+		$1_DEP += $$($1_SRC) $$($1_SRC_BIN)
+		$1_OUT := $(GENSRC_BUFFER_DST)/$1.binop.0.java
+	endif
+
+	ifeq ($$($1_BIN),1)
+		$(call genBinOps,$1_char,char,$$($1_BO),$$($1_RW),two,one)
+		$(call genBinOps,$1_short,short,$$($1_BO),$$($1_RW),two,one)
+		$(call genBinOps,$1_int,int,$$($1_BO),$$($1_RW),four,three)
+		$(call genBinOps,$1_long,long,$$($1_BO),$$($1_RW),eight,seven)
+		$(call genBinOps,$1_float,float,$$($1_BO),$$($1_RW),four,three)
+		$(call genBinOps,$1_double,double,$$($1_BO),$$($1_RW),eight,seven)
+	endif
+
+$$($1_DST) : $$($1_DEP) $(GENSRC_BUFFER_DST)/_the.dir
+	$(TOOL_SPP) < $$($1_SRC) > $$($1_OUT).temp \
+		-K$$($1_type) \
+		-K$$($1_category) \
+		-Dtype=$$($1_type) \
+		-DType=$$($1_Type) \
+		-Dfulltype=$$($1_fulltype) \
+		-DFulltype=$$($1_Fulltype) \
+		-Dx=$$($1_x) \
+		-Dmemtype=$$($1_memtype) \
+		-DMemtype=$$($1_Memtype) \
+		-DSwaptype=$$($1_Swaptype) \
+		-DfromBits=$$($1_fromBits) \
+		-DtoBits=$$($1_toBits) \
+		-DLG_BYTES_PER_VALUE=$$($1_LBPV) \
+		-DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
+		-DBO=$$($1_BO) \
+		-Dswap=$$($1_swap) \
+		-DRW=$$($1_RW) \
+		-K$$($1_rwkey) \
+		-Da=$$($1_a) \
+		-DA=$$($1_A) \
+		-Kbo$$($1_BO)
+		$(MV) $$($1_OUT).temp $$($1_OUT)
+# Do the extra bin thing
+ifeq ($$($1_BIN),1)
+	$(SED) -e '/#BIN/,$$$$d' < $$($1_OUT) > $$($1_DST).temp
+	$(RM) $$($1_OUT)
+	$$($1_char_CMD) < $$($1_SRC_BIN) >> $$($1_DST).temp
+	$$($1_short_CMD) < $$($1_SRC_BIN) >> $$($1_DST).temp
+	$$($1_int_CMD) < $$($1_SRC_BIN) >> $$($1_DST).temp
+	$$($1_long_CMD) < $$($1_SRC_BIN) >> $$($1_DST).temp
+	$$($1_float_CMD) < $$($1_SRC_BIN) >> $$($1_DST).temp
+	$$($1_double_CMD) < $$($1_SRC_BIN) >> $$($1_DST).temp
+	$(PRINTF) "}\n" >> $$($1_DST).temp
+	mv $$($1_DST).temp $$($1_DST)
+endif
+
+GENSRC_BUFFER += $$($1_DST)
+
+endef
+
+###
+
+X_BUF :=X-Buffer
+
+$(eval $(call SetupGenBuffer,ByteBuffer,  $(X_BUF),type:=byte,BIN:=1))
+$(eval $(call SetupGenBuffer,CharBuffer,  $(X_BUF),type:=char))
+$(eval $(call SetupGenBuffer,ShortBuffer, $(X_BUF),type:=short))
+$(eval $(call SetupGenBuffer,IntBuffer,   $(X_BUF),type:=int))
+$(eval $(call SetupGenBuffer,LongBuffer,  $(X_BUF),type:=long))
+$(eval $(call SetupGenBuffer,FloatBuffer, $(X_BUF),type:=float))
+$(eval $(call SetupGenBuffer,DoubleBuffer,$(X_BUF),type:=double))
+
+# Buffers whose contents are heap-allocated
+# 
+HEAP_X_BUF := Heap-X-Buffer
+
+$(eval $(call SetupGenBuffer,HeapByteBuffer,   $(HEAP_X_BUF),type:=byte))
+$(eval $(call SetupGenBuffer,HeapByteBufferR,  $(HEAP_X_BUF),type:=byte,RW:=R))
+$(eval $(call SetupGenBuffer,HeapCharBuffer,   $(HEAP_X_BUF),type:=char))
+$(eval $(call SetupGenBuffer,HeapCharBufferR,  $(HEAP_X_BUF),type:=char,RW:=R))
+$(eval $(call SetupGenBuffer,HeapShortBuffer,  $(HEAP_X_BUF),type:=short))
+$(eval $(call SetupGenBuffer,HeapShortBufferR, $(HEAP_X_BUF),type:=short,RW:=R))
+$(eval $(call SetupGenBuffer,HeapIntBuffer,    $(HEAP_X_BUF),type:=int))
+$(eval $(call SetupGenBuffer,HeapIntBufferR,   $(HEAP_X_BUF),type:=int,RW:=R))
+$(eval $(call SetupGenBuffer,HeapLongBuffer,   $(HEAP_X_BUF),type:=long))
+$(eval $(call SetupGenBuffer,HeapLongBufferR,  $(HEAP_X_BUF),type:=long,RW:=R))
+$(eval $(call SetupGenBuffer,HeapFloatBuffer,  $(HEAP_X_BUF),type:=float))
+$(eval $(call SetupGenBuffer,HeapFloatBufferR, $(HEAP_X_BUF),type:=float,RW:=R))
+$(eval $(call SetupGenBuffer,HeapDoubleBuffer, $(HEAP_X_BUF),type:=double))
+$(eval $(call SetupGenBuffer,HeapDoubleBufferR,$(HEAP_X_BUF),type:=double,RW:=R))
+
+# Direct byte buffer
+# 
+DIRECT_X_BUF := Direct-X-Buffer
+
+$(eval $(call SetupGenBuffer,DirectByteBuffer, $(DIRECT_X_BUF),type:=byte,BIN:=1))
+$(eval $(call SetupGenBuffer,DirectByteBufferR,$(DIRECT_X_BUF),type:=byte,BIN:=1,RW:=R))
+
+# Unswapped views of direct byte buffers
+#
+$(eval $(call SetupGenBuffer,DirectCharBufferU,   $(DIRECT_X_BUF),type:=char,BO:=U))
+$(eval $(call SetupGenBuffer,DirectCharBufferRU,  $(DIRECT_X_BUF),type:=char,RW:=R,BO:=U))
+$(eval $(call SetupGenBuffer,DirectShortBufferU,  $(DIRECT_X_BUF),type:=short,BO:=U))
+$(eval $(call SetupGenBuffer,DirectShortBufferRU, $(DIRECT_X_BUF),type:=short,RW:=R,BO:=U))
+$(eval $(call SetupGenBuffer,DirectIntBufferU,    $(DIRECT_X_BUF),type:=int,BO:=U))
+$(eval $(call SetupGenBuffer,DirectIntBufferRU,   $(DIRECT_X_BUF),type:=int,RW:=R,BO:=U))
+$(eval $(call SetupGenBuffer,DirectLongBufferU,   $(DIRECT_X_BUF),type:=long,BO:=U))
+$(eval $(call SetupGenBuffer,DirectLongBufferRU,  $(DIRECT_X_BUF),type:=long,RW:=R,BO:=U))
+$(eval $(call SetupGenBuffer,DirectFloatBufferU,  $(DIRECT_X_BUF),type:=float,BO:=U))
+$(eval $(call SetupGenBuffer,DirectFloatBufferRU, $(DIRECT_X_BUF),type:=float,RW:=R,BO:=U))
+$(eval $(call SetupGenBuffer,DirectDoubleBufferU, $(DIRECT_X_BUF),type:=double,BO:=U))
+$(eval $(call SetupGenBuffer,DirectDoubleBufferRU,$(DIRECT_X_BUF),type:=double,RW:=R,BO:=U))
+
+# Swapped views of direct byte buffers
+#
+$(eval $(call SetupGenBuffer,DirectCharBufferS,   $(DIRECT_X_BUF),type:=char,BO:=S))
+$(eval $(call SetupGenBuffer,DirectCharBufferRS,  $(DIRECT_X_BUF),type:=char,RW:=R,BO:=S))
+$(eval $(call SetupGenBuffer,DirectShortBufferS,  $(DIRECT_X_BUF),type:=short,BO:=S))
+$(eval $(call SetupGenBuffer,DirectShortBufferRS, $(DIRECT_X_BUF),type:=short,RW:=R,BO:=S))
+$(eval $(call SetupGenBuffer,DirectIntBufferS,    $(DIRECT_X_BUF),type:=int,BO:=S))
+$(eval $(call SetupGenBuffer,DirectIntBufferRS,   $(DIRECT_X_BUF),type:=int,RW:=R,BO:=S))
+$(eval $(call SetupGenBuffer,DirectLongBufferS,   $(DIRECT_X_BUF),type:=long,BO:=S))
+$(eval $(call SetupGenBuffer,DirectLongBufferRS,  $(DIRECT_X_BUF),type:=long,RW:=R,BO:=S))
+$(eval $(call SetupGenBuffer,DirectFloatBufferS,  $(DIRECT_X_BUF),type:=float,BO:=S))
+$(eval $(call SetupGenBuffer,DirectFloatBufferRS, $(DIRECT_X_BUF),type:=float,RW:=R,BO:=S))
+$(eval $(call SetupGenBuffer,DirectDoubleBufferS, $(DIRECT_X_BUF),type:=double,BO:=S))
+$(eval $(call SetupGenBuffer,DirectDoubleBufferRS,$(DIRECT_X_BUF),type:=double,RW:=R,BO:=S))
+
+# Big-endian views of byte buffers
+#
+BYTE_X_BUF := ByteBufferAs-X-Buffer
+
+$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferB,   $(BYTE_X_BUF),type:=char,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRB,  $(BYTE_X_BUF),type:=char,RW:=R,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferB,  $(BYTE_X_BUF),type:=short,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRB, $(BYTE_X_BUF),type:=short,RW:=R,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferB,    $(BYTE_X_BUF),type:=int,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRB,   $(BYTE_X_BUF),type:=int,RW:=R,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferB,   $(BYTE_X_BUF),type:=long,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRB,  $(BYTE_X_BUF),type:=long,RW:=R,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferB,  $(BYTE_X_BUF),type:=float,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRB, $(BYTE_X_BUF),type:=float,RW:=R,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferB, $(BYTE_X_BUF),type:=double,BO:=B))
+$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRB,$(BYTE_X_BUF),type:=double,RW:=R,BO:=B))
+
+# Little-endian views of byte buffers
+#
+$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferL,   $(BYTE_X_BUF),type:=char,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRL,  $(BYTE_X_BUF),type:=char,RW:=R,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferL,  $(BYTE_X_BUF),type:=short,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRL, $(BYTE_X_BUF),type:=short,RW:=R,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferL,    $(BYTE_X_BUF),type:=int,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRL,   $(BYTE_X_BUF),type:=int,RW:=R,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferL,   $(BYTE_X_BUF),type:=long,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRL,  $(BYTE_X_BUF),type:=long,RW:=R,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferL,  $(BYTE_X_BUF),type:=float,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRL, $(BYTE_X_BUF),type:=float,RW:=R,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferL, $(BYTE_X_BUF),type:=double,BO:=L))
+$(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRL,$(BYTE_X_BUF),type:=double,RW:=R,BO:=L))
+
+###
+
+$(GENSRC_BUFFER) : $(BUILD_TOOLS)
--- a/makefiles/GensrcCharacterData.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GensrcCharacterData.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -34,8 +34,8 @@
 
 define SetupCharacterData
     $(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/$1.java : $(CHARACTERDATA)/$1.java.template $(BUILD_TOOLS)
-	mkdir -p $$(@D)
-	echo Generating $1.java
+	$(MKDIR) -p $$(@D)
+	$(ECHO) Generating $1.java
 	$(TOOL_GENERATECHARACTER) $2 \
 		-template $(CHARACTERDATA)/$1.java.template \
 		-spec $(UNICODEDATA)/UnicodeData.txt \
@@ -56,7 +56,7 @@
 # Copy two Java files that need no preprocessing.
 $(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/%.java : $(CHARACTERDATA)/%.java.template
 	$(MKDIR) -p $(@D)
-	echo Generating $(@F)
+	$(ECHO) Generating $(@F)
 	$(CP) -f $< $@
 
 GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc_characterdata/java/lang/CharacterDataUndefined.java \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GensrcCharsetCoder.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,107 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENSRC_CHARSETCODER :=
+
+GENSRC_CHARSETCODER_TMP := $(JDK_OUTPUTDIR)/gensrc_charsetcoder
+GENSRC_CHARSETCODER_DST := $(JDK_OUTPUTDIR)/gensrc_charsetcoder/java/nio/charset
+
+GENSRC_CHARSETCODER_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
+
+GENSRC_CHARSETCODER_TEMPLATE := $(GENSRC_CHARSETCODER_SRC)/charset/Charset-X-Coder.java.template
+
+###
+
+$(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java : $(GENSRC_CHARSETCODER_TEMPLATE)
+	$(MKDIR) -p $(@D)
+	-$(RM) $@.temp
+	$(TOOL_SPP) < $< >$@.temp \
+		-Kdecoder \
+		-DA='A' \
+		-Da='a' \
+		-DCode='Decode' \
+		-Dcode='decode' \
+		-DitypesPhrase='bytes in a specific charset' \
+		-DotypesPhrase='sixteen-bit Unicode characters' \
+		-Ditype='byte' \
+		-Dotype='character' \
+		-DItype='Byte' \
+		-DOtype='Char' \
+		-Dcoder='decoder' \
+		-DCoder='Decoder' \
+		-Dcoding='decoding' \
+		-DOtherCoder='Encoder' \
+		-DreplTypeName='string' \
+		-DdefaultRepl='"\\uFFFD"' \
+		-DdefaultReplName='<tt>"\&#92;uFFFD"<\/tt>' \
+		-DreplType='String' \
+		-DreplFQType='java.lang.String' \
+		-DreplLength='length()' \
+		-DItypesPerOtype='CharsPerByte' \
+		-DnotLegal='not legal for this charset' \
+		-Dotypes-per-itype='chars-per-byte' \
+		-DoutSequence='Unicode character'
+	$(MV) $@.temp $@
+
+GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java
+
+###
+
+$(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java : $(GENSRC_CHARSETCODER_TEMPLATE)
+	$(MKDIR) -p $(@D)
+	-$(RM) $@.temp
+	$(TOOL_SPP) < $< >$@.temp \
+		-Kencoder \
+		-DA='An' \
+		-Da='an' \
+		-DCode='Encode' \
+		-Dcode='encode' \
+		-DitypesPhrase='sixteen-bit Unicode characters' \
+		-DotypesPhrase='bytes in a specific charset' \
+		-Ditype='character' \
+		-Dotype='byte' \
+		-DItype='Char' \
+		-DOtype='Byte' \
+		-Dcoder='encoder' \
+		-DCoder='Encoder' \
+		-Dcoding='encoding' \
+		-DOtherCoder='Decoder' \
+		-DreplTypeName='byte array' \
+		-DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
+		-DdefaultReplName='<tt>{<\/tt>\&nbsp;<tt>(byte)'"'"\\?"'"'<\/tt>\&nbsp;<tt>}<\/tt>' \
+		-DreplType='byte[]' \
+		-DreplFQType='byte[]' \
+		-DreplLength='length' \
+		-DItypesPerOtype='BytesPerChar' \
+		-DnotLegal='not a legal sixteen-bit Unicode sequence' \
+		-Dotypes-per-itype='bytes-per-char' \
+		-DoutSequence='byte sequence in the given charset'
+	$(MV) $@.temp $@
+
+GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java
+
+###
+
+$(GENSRC_CHARSETCODER) : $(BUILD_TOOLS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GensrcCharsetMapping.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,105 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENSRC_CHARSETMAPPING:=
+
+GENSRC_TMP := $(JDK_OUTPUTDIR)/gensrc_charsetmapping
+GENSRC_DST := $(JDK_OUTPUTDIR)/gensrc_charsetmapping/sun/nio/cs
+
+GENSRC_SRC := $(JDK_TOPDIR)/make/tools/CharsetMapping
+GENSRC_JAVA_SRC := $(JDK_TOPDIR)/make/tools/src/build/tools/charsetmapping
+
+GENSRC_TEMPLATES := $(GENSRC_SRC)/SingleByte-X.java.template $(GENSRC_SRC)/DoubleByte-X.java.template
+
+###
+
+$(GENSRC_TMP)/_the.dir :
+	$(ECHO) Generating charsetmapping classes
+	$(MKDIR) -p $(GENSRC_DST)/ext
+	$(TOUCH) $@
+
+###
+
+GENSRC_SB := $(GENSRC_TMP)/gensrc_the.charsetmapping.sbcs
+
+$(GENSRC_SB) : $(GENSRC_SRC)/sbcs $(GENSRC_TEMPLATES) $(GENSRC_TMP)/_the.dir
+	$(TOOL_CHARSETMAPPING) $(GENSRC_SRC) $(GENSRC_DST) sbcs
+	$(TOUCH) $@
+
+GENSRC_CHARSETMAPPING += $(GENSRC_SB)
+
+###
+
+$(GENSRC_DST)/ext/sjis0213.dat : $(GENSRC_SRC)/sjis0213.map $(GENSRC_SB)
+	$(TOOL_CHARSETMAPPING) $< $@ sjis0213
+
+GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/sjis0213.dat
+
+###
+
+$(GENSRC_DST)/ext/EUC_TWMapping.java : $(GENSRC_JAVA_SRC)/EUC_TW.java $(GENSRC_SB)
+	$(TOOL_CHARSETMAPPING) $(GENSRC_SRC) $(GENSRC_DST)/ext euctw $(GENSRC_JAVA_SRC)/EUC_TW.java
+
+GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/EUC_TWMapping.java
+
+###
+
+$(GENSRC_DST)/ext/HKSCSMapping.java : $(GENSRC_JAVA_SRC)/HKSCS.java $(GENSRC_SB)
+	$(TOOL_CHARSETMAPPING) $(GENSRC_SRC) $(GENSRC_DST)/ext hkscs $(GENSRC_JAVA_SRC)/HKSCS.java
+
+GENSRC_CHARSETMAPPING += $(GENSRC_DST)/ext/HKSCSMapping.java
+
+###
+
+$(GENSRC_TMP)/gensrc_the.charsetmapping.extsbcs : $(GENSRC_SRC)/extsbcs $(GENSRC_TEMPLATES) $(GENSRC_SB)
+	$(TOOL_CHARSETMAPPING) $(GENSRC_SRC) $(GENSRC_DST)/ext extsbcs
+	$(TOUCH) $@
+
+GENSRC_CHARSETMAPPING += $(GENSRC_TMP)/gensrc_the.charsetmapping.extsbcs
+
+###
+
+$(GENSRC_TMP)/gensrc_the.charsetmapping.dbcs : $(GENSRC_SRC)/dbcs $(GENSRC_TEMPLATES) $(GENSRC_SB)
+	$(TOOL_CHARSETMAPPING) $(GENSRC_SRC) $(GENSRC_DST)/ext dbcs
+	$(TOUCH) $@
+
+GENSRC_CHARSETMAPPING += $(GENSRC_TMP)/gensrc_the.charsetmapping.dbcs
+
+###
+
+GENSRC_CHARSET_PROVIDER_CMD := $(JDK_TOPDIR)/makefiles/scripts/genCharsetProvider.sh
+
+$(GENSRC_DST)/StandardCharsets.java : $(JDK_TOPDIR)/src/share/classes/sun/nio/cs/standard-charsets \
+                                      $(GENSRC_CHARSET_PROVIDER_CMD) \
+                                      $(GENSRC_TMP)/_the.dir
+
+	NAWK="$(NAWK)" TEMPDIR="$(GENSRC_TMP)" SH="$(SH)" \
+	  HASHER="$(TOOL_HASHER)" \
+          SCRIPTS="$(JDK_TOPDIR)/makefiles/scripts" \
+	  $(SH) -e $(GENSRC_CHARSET_PROVIDER_CMD) $< $(@D)
+
+GENSRC_CHARSETMAPPING += $(GENSRC_DST)/StandardCharsets.java
+
+$(GENSRC_CHARSETMAPPING) : $(BUILD_TOOLS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GensrcExceptions.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENSRC_EXCEPTIONS :=
+
+GENSRC_EXCEPTIONS_TMP := $(JDK_OUTPUTDIR)/gensrc_exceptions
+GENSRC_EXCEPTIONS_DST := $(JDK_OUTPUTDIR)/gensrc_exceptions/java/nio
+
+GENSRC_EXCEPTIONS_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
+GENSRC_EXCEPTIONS_CMD := $(JDK_TOPDIR)/makefiles/scripts/genExceptions.sh
+
+GENSRC_EXCEPTIONS_SRC_DIRS := . charset channels 
+
+###
+
+$(GENSRC_EXCEPTIONS_DST)/_the.dir :
+	$(ECHO) "Generating exceptions classes"
+	$(MKDIR) -p $(@D)
+	$(TOUCH) $@
+
+
+###
+
+$(GENSRC_EXCEPTIONS_DST)/_the.% : $(GENSRC_EXCEPTIONS_SRC)/%/exceptions \
+                                  $(GENSRC_EXCEPTIONS_CMD) \
+                                  $(GENSRC_EXCEPTIONS_DST)/_the.dir
+	$(MKDIR) -p $(@D)/$*
+	SCRIPTS="$(JDK_TOPDIR)/makefiles/scripts" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GENSRC_EXCEPTIONS_CMD) $< $(@D)/$*
+	$(TOUCH) $@
+
+GENSRC_EXCEPTIONS += $(foreach D,$(GENSRC_EXCEPTIONS_SRC_DIRS),$(GENSRC_EXCEPTIONS_DST)/_the.$(D))
+
+$(GENSRC_EXCEPTIONS) : $(BUILD_TOOLS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GensrcIcons.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,112 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENSRC_ICONS :=
+GENSRC_ICONS_SRC :=
+GENSRC_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc_icons
+GENSRC_ICONS_DST := $(GENSRC_ICONS_TMP)/sun/awt/X11
+
+ifdef OPENJDK
+	ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)
+else
+	ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/solaris
+endif
+
+GENSRC_ICONS_SRC += \
+    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
+    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
+    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
+    $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
+
+
+ICONPATH := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/awt/X11
+
+GENSRC_ICONS_SRC += \
+   $(ICONPATH)/security-icon-bw16.png \
+   $(ICONPATH)/security-icon-interim16.png \
+   $(ICONPATH)/security-icon-yellow16.png \
+   $(ICONPATH)/security-icon-bw24.png \
+   $(ICONPATH)/security-icon-interim24.png \
+   $(ICONPATH)/security-icon-yellow24.png \
+   $(ICONPATH)/security-icon-bw32.png \
+   $(ICONPATH)/security-icon-interim32.png \
+   $(ICONPATH)/security-icon-yellow32.png \
+   $(ICONPATH)/security-icon-bw48.png \
+   $(ICONPATH)/security-icon-interim48.png \
+   $(ICONPATH)/security-icon-yellow48.png
+
+GENSRC_ICONS_FILES := $(notdir $(GENSRC_ICONS_SRC))
+
+GENSRC_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1)))
+GENSRC_ICONS_DST_NAME = XAWTIcon$(2)_$(subst .,_,$(subst -,_,$(1)))
+
+###
+
+$(GENSRC_ICONS_TMP)/_the.dir :
+	$(ECHO) Generating icon classes
+	$(MKDIR) -p $(GENSRC_ICONS_DST)
+	$(TOUCH) $@
+
+###
+
+define SetupGensrcIcon
+        # param 1 is for src-file
+        # param 2 is for src-dir
+	$1_SHORTNAME := $(call GENSRC_ICONS_SHORT_NAME,$1)
+	$1_NAME32 := $(call GENSRC_ICONS_DST_NAME,$1,32)
+	$1_TARGET32 := $(GENSRC_ICONS_DST)/$$($1_NAME32).java
+	$1_NAME64 := $(call GENSRC_ICONS_DST_NAME,$1,64)
+	$1_TARGET64 := $(GENSRC_ICONS_DST)/$$($1_NAME64).java
+
+$$($1_TARGET32) : $2/$1 $(GENSRC_ICONS_TMP)/_the.dir
+	$(RM) $$@ $$@.tmp
+	$(ECHO) "package sun.awt.X11;" > $$@.tmp
+	$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
+	$(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
+# TODO FIX FIX FIX
+ifneq ($(PLATFORM),macosx)
+	$(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp
+endif
+	$(ECHO) "}; }" >> $$@.tmp
+	$(MV) $$@.tmp $$@
+
+GENSRC_ICONS += $$($1_TARGET32)
+
+$$($1_TARGET64) : $2/$1 $(GENSRC_ICONS_TMP)/_the.dir
+	$(RM) $$@ $$@.tmp
+	$(ECHO) "package sun.awt.X11;" > $$@.tmp
+	$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
+	$(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
+# TODO FIX FIX FIX
+ifneq ($(PLATFORM),macosx)
+	$(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp
+endif
+	$(ECHO) "}; }" >> $$@.tmp
+	$(MV) $$@.tmp $$@
+
+GENSRC_ICONS += $$($1_TARGET64)
+endef
+
+$(foreach I,$(GENSRC_ICONS_SRC), $(eval $(call SetupGensrcIcon,$(notdir $(I)),$(dir $(I)))))
--- a/makefiles/GensrcJDWP.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GensrcJDWP.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -29,8 +29,8 @@
 $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h : $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec
 
 $(JDK_OUTPUTDIR)/gensrc_jdwp/com/sun/tools/jdi/JDWP.java : $(JDK_TOPDIR)/makefiles/jpda/jdwp/jdwp.spec
-	mkdir -p $(@D)
-	mkdir -p $(JDK_OUTPUTDIR)/gensrc_jdwp_headers
+	$(MKDIR) -p $(@D)
+	$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_jdwp_headers
 	$(ECHO) Creating JDWP.java and JDWPCommands.h from jdwp.spec
 	$(TOOL_JDWPGEN) $< -jdi $@ -include $(JDK_OUTPUTDIR)/gensrc_jdwp_headers/JDWPCommands.h
 
--- a/makefiles/GensrcLocaleDataMetaInfo.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GensrcLocaleDataMetaInfo.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -84,10 +84,26 @@
 
 $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java: \
 		$(JDK_TOPDIR)/src/share/classes/sun/util/LocaleDataMetaInfo-XLocales.java.template
-	mkdir -p $(@D)
+	$(MKDIR) -p $(@D)
 	$(ECHO) Creating sun/util/LocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources.
 	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" > $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/_the.locale_resources
 	$(SED) $(SED_ARGS) $(JDK_TOPDIR)/src/share/classes/sun/util/LocaleDataMetaInfo-XLocales.java.template \
 		> $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java
 
 GENSRC_LOCALEDATAMETAINFO:=$(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java
+
+###
+
+GENSRC_CRBC_DST := $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/CoreResourceBundleControl.java
+GENSRC_CRBC_CMD := $(JDK_TOPDIR)/makefiles/scripts/localelist.sh
+
+JRE_NONEXIST_LOCALES := en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
+
+$(GENSRC_CRBC_DST) : $(JDK_TOPDIR)/src/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template \
+                     $(GENSRC_CRBC_CMD)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SED="$(SED)" $(SH) $(GENSRC_CRBC_CMD) "$(JRE_NONEXIST_LOCALES)" $< $@ 
+
+GENSRC_LOCALEDATAMETAINFO += $(GENSRC_CRBC_DST)
+
+###
--- a/makefiles/GensrcMisc.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GensrcMisc.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -31,7 +31,7 @@
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/misc/Version.java: \
 	$(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template
 	$(MKDIR) -p $(@D)
-	echo Generating sun/misc/Version.java
+	$(ECHO) Generating sun/misc/Version.java
 	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
 	       -e 's/@@java_version@@/$(RELEASE)/g' \
 	       -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \
@@ -46,7 +46,7 @@
 $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java: \
                 $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/Version.java.template
 	$(MKDIR) -p $(@D)
-	echo Generating sun/tools/jconsole/Version.java
+	$(ECHO) Generating sun/tools/jconsole/Version.java
 	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@
 
 GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java
@@ -64,7 +64,7 @@
     $(JDK_OUTPUTDIR)/gensrc_misc/java/lang/UNIXProcess.java : \
               $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX)
 	$(MKDIR) -p $(@D)
-	echo Copying UNIXProcess.java.$(PLATFORM) to java/lang/UNIXProcess.java
+	$(ECHO) Copying UNIXProcess.java.$(PLATFORM) to java/lang/UNIXProcess.java
 	$(CP) $< $@
 	$(CHMOD) u+rw $@
 
@@ -72,3 +72,114 @@
 endif
 
 ##########################################################################################
+
+ifndef OPENJDK
+ifneq ($(PLATFORM), windows)
+ifneq ($(PLATFORM), macosx)
+    # These file(s) are needed for building fake .so libs on !windows for jdbcodbc
+
+    $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc1.c : 
+	$(MKDIR) -p $(@D)
+	$(ECHO) Creating $@
+	$(PRINTF) "void dummyOdbc(void){}\n" > $@
+	$(ECHO) Created $@
+
+    $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc2.c : 
+	$(MKDIR) -p $(@D)
+	$(ECHO) Creating $@
+	$(PRINTF) "void dummyOdbc(void){}\n" > $@
+	$(ECHO) Created $@
+
+    GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc1.c $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc2.c
+endif
+endif
+endif
+
+##########################################################################################
+
+GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java
+
+GENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch
+GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
+GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genSocketOptionRegistry
+GENSRC_SOR_EXE := $(GENSRC_SOR_BIN)/genSocketOptionRegistry$(EXE_SUFFIX)
+
+SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
+	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
+
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(GENSRC_SOR_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
+	$(GENSRC_SOR_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+
+
+$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE,\
+		SRC:=$(GENSRC_SOR_SRC),\
+		INCLUDE_FILES:=$(GENSRC_SOR_SRC_FILE),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		BIN:=$(GENSRC_SOR_BIN),\
+		EXE:=$(GENSRC_SOR_EXE)))
+
+##########################################################################################
+
+ifneq ($(PLATFORM),windows)
+
+GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java
+
+GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/fs
+GENSRC_UC_SRC_FILE := genUnixConstants.c
+GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genUnixConstants
+GENSRC_UC_EXE := $(GENSRC_UC_BIN)/genUnixConstants$(EXE_SUFFIX)
+
+UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
+	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
+
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(GENSRC_UC_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
+	$(GENSRC_UC_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+
+
+$(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE,\
+		SRC:=$(GENSRC_UC_SRC),\
+		INCLUDE_FILES:=$(GENSRC_UC_SRC_FILE),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		BIN:=$(GENSRC_UC_BIN),\
+		EXE:=$(GENSRC_UC_EXE)))
+
+endif
+
+##########################################################################################
+
+ifeq ($(PLATFORM),solaris)
+
+GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java
+
+GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/fs
+GENSRC_SOL_SRC_FILE := genSolarisConstants.c
+GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genSolarisConstants
+GENSRC_SOL_EXE := $(GENSRC_SOL_BIN)/genSolarisConstants$(EXE_SUFFIX)
+
+SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
+	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
+
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java : $(GENSRC_SOL_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
+	$(GENSRC_SOL_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+
+
+$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE,\
+		SRC:=$(GENSRC_SOL_SRC),\
+		INCLUDE_FILES:=$(GENSRC_SOL_SRC_FILE),\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		BIN:=$(GENSRC_SOL_BIN),\
+		EXE:=$(GENSRC_SOL_EXE)))
+
+endif
--- a/makefiles/GensrcProperties.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/GensrcProperties.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -85,7 +85,7 @@
   ALL_CLEANED_PROPSOURCES+=$2
 
   # Generate the list of to be created java files.
-  $1_PROPOUTPUT:=$$(patsubst %,$(JDK_OUTPUTDIR)/newclasses/%.properties,$$($1_PROPPATHS))
+  $1_PROPOUTPUT:=$$(patsubst %,$(JDK_OUTPUTDIR)/classes/%.properties,$$($1_PROPPATHS))
   # If the properties target file isn't in a "resources" dir, add one.
   ifneq ($5,)
     $1_PROPOUTPUT:=$$(foreach p,$$($1_PROPOUTPUT), $$(dir $$p)$5/$$(notdir $$p))
@@ -121,9 +121,32 @@
 	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/accessibility/internal/resources -name "*.properties"),\
 		ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/imageio/plugins/common
+$(eval $(call add_properties_to_clean,COM_SUN_IMAGEIO,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/imageio -name "*.properties")))
 #com/sun/java/swing/plaf/gtk/resources
+ifneq ($(PLATFORM), windows)
+# Only compile GTK resource bundles on Solaris/Linux
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources -name "*.properties"),\
+		ListResourceBundle))
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK_HK,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources -name "*.properties"),\
+		ListResourceBundle,%zh_TW,%zh_HK))
+endif
 #com/sun/java/swing/plaf/motif/resources
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_MOTIF,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources -name "*.properties"),\
+		ListResourceBundle))
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_MOTIF_HK,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif/resources -name "*.properties"),\
+		ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/java/swing/plaf/windows/resources
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_WINDOWS,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources -name "*.properties"),\
+		ListResourceBundle))
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_WINDOWS_HK,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/resources -name "*.properties"),\
+		ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/java/util/jar/pack
 $(eval $(call add_properties_to_clean,JNDI_COSNAMING,\
 	$(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/intrinsic.properties))
@@ -149,8 +172,26 @@
 
 #com/sun/servicetag/resources
 #com/sun/swing/internal/plaf/basic/resources
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_BASIC,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources -name "*.properties"),\
+		ListResourceBundle))
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_BASIC_HK,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/basic/resources -name "*.properties"),\
+		ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/swing/internal/plaf/metal/resources
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_METAL,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources -name "*.properties"),\
+		ListResourceBundle))
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_METAL_HK,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/metal/resources -name "*.properties"),\
+		ListResourceBundle,%zh_TW,%zh_HK))
 #com/sun/swing/internal/plaf/synth/resources
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_SYNTH,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources -name "*.properties"),\
+		ListResourceBundle))
+$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_SYNTH_HK,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/swing/internal/plaf/synth/resources -name "*.properties"),\
+		ListResourceBundle,%zh_TW,%zh_HK))
 
 #com/sun/tools/jdi/resources
 $(eval $(call add_properties_to_compile,COM_SUN_TOOLS_JDI,\
@@ -160,6 +201,8 @@
 #com/sun/tools/script/shell
 #java/util
 #javax/sql/rowset
+$(eval $(call add_properties_to_clean,JAVAX_SQL_ROWSET,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/javax/sql/rowset -name "*.properties")))
 #sun/awt/resources
 $(eval $(call add_properties_to_compile,SUN_AWT,\
 	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/awt/resources -name "*.properties"),\
@@ -175,6 +218,12 @@
 	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/launcher/resources -name "*.properties"),\
 		ListResourceBundle,%zh_TW,%zh_HK))
 #sun/management/resources
+$(eval $(call add_properties_to_compile,SUN_MANAGEMENT,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/management/resources -name "*.properties"),\
+		ListResourceBundle))
+$(eval $(call add_properties_to_compile,SUN_MANAGEMENT_KH,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/management/resources -name "*.properties"),\
+		ListResourceBundle,%zh_TW,%zh_HK))
 #sun/print
 #sun/print/resources
 $(eval $(call add_properties_to_compile,SUN_PRINT,\
@@ -231,31 +280,30 @@
 	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/util/resources -name "*.properties"),\
 		LocaleNamesBundle))
 
-
 # Now setup the rule for the generation of the resource bundles.
 $(JDK_OUTPUTDIR)/gensrc_properties/_the.compiled_properties : $(ALL_COMPILED_PROPSOURCES) $(BUILD_TOOLS)
 	$(RM) -rf $(JDK_OUTPUTDIR)/gensrc_properties/*
 #	Generate all output directories in advance since the build tool does not do that...
 	$(MKDIR) -p $(sort $(dir $(ALL_COMPILED_PROPJAVAS)))
-	echo Compiling $(words $(ALL_COMPILED_PROPSOURCES)) properties into resource bundles
+	$(ECHO) Compiling $(words $(ALL_COMPILED_PROPSOURCES)) properties into resource bundles
 	$(call ListPathsSafely,COMPILE_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/gensrc_properties/_the.cmdline)
 	$(TOOL_COMPILEPROPERTIES) -quiet @$(JDK_OUTPUTDIR)/gensrc_properties/_the.cmdline
-	touch $@
+	$(TOUCH) $@
 
 # Now setup the rule for the generation of the cleaned properties.
 # FIXME: We currently don't handle removed properties incrementally. 
-$(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties : $(ALL_CLEANED_PROPSOURCES) $(BUILD_TOOLS)
-	$(RM) -f $(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties.cmdline
+$(JDK_OUTPUTDIR)/classes/_the.cleaned_properties : $(ALL_CLEANED_PROPSOURCES) $(BUILD_TOOLS)
+	$(RM) -f $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline
 #	Generate all output directories in advance since the build tool does not do that...
 	$(MKDIR) -p $(sort $(dir $(ALL_CLEANED_PROPOUTPUT)))
-	echo Copying and cleaning $(words $(ALL_CLEANED_PROPSOURCES)) properties 
-	$(call ListPathsSafely,CLEAN_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties.cmdline)
-	$(TOOL_STRIPPROPERTIES) @$(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties.cmdline
-	touch $@
+	$(ECHO) Copying and cleaning $(words $(ALL_CLEANED_PROPSOURCES)) properties 
+	$(call ListPathsSafely,CLEAN_PROPCMDLINE,\n, >> $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline)
+	$(TOOL_STRIPPROPERTIES) @$(JDK_OUTPUTDIR)/classes/_the.cleaned_properties.cmdline
+	$(TOUCH) $@
 
 $(ALL_COMPILED_PROPJAVAS) : $(JDK_OUTPUTDIR)/gensrc_properties/_the.compiled_properties
 
-$(ALL_CLEANED_PROPOUTPUT) : $(JDK_OUTPUTDIR)/newclasses/_the.cleaned_properties
+$(ALL_CLEANED_PROPOUTPUT) : $(JDK_OUTPUTDIR)/classes/_the.cleaned_properties
 
 
 # Some zh_HK resources are just copied of zh_TW
@@ -265,7 +313,9 @@
 
 ZH_HK_JAVA:=	sun/applet/resources/MsgAppletViewer_zh_HK.java \
 		sun/misc/resources/Messages_zh_HK.java \
-		sun/security/util/AuthResources_zh_HK.java
+		sun/security/util/AuthResources_zh_HK.java \
+                sun/security/util/Resources_zh_HK.java
+
 ZH_HK_JAVA_FILES:=$(addprefix $(JDK_OUTPUTDIR)/gensrc_properties/,$(ZH_HK_JAVA))
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GensrcSwing.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,91 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Generate java files for javax.swing.plaf package
+# 
+NIMBUS_PACKAGE = javax.swing.plaf
+NIMBUS_GENSRC_DIR = $(JDK_OUTPUTDIR)/gensrc_swing/javax/swing/plaf/nimbus
+NIMBUS_SKIN_FILE = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/skin.laf
+
+$(JDK_OUTPUTDIR)/gensrc_swing/_the.generated_nimbus: $(NIMBUS_SKIN_FILE) $(BUILD_TOOLS)
+	$(MKDIR) -p $(@D)
+	$(ECHO) "Generating Nimbus source files:"
+	$(TOOL_GENERATENIMBUS) \
+	    -skinFile $(NIMBUS_SKIN_FILE) -buildDir $(JDK_OUTPUTDIR)/gensrc_swing \
+	    -packagePrefix $(NIMBUS_PACKAGE).nimbus -lafName Nimbus
+	$(ECHO) "Finished generating Nimbus source files"
+	$(TOUCH) $@
+
+GENSRC_SWING_NIMBUS := $(JDK_OUTPUTDIR)/gensrc_swing/_the.generated_nimbus
+
+#
+# Generate beaninfo java files
+#
+
+BEAN_GENSRC_DIR = $(JDK_OUTPUTDIR)/gensrc_swing/javax/swing/beaninfo
+DOCLETSRC_DIR = $(JDK_TOPDIR)/make/tools/swing-beans
+
+# javax.swing package
+BEANS	    = AbstractButton Box JComponent JApplet JButton		\
+	      JCheckBox JCheckBoxMenuItem JComboBox JColorChooser	\
+	      JDesktopPane JDialog JEditorPane JFileChooser JFrame	\
+	      JFormattedTextField JInternalFrame JLabel JLayeredPane	\
+	      JList JMenu JMenuBar JMenuItem JOptionPane JPanel		\
+	      JPasswordField JPopupMenu JProgressBar JRadioButton	\
+	      JRadioButtonMenuItem JScrollBar JScrollPane JSeparator	\
+	      JSlider JSplitPane JSpinner JTabbedPane JTable		\
+	      JTextArea JTextField JTextPane JToggleButton JToolBar	\
+	      JTree JWindow
+
+# javax.swing.text package
+BEANS_TEXT = JTextComponent
+
+BEANS_SRC = $(BEANS:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/%.java) \
+	    $(BEANS_TEXT:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/text/%.java)
+
+# Dummy variable so far, in the old build system it was false by default
+SWINGBEAN_DEBUG_FLAG = false
+# GenDocletBeanInfo is compiled in Tools.gmk and picks up from $(JDK_OUTPUTDIR)/btclasses
+$(JDK_OUTPUTDIR)/gensrc_swing/_the.generated_beaninfo: $(BEANS_SRC) $(BEAN_GENSRC_DIR)/SwingBeanInfoBase.java $(BEAN_GENSRC_DIR)/BeanInfoUtils.java $(BUILD_TOOLS)
+	$(JAVA) -Djava.awt.headless=true -jar $(JAVADOC_JARS) -doclet GenDocletBeanInfo -x $(SWINGBEAN_DEBUG_FLAG) -d $(BEAN_GENSRC_DIR) -t $(DOCLETSRC_DIR)/SwingBeanInfo.template -docletpath $(JDK_OUTPUTDIR)/btclasses \
+	    -classpath $(JDK_OUTPUTDIR)/btclasses $(BEANS_SRC)
+	$(TOUCH) $@
+
+# This file is the part of dt.jar
+# For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo
+# Should it be moved under $(JDK_TOPDIR)/src/share/classes/javax/swing instead?
+$(BEAN_GENSRC_DIR)/SwingBeanInfoBase.java: $(DOCLETSRC_DIR)/beaninfo/SwingBeanInfoBase.java
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+# This file is the part of dt.jar 
+# For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo
+# Should it be moved under $(JDK_TOPDIR)/src/share/classes/sun/swing instead?
+$(BEAN_GENSRC_DIR)/BeanInfoUtils.java: $(DOCLETSRC_DIR)/beaninfo/BeanInfoUtils.java
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+GENSRC_SWING_BEANINFO = $(JDK_OUTPUTDIR)/gensrc_swing/_the.generated_beaninfo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GensrcX11Wrappers.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,97 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+GENSRC_X11WRAPPERS :=
+GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers
+
+GENSRC_SIZER_SRC := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
+
+GENSRC_SIZES :=
+
+ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
+GENSRC_SIZES := sizes.32 sizes.64
+else ifeq ($(PLATFORM), solaris)
+isalist:=$(shell $(ISAINFO))
+ifneq (,$(findstring sparcv9, $(isalist)))
+# On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
+GENSRC_SIZES := sizes.32 sizes.64
+else
+ifneq (,$(findstring amd64, $(isalist)))
+# On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
+GENSRC_SIZES := sizes.32 sizes.64
+else # !sparcv9 : includes (32-bit) sparc, i586
+GENSRC_SIZES := sizes.32
+endif # amd64
+endif # sparcv9
+else # !solaris
+ifeq ($(PLATFORM), macosx)
+GENSRC_SIZES := sizes.32 sizes.64
+else # !macosx
+GENSRC_SIZES := sizes.$(ARCH_DATA_MODEL)
+endif # !macosx
+endif # solaris
+
+
+##########################################################################################
+
+$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c : $(GENSRC_SIZER_SRC)/xlibtypes.txt
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(TOOL_WRAPPERGENERATOR) $(@D) $< "sizer" $*
+
+$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c
+	(cd $(@D) && $(CC) -m$* -o $@ $< $(CFLAGS_JDKLIB) \
+              -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \
+	      -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+	      -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc)
+
+ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
+
+$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.32 : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.32.exe
+	$< > $@.tmp
+	$(MV) $@.tmp $@
+
+$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 : $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+else
+
+$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.% : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe
+	$< > $@.tmp
+	$(MV) $@.tmp $@
+
+endif
+
+$(GENSRC_X11WRAPPERS_TMP)/classes/_the.classes : $(foreach S,$(GENSRC_SIZES),$(GENSRC_X11WRAPPERS_TMP)/sizer/$(S))
+	$(MKDIR) -p $(@D)/sun/awt/X11
+	$(RM) $(@D)/sun/awt/X11/*
+	$(TOOL_WRAPPERGENERATOR) $(@D)/sun/awt/X11 $(GENSRC_SIZER_SRC)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes
+ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
+	$(ECHO) COMPARING $@ and $(GENSRC_SIZER_SRC)/sizes.64-$(PLATFORM)-i386
+	$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.64 $(GENSRC_SIZER_SRC)/sizes.64-$(PLATFORM)-i386
+endif
+	$(TOUCH) $@
+
+GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_TMP)/classes/_the.classes
--- a/makefiles/Images.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/Images.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -28,47 +28,518 @@
 include JavaCompilation.gmk
 include Setup.gmk
 
-default: $(IMAGES_OUTPUTDIR)/_the.images
+default: images
 
 include Tools.gmk
 
-JARS:=
+images: jre-image jdk-image
 
-##########################################################################################
+ifeq ($(HOST_OS),solaris)
+define install-file
+	$(MKDIR) -p $(@D)
+	$(CP) -r -P '$<' '$(@D)'
+endef
+else
+define install-file
+	$(MKDIR) -p $(@D)
+	$(CP) -P '$<' '$@'
+endef
+endif
 
-JCONSOLE_JAR_DEPS := \
-  $(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses/sun/tools/jconsole/ -name "_the.package") \
-  $(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses/com/sun/tools/jconsole/ -name "_the.package")
+################################################################################
+#
+# JRE and JDK build rules
+#
+################################################################################
 
-$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,$(JCONSOLE_JAR_DEPS),\
-		SRCS:=$(JDK_OUTPUTDIR)/newclasses,\
-		SUFFIXES:=.class .gif .png,\
-		INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
-		JARMAIN:=sun.tools.jconsole.JConsole,\
-		JAR:=$(JDK_OUTPUTDIR)/lib/jconsole.jar,\
-		SKIP_METAINF:=true))
+################################################################################
+# /bin dir
 
-JARS+=$(JDK_OUTPUTDIR)/lib/jconsole.jar
+$(JRE_IMAGE_DIR)/bin/%: $(JDK_OUTPUTDIR)/bin/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
 
-##########################################################################################
+$(JDK_IMAGE_DIR)/bin/%: $(JDK_OUTPUTDIR)/bin/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
 
-# Need to define BUILDDIR for Release.gmk to work
-BUILDDIR=$(JDK_TOPDIR)/makefiles
-include common/Defs.gmk
-include common/Release.gmk
+$(JDK_IMAGE_DIR)/jre/bin/%: $(JDK_OUTPUTDIR)/bin/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
 
-# A rudimentary attempt at band-aiding the dependency tracking.
-DEPS:=	$(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses -name "*.class" -type f) \
-	$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f) \
-	$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f) 
+NOT_JRE_BIN_FILES = \
+	appletviewer$(EXE_SUFFIX) \
+	extcheck$(EXE_SUFFIX) \
+	idlj$(EXE_SUFFIX) \
+	jar$(EXE_SUFFIX) \
+	jarsigner$(EXE_SUFFIX) \
+	java-rmi.cgi \
+	javac$(EXE_SUFFIX) \
+	javadoc$(EXE_SUFFIX) \
+	javah$(EXE_SUFFIX) \
+	javap$(EXE_SUFFIX) \
+	jcmd$(EXE_SUFFIX) \
+	jdb$(EXE_SUFFIX) \
+	jps$(EXE_SUFFIX) \
+	jrunscript$(EXE_SUFFIX) \
+	jstat$(EXE_SUFFIX) \
+	jstatd$(EXE_SUFFIX) \
+	jstack$(EXE_SUFFIX) \
+	packagebean$(SCRIPT_SUFFIX) \
+	rmic$(EXE_SUFFIX) \
+	serialver$(EXE_SUFFIX) \
+	unregbean$(EXE_SUFFIX) \
+	jconsole$(EXE_SUFFIX) \
+	jinfo$(EXE_SUFFIX) \
+	jmap$(EXE_SUFFIX) \
+	native2ascii$(EXE_SUFFIX) \
+	xjc$(EXE_SUFFIX) \
+	wsgen$(EXE_SUFFIX) \
+	wsimport$(EXE_SUFFIX) \
+        schemagen$(EXE_SUFFIX) \
+	jsadebugd$(EXE_SUFFIX) \
+	jhat$(EXE_SUFFIX)
 
-$(IMAGES_OUTPUTDIR)/_the.images : $(DEPS) $(JARS)
+WINDOWS_JDK_BIN_FILES = \
+	$(EXE_SUFFIX) \
+	$(LIB_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
+	$(MSVCRNN_DLL)
+
+# Find all files in bin dir
+ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f)
+ifeq ($(HOST_OS),windows)
+    JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
+else
+    JDK_BIN_LIST := $(ALL_BIN_LIST)
+endif
+JRE_BIN_LIST := $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES)), $(ALL_BIN_LIST))
+
+JRE_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JRE_IMAGE_DIR)/%, $(JRE_BIN_LIST))
+JDK_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/%, $(JDK_BIN_LIST))
+JDKJRE_BIN_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/jre/%, $(JRE_BIN_LIST))
+
+################################################################################
+# /lib dir
+
+$(JRE_IMAGE_DIR)/lib/%: $(JDK_OUTPUTDIR)/lib/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JDK_IMAGE_DIR)/lib/%: $(JDK_OUTPUTDIR)/lib/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JDK_IMAGE_DIR)/jre/lib/%: $(JDK_OUTPUTDIR)/lib/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+JDKJRE_LIB_FILES := \
+	$(LIB_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
+	$(SALIB_NAME)
+
+NOT_JRE_LIB_FILES := \
+	tools.jar \
+	jconsole.jar \
+	sa-jdi.jar \
+	dt.jar \
+	orb.idl \
+	ir.idl \
+	ct.sym
+
+JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
+ifeq ($(HOST_OS), linux)
+    JDK_LIB_FILES += jexec
+endif
+
+ALL_LIB_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) ! -name "_the*")
+JRE_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),$(ALL_LIB_LIST))
+JDKJRE_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_LIB_LIST))
+JDK_LIB_LIST := $(filter $(addprefix %,$(JDK_LIB_FILES)),$(ALL_LIB_LIST))
+
+JRE_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JRE_IMAGE_DIR)/%,$(JRE_LIB_LIST))
+JDK_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/%,$(JDK_LIB_LIST))
+JDKJRE_LIB_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/%,$(JDK_IMAGE_DIR)/jre/%,$(JDKJRE_LIB_LIST))
+
+# CTE plugin security change require new empty directory lib/applet
+$(JRE_IMAGE_DIR)/lib/applet: 
+	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(MKDIR) -p $@
+
+$(JDK_IMAGE_DIR)/jre/lib/applet: 
+	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(MKDIR) -p $@
+
+$(JRE_IMAGE_DIR)/lib/meta-index: $(JRE_LIB_TARGETS)
+	$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar
+
+$(JDK_IMAGE_DIR)/jre/lib/meta-index: $(JDKJRE_LIB_TARGETS)
+	$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar
+
+$(JRE_IMAGE_DIR)/lib/ext/meta-index: $(JRE_LIB_TARGETS)
+	$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar
+
+$(JDK_IMAGE_DIR)/jre/lib/ext/meta-index: $(JRE_LIB_TARGETS)
+	$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(CD) $(@D) && $(TOOL_BUILDMETAINDEX) -o meta-index *.jar
+
+################################################################################
+# /man dir
+
+JRE_MAN_PAGES := \
+	java.1		\
+	keytool.1	\
+	orbd.1          \
+	pack200.1	\
+	policytool.1    \
+	rmid.1		\
+	rmiregistry.1	\
+	servertool.1    \
+	tnameserv.1     \
+	unpack200.1
+
+ifndef OPENJDK
+  JRE_MAN_PAGES += javaws.1
+endif
+
+JDK_MAN_PAGES =            \
+	$(JRE_MAN_PAGES)   \
+	appletviewer.1     \
+	extcheck.1         \
+	idlj.1             \
+	jar.1              \
+	jarsigner.1        \
+	javac.1            \
+	javadoc.1          \
+	javah.1            \
+	javap.1            \
+	jconsole.1         \
+	jcmd.1             \
+	jdb.1              \
+	jhat.1             \
+        jinfo.1            \
+        jmap.1             \
+        jps.1              \
+	jrunscript.1       \
+        jsadebugd.1        \
+        jstack.1           \
+        jstat.1            \
+        jstatd.1           \
+	jvisualvm.1        \
+	native2ascii.1     \
+	rmic.1             \
+        schemagen.1        \
+	serialver.1        \
+        wsgen.1            \
+        wsimport.1         \
+        xjc.1
+
+ifeq ($(HOST_OS), linux)
+    MAN_SRC_DIR:=$(JDK_TOPDIR)/src/linux/doc
+    MAN1_SUBDIR:=man
+endif
+ifeq ($(HOST_OS), solaris)
+    MAN_SRC_DIR:=$(JDK_TOPDIR)/src/solaris/doc
+    MAN1_SUBDIR:=sun/man/man1
+endif
+
+$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JRE_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JDK_IMAGE_DIR)/man/man1/%: $(JDK_OUTPUTDIR)/impdoc/$(MAN1_SUBDIR)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+define install-ja-manpage
 	$(MKDIR) -p $(@D)
-# 	Restart this makefile, ugly, but since double colon (::) rules
-# 	have been used in Release.gmk, it is impossible to craft on
-# 	dependencies on these. I.e. -do-not-use- :: rules!!!!!
-#       Repeat after me: -do-not-use- :: rules!!!!!
-	$(MAKE) -j1 -f Images.gmk $(IMAGES_MAKE_ARGS) images
+	$(CAT) $< \
+		| $(NATIVE2ASCII) -encoding eucJP \
+		| $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \
+		| $(NATIVE2ASCII) -reverse -encoding $1 \
+		> $@
+endef
+
+$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+	$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(call install-ja-manpage,UTF-8)
+
+$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+	$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(call install-ja-manpage,UTF-8)
+
+$(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+	$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(call install-ja-manpage,PCK)
+
+$(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+	$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(call install-ja-manpage,PCK)
+
+ifeq ($(HOST_OS), solaris)
+    $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+	$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+    $(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
+	$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+endif
+
+# Old build creates empty man page for this, mimicing behaviour.
+$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja/man1/jcmd.1:
+	$(ECHO) Creating dummy $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(MKDIR) -p $(@D)
 	$(TOUCH) $@
 
-.PHONY: default
+ifeq ($(HOST_OS), linux)
+    $(JRE_IMAGE_DIR)/man/ja:
+	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
+
+    $(JDK_IMAGE_DIR)/man/ja:
+	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
+endif
+
+ifeq ($(HOST_OS), linux)
+    JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
+			 $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
+			 $(JRE_IMAGE_DIR)/man/ja
+
+    JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
+			 $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
+			 $(JDK_IMAGE_DIR)/man/ja
+endif
+
+ifeq ($(HOST_OS), solaris)
+    JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
+			 $(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/,$(JRE_MAN_PAGES)) \
+			 $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
+			 $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JRE_MAN_PAGES))
+
+    JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
+			 $(addprefix $(JDK_IMAGE_DIR)/man/ja/man1/,$(JDK_MAN_PAGES)) \
+			 $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
+			 $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES))
+endif
+
+################################################################################
+# /demo dir
+
+ifndef NO_DEMOS
+# FIXME: newdemo/applets/GraphLayout/GraphPanel$2.class is sometimes not copied.
+
+#   The db demo contains an empty dir that needs to be copied. The other 
+#   directories will always trigger the rule for recompile since 
+#   _the.list_of_packages files are touched.
+    $(JDK_IMAGE_DIR)/demo/%: $(JDK_OUTPUTDIR)/newdemo/%
+	if [ ! -d "$@" ]; then \
+	  $(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \
+	  $(MKDIR) -p $(@D); \
+	  if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) '$<' '$@'; fi \
+	fi
+
+#   Find all files including directories
+    JDK_DEMO_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/newdemo/%,$(JDK_IMAGE_DIR)/demo/%,\
+			$(shell $(FIND) $(JDK_OUTPUTDIR)/newdemo ! -name "_the.*"))
+
+endif
+
+################################################################################
+# /sample dir
+
+ifndef NO_SAMPLES
+    $(JDK_IMAGE_DIR)/sample/%: $(JDK_OUTPUTDIR)/sample/%
+	$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
+	$(install-file)
+
+    JDK_SAMPLE_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/sample/%,$(JDK_IMAGE_DIR)/sample/%,\
+			$(shell $(FIND) $(JDK_OUTPUTDIR)/sample -type f))
+
+endif
+
+################################################################################
+# /db dir
+
+ifndef OPENJDK
+    $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(JDK_TOPDIR)/src/closed/share/db/%
+	$(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<)
+	$(MKDIR) -p $(JDK_IMAGE_DIR)/db
+	cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $< -x index.html 2> /dev/null
+	$(MKDIR) -p $(@D)
+	$(TOUCH) $@
+
+    $(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html
+	$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
+	$(install-file)
+
+    JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\
+			$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*.zip" ! -name "*demo*")) \
+		      $(JDK_IMAGE_DIR)/db/README-JDK.html
+
+endif
+
+################################################################################
+# /include dir
+
+$(JDK_IMAGE_DIR)/include/%: $(JDK_OUTPUTDIR)/include/%
+	$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
+	$(install-file)
+
+    JDK_INCLUDE_TARGETS := $(patsubst $(JDK_OUTPUTDIR)/include/%,$(JDK_IMAGE_DIR)/include/%,\
+			$(shell $(FIND) $(JDK_OUTPUTDIR)/include -type f))
+
+################################################################################
+# doc files
+
+ifdef OPENJDK
+    JRE_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
+    JDK_DOC_FILES := LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
+    JRE_DOC_LOCATION := $(JDK_TOPDIR)
+    JDK_DOC_LOCATION := $(JDK_TOPDIR)
+else
+    JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
+    JDK_DOC_FILES := COPYRIGHT README.html  LICENSE THIRDPARTYLICENSEREADME.txt
+    ifeq ($(HOST_OS), windows)
+        JRE_DOC_FILES += README.txt
+    else
+        JRE_DOC_FILES += README
+    endif
+    ifndef NO_DEMOS
+        JDK_DOC_FILES += demo/DEMOS_LICENSE
+    endif
+    ifndef NO_SAMPLES
+        JDK_DOC_FILES += sample/SAMPLES_LICENSE
+    endif
+    JRE_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jre
+    JDK_DOC_LOCATION := $(JDK_TOPDIR)/src/closed/share/doc/jdk
+endif
+JRE_DOC_TARGETS := $(addprefix $(JRE_IMAGE_DIR)/,$(JRE_DOC_FILES))
+JDKJRE_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/jre/,$(JRE_DOC_FILES))
+JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/,$(JDK_DOC_FILES))
+
+$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/%
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
+JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
+
+# Common way to emit a line into the release or info file
+define info-file-item # name value
+$(PRINTF) '%s="%s"\n' $1 $2 >> $@
+endef
+
+ALL_SOURCE_TIPS = $(shell \
+  if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \
+    $(CAT) $(OUTPUT_ROOT)/source_tips ; \
+  fi)
+
+$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
+	$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
+	$(call info-file-item, "OS_NAME",      "$(REQUIRED_OS_NAME)")
+	$(call info-file-item, "OS_VERSION",   "$(REQUIRED_OS_VERSION)")
+	$(call info-file-item, "OS_ARCH",      "$(ARCH)")
+	$(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
+
+$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
+	$(ECHO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(MKDIR) -p $(@D)
+	$(RM) $@
+	$(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
+	$(call info-file-item, "OS_NAME",      "$(REQUIRED_OS_NAME)")
+	$(call info-file-item, "OS_VERSION",   "$(REQUIRED_OS_VERSION)")
+	$(call info-file-item, "OS_ARCH",      "$(ARCH)")
+	$(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
+
+$(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip
+	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
+
+################################################################################
+# Post processing (strip etc)
+
+ifneq ($(POST_STRIP_CMD),)
+    ifeq ($(HOST_OS), windows)
+        EXEC_LIST:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \
+		-o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)")
+    else
+        # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
+        EXEC_LIST:=$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX) && \
+		$(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \
+		| $(EGREP) 'ELF' | $(CUT) -d':' -f1)
+    endif
+    # Filter out non JRE files and convert to unique touch files to depend on
+    JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip/%.stripped,\
+			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
+
+    # Setup a rule for stripping files based on touch files
+    $(IMAGES_OUTPUTDIR)/_strip/%.stripped: $(JRE_IMAGE_DIR)/%
+	$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
+	$(CHMOD) u+w $<
+	$(POST_STRIP_CMD) $<
+	$(CHMOD) go-w $<
+	$(MKDIR) -p $(@D)
+	$(TOUCH) $@
+endif
+
+################################################################################
+# Main targets
+
+jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \
+	$(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
+	$(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_EXEC_TOUCH_LIST)
+
+jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
+	$(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \
+	$(JDK_IMAGE_DIR)/jre/lib/applet \
+	$(JDK_DEMO_TARGETS) \
+	$(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \
+	$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
+	$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
+	$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
+	$(JDK_INFO_FILE) $(JDK_IMAGE_DIR)/src.zip
+
+################################################################################
+
+.PHONY: default images jre-image jdk-image
--- a/makefiles/LegacyMakefiles.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/LegacyMakefiles.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -31,26 +31,11 @@
 DEPS:=	$(shell $(FIND) $(JDK_TOPDIR)/makefiles/java -type f) \
 		$(shell $(FIND) $(JDK_TOPDIR)/makefiles/javax -type f) \
 		$(shell $(FIND) $(JDK_TOPDIR)/makefiles/sun -type f) \
-		$(shell $(FIND) $(JDK_TOPDIR)/makefiles/com -type f) \
-		$(shell $(FIND) $(JDK_TOPDIR)/makefiles/apple -type f)
+		$(shell $(FIND) $(JDK_TOPDIR)/makefiles/com -type f)
 
 $(JDK_OUTPUTDIR)/_the.legacy_make: $(DEPS)
 	(echo Building single threaded Java subdir && \
         $(MAKE) -j1 -C java all && \
-	(if test "$(PLATFORM)" = macosx; then \
-		echo Building single threaded Apple subdir && \
-		$(MAKE) -j1 -C apple all; \
-	fi) && \
-	echo Building single threaded javax subdir && \
-	$(MAKE) -j1 -C javax all && \
-	echo Building single threaded sun subdir && \
-	$(MAKE) -j1 -C sun all && \
-	echo Building single threaded com subdir && \
-	$(MAKE) -j1 -C com all && \
-	if [ -z "$(OPENJDK)" ]; then \
-		echo Building single threaded altclasses subdir && \
-		$(MAKE) -j1 -C altclasses all; \
-	fi && \
 	touch $@)
 
 .PHONY: all
--- a/makefiles/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/Makefile	Wed Jun 13 16:57:34 2012 -0700
@@ -23,6 +23,7 @@
 # questions.
 #
 
+# This must be the first rule
 default: all
 
 include $(SPEC)
@@ -36,38 +37,43 @@
 # Setup the build tools.
 include Tools.gmk
 
-
 all: $(BUILD_TOOLS)
-	+make -f GenerateJavaSources.gmk
+	+$(MAKE) -f GenerateJavaSources.gmk
 #       Drop back to the old makefiles for
 #       packages/libs that have not yet been converted.
-	+make -f LegacyMakefiles.gmk
+	+$(MAKE) -f LegacyMakefiles.gmk
 #       Ok, now gensrc is fully populated.
-	+make -f GenerateData.gmk
-	+make -f CompileJavaClasses.gmk
+	+$(MAKE) -f GenerateData.gmk
+	+$(MAKE) -f CompileJavaClasses.gmk
 #	The classes have been built, now generate
 #	classes that have other sources.
-	+make -f GenerateClasses.gmk
+	+$(MAKE) -f GenerateClasses.gmk
 #       The classes are now built and
 #       any javah files have now been generated.
-	+make -f CompileNativeLibraries.gmk
+	+$(MAKE) -f CompileNativeLibraries.gmk
 #       Finally compile the launchers.
-	+make -f CompileLaunchers.gmk
+	+$(MAKE) -f CompileLaunchers.gmk
 #       Now we have a complete jdk, which you can run.
 #       It is not yet wrapped up as an installed image.
 #       The demos are compiled against this jdk.
 ifndef NO_DEMOS
-	+make -f CompileDemos.gmk
+	+$(MAKE) -f CompileDemos.gmk
 endif
 #	Now copy the sample sources into the jdk.
 ifndef NO_SAMPLES
-	+make -f CopySamples.gmk
+	+$(MAKE) -f CopySamples.gmk
 endif
 
+# Create the final jdk and jre images in the old way. Kept for reference
+# until conversion is fully done.
+old-images:
+	+$(MAKE) $(IMAGES_MAKE_ARGS) -f OldImages.gmk 
+
 # Create the final jdk and jre images, to be wrapped up
-# into packages, or instealled.
-images: all
-	+make $(IMAGES_MAKE_ARGS) -f Images.gmk 
+# into packages, or installed.
+images:
+	+$(MAKE) -f CreateJars.gmk
+	+$(MAKE) $(IMAGES_MAKE_ARGS) -f Images.gmk 
 
 
 BINARIES:=$(shell if test -d $(IMAGES_OUTPUTDIR)/j2sdk-image/bin; then cd $(IMAGES_OUTPUTDIR)/j2sdk-image/bin && $(LS) ; fi)
@@ -89,4 +95,4 @@
 	echo Creating packages...well, in the future.
 	$(MKDIR) -p $(OUTPUT_ROOT)/packages
 
-.PHONY: all install
+.PHONY: all install images
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/OldImages.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -0,0 +1,175 @@
+#
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include Setup.gmk
+
+default: $(IMAGES_OUTPUTDIR)/_the.images
+
+include Tools.gmk
+
+JARS:=
+
+##########################################################################################
+
+JCONSOLE_JAR_DEPS := \
+  $(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses/sun/tools/jconsole/ -name "_the.package") \
+  $(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses/com/sun/tools/jconsole/ -name "_the.package")
+
+$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,$(JCONSOLE_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/newclasses,\
+		SUFFIXES:=.class .gif .png,\
+		INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
+		JARMAIN:=sun.tools.jconsole.JConsole,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/jconsole.jar,\
+		SKIP_METAINF:=true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/jconsole.jar
+
+##########################################################################################
+
+CHARSETS_JAR_DEPS :=
+
+$(eval $(call SetupArchive,BUILD_CHARSETS_JAR,$(CHARSETS_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/newclasses, \
+		SUFFIXES:=.class .dat,\
+		INCLUDES:=sun/nio/cs/ext,\
+		EXTRA_FILES := sun/awt/HKSCS.class \
+                               sun/awt/motif/X11GBK.class \
+                               'sun/awt/motif/X11GB2312$$$$Decoder.class' \
+                               sun/awt/motif/X11GB2312.class \
+                               'sun/awt/motif/X11KSC5601$$$$Decoder.class' \
+                               'sun/awt/motif/X11KSC5601$$$$Encoder.class' \
+                               'sun/awt/motif/X11GB2312$$$$Encoder.class' \
+                               'sun/awt/motif/X11GBK$$$$Encoder.class' \
+                               sun/awt/motif/X11KSC5601.class \
+                               META-INF/services/java.nio.charset.spi.CharsetProvider, \
+		JAR:=$(JDK_OUTPUTDIR)/lib/charsets.jar, \
+		JARMAIN := NONE, \
+		SKIP_METAINF := true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/charsets.jar
+
+##########################################################################################
+
+SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
+
+ifndef OPENJDK
+
+SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
+
+$(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
+	@$(ECHO) "\n>>>Installing prebuilt SunPKCS11 provider..."
+	$(RM) $@
+	$(CP) $< $@
+
+else
+
+$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,$(SUNPKCS11_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/newclasses, \
+		SUFFIXES:=.class,\
+		INCLUDES:=sun/security/pkcs11,\
+		JAR:=$(SUNPKCS11_JAR_DST), \
+		JARMAIN := NONE, \
+		SKIP_METAINF := true))
+
+endif
+
+JARS += $(SUNPKCS11_JAR_DST)
+
+##########################################################################################
+
+SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
+
+ifndef OPENJDK
+
+SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
+
+$(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
+	@$(ECHO) "\n>>>Installing prebuilt SunEC provider..."
+	$(RM) $@
+	$(CP) $< $@
+
+else
+
+$(eval $(call SetupArchive,BUILD_SUNEC_JAR,$(SUNEC_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/newclasses, \
+		SUFFIXES:=.class,\
+		INCLUDES:=sun/security/ec,\
+		EXCLUDE_FILES := \
+			sun/security/ec/ECKeyFactory.class \
+			sun/security/ec/ECParameters.class \
+			sun/security/ec/ECPrivateKeyImpl.class \
+			sun/security/ec/ECPublicKeyImpl.class \
+			sun/security/ec/NamedCurve.class \
+			'sun/security/ec/ECKeyFactory$$$$1.class' \
+			'sun/security/ec/ECKeyFactory$$$$2.class' ,\
+		JAR:=$(SUNEC_JAR_DST), \
+		JARMAIN := NONE, \
+		SKIP_METAINF := true))
+
+endif
+
+JARS += $(SUNEC_JAR_DST)
+
+##########################################################################################
+
+# TODO: deps?
+$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,$(SWINGBEANS_JAR_DEPS),\
+		SRCS:=$(JDK_OUTPUTDIR)/newclasses,\
+		SUFFIXES:=BeanInfo.class .gif,\
+		INCLUDES:=javax/swing sun/swing,\
+		EXCLUDES:=javax/swing/plaf,\
+		EXTRA_FILES:=javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/dt.jar,\
+		JARMAIN:=NONE,\
+		SKIP_METAINF:=true))
+
+JARS+=$(JDK_OUTPUTDIR)/lib/dt.jar
+
+##########################################################################################
+
+# Need to define BUILDDIR for Release.gmk to work
+BUILDDIR=$(JDK_TOPDIR)/makefiles
+include common/Defs.gmk
+include common/Release.gmk
+
+# A rudimentary attempt at band-aiding the dependency tracking.
+DEPS:=	$(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses -name "*.class" -type f) \
+	$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f) \
+	$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f) 
+
+$(IMAGES_OUTPUTDIR)/_the.images : $(DEPS) $(JARS)
+	$(MKDIR) -p $(@D)
+# 	Restart this makefile, ugly, but since double colon (::) rules
+# 	have been used in Release.gmk, it is impossible to craft on
+# 	dependencies on these. I.e. -do-not-use- :: rules!!!!!
+#       Repeat after me: -do-not-use- :: rules!!!!!
+	$(MAKE) -j1 -f OldImages.gmk $(IMAGES_MAKE_ARGS) images
+	$(TOUCH) $@
+
+.PHONY: default
--- a/makefiles/Setup.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/Setup.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -25,12 +25,13 @@
 
 JAVAC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar
 JAVAH_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar
+JAVADOC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javadoc.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javadoc.jar
 
 DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
 
 # The generate old bytecode javac setup uses the new compiler to compile for the
 # boot jdk to generate tools that need to be run with the boot jdk.
-# Thus we force the target bytecode to 6.
+# Thus we force the target bytecode to 7.
 $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\
      JVM:=$(JAVA),\
      JAVAC:=$(JAVAC_JARS),\
@@ -46,7 +47,7 @@
      JVM:=$(JAVA),\
      JAVAC:=$(JAVAC_JARS),\
      JAVAH:=$(JAVAH_JARS),\
-     FLAGS:=-bootclasspath "$(JDK_OUTPUTDIR)/newclasses$(PATH_SEP)$(JDK_OUTPUTDIR)/classes" -Xprefer:source -XDignore.symbol.file=true $(DISABLE_WARNINGS),\
+     FLAGS:=-bootclasspath "$(JDK_OUTPUTDIR)/classes" -Xprefer:source -XDignore.symbol.file=true $(DISABLE_WARNINGS),\
      SERVER_DIR:=$(JAVAC_SERVERS),\
      SERVER_JVM:=$(SERVER_JAVA),\
      MODE:=$(JAVAC_USE_MODE),\
--- a/makefiles/Tools.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/Tools.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -23,19 +23,24 @@
 # questions.
 #
 
+# The exception handling of swing beaninfo which have the own tool directory
 ifeq (,$(BUILD_TOOLS))
 $(eval $(call SetupJavaCompilation,BUILD_TOOLS,\
                 SETUP:=GENERATE_OLDBYTECODE,\
-		SRC:=$(JDK_TOPDIR)/make/tools/src,\
+		SRC:=$(JDK_TOPDIR)/make/tools/src \
+                     $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator \
+                     $(JDK_TOPDIR)/makefiles/sun/xawt \
+                     $(JDK_TOPDIR)/make/tools/swing-beans,\
 		BIN:=$(JDK_OUTPUTDIR)/btclasses))
+
 endif
 
 ifndef DISABLE_NIMBUS
 
 $(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/%.template : \
 	$(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/%.template
-	mkdir -p $(@D)
-	cp $< $@
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
 
 BUILD_TOOLS += $(foreach i,$(wildcard $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/*.template),$(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/$(notdir $i))
 
@@ -112,3 +117,9 @@
 # Nimbus is used somewhere in the swing build.
 TOOL_GENERATENIMBUS=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
 	build.tools.generatenimbus.Generator
+
+TOOL_WRAPPERGENERATOR=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
+	WrapperGenerator
+
+TOOL_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
+	sun.awt.X11.ToBin
--- a/makefiles/altclasses/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building alternate runtime classes (not used by default)
-#
-
-BUILDDIR = ..
-
-PRODUCT = altclasses
-
-include $(BUILDDIR)/common/Defs.gmk
-
-# Root of alternate class sources
-
-ALTCLASSES_SRCDIR = $(CLOSED_SRC)/share/altclasses
-
-# Alternate runtime classes
-
-ALTRT_JAR_FILE = $(LIBDIR)/alt-rt.jar
-ALTRT_JAR_SOURCE_FILE = $(TEMPDIR)/alt-rt.jarsrclist
-ALTRT_JAR_SOURCES = $(wildcard $(ALTCLASSES_SRCDIR)/java/*/*.java)
-
-# Use a special file suffix for the file that holds the source list
-
-.SUFFIXES: .jarsrclist
-
-# Build rules
-
-all build: 
-	@if [ -d $(ALTCLASSES_SRCDIR) ] ; then \
-	   $(MAKE) $(ALTRT_JAR_FILE); \
-	fi
-
-# Source list file creation
-
-$(ALTRT_JAR_SOURCE_FILE): $(ALTRT_JAR_SOURCES) FRC
-	$(prep-target)
-	$(ECHO) $(ALTRT_JAR_SOURCES) > $@
-
-clean clobber::
-	$(RM) $(ALTRT_JAR_FILE) $(ALTRT_JAR_SOURCE_FILE) 
-	$(RM) -r $(ALTRT_JAR_SOURCE_FILE).classes
-
-include $(BUILDDIR)/common/Classes.gmk
-
-# Pattern rule to turn a source list file into a jar file
-$(LIBDIR)/%.jar : $(TEMPDIR)/%.jarsrclist
-	$(prep-target)
-	$(RM) -r $(<).classes
-	$(MKDIR) -p $(<).classes
-	$(JAVAC_CMD) -implicit:none -d $(<).classes @$<
-	$(BOOT_JAR_CMD) cf $@ -C $(<).classes . $(BOOT_JAR_JFLAGS)
-
-# Force target
-
-FRC:
-
-# Non file targets
-
-.PHONY: all build clean clobber
-
--- a/makefiles/apple/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building com/apple
-#
-
-BUILDDIR = ..
-PRODUCT = sun
-include $(BUILDDIR)/common/Defs.gmk
-
-SUBDIRS = applescript
-
-include $(BUILDDIR)/common/Subdirs.gmk
-
-all build clean clobber::
-	$(SUBDIRS-loop)
--- a/makefiles/apple/applescript/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-#
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../..
-PACKAGE = apple.applescript
-LIBRARY = AppleScriptEngine
-PRODUCT = sun
-include $(BUILDDIR)/common/Defs.gmk
-
-
-#
-# Files
-#
-AUTO_FILES_JAVA_DIRS = apple/applescript
-
-FILES_objc = \
-        $(TARGDIR)AppleScriptEngine.m \
-        $(TARGDIR)AppleScriptExecutionContext.m \
-        $(TARGDIR)AS_NS_ConversionUtils.m \
-        $(TARGDIR)NS_Java_ConversionUtils.m
-
-
-FILES_export = \
-	apple/applescript/AppleScriptEngine.java \
-	apple/applescript/AppleScriptEngineFactory.java
-
-#
-# Rules
-#
-include $(BUILDDIR)/common/Mapfile-vers.gmk
-include $(BUILDDIR)/common/Library.gmk
-
-
-#
-# Extra rules
-#
-
-#
-# Add to ambient vpath to get files in a subdirectory
-#
-vpath %.m   $(call NativeSrcDirList,,native/apple/applescript)
-
-CPPFLAGS += \
-	-I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
-
-OTHER_LDLIBS = \
-    -framework Cocoa \
-    -framework Carbon \
-    -framework JavaNativeFoundation
--- a/makefiles/com/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-#
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building all of java
-#
-
-BUILDDIR = ..
-PRODUCT = com
-include $(BUILDDIR)/common/Defs.gmk
-
-SUBDIRS = sun oracle
-
-ifeq ($(PLATFORM), macosx)
-    SUBDIRS += apple
-endif
-
-include $(BUILDDIR)/common/Subdirs.gmk
-
-all build clean clobber::
-	$(SUBDIRS-loop)
-
--- a/makefiles/com/apple/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building com/apple
-#
-
-BUILDDIR = ../..
-PRODUCT = sun
-include $(BUILDDIR)/common/Defs.gmk
-
-SUBDIRS = osx osxui
-
-include $(BUILDDIR)/common/Subdirs.gmk
-
-all build clean clobber::
-	$(SUBDIRS-loop)
--- a/makefiles/com/apple/osx/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../../..
-PACKAGE = com.apple.osx
-LIBRARY = osx
-PRODUCT = sun
-include $(BUILDDIR)/common/Defs.gmk
-
-
-#
-# Files
-#
-AUTO_FILES_JAVA_DIRS = apple/launcher apple/security com/apple/concurrent com/apple/eio java/util/prefs
-
-FILES_objc += \
-    $(TARGDIR)Dispatch.m \
-    $(TARGDIR)CFileManager.m \
-    $(TARGDIR)KeystoreImpl.m \
-    $(TARGDIR)JavaAppLauncher.m \
-    $(TARGDIR)MacOSXPreferencesFile.m \
-    $(TARGDIR)SCDynamicStoreConfig.m
-
-FILES_export += \
-	com/apple/concurrent/LibDispatchNative.java \
-	com/apple/eio/FileManager.java \
-	apple/security/KeychainStore.java \
-	apple/launcher/JavaAppLauncher.java \
-	java/util/prefs/MacOSXPreferencesFile.java
-
-# TODO: couldn't figure out how to get resources working
-#LOCALE_SET_DEFINITION = jre
-#RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES = apple/launcher/appLauncherErrors.properties
-
-
-#
-# Rules
-#
-include $(BUILDDIR)/common/Mapfile-vers.gmk
-include $(BUILDDIR)/common/Library.gmk
-
-
-#
-# Extra rules
-#
-
-#
-# Add to ambient vpath to get files in a subdirectory
-#
-vpath %.m   $(call NativeSrcDirList,,native/com/apple/concurrent)
-vpath %.m   $(call NativeSrcDirList,,native/com/apple/eio)
-vpath %.m   $(call NativeSrcDirList,,native/apple/launcher)
-vpath %.m   $(call NativeSrcDirList,,native/apple/security)
-vpath %.m   $(call NativeSrcDirList,,native/java/util)
-
-CPPFLAGS += \
-	$(call NativeSrcDirList,-I,native/com/apple/laf) \
-	$(call NativeSrcDirList,-I,native/apple/awt) \
-	$(call NativeSrcDirList,-I,native/sun/awt) \
-	$(call NativeSrcDirList,-I,native/sun/osxapp)
-
-OTHER_LDLIBS = \
-    -losxapp \
-    -framework Cocoa \
-    -framework ApplicationServices \
-    -framework JavaNativeFoundation \
-    -framework JavaRuntimeSupport \
-    -framework Security \
-    -framework SystemConfiguration
--- a/makefiles/com/apple/osxui/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../../..
-PACKAGE = com.apple.osxui
-LIBRARY = osxui
-PRODUCT = sun
-include $(BUILDDIR)/common/Defs.gmk
-
-
-#
-# Files
-#
-AUTO_FILES_JAVA_DIRS = apple/laf com/apple/laf com/apple/eawt
-
-FILES_objc = \
-        $(TARGDIR)AquaFileView.m \
-        $(TARGDIR)AquaLookAndFeel.m \
-        $(TARGDIR)AquaNativeResources.m \
-        $(TARGDIR)JRSUIConstantSync.m \
-        $(TARGDIR)JRSUIController.m \
-        $(TARGDIR)JRSUIFocus.m \
-        $(TARGDIR)ScreenPopupFactory.m \
-        $(TARGDIR)ScreenMenu.m
-
-FILES_export = \
-	apple/laf/AquaLookAndFeel.java \
-	apple/laf/JRSUIConstants.java \
-	apple/laf/JRSUIControl.java \
-	apple/laf/JRSUIFocus.java \
-	apple/laf/JRSUIState.java \
-	apple/laf/JRSUIStateFactory.java \
-	apple/laf/JRSUIUtils.java \
-	com/apple/laf/AquaFileView.java \
-	com/apple/laf/AquaNativeResources.java \
-	com/apple/laf/ScreenPopupFactory.java \
-	com/apple/laf/ScreenMenu.java \
-	com/apple/laf/ScreenMenuBar.java \
-	com/apple/laf/ScreenMenuBarProvider.java \
-	com/apple/laf/ScreenMenuItem.java \
-	com/apple/laf/ScreenMenuItemCheckbox.java \
-	com/apple/laf/ScreenMenuItemUI.java \
-	com/apple/laf/ScreenMenuPropertyHandler.java \
-	com/apple/laf/ScreenMenuPropertyListener.java
-
-#RESOURCE_BUNDLES_COMPILED_PROPERTIES += \
-#	com/apple/laf/resources/aqua.properties \
-#	com/apple/laf/resources/aqua_de.properties \
-#	com/apple/laf/resources/aqua_fr.properties \
-#	com/apple/laf/resources/aqua_ja.properties
-
-
-#
-# Rules
-#
-include $(BUILDDIR)/common/Mapfile-vers.gmk
-include $(BUILDDIR)/common/Library.gmk
-
-
-#
-# Extra rules
-#
-
-#
-# Add to ambient vpath to get files in a subdirectory
-#
-vpath %.m   $(call NativeSrcDirList,,native/com/apple/laf)
-vpath %.m $(call NativeSrcDirList,,native/com/apple/eawt)
-
-CPPFLAGS += \
-	$(call NativeSrcDirList,-I,native/com/apple/laf) \
-	$(call NativeSrcDirList,-I,native/apple/awt) \
-	$(call NativeSrcDirList,-I,native/sun/awt) \
-	$(call NativeSrcDirList,-I,native/sun/osxapp) \
-	-I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
-
-OTHER_LDLIBS = \
-    -lawt -losxapp \
-    -lawt_lwawt -L$(LIBDIR) -Xlinker -rpath -Xlinker @loader_path \
-    -framework Cocoa \
-    -framework Carbon \
-    -framework ApplicationServices \
-    -framework JavaNativeFoundation \
-    -framework JavaRuntimeSupport
--- a/makefiles/com/oracle/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../..
-PRODUCT = oracle
-#SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
-#SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
-#SUBDIRS_MAKEFLAGS += JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation,-path
-include $(BUILDDIR)/common/Defs.gmk
-
-# build com/oracle/security/ucrypto on Solaris platform for non-OpenJDK builds
-UCRYPTO =
-ifndef OPENJDK
-  ifeq ($(PLATFORM), solaris)
-    UCRYPTO = security/ucrypto
-  endif
-endif
-
-JFR =
-ifndef OPENJDK
-ifndef JAVASE_EMBEDDED
-	JFR = jfr
-endif
-endif
-
-SUBDIRS = $(JFR) $(UCRYPTO)
-
-include $(BUILDDIR)/common/Subdirs.gmk
-
-all build clean clobber::
-	$(SUBDIRS-loop)
-
--- a/makefiles/com/oracle/jfr/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../../..
-PACKAGE = oracle.jrockit.jfr
-LIBRARY = jfr
-PRODUCT = oracle
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Use mapfile
-#
-FILES_m = $(CLOSED_SHARE_SRC)/native/oracle/jfr/mapfile-vers
-include $(BUILDDIR)/common/Mapfile-vers.gmk
-
-#
-# Files to compile
-#
-FILES_c = VMJFR.c
-
-AUTO_FILES_JAVA_DIRS = com/oracle/jrockit/jfr oracle/jrockit/jfr
-
-# Find C source files
-#
-vpath %.c $(CLOSED_SHARE_SRC)/native/oracle/jfr
-
-#
-# Library to compile.
-#
-include $(BUILDDIR)/common/Library.gmk
-
-JVMLIB =
-JAVALIB =
-OTHER_LDLIBS =
-
-clean clobber::
-	$(RM) -r $(CLASSDESTDIR)/com/oracle/jrockit/jfr
-	$(RM) -r $(CLASSDESTDIR)/oracle/jrockit/jfr
-
-
-# Copy pre-shipped .jfs files
-JFR_LIBDIR = $(LIBDIR)/jfr
-JFR_SRCDIR = $(CLOSED_SHARE_SRC)/lib/jfr
-
-$(JFR_LIBDIR)/%.jfs: $(JFR_SRCDIR)/%.jfs
-	$(install-file)
-
-JFS_FILES := $(subst $(JFR_SRCDIR),$(JFR_LIBDIR),$(wildcard $(JFR_SRCDIR)/*.jfs))
-
-all build : $(JFS_FILES)
-
--- a/makefiles/com/oracle/security/ucrypto/FILES_c.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-ifndef OPENJDK
-FILES_c = \
-        nativeFunc.c \
-	nativeCrypto.c
-endif
--- a/makefiles/com/oracle/security/ucrypto/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building ucrypto.jar and its native libraries.
-#
-# This file was modified from make/sun/security/pkcs11/Makefile.
-#
-#
-# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Oracle
-# JDK builds respectively.)
-#
-# This Makefile does the "real" build of the Ucrypto provider files.
-# Since the sources are unavailable for OpenJDK, this Makefile is only
-# useful for JDK.
-#
-#
-# Main Targets (JDK on Solaris):
-#
-#     all                      The usual, ucrypto.jar plus the native libraries.
-#                                  builds and installs the prebuilt/signed jar.
-#
-#     clobber/clean            Cleans up the temp directory, ucrypto.jar, the
-#                              native libraries, and the config file from the
-#                              build area
-#
-#     jar                      Builds, signs and installs ucrypto.jar
-#                              (Can only be done on machines with access to
-#                               the signing keystore)
-#
-# Other lesser-used Targets (JDK on Solaris):
-#
-#     build-jar                Builds ucrypto.jar (no sign/install)
-#
-#     sign                     Builds/signs ucrypto.jar (no install)
-#
-#     release                  Builds all targets in preparation
-#                              for workspace integration.
-#                              (Can only be done on machines with access to
-#                               the signing keystore)
-#
-#     install-prebuilt         Installs the pre-built jar files
-#
-# NOTE: None of the above target will update the prebuilt provider binary
-# under the closed workspace. To update it, you must explicitly copy the
-# binary from either the tmp/signed or lib/ext directory.
-#
-# This makefile was written to support parallel target execution.
-#
-
-BUILDDIR = ../../../..
-
-include $(BUILDDIR)/common/Defs.gmk
-
-ifndef OPENJDK
-  ifneq ($(PLATFORM), solaris)
-    all:
-  else
-    PACKAGE = com.oracle.security.ucrypto
-  LIBRARY = j2ucrypto
-  PRODUCT = oracle
-
-  #
-  # The following is for when we need to do postprocessing
-  # (signing/obfuscation) against a read-only build.  If the OUTPUTDIR
-  # isn't writable, the build currently crashes out.
-  #
-  ifdef ALT_JCE_BUILD_DIR
-    # =====================================================
-    # Where to place the output, in case we're building from a read-only
-    # build area.  (e.g. a release engineering build.)
-    JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
-    IGNORE_WRITABLE_OUTPUTDIR_TEST=true
-  else
-    JCE_BUILD_DIR=${TEMPDIR}
-  endif
-
-  JAVAC_MAX_WARNINGS=false
-  JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
-  JAVAC_WARNINGS_FATAL=true
-
-  #
-  # C and Java Files
-  #
-  include FILES_c.gmk
-
-  #
-  # Subdirectories of these are automatically included.
-  #
-  AUTO_FILES_JAVA_DIRS = com/oracle/security/ucrypto
-
-  #
-  # Java files that define native methods
-  #
-  FILES_export = \
-      com/oracle/security/ucrypto/UcryptoProvider.java \
-      com/oracle/security/ucrypto/NativeCipher.java \
-      com/oracle/security/ucrypto/NativeDigest.java \
-      com/oracle/security/ucrypto/NativeKey.java \
-      com/oracle/security/ucrypto/NativeRSASignature.java \
-      com/oracle/security/ucrypto/NativeRSACipher.java
-
-  #
-  # Find native code
-  #
-  vpath %.c \
-    $(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto
-
-  #
-  # Find include files
-  #
-  OTHER_INCLUDES += \
-    -I$(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto
-
-  #
-  # Rules
-  #
-  CLASSDESTDIR = $(TEMPDIR)/classes
-  JAVAHFLAGS = -bootclasspath \
-    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)$(JCE_PATH)"
-
-  include $(BUILDDIR)/common/Mapfile-vers.gmk
-  include $(BUILDDIR)/common/Library.gmk
-
-  #
-  # Libraries to link
-  #
-  OTHER_LDLIBS = -ldl
-
-  # Default config file
-  UCRYPTO_CFG_SRC   = $(CLOSED_SRC)/share/lib/security/ucrypto-solaris.cfg
-  UCRYPTO_CFG_BUILD = $(LIBDIR)/security/ucrypto-solaris.cfg
-
-  #
-  # We use a variety of subdirectories in the $(TEMPDIR) depending on what
-  # part of the build we're doing.  Build is initially done in the unsigned
-  # area and when files are signed, they will be placed in the appropriate area.
-  #
-  UNSIGNED_DIR = $(TEMPDIR)/unsigned
-
-  #
-  # Rules
-  #
-  all: ucrypto-cfg build-jar install-prebuilt
-	$(build-warning)
-
-  ucrypto-cfg: $(UCRYPTO_CFG_BUILD)
-
-  $(UCRYPTO_CFG_BUILD): $(UCRYPTO_CFG_SRC)
-	$(install-file)
-
-  include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
-
-
-  # =====================================================
-  # Build the unsigned ucrypto.jar file.
-  #
-
-  JAR_DESTFILE = $(EXTDIR)/ucrypto.jar
-
-  #
-  # The ucrypto.jar needs to be in the extension class directory,
-  # therefore none of its classes can appear in $(CLASSBINDIR).
-  # Currently no one is using any of the internals, so these files
-  # should not have been built.
-  #
-
-  #
-  # Since the -C option to jar is used below, each directory entry must be
-  # preceded with the appropriate directory to "cd" into.
-  #
-  JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS))
-
-  build-jar: $(UNSIGNED_DIR)/ucrypto.jar
-
-  #
-  # Build ucrypto.jar.
-  #
-  $(UNSIGNED_DIR)/ucrypto.jar: build
-	$(prep-target)
-	$(BOOT_JAR_CMD) cf $@ $(JAR_DIRS) \
-	    $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
-
-  #
-  # Sign ucrypto.jar
-  #
-  SIGNED_DIR = $(JCE_BUILD_DIR)/signed
-
-  sign: $(SIGNED_DIR)/ucrypto.jar
-
-  ifndef ALT_JCE_BUILD_DIR
-    $(SIGNED_DIR)/ucrypto.jar: $(UNSIGNED_DIR)/ucrypto.jar
-  else
-    #
-    # We have to remove the build dependency, otherwise, we'll try to rebuild it
-    # which we can't do on a read-only filesystem.
-    #
-    $(SIGNED_DIR)/ucrypto.jar:
-	@if [ ! -r $(UNSIGNED_DIR)/ucrypto.jar ] ; then \
-            $(ECHO) "Couldn't find $(UNSIGNED_DIR)/ucrypto.jar"; \
-            exit 1; \
-        fi
-  endif
-	$(call sign-file, $(UNSIGNED_DIR)/ucrypto.jar)
-
-
-  # =====================================================
-  # Create the Release Engineering files.  Signed builds, etc.
-  #
-
-  release: $(SIGNED_DIR)/ucrypto.jar
-	$(RM) $(JCE_BUILD_DIR)/release/ucrypto.jar
-	$(MKDIR) -p $(JCE_BUILD_DIR)/release
-	$(CP) $(SIGNED_DIR)/ucrypto.jar $(JCE_BUILD_DIR)/release
-	$(release-warning)
-
-
-  # =====================================================
-  # Install routines.
-  #
-
-  #
-  # Install ucrypto.jar, depending on which type is requested.
-  #
-  jar: $(JAR_DESTFILE)
-	$(release-warning)
-
-  $(JAR_DESTFILE): $(SIGNED_DIR)/ucrypto.jar
-	$(install-file)
-
-  install-prebuilt:
-	@$(ECHO) "\n>>>Installing prebuilt OracleUcrypto provider..."
-	$(RM) $(JAR_DESTFILE)
-	$(CP) $(PREBUILT_DIR)/ucrypto/ucrypto.jar $(JAR_DESTFILE)
-
-
-  # =====================================================
-  # Support routines.
-  #
-  clobber clean::
-	$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
-	$(RM) -r $(UCRYPTO_CFG_BUILD)
-
-  .PHONY: build-jar jar sign release install-prebuilt
-
-  endif #ifneq ($(PLATFORM), solaris)
-endif #ifndef OPENJDK
--- a/makefiles/com/oracle/security/ucrypto/mapfile-vers	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-#
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# Define public interface.
-
-SUNWprivate_1.1 {
-	global:
-                JNI_OnLoad;
-                Java_com_oracle_security_ucrypto_UcryptoProvider_loadLibraries;
-                Java_com_oracle_security_ucrypto_UcryptoProvider_getMechList;
-		Java_com_oracle_security_ucrypto_NativeDigest_nativeInit;
-                Java_com_oracle_security_ucrypto_NativeDigest_nativeUpdate;
-                Java_com_oracle_security_ucrypto_NativeDigest_nativeDigest;
-                Java_com_oracle_security_ucrypto_NativeDigest_nativeClone;
-                Java_com_oracle_security_ucrypto_NativeDigest_nativeFree;
-		Java_com_oracle_security_ucrypto_NativeCipher_nativeInit;
-		Java_com_oracle_security_ucrypto_NativeCipher_nativeUpdate;
-		Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal;
-                Java_com_oracle_security_ucrypto_NativeKey_nativeFree;
-                Java_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit;
-                Java_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit;
-		Java_com_oracle_security_ucrypto_NativeRSASignature_nativeInit;
-		Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII;
-		Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI;
-		Java_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal;
-		Java_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic;
-
-                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeInit;
-                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeUpdate;
-                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeDigest;
-                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeClone;
-                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeFree;
-                JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeInit;
-                JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeUpdate;
-                JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeFinal;
-                JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree;
-                JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit;
-                JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit;
-		JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeInit;
-		JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII;
-		JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI;
-		JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal;
-                JavaCritical_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic;
-
-	local:
-		*;
-};
--- a/makefiles/com/sun/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-
-#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building com/sun
-#
-
-BUILDDIR = ../..
-PRODUCT = sun
-include $(BUILDDIR)/common/Defs.gmk
-
-ifndef OPENJDK
-  ORG_EXISTS := $(call DirExists,$(CLOSED_SRC)/share/classes/sun/org,,)
-  ifneq ("$(ORG_EXISTS)", "") 
-    SCRIPT_SUBDIR = script
-  endif
-endif
-
-# jarsigner is part of JRE
-SUBDIRS = 
-
-SUBDIRS_management =
-SUBDIRS_enterprise = crypto/provider
-SUBDIRS_misc       = 
-
-# Omit mirror since it's built with the apt tool.
-
-include $(BUILDDIR)/common/Subdirs.gmk
-
-all build clean clobber::
-	$(SUBDIRS-loop)
--- a/makefiles/common/Defs-macosx.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/common/Defs-macosx.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -106,10 +106,10 @@
 
 # For all platforms, do not omit the frame pointer register usage. 
 #    We need this frame pointer to make it easy to walk the stacks.
-#    This should be the default on X86, but ia64 and amd64 may not have this
-#    as the default.
-CFLAGS_REQUIRED_amd64   += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
-LDFLAGS_COMMON_amd64    += -m64
+#    This should be the default on X86, but ia64, and x86_64
+#    may not have this as the default.
+CFLAGS_REQUIRED_x86_64  += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
+LDFLAGS_COMMON_x86_64   += -m64
 CFLAGS_REQUIRED_i586    += -m32 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
 LDFLAGS_COMMON_i586     += -m32
 CFLAGS_REQUIRED_ia64    += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
@@ -163,7 +163,7 @@
 PIC_CODE_SMALL = -fpic
 GLOBAL_KPIC = $(PIC_CODE_LARGE)
 CFLAGS_COMMON   += $(GLOBAL_KPIC) $(GCC_WARNINGS)
-ifeq ($(ARCH), amd64)
+ifeq ($(ARCH), x86_64)
  CFLAGS_COMMON += -pipe
 endif
 
--- a/makefiles/common/Release-macosx.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/common/Release-macosx.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -29,14 +29,14 @@
 
 # Defines the release targets for Mac OS X build products
 
-JDK_BUNDLE_DIR = $(ABS_OUTPUTDIR)/j2sdk-bundle/$(THIS_JDK_VERSION).jdk/Contents
-JRE_BUNDLE_DIR = $(ABS_OUTPUTDIR)/j2re-bundle/$(THIS_JDK_VERSION).jre/Contents
+JDK_BUNDLE_DIR = $(ABS_OUTPUTDIR)/j2sdk-bundle/jdk$(JDK_VERSION).jdk/Contents
+JRE_BUNDLE_DIR = $(ABS_OUTPUTDIR)/j2re-bundle/jre$(JDK_VERSION).jre/Contents
 
 MACOSX_SRC	 = $(JDK_TOPDIR)/src/macosx
 
 BUNDLE_ID ?= net.java.openjdk
-BUNLDE_ID_JRE ?= $(BUNDLE_ID).jre
-BUNLDE_ID_JDK ?= $(BUNDLE_ID).jdk
+BUNDLE_ID_JRE ?= $(BUNDLE_ID).jre
+BUNDLE_ID_JDK ?= $(BUNDLE_ID).jdk
 
 BUNDLE_NAME ?= OpenJDK $(JDK_MINOR_VERSION)
 BUNDLE_NAME_JRE ?= $(BUNDLE_NAME)
--- a/makefiles/common/Release.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/common/Release.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -509,7 +509,8 @@
 
 # The following get removed from the JRE after the bulk-copy of LIBDIR...
 NOTJRELIBS = tools.jar \
-        jconsole.jar
+        jconsole.jar \
+	dt.jar
 
 ifeq ($(INCLUDE_SA), true)
   NOTJRELIBS += sa-jdi.jar
@@ -584,6 +585,7 @@
 	$(ECHO) "sun/awt/motif/X11KSC5601\$$Decoder.class" >> $@
 	$(ECHO) "sun/awt/motif/X11KSC5601\$$Encoder.class" >> $@
 	$(ECHO) "sun/awt/motif/X11KSC5601.class" >> $@
+	$(ECHO) "META-INF/services/java.nio.charset.spi.CharsetProvider" >> $@
 	$(ECHO) "sun/rmi/rmic/" >> $@
 	$(ECHO) "sun/tools/asm/" >> $@
 	$(ECHO) "sun/tools/java/" >> $@
@@ -611,6 +613,18 @@
 	$(ECHO) "sun/security/provider/Sun.class" >> $@
 	$(ECHO) "sun/security/rsa/SunRsaSign.class" >> $@
 	$(ECHO) "sun/security/ssl/" >> $@
+	$(ECHO) "sun/security/pkcs11/" >> $@
+	$(ECHO) "sun/security/ec/ECDHKeyAgreement.class" >> $@
+	$(ECHO) "sun/security/ec/ECDSASignature.class" >> $@
+	$(ECHO) "sun/security/ec/ECKeyPairGenerator.class" >> $@
+	$(ECHO) "sun/security/ec/SunEC\$$1.class" >> $@
+	$(ECHO) "sun/security/ec/SunEC.class" >> $@
+	$(ECHO) "sun/security/ec/SunECEntries.class" >> $@
+	$(ECHO) "sun/security/ec/ECDSASignature\$$Raw.class" >> $@
+	$(ECHO) "sun/security/ec/ECDSASignature\$$SHA1.class" >> $@
+	$(ECHO) "sun/security/ec/ECDSASignature\$$SHA256.class" >> $@
+	$(ECHO) "sun/security/ec/ECDSASignature\$$SHA384.class" >> $@
+	$(ECHO) "sun/security/ec/ECDSASignature\$$SHA512.class" >> $@
 	$(ECHO) "com/sun/net/ssl/internal/ssl/" >> $@
 	$(ECHO) "javax/crypto/" >> $@
 	$(ECHO) "sun/security/internal/" >> $@
@@ -629,7 +643,54 @@
 	$(ECHO) "sun/tools/jmap/" >> $@
 	$(ECHO) "sun/net/spi/nameservice/dns/" >> $@
 	$(ECHO) "META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor" >> $@
-	$(ECHO) $(patsubst $(CLASSBINDIR)/%,%,$(LOCALEDATA_JAR_FILES)) | sed 's/ /\n/g' >> $@
+	$(ECHO) "javax/swing/AbstractButtonBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/BoxBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JAppletBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JButtonBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JCheckBoxBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JCheckBoxMenuItemBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JColorChooserBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JComboBoxBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JComponentBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JDesktopPaneBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JDialogBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JEditorPaneBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JFileChooserBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JFormattedTextFieldBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JFrameBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JInternalFrameBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JLabelBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JLayeredPaneBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JListBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JMenuBarBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JMenuBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JMenuItemBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JOptionPaneBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JPanelBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JPasswordFieldBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JPopupMenuBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JProgressBarBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JRadioButtonBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JRadioButtonMenuItemBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JScrollBarBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JScrollPaneBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JSeparatorBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JSliderBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JSpinnerBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JSplitPaneBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JTabbedPaneBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JTableBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JTextAreaBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JTextFieldBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JTextPaneBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JToggleButtonBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JToolBarBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JTreeBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/JWindowBeanInfo.class" >> $@
+	$(ECHO) "javax/swing/SwingBeanInfoBase.class" >> $@
+	$(ECHO) "javax/swing/text/JTextComponentBeanInfo.class" >> $@
+	$(ECHO) "sun/swing/BeanInfoUtils.class" >> $@
+	$(ECHO) $(patsubst $(CLASSBINDIR)/%,%,$(LOCALEDATA_JAR_FILES)) | $(TR) " " "\n" >> $@
 ifndef OPENJDK
 ifndef JAVASE_EMBEDDED
 	$(ECHO) "com/oracle/jrockit/jfr/" >> $@
@@ -647,7 +708,46 @@
 	$(ECHO) "oracle/jrockit/jfr/util/text/" >> $@
 endif
 endif
+	(cd $(JDK_OUTPUTDIR)/classes && $(FIND) . -name "_the.*") >> $@
+ifeq ($(PLATFORM), macosx)
+	$(ECHO) "com/sun/nio/sctp/" >> $@
+	$(ECHO) "sun/nio/ch/sctp/" >> $@
+	$(ECHO) "sun/jdbc/" >> $@
+	$(ECHO) "sun/nio/ch/DevPollArrayWrapper\$$Updator.class" >> $@
+	$(ECHO) "sun/nio/ch/DevPollArrayWrapper.class" >> $@
+	$(ECHO) "sun/nio/ch/DevPollSelectorImpl.class" >> $@
+	$(ECHO) "sun/nio/ch/DevPollSelectorProvider.class" >> $@
+	$(ECHO) "sun/nio/ch/EPollArrayWrapper\$$Updator.class" >> $@
+	$(ECHO) "sun/nio/ch/EPollArrayWrapper.class" >> $@
+	$(ECHO) "sun/nio/ch/EPollSelectorImpl.class" >> $@
+	$(ECHO) "sun/nio/ch/EPollSelectorProvider.class" >> $@
+endif
 
+######################################################
+# List of directories in classes directory that should NOT be in resources.jar
+######################################################
+
+NOT_RESOURCES_JAR_LIST = $(IMAGES_OUTPUTDIR)/tmp/not_resources_jar.list
+
+$(NOT_RESOURCES_JAR_LIST): FRC
+	$(prep-target)
+	$(ECHO) "#\n" >> $@
+	$(ECHO) "# List of subdirectories not in include in resources.jar" >> $@
+	$(ECHO) "# Directories must contain trailing '/'." >> $@
+	$(ECHO) "javax/swing/beaninfo/" >> $@
+
+TOTAL_JAR_EXCLUDE_LIST = $(IMAGES_OUTPUTDIR)/tmp/total_jar_exclude.list
+
+######################################################
+# Total exclude list
+######################################################
+
+$(TOTAL_JAR_EXCLUDE_LIST): $(NOT_RT_JAR_LIST) $(NOT_RESOURCES_JAR_LIST)
+	$(prep-target)
+	$(ECHO) "#\n" >> $@
+	$(ECHO) "# List of subdirectories not in include in resources.jar" >> $@	
+	$(CAT) $(NOT_RT_JAR_LIST) >>$@
+	$(CAT) $(NOT_RESOURCES_JAR_LIST) >>$@ 
 
 # File order list for rt.jar
 #     - sun.applet is included, till hotjava stops relying on it.
@@ -660,12 +760,12 @@
 RT_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/rt_jar_list
 RES_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/resources_jar_list
 
-$(TOTAL_JAR_FILELIST): $(BUILD_TOOLS) $(NOT_RT_JAR_LIST)
+$(TOTAL_JAR_FILELIST): $(BUILD_TOOLS) $(TOTAL_JAR_EXCLUDE_LIST)
 	$(prep-target)
 	$(RM) $@.temp
 	($(CD) $(CLASSBINDIR) && \
 	    $(TOOL_JARREORDER) \
-		-o  $@.temp $(ABS_LIBDIR)/classlist $(NOT_RT_JAR_LIST) . )
+		-o  $@.temp $(ABS_LIBDIR)/classlist $(TOTAL_JAR_EXCLUDE_LIST) . )
 	$(MV) $@.temp $@
 	($(CD) $(CLASSBINDIR) && $(java-vm-cleanup))
 
@@ -1181,7 +1281,7 @@
 	@#
 	@# Swing BeanInfo generation
 	@#
-	$(CD) javax/swing/beaninfo && $(MAKE) TEMPDIR=$(IMAGES_OUTPUTDIR)/tmp ABS_TEMPDIR=$(IMAGES_OUTPUTDIR)/tmp swing-1.2-beans
+	$(CP) $(JDK_OUTPUTDIR)/lib/dt.jar $(JDK_IMAGE_DIR)/lib/dt.jar
 ifneq ($(PLATFORM), windows)
 	$(call copy-man-pages,$(JDK_IMAGE_DIR),$(JDK_MAN_PAGES))
 endif # !windows
--- a/makefiles/common/shared/Defs-utils.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-# Purposely empty for now, should be removed eventually.
-
--- a/makefiles/common/shared/Defs.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/common/shared/Defs.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -51,9 +51,6 @@
 -include $(SPEC)
 -include $(VARS)
 
-# Get shared system utilities macros defined
-include $(JDK_MAKE_SHARED_DIR)/Defs-utils.gmk
-
 # Assumes ARCH, PLATFORM, ARCH_VM_SUBDIR, JDK_TOPDIR, etc. have been defined.
 
 # Simple pwd path
@@ -663,4 +660,3 @@
 #   Up until we include this file, we don't know what specific compiler
 #   version is actually being used (i.e. what is in PATH or COMPILER_PATH).
 include $(JDK_MAKE_SHARED_DIR)/Compiler-$(CC_VERSION).gmk
-
--- a/makefiles/docs/CORE_PKGS.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/docs/CORE_PKGS.gmk	Wed Jun 13 16:57:34 2012 -0700
@@ -64,7 +64,7 @@
   javax.management.*  \
   javax.script  \
   javax.sql.*  \
-  javax.tools  \
+  javax.tools.*  \
   javax.xml.*  \
   org.w3c.*  \
   org.xml.sax
@@ -218,6 +218,7 @@
   javax.swing.plaf.nimbus                        \
   javax.swing.plaf.synth                         \
   javax.tools                                    \
+  javax.tools.annotation                         \
   javax.transaction                              \
   javax.transaction.xa                           \
   javax.xml.parsers                              \
--- a/makefiles/java/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ b/makefiles/java/Makefile	Wed Jun 13 16:57:34 2012 -0700
@@ -34,30 +34,19 @@
 #
 # The order of subdirs here is important
 #
-SUBDIRS += jvm redist verify fdlibm java sun_nio jli main
+SUBDIRS += redist
 
 # Others
 #    Note: java_crw_demo java_hprof_demo are demos but must be delivered built in sdk
 
-SUBDIRS += security util net nio
+SUBDIRS +=
 
-SUBDIRS_management = management
-SUBDIRS_misc       = npt java_crw_demo java_hprof_demo \
-                     instrument 
+SUBDIRS_management =
+SUBDIRS_misc       =
+
 #TODO Check invoke
 #                     logging instrument invoke sql rmi
 
-
-ifeq ($(PLATFORM), solaris)
-  ifeq ($(ARCH_DATA_MODEL), 32)
-    SUBDIRS += jexec
-  endif
-endif # PLATFORM
-
-ifeq ($(PLATFORM), linux)
-  SUBDIRS += jexec
-endif # PLATFORM
-
 ifeq ($(PLATFORM), macosx)
   SUBDIRS += jobjc
 endif # PLATFORM
--- a/makefiles/java/fdlibm/FILES_c.gmk	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-#
-# Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-FILES_c = \
-	k_standard.c \
-	k_rem_pio2.c \
-	k_cos.c \
-	k_sin.c \
-	k_tan.c \
-	e_acos.c \
-	e_asin.c \
-	e_atan2.c \
-	e_atanh.c \
-	e_cosh.c \
-	e_exp.c \
-	e_fmod.c \
-	e_hypot.c \
-	e_log.c \
-	e_log10.c \
-	e_pow.c \
-	e_rem_pio2.c \
-	e_remainder.c \
-	e_scalb.c \
-	e_sinh.c \
-	e_sqrt.c \
-	w_acos.c \
-	w_asin.c \
-	w_atan2.c \
-	w_atanh.c \
-	w_cosh.c \
-	w_exp.c \
-	w_fmod.c \
-	w_hypot.c \
-	w_log.c \
-	w_log10.c \
-	w_pow.c \
-	w_remainder.c \
-	w_scalb.c \
-	w_sinh.c \
-	w_sqrt.c \
-	s_atan.c \
-	s_cbrt.c \
-	s_ceil.c \
-	s_copysign.c \
-	s_cos.c \
-	s_expm1.c \
-	s_fabs.c \
-	s_finite.c \
-	s_floor.c \
-	s_frexp.c \
-	s_ilogb.c \
-	s_isnan.c \
-	s_ldexp.c \
-	s_lib_version.c \
-	s_log1p.c \
-	s_logb.c \
-	s_matherr.c \
-	s_modf.c \
-	s_nextafter.c \
-	s_rint.c \
-	s_scalbn.c \
-	s_signgam.c \
-	s_significand.c \
-	s_sin.c \
-	s_tan.c \
-	s_tanh.c
--- a/makefiles/java/fdlibm/Makefile	Fri Jun 08 12:44:30 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-#
-# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for fdlibm
-#
-# Note:
-# The fdlibm libraries are built using special rules in Library.gmk.
-#
-
-BUILDDIR     = ../..
-LIBRARY      = fdlibm
-PRODUCT      = java
-
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Where is fdlibm in the source tree?
-#
-FDLIBM_SRC = $(SHARE_SRC)/native/java/lang/fdlibm
-
-# Windows: compiler flags
-ifeq ($(PLATFORM),windows)
-  # Turn all optimizations off
-  OPTIMIZATION_LEVEL = NONE
-  FASTDEBUG_OPTIMIZATION_LEVEL = NONE
-  OTHER_CFLAGS =
-  CPPFLAGS_DBG += -DLOGGING
-endif
-
-#
-# Linux: Disable optimization to get correctly reproducible
-# floating-point results.
-#