changeset 5600:00b22b23269a jdk8-b47

Merge
author katleman
date Wed, 11 Jul 2012 16:02:18 -0700
parents 9957b4759354 5b0f880eb154
children 3e4ab821f461
files makefiles/LegacyMakefiles.gmk makefiles/OldImages.gmk makefiles/com/sun/crypto/provider/Makefile makefiles/common/Classes.gmk makefiles/common/Cscope.gmk makefiles/common/Defs-embedded.gmk makefiles/common/Defs-linux.gmk makefiles/common/Defs-macosx.gmk makefiles/common/Defs-solaris.gmk makefiles/common/Defs-windows.gmk makefiles/common/Defs.gmk makefiles/common/Demo.gmk makefiles/common/Library.gmk makefiles/common/Mapfile-vers.gmk makefiles/common/Modules.gmk makefiles/common/Program.gmk makefiles/common/Release-embedded.gmk makefiles/common/Release-macosx.gmk makefiles/common/Release.gmk makefiles/common/Rules.gmk makefiles/common/Subdirs.gmk makefiles/common/internal/Defs-corba.gmk makefiles/common/internal/Defs-jaxp.gmk makefiles/common/internal/Defs-jaxws.gmk makefiles/common/internal/Defs-langtools.gmk makefiles/common/internal/ImportComponents.gmk makefiles/common/internal/NativeCompileRules.gmk makefiles/common/internal/Resources.gmk makefiles/common/shared/Compiler-gcc.gmk makefiles/common/shared/Compiler-llvm.gmk makefiles/common/shared/Compiler-msvc.gmk makefiles/common/shared/Compiler-sun.gmk makefiles/common/shared/Defs-control.gmk makefiles/common/shared/Defs-java.gmk makefiles/common/shared/Defs-javadoc.gmk makefiles/common/shared/Defs-linux.gmk makefiles/common/shared/Defs-macosx.gmk makefiles/common/shared/Defs-solaris.gmk makefiles/common/shared/Defs-versions.gmk makefiles/common/shared/Defs-windows.gmk makefiles/common/shared/Defs.gmk makefiles/common/shared/Platform.gmk makefiles/common/shared/PrivateDefs.gmk-example makefiles/common/shared/Sanity-Settings.gmk makefiles/java/Makefile makefiles/java/invoke/Makefile makefiles/java/redist/Makefile makefiles/java/redist/sajdi/Makefile makefiles/javax/crypto/Defs-jce.gmk makefiles/javax/crypto/Makefile makefiles/javax/crypto/policy/limited/LIMITED makefiles/javax/crypto/policy/limited/default_local.policy makefiles/javax/crypto/policy/limited/exempt_local.policy makefiles/javax/crypto/policy/unlimited/UNLIMITED makefiles/javax/crypto/policy/unlimited/default_US_export.policy makefiles/javax/crypto/policy/unlimited/default_local.policy makefiles/mkdemo/Makefile makefiles/mkdemo/jni/Makefile makefiles/mkdemo/jni/Poller/Makefile makefiles/mkdemo/jvmti/Makefile makefiles/mkdemo/jvmti/README.txt makefiles/mkdemo/jvmti/hprof/Makefile makefiles/mkdemo/jvmti/mapfile-vers makefiles/mkdemo/management/README.txt makefiles/sun/jkernel/Makefile makefiles/sun/security/ec/Makefile makefiles/sun/security/pkcs11/FILES_c.gmk makefiles/sun/security/pkcs11/Makefile makefiles/sun/security/pkcs11/mapfile-vers
diffstat 124 files changed, 3410 insertions(+), 17059 deletions(-) [+]
line wrap: on
line diff
--- a/makefiles/CompileDemos.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/CompileDemos.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -215,7 +215,7 @@
      # Param 5 = libs for posix
      # Param 6 = libs for winapi
      # Param 7 = libs for solaris
-     BUILD_DEMO_JVMTI_$1_EXTRA_SRC:=	$$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/demo/jvmti/$1) \
+     BUILD_DEMO_JVMTI_$1_EXTRA_SRC:=	$$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/demo/jvmti/$1) \
 					$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2))
      BUILD_DEMO_JVMTI_$1_EXTRA_INC:=$$(addprefix -I,$$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
      BUILD_DEMO_JVMTI_$1_LANG:=C
@@ -227,18 +227,26 @@
          $1_EXTRA_CXX:=$(LIBCXX)
          BUILD_DEMO_JVMTI_$1_O_FLAG:=$(CXX_O_FLAG_NORM)
      endif
+
+     $1_CXXFLAGS:=$(CXXFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
+     ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH),waiters-sparc)
+       $1_FILTER:=-xregs=no%appl
+       $1_CXXFLAGS:=$$(filter-out $$($1_FILTER),$$($1_CXXFLAGS))
+     endif
+
      $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1,\
 		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,\
+		CXXFLAGS:=$$($1_CXXFLAGS),\
 		LDFLAGS:=$(LDFLAGS_JDKLIB),\
 		LDFLAGS_SUFFIX:=$$($1_EXTRA_CXX),\
 		LDFLAGS_SUFFIX_posix:=$5,\
 		LDFLAGS_SUFFIX_winapi:=$6,\
 		LDFLAGS_SUFFIX_solaris:=-lc $7,\
-		BIN:=$(JDK_OUTPUTDIR)/newdemoobjs/jvmti/$1,\
-		LIB:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib/$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX)))
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs/jvmti/$1,\
+		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib,\
+		LIBRARY:=$1))
 
     $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1,\
 		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
@@ -262,7 +270,7 @@
          BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar
      endif
 
-     BUILD_DEMOS += 	$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib/$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX) \
+     BUILD_DEMOS += 	$$(BUILD_DEMO_JVMTI_$1) \
 			$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/src.zip \
 			$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/README.txt
 endef
@@ -274,7 +282,7 @@
 # hprof contains error messages using __FILE__ macro. These expand to the absolute path
 # in the new build system and relative in the old, causing the binaries to differ.
 $(eval $(call SetupJVMTIDemo,hprof,			java_crw_demo,\
-		-I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt,C,\
+		-I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/npt,C,\
 		-ldl,ws2_32.lib winmm.lib,-lsocket -lnsl))
 
 $(eval $(call SetupJVMTIDemo,minst,			agent_util java_crw_demo))
@@ -349,7 +357,7 @@
 
 ##################################################################################################
 
-ifeq ($(PLATFORM), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
 
 $(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
 		$(MKDIR) -p $(@D)
@@ -386,8 +394,9 @@
 		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)))
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller,\
+                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs, \
+		LIBRARY:=Poller))
 
 #
 # We can only compile native code after jar has been build (since we depend on generated .h files)
--- a/makefiles/CompileJavaClasses.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/CompileJavaClasses.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -45,7 +45,7 @@
 		com/sun/tools/example/debug/gui \
 		com/oracle/security
 
-ifeq ($(PLATFORM)-$(ARCH_DATA_MODEL),windows-64)
+ifeq ($(OPENJDK_TARGET_OS)-$(ARCH_DATA_MODEL),windows-64)
      EXCLUDES += sun/security/pkcs11
 endif
 
@@ -61,7 +61,7 @@
    EXFILES := $(JDK_TOPDIR)/src/share/classes/javax/crypto/JarVerifier.java
 endif
 
-ifneq ($(PLATFORM),solaris)
+ifneq ($(OPENJDK_TARGET_OS),solaris)
    # Exclude Solaris nio and two security related files in src/share/classes
    EXFILES += SolarisAclFileAttributeView.java \
 	SolarisFileStore.java \
@@ -71,37 +71,34 @@
 	SolarisUserDefinedFileAttributeView.java \
 	SolarisWatchService.java \
 	SolarisAclFileAttributeView.java \
-	SolarisFileStore.java \
-	SolarisFileSystem.java \
-	SolarisFileSystemProvider.java \
-	SolarisUserDefinedFileAttributeView.java \
-	SolarisNativeDispatcher.java \
-	SolarisWatchService.java \
 	SolarisLoginModule.java \
 	SolarisSystem.java \
+	sun/nio/ch/EventPortSelectorImpl.java \
+	sun/nio/ch/EventPortSelectorProvider.java \
+	sun/nio/ch/EventPortWrapper.java \
 	sun/tools/attach/SolarisAttachProvider.java \
 	sun/tools/attach/SolarisVirtualMachine.java
 endif
 
 # In the old build, this isn't excluded on macosx, even though it probably
 # should be.
-ifneq ($(PLATFORM),macosx)
+ifneq ($(OPENJDK_TARGET_OS),macosx)
 	EXFILES+=WrapperGenerator.java
 endif
 
-ifneq ($(PLATFORM),windows)
+ifneq ($(OPENJDK_TARGET_OS),windows)
     # Exclude Window security related files in src/share/classes
     EXFILES+=NTLoginModule.java \
              NTSystem.java
 
 endif
 
-ifeq ($(PLATFORM),windows)
+ifeq ($(OPENJDK_TARGET_OS),windows)
     # Don't build GTK L&F on Windows
     EXCLUDES+=	com/sun/java/swing/plaf/gtk
 endif
 
-ifneq ($(PLATFORM),linux)
+ifneq ($(OPENJDK_TARGET_OS),linux)
     EXFILES+=sun/tools/attach/LinuxAttachProvider.java \
 	sun/tools/attach/LinuxVirtualMachine.java \
 	sun/nio/fs/LinuxDosFileAttributeView.java \
@@ -113,7 +110,7 @@
 	sun/nio/fs/LinuxWatchService.java
 endif
 
-ifneq ($(PLATFORM),macosx)
+ifneq ($(OPENJDK_TARGET_OS),macosx)
     EXFILES+=sun/nio/fs/BsdFileStore.java \
 	     sun/nio/fs/BsdFileSystem.java \
              sun/nio/fs/BsdFileSystemProvider.java \
@@ -137,11 +134,11 @@
 endif
 
 # Used on windows and macosx
-ifeq (,$(filter $(PLATFORM), windows macosx))
+ifeq (,$(filter $(OPENJDK_TARGET_OS), windows macosx))
     EXFILES+=sun/awt/AWTCharset.java
 endif
 
-ifneq ($(PLATFORM), macosx)
+ifneq ($(OPENJDK_TARGET_OS), macosx)
 #
 # Not in rt.jar on solaris and linux...(windows not checked)
 #     in rt.jar on macosx ??
@@ -192,7 +189,7 @@
 # Exclude another implicitly not included file.
 EXFILES+=sun/util/locale/AsciiUtil.java
 
-ifeq (,$(filter $(PLATFORM), solaris macosx))
+ifeq (,$(filter $(OPENJDK_TARGET_OS), solaris macosx))
 #
 # only solaris and macosx
 #
@@ -205,7 +202,7 @@
 	 -linux-ppc.java
 
 # TODO: Is this necessary?
-ifeq ($(PLATFORM), windows)
+ifeq ($(OPENJDK_TARGET_OS), windows)
     EXFILES+=sun/nio/ch/AbstractPollSelectorImpl.java \
 	sun/nio/ch/DevPollArrayWrapper.java \
 	sun/nio/ch/DevPollSelectorImpl.java \
@@ -248,18 +245,24 @@
 
 ifndef OPENJDK
     CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes \
-		     $(JDK_TOPDIR)/src/closed/$(LEGACY_HOST_OS_API)/classes
+		     $(JDK_TOPDIR)/src/closed/$(LEGACY_OPENJDK_TARGET_OS_API)/classes
 endif
 
 MACOSX_SRC_DIRS :=
-ifeq ($(PLATFORM),macosx)
+ifeq ($(OPENJDK_TARGET_OS),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
+               $(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java
+
+     # JObjC.jar contains 1.5 byte-code...so skip it here :-(
+     # MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/jobjc/src
+     # EXCLUDES+= tests/java/com/apple/jobjc
+
+     EXCLUDES+= com/apple/jobjc
 endif
 
 # The exception handling of swing beaninfo
@@ -272,7 +275,7 @@
 $(eval $(call SetupJavaCompilation,BUILD_JDK,\
                 SETUP:=GENERATE_JDKBYTECODE,\
 		SRC:=$(JDK_TOPDIR)/src/share/classes \
-		     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes \
+		     $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes \
 		     $(MACOSX_SRC_DIRS) \
 		     $(JDK_OUTPUTDIR)/gensrc \
 		     $(JDK_OUTPUTDIR)/gensrc_swing/javax/swing/beaninfo \
@@ -297,7 +300,7 @@
 JDK_BASE_HEADER_JAVA_FILES:=$(patsubst %,$(JDK_TOPDIR)/src/share/classes/%.java,\
 				$(subst .,/,$(JDK_BASE_HEADER_CLASSES)))
 
-ifeq ($(PLATFORM),windows)
+ifeq ($(OPENJDK_TARGET_OS),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,\
@@ -348,6 +351,53 @@
 
 ##########################################################################################
 
+ifeq ($(OPENJDK_TARGET_OS),macosx)
+#
+# JObjC.jar is compiled with BOOT_JAVAC which (may) not support the "-h" flag.
+#   so we first compile classes with BOOT_JAVAC and then with JDK_JAVAC :-(
+#
+$(eval $(call SetupJavaCompiler,GENERATE_15BYTECODE,\
+     JAVAC:=$(JAVAC),\
+     FLAGS:=-source 1.5 -target 1.5 -g -bootclasspath $(BOOT_RTJAR) -cp $(JDK_OUTPUTDIR)/../langtools/dist/lib/classes.jar $(DISABLE_WARNINGS),\
+     SERVER_DIR:=$(JAVAC_SERVERS),\
+     SERVER_JVM:=$(SERVER_JAVA),\
+     MODE:=$(JAVAC_USE_MODE),\
+     USE_DEPS:=$(JAVAC_USE_DEPS)))
+
+$(eval $(call SetupJavaCompilation,BUILD_JOBJC_JAR,\
+		SETUP:=GENERATE_15BYTECODE,\
+		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
+		     $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
+		     $(JDK_OUTPUTDIR)/gensrc, \
+		INCLUDES := com/apple/jobjc,\
+                EXCLUDES := tests/java/com/apple/jobjc,\
+		BIN:=$(JDK_OUTPUTDIR)/jobjc_classes,\
+		JAR:=$(JDK_OUTPUTDIR)/lib/JObjC.jar, \
+		JARINDEX := true))
+
+$(BUILD_JOBJC_JAR) : $(BUILD_JDK)
+
+JARS += $(JDK_OUTPUTDIR)/lib/JObjC.jar
+
+$(eval $(call SetupJavaCompilation,BUILD_JOBJC_HEADERS_JAR,\
+		SETUP:=GENERATE_JDKBYTECODE,\
+		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
+		     $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
+		     $(JDK_OUTPUTDIR)/gensrc, \
+		INCLUDES := com/apple/jobjc,\
+                EXCLUDES := tests/java/com/apple/jobjc,\
+		BIN:=$(JDK_OUTPUTDIR)/jobjc_classes_headers,\
+		JAR:=$(JDK_OUTPUTDIR)/jobjc_classes_headers/dummy.jar, \
+		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers))
+
+$(BUILD_JOBJC_HEADERS_JAR) : $(BUILD_JDK)
+
+JARS += $(JDK_OUTPUTDIR)/jobjc_classes_headers/dummy.jar
+
+endif
+
+##########################################################################################
+
 # copy with -a to preserve timestamps so dependencies down the line aren't messed up
 all: $(BUILD_JDK) $(JARS) $(COPY_EXTRA) $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
 	$(JDK_OUTPUTDIR)/classes/_the.jdk.base.headers
--- a/makefiles/CompileLaunchers.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/CompileLaunchers.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -32,17 +32,25 @@
 # Setup the java compilers for the JDK build.
 include Setup.gmk
 
+# Build tools
+include Tools.gmk
+
 BUILD_LAUNCHERS=
 
 define SetupLauncher
     # TODO: Fix mapfile on solaris. Won't work with ld as linker.
     # Parameter 1 is the name of the launcher (java,javac,jar...)
-    # Parameter 2 are extra CFLAGS
-    # Parameter 3 are extra LDFLAGS
-    # Parameter 4 are extra LDFLAGS_SUFFIX_posix
-    # Parameter 5 are extra LDFLAGS_SUFFIX_winapi
+    # Parameter 2 is extra CFLAGS
+    # Parameter 3 is extra LDFLAGS
+    # Parameter 4 is extra LDFLAGS_SUFFIX_posix
+    # Parameter 5 is extra LDFLAGS_SUFFIX_winapi
+    # Parameter 6 is optional Windows JLI library (full path)
+    # Parameter 7 is optional Windows resource (RC) flags
+    # Parameter 8 is optional Windows version resource file (.rc)
+    # Parameter 9  is different output dir
+    # Parameter 10 is FULL DEBUG SYMBOLS (set value to turn OFF, since most(all) seems to have it)
 
-    $1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/jli.lib
+    $1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/libjli/jli.lib
     ifneq ($6,)
         $1_WINDOWS_JLI_LIB:=$6
     endif
@@ -51,33 +59,73 @@
         $1_VERSION_INFO_RESOURCE:=$8
     endif
 
+    $1_LDFLAGS := $3
+    ifeq ($(OPENJDK_TARGET_OS), macosx)
+        $1_LDFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+                       -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
+    endif
+
+    $1_LDFLAGS_SUFFIX :=
+    ifeq ($(USE_EXTERNAL_LIBZ), true)
+        $1_LDFLAGS_SUFFIX += -lz
+    endif
+
+    ifeq ($(OPENJDK_TARGET_OS), macosx)
+        $1_LDFLAGS_SUFFIX += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
+                             -framework Cocoa -framework Security -framework ApplicationServices \
+                             -sectcreate __TEXT __info_plist $(JDK_TOPDIR)/src/macosx/lib/Info-cmdline.plist
+    endif
+
+
+    $1_OUTPUT_DIR_ARG:=$9
+    ifeq (,$$($1_OUTPUT_DIR_ARG))
+        $1_OUTPUT_DIR_ARG:=$(JDK_OUTPUTDIR)/bin
+    endif
+
+    $1_DEBUG_SYMBOLS:=yes
+    ifneq (,$(10))
+      $1_DEBUG_SYMBOLS:=
+    endif
+
+    $1_OPTIMIZATION:= LOW
+
+    # TODO: maybe it's better to move this if-statement out of this function
+    ifeq ($(1),java)
+      $1_OPTIMIZATION:=HIGH
+    endif
+
     $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
 	SRC:=$(JDK_TOPDIR)/src/share/bin,\
 	INCLUDE_FILES:=main.c,\
 	LANG:=C,\
-	CFLAGS:=$(CFLAGS_JDKEXE) $(C_O_FLAG_NORM) \
+	OPTIMIZATION :=$$($1_OPTIMIZATION), \
+	CFLAGS:=$(CFLAGS_JDKEXE) \
 		-I$(JDK_TOPDIR)/src/share/bin \
-		-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin \
-		-I$(JDK_TOPDIR)/src/$(PLATFORM)/bin \
+		-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin \
+		-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
                 -DFULL_VERSION='"$(FULL_VERSION)"' \
                 -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
                 -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
 		-DLIBARCHNAME='"$(ARCH)"' \
-		-DLAUNCHER_NAME='"openjdk"' \
+		-DLAUNCHER_NAME='"java"' \
 		-DPROGNAME='"$1"' $(DPACKAGEPATH) \
 		$2,\
 	CFLAGS_linux:=-fPIC,\
+        CFLAGS_solaris:=-KPIC -DHAVE_GETHRTIME,\
 	LDFLAGS:=$(LDFLAGS_JDKEXE) \
                  $(call SET_SHARED_LIBRARY_ORIGIN,../lib/$(LIBARCH)/jli) \
                  $(call SET_SHARED_LIBRARY_ORIGIN,../jre/lib/$(LIBARCH)/jli) \
-		 $3,\
+		 $$($1_LDFLAGS),\
 	MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(ARCH), \
-        LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX),\
+        LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX),\
 	LDFLAGS_SUFFIX_posix:=$4 -lc,\
 	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),\
+			       $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5,\
+	LDFLAGS_SUFFIX_solaris := -lthread $(LIBDL), \
+	OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/$1_objs,\
+	OUTPUT_DIR:=$$($1_OUTPUT_DIR_ARG),\
+	PROGRAM:=$1,\
+	DEBUG_SYMBOLS:=$$($1_DEBUG_SYMBOLS),\
 	VERSIONINFO_RESOURCE:=$$($1_VERSION_INFO_RESOURCE),\
 	RC_FLAGS:=$(RC_FLAGS)\
 		  /D "JDK_FNAME=$1$(EXE_SUFFIX)" \
@@ -86,13 +134,22 @@
 		  $7,\
 	MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest)
 
-    BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/$1$(EXE_SUFFIX)
+    BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)
+
+    ifeq ($(OPENJDK_TARGET_OS),macosx)
+        $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjli_static.a
+    endif
+
+    ifeq ($(OPENJDK_TARGET_OS),windows)
+        $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
+				$$($1_WINDOWS_JLI_LIB)
+    endif    	 
 endef
 
 ##########################################################################################
 
-XLIBS:=-lX11
-ifeq ($(PLATFORM),macosx)
+XLIBS:=$(X_LIBS) -lX11
+ifeq ($(OPENJDK_TARGET_OS),macosx)
     DPACKAGEPATH:=-DPACKAGE_PATH='"$(PACKAGE_PATH)"'
     XLIBS:=
 endif
@@ -108,17 +165,17 @@
     $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
     $(JDK_TOPDIR)/src/windows/resource/java.rc))
 
-ifeq ($(HOST_OS),windows)
+ifeq ($(OPENJDK_TARGET_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)
+ifeq ($(OPENJDK_TARGET_OS),solaris)
     THREAD_LIB:=-lthread
 endif
-ifeq ($(PLATFORM),linux)
+ifeq ($(OPENJDK_TARGET_OS),linux)
     THREAD_LIB:=-lpthread
 endif
 
@@ -271,7 +328,7 @@
 $(eval $(call SetupLauncher,jcmd,\
     -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))
 
-ifeq ($(PLATFORM),windows)
+ifeq ($(OPENJDK_TARGET_OS),windows)
     $(eval $(call SetupLauncher,kinit,\
         -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }'))
 
@@ -286,8 +343,10 @@
 # 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.
 ifeq ($(USE_EXTERNAL_LIBZ), true)
+UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
 UNPACKEXE_ZIPOBJS := -lz
 else
+UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
 UNPACKEXE_ZIPOBJS := 	$(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
 		     	$(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
 			$(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
@@ -299,27 +358,31 @@
 			$(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
 			$(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
 
+endif
 
-$(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX): $(UNPACKEXE_ZIPOBJS)
-
+ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
+     UNPACKEXE_CFLAGS += -xregs=no%appl
 endif
 
 $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
 		EXCLUDE_FILES:=jni.cpp,\
 		LANG:=C,\
-		CFLAGS:=$(CXXFLAGS_JDKEXE) $(CXX_O_FLAG_NORM) \
-			 -DFULL \
-			 -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5,\
+		OPTIMIZATION := LOW, \
+		CFLAGS:=$(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE)\
+			 -DFULL, \
 		CFLAGS_release:=-DPRODUCT,\
 		CFLAGS_linux:=-fPIC,\
+		CFLAGS_solaris := -KPIC, \
+		CFLAGS_macosx := -fPIC, \
 		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200, \
 		LDFLAGS:=$(LDFLAGS_JDKEXE) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN), \
 		LDFLAGS_SUFFIX:=$(UNPACKEXE_ZIPOBJS) $(LIBCXX),\
 		LDFLAGS_SUFFIX_solaris:=-lc,\
-		BIN:=$(JDK_OUTPUTDIR)/objs/unpackexe,\
-		EXE:=$(JDK_OUTPUTDIR)/objs/unpack200$(EXE_SUFFIX),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe,\
+		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/bin,\
+		PROGRAM:=unpack200,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  /D "JDK_FNAME=unpack200.exe" \
@@ -327,7 +390,13 @@
 			  /D "JDK_FTYPE=0x1L",\
 		MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
 
-BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
+ifneq ($(USE_EXTERNAL_LIBZ), true)
+
+$(BUILD_UNPACKEXE) : $(UNPACKEXE_ZIPOBJS)
+
+endif
+
+BUILD_LAUNCHERS += $(BUILD_UNPACKEXE)
 
 ##########################################################################################
 
@@ -335,7 +404,7 @@
 BUILD_JEXEC := 
 BUILD_JEXEC_SRC :=
 BUILD_JEXEC_INC :=
-BUILD_JEXEC_DST := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/jexec$(EXE_SUFFIX)
+BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)
 
 #
 # UNHANDLED:
@@ -345,30 +414,30 @@
 #
 # jdk/make/java/Makefile
 #
-ifeq ($(PLATFORM), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
 	ifeq ($(ARCH_DATA_MODEL), 32)
 		BUILD_JEXEC := 1
 	endif
 endif
 
-ifeq ($(PLATFORM), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
 	BUILD_JEXEC := 1
-endif # PLATFORM
+endif # OPENJDK_TARGET_OS
 
 #
 # jdk/make/java/jexec/Makefile
 #
 ifeq ($(BUILD_JEXEC), 1)
 
-	ifeq ($(PLATFORM),windows)
-	else ifeq ($(PLATFORM),macosx)
+	ifeq ($(OPENJDK_TARGET_OS),windows)
+	else ifeq ($(OPENJDK_TARGET_OS),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)
+	ifeq ($(OPENJDK_TARGET_OS), linux)
+                BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib
 		BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/share/bin
 	endif
 endif
@@ -382,13 +451,15 @@
 		SRC:=$(BUILD_JEXEC_SRC),\
 		INCLUDE_FILES:=jexec.c,\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKEXE) $(C_O_FLAG_NORM) \
+		OPTIMIZATION := LOW, \
+		CFLAGS:=$(CFLAGS_JDKEXE)\
                         $(BUILD_JEXEC_INC), \
 		LDFLAGS:=$(LDFLAGS_JDKEXE), \
-		BIN:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
-		EXE:=$(BUILD_JEXEC_DST)))
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
+		OUTPUT_DIR:=$(BUILD_JEXEC_DST_DIR),\
+		PROGRAM:=jexec))
 
-	BUILD_LAUNCHERS += $(BUILD_JEXEC_DST)
+	BUILD_LAUNCHERS += $(BUILD_JEXEC)
 endif
 
 ##########################################################################################
@@ -397,10 +468,10 @@
 # The java-rmi.cgi script in bin/ only gets delivered in certain situations
 #
 JAVA_RMI_CGI:=$(JDK_OUTPUTDIR)/bin/java-rmi.cgi
-ifeq ($(PLATFORM), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
   BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
 endif
-ifeq ($(PLATFORM), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
   ifeq ($(ARCH_DATA_MODEL), 32)
     BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
   endif
@@ -413,12 +484,13 @@
 # images bin dir. This weird behavior is mimicked here in the converted makefiles for
 # now. Should probably just be deleted.
 # http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
-ifeq ($(HOST_OS_API),winapi)
+ifeq ($(OPENJDK_TARGET_OS_API),winapi)
     $(eval $(call SetupLauncher,java-rmi,\
         -DEXPAND_CLASSPATH_WILDCARDS,\
-        $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(ARCH))))
+        $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(ARCH)),\
+        ,,,,,$(JDK_OUTPUTDIR)/objs))
 
-    $(JAVA_RMI_CGI): $(JDK_OUTPUTDIR)/objs/java-rmi$(EXE_SUFFIX)
+    $(JAVA_RMI_CGI): $(BUILD_LAUNCHER_java-rmi)
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
@@ -432,11 +504,6 @@
 
 ##########################################################################################
 
-$(JDK_OUTPUTDIR)/bin/% : $(JDK_OUTPUTDIR)/objs/%
-	$(ECHO) Copying $(@F)
-	$(MKDIR) -p $(@D)
-	$(CP) $< $@
-
 $(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
 
 all: $(BUILD_LAUNCHERS)
--- a/makefiles/CompileNativeLibraries.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/CompileNativeLibraries.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -35,13 +35,16 @@
 # Copy files (can now depend on $(COPY_FILES))
 include CopyFiles.gmk
 
+# Build tools
+include Tools.gmk
+
 # Include the javah generated headers.
 CFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers
 CXXFLAGS_JDKLIB += -I$(JDK_OUTPUTDIR)/gensrc_headers
 
-# Put the libraries here. Different locations for different host apis.
-ifeq ($(HOST_OS_API),posix)
-    ifneq ($(HOST_OS),macosx)
+# Put the libraries here. Different locations for different target apis.
+ifeq ($(OPENJDK_TARGET_OS_API),posix)
+    ifneq ($(OPENJDK_TARGET_OS),macosx)
         INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib/$(LIBARCH)
         LIBARCHDIR=$(LIBARCH)/
     else
@@ -52,465 +55,213 @@
     INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/bin
 endif
 
-$(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX) : $(JDK_OUTPUTDIR)/objs/%$(SHARED_LIBRARY_SUFFIX)
-	$(ECHO) Copying $(@F)
-	$(CP) $< $@
-
 BUILD_LIBRARIES=
 
-# TODO: Temporary until awt is converted:
-# OBJDIRNAME is the name of the directory where the object code is to
-#   be placed. It's name depends on whether the data model architecture 
-#   is 32-bit or not.
-ifneq ($(ARCH_DATA_MODEL), 32)
-  OBJDIRNAME  = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
-else
-  OBJDIRNAME  = obj$(OBJDIRNAME_SUFFIX)
+# Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
+# elegant solution to this.
+WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib
+WIN_JAVA_LIB := $(JDK_OUTPUTDIR)/objs/libjava/java.lib
+WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib
+
+##########################################################################################
+
+BUILD_LIBFDLIBM_OPTIMIZATION:=HIGH
+
+ifneq ($(OPENJDK_TARGET_OS), solaris)
+      BUILD_LIBFDLIBM_OPTIMIZATION:=NONE
 endif
 
-##########################################################################################
-
-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 \
-                     $(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) \
-                        $(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 -UDEBUG,\
-		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/mapfile-vers, \
-		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(EXPORT_ZIP_FUNCS), \
-		LDFLAGS_winapi:=-export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
-                                -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)/objs/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)
-
-$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK,\
-                SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
-		EXCLUDE_FILES:=main.cpp,\
-		LANG:=C++,\
-		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_ORIGIN),\
-		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)/objs/libunpack,\
-		LIB:=$(LIBUNPACK_LIB_FILE),\
-		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
-		RC_FLAGS:=$(RC_FLAGS)\
-			  /D "JDK_FNAME=unpack.dll" \
-			  /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)
-	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.map,$<) $@
-
-    $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(LIBUNPACK_LIB_FILE)
-	$(ECHO) Copying $(@F)
-	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.pdb,$<) $@
-endif
-
-##########################################################################################
-
-BUILD_LIBFDLIBM_OPTIMIZATION:= $(C_O_FLAG_HI)
-
-ifneq ($(PLATFORM), solaris)
-      BUILD_LIBFDLIBM_OPTIMIZATION := $(C_O_FLAG_NONE)
-endif
-
-ifneq ($(PLATFORM),macosx)
+ifneq ($(OPENJDK_TARGET_OS),macosx)
 $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM,\
+                STATIC_LIBRARY:=fdlibm,\
+                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
                 SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFDLIBM_OPTIMIZATION) \
+		OPTIMIZATION:=$(BUILD_LIBFDLIBM_OPTIMIZATION), \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 			-I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\
 		CFLAGS_winapi_debug:=-DLOGGING,\
 		ARFLAGS:=$(ARFLAGS),\
-		BIN:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
-		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)))
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
+
+BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
+
 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,\
+                LIBRARY:=fdlibm,\
+                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
                 SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFDLIBM_OPTIMIZATION) \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 			-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)
+		LDFLAGS:=-nostdlib -r,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
+
+$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) : $(BUILD_LIBFDLIBM)
 	$(CP) -a $< $@
+
+BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
 endif
 
-
-BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
-
 ##########################################################################################
 
-LIBATTACH_EXCLUDE_FILES:=
-ifneq ($(PLATFORM),solaris)
-    LIBATTACH_EXCLUDE_FILES+=SolarisVirtualMachine.c
+BUILD_LIBVERIFY_SRC:=check_code.c check_format.c
+
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+	ifneq ($(ARCH), amd64)
+		BUILD_LIBVERIFY_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libverify/reorder-$(ARCH)
+	endif
 endif
-ifneq ($(PLATFORM),linux)
-    LIBATTACH_EXCLUDE_FILES+=LinuxVirtualMachine.c
+
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY,\
+		LIBRARY:=verify, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(JDK_TOPDIR)/src/share/native/common,\
+		INCLUDE_FILES:=$(BUILD_LIBVERIFY_SRC),\
+		LANG:=C,\
+		OPTIMIZATION:=HIGH, \
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		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),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libverify,\
+		DEBUG_SYMBOLS:=true))
+
+BUILD_LIBRARIES += $(BUILD_LIBVERIFY)
+
+##########################################################################################
+
+LIBJAVA_SRC_DIRS:=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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_OPENJDK_TARGET_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_OPENJDK_TARGET_OS_API)/native/common \
+		$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/java/util \
+		$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/security/provider \
+		$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/io
+
+#
+# TODO
+#
+ARCHPROPNAME:=$(LIBARCH)
+ifeq ($(OPENJDK_TARGET_OS)-$(ARCH), solaris-i586)
+     ARCHPROPNAME:=x86
+else ifeq ($(OPENJDK_TARGET_OS)-$(ARCH_DATA_MODEL), windows-32)
+     ARCHPROPNAME:=x86
+else ifeq ($(OPENJDK_TARGET_OS), macosx)
+     ARCHPROPNAME:=$(ARCH)
 endif
-ifneq ($(PLATFORM),macosx)
-    LIBATTACH_EXCLUDE_FILES+=BsdVirtualMachine.c
+
+LIBJAVA_CFLAGS:=$(foreach dir,$(LIBJAVA_SRC_DIRS),-I$(dir)) \
+		  -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \
+                  -DARCHPROPNAME='"$(ARCHPROPNAME)"'
+
+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
 
-$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH,\
-                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/tools/attach,\
-		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_ORIGIN),\
-		LDFLAGS_solaris:=-ldoor,\
-		LDFLAGS_winapi:=psapi.lib advapi32.lib java.lib jvm.lib,\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_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)
-
-##########################################################################################
-
-$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET,\
-                SRC:=$(JDK_TOPDIR)/src/share/transport/socket \
-			$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/socket,\
-		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
-                        -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(PLATFORM) \
-                        -I$(JDK_TOPDIR)/src/share/transport/socket \
-		        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/socket \
-                        -I$(JDK_TOPDIR)/src/share/back/export \
-                        -I$(JDK_TOPDIR)/src/share/back,\
-		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)/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)
-
-##########################################################################################
-
-ifeq ($(HOST_OS_API),winapi)
-
-  $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM,\
-                SRC:= $(JDK_TOPDIR)/src/share/native/com/sun/tools/jdi \
-			$(JDK_TOPDIR)/src/share/transport/shmem \
-			$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/shmem,\
-		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS)\
-                        -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(PLATFORM) \
-                        -I$(JDK_TOPDIR)/src/share/transport/shmem \
-		        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/transport/shmem \
-                        -I$(JDK_TOPDIR)/src/share/back/export, \
-		LDFLAGS:=$(LDFLAGS_JDKLIB),\
-		LDFLAGS_winapi:=-export:jdwpTransport_OnLoad,\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_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)
-
-endif # PLATFORM
-
-##########################################################################################
-# JDWP_LOGGING causes log messages to be compiled into the library. These reference the 
-# __FILE__ macro which here expands to the absolute path of the file while the old build 
-# system used a relative path. This causes the binaries to differ in size.
-$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP,\
-                SRC:=$(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/back,\
-		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) -DJDWP_LOGGING $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS)\
-		 -I$(JDK_TOPDIR)/src/share/transport/export \
-                 -I$(JDK_TOPDIR)/src/share/back/export \
-                 -I$(JDK_TOPDIR)/src/share/npt \
-                 -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt \
-                 -I$(JDK_TOPDIR)/src/share/back \
-                 -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/back \
-		 -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers,\
-		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdwp/mapfile-vers, \
-		LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)), \
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_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
+LIBJAVA_EXCLUDE_FILES:=check_code.c check_format.c
+
+ifneq ($(OPENJDK_TARGET_OS),macosx)
+	LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
 else
-   # only on solaris...wonder why
-   LIBJAAS_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjaas/mapfile-vers
+	BUILD_LIBJAVA_java_props_md.c_CFLAGS:=-x objective-c
 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_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		EXCLUDE_FILES:=$(LIBJAAS_EXCLUDE_FILES),\
-		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)/objs/jaas.dll
-	$(ECHO) Copying $(@F)
-	$(CP) $< $@
-    BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/jaas_nt.dll
+ifeq ($(OPENJDK_TARGET_OS),windows)
+        LIBJAVA_EXCLUDE_FILES += \
+		UNIXProcess_md.c \
+		UnixFileSystem_md.c \
+		FileSystemPreferences.c
 else
-    $(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)
+	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 ($(HOST_OS_API),posix)
-  # TODO make this work on macosx
-  ifneq ($(HOST_OS),macosx)
-
-    $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP,\
-                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/ch/sctp,\
-		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS)\
-			-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
-			-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \
-			-I$(JDK_TOPDIR)/src/share/native/java/net \
-			-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,\
-		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsctp/mapfile-vers, \
-		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_SUFFIX_linux:=-lpthread,\
-		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)/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
-
-##########################################################################################
-
-$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT,\
-                SRC:=$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace\
-			$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/tracing/dtrace,\
-		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_ORIGIN),\
-		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)
-
-##########################################################################################
-
-ifdef OPENJDK
-    # TODO: Update awt lib path when awt is converted
-    $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS,\
-                SRC:=$(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms \
-		     $(JDK_TOPDIR)/src/share/native/sun/java2d/,\
-		INCLUDE_FILES:=cmscam02.c cmscgats.c cmscnvrt.c cmserr.c \
-			       cmsgamma.c cmsgmt.c cmsintrp.c cmsio0.c \
-			       cmsio1.c cmslut.c cmsmd5.c cmsmtrx.c \
-			       cmsnamed.c cmsopt.c cmspack.c cmspcs.c \
-			       cmsplugin.c cmsps2.c cmssamp.c cmssm.c \
-			       cmstypes.c cmsvirt.c cmswtpnt.c cmsxform.c \
-			       LCMS.c,\
-		LANG:=C,\
-		CFLAGS:=$(filter-out -xc99=%none,$(CFLAGS_JDKLIB)) $(C_O_FLAG_NORM) \
-			$(SHARED_LIBRARY_FLAGS) \
-			-I$(JDK_TOPDIR)/src/share/native/sun/java2d \
-			-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug,\
-		CFLAGS_solaris:=-xc99=no_lib,\
-		CFLAGS_winapi:=-DCMS_IS_WINDOWS_,\
-		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/liblcms/mapfile-vers, \
-		LDFLAGS:=$(LDFLAGS_JDKLIB), \
-		LDFLAGS_solaris:=/usr/lib$(ISA_DIR)/libm.so.2,\
-		LDFLAGS_winapi:=awt.lib java.lib,\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		LDFLAGS_SUFFIX_posix:=-lawt,\
-		LDFLAGS_SUFFIX_linux:=-lm,\
-		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 := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers
-else
-    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)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
     ifneq ($(ARCH), amd64)
-        BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(ARCH)
+        LIBJAVA_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava/reorder-$(ARCH)
     endif
 endif
 
-# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
-# or 'vfork'": this warning indicates that some variable is placed to
-# a register by optimized compiler and it's value might be lost on longjmp().
-# Recommended way to avoid such warning is to declare the variable as
-# volatile to prevent the optimization. However, this approach does not
-# work because we have to declare all variables as volatile in result.
-#ifndef CROSS_COMPILE_ARCH
-#    CC_43_OR_NEWER := \
-#        $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
-#              \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
-#    ifeq ($(CC_43_OR_NEWER),1)
-#        BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
-#    endif
-#endif
-
-$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG,\
-                SRC:=$(BUILD_LIBJPEG_CLOSED_SRC) \
-		     $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
+$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA,\
+		LIBRARY:=java,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(LIBJAVA_SRC_DIRS),\
+		EXCLUDES:=fdlibm/src zip, \
+		EXCLUDE_FILES:=$(LIBJAVA_EXCLUDE_FILES), \
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_HIGHEST) $(SHARED_LIBRARY_FLAGS) \
-			$(BUILD_LIBJPEG_CLOSED_INCLUDES) \
-			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
-		MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
+		OPTIMIZATION:=HIGH, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                        $(LIBJAVA_CFLAGS),\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
-			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_linux:=$(LIBDL),\
-		LDFLAGS_winapi:=java.lib jvm.lib,\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_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)
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_windows:=-export:winFileHandleOpen -export:handleLseek \
+				 $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) jvm.lib \
+				 shell32.lib delayimp.lib /DELAYLOAD:shell32.dll \
+				 advapi32.lib,\
+		LDFLAGS_SUFFIX_posix:=-ljvm -lverify, \
+		LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc,\
+		LDFLAGS_SUFFIX_linux:=$(LIBDL) $(BUILD_LIBFDLIBM),\
+		LDFLAGS_SUFFIX_macosx:=$(BUILD_LIBFDLIBM) \
+                                         -framework CoreFoundation \
+                                         -framework Security -framework SystemConfiguration, \
+		REORDER:=$(LIBJAVA_REORDER), \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjava))
+
+BUILD_LIBRARIES += $(BUILD_LIBJAVA)
+
+$(BUILD_LIBJAVA) : $(LIBJLI_BINARY)
+
+$(BUILD_LIBJAVA) : $(BUILD_LIBVERIFY)
+
+$(BUILD_LIBJAVA) : $(BUILD_LIBFDLIBM)
 
 ##########################################################################################
 
-BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib
-BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
+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)
+			-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/awt/medialib 
+
+BUILD_LIBMLIB_LDLIBS:=
+BUILD_LIBMLIB_IMAGE_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libmlib_image/mapfile-vers
+
+ifneq ($(OPENJDK_TARGET_OS), sparc)
+#
+# Yes, this will always be true (until someone makes an OS called sparc)
+#   but this is how it was writtin in old system...keep it like this for now
+#
 	BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
 endif
 
@@ -518,43 +269,44 @@
 	BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
 endif
 
-ifneq ($(PLATFORM), windows)
+ifneq ($(OPENJDK_TARGET_OS), windows)
 	BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
 endif
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE,\
-		SRC:=$(BUILD_LIBMLIB_SRC),\
+		LIBRARY:=mlib_image,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                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) \
+		OPTIMIZATION:=HIGHEST, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
                         $(BUILD_LIBMLIB_CFLAGS),\
-		MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
+		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)
+                LDFLAGS_SUFFIX_posix:=-lm,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmlib_image))
+
+$(BUILD_LIBMLIB_IMAGE) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)
 
 ##########################################################################################
 
-ifeq ($(PLATFORM),solaris)
+ifeq ($(OPENJDK_TARGET_OS),solaris)
 ifeq ($(ARCH),sparc)
-	BUILD_LIBMLIB_IMAGE_V := 1
+	BUILD_LIBMLIB_IMAGE_V:=1
 else ifeq ($(ARCH), sparcv9)
-	BUILD_LIBMLIB_IMAGE_V := 1
+	BUILD_LIBMLIB_IMAGE_V:=1
 endif
 endif
 
 ifeq ($(BUILD_LIBMLIB_IMAGE_V), 1)
 
-BUILD_LIBMLIB_IMAGE_V_FILES :=  \
+BUILD_LIBMLIB_IMAGE_V_FILES:=\
         mlib_v_ImageLookUp.c \
         mlib_ImageCreate.c \
         mlib_ImageAffine.c \
@@ -648,1185 +400,355 @@
         mlib_ImageUtils.c \
         mlib_ImageDivTables.c
 
-#
-# TODO
-#
-# ASFLAGS += -P
-# INLINE = $(PLATFORM_SRC)/native/sun/awt/medialib/vis_$(ARCH_DATA_MODEL).il
+BUILD_LIBMLIB_V_CFLAGS := $(filter-out -DMLIB_NO_LIBSUNMATH,$(BUILD_LIBMLIB_CFLAGS))
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V,\
-		SRC:=$(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
+		LIBRARY:=mlib_image_v, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                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), \
+		INCLUDE_FILES:=$(BUILD_LIBMLIB_IMAGE_V_FILES),\
+		OPTIMIZATION:=HIGHEST, \
+		CFLAGS:=-xarch=sparcvis \
+                      $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(ARCH_DATA_MODEL).il\
+                      $(BUILD_LIBMLIB_V_CFLAGS) \
+                      $(CFLAGS_JDKLIB), \
+		MAPFILE:=$(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)
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmlib_image_v))
+
+BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)
 
 endif
 
 ##########################################################################################
 
-ifndef OPENJDK
-    FONT_HEADERS := -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
-    BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
-    LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
+LIBAWT_DIRS:=\
+	$(JDK_TOPDIR)/src/share/native/sun/awt \
+	$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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_OPENJDK_TARGET_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_OPENJDK_TARGET_OS_API)/native/sun/java2d/opengl \
+	$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/java2d/x11 \
+	$(JDK_TOPDIR)/src/share/native/sun/font \
+	$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/windows \
+	$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/java2d/windows \
+	$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/java2d/d3d
+
+
+LIBAWT_CFLAGS:=-D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
+	$(X_CFLAGS) \
+	$(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 $(OPENJDK_TARGET_OS), solaris linux macosx))
+	LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c
+endif
+
+ifeq ($(OPENJDK_TARGET_OS),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 ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
+        LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
+        LIBAWT_CFLAGS += -xarch=sparcvis
+	LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(ARCH_DATA_MODEL).il
+        LIBAWT_CFLAGS += \
+            -I$(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
+            -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/medialib \
+            -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
+
+	LIBAWT_DIRS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
+                       $(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
+
+	LIBAWT_FILES += \
+                vis_FuncArray.c           \
+                java2d_Mlib.c             \
+                mlib_ImageCreate.c        \
+                mlib_ImageZoom_NN.c       \
+                mlib_ImageCopy_Bit.c      \
+                mlib_sys.c                \
+                mlib_v_ImageClear.c       \
+                mlib_v_ImageClear_f.c     \
+                mlib_v_ImageConstXor.c    \
+                mlib_v_ImageCopy.c        \
+                mlib_v_ImageCopy_f.c      \
+                mlib_v_ImageXor.c         \
+                mlib_v_ImageZoom_NN_f.c   \
+                vis_Interp.c              \
+                vis_AlphaMacros.c         \
+                vis_AlphaMaskBlit.c       \
+                vis_AlphaMaskFill.c       \
+                vis_ByteGray.c            \
+                vis_ByteGray_FromRgb.c    \
+                vis_ByteGray_Mask.c       \
+                vis_ByteIndexed.c         \
+                vis_DrawLine.c            \
+                vis_FourByteAbgr.c        \
+                vis_IntArgb.c             \
+                vis_IntArgbPre.c          \
+                vis_IntArgbPre_Mask.c     \
+                vis_IntBgr.c              \
+                vis_IntRgb.c              \
+                vis_IntRgbx.c             \
+                vis_SrcMaskFill.c         \
+                vis_SrcOverMaskBlit.c     \
+                vis_SrcOverMaskFill.c     \
+                vis_FourByteAbgrPre.c     \
+                vis_GlyphList.c           \
+                vis_GlyphListXor.c        \
+                vis_IntArgbBm.c           \
+                vis_ThreeByteBgr.c        \
+                vis_UshortGray.c          \
+                vis_UshortGray_FromRgb.c  \
+                vis_XorBlit.c             \
+                mlib_v_ImageCopy_blk.s
+
+	ifeq ($(OPENJDK_TARGET_CPU_BITS),64)
+		LIBAWT_ASFLAGS=-P -xarch=v9a
+	else
+		LIBAWT_ASFLAGS=-P -xarch=v8plusa
+	endif
 else
-    FONT_HEADERS := $(FREETYPE2_CFLAGS)
-    BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
-    BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE2_LIBS)
+	LIBAWT_FILES += MapAccelFunc.c
 endif
 
-ifeq ($(PLATFORM),windows)
-    LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
-				    X11TextRenderer.c
-else
-    LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
-				    lcdglyph.c
+ifneq ($(OPENJDK_TARGET_OS),solaris)
+	LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
 endif
 
-BUILD_LIBFONTMANAGER_CFLAGS_COMMON := $(SHARED_LIBRARY_FLAGS) \
-			-DLE_STANDALONE -DHEADLESS \
-			$(FONT_HEADERS) \
-			-I$(JDK_TOPDIR)/src/share/native/sun/font \
-			-I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
-			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
-			-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/awt \
-			-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
-			-I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
-			-I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
-			-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d \
-			-I$(JDK_TOPDIR)/src/share/native/sun/java2d
-
-$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER,\
-                SRC:=$(JDK_TOPDIR)/src/share/native/sun/font\
-		     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/font,\
-		EXCLUDE_FILES:=$(LIBFONTMANAGER_EXCLUDE_FILES) \
-			       AccelGlyphCache.c,\
-		LANG:=C++,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\
-		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\
-		CFLAGS_posix:=$(C_O_FLAG_HI),\
-		CXXFLAGS_posix:=$(CXX_O_FLAG_HI),\
-		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_ORIGIN),\
-		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)/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)
+LIBAWT_LANG:=C
+
+ifeq ($(OPENJDK_TARGET_OS),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
 
-BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX)
+ifeq ($(MILESTONE), internal)
+	LIBAWT_CFLAGS += -DINTERNAL_BUILD
+endif
+
+LIBAWT_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt/mapfile-vers
+ifeq ($(OPENJDK_TARGET_OS),linux)
+	LIBAWT_MAPFILE:=
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBAWT,\
+		LIBRARY:=awt,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(LIBAWT_DIRS),\
+		INCLUDE_FILES:=$(LIBAWT_FILES),\
+		LANG:=$(LIBAWT_LANG),\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS),\
+		ASFLAGS:=$(LIBAWT_ASFLAGS),\
+		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 $(WIN_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:=-lmlib_image \
+                                 -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",\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt))
+
+$(BUILD_LIBAWT) : $(BUILD_LIBJAVA)
+
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+$(BUILD_LIBAWT) : $(BUILD_LIBMLIB_IMAGE)
+endif
+
+BUILD_LIBRARIES += $(BUILD_LIBAWT)
 
 ##########################################################################################
 
-ifndef OPENJDK
-
-#    ifeq ($(PLATFORM), linux)
-#        ifeq ("$(CC_VER_MAJOR)", "3")
-#            OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
-#        endif                           
-#    endif
+# TODO!!
+# Even though this variable as a general name, it is
+# only used on macos, in fontpath.c, as prefix for where to find fonts.
 #
-# The resulting size of the t2k lib file is (at least on linux) dependant on the order of 
-# the input .o files. Because of this the new build will differ in size to the old build.
-    BUILD_LIBT2K_CFLAGS_COMMON:=-I$(JDK_TOPDIR)/src/share/native/sun/font \
-		            -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
-		            -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
-		            -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
-		            -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/font \
-		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
-		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
-		            -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/java2d \
-		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d
-
-    $(eval $(call SetupNativeCompilation,BUILD_LIBT2K,\
-                SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/font \
-		     $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
-		     $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints,\
-		EXCLUDE_FILES:=orion.c,\
-		LANG:=C++,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON) $(C_O_FLAG_HI),\
-		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_ORIGIN),\
-		LDFLAGS_windows:=user32.lib $(JDK_OUTPUTDIR)/objs/fontmanager.lib,\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		LDFLAGS_SUFFIX_macosx:=$(LIBCXX) $(LIBM) -lfontmanager,\
-		LDFLAGS_SUFFIX_linux:=$(LIBCXX) $(LIBM) -lfontmanager,\
-		LDFLAGS_SUFFIX_solaris:=$(LIBCXX) $(LIBM) -lfontmanager -lawt \
-					-lawt_xawt,\
-		BIN:=$(JDK_OUTPUTDIR)/objs/libt2k,\
-		LIB:=$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX)))
-
-    # t2k is linked against fontmanager
-    $(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
-
-##########################################################################################
-
+# It's used for libawt_headless _and_ libawt_xawt
 #
-# 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
-    endif
-    $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\
-                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/windows,\
-		INCLUDE_FILES:=jawt.cpp,\
-		LANG:=C++,\
-		CFLAGS:=$(CXXFLAGS_JDKLIB) $(CXX_O_FLAG_NORM) \
-			-EHsc -DUNICODE -D_UNICODE \
-			-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/windows \
-		        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
-		        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
-			-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 awt.lib,\
-		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_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
-        JAWT_LIBS += -lawt_xawt
-    else
-        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 \
-                     $(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_ORIGIN),\
-		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,\
-		LDFLAGS_SUFFIX_macosx:= -framework Cocoa, \
-		BIN:=$(JDK_OUTPUTDIR)/objs/libjawt,\
-		LIB:=$(BUILD_LIBJAWT_LIB)))
-
+X11_PATH:=/usr/X11R6
+
+ifneq ($(OPENJDK_TARGET_OS), windows)
 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)
-
-
-##########################################################################################
-
-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 := \
+
+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/$(LEGACY_OPENJDK_TARGET_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 \
+		$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/awt \
+		$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/java2d/opengl \
+		$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/java2d/x11 \
+		$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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/$(LEGACY_OPENJDK_TARGET_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)
+	-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/jdga
+
+ifeq ($(OPENJDK_TARGET_OS),solaris)
 	LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
 endif
 
@@ -1834,7 +756,7 @@
 	LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
 endif
 
-LIBAWT_XAWT_FILES := \
+LIBAWT_XAWT_FILES:=\
 	XlibWrapper.c \
 	XWindow.c \
 	XToolkit.c \
@@ -1891,79 +813,1544 @@
 	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:=$(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi  -ljava -ljvm -lc
+
+ifeq ($(OPENJDK_TARGET_OS), linux)
 	LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
 endif
 
-ifeq ($(PLATFORM), macosx)
+ifeq ($(OPENJDK_TARGET_OS), macosx)
 	LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
 endif
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT,\
+		LIBRARY:=awt_xawt,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBAWT_XAWT_DIRS),\
-		INCLUDE_FILES := $(LIBAWT_XAWT_FILES),\
+		INCLUDE_FILES:=$(LIBAWT_XAWT_FILES),\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) $(LIBAWT_XAWT_CFLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
                         $(X_CFLAGS),\
-		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_xawt/mapfile-vers, \
+		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) \
+		LDFLAGS_solaris:=-L$(OPENWIN_HOME)/sfw/lib$(ISA_DIR) -L$(OPENWIN_HOME)/lib$(ISA_DIR) \
+				 -R$(OPENWIN_HOME)/sfw/lib$(ISA_DIR) -R$(OPENWIN_HOME)/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)
+		LDFLAGS_SUFFIX:=$(LIBAWT_XAWT_LDFLAGS_SUFFIX),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_xawt))
+
+$(BUILD_LIBAWT_XAWT) : $(BUILD_LIBJAVA)
+
+$(BUILD_LIBAWT_XAWT) : $(BUILD_LIBAWT)
+
+BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT)
 
 endif
 endif
 
 ##########################################################################################
 
+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
+
+BUILD_LIBZIP_REORDER:=
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+    ifneq ($(ARCH), amd64)
+        BUILD_LIBZIP_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libzip/reorder-$(ARCH)
+    endif
+endif
+
+ifeq ($(LIBZIP_CAN_USE_MMAP), true)
+     BUILD_LIBZIP_MMAP:=-DUSE_MMAP
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBZIP,\
+                LIBRARY:=zip,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                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,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                        $(LIBZ_INCLUDE) \
+		        -I$(JDK_TOPDIR)/src/share/native/java/io \
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/java/io,\
+		CFLAGS_posix:=$(BUILD_LIBZIP_MMAP) -UDEBUG,\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libzip/mapfile-vers, \
+		REORDER:=$(BUILD_LIBZIP_REORDER), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(EXPORT_ZIP_FUNCS), \
+		LDFLAGS_winapi:=-export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
+                                -export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \
+                                $(WIN_JAVA_LIB),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBZ),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libzip))
+
+$(BUILD_LIBZIP) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBZIP)
+
+##########################################################################################
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK,\
+		LIBRARY:=unpack, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
+		EXCLUDE_FILES:=main.cpp,\
+		LANG:=C++,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CXXFLAGS_JDKLIB) \
+			 -DNO_ZLIB -DUNPACK_JNI -DFULL,\
+		CFLAGS_release:=-DPRODUCT,\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_winapi:=-map:$(JDK_OUTPUTDIR)/objs/unpack.map /debug \
+				jvm.lib $(WIN_JAVA_LIB),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX_posix:=$(LIBCXX),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libunpack,\
+		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
+		RC_FLAGS:=$(RC_FLAGS)\
+			  /D "JDK_FNAME=unpack.dll" \
+			  /D "JDK_INTERNAL_NAME=unpack" \
+			  /D "JDK_FTYPE=0x2L"))
+
+$(BUILD_LIBUNPACK) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBUNPACK)
+
+ifeq ($(OPENJDK_TARGET_OS_API),winapi)
+    $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK)
+	$(ECHO) Copying $(@F)
+	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.map,$<) $@
+
+    $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK)
+	$(ECHO) Copying $(@F)
+	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX),%.pdb,$<) $@
+endif
+
+##########################################################################################
+
+LIBATTACH_EXCLUDE_FILES:=
+ifneq ($(OPENJDK_TARGET_OS),solaris)
+    LIBATTACH_EXCLUDE_FILES+=SolarisVirtualMachine.c
+endif
+ifneq ($(OPENJDK_TARGET_OS),linux)
+    LIBATTACH_EXCLUDE_FILES+=LinuxVirtualMachine.c
+endif
+ifneq ($(OPENJDK_TARGET_OS),macosx)
+    LIBATTACH_EXCLUDE_FILES+=BsdVirtualMachine.c
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH,\
+		LIBRARY:=attach, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/tools/attach,\
+		EXCLUDE_FILES:=$(LIBATTACH_EXCLUDE_FILES),\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_solaris:=-ldoor,\
+		LDFLAGS_winapi:=psapi.lib advapi32.lib $(WIN_JAVA_LIB) jvm.lib,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libattach,\
+		DEBUG_SYMBOLS:=true))
+
+$(BUILD_LIBATTACH) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBATTACH)
+
+##########################################################################################
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET,\
+		LIBRARY:=dt_socket,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/share/transport/socket \
+			$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/transport/socket,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP \
+                        -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
+                        -I$(JDK_TOPDIR)/src/share/transport/socket \
+		        -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/transport/socket \
+                        -I$(JDK_TOPDIR)/src/share/back/export \
+                        -I$(JDK_TOPDIR)/src/share/back,\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libdt_socket/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB), \
+		LDFLAGS_SUFFIX_linux:=$(LDFLAGS_JDKLIB_SUFFIX) -lpthread,\
+		LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket,\
+		LDFLAGS_SUFFIX_winapi:=$(LDFLAGS_JDKLIB_SUFFIX) -export:jdwpTransport_OnLoad ws2_32.lib,\
+		LDFLAGS_SUFFIX:=,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdt_socket,\
+		DEBUG_SYMBOLS:=true))
+
+$(BUILD_LIBDT_SOCKET) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBDT_SOCKET)
+
+##########################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS_API),winapi)
+
+  $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM,\
+		LIBRARY:=dt_shmem,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/tools/jdi \
+			$(JDK_TOPDIR)/src/share/transport/shmem \
+			$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/transport/shmem,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) -DUSE_MMAP\
+                        -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
+                        -I$(JDK_TOPDIR)/src/share/transport/shmem \
+		        -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/transport/shmem \
+                        -I$(JDK_TOPDIR)/src/share/back/export, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB),\
+		LDFLAGS_winapi:=-export:jdwpTransport_OnLoad,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdt_shmem))
+
+  BUILD_LIBRARIES += $(BUILD_LIBDT_SHMEM)
+
+endif # OPENJDK_TARGET_OS
+
+##########################################################################################
+# JDWP_LOGGING causes log messages to be compiled into the library. These reference the 
+# __FILE__ macro which here expands to the absolute path of the file while the old build 
+# system used a relative path. This causes the binaries to differ in size.
+$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP,\
+		LIBRARY:=jdwp, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/back,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) -DJDWP_LOGGING\
+		 -I$(JDK_TOPDIR)/src/share/transport/export \
+                 -I$(JDK_TOPDIR)/src/share/back/export \
+                 -I$(JDK_TOPDIR)/src/share/npt \
+                 -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/npt \
+                 -I$(JDK_TOPDIR)/src/share/back \
+                 -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/back \
+		 -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers,\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjdwp/mapfile-vers, \
+		LDFLAGS:=$(filter-out -ljava,$(LDFLAGS_JDKLIB)), \
+		LDFLAGS_SUFFIX_linux:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL),\
+		LDFLAGS_SUFFIX_solaris:=$(LIBDL),\
+		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX:=,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjdwp))
+
+$(BUILD_LIBJDWP) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJDWP)
+
+##########################################################################################
+
+LIBJAAS_MAPFILE:=
+ifneq ($(OPENJDK_TARGET_OS),solaris)
+   LIBJAAS_EXCLUDE_FILES:=Solaris.c
+else
+   # only on solaris...wonder why
+   LIBJAAS_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjaas/mapfile-vers
+endif
+
+LIBJAAS_NAME:=jaas_unix
+ifeq ($(OPENJDK_TARGET_OS), windows)
+     LIBJAAS_NAME:=jaas_nt
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS,\
+		LIBRARY:=$(LIBJAAS_NAME),\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/com/sun/security/auth/module,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		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_SUFFIX_linux:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX:=,\
+		EXCLUDE_FILES:=$(LIBJAAS_EXCLUDE_FILES),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjaas))
+
+$(BUILD_LIBJAAS) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJAAS)
+
+##########################################################################################
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT,\
+		LIBRARY:=jsdt,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace\
+			$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/tracing/dtrace,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB)\
+			-I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace,\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsdt/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX_linux:=$(LDFLAGS_JDKLIB_SUFFIX)  $(LIBDL),\
+		LDFLAGS_SUFFIX_winapi:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL),\
+		LDFLAGS_SUFFIX_macosx:=                         $(LIBDL),\
+		LDFLAGS_SUFFIX:=,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsdt, \
+                DEBUG_SYMBOLS:= yes))
+
+$(BUILD_LIBJSDT) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJSDT)
+
+##########################################################################################
+
+ifdef OPENJDK
+    # TODO: Update awt lib path when awt is converted
+    $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS,\
+                LIBRARY:=lcms,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms \
+		     $(JDK_TOPDIR)/src/share/native/sun/java2d/,\
+		INCLUDE_FILES:=cmscam02.c cmscgats.c cmscnvrt.c cmserr.c \
+			       cmsgamma.c cmsgmt.c cmsintrp.c cmsio0.c \
+			       cmsio1.c cmslut.c cmsmd5.c cmsmtrx.c \
+			       cmsnamed.c cmsopt.c cmspack.c cmspcs.c \
+			       cmsplugin.c cmsps2.c cmssamp.c cmssm.c \
+			       cmstypes.c cmsvirt.c cmswtpnt.c cmsxform.c \
+			       LCMS.c,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(filter-out -xc99=%none,$(CFLAGS_JDKLIB)) \
+			$(SHARED_LIBRARY_FLAGS) \
+			-I$(JDK_TOPDIR)/src/share/native/sun/java2d \
+			-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug,\
+		CFLAGS_solaris:=-xc99=no_lib,\
+		CFLAGS_winapi:=-DCMS_IS_WINDOWS_,\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/liblcms/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB), \
+		LDFLAGS_solaris:=/usr/lib$(ISA_DIR)/libm.so.2,\
+		LDFLAGS_winapi:=$(WIN_AWT_LIB) $(WIN_JAVA_LIB),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX_posix:=-lawt,\
+		LDFLAGS_SUFFIX_linux:=-lm,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/liblcms))
+
+    BUILD_LIBRARIES += $(BUILD_LIBLCMS)
+
+    $(BUILD_LIBLCMS) : $(BUILD_LIBAWT)
+endif
+
+##########################################################################################
+
+ifdef OPENJDK
+    BUILD_LIBJPEG_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers
+else
+    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 ($(OPENJDK_TARGET_OS), solaris)
+    ifneq ($(ARCH), amd64)
+        BUILD_LIBJPEG_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(ARCH)
+    endif
+endif
+
+# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
+# or 'vfork'": this warning indicates that some variable is placed to
+# a register by optimized compiler and it's value might be lost on longjmp().
+# Recommended way to avoid such warning is to declare the variable as
+# volatile to prevent the optimization. However, this approach does not
+# work because we have to declare all variables as volatile in result.
+#ifndef CROSS_COMPILE_ARCH
+#    CC_43_OR_NEWER:=\
+#        $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
+#              \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
+#    ifeq ($(CC_43_OR_NEWER),1)
+#        BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
+#    endif
+#endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG,\
+                LIBRARY:=jpeg, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(BUILD_LIBJPEG_CLOSED_SRC) \
+		     $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
+		LANG:=C,\
+		OPTIMIZATION:=HIGHEST, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+			$(BUILD_LIBJPEG_CLOSED_INCLUDES) \
+			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg,\
+		MAPFILE:=$(BUILD_LIBJPEG_MAPFILE), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_linux:=$(LIBDL),\
+		LDFLAGS_winapi:=$(WIN_JAVA_LIB) jvm.lib,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		REORDER:=$(BUILD_LIBJPEG_REORDER),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjpeg))
+
+$(BUILD_LIBJPEG) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJPEG)
+
+##########################################################################################
+
+ifndef OPENJDK
+    FONT_HEADERS:=-I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
+    BUILD_LIBFONTMANAGER_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
+    LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
+else
+    FONT_HEADERS:=$(FREETYPE2_CFLAGS)
+    BUILD_LIBFONTMANAGER_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
+    BUILD_LIBFONTMANAGER_FONTLIB:=$(FREETYPE2_LIBS)
+endif
+
+LIBFONTMANAGER_OPTIMIZATION:=HIGH
+
+ifeq ($(OPENJDK_TARGET_OS),windows)
+    LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
+				    X11TextRenderer.c
+    LIBFONTMANAGER_OPTIMIZATION:=LOW
+else
+    LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
+				    lcdglyph.c
+endif
+
+BUILD_LIBFONTMANAGER_CFLAGS_COMMON:=\
+			$(X_CFLAGS) \
+			-DLE_STANDALONE -DHEADLESS \
+			$(FONT_HEADERS) \
+			-I$(JDK_TOPDIR)/src/share/native/sun/font \
+			-I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
+			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/awt \
+			-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+			-I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
+			-I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/java2d \
+			-I$(JDK_TOPDIR)/src/share/native/sun/java2d
+
+# Turn off aliasing with GCC for ExtensionSubtables.cpp
+ifeq ($(OPENJDK_TARGET_OS), linux)
+    BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS:=-fno-strict-aliasing
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER,\
+		LIBRARY:=fontmanager, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/share/native/sun/font\
+		     $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/font,\
+		EXCLUDE_FILES:=$(LIBFONTMANAGER_EXCLUDE_FILES) \
+			       AccelGlyphCache.c,\
+		LANG:=C++,\
+		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\
+		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON),\
+		OPTIMIZATION:=$(LIBFONTMANAGER_OPTIMIZATION), \
+		CFLAGS_windows= -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/windows \
+				-DCC_NOEX, \
+		MAPFILE:=$(BUILD_LIBFONTMANAGER_MAPFILE), \
+		LDFLAGS:=$(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_windows:=advapi32.lib user32.lib gdi32.lib $(WIN_AWT_LIB) $(WIN_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,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfontmanager))
+
+$(BUILD_LIBFONTMANAGER) : $(BUILD_LIBAWT)
+
+ifneq (,$(findstring $(OPENJDK_TARGET_OS),solaris macosx))
+$(BUILD_LIBFONTMANAGER) : $(BUILD_LIBAWT_XAWT)
+endif
+
+BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER)
+
+##########################################################################################
+
+ifndef OPENJDK
+
+#    ifeq ($(OPENJDK_TARGET_OS), linux)
+#        ifeq ("$(CC_VER_MAJOR)", "3")
+#            OTHER_LDLIBS  += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
+#        endif                           
+#    endif
+#
+# The resulting size of the t2k lib file is (at least on linux) dependant on the order of 
+# the input .o files. Because of this the new build will differ in size to the old build.
+    BUILD_LIBT2K_CFLAGS_COMMON:=-I$(JDK_TOPDIR)/src/share/native/sun/font \
+		            -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
+		            -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
+		            -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
+		            -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/font \
+		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
+		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
+		            -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/java2d \
+		            -I$(JDK_TOPDIR)/src/share/native/sun/java2d
+
+    $(eval $(call SetupNativeCompilation,BUILD_LIBT2K,\
+                LIBRARY:=t2k, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/font \
+		     $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
+		     $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints,\
+		EXCLUDE_FILES:=orion.c,\
+		LANG:=C++,\
+		OPTIMIZATION:=HIGH, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON),\
+		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON),\
+		CFLAGS_windows=-DCC_NOEX, \
+		CXXFLAGS_windows=-DCC_NOEX, \
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libt2k/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_windows:=user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX_macosx:=$(LIBCXX) $(LIBM) -lfontmanager,\
+		LDFLAGS_SUFFIX_linux:=$(LIBCXX) $(LIBM) -lfontmanager,\
+		LDFLAGS_SUFFIX_solaris:=$(LIBCXX) $(LIBM) -lfontmanager -lawt \
+					-lawt_xawt,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libt2k))
+
+    # t2k is linked against fontmanager
+    $(BUILD_LIBT2K) : $(BUILD_LIBFONTMANAGER)
+
+    BUILD_LIBRARIES += $(BUILD_LIBT2K)
+endif
+
+##########################################################################################
+
+#
+# TODO replace with X_FLAGS / X_LIBS
+#   and add them to configure
+#
+OPENWIN_LIB:=$(OPENWIN_HOME)/lib
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    ifeq ($(ARCH_DATA_MODEL), 32)
+        KERNEL32_LIB:=kernel32.lib
+    endif
+    $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\
+                LIBRARY:=jawt, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/windows,\
+		INCLUDE_FILES:=jawt.cpp,\
+		LANG:=C++,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CXXFLAGS_JDKLIB) \
+			-EHsc -DUNICODE -D_UNICODE \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/windows \
+		        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
+		        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
+			-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/java2d/windows, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(KERNEL32_LIB) \
+			 advapi32.lib $(WIN_AWT_LIB),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawt))
+
+$(BUILD_LIBJAWT) : $(BUILD_LIBAWT)
+
+$(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
+	$(ECHO) Copying $(@F)
+	$(CP) $< $@
+
+BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
+
+else # OPENJDK_TARGET_OS not windows
+
+    JAWT_LIBS:=
+    ifneq ($(OPENJDK_TARGET_OS), solaris)
+        JAWT_LIBS += -lawt
+    endif
+
+    ifndef BUILD_HEADLESS_ONLY
+        JAWT_LIBS += -lawt_xawt
+    else
+        JAWT_LIBS += -lawt_headless
+        HEADLESS_CFLAG += -DHEADLESS
+    endif
+
+    JAWT_FILES:=jawt.c
+    ifeq ($(OPENJDK_TARGET_OS), macosx)
+	JAWT_FILES:=jawt.m
+	JAWT_LIBS:=-lawt_lwawt
+    endif
+
+    $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT,\
+                LIBRARY:=jawt, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/awt \
+                     $(JDK_TOPDIR)/src/macosx/native/sun/awt,\
+		INCLUDE_FILES:=$(JAWT_FILES),\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB), \
+		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_ORIGIN),\
+		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,\
+		LDFLAGS_SUFFIX_macosx:=-framework Cocoa, \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawt))
+
 ifndef BUILD_HEADLESS_ONLY
-LIBSPLASHSCREEN_DIRS := \
+$(BUILD_LIBJAWT) : $(BUILD_LIBAWT_XAWT)
+else
+$(BUILD_LIBJAWT) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
+endif
+
+ifeq ($(OPENJDK_TARGET_OS),macosx)
+$(BUILD_LIBJAWT) : $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
+endif
+
+endif # OPENJDK_TARGET_OS
+
+BUILD_LIBRARIES += $(BUILD_LIBJAWT)
+
+##########################################################################################
+
+ifndef OPENJDK
+ifneq ($(OPENJDK_TARGET_OS), macosx)
+
+LIBJDBCODBC_DIR   :=$(JDK_OUTPUTDIR)/objs/libjdbcodbc
+LIBJDBCODBC_NAME  :=$(LIBRARY_PREFIX)JdbcOdbc$(SHARED_LIBRARY_SUFFIX)
+LIBJDBCODBC_CFLAGS:=
+LIBJDBCODBC_LIBS   :=
+LIBJDBCODBC_LDFLAGS:=
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+	LIBJDBCODBC_LDFLAGS:=$(LDFLAGS_JDKLIB)
+	LIBJDBCODBC_LIBS += odbc32.lib odbccp32.lib $(WIN_JAVA_LIB) advapi32.lib
+else
+	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
+#
+	LIBJDBCODBC_LDFLAGS:=$(patsubst defs,nodefs,$(LDFLAGS_JDKLIB)) \
+				      -Xlinker -z -Xlinker nodefs
+	LIBJDBCODBC_LIBS += -L$(LIBJDBCODBC_DIR) -lodbcinst -lodbc
+	LIBJDBCODBC_SONAME:=$(call SET_SHARED_LIBRARY_NAME,$(LIBJDBCODBC_NAME))
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJDBCODBC,\
+		LIBRARY:=JdbcOdbc,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(JDK_TOPDIR)/src/closed/share/classes/sun/jdbc/odbc,\
+		EXCLUDE_FILES:=dummyodbc.c,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(LIBJDBCODBC_CFLAGS) $(CFLAGS_JDKLIB) \
+			$(SHARED_LIBRARY_FLAGS),\
+		LDFLAGS:=$(LIBJDBCODBC_LDFLAGS) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN) $(LIBJDBCODBC_LIBS),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBJDBCODBC_SONAME),\
+		OBJECT_DIR:=$(LIBJDBCODBC_DIR)))
+
+$(BUILD_LIBJDBCODBC) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJDBCODBC)
+
+ifneq ($(OPENJDK_TARGET_OS), windows)
+
+$(eval $(call SetupNativeCompilation,BUILD_FAKEODBCINST,\
+		LIBRARY:=odbcinst,\
+                OUTPUT_DIR:=$(LIBJDBCODBC_DIR),\
+		SRC:=$(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc,\
+		INCLUDE_FILES:=dummyodbc1.c,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB),\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN) $(LIBJDBCODBC_LDFLAGS),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBJDBCODBC_SONAME),\
+		OBJECT_DIR:=$(LIBJDBCODBC_DIR)))
+
+$(eval $(call SetupNativeCompilation,BUILD_FAKEODBC,\
+		LIBRARY:=odbc,\
+                OUTPUT_DIR:=$(LIBJDBCODBC_DIR),\
+		SRC:=$(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc,\
+		INCLUDE_FILES:=dummyodbc2.c,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(LIBJDBCODBC_CFLAGS) $(CFLAGS_JDKLIB),\
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN) $(LIBJDBCODBC_LDFLAGS),\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBJDBCODBC_SONAME),\
+		OBJECT_DIR:=$(LIBJDBCODBC_DIR)))
+
+$(BUILD_FAKEODBCINST) $(BUILD_FAKEODBC) : \
+  $(BUILD_LIBJAVA)
+
+$(BUILD_LIBJDBCODBC) : $(BUILD_FAKEODBCINST) $(BUILD_FAKEODBC)
+
+endif
+
+endif
+endif
+
+##########################################################################################
+
+BUILD_LIBINSTRUMENT_SRC   :=$(JDK_TOPDIR)/src/share/instrument \
+                               $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/java/io \
+                               $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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_CFLAGS:=-I$(JDK_TOPDIR)/src/share/instrument \
+                               -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/instrument \
+                               -I$(JDK_TOPDIR)/src/share/bin
+
+BUILD_LIBINSTRUMENT_LDFLAGS:=
+BUILD_LIBINSTRUMENT_LDFLAGS_SUFFIX:=
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  BUILD_LIBINSTRUMENT_LDFLAGS += $(JDK_OUTPUTDIR)/objs/jli_static.lib $(WIN_JAVA_LIB) \
+				 -export:Agent_OnAttach
+  # equivalent of strcasecmp is stricmp on Windows
+  BUILD_LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
+else ifneq (,$(findstring $(OPENJDK_TARGET_OS), 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 += -L $(INSTALL_LIBRARIES_HERE)/jli
+	BUILD_LIBINSTRUMENT_LDFLAGS_SUFFIX += -ljli $(LIBDL)
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT,\
+		LIBRARY:=instrument, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(BUILD_LIBINSTRUMENT_SRC),\
+		INCLUDE_FILES:=$(BUILD_LIBINSTRUMENT_FILES),\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                        $(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),\
+		OBJECT_DIR:=$(BUILD_LIBINSTRUMENT_DIR),\
+		DEBUG_SYMBOLS:=true))
+
+ifneq (,$(findstring $(OPENJDK_TARGET_OS), macosx windows))
+$(BUILD_LIBINSTRUMENT) : $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
+else
+$(BUILD_LIBINSTRUMENT) : $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
+endif
+$(BUILD_LIBINSTRUMENT) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT)
+
+##########################################################################################
+
+BUILD_LIBMANAGEMENT_SRC:=$(JDK_TOPDIR)/src/share/native/sun/management \
+                           $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/management \
+                           $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/com/sun/management
+
+BUILD_LIBMANAGEMENT_EXCLUDES:=
+
+BUILD_LIBMANAGEMENT_CFLAGS:=-I$(JDK_TOPDIR)/src/share/native/sun/management
+
+ifneq ($(OPENJDK_TARGET_OS), windows)
+	BUILD_LIBMANAGEMENT_EXCLUDES += OperatingSystem_md.c
+else
+	BUILD_LIBMANAGEMENT_EXCLUDES += UnixOperatingSystem_md.c
+endif
+
+ifneq ($(OPENJDK_TARGET_OS),solaris)
+	BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c
+endif
+
+ifneq ($(OPENJDK_TARGET_OS),linux)
+	BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c
+endif
+
+ifneq ($(OPENJDK_TARGET_OS),macosx)
+	BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c
+endif
+
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT,\
+		LIBRARY:=management,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(BUILD_LIBMANAGEMENT_SRC),\
+		EXCLUDE_FILES:=$(BUILD_LIBMANAGEMENT_EXCLUDES),\
+		LANG:=C,\
+		OPTIMIZATION:=HIGH, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS),\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libmanagement/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_windows:=$(WIN_JAVA_LIB) jvm.lib advapi32.lib psapi.lib,\
+		LDFLAGS_solaris:=-lkstat,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmanagement,\
+		DEBUG_SYMBOLS:=true))
+
+$(BUILD_LIBMANAGEMENT) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBMANAGEMENT)
+
+##########################################################################################
+
+BUILD_LIBHPROF_SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/hprof $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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_OPENJDK_TARGET_OS_API)/npt \
+                         -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo
+
+BUILD_LIBHPROF_LDFLAGS:=
+
+ifeq ($(OPENJDK_TARGET_OS),solaris)
+     BUILD_LIBHPROF_LDFLAGS += -lsocket -lnsl
+endif
+
+ifneq ($(OPENJDK_TARGET_OS),windows)
+     BUILD_LIBHPROF_LDFLAGS += $(LIBDL)
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBHPROF,\
+		LIBRARY:=hprof, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(BUILD_LIBHPROF_SRC),\
+		LANG:=C,\
+		OPTIMIZATION:=HIGHEST, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                         $(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),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libhprof_jvmti,\
+		DEBUG_SYMBOLS:=true))
+
+BUILD_LIBRARIES += $(BUILD_LIBHPROF)
+
+##########################################################################################
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO,\
+		LIBRARY:=java_crw_demo, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                        -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:=,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjava_crw_demo,\
+		DEBUG_SYMBOLS:=true))
+
+BUILD_LIBRARIES += $(BUILD_LIBJAVA_CRW_DEMO)
+
+##########################################################################################
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBNPT,\
+		LIBRARY:=npt, \
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/npt,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                        -I$(JDK_TOPDIR)/src/share/npt \
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnpt,\
+		DEBUG_SYMBOLS:=true))
+
+BUILD_LIBRARIES += $(BUILD_LIBNPT)
+
+##########################################################################################
+
+LIBNET_SRC_DIRS:=$(JDK_TOPDIR)/src/share/native/java/net \
+                   $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/java/net \
+                   $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/net/dns \
+                   $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/net/www/protocol/http/ntlm \
+                   $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/net/sdp \
+                   $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/net/spi
+
+LIBNET_CFLAGS:=$(foreach dir,$(LIBNET_SRC_DIRS),-I$(dir))
+
+LIBNET_EXCLUDE_FILES:=
+ifneq ($(OPENJDK_TARGET_OS),linux)
+	LIBNET_EXCLUDE_FILES += linux_close.c
+endif
+
+ifneq ($(OPENJDK_TARGET_OS),macosx)
+	LIBNET_EXCLUDE_FILES += bsd_close.c
+endif
+
+ifeq ($(OPENJDK_TARGET_OS),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,\
+		LIBRARY:=net,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(LIBNET_SRC_DIRS),\
+		EXCLUDE_FILES:=$(LIBNET_EXCLUDE_FILES), \
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                        $(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 $(WIN_JAVA_LIB) jvm.lib advapi32.lib \
+                                          /DELAYLOAD:secur32.dll /DELAYLOAD:iphlpapi.dll, \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnet))
+
+$(BUILD_LIBNET) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBNET)
+
+$(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 ($(OPENJDK_TARGET_OS), solaris)
+$(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template : $(JDK_TOPDIR)/src/${LEGACY_OPENJDK_TARGET_OS_API}/lib/sdp/sdp.conf.template
+	$(ECHO) Copying $(@F)
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+
+COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
+endif
+
+##########################################################################################
+
+BUILD_LIBNIO_SRC:=\
+        $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/java/nio \
+	$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/ch \
+	$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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_OPENJDK_TARGET_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 ($(OPENJDK_TARGET_OS), windows)
+	BUILD_LIBNIO_FILES += \
+		Iocp.c \
+		RegistryFileTypeDetector.c \
+		WindowsAsynchronousFileChannelImpl.c \
+		WindowsAsynchronousServerSocketChannelImpl.c \
+		WindowsAsynchronousSocketChannelImpl.c \
+		WindowsNativeDispatcher.c \
+	        WindowsSelectorImpl.c
+endif
+
+ifeq ($(OPENJDK_TARGET_OS), linux)
+	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 ($(OPENJDK_TARGET_OS), 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 ($(OPENJDK_TARGET_OS), solaris)
+	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
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBNIO,\
+		LIBRARY:=nio,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(BUILD_LIBNIO_SRC),\
+		INCLUDE_FILES:=$(BUILD_LIBNIO_FILES), \
+		LANG:=C,\
+		OPTIMIZATION:=HIGH, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                        $(BUILD_LIBNIO_CFLAGS),\
+		MAPFILE:=$(BUILD_LIBNIO_MAPFILE), \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX_linux:=-ljava -lnet -lpthread $(LIBDL),\
+		LDFLAGS_SUFFIX_solaris:=$(LDFLAGS_JDKLIB_SUFFIX) \
+                                        $(JVMLIB) -lsocket -lposix4 $(LIBDL) -lsendfile \
+		                        -ljava -lnet,\
+		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX) \
+                                        $(WIN_JAVA_LIB) $(JDK_OUTPUTDIR)/objs/libnet/net.lib \
+					advapi32.lib jvm.lib ws2_32.lib\
+                                        $(JDK_OUTPUTDIR)/objs/libjava/io_util.obj \
+		                        $(JDK_OUTPUTDIR)/objs/libjava/FileDescriptor_md.obj ,\
+		LDFLAGS_SUFFIX_macosx:=-ljava -lnet -pthread,\
+		LDFLAGS_SUFFIX:=,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libnio))
+
+BUILD_LIBRARIES += $(BUILD_LIBNIO)
+
+$(BUILD_LIBNIO) : $(BUILD_LIBNET)
+
+##########################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS_API),posix)
+  # TODO make this work on macosx
+  ifneq ($(OPENJDK_TARGET_OS),macosx)
+
+    SCTP_WERROR := -Werror
+    ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
+      SCTP_WERROR :=
+    endif
+
+    $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP,\
+                LIBRARY:=sctp,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+                SRC:=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/ch/sctp,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB)\
+			-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
+			-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \
+			-I$(JDK_TOPDIR)/src/share/native/java/net \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/ch \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/java/net,\
+		CFLAGS_linux:=$(SCTP_WERROR),\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsctp/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX_linux:=$(LIBDL) -lpthread,\
+		LDFLAGS_SUFFIX_posix:=-lnio -lnet,\
+		LDFLAGS_SUFFIX_solaris:=-lsocket,\
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
+		INCLUDE_FILES:=SctpNet.c SctpChannelImpl.c SctpServerChannelImpl.c,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsctp))
+
+    BUILD_LIBRARIES += $(BUILD_LIBSCTP)
+
+    $(BUILD_LIBSCTP) : $(BUILD_LIBNIO)
+  endif
+endif
+
+##########################################################################################
+
+BUILD_LIBJLI_SRC_DIRS:=$(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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 ($(OPENJDK_TARGET_OS), 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_STATIC_java_md_macosx.c_CFLAGS:=-x objective-c
+endif
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+	BUILD_LIBJLI_FILES += java_md.c
+else ifneq ($(OPENJDK_TARGET_OS), 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_OPENJDK_TARGET_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
+ifneq ($(OPENJDK_TARGET_OS), macosx)
+	BUILD_LIBJLI_CFLAGS += -DLIBARCHNAME='"$(LIBARCH)"'
+else
+	BUILD_LIBJLI_CFLAGS += -DLIBARCHNAME='"$(ARCH)"'
+endif
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+	ifeq ($(OPENJDK_TARGET_CPU_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 # OPENJDK_TARGET_OS
+
+ifeq ($(OPENJDK_TARGET_OS), 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
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    LIBJLI_OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE)
+else
+    LIBJLI_OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE)/jli
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJLI,\
+		LIBRARY:=jli,\
+                OUTPUT_DIR:=$(LIBJLI_OUTPUT_DIR),\
+		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
+		INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
+		LANG:=C,\
+		OPTIMIZATION:=HIGH, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(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, \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli))
+
+BUILD_LIBRARIES += $(BUILD_LIBJLI)
+
+# 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.
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
+		STATIC_LIBRARY:=jli_static,\
+                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
+		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
+		INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
+		LANG:=C,\
+		OPTIMIZATION:=HIGH, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(STATIC_LIBRARY_FLAGS) $(BUILD_LIBJLI_CFLAGS),\
+		ARFLAGS:=$(ARFLAGS),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static))
+
+BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC)
+
+else ifeq ($(OPENJDK_TARGET_OS),macosx)
+    #
+    # On macosx they do partial (incremental) linking of libjli_static.a
+    #   code it here...rather than add support to NativeCompilation
+    #   as this is first time I see it
+    $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\
+		LIBRARY:=jli_static, \
+                OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\
+		SRC:=$(BUILD_LIBJLI_SRC_DIRS),\
+		INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\
+		LANG:=C,\
+		OPTIMIZATION:=HIGH, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(BUILD_LIBJLI_CFLAGS),\
+		LDFLAGS:=-nostdlib -r,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static))
+
+$(JDK_OUTPUTDIR)/objs/libjli_static.a : $(BUILD_LIBJLI_STATIC)
+	$(CP) -a $< $@
+
+BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
+endif
+
+##########################################################################################
+
+ifeq ($(ENABLE_JFR), true)
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJFR,\
+		LIBRARY:=jfr,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(JDK_TOPDIR)/src/closed/share/native/oracle/jfr,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+                        -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjfr/mapfile-vers, \
+		LDFLAGS:=$(LDFLAGS_JDKLIB) \
+			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjfr))
+
+BUILD_LIBRARIES += $(BUILD_LIBJFR)
+
+endif
+
+##########################################################################################
+
+ifndef OPENJDK
+
+BUILD_LIBKCMS_EXCLUDE_FILES:=
+ifeq ($(OPENJDK_TARGET_OS),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
+
+BUILD_LIBKCMS_FLAGS:=$(CFLAGS_JDKLIB)
+
+ifeq ($(OPENJDK_TARGET_OS),solaris)
+     # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
+     #   implement it like this...since it's only used here
+     BUILD_LIBKCMS_FLAGS:=$(patsubst -KPIC,-Kpic,$(BUILD_LIBKCMS_FLAGS))
+else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
+     BUILD_LIBKCMS_FLAGS:=$(patsubst -fPIC,-fpic,$(BUILD_LIBKCMS_FLAGS))
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBKCMS,\
+		LIBRARY:=kcms,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms,\
+		LANG:=C,\
+		EXCLUDE_FILES:=$(BUILD_LIBKCMS_EXCLUDE_FILES),\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(BUILD_LIBKCMS_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:=$(WIN_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,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libkcms))
+
+$(BUILD_LIBKCMS) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBKCMS)
+
+endif
+
+##########################################################################################
+
+ifndef OPENJDK
+ifeq ($(OPENJDK_TARGET_OS), 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, \
+		LIBRARY:=sunwjdga,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
+		LANG:=C, \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
+			-I$(JDK_TOPDIR)/src/share/javavm/export \
+			-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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, \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunwjdga))
+
+BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA)
+
+endif
+endif
+endif
+endif
+
+##########################################################################################
+
+ifeq ($(BUILD_HEADLESS), true)
+ifneq ($(OPENJDK_TARGET_OS), windows)
+
+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) \
+			  $(X_CFLAGS) \
+			  -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
+			  -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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_OPENJDK_TARGET_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 ($(OPENJDK_TARGET_OS), solaris)
+	ifneq ($(ARCH), amd64)
+		LIBAWT_HEADLESS_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/reorder-$(ARCH)
+	endif
+endif
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS,\
+		LIBRARY:=awt_headless,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(LIBAWT_HEADLESS_DIRS),\
+		INCLUDE_FILES:=$(LIBAWT_HEADLESS_FILES),\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(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),\
+		LDFLAGS_SUFFIX_macosx:=$(LIBCXX), \
+		LDFLAGS_SUFFIX_solaris:=$(LIBCXX), \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_headless))
+
+$(BUILD_LIBAWT_HEADLESS) : $(BUILD_LIBAWT)
+
+BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
+
+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 \
+        $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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 \
+ifeq ($(OPENJDK_TARGET_OS), 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_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 ($(OPENJDK_TARGET_OS), windows)
 	LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
 else
 	LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 endif
 
-LIBSPLASHSCREEN_FILES := \
+LIBSPLASHSCREEN_FILES:=\
 	java_awt_SplashScreen.c \
 	splashscreen_gfx_impl.c \
 	splashscreen_gif.c \
@@ -2033,14 +2420,14 @@
 	jfdctfst.c \
 	jfdctint.c
 
-ifneq ($(PLATFORM), macosx)
+ifneq ($(OPENJDK_TARGET_OS), 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 :=
+LIBSPLASHSCREEN_LDFLAGS_SUFFIX:=
 
 ifneq ($(USE_EXTERNAL_LIBZ),true)
 	LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
@@ -2063,422 +2450,205 @@
 		zutil.c
 endif
 
-ifeq ($(PLATFORM), macosx)
+ifeq ($(OPENJDK_TARGET_OS), 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
+else ifneq ($(OPENJDK_TARGET_OS), windows)
+	LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(ISA_DIR) -lX11 -lXext $(LIBM) -lpthread
+else # OPENJDK_TARGET_OS
 	LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll
-endif # PLATFORM
+endif # OPENJDK_TARGET_OS
 
 $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\
+		LIBRARY:=splashscreen,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBSPLASHSCREEN_DIRS),\
-		INCLUDE_FILES := $(LIBSPLASHSCREEN_FILES),\
+		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) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB),\
+		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) 
+		LDFLAGS_SUFFIX_linux:=$(LIBDL), \
+		LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ),\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsplashscreen))
+
+BUILD_LIBRARIES += $(LIBSPLASHSCREEN)
+
+ifeq ($(OPENJDK_TARGET_OS),macosx)
+$(LIBSPLASHSCREEN) :  $(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 := \
+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)) \
+LIBDCPR_CFLAGS:=$(foreach dir,$(LIBDCPR_SRC_DIRS),-I$(dir)) \
 	          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR,\
+		LIBRARY:=dcpr,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBDCPR_SRC_DIRS),\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 			$(LIBDCPR_CFLAGS), \
-		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdcpr/mapfile-vers, \
+		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)
+		LDFLAGS_SUFFIX_posix:=-lm,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libdcpr))
+
+$(BUILD_LIBDCPR) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBDCPR)
 
 endif
 
 ##########################################################################################
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC,\
+		LIBRARY:=j2pcsc,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
-                     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/smartcardio,\
+                     $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/security/smartcardio,\
 		LANG:=C,\
-		CFLAGS_posix:= -D__sun_jdk,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		CFLAGS_posix:=-D__sun_jdk,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
                      -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, \
+                     -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/security/smartcardio\
+                     -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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)
+		LDFLAGS_SUFFIX_posix:=$(LIBDL), \
+		LDFLAGS_SUFFIX_windows:=winscard.lib,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2pcsc))
+
+BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC)
 
 ##########################################################################################
 
-ifneq ($(PLATFORM), windows)
+ifneq ($(OPENJDK_TARGET_OS), windows)
 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
+		LIBRARY:=j2gss,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
-                     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/jgss/wrapper,\
+                     $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/security/jgss/wrapper,\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
                      -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, \
+                     -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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)
+		LDFLAGS_SUFFIX:=$(LIBDL), \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2gss))
+
+BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
 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 \
+BUILD_LIBKRB5_NAME:=
+ifeq ($(OPENJDK_TARGET_OS), windows)
+     BUILD_LIBKRB5_NAME:=w2k_lsa_auth
+     BUILD_LIBKRB5_FILES:=NativeCreds.c WindowsDirectory.c
+     BUILD_LIBKRB5_SRC:=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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
+else ifeq ($(OPENJDK_TARGET_OS), 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,\
+		LIBRARY:=$(BUILD_LIBKRB5_NAME),\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
                      $(BUILD_LIBKRB5_SRC) ,\
-		INCLUDE_FILES := $(BUILD_LIBKRB5_FILES),\
+		INCLUDE_FILES:=$(BUILD_LIBKRB5_FILES),\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 		        -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
-                        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/krb5 ,\
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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)
+		LDFLAGS_SUFFIX:=$(BUILD_LIBKRB5_LIBS) ,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libkrb5))
+
+BUILD_LIBRARIES += $(BUILD_LIBKRB5)
 endif
 
 ##########################################################################################
 
-ifeq ($(PLATFORM), windows)
+ifeq ($(OPENJDK_TARGET_OS), windows)
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI,\
+		LIBRARY:=sunmscapi,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/mscapi \
-		     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/mscapi,\
-		INCLUDE_FILES := security.cpp, \
+		     $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/security/mscapi,\
+		INCLUDE_FILES:=security.cpp, \
 		LANG:=C++,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 		        -I$(JDK_TOPDIR)/src/share/native/sun/security/mscapi \
-                        -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/mscapi ,\
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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)
+		LDFLAGS_SUFFIX:=Crypt32.Lib advapi32.lib,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunmscapi))
+
+BUILD_LIBRARIES += $(BUILD_LIBSUNMSCAPI)
 endif
 
 ##########################################################################################
 
-ifneq ($(PLATFORM)-$(ARCH_DATA_MODEL), windows-64)
+ifneq ($(OPENJDK_TARGET_OS)-$(ARCH_DATA_MODEL), windows-64)
 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11,\
+		LIBRARY:=j2pkcs11,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
-                     $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/security/pkcs11 \
+                     $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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,\
+                     $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/security/pkcs11/wrapper,\
 		LANG:=C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 		        -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/$(LEGACY_OPENJDK_TARGET_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, \
+                        -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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)
+		LDFLAGS_SUFFIX_posix:=$(LIBDL), \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2pkcs11))
+
+BUILD_LIBRARIES += $(BUILD_LIBJ2PKCS11)
 endif
 
 ##########################################################################################
@@ -2488,40 +2658,56 @@
 # 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
+BUILD_LIBSUNEC_FLAGS:= -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \
+                       -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl
+
+#
+# On sol-sparc...all libraries are compiled with -xregs=no%appl
+#   (set in CFLAGS_REQUIRED_sparc)
+#
+# except!!! libsunec.so
+#
+ECC_JNI_SOLSPARC_FILTER:=
+ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
+     ECC_JNI_SOLSPARC_FILTER:=-xregs=no%appl
+endif
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC,\
+		LIBRARY:=sunec,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		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, \
+		LANG:=C++, \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB))\
+                        $(BUILD_LIBSUNEC_FLAGS) \
+                        -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B,\
+		CXXFLAGS:=$(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \
+                          $(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)
+		LDFLAGS_SUFFIX:=$(LIBCXX),\
+                LDFLAGS_SUFFIX_solaris:=-lc ,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsunec))
+
+BUILD_LIBRARIES += $(BUILD_LIBSUNEC)
 endif
 
 ##########################################################################################
 
-LIBJSOUND_SRC_DIRS := \
+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 := \
+	$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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 \
@@ -2529,16 +2715,16 @@
 	PlatformMidi.c
 
 # files needed for ports
-LIBJSOUND_PORTFILES := \
+LIBJSOUND_PORTFILES:=\
 	PortMixerProvider.c \
 	PortMixer.c
 
 # files needed for direct audio
-LIBJSOUND_DAUDIOFILES := \
+LIBJSOUND_DAUDIOFILES:=\
 	DirectAudioDeviceProvider.c \
 	DirectAudioDevice.c
 
-ifeq ($(PLATFORM), windows)
+ifeq ($(OPENJDK_TARGET_OS), windows)
 	EXTRA_SOUND_JNI_LIBS += jsoundds
 	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \
                             -DUSE_PLATFORM_MIDI_OUT=TRUE \
@@ -2551,15 +2737,15 @@
 		PLATFORM_API_WinOS_Ports.c
 	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
 	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
-endif # PLATFORM windows
-
-ifeq ($(PLATFORM), linux)
+endif # OPENJDK_TARGET_OS windows
+
+ifeq ($(OPENJDK_TARGET_OS), linux)
 	EXTRA_SOUND_JNI_LIBS += jsoundalsa
 	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
-endif # PLATFORM linux
-
-ifeq ($(PLATFORM), macosx)
-	LIBJSOUND_LANG := C++
+endif # OPENJDK_TARGET_OS linux
+
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+	LIBJSOUND_LANG:=C++
 	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \
                             -DUSE_PORTS=TRUE \
                             -DUSE_DAUDIO=TRUE \
@@ -2576,9 +2762,9 @@
 	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
 	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
 	LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
-endif # PLATFORM macosx
-
-ifeq ($(PLATFORM), solaris)
+endif # OPENJDK_TARGET_OS macosx
+
+ifeq ($(OPENJDK_TARGET_OS), solaris)
 	LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \
                             -DUSE_PORTS=TRUE \
                             -DUSE_DAUDIO=TRUE
@@ -2589,7 +2775,7 @@
 	LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
 	LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
 	LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
-endif # PLATFORM solaris
+endif # OPENJDK_TARGET_OS solaris
 
 
 ifeq ($(JVM_VARIANT_ZERO), true)
@@ -2623,37 +2809,38 @@
 LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND,\
+		LIBRARY:=jsound,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBJSOUND_SRC_DIRS),\
-		INCLUDE_FILES := $(LIBJSOUND_SRC_FILES),\
+		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, \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
+		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $(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_windows:=$(WIN_JAVA_LIB) advapi32.lib winmm.lib,\
 		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_SUFFIX),\
 		LDFLAGS_SUFFIX_solaris:=-lc ,\
-		LDFLAGS_SUFFIX_macosx := -framework CoreAudio -framework CoreFoundation \
+		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)
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsound))
+
+$(BUILD_LIBJSOUND) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJSOUND)
 
 ##########################################################################################
 
 ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)),)
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
+		LIBRARY:=jsoundalsa,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBJSOUND_SRC_DIRS),\
-		INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
+		INCLUDE_FILES:=Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
                                 $(LIBJSOUND_DAUDIOFILES) \
 				PLATFORM_API_LinuxOS_ALSA_CommonUtils.c   \
 				PLATFORM_API_LinuxOS_ALSA_PCM.c     \
@@ -2662,24 +2849,23 @@
 				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) \
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 			$(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, \
+		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)
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundalsa))
+
+$(BUILD_LIBJSOUNDALSA) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJSOUNDALSA)
 
 endif
 
@@ -2688,104 +2874,113 @@
 ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)),)
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS,\
+		LIBRARY:=jsoundds,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBJSOUND_SRC_DIRS),\
-		INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \
+		INCLUDE_FILES:=Utilities.c $(LIBJSOUND_DAUDIOFILES) \
 				PLATFORM_API_WinOS_DirectSound.cpp, \
-		LANG := C++,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		LANG:=C++,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 			$(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)
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundds))
+
+$(BUILD_LIBJSOUNDDS) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJSOUNDDS)
 
 endif
 
 ##########################################################################################
 
-ifeq ($(PLATFORM), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
 ifndef OPENJDK
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO,\
+		LIBRARY:=j2ucrypto,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto,\
-		LANG := C,\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 			-I$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto ,\
-		MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2ucrypto/mapfile-vers, \
+		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)
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2ucrypto))
+
+$(BUILD_LIBJ2UCRYPTO) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBJ2UCRYPTO)
 
 endif
 endif
 
 ##########################################################################################
 
-ifeq ($(PLATFORM), macosx)
-
-LIBAPPLESCRIPTENGINE_FILES := \
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+
+LIBAPPLESCRIPTENGINE_FILES:=\
 	AppleScriptEngine.m \
         AppleScriptExecutionContext.m \
         AS_NS_ConversionUtils.m \
         NS_Java_ConversionUtils.m
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE,\
+		LIBRARY:=AppleScriptEngine,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/macosx/native/apple/applescript,\
-		LANG := C,\
+		LANG:=C,\
 		INCLUDE_FILES:=$(LIBAPPLESCRIPTENGINE_FILES),\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 			-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:= \
+		LDFLAGS_SUFFIX:=$(LDFLAGS_JDKLIB_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)
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libAppleScriptEngine))
+
+$(BUILD_LIBAPPLESCRIPTENGINE) : $(BUILD_LIBJAVA)
+
+BUILD_LIBRARIES += $(BUILD_LIBAPPLESCRIPTENGINE)
 
 endif
 
 ##########################################################################################
 
-ifeq ($(PLATFORM), macosx)
-
-LIBOSXAPP_FILES := \
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+
+LIBOSXAPP_FILES:=\
 	NSApplicationAWT.m \
 	QueuingApplicationDelegate.m \
 	PropertiesUtilities.m \
 	ThreadUtilities.m
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP,\
+		LIBRARY:=osxapp,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/macosx/native/sun/osxapp,\
-		LANG := C,\
+		LANG:=C,\
 		INCLUDE_FILES:=$(LIBOSXAPP_FILES),\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
 			-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 := \
+		LDFLAGS_SUFFIX_macosx:=\
 	-framework Accelerate \
 	-framework ApplicationServices \
 	-framework AudioToolbox \
@@ -2799,18 +2994,17 @@
 	-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)
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosxapp))
+
+BUILD_LIBRARIES += $(BUILD_LIBOSXAPP)
 
 endif
 
 ##########################################################################################
 
-ifeq ($(PLATFORM), macosx)
-
-LIBOSX_FILES := \
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+
+LIBOSX_FILES:=\
     Dispatch.m \
     CFileManager.m \
     KeystoreImpl.m \
@@ -2818,7 +3012,7 @@
     MacOSXPreferencesFile.m \
     SCDynamicStoreConfig.m
 
-LIBOSX_DIRS := \
+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 \
@@ -2826,17 +3020,20 @@
   $(JDK_TOPDIR)/src/macosx/native/apple/launcher
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBOSX,\
+		LIBRARY:=osx,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBOSX_DIRS),\
-		LANG := C,\
+		LANG:=C,\
 		INCLUDE_FILES:=$(LIBOSX_FILES),\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
                         $(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 := \
+		LDFLAGS_SUFFIX_macosx:=\
     -losxapp \
     -framework Cocoa \
     -framework ApplicationServices \
@@ -2846,24 +3043,21 @@
     -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) 
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosx))
+
+BUILD_LIBRARIES += $(BUILD_LIBOSX)
+
+$(BUILD_LIBOSX) : $(BUILD_LIBOSXAPP)
+
+$(BUILD_LIBOSX) : $(BUILD_LIBJAVA)
 
 endif
 
 ##########################################################################################
 
-ifeq ($(PLATFORM), macosx)
-
-LIBAWT_LWAWT_FILES := \
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+
+LIBAWT_LWAWT_FILES:=\
         awt.m \
         ApplicationDelegate.m \
         CFRetainedResource.m \
@@ -2938,7 +3132,7 @@
         CUPSfuncs.c
 
 
-LIBAWT_LWAWT_DIRS := \
+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 \
@@ -2947,10 +3141,13 @@
   $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT,\
+		LIBRARY:=awt_lwawt,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBAWT_LWAWT_DIRS),\
-		LANG := C,\
+		LANG:=C,\
 		INCLUDE_FILES:=$(LIBAWT_LWAWT_FILES),\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
                         $(foreach dir,$(LIBAWT_LWAWT_DIRS),-I$(dir)) \
                         -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
                         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
@@ -2964,7 +3161,7 @@
                         -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks,\
 		LDFLAGS:=$(LDFLAGS_JDKLIB)\
 			 $(call SET_SHARED_LIBRARY_ORIGIN), \
-		LDFLAGS_SUFFIX_macosx := \
+		LDFLAGS_SUFFIX_macosx:=\
 	-lawt -lmlib_image -losxapp $(LDFLAGS_JDKLIB_SUFFIX) $(LIBM) \
 	-framework Accelerate \
 	-framework ApplicationServices \
@@ -2978,30 +3175,25 @@
 	-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) 
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_lwawt))
+
+BUILD_LIBRARIES += $(BUILD_LIBAWT_LWAWT)
+
+$(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBAWT) 
+
+$(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBMLIB_IMAGE)
+
+$(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBOSXAPP)
+
+$(BUILD_LIBAWT_LWAWT) : $(BUILD_LIBJAVA)
 
 endif
 
 ##########################################################################################
 
-ifeq ($(PLATFORM), macosx)
-
-LIBOSXUI_FILES := \
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+
+LIBOSXUI_FILES:=\
         AquaFileView.m \
         AquaLookAndFeel.m \
         AquaNativeResources.m \
@@ -3012,17 +3204,21 @@
         ScreenMenu.m
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI,\
+		LIBRARY:=osxui,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/macosx/native/com/apple/laf,\
-		LANG := C,\
+		LANG:=C,\
 		INCLUDE_FILES:=$(LIBOSXUI_FILES),\
-		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=$(CFLAGS_JDKLIB) \
                         -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 := \
+		LDFLAGS_SUFFIX_macosx:=\
+    $(LDFLAGS_JDKLIB_SUFFIX) \
     -lawt -losxapp -lawt_lwawt \
     -framework Cocoa \
     -framework Carbon \
@@ -3030,27 +3226,54 @@
     -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) 
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libosxui))
+
+BUILD_LIBRARIES += $(BUILD_LIBOSXUI)
+
+$(BUILD_LIBOSXUI) : $(BUILD_LIBAWT) 
+
+$(BUILD_LIBOSXUI) : $(BUILD_LIBOSXAPP)
+
+$(BUILD_LIBOSXUI) : $(BUILD_LIBAWT_LWAWT)
+
+#$(BUILD_LIBOSXUI) : $(BUILD_LIBJAVA)
 
 endif
 
 ##########################################################################################
 
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+
+$(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC,\
+		LIBRARY:=JObjC,\
+                OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
+		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
+                     $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native ,\
+		LANG:=C,\
+		OPTIMIZATION:=LOW, \
+		CFLAGS:=-fpascal-strings \
+                        -fobjc-gc \
+                        -gdwarf-2 \
+                        $(CFLAGS_JDKLIB) \
+                        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+			, \
+		LDFLAGS:=-fpascal-strings \
+                         -fobjc-gc \
+                         -gdwarf-2 \
+                         $(LDFLAGS_JDKLIB)\
+			 $(call SET_SHARED_LIBRARY_ORIGIN), \
+		LDFLAGS_SUFFIX:=-framework Foundation -framework JavaVM \
+                                  -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
+                                  -framework JavaNativeFoundation \
+                                  -lffi, \
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjobjc))
+
+BUILD_LIBRARIES += $(BUILD_LIBJOBJC)
+
+endif
+
+##########################################################################################
+
 all: $(COPY_FILES) $(BUILD_LIBRARIES)
 
 .PHONY: all
--- a/makefiles/CopyFiles.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/CopyFiles.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -25,12 +25,12 @@
 
 INCLUDEDIR = $(JDK_OUTPUTDIR)/include
 
-PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM)
+OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/$(OPENJDK_TARGET_OS)
 
-ifeq ($(PLATFORM), windows)
-     PLATFORM_INCLUDE = $(INCLUDEDIR)/win32
-else ifeq ($(PLATFORM), macosx)
-     PLATFORM_INCLUDE = $(INCLUDEDIR)/darwin
+ifeq ($(OPENJDK_TARGET_OS), windows)
+     OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/win32
+else ifeq ($(OPENJDK_TARGET_OS), macosx)
+     OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/darwin
 endif
 
 #
@@ -42,15 +42,15 @@
 		$(INCLUDEDIR)/jvmticmlr.h		\
 		$(INCLUDEDIR)/classfile_constants.h	\
 		$(INCLUDEDIR)/jawt.h			\
-		$(PLATFORM_INCLUDE)/jni_md.h		\
-		$(PLATFORM_INCLUDE)/jawt_md.h
+		$(OPENJDK_TARGET_OS_INCLUDE)/jni_md.h		\
+		$(OPENJDK_TARGET_OS_INCLUDE)/jawt_md.h
 
 $(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h
 	$(MKDIR) -p $(@D)
 	$(RM) -f $@
 	$(CP) $< $@
 
-$(PLATFORM_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/javavm/export/%.h
+$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/javavm/export/%.h
 	$(MKDIR) -p $(@D)
 	$(RM) -f $@
 	$(CP) $< $@
@@ -83,6 +83,13 @@
 	$(CP) $< $@
 	$(CHMOD) 644 $@
 
+# this file has different permissions...don't know why...
+$(MGMT_LIBDIR)/jmxremote.access: $(MGMT_LIB_SRC)/jmxremote.access
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@
+	$(CP) $< $@
+	$(CHMOD) 644 $@
+
 $(MGMT_LIBDIR)/%: $(MGMT_LIB_SRC)/%
 	$(MKDIR) -p $(@D)
 	$(RM) -f $@
@@ -121,9 +128,13 @@
 #
 # Copy flavormap.properties, cursor.properties and cursors gif files to LIBDIR
 #
-PLATFORM_LIB_SRC = $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib
+ifneq ($(OPENJDK_TARGET_OS), macosx)
+OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/lib
+else
+OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib
+endif
 
-$(LIBDIR)/flavormap.properties: $(PLATFORM_LIB_SRC)/flavormap.properties
+$(LIBDIR)/flavormap.properties: $(OPENJDK_TARGET_OS_LIB_SRC)/flavormap.properties
 	$(MKDIR) -p $(@D)
 	$(RM) -f $@
 	$(CP) $< $@
@@ -131,9 +142,9 @@
 COPY_FILES += $(LIBDIR)/flavormap.properties
 
 CURSORS_DEST_DIR = $(LIBDIR)/images/cursors
-CURSORS_PLATFORM_LIB_SRC = $(PLATFORM_LIB_SRC)/images/cursors
+CURSORS_OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/lib/images/cursors
 
-$(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_PLATFORM_LIB_SRC)/cursors.properties
+$(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_OPENJDK_TARGET_OS_LIB_SRC)/cursors.properties
 	$(MKDIR) -p $(@D)
 	$(RM) -f $@
 	$(CP) $< $@
@@ -141,11 +152,11 @@
 COPY_FILES += $(CURSORS_DEST_DIR)/cursors.properties
 
 CURSORS_LIB_SRC = $(JDK_TOPDIR)/src/share/lib/images/cursors
-ifeq ($(PLATFORM), windows)
+ifeq ($(OPENJDK_TARGET_OS), windows)
 CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/win32_*.gif)
-else # PLATFORM
+else # OPENJDK_TARGET_OS
 CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/motif_*.gif)
-endif # PLATFORM
+endif # OPENJDK_TARGET_OS
 CURSORS_TARGET_FILES =  $(subst $(CURSORS_LIB_SRC),$(CURSORS_DEST_DIR),$(CURSORS_SRC_FILES))
 
 $(CURSORS_DEST_DIR)/%: $(CURSORS_LIB_SRC)/%
@@ -157,7 +168,7 @@
 
 ##########################################################################################
 
-CONTENT_TYPES_SRC=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib
+CONTENT_TYPES_SRC=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/lib
 
 $(LIBDIR)/content-types.properties: $(CONTENT_TYPES_SRC)/content-types.properties
 	$(MKDIR) -p $(@D)
@@ -179,9 +190,9 @@
 
 ##########################################################################################
 
-ifeq ($(PLATFORM),windows)
+ifeq ($(OPENJDK_TARGET_OS),windows)
 
-TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib
+TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/lib
 
 $(LIBDIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
 	$(MKDIR) -p $(@D)
@@ -233,7 +244,7 @@
 #TODO: rework this to avoid hardcoding library name in the makefile
 #
 ifdef OPENJDK
-    ifeq ($(PLATFORM), windows)
+    ifeq ($(OPENJDK_TARGET_OS), windows)
         FREETYPE_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype)
     else 
         ifeq ($(USING_SYSTEM_FT_LIB), false)
@@ -243,7 +254,7 @@
 
     $(FREETYPE_LIB): $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype)
 	$(CP) $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@
-    ifeq ($(BUILD_OS), windows)
+    ifeq ($(OPENJDK_BUILD_OS), windows)
 	$(CHMOD) +rx $@
     endif
 
@@ -254,7 +265,7 @@
 
 # Copy msvcr100.dll on windows
 
-ifeq ($(PLATFORM),windows)
+ifeq ($(OPENJDK_TARGET_OS),windows)
     MSVCRNN_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCRNN_DLL))
     $(MSVCRNN_TARGET): $(MSVCRNN_DLL)
 	$(MKDIR) -p $(@D)
@@ -286,14 +297,14 @@
     JVMCFG_ARCH := $(ARCH)
 endif
 
-ifeq ($(PLATFORM),macosx)
+ifeq ($(OPENJDK_TARGET_OS),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_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/$(JVMCFG_ARCH)/jvm.cfg
   JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)
 endif
 
@@ -353,15 +364,15 @@
 PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security
 PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security
 
-ifeq ($(PLATFORM), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
 	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-solaris
 endif
 
-ifeq ($(PLATFORM), windows)
+ifeq ($(OPENJDK_TARGET_OS), windows)
 	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-windows
 endif
 
-ifeq ($(PLATFORM), macosx)
+ifeq ($(OPENJDK_TARGET_OS), macosx)
 	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-macosx
 endif
 
@@ -453,7 +464,7 @@
 
 COPY_FILES += $(SHARED_FONTS_DST) $(SHARED_FONTS_DST_DIR)/fonts.dir
 
-ifeq ($(PLATFORM), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
 
 # The oblique fonts are only needed/wanted on Linux.
 
@@ -532,11 +543,13 @@
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(CP) $< $@
+	$(CHMOD) 755 $@
 
 $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNW%.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(ARCH)/libjdgaSUNW%.so
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(CP) $< $@
+	$(CHMOD) 755 $@
 
 $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNWafb.so: $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNWffb.so
 	$(MKDIR) -p $(@D)
@@ -549,7 +562,7 @@
 
 ##########################################################################################
 
-ifeq ($(PLATFORM), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
 
 SUNPKCS11_CFG_SRC := $(JDK_TOPDIR)/src/share/lib/security/sunpkcs11-solaris.cfg
 SUNPKCS11_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/sunpkcs11-solaris.cfg
@@ -566,7 +579,7 @@
 ##########################################################################################
 
 ifndef OPENJDK
-ifeq ($(PLATFORM), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
 
 UCRYPTO_CFG_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/ucrypto-solaris.cfg
 UCRYPTO_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/ucrypto-solaris.cfg
--- a/makefiles/CopyIntoClasses.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/CopyIntoClasses.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -133,7 +133,7 @@
   $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.png) \
   $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/sounds/*.wav)
 
-ifneq ($(PLATFORM), windows)
+ifneq ($(OPENJDK_TARGET_OS), 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 += \
@@ -174,11 +174,11 @@
 $(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)
+ALL_META-INF_DIRS_targetapi:=$(shell $(FIND) $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes -type d -a -name META-INF)
 # Platform specific overrides shared
-ifneq ($(ALL_META-INF_DIRS_hostapi),)
-    ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_hostapi) \
-	$(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes%,%,$(ALL_META-INF_DIRS_hostapi)),\
+ifneq ($(ALL_META-INF_DIRS_targetapi),)
+    ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_targetapi) \
+	$(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes%,%,$(ALL_META-INF_DIRS_targetapi)),\
 		$(ALL_META-INF_DIRS_share))
 else
     ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_share)
@@ -189,7 +189,7 @@
 endif
 
 ifndef OPENJDK
-ifneq ($(PLATFORM), macosx)
+ifneq ($(OPENJDK_TARGET_OS), macosx)
     ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/jdbc/odbc/META-INF
 endif
 endif
@@ -216,9 +216,9 @@
 	$(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/*)
+SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/print/services/*)
 OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,\
-	$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/print/services/%,%,\
+	$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/print/services/%,%,\
 		$(SRC_SERVICES_FILES_PRINT)))
 OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :,$(OUT_SERVICES_FILES_PRINT))
 RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON),$(SRC_SERVICES_FILES_PRINT))
@@ -229,7 +229,7 @@
 define addto_meta-inf_services
 $1
 	echo Installing META-INF/services/$$(@F) 
-	$(CAT) $$< | $(SED) -e "s/^#\[$(PLATFORM)\]//" > $$@
+	$(CAT) $$< | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $$@
 endef
 $(foreach i,$(META-INF_RULES_SERVICES),$(eval $(call addto_meta-inf_services,$i)))
 # Here is the generic rule, whose receipt the above rules will trigger.
@@ -261,13 +261,13 @@
 
 COPY_EXTRA += $(foreach F,$(notdir $(JAVAX_SOUND_SRC_FILES)),$(JDK_OUTPUTDIR)/classes/META-INF/services/${F})
 
-ifeq ($(PLATFORM)-$(ARCH),windows-ia64)
+ifeq ($(OPENJDK_TARGET_OS)-$(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)
+else ifeq ($(OPENJDK_TARGET_OS),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)
+else ifeq ($(OPENJDK_TARGET_OS)-$(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
--- a/makefiles/CopySamples.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/CopySamples.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -46,7 +46,7 @@
     SAMPLE_TARGET += $(SAMPLE_CLOSED_TARGET)
 endif
 
-ifneq (, $(filter $(PLATFORM), solaris macosx))
+ifneq (, $(filter $(OPENJDK_TARGET_OS), 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)
@@ -72,4 +72,3 @@
 all: $(COPY_FILES) 
 
 .PHONY: all
-
--- a/makefiles/CreateJars.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/CreateJars.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -32,6 +32,10 @@
 
 include Tools.gmk
 
+#
+# This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
+#
+MAKEFILE=$(JDK_TOPDIR)/makefiles/CreateJars.gmk
 
 MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
 BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest
@@ -46,7 +50,7 @@
 
 $(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,$(JCONSOLE_JAR_DEPS),\
 		SRCS:=$(JDK_OUTPUTDIR)/classes,\
-		SUFFIXES:=.class .gif .png,\
+		SUFFIXES:=.class .gif .png .properties,\
 		INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
 		JARMAIN:=sun.tools.jconsole.JConsole,\
 		JAR:=$(JDK_OUTPUTDIR)/lib/jconsole.jar,\
@@ -242,12 +246,35 @@
 	sun/swing/BeanInfoUtils.class \
 	$(LOCALEDATA_INCLUDES)
 
-ifndef OPENJDK
-ifndef JAVASE_EMBEDDED
+# These files should never be put into rt.jar
+# but due to a misstake...some are put there if embedded
+#
+ifneq ($(JAVASE_EMBEDDED), true)
+# normal (correct) case
 RT_JAR_EXCLUDES += \
 	com/oracle/jrockit/jfr \
 	oracle/jrockit/jfr
+else
+# embedded (broken) case
+RT_JAR_EXCLUDES += \
+  oracle/jrockit/jfr/parser \
+  oracle/jrockit/jfr/tools \
+  oracle/jrockit/jfr/NativeOptions.class \
+  oracle/jrockit/jfr/RepositoryChunkHandler.class
 endif
+
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+        RT_JAR_EXCLUDES += com/sun/nio/sctp \
+                           sun/nio/ch/sctp \
+                           sun/jdbc \
+                           sun/nio/ch/DevPollArrayWrapper\$$$$Updator.class \
+                           sun/nio/ch/DevPollArrayWrapper.class \
+                           sun/nio/ch/DevPollSelectorImpl.class \
+                           sun/nio/ch/DevPollSelectorProvider.class \
+                           sun/nio/ch/EPollArrayWrapper\$$$$Updator.class \
+                           sun/nio/ch/EPollArrayWrapper.class \
+                           sun/nio/ch/EPollSelectorImpl.class \
+                           sun/nio/ch/EPollSelectorProvider.class
 endif
 
 # Find all files in the classes dir to use as dependencies. This could be more fine granular.
@@ -271,12 +298,19 @@
 	       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
 	       $(MAINMANIFEST) >> $@
 
-$(JDK_OUTPUTDIR)/lib/_the.jars.exclude:
+$(JDK_OUTPUTDIR)/lib/_the.jars.exclude: $(MAKEFILE)
 	$(MKDIR) -p $(@D)
 	$(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@)
 
+$(JDK_OUTPUTDIR)/lib/classlist : $(JDK_TOPDIR)/make/tools/sharing/classlist.$(OPENJDK_TARGET_OS) \
+  $(MAKEFILE)
+	$(MKDIR) -p $(@D)
+	$(RM) -f $@.temp
+	$(TOOL_ADDJSUM) $< $@.temp
+	$(MV) $@.temp $@
+
 $(JDK_OUTPUTDIR)/lib/_the.jars.contents: $(BUILD_TOOLS) $(JDK_OUTPUTDIR)/lib/_the.jars.exclude \
-					 $(ALL_FILES_IN_CLASSES)
+					 $(ALL_FILES_IN_CLASSES) $(JDK_OUTPUTDIR)/lib/classlist
 	$(MKDIR) -p $(@D)
 	$(RM) $@.temp
 	($(CD) $(JDK_OUTPUTDIR)/classes && \
@@ -290,17 +324,22 @@
 $(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 > $@
 
+RT_JAR_CREATE_OPTIONS := c0fm
+ifeq ($(COMPRESS_JARS), true)
+    RT_JAR_CREATE_OPTIONS := cfm
+endif
+
 $(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) \
+	    $(JAR) $(RT_JAR_CREATE_OPTIONS) $@ $(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) \
+	    $(JAR) $(RT_JAR_CREATE_OPTIONS) $@ $(RESOURCE_JAR_MANIFEST_FILE) \
 	        @$(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents
 
 JARS+=$(JDK_OUTPUTDIR)/lib/rt.jar $(JDK_OUTPUTDIR)/lib/resources.jar
@@ -309,7 +348,7 @@
 
 CHARSETS_JAR_DEPS :=
 
-ifneq ($(HOST_OS), windows)
+ifneq ($(OPENJDK_TARGET_OS), windows)
     CHARSETS_EXTRA_FILES:=sun/awt/motif/X11GBK.class \
                           sun/awt/motif/X11GB2312\$$$$Decoder.class \
                           sun/awt/motif/X11GB2312.class \
@@ -328,20 +367,22 @@
 			       $(CHARSETS_EXTRA_FILES) \
                                META-INF/services/java.nio.charset.spi.CharsetProvider, \
 		JAR:=$(JDK_OUTPUTDIR)/lib/charsets.jar, \
-		SKIP_METAINF := true))
+		SKIP_METAINF := true, \
+                CHECK_COMPRESS_JAR:=true))
 
 JARS+=$(JDK_OUTPUTDIR)/lib/charsets.jar
 
 ##########################################################################################
 
-ifndef OPENJDK
+ifeq ($(ENABLE_JFR), true)
     $(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)))
+		MANIFEST:=$(MAINMANIFEST), \
+                CHECK_COMPRESS_JAR:=true))
 
     JARS+=$(JDK_OUTPUTDIR)/lib/jfr.jar
 endif
@@ -356,13 +397,14 @@
 			  com/sun/net/ssl/internal/ssl,\
 		JAR:=$(JDK_OUTPUTDIR)/lib/jsse.jar,\
 		SKIP_METAINF:=true,\
-		MANIFEST:=$(MAINMANIFEST)))
+		MANIFEST:=$(MAINMANIFEST), \
+                CHECK_COMPRESS_JAR:=true))
 
 JARS+=$(JDK_OUTPUTDIR)/lib/jsse.jar
 
 ##########################################################################################
 
-ifneq ($(PLATFORM)-$(ARCH_DATA_MODEL),windows-64)
+ifneq ($(OPENJDK_TARGET_OS)-$(ARCH_DATA_MODEL),windows-64)
     SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
 
     ifndef OPENJDK
@@ -544,7 +586,7 @@
 
 ##########################################################################################
 
-ifeq ($(PLATFORM),windows)
+ifeq ($(OPENJDK_TARGET_OS),windows)
 
 SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
 
@@ -574,7 +616,7 @@
 
 ##########################################################################################
 
-ifeq ($(PLATFORM),solaris)
+ifeq ($(OPENJDK_TARGET_OS),solaris)
 ifndef OPENJDK
 
 UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
@@ -661,7 +703,8 @@
 			     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))
+		SKIP_METAINF:=true, \
+                CHECK_COMPRESS_JAR:=true))
 
 JARS+=$(JDK_OUTPUTDIR)/lib/tools.jar
 
@@ -696,6 +739,7 @@
                         com.oracle.nio
 
 $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(JDK_OUTPUTDIR)/lib/rt.jar
+	$(RM) -rf $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
 	$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
 	$(JAVA) \
 		-Xbootclasspath/a:$(JDK_OUTPUTDIR)/classes \
@@ -711,7 +755,8 @@
 $(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))
+		JAR:=$(JDK_OUTPUTDIR)/lib/ct.sym, \
+		CHECK_COMPRESS_JAR:=true))
 
 JARS+=$(JDK_OUTPUTDIR)/lib/ct.sym
 
@@ -765,7 +810,7 @@
 	org/xml/sax			\
 	sunw
 
-SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes
+SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes
 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/impsrc
 SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gendocsrc_rmic
@@ -776,16 +821,16 @@
 # 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*)
+                      $(wildcard $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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/%,\
+		    $(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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/%
+$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/%
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
--- a/makefiles/GendataBreakIterator.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GendataBreakIterator.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -35,10 +35,10 @@
 #
 TEXT_SRCDIR = $(JDK_TOPDIR)/src/share/classes
 TEXT_PKG  = sun/text/resources
-TEXT_SOURCES = 	%$(TEXT_PKG)/BreakIteratorRules.java \
-		%$(TEXT_PKG)/BreakIteratorInfo.java \
-		%$(TEXT_PKG)/BreakIteratorRules_th.java \
-		%$(TEXT_PKG)/BreakIteratorInfo_th.java
+TEXT_SOURCES = 	$(TEXT_PKG)/BreakIteratorRules.java \
+		$(TEXT_PKG)/BreakIteratorInfo.java \
+		$(TEXT_PKG)/BreakIteratorRules_th.java \
+		$(TEXT_PKG)/BreakIteratorInfo_th.java
 
 # Generate BreakIteratorData
 BREAK_ITERATOR_DIR = $(JDK_OUTPUTDIR)/break_iterator
--- a/makefiles/GendataFontConfig.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GendataFontConfig.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -25,13 +25,13 @@
 
 GENDATA_FONT_CONFIG_DST := $(JDK_OUTPUTDIR)/lib
 
-ifeq ($(PLATFORM), windows)
+ifeq ($(OPENJDK_TARGET_OS), 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)
+ifeq ($(OPENJDK_TARGET_OS), linux)
 GENDATA_FONT_CONFIG_SRC_PREFIX := linux.
 ifdef OPENJDK
 GENDATA_FONT_CONFIG_SRC_DIR   := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/fontconfigs
@@ -52,27 +52,29 @@
 endif
 endif
 
-ifeq ($(PLATFORM), solaris)
+ifeq ($(OPENJDK_TARGET_OS), 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)
+ifeq ($(OPENJDK_TARGET_OS), 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
+endif # OPENJDK_TARGET_OS
 
 ###
 
 $(GENDATA_FONT_CONFIG_DST)/%.src : $(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
+	$(CHMOD) 644 $@
 
 $(GENDATA_FONT_CONFIG_DST)/%.bfc : $(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%.properties
 	$(MKDIR) -p $(@D)
 	$(TOOL_COMPILEFONTCONFIG) $< $@
+	$(CHMOD) 444 $@
 
 ###
 
--- a/makefiles/GendataHtml32dtd.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GendataHtml32dtd.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -32,5 +32,4 @@
 	$(RM) $@
 	($(TOOL_DTDBUILDER) html32 > $@) || exit 1
 
-GENDATA_HTML32DTD += $(HTML32DTD)
-
+GENDATA_HTML32DTD += $(HTML32DTD)
\ No newline at end of file
--- a/makefiles/GenerateClasses.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GenerateClasses.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -27,7 +27,13 @@
 
 include $(SPEC)
 include MakeBase.gmk
-include RMICompile.gmk
+include RMICompilation.gmk
+
+# To ensure the latest stub generator files are picked up from corba repo
+# when available, we need to run with latest rmic version available. 
+ifeq ($(CROSS_COMPILE_ARCH),)
+    RMIC := $(UNCYGDRIVE) $(JDK_OUTPUTDIR)/bin/rmic
+endif  
 
 CLASSES_DIR := $(JDK_OUTPUTDIR)/classes
 # NOTE: If the smart javac dependency management is reintroduced, these classes risk 
--- a/makefiles/GenerateData.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GenerateData.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -69,6 +69,7 @@
 	$(RM) $@
 	$(TOOL_GENERATECURRENCYDATA) -o $@.temp < $<
 	$(MV) $@.temp $@
+	$(CHMOD) 444 $@
 
 GENDATA += $(GENDATA_CURDATA)
 
--- a/makefiles/GenerateJavaSources.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GenerateJavaSources.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -65,7 +65,7 @@
 include GensrcExceptions.gmk
 GENSRC += $(GENSRC_EXCEPTIONS)
 
-ifneq ($(HOST_OS),windows)
+ifneq ($(OPENJDK_TARGET_OS),windows)
 include GensrcIcons.gmk
 GENSRC += $(GENSRC_ICONS)
 
@@ -78,6 +78,11 @@
   GENSRC += $(GENSRC_SWING_NIMBUS)
 endif
 
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+     include GensrcJObjC.gmk
+     GENSRC += $(GENSRC_JOBJC)
+endif
+
 $(GENSRC) : $(BUILD_TOOLS)
 
 # The exception handling of swing beaninfo
@@ -100,7 +105,10 @@
 		$(MKDIR) -p gensrc/javax/swing/plaf && \
 		$(CP) -rp gensrc_swing/javax/swing/plaf/* gensrc/javax/swing/plaf) \
 	fi
-ifneq ($(HOST_OS),windows)
+	if [ -d $(JDK_OUTPUTDIR)/gensrc_jobjc ] ; then \
+		(cd $(JDK_OUTPUTDIR) && cp -rp gensrc_jobjc/src/* gensrc) \
+	fi
+ifneq ($(OPENJDK_TARGET_OS),windows)
 	(cd $(JDK_OUTPUTDIR) && \
 		$(CP) -rp gensrc_icons/* gensrc && \
 		$(CP) -rp gensrc_x11wrappers/classes/* gensrc)
--- a/makefiles/GensrcBuffer.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GensrcBuffer.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -198,6 +198,7 @@
 	$(if $(12),$1_$(strip $(12)))
 	$(if $(13),$1_$(strip $(13)))
 	$(if $(14),$1_$(strip $(14)))
+	$(if $(15),$(error Internal makefile error: Too many arguments to SetupGenBuffer, please update GensrcBuffer.gmk))
 
 	$(call fixRw,$1,$$($1_RW))
 	$(call typesAndBits,$1,$$($1_type),$$($1_BO))
--- a/makefiles/GensrcIcons.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GensrcIcons.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -29,7 +29,7 @@
 GENSRC_ICONS_DST := $(GENSRC_ICONS_TMP)/sun/awt/X11
 
 ifdef OPENJDK
-	ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)
+	ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)
 else
 	ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/solaris
 endif
@@ -41,7 +41,7 @@
     $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
 
 
-ICONPATH := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/awt/X11
+ICONPATH := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/awt/X11
 
 GENSRC_ICONS_SRC += \
    $(ICONPATH)/security-icon-bw16.png \
@@ -86,7 +86,7 @@
 	$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
 	$(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
 # TODO FIX FIX FIX
-ifneq ($(PLATFORM),macosx)
+ifneq ($(OPENJDK_TARGET_OS),macosx)
 	$(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp
 endif
 	$(ECHO) "}; }" >> $$@.tmp
@@ -100,7 +100,7 @@
 	$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
 	$(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
 # TODO FIX FIX FIX
-ifneq ($(PLATFORM),macosx)
+ifneq ($(OPENJDK_TARGET_OS),macosx)
 	$(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp
 endif
 	$(ECHO) "}; }" >> $$@.tmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/GensrcJObjC.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -0,0 +1,80 @@
+#
+# 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_JOBJC :=
+
+JOBJC_FRAMEWORKS := Foundation CoreFoundation AppKit
+FRAMEWORKS_DIR := /System/Library/Frameworks
+GBM := /usr/bin/gen_bridge_metadata
+
+JOBJC_SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc
+JOBJC_TMP := $(JDK_OUTPUTDIR)/gensrc_jobjc
+JOBJC_DST := $(JDK_OUTPUTDIR)/gensrc_jobjc/src
+
+#
+# Build generator
+#
+$(eval $(call SetupJavaCompilation,BUILD_JOBJC_PRIMITIVE_CODER,\
+		SETUP:=GENERATE_OLDBYTECODE,\
+		INCLUDES:=core/java \
+                          com/apple,\
+                HEADERS :=$(JOBJC_DST)/jni_headers/core ,\
+		SRC:=$(JOBJC_SRC)/src \
+                     $(JOBJC_SRC)/src/generator/java, \
+		BIN:=$(JOBJC_TMP)/bin))
+
+GENSRC_JOBJC += $(JOBJC_TMP)/bin/_the.batch
+
+#
+# Generate bridge support
+#
+BRIDGESUPPORT := $(addprefix $(JOBJC_TMP)/bridge/,$(addsuffix Full.bridgesupport,$(JOBJC_FRAMEWORKS)))
+
+$(JOBJC_TMP)/bridge/%Full.bridgesupport : $(FRAMEWORKS_DIR)/%.framework/Headers/*.h
+	$(MKDIR) -p $(@D)
+	if [ -f $(FRAMEWORKS_DIR)/$*.framework/Resources/BridgeSupport/$(@F) ]; then \
+		cp $(FRAMEWORKS_DIR)/$*.framework/Resources/BridgeSupport/$(@F) $@ ;\
+	else \
+		$(GBM) -F complete --framework $* -o $@ ; \
+	fi
+
+#
+# Find Xbootclasspath
+#
+$(JOBJC_TMP)/_the.generator_bootclasspath : $(JOBJC_TMP)/bin/_the.batch
+	$(JAVA) -cp $(JOBJC_TMP)/bin com.apple.internal.jobjc.generator.BootClassPathMinus JObjC.jar > $@.tmp
+	$(MV) $@.tmp $@
+
+
+#
+# Run generator
+#
+TOOL_JOBJC := $(JAVA) -cp $(JOBJC_TMP)/bin -ea com.apple.internal.jobjc.generator.Generator
+
+$(JOBJC_TMP)/_the.generator : $(JOBJC_TMP)/bin/_the.batch $(JOBJC_TMP)/_the.generator_bootclasspath $(BRIDGESUPPORT)
+	$(JAVA) -d64 -Xbootclasspath:`$(CAT) $(JOBJC_TMP)/_the.generator_bootclasspath` -cp $(JOBJC_TMP)/bin -ea com.apple.internal.jobjc.generator.Generator dst=$(JOBJC_DST) frameworks=$(JOBJC_TMP)/bridge
+	$(TOUCH) $@
+
+GENSRC_JOBJC += $(JOBJC_TMP)/_the.generator
--- a/makefiles/GensrcMisc.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GensrcMisc.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -53,9 +53,9 @@
 
 ##########################################################################################
 
-ifeq ($(HOST_OS_API),posix)
-    UPSUFFIX:=$(PLATFORM)
-    ifeq ($(PLATFORM),macosx)
+ifeq ($(OPENJDK_TARGET_OS_API),posix)
+    UPSUFFIX:=$(OPENJDK_TARGET_OS)
+    ifeq ($(OPENJDK_TARGET_OS),macosx)
         UPSUFFIX:=bsd
     endif
     # UNIXProcess.java is different for solaris and linux. We need to copy
@@ -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.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java
 	$(CP) $< $@
 	$(CHMOD) u+rw $@
 
@@ -74,8 +74,8 @@
 ##########################################################################################
 
 ifndef OPENJDK
-ifneq ($(PLATFORM), windows)
-ifneq ($(PLATFORM), macosx)
+ifneq ($(OPENJDK_TARGET_OS), windows)
+ifneq ($(OPENJDK_TARGET_OS), macosx)
     # These file(s) are needed for building fake .so libs on !windows for jdbcodbc
 
     $(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc1.c : 
@@ -101,85 +101,98 @@
 
 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)
+GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genSocketOptionRegistry
 
 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)))
+		CC:=$(HOST_CC),\
+		LDEXE:=$(HOST_LD),\
+		OBJECT_DIR:=$(GENSRC_SOR_BIN),\
+		OUTPUT_DIR:=$(GENSRC_SOR_BIN),\
+                PROGRAM:=genSocketOptionRegistry))
+
+ifneq ($(JAVASE_EMBEDDED), true)
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SOR_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
+	$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+else
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+endif
 
 ##########################################################################################
 
-ifneq ($(PLATFORM),windows)
+ifneq ($(OPENJDK_TARGET_OS),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 := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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)
+GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genUnixConstants
 
 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)))
+		CC:=$(HOST_CC),\
+		LDEXE:=$(HOST_CC),\
+		OBJECT_DIR:=$(GENSRC_UC_BIN),\
+                OUTPUT_DIR:=$(GENSRC_UC_BIN),\
+		PROGRAM:=genUnixConstants))
+
+ifneq ($(JAVASE_EMBEDDED), true)
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
+	$(BUILD_GENSRC_UC_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+else
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
+	$(MKDIR) -p $(@D)
+	$(CP) $< $@
+endif
 
 endif
 
 ##########################################################################################
 
-ifeq ($(PLATFORM),solaris)
+ifeq ($(OPENJDK_TARGET_OS),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 := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_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)
+GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genSolarisConstants
 
 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)))
+		CC:=$(HOST_CC),\
+		LDEXE:=$(HOST_CC),\
+		OBJECT_DIR:=$(GENSRC_SOL_BIN),\
+		OUTPUT_DIR:=$(GENSRC_SOL_BIN),\
+		PROGRAM:=genSolarisConstants))
+
+$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EXE)
+	$(MKDIR) -p $(@D)
+	NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
+	$(BUILD_GENSRC_SOL_EXE) >> $@.tmp
+	$(MV) $@.tmp $@
+
 
 endif
--- a/makefiles/GensrcProperties.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GensrcProperties.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -46,7 +46,7 @@
 
   # Strip away prefix and suffix,
   # leaving for example: sun/util/resources/CurrencyNames_sv
-  $1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/%.properties,%,\
+  $1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/%.properties,%,\
                 $$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties,%,$2))
 
   # Apply optional name transformation, example: hz_TW -> hz_HK
@@ -75,7 +75,7 @@
 
   # Strip away prefix and suffix,
   # leaving for example: sun/util/resources/CurrencyNames_sv
-  $1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/%.properties,%,\
+  $1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/%.properties,%,\
                 $$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties,%,$2))
 
   # Apply optional name transformation, example: hz_TW -> hz_HK
@@ -124,7 +124,7 @@
 $(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)
+ifneq ($(OPENJDK_TARGET_OS), 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"),\
@@ -264,6 +264,10 @@
 $(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\
 	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources -name "javac.properties")))
 
+#sun/tools/jconsole/resources
+$(eval $(call add_properties_to_clean,SUN_TOOLS_JCONSOLE,\
+	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources -name "*.properties")))
+
 #sun/tools/serialver
 $(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\
 	$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/serialver -name "*.properties"),,,resources))
--- a/makefiles/GensrcX11Wrappers.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/GensrcX11Wrappers.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -30,10 +30,10 @@
 
 GENSRC_SIZES :=
 
-ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
+ifeq ($(OPENJDK_TARGET_OS)-$(LIBARCH), solaris-i386)
 GENSRC_SIZES := sizes.32 sizes.64
-else ifeq ($(PLATFORM), solaris)
-isalist:=$(shell $(ISAINFO))
+else ifeq ($(OPENJDK_TARGET_OS), 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
@@ -46,7 +46,7 @@
 endif # amd64
 endif # sparcv9
 else # !solaris
-ifeq ($(PLATFORM), macosx)
+ifeq ($(OPENJDK_TARGET_OS), macosx)
 GENSRC_SIZES := sizes.32 sizes.64
 else # !macosx
 GENSRC_SIZES := sizes.$(ARCH_DATA_MODEL)
@@ -62,18 +62,23 @@
 	$(TOOL_WRAPPERGENERATOR) $(@D) $< "sizer" $*
 
 $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c
-	(cd $(@D) && $(CC) -m$* -o $@ $< $(CFLAGS_JDKLIB) \
+	(cd $(@D) && $(HOST_CC) -m$* -o $@ $< \
+              -I$(JDK_OUTPUTDIR)/include \
+              -I$(JDK_TOPDIR)/src/share/javavm/export \
+              -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/javavm/export \
+              -I$(JDK_TOPDIR)//src/share/native/common \
+              -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/common \
               -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)
+ifeq ($(OPENJDK_TARGET_OS)-$(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)
+$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 : $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/awt/X11/generator/sizes.64-$(OPENJDK_TARGET_OS)-$(LIBARCH)
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 else
@@ -88,9 +93,9 @@
 	$(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
+ifeq ($(OPENJDK_TARGET_OS)-$(LIBARCH), solaris-amd64)
+	$(ECHO) COMPARING $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 and $(GENSRC_SIZER_SRC)/sizes.64-$(OPENJDK_TARGET_OS)-i386
+	$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 $(GENSRC_SIZER_SRC)/sizes.64-$(OPENJDK_TARGET_OS)-i386
 endif
 	$(TOUCH) $@
 
--- a/makefiles/Images.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/Images.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -34,15 +34,20 @@
 
 images: jre-image jdk-image
 
-ifeq ($(HOST_OS),solaris)
+ifeq ($(OPENJDK_TARGET_OS),solaris)
 define install-file
 	$(MKDIR) -p $(@D)
-	$(CP) -r -P '$<' '$(@D)'
+	$(CP) -f -r -P '$<' '$(@D)'
+endef
+else ifeq ($(OPENJDK_TARGET_OS),macosx)
+define install-file
+	$(MKDIR) -p $(@D)
+	$(CP) -fpRP '$<' '$@'
 endef
 else
 define install-file
 	$(MKDIR) -p $(@D)
-	$(CP) -P '$<' '$@'
+	$(CP) -fP '$<' '$@'
 endef
 endif
 
@@ -67,7 +72,7 @@
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(install-file)
 
-NOT_JRE_BIN_FILES = \
+NOT_JRE_BIN_FILES := \
 	appletviewer$(EXE_SUFFIX) \
 	extcheck$(EXE_SUFFIX) \
 	idlj$(EXE_SUFFIX) \
@@ -107,7 +112,12 @@
 
 # Find all files in bin dir
 ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f)
-ifeq ($(HOST_OS),windows)
+
+# For unknown reason the debuginfo files for binaries are not put into images
+# e.g filter them out
+ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
+
+ifeq ($(OPENJDK_TARGET_OS),windows)
     JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
 else
     JDK_BIN_LIST := $(ALL_BIN_LIST)
@@ -147,7 +157,7 @@
 	ct.sym
 
 JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
-ifeq ($(HOST_OS), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
     JDK_LIB_FILES += jexec
 endif
 
@@ -236,14 +246,21 @@
         wsimport.1         \
         xjc.1
 
-ifeq ($(HOST_OS), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
     MAN_SRC_DIR:=$(JDK_TOPDIR)/src/linux/doc
     MAN1_SUBDIR:=man
 endif
-ifeq ($(HOST_OS), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
     MAN_SRC_DIR:=$(JDK_TOPDIR)/src/solaris/doc
     MAN1_SUBDIR:=sun/man/man1
 endif
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+    MAN_SRC_DIR:=$(JDK_TOPDIR)/src/bsd/doc
+    MAN1_SUBDIR:=man
+    JDK_MAN_PAGES := $(filter-out jcmd.1, $(JDK_MAN_PAGES))
+    JDK_MAN_PAGES := $(filter-out jvisualvm.1, $(JDK_MAN_PAGES))
+endif
+
 
 $(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
@@ -286,7 +303,7 @@
 	$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(call install-ja-manpage,PCK)
 
-ifeq ($(HOST_OS), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
     $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
 	$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(install-file)
@@ -302,7 +319,7 @@
 	$(MKDIR) -p $(@D)
 	$(TOUCH) $@
 
-ifeq ($(HOST_OS), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
     $(JRE_IMAGE_DIR)/man/ja:
 	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
@@ -312,7 +329,17 @@
 	$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
 endif
 
-ifeq ($(HOST_OS), linux)
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+    $(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 ($(OPENJDK_TARGET_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
@@ -322,7 +349,7 @@
 			 $(JDK_IMAGE_DIR)/man/ja
 endif
 
-ifeq ($(HOST_OS), solaris)
+ifeq ($(OPENJDK_TARGET_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)) \
@@ -334,6 +361,16 @@
 			 $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES))
 endif
 
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+    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
+
 ################################################################################
 # /demo dir
 
@@ -383,6 +420,7 @@
     $(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html
 	$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
 	$(install-file)
+	$(CHMOD) 644 $(@)
 
     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*")) \
@@ -411,7 +449,7 @@
 else
     JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
     JDK_DOC_FILES := COPYRIGHT README.html  LICENSE THIRDPARTYLICENSEREADME.txt
-    ifeq ($(HOST_OS), windows)
+    ifeq ($(OPENJDK_TARGET_OS), windows)
         JRE_DOC_FILES += README.txt
     else
         JRE_DOC_FILES += README
@@ -432,32 +470,39 @@
 $(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(install-file)
+	$(CHMOD) 444 $(@)
 
 $(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(install-file)
+	$(CHMOD) 444 $(@)
 
 $(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
+	$(CHMOD) 444 $(@)
 
 $(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@
+	$(CHMOD) 444 $(@)
 
 $(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(install-file)
+	$(CHMOD) 444 $(@)
 
 $(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(install-file)
+	$(CHMOD) 444 $(@)
 
 $(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(install-file)
+	$(CHMOD) 444 $(@)
 
 JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
 JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
@@ -500,7 +545,7 @@
 # Post processing (strip etc)
 
 ifneq ($(POST_STRIP_CMD),)
-    ifeq ($(HOST_OS), windows)
+    ifeq ($(OPENJDK_TARGET_OS), windows)
         EXEC_LIST:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \
 		-o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)")
     else
@@ -510,17 +555,43 @@
 		| $(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,\
+    JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped,\
 			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
 
+    JDK_JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
+                        $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
+			$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
+
+    JDK_BIN_EXEC_TOUCH_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
+                          $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
+                          $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))
+
     # Setup a rule for stripping files based on touch files
-    $(IMAGES_OUTPUTDIR)/_strip/%.stripped: $(JRE_IMAGE_DIR)/%
+    $(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped: $(JRE_IMAGE_DIR)/%
 	$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
 	$(CHMOD) u+w $<
 	$(POST_STRIP_CMD) $<
 	$(CHMOD) go-w $<
 	$(MKDIR) -p $(@D)
 	$(TOUCH) $@
+
+    $(IMAGES_OUTPUTDIR)/_strip_jdk/bin/%.stripped: $(JDK_IMAGE_DIR)/bin/%
+	$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
+	$(CHMOD) u+w $<
+	$(POST_STRIP_CMD) $<
+	$(CHMOD) go-w $<
+	$(MKDIR) -p $(@D)
+	$(TOUCH) $@
+
+    # Setup a rule for stripping files based on touch files
+    $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped: $(JDK_IMAGE_DIR)/jre/%
+	$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
+	$(CHMOD) u+w $<
+	$(POST_STRIP_CMD) $<
+	$(CHMOD) go-w $<
+	$(MKDIR) -p $(@D)
+	$(TOUCH) $@
+
 endif
 
 ################################################################################
@@ -538,7 +609,8 @@
 	$(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
+	$(JDK_INFO_FILE) $(JDK_JRE_EXEC_TOUCH_LIST) $(JDK_BIN_EXEC_TOUCH_LIST) \
+        $(JDK_IMAGE_DIR)/src.zip
 
 ################################################################################
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/Import.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -0,0 +1,243 @@
+#
+# 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.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+
+#######
+
+IMPORT_TARGET_FILES :=
+
+IMPORT_CLASSES := CORBA JAXP JAXWS LANGTOOLS
+IMPORT_SOURCES := CORBA JAXP JAXWS LANGTOOLS
+# Only Corba has binaries
+IMPORT_BINARIES := CORBA
+
+#######
+
+# Put the libraries here. Different locations for different target apis.
+ifeq ($(OPENJDK_TARGET_OS_API),posix)
+    ifneq ($(OPENJDK_TARGET_OS),macosx)
+        INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib/$(LIBARCH)
+    else
+        INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib
+    endif
+    HOTSPOT_LIB_DIR:=$(HOTSPOT_DIST)/jre/lib/$(LIBARCH)
+else
+    INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/bin
+    HOTSPOT_LIB_DIR:=$(HOTSPOT_DIST)/jre/bin
+endif
+
+#######
+
+#
+# jar xf/unzip fails when executing them all in parallel
+#   introduce artificial dependency (_DEP) buuhhh 
+
+define ImportClasses
+$1_CLASSES_DEP := $$(IMPORT_TARGET_CLASSES)
+IMPORT_TARGET_CLASSES += $(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported
+
+$(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported : $$($1_DIST)/lib/classes.jar $$($1_CLASSES_DEP)
+	$(ECHO) Importing $1 classes.jar
+	$(MKDIR) -p $$(@D)
+	($(CD) $$(@D) && $(JAR) xvf $$< > $$@.tmp)
+	$(MV) $$@.tmp $$@
+endef
+
+define ImportSources
+$1_SOURCES_DEP := $$(IMPORT_TARGET_SOURCES)
+IMPORT_TARGET_SOURCES += $(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported
+
+$(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported : $$($1_DIST)/lib/src.zip $$($1_SOURCES_DEP)
+	$(ECHO) Importing $1 src.zip
+	$(MKDIR) -p $$(@D)
+	($(CD) $$(@D) && $(JAR) xvf $$< > $$@.tmp)
+	$(MV) $$@.tmp $$@
+endef
+
+define ImportBinaries
+$1_BINARIES_DEP := $$(IMPORT_TARGET_BINARIES)
+IMPORT_TARGET_BINARIES += $(JDK_OUTPUTDIR)/_the.$1.binaries.imported
+
+$(JDK_OUTPUTDIR)/_the.$1.binaries.imported : $$($1_DIST)/lib/bin.zip $$($1_BINARIES_DEP)
+	$(ECHO) Importing $1 bin.zip
+	$(MKDIR) -p $$(@D)
+	($(CD) $$(@D) && $(JAR) xvf $$< > $$@.tmp)
+	$(MV) $$@.tmp $$@
+endef
+
+#######
+
+$(foreach I,$(IMPORT_CLASSES), $(eval $(call ImportClasses,$I)))
+$(foreach I,$(IMPORT_SOURCES), $(eval $(call ImportSources,$I)))
+$(foreach I,$(IMPORT_BINARIES), $(eval $(call ImportBinaries,$I)))
+
+IMPORT_TARGET_FILES += $(IMPORT_TARGET_CLASSES) $(IMPORT_TARGET_SOURCES) $(IMPORT_TARGET_BINARIES)
+
+#######
+
+ifeq ($(OPENJDK_TARGET_OS),solaris)
+define do-install-file
+	$(MKDIR) -p $$(@D)
+	$(CP) -r -P '$$<' '$$(@D)'
+endef
+else ifeq ($(OPENJDK_TARGET_OS),macosx)
+define do-install-file
+	$(MKDIR) -p $$(@D)
+	$(CP) -pRP '$$<' '$$@'
+endef
+else
+define do-install-file
+	$(MKDIR) -p $$(@D)
+	$(CP) -P '$$<' '$$@'
+endef
+endif
+
+define CopyDir
+        $1_SRC_FILES := $(shell $(FIND) $2 -type f)
+        $1_DST_FILES := $$(patsubst $2/%,$3/%,$$($1_SRC_FILES))
+        IMPORT_TARGET_FILES += $$($1_DST_FILES)
+$3/% : $2/%
+	$(ECHO) Copying $$(@F)
+	$(do-install-file)
+endef
+
+#######
+
+#
+# Import hotspot
+#
+
+$(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE)))
+$(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib))
+
+JSIG_DEBUGINFO := $(wildcard $(HOTSPOT_DIST)/jre/lib/$(LIBARCH)/libjsig.debuginfo) \
+                  $(wildcard $(HOTSPOT_DIST)/jre/lib/$(LIBARCH)/libjsig.diz)
+
+ifneq ($(OPENJDK_TARGET_OS), windows)
+    ifeq ($(JVM_VARIANT_SERVER), true)
+        IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
+        ifneq (,$(JSIG_DEBUGINFO))
+            IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
+        endif
+    endif
+    ifeq ($(JVM_VARIANT_CLIENT), true)
+        IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
+        ifneq (,$(JSIG_DEBUGINFO))
+            IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
+        endif
+    endif
+endif
+
+$(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
+	$(RM) -f $@
+	$(LN) -s ../$(@F) $@
+
+$(INSTALL_LIBRARIES_HERE)/server/%.debuginfo : $(INSTALL_LIBRARIES_HERE)/%.debuginfo
+	$(RM) -f $@
+	$(LN) -s ../$(@F) $@
+
+$(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
+	$(RM) -f $@
+ifeq (REALLY_WEIRD,1)
+	$(LN) -s ../$(@F) $@
+else
+#
+# TODO: Check if this is what they really want...a zip containing a symlink
+#
+	$(RM) -f $(basename $@).debuginfo
+	$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
+	$(ZIP) -q -y $@ $(basename $@).debuginfo
+	$(RM) -f $(basename $@).debuginfo
+endif
+
+$(INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
+	$(RM) -f $@
+	$(LN) -s ../$(@F) $@
+
+$(INSTALL_LIBRARIES_HERE)/client/%.debuginfo : $(INSTALL_LIBRARIES_HERE)/%.debuginfo
+	$(RM) -f $@
+	$(LN) -s ../$(@F) $@
+
+$(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
+	$(RM) -f $@
+ifeq (REALLY_WEIRD,1)
+	$(LN) -s ../$(@F) $@
+else
+#
+# TODO: Check if this is what they really want...a zip containing a symlink
+#
+	$(RM) -f $(basename $@).debuginfo
+	$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
+	$(ZIP) -q -y $@ $(basename $@).debuginfo
+	$(RM) -f $(basename $@).debuginfo
+endif
+
+#######
+
+ifeq ($(OPENJDK_TARGET_OS),solaris)
+define install-file
+	$(MKDIR) -p $(@D)
+	$(CP) -r -P '$<' '$(@D)'
+endef
+else ifeq ($(OPENJDK_TARGET_OS),macosx)
+define install-file
+	$(MKDIR) -p $(@D)
+	$(CP) -pRP '$<' '$@'
+endef
+else
+define install-file
+	$(MKDIR) -p $(@D)
+	$(CP) -P '$<' '$@'
+endef
+endif
+
+ifndef OPENJDK
+
+IMPORT_TARGET_FILES += \
+            $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar \
+            $(JDK_OUTPUTDIR)/lib/security/local_policy.jar \
+            $(JDK_OUTPUTDIR)/lib/jce.jar
+
+$(JDK_OUTPUTDIR)/lib/jce.jar : $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
+	$(ECHO) Copying $(@F)
+	$(install-file)
+
+$(JDK_OUTPUTDIR)/lib/security/local_policy.jar: $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
+	$(ECHO) Copying $(@F)
+	$(install-file)
+
+$(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar: $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
+	$(ECHO) Copying $(@F)
+	$(install-file)
+
+endif # OPENJDK
+
+#######
+
+all: $(IMPORT_TARGET_FILES)
--- a/makefiles/LegacyMakefiles.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#
-# 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
-
-all: $(JDK_OUTPUTDIR)/_the.legacy_make
-
-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)
-
-$(JDK_OUTPUTDIR)/_the.legacy_make: $(DEPS)
-	(echo Building single threaded Java subdir && \
-        $(MAKE) -j1 -C java all && \
-	touch $@)
-
-.PHONY: all
-
--- a/makefiles/Makefile	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/Makefile	Wed Jul 11 16:02:18 2012 -0700
@@ -38,21 +38,21 @@
 include Tools.gmk
 
 all: $(BUILD_TOOLS)
+#       Import (corba jaxp jaxws langtools hotspot)
+	+$(MAKE) -f Import.gmk
+#
 	+$(MAKE) -f GenerateJavaSources.gmk
-#       Drop back to the old makefiles for
-#       packages/libs that have not yet been converted.
-	+$(MAKE) -f LegacyMakefiles.gmk
 #       Ok, now gensrc is fully populated.
 	+$(MAKE) -f GenerateData.gmk
 	+$(MAKE) -f CompileJavaClasses.gmk
-#	The classes have been built, now generate
-#	classes that have other sources.
-	+$(MAKE) -f GenerateClasses.gmk
 #       The classes are now built and
 #       any javah files have now been generated.
 	+$(MAKE) -f CompileNativeLibraries.gmk
 #       Finally compile the launchers.
 	+$(MAKE) -f CompileLaunchers.gmk
+#	Generate classes that have other sources. Needs
+#       to execute launchers.
+	+$(MAKE) -f GenerateClasses.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.
@@ -64,16 +64,11 @@
 	+$(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 installed.
 images:
 	+$(MAKE) -f CreateJars.gmk
-	+$(MAKE) $(IMAGES_MAKE_ARGS) -f Images.gmk 
+	+$(MAKE) -f Images.gmk 
 
 
 BINARIES:=$(shell if test -d $(IMAGES_OUTPUTDIR)/j2sdk-image/bin; then cd $(IMAGES_OUTPUTDIR)/j2sdk-image/bin && $(LS) ; fi)
@@ -90,9 +85,4 @@
 	$(RM) $(addprefix $(INSTALL_PREFIX)/bin/,$(BINARIES))
 	$(foreach b,$(BINARIES),$(LN) -s $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/bin/$b $(INSTALL_PREFIX)/bin/$b &&) true
 
-# Create the deb,rpm,tgz,zip, packages.
-packages: images
-	echo Creating packages...well, in the future.
-	$(MKDIR) -p $(OUTPUT_ROOT)/packages
-
 .PHONY: all install images
--- a/makefiles/OldImages.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-#
-# 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/Tools.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ b/makefiles/Tools.gmk	Wed Jul 11 16:02:18 2012 -0700
@@ -123,3 +123,27 @@
 
 TOOL_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
 	sun.awt.X11.ToBin
+
+##########################################################################################
+
+# Tools needed on solaris because OBJCOPY is broken.
+
+$(eval $(call SetupNativeCompilation,ADD_GNU_DEBUGLINK,\
+		SRC:=$(JDK_TOPDIR)/make/tools/add_gnu_debuglink,\
+		LANG:=C,\
+		CC:=$(HOST_CC),\
+		LDEXE:=$(HOST_LD),\
+		LDFLAGS:=-lelf,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/add_gnu_debuglink,\
+		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/btbin,\
+                PROGRAM:=add_gnu_debuglink))
+
+$(eval $(call SetupNativeCompilation,FIX_EMPTY_SEC_HDR_FLAGS,\
+		SRC:=$(JDK_TOPDIR)/make/tools/fix_empty_sec_hdr_flags,\
+		LANG:=C,\
+		CC:=$(HOST_CC),\
+		LDEXE:=$(HOST_LD),\
+		LDFLAGS:=-lelf,\
+		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags,\
+		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/btbin,\
+                PROGRAM:=fix_empty_sec_hdr_flags))
--- a/makefiles/com/sun/crypto/provider/Makefile	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,275 +0,0 @@
-#
-# Copyright (c) 2007, 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 sunjce_provider.jar.
-#
-# This file was derived from make/javax/crypto/Makefile.
-#
-
-#
-# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds
-# respectively.)
-#
-# JCE builds are very different between OpenJDK and JDK.  The OpenJDK JCE
-# jar files do not require signing, but those for JDK do.  If an unsigned
-# jar file is installed into JDK, things will break when the crypto
-# routines are called.
-#
-# This Makefile does the "real" build of the JCE files.  There are some
-# javac options currently specific to JCE, so we recompile now to make
-# sure any implicit compilations didn't use any incorrect flags.
-#
-# For OpenJDK, the jar files built here are installed directly into the
-# OpenJDK.
-#
-# For JDK, the binaries use pre-built/pre-signed binary files stored in
-# the closed workspace that are not shipped in the OpenJDK workspaces.
-# We still build the JDK files here to verify the files compile, and in
-# preparation for possible signing.  Developers working on JCE in JDK
-# must sign the JCE files before testing.  The JCE signing key is kept
-# separate from the JDK workspace to prevent its disclosure.
-# 
-# SPECIAL NOTE TO JCE/JDK developers:  The source files must eventually
-# be built and signed, and the resulting jar files MUST BE CHECKED INTO
-# THE CLOSED PART OF THE WORKSPACE*.  This separate step *MUST NOT BE
-# FORGOTTEN*, otherwise a bug fixed in the source code will not be
-# reflected in the shipped binaries.  The "release" target should be
-# used to generate the required files.
-#
-# There are a number of targets to help both JDK/OpenJDK developers.
-#
-# Main Targets (JDK/OPENJDK):
-#
-#     all/clobber/clean        The usual.
-#                                  If OpenJDK, installs sunjce_provider.jar.
-#                                  If JDK, installs prebuilt
-#                                      sunjce_provider.jar.
-#
-#     jar                      Builds/installs sunjce_provider.jar
-#                                  If OpenJDK, does not sign.
-#                                  If JDK, tries to sign.
-#
-# Other lesser-used Targets (JDK/OPENJDK):
-#
-#     build-jar                Builds sunjce_provider.jar
-#                                  (does not sign/install)
-#
-#     install-jar              Alias for "jar" above.
-#
-# Other targets (JDK only):
-#
-#     sign                     Alias for sign-jar
-#         sign-jar             Builds/signs sunjce_provider.jar (no install)
-#
-#     release                  Builds all targets in preparation
-#                              for workspace integration.
-#
-#     install-prebuilt         Installs the pre-built jar files
-#
-# This makefile was written to support parallel target execution.
-#
-
-BUILDDIR = ../../../..
-PACKAGE = com.sun.crypto.provider
-PRODUCT = sun
-
-#
-# The following is for when we need to do postprocessing
-# (signing) against a read-only build.  If the OUTPUTDIR
-# isn't writable, the build currently crashes out.
-#
-ifndef OPENJDK
-  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
-endif
-
-JAVAC_MAX_WARNINGS = false
-JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
-JAVAC_WARNINGS_FATAL = true
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Location for the newly built classfiles.
-#
-CLASSDESTDIR = $(TEMPDIR)/classes
-
-#
-# Subdirectories of these are automatically included.
-#
-AUTO_FILES_JAVA_DIRS = \
-    com/sun/crypto/provider
-
-include $(BUILDDIR)/common/Classes.gmk
-
-#
-# Rules
-#
-
-#
-# Some licensees do not get the security sources, but we still need to
-# be able to build "all" for them.  Check here to see if the sources were
-# available.  If not, then we don't need to continue this rule.
-#
-
-ifdef OPENJDK
-all: build-jar install-jar
-else  # OPENJDK
-ifeq ($(strip $(FILES_java)),)
-all: install-prebuilt
-	$(no-source-warning)
-else  # FILES_java available
-all: build-jar install-prebuilt
-	$(build-warning)
-endif # $(FILES_java) available
-endif # OPENJDK
-
-#
-# We use a variety of subdirectories in the $(TEMPDIR) depending on what
-# part of the build we're doing.  Both OPENJDK/JDK builds are initially
-# done in the unsigned area.  When files are signed in JDK, they will be
-# placed in the appropriate areas.
-#
-UNSIGNED_DIR = $(TEMPDIR)/unsigned
-
-include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
-
-
-# =====================================================
-# Build the unsigned sunjce_provider.jar file.
-#
-
-JAR_DESTFILE = $(EXTDIR)/sunjce_provider.jar
-
-#
-# The sunjce_provider.jar needs to be in the extension class directory,
-# therefore none of its classes should appear in $(CLASSBINDIR).
-# Currently no one is using any of the SunJCE 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)/sunjce_provider.jar
-
-#
-# Build sunjce_provider.jar.
-#
-$(UNSIGNED_DIR)/sunjce_provider.jar: build $(JCE_MANIFEST_FILE)
-	$(prep-target)
-	$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ $(JAR_DIRS) \
-	    $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
-
-
-ifndef OPENJDK
-# =====================================================
-# Sign the provider jar file.  Not needed for OpenJDK.
-#
-
-SIGNED_DIR = $(JCE_BUILD_DIR)/signed
-
-sign: sign-jar
-
-sign-jar: $(SIGNED_DIR)/sunjce_provider.jar
-
-ifndef ALT_JCE_BUILD_DIR
-$(SIGNED_DIR)/sunjce_provider.jar: $(UNSIGNED_DIR)/sunjce_provider.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)/sunjce_provider.jar:
-	@if [ ! -r $(UNSIGNED_DIR)/sunjce_provider.jar ] ; then \
-	    $(ECHO) "Couldn't find $(UNSIGNED_DIR)/sunjce_provider.jar"; \
-	    exit 1; \
-	fi
-endif
-	$(call sign-file, $(UNSIGNED_DIR)/sunjce_provider.jar)
-
-
-# =====================================================
-# Create the Release Engineering files.  Signed builds, etc.
-#
-
-release: $(SIGNED_DIR)/sunjce_provider.jar
-	$(RM) $(JCE_BUILD_DIR)/release/sunjce_provider.jar
-	$(MKDIR) -p $(JCE_BUILD_DIR)/release
-	$(CP) $(SIGNED_DIR)/sunjce_provider.jar $(JCE_BUILD_DIR)/release
-	$(release-warning)
-
-endif # OPENJDK
-
-
-# =====================================================
-# Install routines.
-#
-
-#
-# Install sunjce_provider.jar, depending on which type is requested.
-#
-install-jar jar: $(JAR_DESTFILE)
-ifndef OPENJDK
-	$(release-warning)
-endif
-
-ifdef OPENJDK
-$(JAR_DESTFILE): $(UNSIGNED_DIR)/sunjce_provider.jar
-else
-$(JAR_DESTFILE): $(SIGNED_DIR)/sunjce_provider.jar
-endif
-	$(install-file)
-
-ifndef OPENJDK
-install-prebuilt:
-	@$(ECHO) "\n>>>Installing prebuilt SunJCE provider..."
-	$(RM) $(JAR_DESTFILE)
-	$(CP) $(PREBUILT_DIR)/jce/sunjce_provider.jar $(JAR_DESTFILE)
-endif
-
-
-# =====================================================
-# Support routines.
-#
-
-clobber clean::
-	$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
-
-.PHONY: build-jar jar install-jar
-ifndef OPENJDK
-.PHONY: sign sign-jar release install-prebuilt
-endif
--- a/makefiles/common/Classes.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#
-# Copyright (c) 1995, 2005, 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.
-#
-
-# WARNING: This file is shared with other workspaces.
-#          So when it includes other files, it must use JDK_TOPDIR.
-#
-
-include $(JDK_TOPDIR)/makefiles/common/Rules.gmk
-
-#
-# Say you built classes into $(ALT_CLASSBINDIR) and then at the end of
-# the build you might want to copy them over to $(ALT_CLASSDESTDIR);
-# this rule takes care of that.  No one should really set these
-# variables except the bootstrap/recompile stage of the java compiler.
-#
-ifdef ALT_CLASSBINDIR
-
-# By default post-processing is copying.  Suppose you want to build
-# a jar file then set ALT_CLASSES_DISPOSITION to '../../dest/nameof.jar'
-# before including this file.
-ifndef ALT_CLASSES_DISPOSITION
-ALT_CLASSES_DISPOSITION = copy-classes
-endif
-
-build : $(ALT_CLASSES_DISPOSITION)
-
-copy-classes: 
-ifneq ($(ALT_CLASSBINDIR), $(ALT_CLASSDESTDIR))
-	@if [ -s $(TEMPDIR)/.classes.list ]; then \
-	  mkdir -p $(ALT_CLASSDESTDIR); \
-	  echo "Copying $(ALT_CLASSBINDIR)..."; \
-	  echo "(cd $(ALT_CLASSBINDIR); tar cf - .) | \
-			(cd $(ALT_CLASSDESTDIR); tar xf -)"; \
-	  (cd $(ALT_CLASSBINDIR); tar cf - .) | \
-			(cd $(ALT_CLASSDESTDIR); tar xf -); \
-	fi
-else # ALT_CLASSBINDIR
-	@if [ -s $(TEMPDIR)/.classes.list ]; then \
-	  echo "Copy source and destination are the same: $(ALT_CLASSBINDIR) -- Copy skipped..."; \
-	fi
-endif # ALT_CLASSBINDIR
-
-.PHONY: copy-classes
-endif # ALT_CLASSBINDIR
-
--- a/makefiles/common/Cscope.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-#
-# Copyright (c) 1998, 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.
-#
-
-#
-# The cscope.out file is made in the current directory and spans the entire
-# source tree.
-#
-# Things to note:
-#	1. We use relative names for cscope.
-#	2. We *don't* remove the old cscope.out file, because cscope is smart
-#	   enough to only build what has changed.  It can be confused, however,
-#	   if files are renamed or removed, so it may be necessary to manually
-#	   remove cscope.out if a lot of reorganization has occurred.
-#
-CSDIRS	= $(JDK_TOPDIR)/src $(JDK_TOPDIR)/build
-CSINCS	= $(CSDIRS:%=-I%)
-
-#
-# Set CSFLAGS env variable to -b when using fast cscope to build the fast
-# (but large) cscope data bases.
-#
-CSCOPE	= cscope-fast
-ifeq ($(CSCOPE), cscope-fast)
-CSFLAGS	= -b
-endif
-
-#
-# Adding .java files pushes the file count of a full workspace up about 2500
-# files, which slows database lookup.  Thus allow these files to be added from
-# the environment (CSCLASSES=yes).
-#
-ifdef	CSCLASSES
-ADDCLASSES=	-o -name '*.java'
-endif
-
-#
-# Adding CClassHeaders also pushes the file count of a full workspace up about
-# 200 files (these files also don't exist in a new workspace, and thus will
-# cause the recreation of the database as they get created, which might seem
-# A little confusing).  Thus allow these files to be added from the environment
-# (CSHEADERS=yes).
-#
-ifndef	CSHEADERS
-RMCCHEADERS=	-o -name CClassHeaders
-endif
-
-
-.PRECIOUS:	cscope.out
-
-cscope.out: cscope.files FRC
-	$(CSCOPE) $(CSFLAGS)
-
-#
-# What files should we include?  A simple rule might be just those files under
-# SCM control, however this would miss files we create like the opcodes and
-# CClassHeaders.  The following attempts to find everything that is *useful*.
-# (demo directories contain many .java files
-# that probably aren't useful for development, and the pkgarchive may contain
-# duplicates of files within the source hierarchy).  The ordering of the .raw
-# file is an attempt to make cscope display the most relevant files first.
-#
-cscope.files: FRC
-	@-$(RM) cscope.files cscope.files.raw
-	echo "$(CSINCS)" > cscope.files
-	-find $(CSDIRS) $(SCM_DIRS_prune) -o -type d \( -name '.del-*' -o \
-	    -name '*demo' -o -name pkgarchive $(RMCCHEADERS) \) -prune -o \
-	    -type f \( -name '*.[Ccshlxy]' -o -name '*.il' -o -name '*.cc' -o \
-	    -name 'Makefile*' -o -name GNUmakefile -o -name '*.gmk' -o \
-	    -name '*.cpp' $(ADDCLASSES) \) -print > cscope.files.raw
-	-egrep -v "\.java|\/build\/"	cscope.files.raw >> cscope.files
-	-fgrep ".java"			cscope.files.raw >> cscope.files
-	-fgrep "/build/"		cscope.files.raw >> cscope.files
-	@-$(RM) cscope.files.raw
-
-cscope.clean:
-	-$(RM) cscope.files cscope.files.raw cscope.out
-
-FRC:
--- a/makefiles/common/Defs-embedded.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +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.
-#
-
-#
-# Variable definitions for SE Embedded builds.  This file should
-# not contain rules.
-#
-ifdef JAVASE_EMBEDDED
-
-# Compress jar files
-COMPRESS_JARS = true
-
-# Don't mmap zip files
-LIBZIP_CAN_USE_MMAP = false
-
-# Disable ALSA version check
-REQUIRED_ALSA_VERSION =
-
-# Compilation settings
-OTHER_CPPFLAGS += -DJAVASE_EMBEDDED
-
-# Product naming
-PRODUCT_SUFFIX = SE Runtime Environment for Embedded
-RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
-
-# Reduced JRE locations
-JRE_REDUCED_HEADLESS_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-headless-image
-JRE_REDUCED_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-image
-
-# Override on linux to further reduce binary/lib sizes in product build
-ifeq ($(PLATFORM), linux)
-  ifeq ($(VARIANT), OPT)
-    ifneq ($(NO_STRIP), true)
-      ifneq ($(DEBUG_BINARIES), true)
-        POST_STRIP_PROCESS = $(STRIP) --strip-unneeded
-      endif
-    endif
-  endif
-endif
-
-# NIO Platform specific source file location
-ifdef CROSS_COMPILE_ARCH
-  NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/
-endif
-
-# For ARM sflt we need to link to a library with improved FP accuracy
-# and it must be linked after fdlibm - this places it at the end after libc
-# -z muldefs avoids linker errors for duplicate symbols.
-ifeq ($(CROSS_COMPILE_ARCH), arm)
-  EXTRA_LIBS +=  $(EXT_LIBS_PATH)/sflt_glibc_jdk.a -Xlinker -z -Xlinker muldefs
-endif
-
-endif # JAVASE_EMBEDDED
-
--- a/makefiles/common/Defs-linux.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,430 +0,0 @@
-#
-# Copyright (c) 1999, 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 to specify compiler flags for programs and libraries
-# targeted to Linux.  Should not contain any rules.
-#
-# WARNING: This file is shared with other workspaces. 
-#          So when it includes other files, it must use JDK_TOPDIR.
-#
-
-# Warning: the following variables are overriden by Defs.gmk. Set
-# values will be silently ignored:
-#   CFLAGS        (set $(OTHER_CFLAGS) instead)
-#   CPPFLAGS      (set $(OTHER_CPPFLAGS) instead)
-#   CXXFLAGS      (set $(OTHER_CXXFLAGS) instead)
-#   LDFLAGS       (set $(OTHER_LDFAGS) instead)
-#   LDLIBS        (set $(EXTRA_LIBS) instead)
-#   LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
-
-# Get shared JDK settings
-include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
-
-# Part of INCREMENTAL_BUILD mechanism.
-#   Compiler emits things like:  path/file.o: file.h
-#   We want something like: relative_path/file.o relative_path/file.d: file.h
-CC_DEPEND	 = -MM
-CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g'
-
-ifndef PLATFORM_SRC
-  PLATFORM_SRC = $(BUILDDIR)/../src/solaris
-endif # PLATFORM_SRC
-
-# Platform specific closed sources
-ifndef OPENJDK
-  ifndef CLOSED_PLATFORM_SRC
-    CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
-  endif
-endif
-
-# platform specific include files
-PLATFORM_INCLUDE_NAME = $(PLATFORM)
-PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
-
-# suffix used for make dependencies files.
-DEPEND_SUFFIX = d
-# The suffix applied to the library name for FDLIBM
-FDDLIBM_SUFFIX = a
-# The suffix applied to scripts (.bat for windows, nothing for unix)
-SCRIPT_SUFFIX =
-# CC compiler object code output directive flag value
-CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
-
-# Default OBJCOPY comes from GNU Binutils on Linux:
-DEF_OBJCOPY=/usr/bin/objcopy
-ifdef CROSS_COMPILE_ARCH
-  # don't try to generate .debuginfo files when cross compiling
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
-      "skipping .debuginfo generation.")
-  OBJCOPY=
-else
-  OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
-  ifneq ($(ALT_OBJCOPY),)
-    _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
-    # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
-    OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
-  endif
-endif
-
-ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
-# The setting of OBJCOPY above enables the JDK build to import
-# .debuginfo files from the HotSpot build. However, adding FDS
-# support to the JDK build will occur in phases so a different
-# make variable is used to indicate that a particular library
-# supports FDS.
-
-ifeq ($(OBJCOPY),)
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
-else
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
-
-  # Library stripping policies for .debuginfo configs:
-  #   all_strip - strips everything from the library
-  #   min_strip - strips most stuff from the library; leaves minimum symbols
-  #   no_strip  - does not strip the library at all
-  #
-  # Oracle security policy requires "all_strip". A waiver was granted on
-  # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
-  #
-  DEF_STRIP_POLICY="min_strip"
-  ifeq ($(ALT_STRIP_POLICY),)
-    STRIP_POLICY=$(DEF_STRIP_POLICY)
-  else
-    STRIP_POLICY=$(ALT_STRIP_POLICY)
-  endif
-
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
-endif
-endif
-
-#
-# Default optimization
-#
-
-ifndef OPTIMIZATION_LEVEL
-  ifeq ($(PRODUCT), java)
-    OPTIMIZATION_LEVEL = HIGHER
-  else
-    OPTIMIZATION_LEVEL = LOWER
-  endif
-endif
-ifndef FASTDEBUG_OPTIMIZATION_LEVEL
-  FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
-endif
-
-CC_OPT/NONE     = 
-CC_OPT/LOWER    = -O2
-CC_OPT/HIGHER   = -O3
-CC_OPT/HIGHEST  = -O3
-
-CC_OPT          = $(CC_OPT/$(OPTIMIZATION_LEVEL))
-
-# 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   += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
-CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
-CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
-CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
-LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
-CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
-LDFLAGS_COMMON_sparc    += -m32 -mcpu=v9
-CFLAGS_REQUIRED_arm     += -fsigned-char -D_LITTLE_ENDIAN
-CFLAGS_REQUIRED_ppc     += -fsigned-char -D_BIG_ENDIAN
-ifeq ($(ZERO_BUILD), true)
-  CFLAGS_REQUIRED       =  $(ZERO_ARCHFLAG)
-  ifeq ($(ZERO_ENDIANNESS), little)
-    CFLAGS_REQUIRED     += -D_LITTLE_ENDIAN
-  endif
-  LDFLAGS_COMMON        += $(ZERO_ARCHFLAG)
-else
-  CFLAGS_REQUIRED       =  $(CFLAGS_REQUIRED_$(ARCH))
-  LDFLAGS_COMMON        += $(LDFLAGS_COMMON_$(ARCH))
-endif
-
-# If this is a --hash-style=gnu system, use --hash-style=both
-#   The gnu .hash section won't work on some Linux systems like SuSE 10.
-_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu')
-ifneq ($(_HAS_HASH_STYLE_GNU),)
-  LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
-endif
-LDFLAGS_COMMON          += $(LDFLAGS_HASH_STYLE)
-
-#
-# Selection of warning messages
-#
-GCC_INHIBIT	= -Wno-unused -Wno-parentheses
-GCC_STYLE	= 
-GCC_WARNINGS	= -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
-
-#
-# Treat compiler warnings as errors, if warnings not allowed
-#
-ifeq ($(COMPILER_WARNINGS_FATAL),true)
-  GCC_WARNINGS += -Werror
-endif
-
-#
-# Misc compiler options
-#
-ifneq ($(ARCH),ppc)
-  CFLAGS_COMMON   = -fno-strict-aliasing
-endif 
-PIC_CODE_LARGE = -fPIC
-PIC_CODE_SMALL = -fpic
-GLOBAL_KPIC = $(PIC_CODE_LARGE)
-CFLAGS_COMMON   += $(GLOBAL_KPIC) $(GCC_WARNINGS)
-ifeq ($(ARCH), amd64)
- CFLAGS_COMMON += -pipe
-endif
-
-# Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1
-DEBUG_FLAG = -g
-ifeq ($(FASTDEBUG), true)
-  ifeq ($(ARCH_DATA_MODEL), 64)
-    DEBUG_FLAG = -g1
-  endif
-endif
-
-# DEBUG_BINARIES overrides everything, use full -g debug information
-ifeq ($(DEBUG_BINARIES), true)
-  DEBUG_FLAG = -g
-  CFLAGS_REQUIRED += $(DEBUG_FLAG)
-endif
-
-CFLAGS_OPT      = $(CC_OPT)
-CFLAGS_DBG      = $(DEBUG_FLAG)
-CFLAGS_COMMON += $(CFLAGS_REQUIRED)
-
-CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS)
-CXXFLAGS_OPT	= $(CC_OPT)
-CXXFLAGS_DBG	= $(DEBUG_FLAG)
-CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
-
-# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java
-ifeq ($(FASTDEBUG), true)
-  CFLAGS_DBG    += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
-  CXXFLAGS_DBG	+= $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
-endif
-
-CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
-
-# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
-ifneq ($(ARCH),alpha)
-  CPP_ARCH_FLAGS += -D$(ARCH)
-else
-  CPP_ARCH_FLAGS += -D_$(ARCH)_
-endif
-
-CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
-		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
-
-ifeq ($(ARCH_DATA_MODEL), 64)
-CPPFLAGS_COMMON += -D_LP64=1
-endif
-
-CPPFLAGS_OPT    = -DNDEBUG
-CPPFLAGS_DBG    = -DDEBUG
-ifneq ($(PRODUCT), java)
-  CPPFLAGS_DBG    += -DLOGGING 
-endif
-
-ifdef LIBRARY
-  # Libraries need to locate other libraries at runtime, and you can tell
-  #   a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
-  #   buried inside the .so. The $ORIGIN says to look relative to where
-  #   the library itself is and it can be followed with relative paths from
-  #   that. By default we always look in $ORIGIN, optionally we add relative
-  #   paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
-  #   On Linux we add a flag -z origin, not sure if this is necessary, but 
-  #   doesn't seem to hurt.
-  #   The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
-  #   Try: 'readelf -d lib*.so' to see these settings in a library.
-  #
-  Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin
-  Z_ORIGIN_FLAG/i586  = -Xlinker -z -Xlinker origin
-  Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin 
-  Z_ORIGIN_FLAG/ia64  = -Xlinker -z -Xlinker origin
-  Z_ORIGIN_FLAG/arm   = 
-  Z_ORIGIN_FLAG/ppc   =
-  Z_ORIGIN_FLAG/zero  = -Xlinker -z -Xlinker origin
-
-  LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY))
-
-  LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN
-  LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%)
-
-endif
-
-EXTRA_LIBS += -lc
-
-LDFLAGS_DEFS_OPTION  = -Xlinker -z -Xlinker defs
-#LDFLAGS_COMMON  += $(LDFLAGS_DEFS_OPTION)
-
-#
-# -L paths for finding and -ljava
-#
-LDFLAGS_OPT     = -Xlinker -O1
-LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
-LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
-
-#
-# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
-# statically link libgcc but will print a warning with the flag. We don't 
-# want the warning, so check gcc version first.
-#
-ifeq ($(CC_MAJORVER),3)
-  OTHER_LDFLAGS  += -static-libgcc
-endif
-
-# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
-#   (See Rules.gmk) The gcc 5 compiler might have an option for this?
-AUTOMATIC_PCH_OPTION = 
-
-#
-# Post Processing of libraries/executables
-#
-ifeq ($(VARIANT), OPT)
-  ifneq ($(NO_STRIP), true)
-    ifneq ($(DEBUG_BINARIES), true)
-      # Debug 'strip -g' leaves local function Elf symbols (better stack
-      # traces)
-      POST_STRIP_PROCESS = $(STRIP) -g
-    endif
-  endif
-endif
-
-#
-# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o
-#
-LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker
-
-#
-# Support for Quantify.
-#
-ifdef QUANTIFY
-QUANTIFY_CMD = quantify
-QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
-LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
-endif
-
-#
-# Path and option to link against the VM, if you have to.  Note that
-# there are libraries that link against only -ljava, but they do get
-# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
-# the library itself should not.
-#
-VM_NAME         = server
-# First try to link against server, if that does not exist link against client.
-JVMLIB          = -L$(LIBDIR)/$(LIBARCH)/server -L$(LIBDIR)/$(LIBARCH)/client -ljvm
-JAVALIB         = -ljava $(JVMLIB)
-
-#
-# We want to privatize JVM symbols on Solaris. This is so the user can
-# write a function called FindClass and this should not override the 
-# FindClass that is inside the JVM. At this point in time we are not
-# concerned with other JNI libraries because we hope that there will
-# not be as many clashes there.
-#
-PRIVATIZE_JVM_SYMBOLS = false
-
-USE_PTHREADS = true
-override ALT_CODESET_KEY         = _NL_CTYPE_CODESET_NAME
-override AWT_RUNPATH             =
-override HAVE_ALTZONE            = false
-override HAVE_FILIOH             = false
-override HAVE_GETHRTIME          = false
-override HAVE_GETHRVTIME         = false
-override HAVE_SIGIGNORE          = true
-override LEX_LIBRARY             = -lfl
-ifeq ($(STATIC_CXX),true)
-override LIBCXX                  = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
-else
-override LIBCXX                  = -lstdc++
-endif
-override LIBPOSIX4               =
-override LIBSOCKET               =
-override LIBNSL                  =
-override LIBSCF                  =
-override LIBTHREAD               =
-override LIBDL                   = -ldl
-override MOOT_PRIORITIES         = true
-override NO_INTERRUPTIBLE_IO     = true
-ifeq ($(ARCH), amd64)
-override OPENWIN_LIB             = $(OPENWIN_HOME)/lib64
-else
-override OPENWIN_LIB             = $(OPENWIN_HOME)/lib
-endif
-override OTHER_M4FLAGS           = -D__GLIBC__ -DGNU_ASSEMBLER
-override SUN_CMM_SUBDIR          =
-override THREADS_FLAG            = native
-override USE_GNU_M4              = true
-override USING_GNU_TAR           = true
-override WRITE_LIBVERSION        = false
-
-# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the
-# resulting resolved absolute name of the executable in the environment
-# variable EXECNAME.  That executable name is then used that to locate the
-# installation area.
-override USE_EXECNAME            = true
-
-# If your platform has DPS, it will have Type1 fonts too, in which case
-# it is best to enable DPS support until such time as 2D's rasteriser
-# can fully handle Type1 fonts in all cases. Default is "yes".
-# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
-# DPS (Displayable PostScript) is available on Solaris machines
-HAVE_DPS = no
-
-#
-# Japanese manpages
-#
-JA_SOURCE_ENCODING = eucJP
-JA_TARGET_ENCODINGS = UTF-8
-
-# Settings for the JDI - Serviceability Agent binding.
-HOTSPOT_SALIB_PATH   = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
-SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
-SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo
-
-# The JDI - Serviceability Agent binding is not currently supported
-# on Linux-ia64.
-ifeq ($(ARCH), ia64)
-  INCLUDE_SA = false
-else
-  INCLUDE_SA = true
-endif
-
-ifdef CROSS_COMPILE_ARCH
-  # X11 headers are not under /usr/include
-  OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
-  OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
-  OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
-endif
--- a/makefiles/common/Defs-macosx.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,402 +0,0 @@
-#
-# Copyright (c) 1999, 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 to specify compiler flags for programs and libraries
-# targeted to MACOSX.  Should not contain any rules.
-#
-# WARNING: This file is shared with other workspaces. 
-#          So when it includes other files, it must use JDK_TOPDIR.
-#
-
-# Warning: the following variables are overriden by Defs.gmk. Set
-# values will be silently ignored:
-#   CFLAGS        (set $(OTHER_CFLAGS) instead)
-#   CPPFLAGS      (set $(OTHER_CPPFLAGS) instead)
-#   CXXFLAGS      (set $(OTHER_CXXFLAGS) instead)
-#   LDFLAGS       (set $(OTHER_LDFAGS) instead)
-#   LDLIBS        (set $(EXTRA_LIBS) instead)
-#   LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
-
-# Get shared JDK settings
-include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
-
-# Part of INCREMENTAL_BUILD mechanism.
-#   Compiler emits things like:  path/file.o: file.h
-#   We want something like: relative_path/file.o relative_path/file.d: file.h
-CC_DEPEND	 = -MM
-CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g'
-
-ifndef PLATFORM_SRC
-  PLATFORM_SRC = $(BUILDDIR)/../src/solaris
-endif # PLATFORM_SRC
-
-PLATFORM_SRC_MACOS = $(BUILDDIR)/../src/macosx
-
-# BSD build pulls its platform sources from the solaris tree.
-JAVA_SRCDIR_LIST = src/$(PLATFORM) src/solaris src/share
-NATIVE_SRCDIR_LIST = src/$(PLATFORM) src/solaris src/share
-
-# Platform specific closed sources
-ifndef OPENJDK
-  ifndef CLOSED_PLATFORM_SRC
-    CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
-  endif
-endif
-
-# platform specific include files
-PLATFORM_INCLUDE_NAME = $(OS_NAME)
-PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
-
-# suffix used for make dependencies files.
-DEPEND_SUFFIX = d
-# The suffix applied to the library name for FDLIBM
-FDDLIBM_SUFFIX = a
-# The suffix applied to scripts (.bat for windows, nothing for unix)
-SCRIPT_SUFFIX =
-# CC compiler object code output directive flag value
-CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
-CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
-
-#
-# Default optimization
-#
-
-ifndef OPTIMIZATION_LEVEL
-  ifeq ($(PRODUCT), java)
-    OPTIMIZATION_LEVEL = HIGHER
-  else
-    OPTIMIZATION_LEVEL = LOWER
-  endif
-endif
-ifndef FASTDEBUG_OPTIMIZATION_LEVEL
-  FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
-endif
-
-# For macosx use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
-# <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers>
-CC_OPT/NONE     = 
-CC_OPT/LOWER    = -Os
-CC_OPT/HIGHER   = -Os
-CC_OPT/HIGHEST  = -Os
-
-CC_OPT          = $(CC_OPT/$(OPTIMIZATION_LEVEL))
-
-# 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 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
-CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
-LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
-CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
-LDFLAGS_COMMON_sparc    += -m32 -mcpu=v9
-CFLAGS_REQUIRED_arm     += -fsigned-char -D_LITTLE_ENDIAN
-CFLAGS_REQUIRED_ppc     += -fsigned-char -D_BIG_ENDIAN
-ifeq ($(ZERO_BUILD), true)
-  CFLAGS_REQUIRED       =  $(ZERO_ARCHFLAG)
-  ifeq ($(ZERO_ENDIANNESS), little)
-    CFLAGS_REQUIRED     += -D_LITTLE_ENDIAN
-  endif
-  LDFLAGS_COMMON        += $(ZERO_ARCHFLAG)
-else ifeq ($(ARCH), universal)
-  CFLAGS_REQUIRED       += -arch i386 -arch x86_64 -D_LITTLE_ENDIAN
-  LDFLAGS_COMMON        += -arch i386 -arch x86_64
-else
-  CFLAGS_REQUIRED       =  $(CFLAGS_REQUIRED_$(ARCH))
-  LDFLAGS_COMMON        += $(LDFLAGS_COMMON_$(ARCH))
-endif
-# 16-byte stack re-alignment on 32-bit Darwin
-CFLAGS_REQUIRED_i586 += -mstackrealign
-
-OTHER_CFLAGS = \
-         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-	     -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
-
-#
-# Selection of warning messages
-#
-GCC_INHIBIT	= -Wno-unused -Wno-parentheses
-GCC_STYLE	= 
-GCC_WARNINGS	= -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
-
-#
-# Treat compiler warnings as errors, if warnings not allowed
-#
-ifeq ($(COMPILER_WARNINGS_FATAL),true)
-  GCC_WARNINGS += -Werror
-endif
-
-#
-# Misc compiler options
-#
-ifneq ($(ARCH),ppc)
-  CFLAGS_COMMON   = -fno-strict-aliasing
-endif 
-PIC_CODE_LARGE = -fPIC
-PIC_CODE_SMALL = -fpic
-GLOBAL_KPIC = $(PIC_CODE_LARGE)
-CFLAGS_COMMON   += $(GLOBAL_KPIC) $(GCC_WARNINGS)
-ifeq ($(ARCH), x86_64)
- CFLAGS_COMMON += -pipe
-endif
-
-# BSD 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1
-DEBUG_FLAG = -g
-ifeq ($(FASTDEBUG), true)
-  ifeq ($(ARCH_DATA_MODEL), 64)
-    DEBUG_FLAG = -g1
-  endif
-endif
-
-# DEBUG_BINARIES overrides everything, use full -g debug information
-ifeq ($(DEBUG_BINARIES), true)
-  DEBUG_FLAG = -g
-  CFLAGS_REQUIRED += $(DEBUG_FLAG)
-endif
-
-CFLAGS_OPT      = $(CC_OPT)
-CFLAGS_DBG      = $(DEBUG_FLAG)
-CFLAGS_COMMON += $(CFLAGS_REQUIRED)
-
-CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS)
-CXXFLAGS_OPT	= $(CC_OPT)
-CXXFLAGS_DBG	= $(DEBUG_FLAG)
-CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
-
-# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java
-ifeq ($(FASTDEBUG), true)
-  CFLAGS_DBG    += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
-  CXXFLAGS_DBG	+= $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
-endif
-
-CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
-
-# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
-ifneq ($(ARCH),alpha)
-  CPP_ARCH_FLAGS += -D$(ARCH)
-else
-  CPP_ARCH_FLAGS += -D_$(ARCH)_
-endif
-CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -D_ALLBSD_SOURCE $(VERSION_DEFINES) \
-		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
-
-CPPFLAGS_COMMON += -DMACOSX
-
-ifeq ($(ARCH_DATA_MODEL), 64)
-CPPFLAGS_COMMON += -D_LP64=1
-endif
-
-CPPFLAGS_OPT    = -DNDEBUG
-CPPFLAGS_DBG    = -DDEBUG
-ifneq ($(PRODUCT), java)
-  CPPFLAGS_DBG    += -DLOGGING 
-endif
-
-# Libraries need to locate other libraries at runtime, and you can tell
-#   a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
-#   buried inside the .{so,dylib}. The {$ORIGIN,@loader_path/} says to look
-#   relative to where the library itself is and it can be followed
-#   with relative paths from that. By default we always look in
-#   {$ORIGIN,@loader_path/}, optionally we add relative paths if the Makefile
-#   sets LD_RUNPATH_EXTRAS to those relative paths.
-#   Except on MacOS X we add a flag -z origin, not sure if this is necessary,
-#   but doesn't seem to hurt.
-#   The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
-#   See 'man {dyld,rtld}' for more information.
-#   Try: 'readelf -d lib*.so' to see these settings in a library.
-#
-LDFLAGS_COMMON += -Xlinker -rpath -Xlinker @loader_path/.
-LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -rpath -Xlinker @loader_path/%)
-LDFLAGS_COMMON += -Xlinker -install_name -Xlinker @rpath/$(@F)
-
-#
-# -L paths for finding and -ljava
-#
-LDFLAGS_COMMON += -L$(LIBDIR)
-
-#
-# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
-# statically link libgcc but will print a warning with the flag. We don't 
-# want the warning, so check gcc version first.
-#
-ifeq ($(CC_MAJORVER),3)
-  OTHER_LDFLAGS  += -static-libgcc
-endif
-
-# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
-#   (See Rules.gmk) The gcc 5 compiler might have an option for this?
-AUTOMATIC_PCH_OPTION = 
-
-#
-# Post Processing of libraries/executables
-#
-ifeq ($(VARIANT), OPT)
-  ifneq ($(NO_STRIP), true)
-    ifneq ($(DEBUG_BINARIES), true)
-      # Debug 'strip -S' leaves local function Elf symbols (better stack
-      # traces)
-      POST_STRIP_PROCESS = $(STRIP) -S
-    endif
-  endif
-endif
-
-#
-# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o
-#
-LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker
-
-#
-# Support for Quantify.
-#
-ifdef QUANTIFY
-QUANTIFY_CMD = quantify
-QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
-LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
-endif
-
-# Darwin does not support linker map files.
-LDNOMAP=true
-
-#
-# Path and option to link against the VM, if you have to.  Note that
-# there are libraries that link against only -ljava, but they do get
-# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
-# the library itself should not.
-#
-VM_NAME         = server
-JVMLIB          = -L$(LIBDIR)/server -L$(LIBDIR)/client -ljvm
-JAVALIB         = -ljava $(JVMLIB)
-
-#
-# We want to privatize JVM symbols on Solaris. This is so the user can
-# write a function called FindClass and this should not override the 
-# FindClass that is inside the JVM. At this point in time we are not
-# concerned with other JNI libraries because we hope that there will
-# not be as many clashes there.
-#
-PRIVATIZE_JVM_SYMBOLS = false
-
-USE_PTHREADS = true
-override ALT_CODESET_KEY         = _NL_CTYPE_CODESET_NAME
-override AWT_RUNPATH             =
-override HAVE_ALTZONE            = false
-override HAVE_FILIOH             = false
-override HAVE_GETHRTIME          = false
-override HAVE_GETHRVTIME         = false
-override HAVE_SIGIGNORE          = true
-override LEX_LIBRARY             = -lfl
-ifeq ($(STATIC_CXX),true)
-override LIBCXX                  = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
-else
-override LIBCXX                  = -lstdc++
-endif
-override LIBPOSIX4               =
-override LIBSOCKET               =
-override LIBNSL                  =
-override LIBTHREAD               =
-override LIBDL                   =
-override MOOT_PRIORITIES         = true
-override NO_INTERRUPTIBLE_IO     = true
-override OPENWIN_HOME            = $(X11_PATH)
-override OPENWIN_LIB             = $(OPENWIN_HOME)/lib
-override OTHER_M4FLAGS           = -D__GLIBC__ -DGNU_ASSEMBLER
-override SUN_CMM_SUBDIR          =
-override THREADS_FLAG            = native
-override USE_GNU_M4              = true
-override USING_GNU_TAR           = true
-override WRITE_LIBVERSION        = false
-
-ifdef ALT_X11_PATH
-  X11_PATH = $(ALT_X11_PATH)
-else
-  X11_PATH = /usr/X11R6
-endif
-
-ifdef ALT_PACKAGE_PATH
-  PACKAGE_PATH = $(ALT_PACKAGE_PATH)
-else
-  PACKAGE_PATH = /opt/local
-endif
-
-# ALSA
-ifdef ALT_ALSA_LIB_PATH
-  ALSA_LIB_PATH = $(ALT_ALSA_LIB_PATH)
-else
-  ALSA_LIB_PATH = $(PACKAGE_PATH)/lib
-endif
-
-ifdef ALT_ALSA_HEADERS_PATH
-  ALSA_HEADERS_PATH = $(ALT_ALSA_HEADERS_PATH)
-else
-  ALSA_HEADERS_PATH = $(PACKAGE_PATH)/include
-endif
-
-# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the
-# resulting resolved absolute name of the executable in the environment
-# variable EXECNAME.  That executable name is then used that to locate the
-# installation area.
-override USE_EXECNAME            = true
-
-# If your platform has DPS, it will have Type1 fonts too, in which case
-# it is best to enable DPS support until such time as 2D's rasteriser
-# can fully handle Type1 fonts in all cases. Default is "yes".
-# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
-# DPS (Displayable PostScript) is available on Solaris machines
-HAVE_DPS = no
-
-SYSTEM_ZLIB = true
-
-#
-# Japanese manpages
-#
-JA_SOURCE_ENCODING = eucJP
-JA_TARGET_ENCODINGS = UTF-8
-
-# Settings for the JDI - Serviceability Agent binding.
-
-HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
-SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
-
-# The JDI - Serviceability Agent binding is not currently supported
-# on ia64.
-ifeq ($(ARCH), ia64)
-  INCLUDE_SA = false
-else
-  INCLUDE_SA = true
-endif
-
-ifdef CROSS_COMPILE_ARCH
-  # X11 headers are not under /usr/include
-  OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
-  OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
-  OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
-endif
-
-LIB_LOCATION ?= $(LIBDIR)
--- a/makefiles/common/Defs-solaris.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,757 +0,0 @@
-#
-# Copyright (c) 1995, 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 to specify compiler flags for programs and libraries
-# targeted to Solaris.  Should not contain any rules.
-#
-# WARNING: This file is shared with other workspaces. 
-#          So when it includes other files, it must use JDK_TOPDIR.
-#
-
-# Warning: the following variables are overridden by Defs.gmk. Set
-# values will be silently ignored:
-#   CFLAGS        (set $(OTHER_CFLAGS) instead)
-#   CPPFLAGS      (set $(OTHER_CPPFLAGS) instead)
-#   CXXFLAGS      (set $(OTHER_CXXFLAGS) instead)
-#   LDFLAGS       (set $(OTHER_LDFAGS) instead)
-#   LDLIBS        (set $(EXTRA_LIBS) instead)
-#   LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
-#   LINTFLAGS     (set $(OTHER_LINTFLAGS) instead)
-#
-# Note: CPPFLAGS are used in C and C++ compiles.
-#
-
-# Get shared JDK settings
-include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
-
-ifndef PLATFORM_SRC
-PLATFORM_SRC = $(BUILDDIR)/../src/solaris
-endif # PLATFORM_SRC
-
-# Platform specific closed sources
-ifndef OPENJDK
-  ifndef CLOSED_PLATFORM_SRC
-    CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
-  endif
-endif
-
-# platform specific include files
-PLATFORM_INCLUDE_NAME = $(PLATFORM)
-PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
-
-# suffix used for make dependencies files
-DEPEND_SUFFIX = d
-# suffix used for lint files
-LINT_SUFFIX = ln
-# The suffix applied to the library name for FDLIBM
-FDDLIBM_SUFFIX = a
-# The suffix applied to scripts (.bat for windows, nothing for unix)
-SCRIPT_SUFFIX =
-# CC compiler object code output directive flag value
-CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
-
-ifdef ENABLE_FULL_DEBUG_SYMBOLS
-# Only check for Full Debug Symbols support on Solaris if it is
-# specifically enabled. Hopefully, it can be enabled by default
-# once the .debuginfo size issues are worked out.
-
-# Default OBJCOPY comes from the SUNWbinutils package:
-DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
-ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
-  # On Solaris AMD64/X64, gobjcopy is not happy and fails:
-  #
-  # usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so
-  # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-  # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
-  # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-  # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value
-  # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-  # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64")
-  OBJCOPY=
-else
-  OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
-  ifneq ($(ALT_OBJCOPY),)
-    _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
-    # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
-    OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
-  endif
-endif
-
-ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
-# The setting of OBJCOPY above enables the JDK build to import
-# .debuginfo files from the HotSpot build. However, adding FDS
-# support to the JDK build will occur in phases so a different
-# make variable is used to indicate that a particular library
-# supports FDS.
-
-ifeq ($(OBJCOPY),)
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
-else
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
-
-  # Library stripping policies for .debuginfo configs:
-  #   all_strip - strips everything from the library
-  #   min_strip - strips most stuff from the library; leaves minimum symbols
-  #   no_strip  - does not strip the library at all
-  #
-  # Oracle security policy requires "all_strip". A waiver was granted on
-  # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
-  #
-  DEF_STRIP_POLICY="min_strip"
-  ifeq ($(ALT_STRIP_POLICY),)
-    STRIP_POLICY=$(DEF_STRIP_POLICY)
-  else
-    STRIP_POLICY=$(ALT_STRIP_POLICY)
-  endif
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
-endif
-endif
-endif
-
-#
-# Java default optimization (-x04/-O2) etc.  Applies to the VM.
-#
-ifndef OPTIMIZATION_LEVEL
-  ifeq ($(PRODUCT), java)
-    OPTIMIZATION_LEVEL = HIGHER
-  else
-    OPTIMIZATION_LEVEL = LOWER
-  endif
-endif
-ifndef FASTDEBUG_OPTIMIZATION_LEVEL
-  FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
-endif
-
-#
-# If -Xa is in CFLAGS_COMMON it will end up ahead of $(CC_OPT) for the
-# optimized build, and that ordering of the flags completely freaks
-# out cc.  Hence, -Xa is instead in each CFLAGS variant.
-#
-# The more unusual options to the Sun C compiler:
-#	-v		Stricter type checking, more error checking
-#			(To turn ALL warnings into fatals, use -errwarn=%all)
-#	-xstrconst	Place string literals and constants in read-only area
-#			(means you can't write on your string literals)
-#	-xs		Force debug information (stabs) into the .so or a.out
-#			(makes the library/executable debuggable without the
-#			.o files needing to be around, but at a space cost)
-#	-g & -O		If you add the -g option to the optimized compiles
-#			you will get better stack retraces, the code is
-#			still optimized. This includes a space cost too.
-#       -xc99=%none     Do NOT allow for c99 extensions to be used.
-#                       e.g. declarations must precede statements
-#       -xCC            Allow the C++ style of comments in C: //
-#                       Required with many of the source files.
-#       -mt             Assume multi-threaded (important)
-#
-# The more unusual options to the Sun C compiler:
-#       +w              Print more warnings
-#       +w2             Maximum warnings
-#
-
-#
-# Debug flag for C and C++ compiler
-#
-CFLAGS_DEBUG_OPTION    = -g $(CC_OPT/NONE)
-CXXFLAGS_DEBUG_OPTION  = -g $(CXX_OPT/NONE)
-
-# Turn off -g if we are doing tcov build
-ifdef TCOV_BUILD
-  CFLAGS_DEBUG_OPTION=
-  CXXFLAGS_DEBUG_OPTION=
-endif
-
-# FASTDEBUG: Optimize the -g builds, gives us a faster debug java
-#        If true adds -O to the debug compiles. This allows for any assert
-#        tests to remain and debug checking. The resulting code is faster
-#        but less debuggable.  Stack traces are still valid, although only
-#        approximate line numbers are given. Printing of local variables
-#        during a debugging session is not possible, but stepping and
-#        printing of global or static variables should be possible.
-#        Performance/size of files should be about the same, maybe smaller.
-#
-ifeq ($(FASTDEBUG), true)
-  CFLAGS_DEBUG_OPTION    = -g  $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
-  CXXFLAGS_DEBUG_OPTION  = -g0 $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
-endif
-
-CFLAGS_COMMON   = -L$(OBJDIR)
-
-# Do not allow C99 language features like declarations in code etc.
-CFLAGS_COMMON  += -xc99=%none
-
-# Allow C++ comments in C code
-CFLAGS_COMMON  += -xCC
-
-# Show error message tags on errors
-CFLAGS_COMMON   += -errshort=tags
-CXXFLAGS_COMMON += -errtags=yes
-
-# Optimization flags
-CFLAGS_OPT      = $(CC_OPT)
-
-# Debug version flags
-CFLAGS_DBG      = $(CFLAGS_DEBUG_OPTION)
-
-# Required C compiler flags
-CFLAGS_COMMON  += -Xa $(CFLAGS_REQUIRED)
-
-# Maximum warnings all the time
-CXXFLAGS_COMMON += +w
-CFLAGS_COMMON   += -v
-
-# Assume MT behavior all the time (important)
-CXXFLAGS_COMMON += -mt
-CFLAGS_COMMON   += -mt
-
-# Assume no C++ exceptions are used
-CXXFLAGS_COMMON += -features=no%except -DCC_NOEX
-
-# For C++, these options tell it to assume nothing about locating libraries
-#    either at compile time, or at runtime. Use of these options will likely
-#    require the use of -L and -R options to indicate where libraries will
-#    be found at compile time (-L) and at runtime (-R).
-#    The /usr/lib location comes for free, so no need to specify that one.
-#    Note: C is much simplier and there is no need for these options. This
-#          is mostly needed to avoid dependencies on libraries in the
-#          Compiler install area, also see LIBCXX and LIBM.
-CXXFLAGS_COMMON += -norunpath -xnolib
-
-#
-# Treat compiler warnings as errors, if requested
-#
-ifeq ($(COMPILER_WARNINGS_FATAL),true)
-  CFLAGS_COMMON += -errwarn=%all
-  CXXFLAGS_COMMON += -errwarn=%all
-endif
-
-CXXFLAGS_OPT	= $(CXX_OPT)
-CXXFLAGS_DBG	= $(CXXFLAGS_DEBUG_OPTION)
-CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
-
-# Add -xstrconst to the library compiles. This forces all string
-#  literals into the read-only data section, which prevents them from
-#  being written to and increases the runtime pages shared on the system.
-#
-ifdef LIBRARY
-  CFLAGS_COMMON +=-xstrconst
-endif
-
-# Source browser database
-#
-# COMPILE_WITH_SB    
-#        If defined adds -xsb to compiles and creates a
-#        source browsing database during compilation.
-#
-ifdef COMPILE_WITH_SB
-  ifeq ($(LIBRARY), java)
-    CFLAGS_DBG +=   -xsb
-  endif
-endif
-
-# Lint Flags:
-#	-Xa			ANSI C plus K&R, favor ANSI rules
-#	-fd			report on old style func defs
-#	-errchk=structarg	report on 64bit struct args by value
-#	-errchk=longptr64	report on 64bit to 32bit issues (ignores casts)
-#	-errchk=parentheses	report on suggested use of extra parens
-#	-v 			suppress unused args
-#	-x			suppress unused externs
-#	-u			suppress extern func/vars used/defined
-#	-errfmt=simple		use one line errors with position info
-#       $(LINT_XARCH_OPTION)    See Compiler-sun.gwk
-
-LINTFLAGS_COMMON  = -Xa
-LINTFLAGS_COMMON += -fd 
-LINTFLAGS_COMMON += -errchk=structarg,longptr64,parentheses
-LINTFLAGS_COMMON += -v
-LINTFLAGS_COMMON += -x 
-LINTFLAGS_COMMON += -u
-LINTFLAGS_COMMON += -errfmt=simple 
-LINTFLAGS_OPT   = 
-LINTFLAGS_DBG   =
-
-# The -W0,-noglobal tells the compiler to NOT generate mangled global
-#    ELF data symbols for file local static data.
-#    This can break fix&continue, but we'd rather do the same compilations
-#    for deliverable bits as we do for non-deliverable bits
-#    Tell the compilers to never generate globalized names, all the time.
-CFLAGS_COMMON += -W0,-noglobal
-
-# If we have a specific arch value to use, add it
-CFLAGS_COMMON    += $(XARCH_OPTION)
-CXXFLAGS_COMMON  += $(XARCH_OPTION)
-ASFLAGS_COMMON   += $(AS_XARCH_OPTION)
-EXTRA_LIBS       += $(XARCH_OPTION)
-LINTFLAGS_COMMON += $(LINT_XARCH_OPTION)
-
-#
-# uncomment the following to build with PERTURBALOT set
-#
-# OTHER_CFLAGS += -DPERTURBALOT
-#
-
-CPPFLAGS_COMMON = -D__solaris__  -D$(ARCH_FAMILY)
-CPPFLAGS_OPT    = -DNDEBUG
-CPPFLAGS_DBG    = -DDEBUG
-
-ifneq ($(PRODUCT), java)
-  CPPFLAGS_DBG    += -DLOGGING -DDBINFO
-endif
-
-ifeq ($(ARCH_FAMILY), i586)
-  # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
-  #   Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
-  #   (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h).
-  #   Note: -Dmacro         is the same as    #define macro 1
-  #         -Dmacro=	    is the same as    #define macro
-  #
-  CPPFLAGS_COMMON +=  -DcpuIntel -D_LITTLE_ENDIAN= -D$(LIBARCH)
-  # Turn off a superfluous compiler error message on Intel
-  CFLAGS_COMMON += -erroff=E_BAD_PRAGMA_PACK_VALUE
-endif
-
-# Java memory management is based on memory mapping by default, but a
-# system only assuming malloc/free can be built by adding -DUSE_MALLOC 
-
-CPPFLAGS_COMMON	+= -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS
-CPPFLAGS_OPT	+= -DTRIMMED
-
-LDFLAGS_DEFS_OPTION  = -z defs
-LDFLAGS_COMMON  += $(LDFLAGS_DEFS_OPTION)
-
-#
-# -L paths for finding and -ljava
-#
-LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
-LDFLAGS_OPT     =
-LDFLAGS_DBG     =
-
-#
-# We never really want the incremental linker, ever
-#    The -xildoff option tells Sun's compilers to NOT use incremental linker
-#
-LDFLAGS_COMMON  += -xildoff
-
-ifdef LIBRARY
-  # Libraries need to locate other libraries at runtime, and you can tell
-  #   a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
-  #   buried inside the .so. The $ORIGIN says to look relative to where
-  #   the library itself is and it can be followed with relative paths from
-  #   that. By default we always look in $ORIGIN, optionally we add relative
-  #   paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
-  #   The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
-  #   Try: 'dump -Lv lib*.so' to see these settings in a library.
-  #
-  LDFLAGS_COMMON += -R\$$ORIGIN
-  LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-R\$$ORIGIN/%)
-endif
-
-EXTRA_LIBS += -lc
-
-# Postprocessing is done on the images directories only
-#
-ifeq ($(VARIANT), OPT)
-  ifeq ($(PARTIAL_GPROF), true)
-    NO_STRIP = true
-  endif
-  ifeq ($(GPROF), true)
-    NO_STRIP = true
-  endif
-  ifneq ($(NO_STRIP), true)
-    # Debug 'strip -x' leaves local function Elf symbols (better stack traces)
-    POST_STRIP_PROCESS = $(STRIP) -x
-  endif
-endif
-POST_MCS_PROCESS=$(MCS) -d -a "JDK $(FULL_VERSION)"
-
-#
-# Sun C compiler will take -M and pass it on to ld.
-# Usage: ld $(LD_MAPFILE_FLAG) mapfile *.o
-#
-ifeq ($(CC_VERSION),gcc)
-LD_MAPFILE_FLAG = -Xlinker -M -Xlinker
-else
-LD_MAPFILE_FLAG = -M
-endif
-
-#
-# Variables globally settable from the make command line (default
-# values in brackets):
-#	GPROF (false)
-# Eg: 	% gnumake GPROF=true
-GPROF = false
-ifeq ($(GPROF), true)
-    CFLAGS_COMMON += -DGPROF -xpg
-    EXTRA_LIBS += -xpg
-endif
-
-# PARTIAL_GPROF is to be used ONLY during compilation - it should not
-# appear during linking of libraries or programs.  It also should
-# prevent linking with -z defs to allow a symbol to remain undefined.
-#
-PARTIAL_GPROF = false
-ifeq ($(PARTIAL_GPROF), true)
-  CFLAGS_GPROF += -xpg
-  LDFLAGS_DEFS_OPTION  = -z nodefs
-endif
-
-#
-# For a TCOV build we add in the TCOV_OPTION
-#
-ifdef TCOV_BUILD
-  TCOV_OPTION		= -xprofile=tcov
-  LDFLAGS_COMMON 	+= $(TCOV_OPTION) -Kpic
-  CFLAGS_COMMON  	+= $(TCOV_OPTION)
-  CXXFLAGS_COMMON 	+= $(TCOV_OPTION)
-  EXTRA_LIBS 	+= $(TCOV_OPTION)
-  LDNOMAP=true
-endif
-
-#
-# Solaris only uses native threads. 
-#
-THREADS_FLAG=	native
-THREADS_DIR=	threads
-
-#
-# Support for Quantify.
-#
-ifdef QUANTIFY
-  QUANTIFY_CMD = quantify
-  QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
-  LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
-  ifdef LIBRARY
-    CFLAGS_COMMON += -K PIC
-  endif
-endif
-
-#
-# Support for Purify.
-#
-ifdef PURIFY
-  PURIFY_CMD = /net/suntools.eng/export/tools/sparc/bin/purify
-  PURIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
-  LINK_PRE_CMD = $(PURIFY_CMD) $(PURIFY_OPTIONS)
-  ifdef LIBRARY
-    CFLAGS_COMMON += -K PIC
-  endif
-endif
-
-#
-# Different "levels" of optimization.
-#
-ifeq ($(CC_VERSION),gcc)
-  
-  CC_OPT/NONE     =
-  CC_OPT/LOWER    = -O2
-  CC_OPT/HIGHER   = -O3
-  CC_OPT/HIGHEST  = -O3
-
-  CXX_OPT/NONE    =
-  CXX_OPT/LOWER   = -O2
-  CXX_OPT/HIGHER  = -O3
-  CXX_OPT/HIGHEST = -O3
-
-  CFLAGS_REQUIRED_i586  += -fno-omit-frame-pointer
-  CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer
-  
-  # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
-  #   (See Rules.gmk) May need to wait for gcc 5?
-  AUTOMATIC_PCH_OPTION = 
-
-else
-  
-  # Highest could be -xO5, but indications are that -xO5 should be reserved
-  #    for a per-file use, on sources with known performance impacts.
-  OPT_LEVEL/LOWER    = 2
-  OPT_LEVEL/HIGHER   = 4
-  OPT_LEVEL/HIGHEST  = 4
-  
-  CC_OPT/NONE     =
-  CC_OPT/LOWER    = $(OPT_LEVEL/LOWER:%=-xO%)
-  CC_OPT/HIGHER   = $(OPT_LEVEL/HIGHER:%=-xO%)
-  CC_OPT/HIGHEST  = $(OPT_LEVEL/HIGHEST:%=-xO%)
-  
-  CXX_OPT/NONE    =
-  CXX_OPT/LOWER   = $(OPT_LEVEL/LOWER:%=-xO%)
-  CXX_OPT/HIGHER  = $(OPT_LEVEL/HIGHER:%=-xO%)
-  CXX_OPT/HIGHEST = $(OPT_LEVEL/HIGHEST:%=-xO%)
-    
-  # We need stack frames at all times
-  USE_XKEEPFRAME_OPTION = false
-  ifeq ($(USE_XKEEPFRAME_OPTION),true)
-    
-    # Unknown spelling on this option at this time (Maybe in SS13?)
-    CC_XKEEPFRAME_OPTIONS  = -xkeepframe
-    CXX_XKEEPFRAME_OPTIONS = -xkeepframe
-  
-  else
-  
-    # On X86, make sure tail call optimization is off
-    #    The z and y are the tail call optimizations.
-    ifeq ($(ARCH_FAMILY), i586)
-      CC_NEWER_THAN_58 := \
-        $(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \
-	    \( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 8 \) )
-      ifeq ($(CC_NEWER_THAN_58),1)
-        #    Somehow, tail call optimization is creeping in.
-        #    Make sure it is off.
-        # WARNING: These may cause compiler warnings about duplicate -O options
-        CC_XKEEPFRAME_OPTIONS  += -Wu,-O$(OPT_LEVEL/$(OPTIMIZATION_LEVEL))~yz
-        CXX_XKEEPFRAME_OPTIONS += -Qoption ube -O$(OPT_LEVEL/$(OPTIMIZATION_LEVEL))~yz
-      endif
-    endif
-  
-    #  On i586 we need to tell the code generator to ALWAYS use a
-    #   frame pointer.
-    ifeq ($(ARCH_FAMILY), i586)
-      # Note that in 5.7, this is done with -xregs=no%frameptr
-      ifeq ($(CC_VER), 5.5)
-        # It's not exactly clear when this optimization kicks in, the
-        #   current assumption is -xO4 or greater and for C++ with
-        #   the -features=no%except option and -xO4 and greater.
-        #   Bottom line is, we ALWAYS want a frame pointer!
-        CC_XKEEPFRAME_OPTIONS  += -Wu,-Z~B
-        CXX_XKEEPFRAME_OPTIONS += -Qoption ube -Z~B
-      endif
-
-      CC_NEWER_THAN_56 := \
-        $(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \
-	    \( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 6 \) )
-      ifeq ($(CC_NEWER_THAN_56),1)
-        # Do NOT use frame pointer register as a general purpose opt register
-        CC_OPT/NONE            += -xregs=no%frameptr
-        CXX_OPT/NONE           += -xregs=no%frameptr
-        CC_XKEEPFRAME_OPTIONS  += -xregs=no%frameptr
-        CXX_XKEEPFRAME_OPTIONS += -xregs=no%frameptr
-      endif
-    endif
-  
-    #  Optimizer for sparc needs to be told not to do certain things
-    #   related to frames or save instructions.
-    ifeq ($(ARCH_FAMILY), sparc)
-      #  Do not use save instructions instead of add instructions
-      #  This was an optimization starting in SC5.0 that made it hard for us to
-      #    find the "save" instruction (which got turned into an "add")
-      CC_XKEEPFRAME_OPTIONS  += -Wc,-Qrm-s
-      CXX_XKEEPFRAME_OPTIONS += -Qoption cg -Qrm-s
-      # Don't allow tail call code optimization. Started in SC5.0.
-      #    We don't like code of this form:
-      #	save
-      #	<code>
-      #	call foo
-      #	   restore
-      #   because we can't tell if the method will have a stack frame
-      #   and register windows or not.
-      CC_XKEEPFRAME_OPTIONS  += -Wc,-Qiselect-T0
-      CXX_XKEEPFRAME_OPTIONS += -Qoption cg -Qiselect-T0
-    endif
-  
-  endif
-
-  # Extra options used with HIGHEST
-  #
-  # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
-  #          done with care, there are some assumptions below that need to
-  #          be understood about the use of pointers, and IEEE behavior.
-  #
-  # Use non-standard floating point mode (not IEEE 754)
-  CC_HIGHEST_EXTRAS += -fns
-  # Do some simplification of floating point arithmetic (not IEEE 754)
-  CC_HIGHEST_EXTRAS += -fsimple
-  # Use single precision floating point with 'float'
-  CC_HIGHEST_EXTRAS += -fsingle
-  # Assume memory references via basic pointer types do not alias
-  #   (Source with excessing pointer casting and data access with mixed 
-  #    pointer types are not recommended)
-  CC_HIGHEST_EXTRAS += -xalias_level=basic
-  # Use intrinsic or inline versions for math/std functions
-  #   (If you expect perfect errno behavior, do not use this)
-  CC_HIGHEST_EXTRAS += -xbuiltin=%all
-  # Loop data dependency optimizations (need -xO3 or higher)
-  CC_HIGHEST_EXTRAS += -xdepend
-  # Pointer parameters to functions do not overlap
-  #   (Similar to -xalias_level=basic usage, but less obvious sometimes.
-  #    If you pass in multiple pointers to the same data, do not use this)
-  CC_HIGHEST_EXTRAS += -xrestrict
-  # Inline some library routines
-  #   (If you expect perfect errno behavior, do not use this)
-  CC_HIGHEST_EXTRAS += -xlibmil
-  # Use optimized math routines
-  #   (If you expect perfect errno behavior, do not use this)
-  #  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
-  #  CC_HIGHEST_EXTRAS += -xlibmopt
-  ifeq ($(ARCH_FAMILY), sparc)
-    # Assume at most 8byte alignment, raise SIGBUS on error
-    ### Presents an ABI issue with customer JNI libs?
-    ####CC_HIGHEST_EXTRAS  += -xmemalign=8s
-    # Automatic prefetch instructions, explicit prefetch macros
-    CC_HIGHEST_EXTRAS += -xprefetch=auto,explicit
-    # Pick ultra as the chip to optimize to
-    CC_HIGHEST_EXTRAS += -xchip=ultra
-  endif
-  ifeq ($(ARCH), i586)
-    # Pick pentium as the chip to optimize to
-    CC_HIGHEST_EXTRAS += -xchip=pentium
-  endif
-  ifdef LIBRARY
-    # The Solaris CBE (Common Build Environment) requires that the use
-    # of appl registers be disabled when compiling a public library (or
-    # a library that's loaded by a public library) on sparc.
-    CFLAGS_REQUIRED_sparc    += -xregs=no%appl
-    CFLAGS_REQUIRED_sparcv9  += -xregs=no%appl
-  endif
-  CC_NEWER_THAN_56 := \
-    $(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \
-         \( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 6 \) )
-  ifeq ($(CC_NEWER_THAN_56),1)
-    #     Presents an ABI issue with customer JNI libs? We must be able to
-    #     to handle 4byte aligned objects? (rare occurance, but possible?)
-    CFLAGS_REQUIRED_sparc += -xmemalign=4s
-  endif
-  # Just incase someone trys to use the SOS9 compilers
-  ifeq ($(CC_VER), 5.6)
-    # We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s)
-    CFLAGS_REQUIRED_sparc += -xmemalign=4s
-  endif
-  # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
-  #   (See Rules.gmk) The SS11 -xpch=auto* options appear to be broken.
-  AUTOMATIC_PCH_OPTION =
-  
-  # Add in keep frame options
-  CC_OPT/LOWER    += $(CC_XKEEPFRAME_OPTIONS)
-  CC_OPT/HIGHER   += $(CC_XKEEPFRAME_OPTIONS)
-  CC_OPT/HIGHEST  += $(CC_XKEEPFRAME_OPTIONS)
-  CXX_OPT/LOWER   += $(CXX_XKEEPFRAME_OPTIONS)
-  CXX_OPT/HIGHER  += $(CXX_XKEEPFRAME_OPTIONS)
-  CXX_OPT/HIGHEST += $(CXX_XKEEPFRAME_OPTIONS)
- 
-  # Add in highest optimization settings
-  CC_OPT/HIGHEST  += $(CC_HIGHEST_EXTRAS)
-  CXX_OPT/HIGHEST += $(CC_HIGHEST_EXTRAS)
-  
-endif
-
-# Default optimization settings based on level.
-CC_OPT  = $(CC_OPT/$(OPTIMIZATION_LEVEL))
-CXX_OPT = $(CXX_OPT/$(OPTIMIZATION_LEVEL))
-
-# Flags required all the time
-CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
-
-#
-# Path and option to link against the VM, if you have to.  Note that
-# there are libraries that link against only -ljava, but they do get
-# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
-# the library itself should not.
-#
-VM_NAME         = server
-JVMLIB          = -L$(LIBDIR)/$(LIBARCH)/server -L$(LIBDIR)/$(LIBARCH)/client -ljvm
-JAVALIB         = -ljava $(JVMLIB)
-
-# Part of INCREMENTAL_BUILD mechanism.
-#   Compiler emits things like:  path/file.o: file.h
-#   We want something like: relative_path/file.o relative_path/file.d: file.h
-#   In addition on Solaris, any include file starting with / is deleted,
-#   this gets rid of things like /usr/include files, which never change.
-CC_DEPEND	 = -xM1
-CC_DEPEND_FILTER = $(SED) -e '/:[ 	]*[/]/d' -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' | $(SORT) -u
-
-# Location of openwin libraries (do we really need this anymore?)
-OPENWIN_HOME    = /usr/openwin
-OPENWIN_LIB     = $(OPENWIN_HOME)/lib$(ISA_DIR)
-
-# Runtime graphics library search paths...
-OPENWIN_RUNTIME_LIB = /usr/openwin/lib$(ISA_DIR)
-AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB)
-
-# C++ Runtime library (libCrun.so), use instead of -lCrun.
-#    Originally used instead of -lCrun to guarantee use of the system
-#    .so version and not the .a or .so that came with the compilers.
-#    With the newer compilers this could probably change back to -lCrun but
-#    in general this is ok to continue to do.
-LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1
-
-# JDK now requires Solaris 10, so pick up libm.so.2
-LIBM = /usr/lib$(ISA_DIR)/libm.so.2
-
-# Socket library
-LIBSOCKET = -lsocket
-
-# Network Services library
-LIBNSL = -lnsl
-
-# service configuration facility library
-LIBSCF = -lscf
-
-# Dynamic Loading library
-LIBDL = -ldl
-
-# GLOBAL_KPIC: If set means all libraries are PIC, position independent code
-#    EXCEPT for select compiles
-#    If a .o file is compiled non-PIC then it should be forced
-#	   into the RW data segment with a mapfile option. This is done
-#    with object files which generated from .s files.
-#    The -ztext enforces that no relocations remain in the text segment
-#    so that it remains purely read-only for optimum system performance.
-#    Some libraries may use a smaller size (13bit -Kpic) on sparc instead of 
-#    (32 bit -KPIC) and will override GLOBAL_KPIC appropriately.
-#
-PIC_CODE_LARGE   = -KPIC
-PIC_CODE_SMALL   = -Kpic
-ifndef TCOV_BUILD
-    GLOBAL_KPIC      = $(PIC_CODE_LARGE)
-    CXXFLAGS_COMMON += $(GLOBAL_KPIC)
-    CFLAGS_COMMON   += $(GLOBAL_KPIC)
-    LDFLAGS_COMMON  += -ztext
-endif # TCOV_BUILD
-
-# If your platform has DPS, it will have Type1 fonts too, in which case
-# it is best to enable DPS support until such time as 2D's rasteriser
-# can fully handle Type1 fonts in all cases. Default is "yes".
-# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
-# DPS (Displayable PostScript) is available on Solaris machines
-
-HAVE_DPS = yes
-
-#
-# Japanese manpages
-#
-JA_SOURCE_ENCODING = eucJP
-JA_TARGET_ENCODINGS = eucJP UTF-8 PCK
-
-# Settings for the JDI - Serviceability Agent binding.
-HOTSPOT_SALIB_PATH   = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
-SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
-SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo
-INCLUDE_SA=true
-
--- a/makefiles/common/Defs-windows.gmk	Tue Jul 10 11:41:40 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,418 +0,0 @@
-#
-# Copyright (c) 1999, 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 to specify compiler flags for programs and libraries
-# targeted to Windows builds.  Should not contain any rules.
-#
-# WARNING: This file is shared with other workspaces. 
-#          So when it includes other files, it must use JDK_TOPDIR.
-#
-
-# Get shared JDK settings
-include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
-
-# CC compiler object code output directive flag value
-CC_OBJECT_OUTPUT_FLAG = -Fo
-
-# The suffix applied to the library name for FDLIBM
-FDDLIBM_SUFFIX = lib
-# The suffix applied to scripts (.bat for windows, nothing for unix)
-SCRIPT_SUFFIX = .bat
-
-# LIB_LOCATION, which for windows identifies where .exe files go, may be
-# set by each GNUmakefile. The default is BINDIR.
-ifndef LIB_LOCATION
-  LIB_LOCATION = $(BINDIR)
-endif # LIB_LOCATION
-
-ifndef PLATFORM_SRC
-  PLATFORM_SRC  = $(BUILDDIR)/../src/windows
-endif # PLATFORM_SRC
-
-# Platform specific closed sources
-ifndef OPENJDK
-  ifndef CLOSED_PLATFORM_SRC
-    CLOSED_PLATFORM_SRC  = $(BUILDDIR)/../src/closed/windows
-  endif
-endif
-
-# for backwards compatability, the old "win32" is used here instead of 
-# the more proper "windows"
-PLATFORM_INCLUDE_NAME = win32
-PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
-
-# The following DLL's are considered MS runtime libraries and should
-#     not to be REBASEd, see deploy/make/common/Release.gmk.
-#     msvcr*.dll: Microsoft runtimes
-ifeq ($(COMPILER_VERSION), VS2010)
-  MSVCRNN_DLL = msvcr100.dll
-  MSVCPNN_DLL = msvcp100.dll
-endif
-
-EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH)
-
-# C Compiler flag definitions
-
-#
-# Default optimization
-#
-
-ifndef OPTIMIZATION_LEVEL
-  ifeq ($(PRODUCT), java)
-    OPTIMIZATION_LEVEL = HIGHER
-  else
-    OPTIMIZATION_LEVEL = LOWER
-  endif
-endif
-ifndef FASTDEBUG_OPTIMIZATION_LEVEL
-  FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
-endif
-
-ifeq ($(CC_VERSION),msvc)
-  # Visual Studio compiler option definitions:
-  #   -O1      Favors reduced size over speed (-Og     -Os -Oy -Ob2 -Gs -GF -Gy)
-  #   -O2      Favors speed over reduced size (-Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy)
-  #   -Ob2     More aggressive inlining
-  #   -Og      Global optimizations
-  #   -Oi      Replace some functions with intrinsic or special forms
-  #   -fp:precise (should be the default)
-  #            Improve floating point calculations (disables some optimizations)
-  #   -Os      Favor small code
-  #   -Ot      Favor faster code
-  #   -Oy      Frame pointer omission
-  #   -G6      Used to be -GB?
-  #   -GF      Pool strings in read-only memory
-  #   -Gf      Pool strings in read-write memory (the default)
-  #   -Gs      Controls stack probess
-  #   -GS      Adds buffer overflow checks on stacks (the default)
-  #   -EHsc    Enables exception handling 
-  #   -Gy      Function level linking only
-  #
-
-  CC_OPT/NONE    = -Od
-  CC_OPT/LOWER   = -O2
-  CC_OPT/HIGHER  = -O3
-  CC_OPT/HIGHEST = -O3
-  
-  ifeq ($(COMPILER_VERSION), VS2010)
-    # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
-    AUTOMATIC_PCH_OPTION =
-    GX_OPTION = -EHsc
-    GZ_OPTION = -RTC1
-    ifeq ($(ARCH_DATA_MODEL), 32)
-      CC_OPT/HIGHEST = -O2
-      CC_OPT/HIGHER  = -O1
-      CC_OPT/LOWER   = -O1
-    else
-      CC_OPT/HIGHEST = -O2
-      CC_OPT/HIGHER  = -O1
-      CC_OPT/LOWER   = -O1
-    endif
-  endif
-
-else # CC_VERSION
-  # GCC not supported, but left for historical reference...
-  CC_OPT/NONE     =
-  CC_OPT/LOWER    = -O2
-  CC_OPT/HIGHER   = -O2
-  CC_OPT/HIGHEST  = -O3
-
-endif
-
-CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
-
-# Select the runtime support library carefully, need to be consistent
-#
-# Visual Studio Runtime compiler option definitions:
-#   -MD        Use dynamic multi-threaded runtime library
-#   -MDd       Use debug version (don't use, doesn't mix with -MD DLL's)
-#   -MT        Use static multi-threaded runtime library (-ML is going away)
-#   -MTd       Use static debug version (better than -MDd, no runtime issues)
-#   -D_DEBUG   Change use of malloc/free/etc to use special debug ones (-MTd)
-#
-#      NOTE: We also will use /D _STATIC_CPPLIB  so we don't need msvcpnn.dll
-#
-# If MS_RUNTIME_STATIC is requested we may have a problem, it is no longer
-#     supported by VS2010
-ifneq ($(MS_RUNTIME_STATIC),true)
-  MS_RUNTIME_OPTION=-MD
-endif
-# The _DEBUG macro option (changes things like malloc to use debug version)
-MS_RUNTIME_DEBUG_OPTION=
-MS_RC_DEBUG_OPTION=
-# Externally set environment variable can force any build to use the debug vers
-ifeq ($(MFC_DEBUG), true)
-  ifeq ($(MS_RUNTIME_STATIC),true)
-    MS_RUNTIME_OPTION=-MTd
-  else
-    # This MS debugging flag forces a dependence on the debug
-    #     version of the runtime library (MSVCR*D.DLL), as does -MDd.
-    #     We cannot re-distribute this debug runtime.
-    MS_RUNTIME_OPTION=-MDd
-  endif
-  MS_RUNTIME_DEBUG_OPTION= -D_DEBUG
-  MS_RC_DEBUG_OPTION= -d _DEBUG
-endif
-
-# Always add _STATIC_CPPLIB definition
-STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
-
-# Silence the warning about using _STATIC_CPPLIB
-ifneq ($(SHOW_ALL_WARNINGS),true)
-  # Needed with VS2010 to turn off the deprecated warning.
-  STATIC_CPPLIB_OPTION += /D _DISABLE_DEPRECATE_STATIC_CPPLIB
-endif
-
-MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
-
-ifeq ($(CC_VERSION),msvc)
-  # Visual Studio compiler option definitions:
-  #   -Zi      Cause *.pdb file to be created, full debug information
-  #   -Z7      Full debug inside the .obj, no .pdb
-  #   -Zd      Basic debug, no local variables? In the .obj
-  #   -Zl      Don't add runtime library name to obj file?
-  #   -Od      Turns off optimization and speeds compilation
-  #   -YX -Fp/.../foobar.pch   Use precompiled headers (try someday?)
-  #   -nologo  Don't print out startup message
-  #   /D _STATIC_CPPLIB
-  #            Use static link for the C++ runtime (so msvcpnn.dll not needed)
-  #   
-  CFLAGS_COMMON  += -Zi -nologo
-  CFLAGS_OPT      = $(CC_OPT)
-  CFLAGS_DBG      = -Od $(MS_RUNTIME_DEBUG_OPTION)
-
-  CFLAGS_VS2010 += -Zc:wchar_t-
-
-  # All builds get the same runtime setting
-  CFLAGS_COMMON += $(MS_RUNTIME_OPTION) $(CFLAGS_$(COMPILER_VERSION))
-
-  LDEBUG = /debug
-  
-  ifeq ($(VTUNE_SUPPORT), true)
-    OTHER_CFLAGS = -Z7 -Ox 
-    LDEBUG += /pdb:NONE
-  endif
-  
-  # VS2010, always need safe exception handlers, not needed on 64bit
-  ifeq ($(ARCH_DATA_MODEL), 32)
-    LFLAGS_VS2010 +=  -SAFESEH
-  endif
-
-  # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file
-  BASELFLAGS = -nologo /opt:REF /incremental:no
-
-  LFLAGS = $(BASELFLAGS) $(LDEBUG) $(EXTRA_LFLAGS) $(LFLAGS_$(COMPILER_VERSION))
-  LDDFLAGS += $(LFLAGS_$(COMPILER_VERSION))
-  
-endif
-
-#
-# Preprocessor macro definitions
-#
-CPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN
-ifeq ($(ARCH), amd64)
-  CPPFLAGS_COMMON += -D_AMD64_ -Damd64
-else
-  CPPFLAGS_COMMON += -D_X86_ -Dx86 
-endif
-CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN
-
-#
-# Output options (use specific filenames to avoid parallel compile errors)
-#
-CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map
-
-#
-# Use -wdNNNN to disable warning NNNN.
-#   C4800 is a warning about bool performance casts (can't make go away)
-#
-COMPILER_WARNINGS_TO_IGNORE = 4800
-CFLAGS_COMMON += $(COMPILER_WARNINGS_TO_IGNORE:%=-wd%)
-
-#
-# Treat compiler warnings as errors, if requested
-#
-CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
-ifeq ($(COMPILER_WARNINGS_FATAL),true)
-  CFLAGS_COMMON += -WX
-endif
-
-# Turn off some warnings by default, enable them all if asked.
-ifneq ($(SHOW_ALL_WARNINGS),true)
-  # The -D _CRT_SECURE_NO_DEPRECATE turns off security/deprecated warnings on
-  #    the standard C library functions like strcpy.
-  CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE
-  # The -D _CRT_NONSTDC_NO_DEPRECATE turns off deprecation warnings about using
-  #    non-standard C POSIX functions.
-  CFLAGS_COMMON += -D _CRT_NONSTDC_NO_DEPRECATE
-endif
-
-CPPFLAGS_OPT    = -DNDEBUG
-CPPFLAGS_DBG    = -DDEBUG -DLOGGING
-
-CXXFLAGS_COMMON = $(CFLAGS_COMMON)
-CXXFLAGS_OPT    = $(CFLAGS_OPT)
-CXXFLAGS_DBG    = $(CFLAGS_DBG)
-