changeset 21522:bf65f0da83ea

Merge
author mgronlun
date Sat, 02 Nov 2013 20:56:18 +0100
parents 383a7952de74 4dd78cfa5bad
children f47792fe6c72 20b1821f4fbd
files
diffstat 46 files changed, 841 insertions(+), 594 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Nov 01 17:10:31 2013 +0000
+++ b/.hgtags	Sat Nov 02 20:56:18 2013 +0100
@@ -234,3 +234,4 @@
 b5d2bf482a3ea1cca08c994512804ffbc73de0a1 jdk8-b110
 b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111
 ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112
+4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113
--- a/.hgtags-top-repo	Fri Nov 01 17:10:31 2013 +0000
+++ b/.hgtags-top-repo	Sat Nov 02 20:56:18 2013 +0100
@@ -234,3 +234,4 @@
 4faa09c7fe555de086dd9048d3c5cc92317d6f45 jdk8-b110
 d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111
 547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112
+6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113
--- a/common/autoconf/basics.m4	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/autoconf/basics.m4	Sat Nov 02 20:56:18 2013 +0100
@@ -656,7 +656,7 @@
   fi
 
   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
-  BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil)
+    BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil)
     BASIC_REQUIRE_PROG(XATTR, xattr)
     AC_PATH_PROG(CODESIGN, codesign)
     if test "x$CODESIGN" != "x"; then
--- a/common/autoconf/generated-configure.sh	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/autoconf/generated-configure.sh	Sat Nov 02 20:56:18 2013 +0100
@@ -869,6 +869,7 @@
 ZERO_ARCHDEF
 DEFINE_CROSS_COMPILE_ARCH
 LP64
+OPENJDK_TARGET_OS_EXPORT_DIR
 OPENJDK_TARGET_OS_API_DIR
 OPENJDK_TARGET_CPU_JLI_CFLAGS
 OPENJDK_TARGET_CPU_OSARCH
@@ -3864,7 +3865,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1382540536
+DATE_WHEN_GENERATED=1382702260
 
 ###############################################################################
 #
@@ -7149,6 +7150,13 @@
   fi
 
 
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+      OPENJDK_TARGET_OS_EXPORT_DIR=macosx
+  else
+      OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR}
+  fi
+
+
   if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
     A_LP64="LP64:="
     # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
@@ -29638,7 +29646,7 @@
       -I${JDK_OUTPUTDIR}/include \
       -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
       -I${JDK_TOPDIR}/src/share/javavm/export \
-      -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \
+      -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \
       -I${JDK_TOPDIR}/src/share/native/common \
       -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
 
@@ -29905,11 +29913,11 @@
   elif test "x$enable_debug_symbols" = "xno"; then
     ENABLE_DEBUG_SYMBOLS=false
   else
-  # Default is on if objcopy is found
-  if test "x$OBJCOPY" != x; then
-    ENABLE_DEBUG_SYMBOLS=true
-  # MacOS X and Windows don't use objcopy but default is on for those OSes
-  elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
+    # Default is on if objcopy is found
+    if test "x$OBJCOPY" != x; then
+      ENABLE_DEBUG_SYMBOLS=true
+    # MacOS X and Windows don't use objcopy but default is on for those OSes
+    elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
       ENABLE_DEBUG_SYMBOLS=true
     else
       ENABLE_DEBUG_SYMBOLS=false
@@ -34245,10 +34253,10 @@
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
     PREV_CXXCFLAGS="$CXXFLAGS"
-    PREV_LDFLAGS="$LDFLAGS"
+    PREV_LIBS="$LIBS"
     PREV_CXX="$CXX"
     CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
-    LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
+    LIBS="$LIBS $FREETYPE_LIBS"
     CXX="$FIXPATH $CXX"
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -34315,7 +34323,7 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
     CXXCFLAGS="$PREV_CXXFLAGS"
-    LDFLAGS="$PREV_LDFLAGS"
+    LIBS="$PREV_LIBS"
     CXX="$PREV_CXX"
     ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
--- a/common/autoconf/jdk-options.m4	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/autoconf/jdk-options.m4	Sat Nov 02 20:56:18 2013 +0100
@@ -516,11 +516,11 @@
   elif test "x$enable_debug_symbols" = "xno"; then
     ENABLE_DEBUG_SYMBOLS=false
   else
-  # Default is on if objcopy is found
-  if test "x$OBJCOPY" != x; then
-    ENABLE_DEBUG_SYMBOLS=true
-  # MacOS X and Windows don't use objcopy but default is on for those OSes
-  elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
+    # Default is on if objcopy is found
+    if test "x$OBJCOPY" != x; then
+      ENABLE_DEBUG_SYMBOLS=true
+    # MacOS X and Windows don't use objcopy but default is on for those OSes
+    elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
       ENABLE_DEBUG_SYMBOLS=true
     else
       ENABLE_DEBUG_SYMBOLS=false
--- a/common/autoconf/libraries.m4	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/autoconf/libraries.m4	Sat Nov 02 20:56:18 2013 +0100
@@ -481,10 +481,10 @@
     AC_MSG_CHECKING([if we can compile and link with freetype])
     AC_LANG_PUSH(C++)
     PREV_CXXCFLAGS="$CXXFLAGS"
-    PREV_LDFLAGS="$LDFLAGS"
+    PREV_LIBS="$LIBS"
     PREV_CXX="$CXX"
     CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" 
-    LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
+    LIBS="$LIBS $FREETYPE_LIBS"
     CXX="$FIXPATH $CXX"
     AC_LINK_IFELSE([AC_LANG_SOURCE([[
           #include<ft2build.h>
@@ -508,7 +508,7 @@
         ]
     )
     CXXCFLAGS="$PREV_CXXFLAGS"
-    LDFLAGS="$PREV_LDFLAGS"
+    LIBS="$PREV_LIBS"
     CXX="$PREV_CXX"
     AC_LANG_POP(C++)
 
--- a/common/autoconf/platform.m4	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/autoconf/platform.m4	Sat Nov 02 20:56:18 2013 +0100
@@ -327,6 +327,13 @@
   fi
   AC_SUBST(OPENJDK_TARGET_OS_API_DIR)
 
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+      OPENJDK_TARGET_OS_EXPORT_DIR=macosx
+  else
+      OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR}
+  fi
+  AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR)
+
   if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
     A_LP64="LP64:="
     # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
--- a/common/autoconf/spec.gmk.in	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/autoconf/spec.gmk.in	Sat Nov 02 20:56:18 2013 +0100
@@ -92,6 +92,7 @@
 OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@
 OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@
 OPENJDK_TARGET_OS_API_DIR:=@OPENJDK_TARGET_OS_API_DIR@
+OPENJDK_TARGET_OS_EXPORT_DIR:=@OPENJDK_TARGET_OS_EXPORT_DIR@
 
 # We are building on this build system.
 # When not cross-compiling, it is the same as the target.
--- a/common/autoconf/toolchain.m4	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/autoconf/toolchain.m4	Sat Nov 02 20:56:18 2013 +0100
@@ -942,7 +942,7 @@
       -I${JDK_OUTPUTDIR}/include \
       -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
       -I${JDK_TOPDIR}/src/share/javavm/export \
-      -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \
+      -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \
       -I${JDK_TOPDIR}/src/share/native/common \
       -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
 
--- a/common/makefiles/JavaCompilation.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/makefiles/JavaCompilation.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -506,30 +506,30 @@
 
     $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS)
 	$(MKDIR) -p $$(@D)
-	$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
+	$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp)
 	$(ECHO) Compiling $1
 	($$($1_JVM) $$($1_SJAVAC) \
 	    $$($1_REMOTE) \
 	    -j $(JOBS) \
 	    --permit-unidentified-artifacts \
 	    --permit-sources-without-package \
-	    --compare-found-sources $$($1_BIN)/_the.batch.tmp \
+	    --compare-found-sources $$($1_BIN)/_the.$1_batch.tmp \
 	    --log=$(LOG_LEVEL) \
 	    $$($1_SJAVAC_ARGS) \
 	    $$($1_FLAGS) \
 	    $$($1_HEADERS_ARG) \
 	    -d $$($1_BIN) && \
-	$(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
+	$(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch)
   else
     # Using plain javac to batch compile everything.
-    $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch
+    $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.$1_batch
 
     # When building in batch, put headers in a temp dir to filter out those that actually
     # changed before copying them to the real header dir.
     ifneq (,$$($1_HEADERS))
       $1_HEADERS_ARG := -h $$($1_HEADERS).tmp
 
-      $$($1_HEADERS)/_the.headers: $$($1_BIN)/_the.batch
+      $$($1_HEADERS)/_the.$1_headers: $$($1_BIN)/_the.$1_batch
 		$(MKDIR) -p $$(@D)
 		for f in `ls $$($1_HEADERS).tmp`; do \
 		  if [ ! -f "$$($1_HEADERS)/$$$$f" ] || [ "`$(DIFF) $$($1_HEADERS)/$$$$f $$($1_HEADERS).tmp/$$$$f`" != "" ]; then \
@@ -539,19 +539,19 @@
 		$(RM) -r $$($1_HEADERS).tmp
 		$(TOUCH) $$@
 
-      $1 += $$($1_HEADERS)/_the.headers
+      $1 += $$($1_HEADERS)/_the.$1_headers
     endif
 
     # When not using sjavac, pass along all sources to javac using an @file.
-    $$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS)
+    $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS)
 	$(MKDIR) -p $$(@D)
-	$(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp
-	$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
-	$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
+	$(RM) $$($1_BIN)/_the.$1_batch $$($1_BIN)/_the.$1_batch.tmp
+	$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp)
+	$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
 	($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \
 	    -implicit:none -sourcepath "$$($1_SRCROOTSC)" \
-	    -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \
-	$(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
+	    -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp && \
+	$(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch)
 
   endif
 
--- a/common/makefiles/NativeCompilation.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/common/makefiles/NativeCompilation.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -435,36 +435,36 @@
 		$(CP) $$< $$@
         endif
 
-                ifneq ($(OPENJDK_TARGET_OS), macosx)   # OBJCOPY is not used on MacOS X
-                  ifneq ($(OPENJDK_TARGET_OS), windows)  # nor on Windows
-                    ifeq ($(OPENJDK_TARGET_OS), solaris)
-                        # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
-                        # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
-                        # empty section headers until a fixed $(OBJCOPY) is available.
-                        # An empty section header has sh_addr == 0 and sh_size == 0.
-                        # This problem has only been seen on Solaris X64, but we call this tool
-                        # on all Solaris builds just in case.
-                        #
-                        # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
-                        # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
-                        $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \
-					    $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
-			    $(RM) $$@
-			    $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
-			    $(OBJCOPY) --only-keep-debug $$< $$@
-			    $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
-                    else # not solaris
-                        $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
-			    $(RM) $$@
-			    $(OBJCOPY) --only-keep-debug $$< $$@
-			    $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
-                    endif # Touch to not retrigger rule on rebuild
+        ifneq ($(OPENJDK_TARGET_OS), macosx)   # OBJCOPY is not used on MacOS X
+          ifneq ($(OPENJDK_TARGET_OS), windows)  # nor on Windows
+            ifeq ($(OPENJDK_TARGET_OS), solaris)
+              # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
+              # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
+              # empty section headers until a fixed $(OBJCOPY) is available.
+              # An empty section header has sh_addr == 0 and sh_size == 0.
+              # This problem has only been seen on Solaris X64, but we call this tool
+              # on all Solaris builds just in case.
+              #
+              # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+              # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
+              $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \
+				$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
+		$(RM) $$@
+		$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
+		$(OBJCOPY) --only-keep-debug $$< $$@
+		$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
+            else # not solaris
+              $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
+		$(RM) $$@
+		$(OBJCOPY) --only-keep-debug $$< $$@
+		$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
+            endif # Touch to not retrigger rule on rebuild
 		$(TOUCH) $$@
-                  endif # !windows
-                endif # !macosx
+          endif # !windows
+        endif # !macosx
 
         ifeq ($(ZIP_DEBUGINFO_FILES), true)
-                  ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
+ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
           $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz
 
           ifeq ($(OPENJDK_TARGET_OS), windows)
@@ -477,12 +477,12 @@
 		$(CD) $$($1_OBJECT_DIR) \
 		&& $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
           endif
-                  endif # no MacOS X support yet
+endif # no MacOS X support yet
         else
           ifeq ($(OPENJDK_TARGET_OS), windows)
             $1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \
                 $$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb
-                    else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files
+          else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files
             $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
           endif
         endif
@@ -519,36 +519,36 @@
 		$(CP) $$< $$@
         endif
 
-                ifneq ($(OPENJDK_TARGET_OS), macosx)   # OBJCOPY is not used on MacOS X
-                  ifneq ($(OPENJDK_TARGET_OS), windows)  # nor on Windows
-                    ifeq ($(OPENJDK_TARGET_OS), solaris)
-                        # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
-                        # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
-                        # empty section headers until a fixed $(OBJCOPY) is available.
-                        # An empty section header has sh_addr == 0 and sh_size == 0.
-                        # This problem has only been seen on Solaris X64, but we call this tool
-                        # on all Solaris builds just in case.
-                        #
-                        # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
-                        # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
-                        $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \
-					    $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
-			    $(RM) $$@
-			    $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
-			    $(OBJCOPY) --only-keep-debug $$< $$@
-			    $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
-                    else # not solaris
-                        $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
-			    $(RM) $$@
-			    $(OBJCOPY) --only-keep-debug $$< $$@
-			    $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
-                    endif
-			    $(TOUCH) $$@
-                  endif # !windows
-                endif # !macosx
+        ifneq ($(OPENJDK_TARGET_OS), macosx)   # OBJCOPY is not used on MacOS X
+          ifneq ($(OPENJDK_TARGET_OS), windows)  # nor on Windows
+            ifeq ($(OPENJDK_TARGET_OS), solaris)
+              # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
+              # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
+              # empty section headers until a fixed $(OBJCOPY) is available.
+              # An empty section header has sh_addr == 0 and sh_size == 0.
+              # This problem has only been seen on Solaris X64, but we call this tool
+              # on all Solaris builds just in case.
+              #
+              # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+              # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
+              $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \
+				$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
+		$(RM) $$@
+		$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
+		$(OBJCOPY) --only-keep-debug $$< $$@
+		$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
+            else # not solaris
+              $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
+		$(RM) $$@
+		$(OBJCOPY) --only-keep-debug $$< $$@
+		$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
+            endif
+		$(TOUCH) $$@
+          endif # !windows
+        endif # !macosx
 
         ifeq ($(ZIP_DEBUGINFO_FILES), true)
-                  ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
+ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
           $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz
 
           ifeq ($(OPENJDK_TARGET_OS), windows)
@@ -561,12 +561,12 @@
 		$(CD) $$($1_OBJECT_DIR) \
 		&& $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo
           endif
-                  endif # no MacOS X support yet
+endif # no MacOS X support yet
         else
           ifeq ($(OPENJDK_TARGET_OS), windows)
             $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \
                 $$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb
-                    else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files
+          else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files
             $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo
           endif
         endif
--- a/corba/.hgtags	Fri Nov 01 17:10:31 2013 +0000
+++ b/corba/.hgtags	Sat Nov 02 20:56:18 2013 +0100
@@ -234,3 +234,4 @@
 3d2b7ce93c5c2e3db748f29c3d29620a8b3b748a jdk8-b110
 85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111
 43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112
+a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113
--- a/hotspot/.hgtags	Fri Nov 01 17:10:31 2013 +0000
+++ b/hotspot/.hgtags	Sat Nov 02 20:56:18 2013 +0100
@@ -389,3 +389,5 @@
 23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55
 4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113
 82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56
+7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114
+3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57
--- a/hotspot/make/hotspot_version	Fri Nov 01 17:10:31 2013 +0000
+++ b/hotspot/make/hotspot_version	Sat Nov 02 20:56:18 2013 +0100
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=25
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=57
+HS_BUILD_NUMBER=58
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=8
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri Nov 01 17:10:31 2013 +0000
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Sat Nov 02 20:56:18 2013 +0100
@@ -4744,6 +4744,10 @@
 // as libawt.so, and renamed libawt_xawt.so
 //
 bool os::is_headless_jre() {
+#ifdef __APPLE__
+    // We no longer build headless-only on Mac OS X
+    return false;
+#else
     struct stat statbuf;
     char buf[MAXPATHLEN];
     char libmawtpath[MAXPATHLEN];
@@ -4775,6 +4779,7 @@
     if (::stat(libmawtpath, &statbuf) == 0) return false;
 
     return true;
+#endif
 }
 
 // Get the default path to the core file
--- a/jaxp/.hgtags	Fri Nov 01 17:10:31 2013 +0000
+++ b/jaxp/.hgtags	Sat Nov 02 20:56:18 2013 +0100
@@ -234,3 +234,4 @@
 4c84c5b447b09aff27f3b72667ab3a5401e85968 jdk8-b110
 17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111
 c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112
+0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113
--- a/jaxws/.hgtags	Fri Nov 01 17:10:31 2013 +0000
+++ b/jaxws/.hgtags	Sat Nov 02 20:56:18 2013 +0100
@@ -234,3 +234,4 @@
 cc682329886be2fc26220fc30597ee4e5bba43ed jdk8-b110
 32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111
 dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112
+9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113
--- a/jdk/.hgtags	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/.hgtags	Sat Nov 02 20:56:18 2013 +0100
@@ -234,3 +234,4 @@
 54e099776f08430d3a7f4feabd9f2ba886b55320 jdk8-b110
 719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111
 f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112
+5b4261b4b72af53e8e178933ef6bc6c7f8cdbc60 jdk8-b113
--- a/jdk/makefiles/BuildJdk.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/BuildJdk.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -80,7 +80,11 @@
         # to execute launchers.
 	+$(MAKE) -f GenerateClasses.gmk
 
-jdk: genclasses
+securityjars: genclasses securityjars-only
+securityjars-only:
+	+$(MAKE) -f CreateSecurityJars.gmk
+
+jdk: securityjars
         # Now we have a complete jdk, which you can run.
         # It is not yet wrapped up as an installed image.
 
--- a/jdk/makefiles/CompileJavaClasses.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/CompileJavaClasses.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -96,11 +96,7 @@
   EXCLUDES += com/oracle/security
 endif
 
-# In the old build, this isn't excluded on macosx, even though it probably
-# should be.
-ifneq ($(OPENJDK_TARGET_OS), macosx)
-  EXFILES += WrapperGenerator.java
-endif
+EXFILES += WrapperGenerator.java
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
   # Exclude Window security related files in src/share/classes
@@ -169,7 +165,11 @@
   EXFILES += sun/awt/AWTCharset.java
 endif
 
-ifneq ($(OPENJDK_TARGET_OS), macosx)
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+  # exclude all X11 on Mac, we can't exclude some like below or we'll have compilation errors
+  EXCLUDES += sun/awt/X11
+else
+  # TBD: figure out how to eliminate this long list
   EXFILES += sun/awt/X11/ScreenFormat.java \
       sun/awt/X11/XArc.java \
       sun/awt/X11/XChar2b.java \
@@ -281,6 +281,19 @@
   EXCLUDES += com/apple/jobjc
 endif
 
+# The security classes should not end up in the classes directory as that will prevent them
+# from working when running the exploded jdk image. Compile them separately to a different
+# directory from where the jars can be created.
+SECURITY_PKGS := \
+    com/oracle/security/ucrypto \
+    com/sun/crypto/provider \
+    javax/crypto \
+    sun/security/ec \
+    sun/security/internal \
+    sun/security/mscapi \
+    sun/security/pkcs11 \
+    #
+
 # The exception handling of swing beaninfo
 # These resources violates the convention of having code and resources together under
 # $(JDK_TOPDIR)/src/.../classes directories
@@ -293,22 +306,46 @@
 # space separated list.
 JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
 
-$(eval $(call SetupJavaCompilation,BUILD_JDK, \
+ifeq ($(ENABLE_SJAVAC),yes)
+  # With sjavac enabled, excluded sources are not even considered for linking. 
+  # Explicitly add the security sources to sourcepath for linking.
+  BUILD_JDK_SOURCEPATH:=$(patsubst %,-i$(SPACE)%.*,$(subst /,.,$(SECURITY_PKGS))) \
+      -sourcepath $(JDK_TOPDIR)/src/share/classes
+endif
+
+$(eval $(call SetupJavaCompilation,BUILD_JDK,\
+    SETUP:=GENERATE_JDKBYTECODE,\
+    SRC:=$(JDK_TOPDIR)/src/share/classes \
+        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
+        $(MACOSX_SRC_DIRS) \
+        $(JDK_OUTPUTDIR)/gensrc \
+        $(JDK_OUTPUTDIR)/gensrc_no_srczip \
+        $(CLOSED_SRC_DIRS),\
+    INCLUDES:=$(JDK_USER_DEFINED_FILTER),\
+    EXCLUDES:=$(EXCLUDES) $(SECURITY_PKGS),\
+    EXCLUDE_FILES:=$(EXFILES),\
+    BIN:=$(JDK_OUTPUTDIR)/classes,\
+    COPY:=$(COPY_PATTERNS),\
+    COPY_FILES:=$(COPY_FILES),\
+    HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers,\
+    ADD_JAVAC_FLAGS:=$(BUILD_JDK_SOURCEPATH)))
+
+##########################################################################################
+
+$(eval $(call SetupJavaCompilation,BUILD_SECURITY, \
     SETUP := GENERATE_JDKBYTECODE, \
     SRC := $(JDK_TOPDIR)/src/share/classes \
-         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
-         $(MACOSX_SRC_DIRS) \
-         $(JDK_OUTPUTDIR)/gensrc \
-         $(JDK_OUTPUTDIR)/gensrc_no_srczip \
-         $(CLOSED_SRC_DIRS), \
-    INCLUDES := $(JDK_USER_DEFINED_FILTER), \
+        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
+        $(MACOSX_SRC_DIRS) \
+        $(CLOSED_SRC_DIRS), \
+    INCLUDES := $(SECURITY_PKGS), \
     EXCLUDES := $(EXCLUDES), \
     EXCLUDE_FILES := $(EXFILES), \
-    BIN := $(JDK_OUTPUTDIR)/classes, \
-    COPY := $(COPY_PATTERNS), \
-    COPY_FILES := $(COPY_FILES), \
+    BIN := $(JDK_OUTPUTDIR)/classes_security, \
     HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers))
 
+$(BUILD_SECURITY): $(BUILD_JDK)
+
 ##########################################################################################
 
 $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
@@ -393,7 +430,7 @@
 
 ##########################################################################################
 
-all: $(BUILD_JDK) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
+all: $(BUILD_JDK) $(BUILD_SECURITY) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
     $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
     $(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \
     $(BUILD_ACCESSBRIDGE_LEGACY)
--- a/jdk/makefiles/CopyFiles.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/CopyFiles.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -48,7 +48,7 @@
 $(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h
 	$(call install-file)
 
-$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export/%.h
+$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_EXPORT_DIR)/javavm/export/%.h
 	$(call install-file)
 
 COPY_FILES = $(H_TARGET_FILES)
--- a/jdk/makefiles/CreateJars.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/CreateJars.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -102,7 +102,6 @@
 # This value should exclude types destined for jars other than rt.jar and resources.jar.
 # When building a Profile this value augments the profile specific exclusions
 RT_JAR_EXCLUDES += \
-    com/oracle/security \
     com/sun/codemodel \
     com/sun/crypto/provider \
     com/sun/istack/internal/tools \
@@ -415,86 +414,6 @@
     CHECK_COMPRESS_JAR := true))
 
 ##########################################################################################
-# Create manifest for security jars
-
-#
-# Include these extra attributes for now, should probably take out.
-#
-JCE_MANIFEST := $(IMAGES_OUTPUTDIR)/lib/_the.security.manifest.mf
-$(JCE_MANIFEST): $(MAINMANIFEST)
-	$(MKDIR) -p $(@D)
-	$(RM) $@ $@.tmp
-	$(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \
-	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
-	    $(MAINMANIFEST) >> $@.tmp
-	$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
-	$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
-	$(MV) $@.tmp $@
-
-##########################################################################################
-# For security and crypto jars, always build the jar, but for closed, install the prebuilt
-# signed version instead of the newly built jar. Unsigned jars are treated as intermediate
-# targets and explicitly added to the JARS list. For open, signing is not needed. See
-# SignJars.gmk for more information.
-#
-# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
-# variable is set to no if these jars can't be built to skip that step of the build.
-# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
-# other way to get the jars than to build them.
-
-SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar
-SUNPKCS11_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunpkcs11.jar
-
-$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
-    SRCS := $(JDK_OUTPUTDIR)/classes, \
-    SUFFIXES := .class, \
-    INCLUDES := sun/security/pkcs11, \
-    JAR := $(SUNPKCS11_JAR_UNSIGNED), \
-    MANIFEST := $(JCE_MANIFEST), \
-    SKIP_METAINF := true))
-
-$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-ifndef OPENJDK
-  SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
-  $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
-	$(install-file)
-else
-  $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
-	$(install-file)
-endif
-
-JARS += $(SUNPKCS11_JAR_UNSIGNED)
-
-##########################################################################################
-
-SUNEC_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunec.jar
-SUNEC_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunec.jar
-
-$(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
-    SRCS := $(JDK_OUTPUTDIR)/classes, \
-    SUFFIXES := .class, \
-    INCLUDES := sun/security/ec, \
-    JAR := $(SUNEC_JAR_UNSIGNED), \
-    MANIFEST := $(JCE_MANIFEST), \
-    SKIP_METAINF := true))
-
-$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-ifndef OPENJDK
-  SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
-  $(SUNEC_JAR_DST): $(SUNEC_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
-	$(install-file)
-else
-  $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
-	$(install-file)
-endif
-
-JARS += $(SUNEC_JAR_UNSIGNED)
-
-##########################################################################################
 
 $(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR, , \
     SRCS := $(JDK_OUTPUTDIR)/classes, \
@@ -507,208 +426,6 @@
 
 ##########################################################################################
 
-SUNJCE_PROVIDER_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunjce_provider.jar
-SUNJCE_PROVIDER_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunjce_provider.jar
-
-ifneq ($(BUILD_CRYPTO), no)
-  $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
-      SRCS := $(JDK_OUTPUTDIR)/classes, \
-      SUFFIXES := .class, \
-      INCLUDES := com/sun/crypto/provider, \
-      JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \
-      MANIFEST := $(JCE_MANIFEST), \
-      SKIP_METAINF := true))
-
-  $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-  JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
-endif
-
-ifndef OPENJDK
-  SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
-  $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
-	$(install-file)
-else
-  $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
-	$(install-file)
-endif
-
-##########################################################################################
-
-JCE_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/jce.jar
-JCE_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/jce.jar
-
-ifneq ($(BUILD_CRYPTO), no)
-  $(eval $(call SetupArchive,BUILD_JCE_JAR, , \
-      SRCS := $(JDK_OUTPUTDIR)/classes, \
-      SUFFIXES := .class, \
-      INCLUDES := javax/crypto sun/security/internal, \
-      JAR := $(JCE_JAR_UNSIGNED), \
-      MANIFEST := $(JCE_MANIFEST), \
-      SKIP_METAINF := true))
-
-  $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-  JARS += $(JCE_JAR_UNSIGNED)
-endif
-
-ifndef OPENJDK
-  JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
-  $(JCE_JAR_DST): $(JCE_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
-	$(install-file)
-else
-  $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
-	$(install-file)
-endif
-
-##########################################################################################
-
-US_EXPORT_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/US_export_policy.jar
-US_EXPORT_POLICY_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/US_export_policy.jar
-
-ifneq ($(BUILD_CRYPTO), no)
-  #
-  # TODO fix so that SetupArchive does not write files into SRCS
-  # then we don't need this extra copying
-
-  # NOTE: We currently do not place restrictions on our limited export
-  # policy. This was not a typo.
-  #
-  US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
-  US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp
-
-  $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
-	$(install-file)
-
-  US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
-
-  $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \
-      SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
-      SUFFIXES := .policy, \
-      JAR := $(US_EXPORT_POLICY_JAR_UNSIGNED), \
-      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
-      SKIP_METAINF := true))
-
-  JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED)
-endif
-
-ifndef OPENJDK
-  $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
-	$(ECHO) $(LOG_INFO) Copying $(@F)
-	$(install-file)
-else
-  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED)
-	$(install-file)
-endif
-
-##########################################################################################
-
-LOCAL_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/local_policy.jar
-LOCAL_POLICY_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/local_policy.jar
-
-ifneq ($(BUILD_CRYPTO), no)
-  #
-  # TODO fix so that SetupArchive does not write files into SRCS
-  # then we don't need this extra copying
-  #
-  LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp
-
-  ifeq ($(UNLIMITED_CRYPTO), true)
-    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
-    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
-    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
-  else
-    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
-    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
-        $(LOCAL_POLICY_JAR_TMP)/default_local.policy
-    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
-  endif
-
-  $(LOCAL_POLICY_JAR_TMP)/%: $(LOCAL_POLICY_JAR_SRC_DIR)/%
-	$(install-file)
-
-  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR, $(LOCAL_POLICY_JAR_DEPS), \
-      SRCS := $(LOCAL_POLICY_JAR_TMP), \
-      SUFFIXES := .policy, \
-      JAR := $(LOCAL_POLICY_JAR_UNSIGNED), \
-      EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
-      SKIP_METAINF := true))
-
-  JARS += $(LOCAL_POLICY_JAR_UNSIGNED)
-endif
-
-ifndef OPENJDK
-  $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
-	$(ECHO) $(LOG_INFO) Copying $(@F)
-	$(install-file)
-else
-  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED)
-	$(install-file)
-endif
-
-##########################################################################################
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
-
-  SUNMSCAPI_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
-  SUNMSCAPI_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/sunmscapi.jar
-
-  $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
-      SRCS := $(JDK_OUTPUTDIR)/classes, \
-      SUFFIXES := .class, \
-      INCLUDES := sun/security/mscapi, \
-      JAR := $(SUNMSCAPI_JAR_UNSIGNED), \
-      MANIFEST := $(JCE_MANIFEST), \
-      SKIP_METAINF := true))
-
-  $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-  ifndef OPENJDK
-    SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
-    $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
-	$(install-file)
-  else
-    $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
-	$(install-file)
-  endif
-
-  JARS += $(SUNMSCAPI_JAR_UNSIGNED)
-
-endif
-
-##########################################################################################
-
-ifeq ($(OPENJDK_TARGET_OS), solaris)
-  ifndef OPENJDK
-
-    UCRYPTO_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/ucrypto.jar
-    UCRYPTO_JAR_UNSIGNED := $(IMAGES_OUTPUTDIR)/unsigned/ucrypto.jar
-    UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
-
-    $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
-        SRCS := $(JDK_OUTPUTDIR)/classes, \
-        SUFFIXES := .class, \
-        INCLUDES := com/oracle/security/ucrypto, \
-        JAR := $(UCRYPTO_JAR_UNSIGNED), \
-        MANIFEST := $(JCE_MANIFEST), \
-        SKIP_METAINF := true))
-
-    $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
-
-    $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
-	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
-	$(install-file)
-
-    JARS += $(UCRYPTO_JAR_UNSIGNED)
-
-  endif
-endif
-
-##########################################################################################
-
 # Get the CLDRVERSION
 include gensrc/GensrcCLDR.gmk
 
@@ -1047,6 +764,13 @@
 
 ##########################################################################################
 
+# This rule copies all jars from jdk/lib/... to images/lib/... to avoid having to track 
+# which jars are where
+$(IMAGES_OUTPUTDIR)/lib/%: $(JDK_OUTPUTDIR)/lib/%
+	$(install-file)
+
+##########################################################################################
+
 # Import nashorn.jar from nashorn dist dir.
 $(IMAGES_OUTPUTDIR)/lib/ext/nashorn.jar: $(NASHORN_DIST)/nashorn.jar
 	$(install-file)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/makefiles/CreateSecurityJars.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -0,0 +1,329 @@
+#
+# Copyright (c) 2013, 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
+include JavaCompilation.gmk
+include Setup.gmk
+
+# The jars created in this file are required for the exploded jdk image to function and
+# cannot wait to be built in the images target.
+
+##########################################################################################
+# Create manifest for security jars
+#
+# Include these extra attributes for now, should probably take out.
+#
+MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
+JCE_MANIFEST := $(JDK_OUTPUTDIR)/lib/_the.security.manifest.mf
+
+$(JCE_MANIFEST): $(MAINMANIFEST)
+	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
+	$(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#" \
+	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
+	    $(MAINMANIFEST) >> $@.tmp
+	$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
+	$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
+	$(MV) $@.tmp $@
+
+##########################################################################################
+# For security and crypto jars, always build the jar, but for closed, install the prebuilt
+# signed version instead of the newly built jar. Unsigned jars are treated as intermediate
+# targets and explicitly added to the JARS list. For open, signing is not needed. See
+# SignJars.gmk for more information.
+#
+# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
+# variable is set to no if these jars can't be built to skip that step of the build.
+# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
+# other way to get the jars than to build them.
+
+SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
+SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunpkcs11.jar
+
+$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
+    SRCS := $(JDK_OUTPUTDIR)/classes_security, \
+    SUFFIXES := .class, \
+    INCLUDES := sun/security/pkcs11, \
+    JAR := $(SUNPKCS11_JAR_UNSIGNED), \
+    MANIFEST := $(JCE_MANIFEST), \
+    SKIP_METAINF := true))
+
+$(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
+
+ifndef OPENJDK
+  SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
+  $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC)
+	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
+	$(install-file)
+else
+  $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
+	$(install-file)
+endif
+
+JARS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
+
+##########################################################################################
+
+SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
+SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunec.jar
+
+$(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
+    SRCS := $(JDK_OUTPUTDIR)/classes_security, \
+    SUFFIXES := .class, \
+    INCLUDES := sun/security/ec, \
+    JAR := $(SUNEC_JAR_UNSIGNED), \
+    MANIFEST := $(JCE_MANIFEST), \
+    SKIP_METAINF := true))
+
+$(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
+
+ifndef OPENJDK
+  SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
+  $(SUNEC_JAR_DST): $(SUNEC_JAR_SRC)
+	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
+	$(install-file)
+else
+  $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
+	$(install-file)
+endif
+
+JARS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
+
+##########################################################################################
+
+SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
+SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunjce_provider.jar
+
+ifneq ($(BUILD_CRYPTO), no)
+  $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
+      SRCS := $(JDK_OUTPUTDIR)/classes_security, \
+      SUFFIXES := .class, \
+      INCLUDES := com/sun/crypto/provider, \
+      JAR := $(SUNJCE_PROVIDER_JAR_UNSIGNED), \
+      MANIFEST := $(JCE_MANIFEST), \
+      SKIP_METAINF := true))
+
+  $(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
+
+  JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
+endif
+
+ifndef OPENJDK
+  SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
+  $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC)
+	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
+	$(install-file)
+else
+  $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
+	$(install-file)
+endif
+
+JARS += $(SUNJCE_PROVIDER_JAR_DST)
+
+##########################################################################################
+
+JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
+JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/jce.jar
+
+ifneq ($(BUILD_CRYPTO), no)
+  $(eval $(call SetupArchive,BUILD_JCE_JAR, , \
+      SRCS := $(JDK_OUTPUTDIR)/classes_security, \
+      SUFFIXES := .class, \
+      INCLUDES := javax/crypto sun/security/internal, \
+      JAR := $(JCE_JAR_UNSIGNED), \
+      MANIFEST := $(JCE_MANIFEST), \
+      SKIP_METAINF := true))
+
+  $(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
+
+  JARS += $(JCE_JAR_UNSIGNED)
+endif
+
+ifndef OPENJDK
+  JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
+  $(JCE_JAR_DST): $(JCE_JAR_SRC)
+	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
+	$(install-file)
+else
+  $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
+	$(install-file)
+endif
+
+JARS += $(JCE_JAR_DST)
+
+##########################################################################################
+
+US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar
+US_EXPORT_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/US_export_policy.jar
+
+ifneq ($(BUILD_CRYPTO), no)
+  #
+  # TODO fix so that SetupArchive does not write files into SRCS
+  # then we don't need this extra copying
+  #
+  # NOTE: We currently do not place restrictions on our limited export
+  # policy. This was not a typo.
+  #
+  US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
+  US_EXPORT_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/US_export_policy_jar.tmp
+
+  $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
+	$(install-file)
+
+  US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
+
+  $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \
+      SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
+      SUFFIXES := .policy, \
+      JAR := $(US_EXPORT_POLICY_JAR_UNSIGNED), \
+      EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+      SKIP_METAINF := true))
+
+  JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED)
+endif
+
+ifndef OPENJDK
+  $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
+	$(ECHO) $(LOG_INFO) Copying $(@F)
+	$(install-file)
+else
+  $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED)
+	$(install-file)
+endif
+
+JARS += $(US_EXPORT_POLICY_JAR_DST)
+
+##########################################################################################
+
+LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
+LOCAL_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/local_policy.jar
+
+ifneq ($(BUILD_CRYPTO), no)
+  #
+  # TODO fix so that SetupArchive does not write files into SRCS
+  # then we don't need this extra copying
+  #
+  LOCAL_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/local_policy_jar.tmp
+
+  ifeq ($(UNLIMITED_CRYPTO), true)
+    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
+    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
+    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
+  else
+    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
+    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
+        $(LOCAL_POLICY_JAR_TMP)/default_local.policy
+    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
+  endif
+
+  $(LOCAL_POLICY_JAR_TMP)/%: $(LOCAL_POLICY_JAR_SRC_DIR)/%
+	$(install-file)
+
+  $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR, $(LOCAL_POLICY_JAR_DEPS), \
+      SRCS := $(LOCAL_POLICY_JAR_TMP), \
+      SUFFIXES := .policy, \
+      JAR := $(LOCAL_POLICY_JAR_UNSIGNED), \
+      EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
+      SKIP_METAINF := true))
+
+  JARS += $(LOCAL_POLICY_JAR_UNSIGNED)
+endif
+
+ifndef OPENJDK
+  $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
+	$(ECHO) $(LOG_INFO) Copying $(@F)
+	$(install-file)
+else
+  $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED)
+	$(install-file)
+endif
+
+JARS += $(LOCAL_POLICY_JAR_DST)
+
+##########################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+
+  SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
+  SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunmscapi.jar
+
+  $(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
+      SRCS := $(JDK_OUTPUTDIR)/classes_security, \
+      SUFFIXES := .class, \
+      INCLUDES := sun/security/mscapi, \
+      JAR := $(SUNMSCAPI_JAR_UNSIGNED), \
+      MANIFEST := $(JCE_MANIFEST), \
+      SKIP_METAINF := true))
+
+  $(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
+
+  ifndef OPENJDK
+    SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
+    $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
+	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
+	$(install-file)
+  else
+    $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
+	$(install-file)
+  endif
+
+  JARS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
+
+endif
+
+##########################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+  ifndef OPENJDK
+
+    UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
+    UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/ucrypto.jar
+    UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
+
+    $(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
+        SRCS := $(JDK_OUTPUTDIR)/classes_security, \
+        SUFFIXES := .class, \
+        INCLUDES := com/oracle/security/ucrypto, \
+        JAR := $(UCRYPTO_JAR_UNSIGNED), \
+        MANIFEST := $(JCE_MANIFEST), \
+        SKIP_METAINF := true))
+
+    $(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
+
+    $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
+	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
+	$(install-file)
+
+    JARS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
+
+  endif
+endif
+
+all: $(JARS)
+
+.PHONY: default all
--- a/jdk/makefiles/GenerateSources.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/GenerateSources.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -66,15 +66,17 @@
 GENSRC += $(GENSRC_EXCEPTIONS)
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
-include gensrc/GensrcIcons.gmk
-GENSRC += $(GENSRC_AWT_ICONS)
+  include gensrc/GensrcIcons.gmk
+  GENSRC += $(GENSRC_AWT_ICONS)
 
-ifeq ($(OPENJDK_TARGET_OS), macosx)
-GENSRC += $(GENSRC_OSX_ICONS)
-endif
+  ifeq ($(OPENJDK_TARGET_OS), macosx)
+    GENSRC += $(GENSRC_OSX_ICONS)
+  endif
 
-include gensrc/GensrcX11Wrappers.gmk
-GENSRC += $(GENSRC_X11WRAPPERS)
+  ifneq ($(OPENJDK_TARGET_OS), macosx)
+    include gensrc/GensrcX11Wrappers.gmk
+    GENSRC += $(GENSRC_X11WRAPPERS)
+  endif
 endif
 
 include gensrc/GensrcCLDR.gmk
--- a/jdk/makefiles/Import.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/Import.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -120,11 +120,11 @@
 $(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-    JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.dSYM) \
-                      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
+  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \
+      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
 else
-    JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
-                      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
+  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
+      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
 endif
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
@@ -140,14 +140,14 @@
       IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
     endif
   endif
-    ifneq ($(OPENJDK_TARGET_OS), macosx)
-        ifeq ($(JVM_VARIANT_MINIMAL1), true)
-            IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
-            ifneq (,$(JSIG_DEBUGINFO))
-                IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
-            endif
-        endif
+  ifneq ($(OPENJDK_TARGET_OS), macosx)
+    ifeq ($(JVM_VARIANT_MINIMAL1), true)
+      IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
+      ifneq (,$(JSIG_DEBUGINFO))
+        IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
+      endif
     endif
+  endif
 endif
 
 $(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
@@ -156,26 +156,26 @@
 	$(LN) -s ../$(@F) $@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-$(INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
+  $(INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-$(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
-	$(RM) $@.tmp $(basename $@).dSYM
-	$(LN) -s ../$(basename $(@F)).dSYM $(basename $@).dSYM
-	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).dSYM
-	$(RM) $(basename $@).dSYM
+	$(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
+	$(LN) -s ../$(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
+	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM
+	$(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
 	$(MV) $@.tmp $@
 else
-$(INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
+  $(INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-$(INSTALL_LIBRARIES_HERE)/server/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(INSTALL_LIBRARIES_HERE)/server/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(RM) $@.tmp $(basename $@).debuginfo
@@ -191,26 +191,26 @@
 	$(LN) -s ../$(@F) $@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-$(INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
+  $(INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-$(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
-	$(RM) $@.tmp $(basename $@).dSYM
-	$(LN) -s ../$(basename $(@F)).dSYM $(basename $@).dSYM
-	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).dSYM
-	$(RM) $(basename $@).dSYM
+	$(RM) $@.tmp $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
+	$(LN) -s ../$(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
+	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F))$(SHARED_LIBRARY_SUFFIX).dSYM
+	$(RM) $(basename $@)$(SHARED_LIBRARY_SUFFIX).dSYM
 	$(MV) $@.tmp $@
 else
-$(INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
+  $(INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-$(INSTALL_LIBRARIES_HERE)/client/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(INSTALL_LIBRARIES_HERE)/client/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(RM) $@.tmp $(basename $@).debuginfo
@@ -226,12 +226,12 @@
 	$(LN) -s ../$(@F) $@
 
 ifneq ($(OPENJDK_TARGET_OS), macosx)
-$(INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
+  $(INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../$(@F) $@
 
-$(INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
+  $(INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(RM) $@.tmp $(basename $@).debuginfo
--- a/jdk/makefiles/SignJars.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/SignJars.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -78,7 +78,7 @@
 	  exit 2; \
 	fi
 
-$(JCE_OUTPUTDIR)/%: $(IMAGES_OUTPUTDIR)/unsigned/%
+$(JCE_OUTPUTDIR)/%: $(JDK_OUTPUTDIR)/unsigned/%
 	$(call install-file)
 	$(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \
 	    $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
--- a/jdk/makefiles/Tools.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/Tools.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -32,7 +32,7 @@
     $(JDK_TOPDIR)/makefiles/sun/osxapp \
     $(JDK_TOPDIR)/make/tools/swing-beans
 
-ifneq ($(OPENJDK_TARGET_OS), windows)
+ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
   TOOLS_SRC += $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
 endif
 
--- a/jdk/makefiles/gensrc/GensrcX11Wrappers.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/gensrc/GensrcX11Wrappers.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -99,7 +99,7 @@
 	    $(X_LIBS) \
 	    -I$(JDK_OUTPUTDIR)/include \
 	    -I$(JDK_TOPDIR)/src/share/javavm/export \
-	    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
+	    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_EXPORT_DIR)/javavm/export \
 	    -I$(JDK_TOPDIR)/src/share/native/common \
 	    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
 	    -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \
--- a/jdk/makefiles/lib/Awt2dLibraries.gmk	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/makefiles/lib/Awt2dLibraries.gmk	Sat Nov 02 20:56:18 2013 +0100
@@ -226,7 +226,7 @@
       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d
-else
+else ifneq ($(OPENJDK_TARGET_OS), macosx)
   LIBAWT_DIRS += \
       $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11
 endif
@@ -509,15 +509,7 @@
 
 ##########################################################################################
 
-# 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.
-#
-# It's used for libawt_headless _and_ libawt_xawt
-#
-X11_PATH := /usr/X11R6
-
-ifneq ($(OPENJDK_TARGET_OS), windows)
+ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
   ifndef BUILD_HEADLESS_ONLY
 
     LIBAWT_XAWT_DIRS := \
@@ -532,7 +524,7 @@
         $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \
 
     LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \
-        -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
+        -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
         $(CUPS_CFLAGS) \
         $(foreach dir, $(LIBAWT_XAWT_DIRS), -I$(dir)) \
         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
@@ -627,11 +619,6 @@
       LIBAWT_XAWT_LDFLAGS += -lpthread
     endif
 
-    ifeq ($(OPENJDK_TARGET_OS), macosx)
-      LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
-    endif
-
-    # On macosx, the shared library origin is set twice for this lib.
     $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
         LIBRARY := awt_xawt, \
         OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@@ -653,10 +640,6 @@
             -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
             $(call SET_SHARED_LIBRARY_ORIGIN) \
             $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
-        LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN) \
-            $(call SET_SHARED_LIBRARY_ORIGIN). \
-            $(call SET_SHARED_LIBRARY_ORIGIN) \
-            $(call SET_SHARED_LIBRARY_ORIGIN)., \
         LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \
         VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
         RC_FLAGS := $(RC_FLAGS) \
@@ -788,6 +771,11 @@
   LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
       X11TextRenderer.c
   LIBFONTMANAGER_OPTIMIZATION := HIGHEST
+else ifeq ($(OPENJDK_TARGET_OS), macosx)
+  LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
+      X11TextRenderer.c \
+      fontpath.c \
+      lcdglyph.c
 else
   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
       lcdglyph.c
@@ -845,7 +833,7 @@
 
 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 
-ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris macosx))
+ifeq ($(OPENJDK_TARGET_OS), solaris)
   $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
 endif
 
@@ -947,22 +935,21 @@
 
 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
+  else
+    JAWT_FILES := jawt.c
+    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
   endif
 
   $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
@@ -1094,7 +1081,8 @@
 ##########################################################################################
 
 ifeq ($(BUILD_HEADLESS), true)
-  ifneq ($(OPENJDK_TARGET_OS), windows)
+  # Mac and Windows only use the native AWT lib, do not build libawt_headless
+  ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
 
     LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \
         $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
@@ -1108,7 +1096,7 @@
     endif
 
     LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \
-        -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
+        -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
         $(CUPS_CFLAGS) \
         $(X_CFLAGS) \
         -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
@@ -1155,16 +1143,6 @@
         AccelGlyphCache.c \
         CUPSfuncs.c
 
-    ifeq ($(OPENJDK_TARGET_OS), macosx)
-      LIBAWT_HEADLESS_FILES += \
-          AWTFont.m \
-          AWTStrike.m \
-          CCharToGlyphMapper.m \
-          CGGlyphImages.m \
-          CGGlyphOutlines.m \
-          CoreTextSupport.m
-    endif
-
     LIBAWT_HEADLESS_REORDER :=
     ifeq ($(OPENJDK_TARGET_OS), solaris)
       ifneq ($(OPENJDK_TARGET_CPU), x86_64)
@@ -1191,13 +1169,6 @@
         REORDER := $(LIBAWT_HEADLESS_REORDER), \
         LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
         LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
-        LDFLAGS_SUFFIX_macosx := -ljvm $(LIBCXX) -lawt $(LIBDL) -ljava \
-            -framework Accelerate \
-            -framework ApplicationServices \
-            -framework Cocoa \
-            -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-            -framework JavaNativeFoundation \
-            -framework JavaRuntimeSupport, \
         OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \
         DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/macosx/javavm/export/jawt_md.h	Sat Nov 02 20:56:18 2013 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 1999, 2013 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JAWT_MD_H_
+#define _JAVASOFT_JAWT_MD_H_
+
+#include "jawt.h"
+
+#ifdef __OBJC__
+#import <QuartzCore/CALayer.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Mac OS X specific declarations for AWT native interface.
+ * See notes in jawt.h for an example of use.
+ */
+
+/*
+ * When calling JAWT_GetAWT with a JAWT version less than 1.7, you must pass this
+ * flag or you will not be able to get a valid drawing surface and JAWT_GetAWT will
+ * return false. This is to maintain compatibility with applications that used the
+ * interface with Java 6 which had multiple rendering models. This flag is not necessary
+ * when JAWT version 1.7 or greater is used as this is the only supported rendering mode.
+ *
+ * Example:
+ *   JAWT awt;
+ *   awt.version = JAWT_VERSION_1_4 | JAWT_MACOSX_USE_CALAYER;
+ *   jboolean success = JAWT_GetAWT(env, &awt);
+ */
+#define JAWT_MACOSX_USE_CALAYER 0x80000000
+
+/*
+ * When the native Cocoa toolkit is in use, the pointer stored in
+ * JAWT_DrawingSurfaceInfo->platformInfo points to a NSObject that conforms to the
+ * JAWT_SurfaceLayers protocol. Setting the layer property of this object will cause the
+ * specified layer to be overlaid on the Components rectangle. If the window the
+ * Component belongs to has a CALayer attached to it, this layer will be accessible via
+ * the windowLayer property.
+ */
+#ifdef __OBJC__
+@protocol JAWT_SurfaceLayers
+@property (readwrite, retain) CALayer *layer;
+@property (readonly) CALayer *windowLayer;
+@end
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_JAVASOFT_JAWT_MD_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/macosx/javavm/export/jni_md.h	Sat Nov 02 20:56:18 2013 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#define JNIEXPORT     __attribute__((visibility("default")))
+#define JNIIMPORT     __attribute__((visibility("default")))
+#define JNICALL
+
+typedef int jint;
+#ifdef _LP64 /* 64-bit */
+typedef long jlong;
+#else
+typedef long long jlong;
+#endif
+
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/macosx/javavm/export/jvm_md.h	Sat Nov 02 20:56:18 2013 +0100
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JVM_MD_H_
+#define _JAVASOFT_JVM_MD_H_
+
+/*
+ * This file is currently collecting system-specific dregs for the
+ * JNI conversion, which should be sorted out later.
+ */
+
+#include <dirent.h>             /* For DIR */
+#include <sys/param.h>          /* For MAXPATHLEN */
+#include <unistd.h>             /* For F_OK, R_OK, W_OK */
+#include <stddef.h>             /* For ptrdiff_t */
+#include <stdint.h>             /* For uintptr_t */
+
+#define JNI_ONLOAD_SYMBOLS   {"JNI_OnLoad"}
+#define JNI_ONUNLOAD_SYMBOLS {"JNI_OnUnload"}
+
+#define JNI_LIB_PREFIX "lib"
+#define JNI_LIB_SUFFIX ".dylib"
+#define VERSIONED_JNI_LIB_NAME(NAME, VERSION) JNI_LIB_PREFIX NAME "." VERSION JNI_LIB_SUFFIX
+#define JNI_LIB_NAME(NAME) JNI_LIB_PREFIX NAME JNI_LIB_SUFFIX
+
+#define JVM_MAXPATHLEN MAXPATHLEN
+
+#define JVM_R_OK    R_OK
+#define JVM_W_OK    W_OK
+#define JVM_X_OK    X_OK
+#define JVM_F_OK    F_OK
+
+/*
+ * File I/O
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/signal.h>
+
+/* O Flags */
+
+#define JVM_O_RDONLY     O_RDONLY
+#define JVM_O_WRONLY     O_WRONLY
+#define JVM_O_RDWR       O_RDWR
+#define JVM_O_O_APPEND   O_APPEND
+#define JVM_O_EXCL       O_EXCL
+#define JVM_O_CREAT      O_CREAT
+#define JVM_O_DELETE     0x10000
+
+/* Signals */
+
+#define JVM_SIGINT     SIGINT
+#define JVM_SIGTERM    SIGTERM
+
+
+#endif /* !_JAVASOFT_JVM_MD_H_ */
--- a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.h	Sat Nov 02 20:56:18 2013 +0100
@@ -23,8 +23,7 @@
  * questions.
  */
 
-// REMIND: import <jawt_md.h>
-#import <JavaVM/jawt_md.h>
+#import <jawt_md.h>
 
 /*
  * The CALayer-based rendering model returns an object conforming
--- a/jdk/src/macosx/native/sun/awt/CMenuComponent.h	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/macosx/native/sun/awt/CMenuComponent.h	Sat Nov 02 20:56:18 2013 +0100
@@ -24,7 +24,7 @@
  */
 
 #import <AppKit/AppKit.h>
-#import <JavaVM/jni.h>
+#import <jni.h>
 
 @interface CMenuComponent : NSObject {
 
--- a/jdk/src/macosx/native/sun/awt/jawt.m	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/macosx/native/sun/awt/jawt.m	Sat Nov 02 20:56:18 2013 +0100
@@ -25,8 +25,7 @@
 
 #import <jawt.h>
 
-// REMIND: import <jawt_md.h>
-#import <JavaVM/jawt_md.h>
+#import <jawt_md.h>
 
 #import "awt_DrawingSurface.h"
 
--- a/jdk/src/macosx/native/sun/font/CoreTextSupport.h	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/macosx/native/sun/font/CoreTextSupport.h	Sat Nov 02 20:56:18 2013 +0100
@@ -24,7 +24,7 @@
  */
 
 #import <Cocoa/Cocoa.h>
-#import <JavaVM/jni.h>
+#import <jni.h>
 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
 
 #include "AWTFont.h"
--- a/jdk/src/share/javavm/export/jawt.h	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/share/javavm/export/jawt.h	Sat Nov 02 20:56:18 2013 +0100
@@ -154,7 +154,9 @@
     /*
      * Pointer to the platform-specific information.  This can be safely
      * cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a
-     * JAWT_X11DrawingSurfaceInfo on Solaris.  See jawt_md.h for details.
+     * JAWT_X11DrawingSurfaceInfo on Solaris. On Mac OS X this is a
+     * pointer to a NSObject that conforms to the JAWT_SurfaceLayers
+     * protocol. See jawt_md.h for details.
      */
     void* platformInfo;
     /* Cached pointer to the underlying drawing surface */
--- a/jdk/src/share/native/java/lang/System.c	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/share/native/java/lang/System.c	Sat Nov 02 20:56:18 2013 +0100
@@ -206,6 +206,11 @@
     if (sprops->awt_toolkit) {
         PUTPROP(props, "awt.toolkit", sprops->awt_toolkit);
     }
+#ifdef MACOSX
+    if (sprops->awt_headless) {
+        PUTPROP(props, "java.awt.headless", sprops->awt_headless);
+    }
+#endif
 
     /* os properties */
     PUTPROP(props, "os.name", sprops->os_name);
--- a/jdk/src/share/native/java/lang/java_props.h	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/share/native/java/lang/java_props.h	Sat Nov 02 20:56:18 2013 +0100
@@ -116,6 +116,8 @@
     char *gopherPort;
 
     char *exceptionList;
+
+    char *awt_headless  /* java.awt.headless setting, if NULL (default) will not be set */
 #endif
 
 } java_props_t;
--- a/jdk/src/solaris/native/java/lang/java_props_macosx.c	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/solaris/native/java/lang/java_props_macosx.c	Sat Nov 02 20:56:18 2013 +0100
@@ -105,40 +105,17 @@
     }
 }
 
-/* There are several toolkit options on Mac OS X, so we should try to
- * pick the "best" one, given what we know about the environment Java
- * is running under
- */
-
-static PreferredToolkit getPreferredToolkitFromEnv() {
-    char *envVar = getenv("AWT_TOOLKIT");
-    if (envVar == NULL) return unset;
-
-    if (strcasecmp(envVar, "CToolkit") == 0) return CToolkit;
-    if (strcasecmp(envVar, "XToolkit") == 0) return XToolkit;
-    if (strcasecmp(envVar, "HToolkit") == 0) return HToolkit;
-    return unset;
-}
-
-static bool isInAquaSession() {
+int isInAquaSession() {
     // Is the WindowServer available?
     SecuritySessionId session_id;
     SessionAttributeBits session_info;
     OSStatus status = SessionGetInfo(callerSecuritySession, &session_id, &session_info);
-    if (status != noErr) return false;
-    if (!(session_info & sessionHasGraphicAccess)) return false;
-    return true;
-}
-
-PreferredToolkit getPreferredToolkit() {
-    static PreferredToolkit pref = unset;
-    if (pref != unset) return pref;
-
-    PreferredToolkit prefFromEnv = getPreferredToolkitFromEnv();
-    if (prefFromEnv != unset) return pref = prefFromEnv;
-
-    if (isInAquaSession()) return pref = CToolkit;
-    return pref = HToolkit;
+    if (status == noErr) {
+        if (session_info & sessionHasGraphicAccess) {
+            return 1;
+        }
+    }
+    return 0;
 }
 
 void setOSNameAndVersion(java_props_t *sprops) {
--- a/jdk/src/solaris/native/java/lang/java_props_macosx.h	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/solaris/native/java/lang/java_props_macosx.h	Sat Nov 02 20:56:18 2013 +0100
@@ -29,10 +29,4 @@
 void setOSNameAndVersion(java_props_t *sprops);
 void setUserHome(java_props_t *sprops);
 void setProxyProperties(java_props_t *sProps);
-
-enum PreferredToolkit_enum {
-    unset = 0, CToolkit, XToolkit, HToolkit
-};
-typedef enum PreferredToolkit_enum PreferredToolkit;
-
-PreferredToolkit getPreferredToolkit();
+int isInAquaSession();
--- a/jdk/src/solaris/native/java/lang/java_props_md.c	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/solaris/native/java/lang/java_props_md.c	Sat Nov 02 20:56:18 2013 +0100
@@ -454,40 +454,21 @@
     /* patches/service packs installed */
     sprops.patch_level = "unknown";
 
-    /* Java 2D properties */
+    /* Java 2D/AWT properties */
 #ifdef MACOSX
-    PreferredToolkit prefToolkit = getPreferredToolkit();
-    switch (prefToolkit) {
-        case CToolkit:
-        case HToolkit:
-            sprops.graphics_env = "sun.awt.CGraphicsEnvironment";
-            break;
-        case XToolkit:
-#endif
+    // Always the same GraphicsEnvironment and Toolkit on Mac OS X
+    sprops.graphics_env = "sun.awt.CGraphicsEnvironment";
+    sprops.awt_toolkit = "sun.lwawt.macosx.LWCToolkit";
+
+    // check if we're in a GUI login session and set java.awt.headless=true if not
+    sprops.awt_headless = isInAquaSession() ? NULL : "true";
+#else
     sprops.graphics_env = "sun.awt.X11GraphicsEnvironment";
-#ifdef MACOSX
-            break;
-    }
-#endif
-    /* AWT properties */
 #ifdef JAVASE_EMBEDDED
     sprops.awt_toolkit = getEmbeddedToolkit();
     if (sprops.awt_toolkit == NULL) // default as below
 #endif
-#ifdef MACOSX
-        switch (prefToolkit) {
-            case CToolkit:
-                sprops.awt_toolkit = "sun.lwawt.macosx.LWCToolkit";
-                break;
-            case XToolkit:
-#endif
     sprops.awt_toolkit = "sun.awt.X11.XToolkit";
-#ifdef MACOSX
-                break;
-            default:
-                sprops.awt_toolkit = "sun.awt.HToolkit";
-                break;
-        }
 #endif
 
     /* This is used only for debugging of font problems. */
--- a/jdk/src/solaris/native/sun/awt/fontpath.c	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/src/solaris/native/sun/awt/fontpath.c	Sat Nov 02 20:56:18 2013 +0100
@@ -23,7 +23,7 @@
  * questions.
  */
 
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__)
 #include <string.h>
 #endif /* __linux__ */
 #include <stdio.h>
@@ -59,26 +59,12 @@
 extern Display *awt_display;
 #endif /* !HEADLESS */
 
-#ifdef MACOSX
-
-//
-// XXXDARWIN: Hard-code the path to Apple's fontconfig, as it is
-// not included in the dyld search path by default, and 10.4
-// does not support -rpath.
-//
-// This ignores the build time setting of ALT_FREETYPE_LIB_PATH,
-// and should be replaced with -rpath/@rpath support on 10.5 or later,
-// or via support for a the FREETYPE_LIB_PATH define.
-#define FONTCONFIG_DLL_VERSIONED X11_PATH "/lib/" VERSIONED_JNI_LIB_NAME("fontconfig", "1")
-#define FONTCONFIG_DLL X11_PATH "/lib/" JNI_LIB_NAME("fontconfig")
-#else
 #define FONTCONFIG_DLL_VERSIONED VERSIONED_JNI_LIB_NAME("fontconfig", "1")
 #define FONTCONFIG_DLL JNI_LIB_NAME("fontconfig")
-#endif
 
 #define MAXFDIRS 512    /* Max number of directories that contain fonts */
 
-#if !defined(__linux__) && !defined(MACOSX)
+#if !defined(__linux__)
 /*
  * This can be set in the makefile to "/usr/X11" if so desired.
  */
@@ -128,22 +114,6 @@
     NULL, /* terminates the list */
 };
 
-#elif MACOSX
-static char *full_MACOSX_X11FontPath[] = {
-    X11_PATH "/lib/X11/fonts/TrueType",
-    X11_PATH "/lib/X11/fonts/truetype",
-    X11_PATH "/lib/X11/fonts/tt",
-    X11_PATH "/lib/X11/fonts/TTF",
-    X11_PATH "/lib/X11/fonts/OTF",
-    PACKAGE_PATH "/share/fonts/TrueType",
-    PACKAGE_PATH "/share/fonts/truetype",
-    PACKAGE_PATH "/share/fonts/tt",
-    PACKAGE_PATH "/share/fonts/TTF",
-    PACKAGE_PATH "/share/fonts/OTF",
-    X11_PATH "/lib/X11/fonts/Type1",
-    PACKAGE_PATH "/share/fonts/Type1",
-    NULL, /* terminates the list */
-};
 #else /* __linux */
 /* All the known interesting locations we have discovered on
  * various flavors of Linux
@@ -400,7 +370,7 @@
 
 #endif /* !HEADLESS */
 
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__)
 /* from awt_LoadLibrary.c */
 JNIEXPORT jboolean JNICALL AWTIsHeadless();
 #endif
@@ -527,8 +497,6 @@
 
 #if defined(__linux__)
     knowndirs = fullLinuxFontPath;
-#elif defined(MACOSX)
-    knowndirs = full_MACOSX_X11FontPath;
 #else /* IF SOLARIS */
     knowndirs = fullSolarisFontPath;
 #endif
@@ -539,7 +507,7 @@
      * be initialised.
      */
 #ifndef HEADLESS
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__)
     /* There's no headless build on linux ... */
     if (!AWTIsHeadless()) { /* .. so need to call a function to check */
 #endif
@@ -555,7 +523,7 @@
         x11dirs = getX11FontPath();
     }
     AWT_UNLOCK();
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__)
     }
 #endif
 #endif /* !HEADLESS */
--- a/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh	Fri Nov 01 17:10:31 2013 +0000
+++ b/jdk/test/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh	Sat Nov 02 20:56:18 2013 +0100
@@ -77,6 +77,12 @@
       FILESEP="\\"
       ;;
 
+    Darwin)
+      VAR="Lets not forget about Mac"
+      DEFAULT_JDK=$(/usr/libexec/java_home)
+      FILESEP="/"
+      ;;
+
    # catch all other OSs
    * )
       echo "Unrecognized system!  $OS"
@@ -171,6 +177,22 @@
     fi
     ;;
 
+  Darwin)
+    ${TESTJAVA}/bin/java -Djava.awt.headless=true \
+                         TestWrapped sun.lwawt.macosx.LWCToolkit
+    status=$?
+    if [ ! $status -eq "0" ]; then
+      fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.lwawt.macosx.LWCToolkit";
+    fi
+    ${TESTJAVA}/bin/java -Djava.awt.headless=true \
+                         -Dawt.toolkit=sun.lwawt.macosx.LWCToolkit \
+                         TestWrapped sun.lwawt.macosx.LWCToolkit
+    status=$?
+    if [ ! $status -eq "0" ]; then
+      fail "Test FAILED: toolkit wrapped into HeadlessToolkit is not an instance of sun.lwawt.macosx.LWCToolkit";
+    fi
+    ;;
+
 esac
 
 pass "All the tests are PASSED";
--- a/langtools/.hgtags	Fri Nov 01 17:10:31 2013 +0000
+++ b/langtools/.hgtags	Sat Nov 02 20:56:18 2013 +0100
@@ -234,3 +234,4 @@
 41541097533aa3933a018c8c1c426c1871dfd76e jdk8-b110
 af6244ba81b6b8d1bf4ab06587a2067e021e4570 jdk8-b111
 954dd199d6ff3e4cfc42b894c1f611150526eecd jdk8-b112
+54150586ba785e1eb0c0de8d13906f643f640644 jdk8-b113
--- a/nashorn/.hgtags	Fri Nov 01 17:10:31 2013 +0000
+++ b/nashorn/.hgtags	Sat Nov 02 20:56:18 2013 +0100
@@ -222,3 +222,4 @@
 d49a8c2173f5f90c9a39cc4af8e03cfa8f35ee4c jdk8-b110
 75fd3486e584f20475c064a2cd4d01ac6406a511 jdk8-b111
 6a4fdb3bb4e34af4c5bb8db467bb01e13b1a7e31 jdk8-b112
+676cd7bf5e092356f7ee2116c8cf88cdc12377c7 jdk8-b113