changeset 5102:ce47ee2975b3

Merge from jdk7u4 repository
author Greg Lewis <glewis@eyesbeyond.com>
date Thu, 17 May 2012 16:18:58 -0700
parents be5a36645cc3 7daf4a4dee76
children 1495289115ba
files .hgtags make/com/sun/java/pack/Makefile make/com/sun/nio/Makefile make/com/sun/security/auth/module/Makefile make/com/sun/tools/attach/Exportedfiles.gmk make/com/sun/tools/attach/FILES_c.gmk make/com/sun/tools/attach/FILES_java.gmk make/com/sun/tools/attach/Makefile make/com/sun/tools/attach/mapfile-bsd make/common/Defs-linux.gmk make/common/Defs-solaris.gmk make/common/Defs.gmk make/common/Program.gmk make/common/Release.gmk make/common/shared/Defs-utils.gmk make/common/shared/Defs-versions.gmk make/common/shared/Defs.gmk make/common/shared/Platform.gmk make/common/shared/Sanity.gmk make/docs/Makefile make/java/Makefile make/java/instrument/Makefile make/java/java/Makefile make/java/java/genlocales.gmk make/java/java/localegen.sh make/java/java_hprof_demo/Makefile make/java/jli/Makefile make/java/management/Makefile make/java/net/FILES_c.gmk make/java/net/Makefile make/java/nio/Makefile make/java/nio/mapfile-bsd make/java/npt/Makefile make/java/redist/Makefile make/java/security/Makefile make/java/zip/FILES_c.gmk make/java/zip/Makefile make/javax/sound/FILES_c.gmk make/javax/sound/Makefile make/javax/sound/SoundDefs.gmk make/jpda/back/Makefile make/jpda/transport/socket/Makefile make/mkdemo/jvmti/hprof/Makefile make/netbeans/common/architectures/name-Bsd.properties make/sun/awt/Makefile make/sun/awt/mapfile-vers-bsd make/sun/awt/mawt.gmk make/sun/font/Makefile make/sun/image/generic/Makefile make/sun/image/vis/Makefile make/sun/jawt/Makefile make/sun/jdga/Makefile make/sun/security/ec/Makefile make/sun/security/jgss/wrapper/Makefile make/sun/security/krb5/Makefile make/sun/security/pkcs11/Makefile make/sun/security/smartcardio/Makefile make/sun/splashscreen/FILES_c.gmk make/sun/splashscreen/Makefile make/sun/tracing/dtrace/Makefile make/sun/xawt/Makefile make/tools/freetypecheck/Makefile make/tools/reorder/Makefile src/bsd/doc/man/appletviewer.1 src/bsd/doc/man/apt.1 src/bsd/doc/man/extcheck.1 src/bsd/doc/man/idlj.1 src/bsd/doc/man/ja/appletviewer.1 src/bsd/doc/man/ja/apt.1 src/bsd/doc/man/ja/extcheck.1 src/bsd/doc/man/ja/idlj.1 src/bsd/doc/man/ja/jar.1 src/bsd/doc/man/ja/jarsigner.1 src/bsd/doc/man/ja/java.1 src/bsd/doc/man/ja/javac.1 src/bsd/doc/man/ja/javadoc.1 src/bsd/doc/man/ja/javah.1 src/bsd/doc/man/ja/javap.1 src/bsd/doc/man/ja/javaws.1 src/bsd/doc/man/ja/jconsole.1 src/bsd/doc/man/ja/jdb.1 src/bsd/doc/man/ja/jhat.1 src/bsd/doc/man/ja/jinfo.1 src/bsd/doc/man/ja/jmap.1 src/bsd/doc/man/ja/jps.1 src/bsd/doc/man/ja/jrunscript.1 src/bsd/doc/man/ja/jsadebugd.1 src/bsd/doc/man/ja/jstack.1 src/bsd/doc/man/ja/jstat.1 src/bsd/doc/man/ja/jstatd.1 src/bsd/doc/man/ja/keytool.1 src/bsd/doc/man/ja/kinit.1 src/bsd/doc/man/ja/klist.1 src/bsd/doc/man/ja/ktab.1 src/bsd/doc/man/ja/native2ascii.1 src/bsd/doc/man/ja/orbd.1 src/bsd/doc/man/ja/pack200.1 src/bsd/doc/man/ja/policytool.1 src/bsd/doc/man/ja/rmic.1 src/bsd/doc/man/ja/rmid.1 src/bsd/doc/man/ja/rmiregistry.1 src/bsd/doc/man/ja/schemagen.1 src/bsd/doc/man/ja/serialver.1 src/bsd/doc/man/ja/servertool.1 src/bsd/doc/man/ja/tnameserv.1 src/bsd/doc/man/ja/unpack200.1 src/bsd/doc/man/ja/wsgen.1 src/bsd/doc/man/ja/wsimport.1 src/bsd/doc/man/ja/xjc.1 src/bsd/doc/man/jar.1 src/bsd/doc/man/jarsigner.1 src/bsd/doc/man/java.1 src/bsd/doc/man/javac.1 src/bsd/doc/man/javadoc.1 src/bsd/doc/man/javah.1 src/bsd/doc/man/javap.1 src/bsd/doc/man/javaws.1 src/bsd/doc/man/jconsole.1 src/bsd/doc/man/jdb.1 src/bsd/doc/man/jhat.1 src/bsd/doc/man/jinfo.1 src/bsd/doc/man/jmap.1 src/bsd/doc/man/jps.1 src/bsd/doc/man/jrunscript.1 src/bsd/doc/man/jsadebugd.1 src/bsd/doc/man/jstack.1 src/bsd/doc/man/jstat.1 src/bsd/doc/man/jstatd.1 src/bsd/doc/man/keytool.1 src/bsd/doc/man/native2ascii.1 src/bsd/doc/man/orbd.1 src/bsd/doc/man/pack200.1 src/bsd/doc/man/policytool.1 src/bsd/doc/man/rmic.1 src/bsd/doc/man/rmid.1 src/bsd/doc/man/rmiregistry.1 src/bsd/doc/man/schemagen.1 src/bsd/doc/man/serialver.1 src/bsd/doc/man/servertool.1 src/bsd/doc/man/tnameserv.1 src/bsd/doc/man/unpack200.1 src/bsd/doc/man/wsgen.1 src/bsd/doc/man/wsimport.1 src/bsd/doc/man/xjc.1 src/share/back/commonRef.c src/share/bin/java.c src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java src/share/classes/java/awt/GraphicsEnvironment.java src/share/classes/java/util/TimeZone.java src/share/classes/sun/awt/OSInfo.java src/share/classes/sun/font/FontUtilities.java src/share/classes/sun/font/SunFontManager.java src/share/classes/sun/print/PSPrinterJob.java src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider src/share/native/com/sun/java/util/jar/pack/defines.h src/share/native/com/sun/java/util/jar/pack/main.cpp src/share/native/com/sun/media/sound/DirectAudioDevice.c src/share/native/com/sun/media/sound/Platform.c src/share/native/com/sun/media/sound/SoundDefs.h src/share/native/common/check_code.c src/share/native/java/io/io_util.h src/share/native/java/lang/fdlibm/include/fdlibm.h src/share/native/java/lang/fdlibm/include/jfdlibm.h src/share/native/java/util/zip/zip_util.c src/share/native/sun/awt/debug/debug_util.h src/share/native/sun/awt/image/BufImgSurfaceData.c src/share/native/sun/awt/image/DataBufferNative.c src/share/native/sun/awt/medialib/mlib_image.h src/share/native/sun/awt/medialib/mlib_sys.c src/share/native/sun/awt/medialib/mlib_types.h src/share/native/sun/font/AccelGlyphCache.c src/share/native/sun/font/DrawGlyphList.c src/share/native/sun/font/sunFont.c src/share/native/sun/java2d/SurfaceData.c src/share/native/sun/java2d/opengl/OGLFuncs.h src/share/native/sun/java2d/opengl/OGLRenderQueue.c src/share/native/sun/java2d/opengl/OGLTextRenderer.c src/share/native/sun/nio/ch/genSocketOptionRegistry.c src/share/native/sun/security/ec/impl/ecc_impl.h src/share/native/sun/security/ec/impl/ecdecode.c src/share/native/sun/security/ec/impl/oid.c src/share/native/sun/security/ec/impl/secitem.c src/share/transport/socket/socketTransport.c src/solaris/back/exec_md.c src/solaris/back/linker_md.c src/solaris/back/util_md.h src/solaris/bin/ergo.c src/solaris/bin/ergo.h src/solaris/bin/ergo_i586.c src/solaris/bin/java_md.c src/solaris/bin/java_md.h src/solaris/bin/java_md_solinux.c src/solaris/classes/java/lang/UNIXProcess.java.bsd src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties src/solaris/classes/sun/nio/fs/BsdFileStore.java src/solaris/classes/sun/nio/fs/BsdFileSystem.java src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java src/solaris/classes/sun/nio/fs/DefaultFileSystemProvider.java src/solaris/classes/sun/print/UnixPrintServiceLookup.java src/solaris/classes/sun/tools/attach/BsdAttachProvider.java src/solaris/classes/sun/tools/attach/BsdVirtualMachine.java src/solaris/demo/jvmti/hprof/hprof_md.c src/solaris/javavm/export/jvm_md.h src/solaris/native/com/sun/management/UnixOperatingSystem_md.c src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_CommonUtils.c src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_MidiIn.c src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_PCM.c src/solaris/native/java/io/UnixFileSystem_md.c src/solaris/native/java/io/canonicalize_md.c src/solaris/native/java/io/io_util_md.c src/solaris/native/java/lang/ProcessEnvironment_md.c src/solaris/native/java/lang/UNIXProcess_md.c src/solaris/native/java/lang/java_props_md.c src/solaris/native/java/net/Inet4AddressImpl.c src/solaris/native/java/net/Inet6AddressImpl.c src/solaris/native/java/net/NetworkInterface.c src/solaris/native/java/net/PlainDatagramSocketImpl.c src/solaris/native/java/net/PlainSocketImpl.c src/solaris/native/java/net/bsd_close.c src/solaris/native/java/net/net_util_md.c src/solaris/native/java/net/net_util_md.h src/solaris/native/java/util/FileSystemPreferences.c src/solaris/native/java/util/TimeZone_md.c src/solaris/native/sun/awt/CUPSfuncs.c src/solaris/native/sun/awt/VDrawingArea.c src/solaris/native/sun/awt/X11Color.c src/solaris/native/sun/awt/XDrawingArea.c src/solaris/native/sun/awt/awt_Font.c src/solaris/native/sun/awt/awt_GraphicsEnv.c src/solaris/native/sun/awt/awt_InputMethod.c src/solaris/native/sun/awt/awt_LoadLibrary.c src/solaris/native/sun/awt/awt_MToolkit.c src/solaris/native/sun/awt/awt_Mlib.c src/solaris/native/sun/awt/awt_Robot.c src/solaris/native/sun/awt/awt_util.h src/solaris/native/sun/awt/extutil.h src/solaris/native/sun/awt/fontpath.c src/solaris/native/sun/awt/gtk2_interface.c src/solaris/native/sun/awt/list.c src/solaris/native/sun/awt/robot_common.c src/solaris/native/sun/font/X11FontScaler.c src/solaris/native/sun/font/X11TextRenderer.c src/solaris/native/sun/java2d/j2d_md.h src/solaris/native/sun/java2d/loops/mlib_ImageZoom_NN.c src/solaris/native/sun/java2d/loops/vis_FuncArray.c src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h src/solaris/native/sun/java2d/x11/X11SurfaceData.c src/solaris/native/sun/jdga/dgalock.c src/solaris/native/sun/management/FileSystemImpl.c src/solaris/native/sun/net/dns/ResolverConfigurationImpl.c src/solaris/native/sun/net/spi/DefaultProxySelector.c src/solaris/native/sun/nio/ch/DatagramChannelImpl.c src/solaris/native/sun/nio/ch/DatagramDispatcher.c src/solaris/native/sun/nio/ch/FileChannelImpl.c src/solaris/native/sun/nio/ch/FileDispatcherImpl.c src/solaris/native/sun/nio/ch/FileKey.c src/solaris/native/sun/nio/ch/Net.c src/solaris/native/sun/nio/ch/Sctp.h src/solaris/native/sun/nio/ch/SctpChannelImpl.c src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c src/solaris/native/sun/nio/fs/genUnixConstants.c src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c src/solaris/native/sun/security/pkcs11/j2secmod_md.c src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c src/solaris/native/sun/security/smartcardio/pcsc_md.c src/solaris/native/sun/tools/attach/BsdVirtualMachine.c src/solaris/native/sun/xawt/XWindow.c src/solaris/native/sun/xawt/awt_Desktop.c src/solaris/npt/npt_md.h src/solaris/transport/socket/socket_md.c test/Makefile test/com/sun/jdi/ImmutableResourceTest.sh test/com/sun/jdi/JITDebug.sh test/com/sun/jdi/PrivateTransportTest.sh test/com/sun/jdi/ShellScaffold.sh test/com/sun/jdi/Solaris32AndSolaris64Test.sh test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh test/com/sun/tools/attach/CommonSetup.sh test/java/io/File/BlockIsDirectory.java test/java/io/Serializable/evolution/RenamePackage/run.sh test/java/io/Serializable/serialver/classpath/run.sh test/java/io/Serializable/serialver/nested/run.sh test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh test/java/lang/StringCoding/CheckEncodings.sh test/java/lang/annotation/loaderLeak/LoaderLeak.sh test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh test/java/net/Authenticator/B4933582.sh test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh test/java/net/Socket/OldSocketImpl.sh test/java/net/URL/B5086147.sh test/java/net/URL/runconstructor.sh test/java/net/URLClassLoader/B5077773.sh test/java/net/URLClassLoader/sealing/checksealed.sh test/java/net/URLConnection/6212146/test.sh test/java/nio/charset/coders/CheckSJISMappingProp.sh test/java/nio/charset/spi/basic.sh test/java/nio/file/Files/CopyAndMove.java test/java/rmi/registry/readTest/readTest.sh test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh test/java/security/Security/signedfirst/Dyn.sh test/java/security/Security/signedfirst/Static.sh test/java/util/Currency/PropertiesTest.sh test/java/util/PluggableLocale/ExecTest.sh test/java/util/ResourceBundle/Bug6299235Test.sh test/java/util/ResourceBundle/Control/ExpirationTest.sh test/java/util/ServiceLoader/basic.sh test/javax/crypto/SecretKeyFactory/FailOverTest.sh test/javax/script/CommonSetup.sh test/javax/security/auth/Subject/doAs/Test.sh test/lib/security/java.policy/Ext_AllPolicy.sh test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh test/sun/misc/URLClassPath/ClassnameCharTest.sh test/sun/net/www/MarkResetTest.sh test/sun/net/www/http/HttpClient/RetryPost.sh test/sun/net/www/protocol/jar/B5105410.sh test/sun/net/www/protocol/jar/jarbug/run.sh test/sun/security/krb5/runNameEquals.sh test/sun/security/pkcs11/KeyStore/ClientAuth.sh test/sun/security/pkcs11/Provider/ConfigQuotedString.sh test/sun/security/pkcs11/Provider/Login.sh test/sun/security/provider/PolicyFile/getinstance/getinstance.sh test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh test/sun/security/tools/jarsigner/AlgOptions.sh test/sun/security/tools/jarsigner/PercentSign.sh test/sun/security/tools/jarsigner/diffend.sh test/sun/security/tools/jarsigner/oldsig.sh test/sun/security/tools/keytool/AltProviderPath.sh test/sun/security/tools/keytool/CloneKeyAskPassword.sh test/sun/security/tools/keytool/SecretKeyKS.sh test/sun/security/tools/keytool/StandardAlgName.sh test/sun/security/tools/keytool/printssl.sh test/sun/security/tools/keytool/resource.sh test/sun/security/tools/keytool/standard.sh test/sun/security/tools/policytool/Alias.sh test/sun/security/tools/policytool/ChangeUI.sh test/sun/security/tools/policytool/OpenPolicy.sh test/sun/security/tools/policytool/SaveAs.sh test/sun/security/tools/policytool/UpdatePermissions.sh test/sun/security/tools/policytool/UsePolicy.sh test/sun/security/tools/policytool/i18n.sh test/sun/tools/jconsole/ImmutableResourceTest.sh test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh
diffstat 1502 files changed, 174084 insertions(+), 39251 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Sun Mar 18 11:56:52 2012 -0700
+++ b/.hgtags	Thu May 17 16:18:58 2012 -0700
@@ -142,3 +142,31 @@
 79c8c4608f60e1f981b17ba4077dfcaa2ed67be4 jdk7u2-b12
 fb2980d7c9439e3d62ab12f40506a2a2db2df0f4 jdk7u2-b13
 24e42f1f9029f9f5a9b1481d523facaf09452e5b jdk7u2-b21
+e3790f3ce50aa4e2a1b03089ac0bcd48f9d1d2c2 jdk7u3-b02
+7e8351342f0b22b694bd3c2db979643529f32e71 jdk7u3-b03
+fc6b7b6ac837c9e867b073e13fc14e643f771028 jdk7u3-b04
+c0b98811b1fce5f479d487fe69db742874b22129 jdk7u4-b200
+6f7af0f0e7db448bb6c21a08b3aadc461d9e2456 jdk7u4-b04
+b97711a217859410d2724b8fdc90ef5937faa11b jdk7u4-b02
+9621edd8118f1a3e9691f4afc022d05cd5a64ef3 jdk7u4-b05
+2c1b789d18036febd45ef0ce29eb7c6ac34f2fd1 jdk7u4-b06
+ac2948107df1dcce6c026749dd14e4eb36a39091 jdk7u4-b225
+d34bb20fc52e6373f4547c05b938bdc31d974fdf jdk7u4-b07
+bcceb5734a34b37a28cf81fc2408dc47a97a9454 jdk7u4-b08
+2e4258236920ffd9b30799d817fadf88254e16b6 jdk7u4-b227
+0e394800a961634c95f208f11c0282a1515181c9 jdk7u4-b09
+6485e842d7f736b6ca3d7e4a7cdc5de6bbdd870c jdk7u4-b10
+d568e85567ccfdd75f3f0c42aa0d75c440422827 jdk7u4-b11
+16781e84dcdb5f82c287a3b5387dde9f8aaf74e0 jdk7u4-b12
+c929e96aa059c8b79ab94d5b0b1a242ca53a5b32 jdk7u4-b13
+09f612bac047b132bb9bf7d4aa8afe6ea4d5b938 jdk7u4-b14
+00f0f18379ecb927a515d1540682a922bd0227ec jdk7u4-b15
+df20c60949f8cef09be1e89d754cff366eaf7aa4 jdk7u4-b16
+b4401b362fd8076d705aa57acb9967b5962a795d jdk7u4-b17
+084825fc677ef6adecab9400a2625eb0e5579509 jdk7u4-b18
+0f9aacb27534e7bba7ba30a2700a9c828416929d jdk7u4-b19
+1a495432b42a496bde0ddfa16c6462742d7a8cf1 jdk7u4-b20
+81a0f71a895e7f386efdd481eb53fb3ca0597438 jdk7u4-b30
+0573d282ca247a2848c26fe2800c7f3aa8d2e882 jdk7u4-b21
+42ca70fcb2cedc0c4f1d860baa839e19a08770db jdk7u4-b22
+3e2214ca56663a1bc65d178a23ed2ee938814e38 jdk7u4-b31
--- a/make/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -233,6 +233,9 @@
 all build:: sanity-all post-sanity-all
 
 SUBDIRS       = tools java javax sun com
+ifeq ($(PLATFORM), macosx)
+  SUBDIRS += apple
+endif
 SUBDIRS_tools = launchers
 SUBDIRS_misc  = org sunw jpda mkdemo mksample
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/apple/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile for building com/apple
+#
+
+BUILDDIR = ..
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+SUBDIRS = applescript
+
+include $(BUILDDIR)/common/Subdirs.gmk
+
+all build clean clobber::
+	$(SUBDIRS-loop)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/apple/applescript/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../..
+PACKAGE = apple.applescript
+LIBRARY = AppleScriptEngine
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = apple/applescript
+
+FILES_objc = \
+        $(TARGDIR)AppleScriptEngine.m \
+        $(TARGDIR)AppleScriptExecutionContext.m \
+        $(TARGDIR)AS_NS_ConversionUtils.m \
+        $(TARGDIR)NS_Java_ConversionUtils.m
+
+
+FILES_export = \
+	apple/applescript/AppleScriptEngine.java \
+	apple/applescript/AppleScriptEngineFactory.java
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Mapfile-vers.gmk
+include $(BUILDDIR)/common/Library.gmk
+
+
+#
+# Extra rules
+#
+
+#
+# Add to ambient vpath to get files in a subdirectory
+#
+vpath %.m   $(call NativeSrcDirList,,native/apple/applescript)
+
+CPPFLAGS += \
+	-I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
+
+OTHER_LDLIBS = \
+    -framework Cocoa \
+    -framework Carbon \
+    -framework JavaNativeFoundation
--- a/make/com/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/com/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -32,6 +32,11 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = sun oracle
+
+ifeq ($(PLATFORM), macosx)
+    SUBDIRS += apple
+endif
+
 include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/apple/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile for building com/apple
+#
+
+BUILDDIR = ../..
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+# MMM: disable for now, depends on Max AWT (undisabled)
+SUBDIRS = osx osxui
+
+include $(BUILDDIR)/common/Subdirs.gmk
+
+all build clean clobber::
+	$(SUBDIRS-loop)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/apple/osx/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,91 @@
+#
+# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../../..
+PACKAGE = com.apple.osx
+LIBRARY = osx
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = apple/launcher apple/security com/apple/concurrent com/apple/eio java/util/prefs
+
+FILES_objc += \
+    $(TARGDIR)Dispatch.m \
+    $(TARGDIR)CFileManager.m \
+    $(TARGDIR)KeystoreImpl.m \
+    $(TARGDIR)JavaAppLauncher.m \
+    $(TARGDIR)MacOSXPreferencesFile.m \
+    $(TARGDIR)SCDynamicStoreConfig.m
+
+FILES_export += \
+	com/apple/concurrent/LibDispatchNative.java \
+	com/apple/eio/FileManager.java \
+	apple/security/KeychainStore.java \
+	apple/launcher/JavaAppLauncher.java \
+	java/util/prefs/MacOSXPreferencesFile.java
+
+# TODO: couldn't figure out how to get resources working
+#LOCALE_SET_DEFINITION = jre
+#RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES = apple/launcher/appLauncherErrors.properties
+
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Mapfile-vers.gmk
+include $(BUILDDIR)/common/Library.gmk
+
+
+#
+# Extra rules
+#
+
+#
+# Add to ambient vpath to get files in a subdirectory
+#
+vpath %.m   $(call NativeSrcDirList,,native/com/apple/concurrent)
+vpath %.m   $(call NativeSrcDirList,,native/com/apple/eio)
+vpath %.m   $(call NativeSrcDirList,,native/apple/launcher)
+vpath %.m   $(call NativeSrcDirList,,native/apple/security)
+vpath %.m   $(call NativeSrcDirList,,native/java/util)
+
+CPPFLAGS += \
+	$(call NativeSrcDirList,-I,native/com/apple/laf) \
+	$(call NativeSrcDirList,-I,native/apple/awt) \
+	$(call NativeSrcDirList,-I,native/sun/awt) \
+	$(call NativeSrcDirList,-I,native/sun/osxapp)
+
+OTHER_LDLIBS = \
+    -losxapp \
+    -framework Cocoa \
+    -framework ApplicationServices \
+    -framework JavaNativeFoundation \
+    -framework JavaRuntimeSupport \
+    -framework Security \
+    -framework SystemConfiguration
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/apple/osxui/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,106 @@
+#
+# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../../..
+PACKAGE = com.apple.osxui
+LIBRARY = osxui
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = apple/laf com/apple/laf com/apple/eawt
+
+FILES_objc = \
+        $(TARGDIR)AquaFileView.m \
+        $(TARGDIR)AquaLookAndFeel.m \
+        $(TARGDIR)AquaNativeResources.m \
+        $(TARGDIR)JRSUIConstantSync.m \
+        $(TARGDIR)JRSUIController.m \
+        $(TARGDIR)JRSUIFocus.m \
+        $(TARGDIR)ScreenPopupFactory.m \
+        $(TARGDIR)ScreenMenu.m
+
+FILES_export = \
+	apple/laf/AquaLookAndFeel.java \
+	apple/laf/JRSUIConstants.java \
+	apple/laf/JRSUIControl.java \
+	apple/laf/JRSUIFocus.java \
+	apple/laf/JRSUIState.java \
+	apple/laf/JRSUIStateFactory.java \
+	apple/laf/JRSUIUtils.java \
+	com/apple/laf/AquaFileView.java \
+	com/apple/laf/AquaNativeResources.java \
+	com/apple/laf/ScreenPopupFactory.java \
+	com/apple/laf/ScreenMenu.java \
+	com/apple/laf/ScreenMenuBar.java \
+	com/apple/laf/ScreenMenuBarProvider.java \
+	com/apple/laf/ScreenMenuItem.java \
+	com/apple/laf/ScreenMenuItemCheckbox.java \
+	com/apple/laf/ScreenMenuItemUI.java \
+	com/apple/laf/ScreenMenuPropertyHandler.java \
+	com/apple/laf/ScreenMenuPropertyListener.java
+
+#RESOURCE_BUNDLES_COMPILED_PROPERTIES += \
+#	com/apple/laf/resources/aqua.properties \
+#	com/apple/laf/resources/aqua_de.properties \
+#	com/apple/laf/resources/aqua_fr.properties \
+#	com/apple/laf/resources/aqua_ja.properties
+
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Mapfile-vers.gmk
+include $(BUILDDIR)/common/Library.gmk
+
+
+#
+# Extra rules
+#
+
+#
+# Add to ambient vpath to get files in a subdirectory
+#
+vpath %.m   $(call NativeSrcDirList,,native/com/apple/laf)
+vpath %.m $(call NativeSrcDirList,,native/com/apple/eawt)
+
+CPPFLAGS += \
+	$(call NativeSrcDirList,-I,native/com/apple/laf) \
+	$(call NativeSrcDirList,-I,native/apple/awt) \
+	$(call NativeSrcDirList,-I,native/sun/awt) \
+	$(call NativeSrcDirList,-I,native/sun/osxapp) \
+	-I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
+
+OTHER_LDLIBS = \
+    -lawt -losxapp \
+    -llwawt -L$(LIBDIR)/lwawt -Xlinker -rpath -Xlinker @loader_path/lwawt \
+    -framework Cocoa \
+    -framework Carbon \
+    -framework ApplicationServices \
+    -framework JavaNativeFoundation \
+    -framework JavaRuntimeSupport
--- a/make/com/oracle/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/com/oracle/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -25,15 +25,30 @@
 
 BUILDDIR = ../..
 PRODUCT = oracle
+#SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
+#SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
+#SUBDIRS_MAKEFLAGS += JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation,-path
 include $(BUILDDIR)/common/Defs.gmk
 
-#
-# Files to compile
-#
-AUTO_FILES_JAVA_DIRS = com/oracle
+# build com/oracle/security/ucrypto on Solaris platform for non-OpenJDK builds
+UCRYPTO =
+ifndef OPENJDK
+  ifeq ($(PLATFORM), solaris)
+    UCRYPTO = security/ucrypto
+  endif
+endif
 
-#
-# Rules
-#
-include $(BUILDDIR)/common/Classes.gmk
+JFR =
+ifndef OPENJDK
+ifndef JAVASE_EMBEDDED
+	JFR = jfr
+endif
+endif
 
+SUBDIRS = $(JFR) net nio util $(UCRYPTO)
+
+include $(BUILDDIR)/common/Subdirs.gmk
+
+all build clean clobber::
+	$(SUBDIRS-loop)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/oracle/jfr/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,73 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../../..
+PACKAGE = oracle.jrockit.jfr
+LIBRARY = jfr
+PRODUCT = oracle
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Use mapfile
+#
+FILES_m = $(CLOSED_SHARE_SRC)/native/oracle/jfr/mapfile-vers
+include $(BUILDDIR)/common/Mapfile-vers.gmk
+
+#
+# Files to compile
+#
+FILES_c = VMJFR.c
+
+AUTO_FILES_JAVA_DIRS = com/oracle/jrockit/jfr oracle/jrockit/jfr
+
+# Find C source files
+#
+vpath %.c $(CLOSED_SHARE_SRC)/native/oracle/jfr
+
+#
+# Library to compile.
+#
+include $(BUILDDIR)/common/Library.gmk
+
+JVMLIB =
+JAVALIB =
+OTHER_LDLIBS =
+
+clean clobber::
+	$(RM) -r $(CLASSDESTDIR)/com/oracle/jrockit/jfr
+	$(RM) -r $(CLASSDESTDIR)/oracle/jrockit/jfr
+
+
+# Copy pre-shipped .jfs files
+JFR_LIBDIR = $(LIBDIR)/jfr
+JFR_SRCDIR = $(CLOSED_SHARE_SRC)/lib/jfr
+
+$(JFR_LIBDIR)/%.jfs: $(JFR_SRCDIR)/%.jfs
+	$(install-file)
+
+JFS_FILES := $(subst $(JFR_SRCDIR),$(JFR_LIBDIR),$(wildcard $(JFR_SRCDIR)/*.jfs))
+
+all build : $(JFS_FILES)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/oracle/net/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../../..
+PACKAGE = com.oracle.net
+PRODUCT = oracle
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = com/oracle/net
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/oracle/nio/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../../..
+PACKAGE = com.oracle.nio
+PRODUCT = oracle
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = com/oracle/nio
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/oracle/security/ucrypto/FILES_c.gmk	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+ifndef OPENJDK
+FILES_c = \
+        nativeFunc.c \
+	nativeCrypto.c
+endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/oracle/security/ucrypto/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,270 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile for building ucrypto.jar and its native libraries.
+#
+# This file was modified from make/sun/security/pkcs11/Makefile.
+#
+#
+# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Oracle
+# JDK builds respectively.)
+#
+# This Makefile does the "real" build of the Ucrypto provider files.
+# Since the sources are unavailable for OpenJDK, this Makefile is only
+# useful for JDK.
+#
+#
+# Main Targets (JDK on Solaris):
+#
+#     all                      The usual, ucrypto.jar plus the native libraries.
+#                                  builds and installs the prebuilt/signed jar.
+#
+#     clobber/clean            Cleans up the temp directory, ucrypto.jar, the
+#                              native libraries, and the config file from the
+#                              build area
+#
+#     jar                      Builds, signs and installs ucrypto.jar
+#                              (Can only be done on machines with access to
+#                               the signing keystore)
+#
+# Other lesser-used Targets (JDK on Solaris):
+#
+#     build-jar                Builds ucrypto.jar (no sign/install)
+#
+#     sign                     Builds/signs ucrypto.jar (no install)
+#
+#     release                  Builds all targets in preparation
+#                              for workspace integration.
+#                              (Can only be done on machines with access to
+#                               the signing keystore)
+#
+#     install-prebuilt         Installs the pre-built jar files
+#
+# NOTE: None of the above target will update the prebuilt provider binary
+# under the closed workspace. To update it, you must explicitly copy the
+# binary from either the tmp/signed or lib/ext directory.
+#
+# This makefile was written to support parallel target execution.
+#
+
+BUILDDIR = ../../../..
+
+include $(BUILDDIR)/common/Defs.gmk
+
+ifndef OPENJDK
+  ifneq ($(PLATFORM), solaris)
+    all:
+  else
+    PACKAGE = com.oracle.security.ucrypto
+  LIBRARY = j2ucrypto
+  PRODUCT = oracle
+
+  #
+  # The following is for when we need to do postprocessing
+  # (signing/obfuscation) against a read-only build.  If the OUTPUTDIR
+  # isn't writable, the build currently crashes out.
+  #
+  ifdef ALT_JCE_BUILD_DIR
+    # =====================================================
+    # Where to place the output, in case we're building from a read-only
+    # build area.  (e.g. a release engineering build.)
+    JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
+    IGNORE_WRITABLE_OUTPUTDIR_TEST=true
+  else
+    JCE_BUILD_DIR=${TEMPDIR}
+  endif
+
+  JAVAC_MAX_WARNINGS=false
+  JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation
+  JAVAC_WARNINGS_FATAL=true
+
+  #
+  # C and Java Files
+  #
+  include FILES_c.gmk
+
+  #
+  # Subdirectories of these are automatically included.
+  #
+  AUTO_FILES_JAVA_DIRS = com/oracle/security/ucrypto
+
+  #
+  # Java files that define native methods
+  #
+  FILES_export = \
+      com/oracle/security/ucrypto/UcryptoProvider.java \
+      com/oracle/security/ucrypto/NativeCipher.java \
+      com/oracle/security/ucrypto/NativeDigest.java \
+      com/oracle/security/ucrypto/NativeKey.java \
+      com/oracle/security/ucrypto/NativeRSASignature.java \
+      com/oracle/security/ucrypto/NativeRSACipher.java
+
+  #
+  # Find native code
+  #
+  vpath %.c \
+    $(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto
+
+  #
+  # Find include files
+  #
+  OTHER_INCLUDES += \
+    -I$(CLOSED_PLATFORM_SRC)/native/com/oracle/security/ucrypto
+
+  #
+  # Rules
+  #
+  CLASSDESTDIR = $(TEMPDIR)/classes
+  JAVAHFLAGS = -bootclasspath \
+    "$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR)"
+
+  include $(BUILDDIR)/common/Mapfile-vers.gmk
+  include $(BUILDDIR)/common/Library.gmk
+
+  #
+  # Libraries to link
+  #
+  OTHER_LDLIBS = -ldl
+
+  # Default config file
+  UCRYPTO_CFG_SRC   = $(CLOSED_SRC)/share/lib/security/ucrypto-solaris.cfg
+  UCRYPTO_CFG_BUILD = $(LIBDIR)/security/ucrypto-solaris.cfg
+
+  #
+  # We use a variety of subdirectories in the $(TEMPDIR) depending on what
+  # part of the build we're doing.  Build is initially done in the unsigned
+  # area and when files are signed, they will be placed in the appropriate area.
+  #
+  UNSIGNED_DIR = $(TEMPDIR)/unsigned
+
+  #
+  # Rules
+  #
+  all: ucrypto-cfg build-jar install-prebuilt
+	$(build-warning)
+
+  ucrypto-cfg: $(UCRYPTO_CFG_BUILD)
+
+  $(UCRYPTO_CFG_BUILD): $(UCRYPTO_CFG_SRC)
+	$(install-file)
+
+  include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
+
+
+  # =====================================================
+  # Build the unsigned ucrypto.jar file.
+  #
+
+  JAR_DESTFILE = $(EXTDIR)/ucrypto.jar
+
+  #
+  # The ucrypto.jar needs to be in the extension class directory,
+  # therefore none of its classes can appear in $(CLASSBINDIR).
+  # Currently no one is using any of the internals, so these files
+  # should not have been built.
+  #
+
+  #
+  # Since the -C option to jar is used below, each directory entry must be
+  # preceded with the appropriate directory to "cd" into.
+  #
+  JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS))
+
+  build-jar: $(UNSIGNED_DIR)/ucrypto.jar
+
+  #
+  # Build ucrypto.jar.
+  #
+  $(UNSIGNED_DIR)/ucrypto.jar: build
+	$(prep-target)
+	$(BOOT_JAR_CMD) cf $@ $(JAR_DIRS) \
+	    $(BOOT_JAR_JFLAGS)
+	@$(java-vm-cleanup)
+
+  #
+  # Sign ucrypto.jar
+  #
+  SIGNED_DIR = $(JCE_BUILD_DIR)/signed
+
+  sign: $(SIGNED_DIR)/ucrypto.jar
+
+  ifndef ALT_JCE_BUILD_DIR
+    $(SIGNED_DIR)/ucrypto.jar: $(UNSIGNED_DIR)/ucrypto.jar
+  else
+    #
+    # We have to remove the build dependency, otherwise, we'll try to rebuild it
+    # which we can't do on a read-only filesystem.
+    #
+    $(SIGNED_DIR)/ucrypto.jar:
+	@if [ ! -r $(UNSIGNED_DIR)/ucrypto.jar ] ; then \
+            $(ECHO) "Couldn't find $(UNSIGNED_DIR)/ucrypto.jar"; \
+            exit 1; \
+        fi
+  endif
+	$(call sign-file, $(UNSIGNED_DIR)/ucrypto.jar)
+
+
+  # =====================================================
+  # Create the Release Engineering files.  Signed builds, etc.
+  #
+
+  release: $(SIGNED_DIR)/ucrypto.jar
+	$(RM) $(JCE_BUILD_DIR)/release/ucrypto.jar
+	$(MKDIR) -p $(JCE_BUILD_DIR)/release
+	$(CP) $(SIGNED_DIR)/ucrypto.jar $(JCE_BUILD_DIR)/release
+	$(release-warning)
+
+
+  # =====================================================
+  # Install routines.
+  #
+
+  #
+  # Install ucrypto.jar, depending on which type is requested.
+  #
+  jar: $(JAR_DESTFILE)
+	$(release-warning)
+
+  $(JAR_DESTFILE): $(SIGNED_DIR)/ucrypto.jar
+	$(install-file)
+
+  install-prebuilt:
+	@$(ECHO) "\n>>>Installing prebuilt OracleUcrypto provider..."
+	$(RM) $(JAR_DESTFILE)
+	$(CP) $(PREBUILT_DIR)/ucrypto/ucrypto.jar $(JAR_DESTFILE)
+
+
+  # =====================================================
+  # Support routines.
+  #
+  clobber clean::
+	$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
+	$(RM) -r $(UCRYPTO_CFG_BUILD)
+
+  .PHONY: build-jar jar sign release install-prebuilt
+
+  endif #ifneq ($(PLATFORM), solaris)
+endif #ifndef OPENJDK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/oracle/security/ucrypto/mapfile-vers	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,69 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# Define public interface.
+
+SUNWprivate_1.1 {
+	global:
+                JNI_OnLoad;
+                Java_com_oracle_security_ucrypto_UcryptoProvider_loadLibraries;
+                Java_com_oracle_security_ucrypto_UcryptoProvider_getMechList;
+		Java_com_oracle_security_ucrypto_NativeDigest_nativeInit;
+                Java_com_oracle_security_ucrypto_NativeDigest_nativeUpdate;
+                Java_com_oracle_security_ucrypto_NativeDigest_nativeDigest;
+                Java_com_oracle_security_ucrypto_NativeDigest_nativeClone;
+                Java_com_oracle_security_ucrypto_NativeDigest_nativeFree;
+		Java_com_oracle_security_ucrypto_NativeCipher_nativeInit;
+		Java_com_oracle_security_ucrypto_NativeCipher_nativeUpdate;
+		Java_com_oracle_security_ucrypto_NativeCipher_nativeFinal;
+                Java_com_oracle_security_ucrypto_NativeKey_nativeFree;
+                Java_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit;
+                Java_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit;
+		Java_com_oracle_security_ucrypto_NativeRSASignature_nativeInit;
+		Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII;
+		Java_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI;
+		Java_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal;
+		Java_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic;
+
+                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeInit;
+                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeUpdate;
+                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeDigest;
+                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeClone;
+                JavaCritical_com_oracle_security_ucrypto_NativeDigest_nativeFree;
+                JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeInit;
+                JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeUpdate;
+                JavaCritical_com_oracle_security_ucrypto_NativeCipher_nativeFinal;
+                JavaCritical_com_oracle_security_ucrypto_NativeKey_nativeFree;
+                JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPrivateCrt_nativeInit;
+                JavaCritical_com_oracle_security_ucrypto_NativeKey_00024RSAPublic_nativeInit;
+		JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeInit;
+		JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZ_3BII;
+		JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeUpdate__JZJI;
+		JavaCritical_com_oracle_security_ucrypto_NativeRSASignature_nativeFinal;
+                JavaCritical_com_oracle_security_ucrypto_NativeRSACipher_nativeAtomic;
+
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/oracle/util/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../../..
+PACKAGE = com.oracle.util
+PRODUCT = oracle
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = com/oracle/util
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
--- a/make/com/sun/nio/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/com/sun/nio/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -30,17 +30,19 @@
 BUILDDIR = ../../..
 include $(BUILDDIR)/common/Defs.gmk
 
-ifneq ($(PLATFORM), bsd)
+# MMM: disable for now
+ifeq (,$(findstring $(PLATFORM), bsd macosx))
+include $(BUILDDIR)/common/Subdirs.gmk
 SUBDIRS = sctp
-else
+endif
+
 ifeq ($(OS_VENDOR), FreeBSD)
 # FreeBSD 5.x and lower are unsupported, 6.x has no sctp support.
 ifneq ($(call MajorVersion,$(shell uname -r)), 6)
+include $(BUILDDIR)/common/Subdirs.gmk
 SUBDIRS = sctp
 endif
 endif
-endif
-include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/make/com/sun/security/auth/module/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/com/sun/security/auth/module/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -67,7 +67,7 @@
   include FILES_c_solaris.gmk
 endif # solaris
 
-ifneq (,$(findstring $(PLATFORM), linux bsd))
+ifneq (,$(findstring $(PLATFORM), linux bsd macosx))
   LIBRARY = jaas_unix
   include FILES_export_unix.gmk
   include FILES_c_unix.gmk
--- a/make/com/sun/tools/attach/Exportedfiles.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/com/sun/tools/attach/Exportedfiles.gmk	Thu May 17 16:18:58 2012 -0700
@@ -43,7 +43,7 @@
 	sun/tools/attach/LinuxVirtualMachine.java
 endif
 
-ifeq ($(PLATFORM), bsd)
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
 FILES_export = \
 	sun/tools/attach/BsdVirtualMachine.java
 endif
--- a/make/com/sun/tools/attach/FILES_c.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/com/sun/tools/attach/FILES_c.gmk	Thu May 17 16:18:58 2012 -0700
@@ -39,7 +39,7 @@
 	LinuxVirtualMachine.c
 endif
 
-ifeq ($(PLATFORM),bsd)
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
 FILES_c = \
 	BsdVirtualMachine.c
 endif
--- a/make/com/sun/tools/attach/FILES_java.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/com/sun/tools/attach/FILES_java.gmk	Thu May 17 16:18:58 2012 -0700
@@ -43,7 +43,7 @@
 	sun/tools/attach/LinuxAttachProvider.java
 endif
 
-ifeq ($(PLATFORM), bsd)
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
 FILES_java += \
 	sun/tools/attach/BsdAttachProvider.java
 endif
--- a/make/com/sun/tools/attach/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/com/sun/tools/attach/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -36,8 +36,8 @@
 ifeq ($(PLATFORM), linux)
 FILES_m = mapfile-linux
 endif
-ifeq ($(PLATFORM), bsd)
-FILES_m = mapfile-bsd
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
+FILES_m = mapfile-bsd 
 endif
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
@@ -55,7 +55,11 @@
 EXTRA_LIBS += psapi.lib
 endif
 
-vpath %.c $(PLATFORM_SRC)/native/sun/tools/attach
+ifeq ($(PLATFORM), macosx)
+  vpath %.c $(call NativeSrcDirList,,native/sun/tools/attach)
+else
+  vpath %.c $(PLATFORM_SRC)/native/sun/tools/attach
+endif
 
 all: classes copy-files
 
--- a/make/common/Defs-embedded.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Defs-embedded.gmk	Thu May 17 16:18:58 2012 -0700
@@ -65,5 +65,12 @@
   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/make/common/Defs-linux.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Defs-linux.gmk	Thu May 17 16:18:58 2012 -0700
@@ -53,6 +53,11 @@
   PLATFORM_SRC = $(BUILDDIR)/../src/solaris
 endif # PLATFORM_SRC
 
+# Location of the various .properties files specific to Linux platform
+ifndef PLATFORM_PROPERTIES
+  PLATFORM_PROPERTIES  = $(BUILDDIR)/../src/solaris/lib
+endif # PLATFORM_SRC
+
 # Platform specific closed sources
 ifndef OPENJDK
   ifndef CLOSED_PLATFORM_SRC
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/common/Defs-macosx.gmk	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,407 @@
+#
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile 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
+
+# Location of the various .properties files specific to MacOS X platform
+ifndef PLATFORM_PROPERTIES
+  PLATFORM_PROPERTIES  = $(BUILDDIR)/../src/macosx/lib
+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)/$(VM_NAME) -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
+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/make/common/Defs-solaris.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Defs-solaris.gmk	Thu May 17 16:18:58 2012 -0700
@@ -51,6 +51,11 @@
 PLATFORM_SRC = $(BUILDDIR)/../src/solaris
 endif # PLATFORM_SRC
 
+# Location of the various .properties files specific to Solaris platform
+ifndef PLATFORM_PROPERTIES
+  PLATFORM_PROPERTIES  = $(BUILDDIR)/../src/solaris/lib
+endif # PLATFORM_SRC
+
 # Platform specific closed sources
 ifndef OPENJDK
   ifndef CLOSED_PLATFORM_SRC
@@ -717,6 +722,9 @@
 # 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
--- a/make/common/Defs-windows.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Defs-windows.gmk	Thu May 17 16:18:58 2012 -0700
@@ -53,6 +53,11 @@
   PLATFORM_SRC  = $(BUILDDIR)/../src/windows
 endif # PLATFORM_SRC
 
+# Location of the various .properties files specific to Windows platform
+ifndef PLATFORM_PROPERTIES
+  PLATFORM_PROPERTIES  = $(BUILDDIR)/../src/windows/lib
+endif # PLATFORM_SRC
+
 # Platform specific closed sources
 ifndef OPENJDK
   ifndef CLOSED_PLATFORM_SRC
--- a/make/common/Defs.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Defs.gmk	Thu May 17 16:18:58 2012 -0700
@@ -109,49 +109,6 @@
   endif
 endif
 
-ifneq ($(PLATFORM), windows)
-  ifdef ALT_X11_PATH
-    X11_PATH = $(ALT_X11_PATH)
-  else
-    ifneq ($(OS_VENDOR), NetBSD)
-      X11_PATH = /usr/X11R6
-    else
-      X11_PATH = /usr/X11R7
-    endif
-  endif
-
-  ifdef ALT_PACKAGE_PATH
-    PACKAGE_PATH = $(ALT_PACKAGE_PATH)
-  else
-    ifeq ($(PLATFORM), linux)
-      PACKAGE_PATH = /usr
-    else
-      ifeq ($(OS_VENDOR), Apple)
-        PACKAGE_PATH = /opt/local
-      else
-	ifeq ($(OS_NAME), netbsd)
-	  PACKAGE_PATH = /usr/pkg
-	else
-          PACKAGE_PATH = /usr/local
-	endif
-      endif
-    endif
-  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
-endif
-
 #
 # Get platform definitions
 #
@@ -222,12 +179,18 @@
 
   ifdef ALT_FREETYPE_LIB_PATH
     FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
-    USING_SYSTEM_FT_LIB=true
+    ifneq (,$(findstring $(PLATFORM), bsd macosx))
+      USING_SYSTEM_FT_LIB=true
+    endif
   else
     ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
       FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
     else
-      FREETYPE_LIB_PATH = /usr/lib
+      ifneq (,$(findstring $(PLATFORM), bsd macosx))
+        FREETYPE_LIB_PATH = /usr/X11R6/lib
+      else
+        FREETYPE_LIB_PATH = /usr/lib
+      endif
       USING_SYSTEM_FT_LIB=true
     endif
   endif 
@@ -238,7 +201,11 @@
     ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
       FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
     else
-      FREETYPE_HEADERS_PATH = /usr/include
+      ifneq (,$(findstring $(PLATFORM), bsd macosx))
+        FREETYPE_HEADERS_PATH = /usr/X11R6/include
+      else
+        FREETYPE_HEADERS_PATH = /usr/include
+      endif
     endif
   endif
 endif
@@ -287,6 +254,10 @@
     LDLIBS_COMMON = -ldl
   endif
 
+  ifeq ($(PLATFORM), macosx)
+    LDLIBS_COMMON = -pthread
+  endif
+
   ifeq ($(PLATFORM), bsd)
     LDLIBS_COMMON = -pthread
   endif
@@ -431,7 +402,12 @@
 # We define an intermediate variable for Java files because
 # we use its value later to help define $SOURCEPATH
 
-VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
+  VPATH0.java = $(subst $(ONESPACE),:,$(GENSRCDIR) $(call JavaSrcDirList,,classes))
+else
+  VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
+endif
+
 ifdef OPENJDK
   VPATH.java = $(VPATH0.java)
 else
@@ -457,7 +433,12 @@
 # namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
 # relatives.
 #
-VPATH.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
+VPATH0.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
+ifdef OPENJDK
+  VPATH.h = $(VPATH0.h)
+else
+  VPATH.h = $(CLOSED_SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(VPATH0.h)
+endif
 vpath %.h   $(VPATH.h)
 
 #
--- a/make/common/Library.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Library.gmk	Thu May 17 16:18:58 2012 -0700
@@ -58,6 +58,17 @@
 FILES_o  += $(patsubst %.s,   %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_s))))
 FILES_o  += $(patsubst %.cpp, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp))))
 
+ifeq ($(PLATFORM), macosx)
+FILES_o  += $(patsubst %.m,   %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_objc))))
+FILES_o  += $(patsubst %.mm,  %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_objcpp))))
+
+# MMM: why?
+INCREMENTAL_BUILD=false
+
+endif # PLATFORM
+
+
+
 ifeq ($(INCREMENTAL_BUILD),true)
 FILES_d   = $(patsubst %.c,   %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
 FILES_d  += $(patsubst %.cpp, %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp))))
@@ -217,12 +228,17 @@
 # the shared library.  On other platforms set this to false at the
 # make command line.
 #
+
+ifneq ($(PLATFORM), macosx)
+  ARFLAGS = -r
+endif
+
 $(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder)
 	@$(prep-target)
 	@$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)"
 	@$(ECHO) "Rebuilding $@ because of $?"
 ifeq ($(LIBRARY), fdlibm)
-	$(AR) -r $@ $(FILES_o)
+	$(AR) $(ARFLAGS) $@ $(FILES_o)
 else # LIBRARY
 	$(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
 	@$(call binary_file_verification,$@)
--- a/make/common/Program.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Program.gmk	Thu May 17 16:18:58 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 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
@@ -38,12 +38,18 @@
   override COMPILE_APPROACH = normal
 endif
 
-ifndef LAUNCHER_PLATFORM_SRC
-LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)
-endif
+# set the platform specific directory for macosx, also this platform shares
+# substantial family ties with its siblings (solaris and linux), thus we add
+# solaris src path to its compilation dependencies.
+ifeq ($(PLATFORM), macosx)
+  LAUNCHER_PLATFORM_SRC = $(BUILDDIR)/../src/macosx
+  LAUNCHER_SOLARIS_PLATFORM_SRC  = $(BUILDDIR)/../src/solaris
+else # ! MACOSX
+  LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)
+endif # MACOSX  
 
 ifndef LAUNCHER_SHARE_SRC
-LAUNCHER_SHARE_SRC = $(SHARE_SRC)
+  LAUNCHER_SHARE_SRC = $(SHARE_SRC)
 endif
 
 ACTUAL_PROGRAM_NAME = $(PROGRAM)$(EXE_SUFFIX)
@@ -66,68 +72,74 @@
 include $(JDK_TOPDIR)/make/common/Rules.gmk
 
 ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE
-OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE
+  OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE
 endif
 
 #
 # Create a dependency on libjli (Java Launcher Infrastructure)
 #
 # On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to
-# do this reliably on Linux takes a different syntax than Solaris. BSD's
-# don't support $ORIGIN so build an archive instead.
+# do this reliably on Linux takes a different syntax than Solaris.
 #
 # On Windows, this is done by using the same directory as the executable
 # itself, as with all the Windows libraries.
 #
+ifeq ($(PLATFORM), macosx)
+  ifneq ($(ARCH), universal)
+    LDFLAGS += -Wl,-all_load
+  endif # ARCH
+  LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a
+
+  ifeq ($(SYSTEM_ZLIB),true)
+    OTHER_LDLIBS += -lz
+  endif # SYSTEM_ZLIB
+endif # PLATFORM
+
 ifeq ($(PLATFORM), bsd)
-  ifeq ($(OS_VENDOR), Apple)
-    LDFLAGS += -Wl,-all_load
-    LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a
-  else
-    LDFLAGS += -Wl,--whole-archive
-    LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a
-    LDFLAGS += -Wl,--no-whole-archive
+  LDFLAGS += -Wl,--whole-archive
+  LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a
+  LDFLAGS += -Wl,--no-whole-archive
 # Work-around an dlsym(RTLD_DEFAULT) bug in at least FreeBSD & OpenBSD
-    LDFLAGS += -Wl,--export-dynamic
-  endif
+  LDFLAGS += -Wl,--export-dynamic
   ifeq ($(SYSTEM_ZLIB),true)
       OTHER_LDLIBS += -lz
   endif
-endif
-ifneq (,$(findstring $(PLATFORM), linux solaris))	# UNIX systems
-    LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
-    OTHER_LDLIBS += -ljli
-    ifeq ($(PLATFORM), solaris)
-	ifeq ($(ARCH_DATA_MODEL), 32)
-		LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli
-		LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli
-	else
-		LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli
-		LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli
-	endif
-    endif
-    ifeq ($(PLATFORM), linux)
-	LDFLAGS += $(LDFLAG_Z_ORIGIN)
-	LDFLAGS += -Wl,--allow-shlib-undefined
-	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
-	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
-    endif
-endif
+endif #PLATFORM
+
+ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems
+  LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
+  OTHER_LDLIBS += -ljli
+  ifeq ($(PLATFORM), solaris)
+    ifeq ($(ARCH_DATA_MODEL), 32)
+      LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli
+      LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli
+    else # ! ARCH_DATA_MODEL 64-bit
+      LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli
+      LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli
+    endif # ARCH_DATA_MODEL
+  endif # PLATFORM SOLARIS
+  ifeq ($(PLATFORM), linux)
+    LDFLAGS += $(LDFLAG_Z_ORIGIN)
+    LDFLAGS += -Wl,--allow-shlib-undefined
+    LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
+    LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
+  endif # PLATFORM LINUX
+endif # PLATFORM linux solaris
+
 ifeq ($(PLATFORM), windows)
-	JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf
-	ifdef STATIC_JLI
-	    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static
-	else
-	    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)
-	endif
-	OTHER_LDLIBS += jli.lib
-endif
+  JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf
+  ifdef STATIC_JLI
+    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static
+  else # !STATIC_JLI
+    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)
+  endif # STATIC_JLI
+  OTHER_LDLIBS += jli.lib
+endif # PLATFORM
 
 #
 # Launcher specific files.
 #
-FILES_o = \
-	$(OBJDIR)/main.$(OBJECT_SUFFIX)
+FILES_o = $(OBJDIR)/main.$(OBJECT_SUFFIX)
 
 $(ACTUAL_PROGRAM):: classes $(INIT) 
 
@@ -135,86 +147,103 @@
 # Windows only
 #
 ifeq ($(PLATFORM), windows)
+  # JDK name required here
+  RC_FLAGS += /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \
+              /D "JDK_INTERNAL_NAME=$(PROGRAM)" \
+              /D "JDK_FTYPE=0x1L"
 
-# JDK name required here
-RC_FLAGS += /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \
-	    /D "JDK_INTERNAL_NAME=$(PROGRAM)" \
-	    /D "JDK_FTYPE=0x1L"
+  $(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE)
+	@$(prep-target)
+  ifndef LOCAL_RESOURCE_FILE
+	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
+  endif # LOCAL_RESOURCE_FILE
 
-$(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE)
-	@$(prep-target)
-ifndef LOCAL_RESOURCE_FILE
-	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
-endif
-
-$(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o)
+  $(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o)
 	@$(prep-target)
 	@$(ECHO) $(FILES_o) > $@ 
   ifndef LOCAL_RESOURCE_FILE
 	@$(ECHO) $(OBJDIR)/$(PROGRAM).res >> $@
-  endif
+  endif # LOCAL_RESOURCE_FILE
 	@$(ECHO) setargv.obj >> $@
 	@$(ECHO) Created $@ 
 
-$(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
+  $(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
 	@$(install-file)
 
-ifeq ($(ARCH_DATA_MODEL), 32)
-  STACK_SIZE=327680
-else
-# We need more Stack for Windows 64bit
-  STACK_SIZE=1048576
-endif
+  ifeq ($(ARCH_DATA_MODEL), 32)
+    STACK_SIZE=327680
+  else # !32 BIT
+    # We need more Stack for Windows 64bit
+    STACK_SIZE=1048576
+  endif # ARCH_DATA_MODEL
 
-IMVERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
-$(OBJDIR)/$(PROGRAM).exe.manifest: $(JDK_TOPDIR)/src/windows/resource/java.manifest
+  IMVERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
+  $(OBJDIR)/$(PROGRAM).exe.manifest: $(JDK_TOPDIR)/src/windows/resource/java.manifest
 	@$(prep-target)
 	$(SED) 's%IMVERSION%$(IMVERSION)%g;s%PROGRAM%$(PROGRAM)%g' $< > $@
 
-# We used a hand-crafted manifest file for all executables.
-# It is tweaked to embed the build number and executable name.
-# Use ";#2" for .dll and ";#1" for .exe in the MT command below:
-$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest
+  # We used a hand-crafted manifest file for all executables.
+  # It is tweaked to embed the build number and executable name.
+  # Use ";#2" for .dll and ";#1" for .exe in the MT command below:
+  $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest
 	@$(prep-target)
 	@set -- $?; \
 	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
 	$(LINK) -out:$@ /STACK:$(STACK_SIZE) \
 	    -map:$(OBJDIR)/$(PROGRAM).map $(LFLAGS) $(LDFLAGS) \
 	    @$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS)
-ifdef MT
+  ifdef MT
 	$(MT) /manifest $(OBJDIR)/$(PROGRAM).exe.manifest /outputresource:$@;#1
-endif
+  endif # MT
 	@$(call binary_file_verification,$@)
+else # *NIXES
+  #
+  # Note that we have to link -lthread even when USE_PTHREADS is true.
+  # This is becuase checkForCorrectLibthread() croaks otherwise.
+  #
+  LIBTHREAD = -lthread
+  ifeq ($(USE_PTHREADS),true)
+    THREADLIBS = -lpthread $(LIBTHREAD)
+  else # !USE_PTHREADS
+    THREADLIBS = $(LIBTHREAD)
+  endif # USE_PTHREADS
 
-else # PLATFORM
+  ifeq ($(PLATFORM), macosx)
+    THREADLIBS = -pthread
+    # Needed for linking the various launchers
+    LDFLAGS += -framework Cocoa -framework Security \
+               -framework ApplicationServices
+    OTHER_CPPFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
 
-#
-# Note that we have to link -lthread even when USE_PTHREADS is true.
-# This is becuase checkForCorrectLibthread() croaks otherwise.
-#
-LIBTHREAD = -lthread
-ifeq ($(USE_PTHREADS),true)
-  THREADLIBS = -lpthread $(LIBTHREAD)
-else # USE_PTHREADS
-  THREADLIBS = $(LIBTHREAD)
-endif # USE_PTHREADS
+    # Default Info.plist file for the command line tools. This gets overridden by
+    # some of the jvmstat tools so that they have task_for_pid() privileges
+    ifndef INFO_PLIST_FILE
+      INFO_PLIST_FILE = Info-cmdline.plist
+    endif # INFO_PLIST_FILE 
+    LDFLAGS += -sectcreate __TEXT __info_plist $(LAUNCHER_PLATFORM_SRC)/lib/$(INFO_PLIST_FILE)
+  else # SOLARIS/LINUX
+    INFO_PLIST_FILE=
+  endif # MACOSX
 
-ifeq ($(PLATFORM), bsd)
-THREADLIBS = -pthread
-endif
+  ifeq ($(PLATFORM), bsd)
+    THREADLIBS = -pthread
+    OTHER_CPPFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
+  endif
 
-#
-# This rule only applies on unix.  It supports quantify and its ilk.
-#
-$(ACTUAL_PROGRAM):: $(FILES_o)
+  #
+  # This rule only applies on unix.  It supports quantify and its ilk.
+  #
+  $(ACTUAL_PROGRAM):: $(FILES_o)
 	@$(prep-target)
 	@set -- $?; \
-	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
+	$(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
 	@$(MKDIR) -p $(TEMPDIR)
 	$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
-	    $(FILES_o) $(THREADLIBS) $(LDLIBS)
+	$(FILES_o) $(THREADLIBS) $(LDLIBS)
+  ifeq ($(findstring privileged, $(INFO_PLIST_FILE)), privileged)
+	-codesign -s openjdk_codesign $@
+  endif # INFO_PLIST_FILE
 	@$(call binary_file_verification,$@)
-
 endif # PLATFORM
 
 clean:: 
@@ -238,46 +267,49 @@
 # Now include make dependencies (created during compilation, see Rules.gmk)
 #
 ifeq ($(INCREMENTAL_BUILD),true)
-# Workaround: gnumake sometimes says files is empty when it shouldn't
-#    was:  files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
-files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
-ifneq ($(strip $(files)),)
-include $(files)
-endif # files
+  # Workaround: gnumake sometimes says files is empty when it shouldn't
+  #    was:  files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
+  files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
+  ifneq ($(strip $(files)),)
+    include $(files)
+  endif # files
 endif # INCREMENTAL_BUILD
 
 ifdef JAVA_ARGS
-OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)'
-OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
-endif
+  OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)'
+  OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
+endif # JAVA_ARGS
 
 ifeq ($(PLATFORM), windows)
-ifdef RELEASE
-OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"'
-endif
-endif
+  ifdef RELEASE
+    OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"'
+  endif #RELEASE
+endif #PLATFORM
 
 
 ifneq ($(PLATFORM), windows)
-ifneq ($(PLATFORM), bsd)
-HAVE_GETHRTIME=true
-endif
-endif
+  ifneq ($(PLATFORM), bsd)
+    HAVE_GETHRTIME=true
+  endif
+endif #PLATFORM
 
 ifeq ($(HAVE_GETHRTIME),true)
-OTHER_CPPFLAGS += -DHAVE_GETHRTIME
+  OTHER_CPPFLAGS += -DHAVE_GETHRTIME
 endif
 
 OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
-ifneq ($(SYSTEM_ZLIB),true)
-OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
-endif
+ifeq ($(PLATFORM), macosx)
+  OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)/bin
+endif # PLATFORM
+ifneq ($(SYSTEM_ZLIB), true)
+  OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
+endif # SYSTEM_ZLIB
 
-OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
+OTHER_CPPFLAGS  += -DPROGNAME='"$(PROGRAM)"'
 VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
 
 VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
-		   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
+                   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
 
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/common/Release-macosx.gmk	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,75 @@
+#
+# 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.
+#
+
+MANBASEDIRS=$(JDK_TOPDIR)/src/bsd/doc $(IMPORTDOCDIR)
+MAN1SUBDIR = man
+JA_DIRNAME=ja_JP.UTF-8
+
+# Defines the release targets for Mac OS X build products
+
+JDK_BUNDLE_DIR = $(ABS_OUTPUTDIR)/j2sdk-bundle/$(THIS_JDK_VERSION).jdk/Contents
+JRE_BUNDLE_DIR = $(ABS_OUTPUTDIR)/j2re-bundle/$(THIS_JDK_VERSION).jre/Contents
+
+MACOSX_SRC	 = $(JDK_TOPDIR)/src/macosx
+
+BUNDLE_ID ?= net.java.openjdk
+BUNDLE_ID_JRE ?= $(BUNDLE_ID).jre
+BUNDLE_ID_JDK ?= $(BUNDLE_ID).jdk
+
+BUNDLE_NAME ?= OpenJDK $(JDK_MINOR_VERSION)
+BUNDLE_NAME_JRE ?= $(BUNDLE_NAME)
+BUNDLE_NAME_JDK ?= $(BUNDLE_NAME)
+
+BUNDLE_INFO ?= OpenJDK ($(JDK_VERSION))
+BUNDLE_INFO_JRE ?= $(BUNDLE_INFO)
+BUNDLE_INFO_JDK ?= $(BUNDLE_INFO)
+
+BUNDLE_PLATFORM_VERSION ?= $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
+BUNDLE_VERSION ?= $(JDK_VERSION)
+BUNDLE_VENDOR ?= UNDEFINED
+
+jre-bundle-setup:
+	$(RM) -r $(JRE_BUNDLE_DIR)
+
+jdk-bundle-setup:
+	$(RM) -r $(JDK_BUNDLE_DIR)
+
+jre-bundle-files:
+	$(MKDIR) -p $(JRE_BUNDLE_DIR)/MacOS
+	ln -s ../Home/lib/jli/libjli.dylib $(JRE_BUNDLE_DIR)/MacOS/
+	$(CP) -r $(JRE_IMAGE_DIR) $(JRE_BUNDLE_DIR)/Home
+	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" -e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" -e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" < $(MACOSX_SRC)/bundle/JRE-Info.plist > $(JRE_BUNDLE_DIR)/Info.plist
+	/usr/bin/SetFile -a B $(JRE_BUNDLE_DIR)/../
+
+jdk-bundle-files:
+	$(MKDIR) -p $(JDK_BUNDLE_DIR)/MacOS
+	ln -s ../Home/jre/lib/jli/libjli.dylib $(JDK_BUNDLE_DIR)/MacOS/
+	$(CP) -r $(JDK_IMAGE_DIR) $(JDK_BUNDLE_DIR)/Home
+	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" -e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" -e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" < $(MACOSX_SRC)/bundle/JDK-Info.plist > $(JDK_BUNDLE_DIR)/Info.plist
+	/usr/bin/SetFile -a B $(JDK_BUNDLE_DIR)/../
+
+EXTRA_IMAGE_TARGETS += jre-bundle-setup jdk-bundle-setup jre-bundle-files jdk-bundle-files
+
+.PHONY: $(EXTRA_JRE_TARGETS) $(EXTRA_IMAGE_TARGETS)
--- a/make/common/Release.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Release.gmk	Thu May 17 16:18:58 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 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
@@ -61,7 +61,8 @@
 #
 EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
                         com.oracle.net \
-                        com.oracle.nio
+                        com.oracle.nio \
+                        com.oracle.util
 
 # 64-bit solaris has a few special cases. We define the variable
 # SOLARIS64 for use in this Makefile to easily test those cases
@@ -74,6 +75,10 @@
 
 JTG_DOCS            = $(JDK_TOPDIR)/src/solaris/doc
 
+ifeq ($(PLATFORM), macosx)
+  include $(JDK_TOPDIR)/make/common/Release-$(PLATFORM).gmk
+endif
+
 # The base names of all the license and document files for the jdk and jre
 #   (These files get placed in the jdk and jre install images)
 ifdef OPENJDK
@@ -132,6 +137,7 @@
 JDK_MAN_PAGES =            \
 	$(JRE_MAN_PAGES)   \
 	appletviewer.1     \
+        apt.1              \
 	extcheck.1         \
 	idlj.1             \
 	jar.1              \
@@ -140,6 +146,7 @@
 	javadoc.1          \
 	javah.1            \
 	javap.1            \
+	jcmd.1             \
 	jconsole.1         \
 	jdb.1              \
 	jhat.1             \
@@ -171,10 +178,10 @@
 endif # linux
 
 ifeq ($(PLATFORM), bsd)
-  MANBASEDIRS=$(JDK_TOPDIR)/src/bsd/doc $(IMPORTDOCDIR)
-  MAN1SUBDIR = man
+  MANBASEDIRS=$(JDK_TOPDIR)/src/linux/doc $(IMPORTDOCDIR)
+  MAN1SUBDIR=man
   JA_DIRNAME=ja_JP.UTF-8
-endif
+endif # linux
 
 define copy-man-pages
 $(MKDIR) -p $1/man/man1
@@ -236,11 +243,22 @@
 	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
 
 # Order is important here, trim jre after jdk image is created
+ifeq ($(PLATFORM), macosx)
+
+images:: sanity-images post-sanity-images  \
+	 $(INITIAL_IMAGE_JRE) $(EXTRA_JRE_TARGETS) $(INITIAL_IMAGE_JDK) \
+	 trim-image-jre trim-image-jdk \
+     identify-image-jre identify-image-jdk \
+	 process-image-jre process-image-jdk sec-files sec-files-win jgss-files \
+	 $(EXTRA_IMAGE_TARGETS)
+else
+
 images:: sanity-images post-sanity-images  \
 	 $(INITIAL_IMAGE_JRE) $(INITIAL_IMAGE_JDK) \
 	 trim-image-jre trim-image-jdk \
          identify-image-jre identify-image-jdk \
 	 process-image-jre process-image-jdk sec-files sec-files-win jgss-files 
+endif
 
 # Don't use these
 image-jre:: initial-image-jre trim-image-jre identify-image-jre process-image-jre
@@ -309,12 +327,6 @@
   SOURCE_DIRS += $(CLOSED_SRC)/share/classes
 endif
 
-ifeq ($(OS_VENDOR), OpenBSD)
-  FILES_FROM_ARG=-I
-else
-  FILES_FROM_ARG=-T
-endif
-
 
 #
 # Specific files and directories that will be filtered out from above areas.
@@ -334,6 +346,7 @@
 	sun/tools/jar		\
 	sun/tools/java		\
 	sun/tools/javac		\
+	sun/tools/jcmd		\
 	sun/tools/jps		\
 	sun/tools/jstat		\
 	sun/tools/jstatd	\
@@ -391,6 +404,11 @@
 	sun/tools/jinfo         \
 	sun/tools/jmap
 
+# classes that go into jfr.jar
+JFR_CLASSES_DIRS= \
+	com/oracle/jrockit/jfr \
+	oracle/jrockit/jfr
+
 # classes that go into jsse.jar
 JSSE_CLASSES_DIRS = \
 	sun/security/provider/Sun.class \
@@ -446,6 +464,7 @@
 	apt$(EXE_SUFFIX) \
 	javah$(EXE_SUFFIX) \
 	javap$(EXE_SUFFIX) \
+	jcmd$(EXE_SUFFIX) \
 	jdb$(EXE_SUFFIX) \
 	jps$(EXE_SUFFIX) \
 	jrunscript$(EXE_SUFFIX) \
@@ -555,6 +574,7 @@
 	$(ECHO) "sun/tools/javac/" >> $@
 	$(ECHO) "com/sun/tools/classfile/" >> $@
 	$(ECHO) "com/sun/tools/javap/" >> $@
+	$(ECHO) "sun/tools/jcmd/" >> $@
 	$(ECHO) "sun/tools/jconsole/" >> $@
 	$(ECHO) "sun/tools/jps/" >> $@
 	$(ECHO) "sun/tools/jstat/" >> $@
@@ -591,6 +611,19 @@
 	$(ECHO) "sun/tools/jstack/" >> $@
 	$(ECHO) "sun/tools/jinfo/" >> $@
 	$(ECHO) "sun/tools/jmap/" >> $@
+ifndef OPENJDK
+ifndef JAVASE_EMBEDDED
+	$(ECHO) "com/oracle/jrockit/jfr/" >> $@
+	$(ECHO) "com/oracle/jrockit/jfr/client/" >> $@
+	$(ECHO) "com/oracle/jrockit/jfr/management/" >> $@
+	$(ECHO) "oracle/jrockit/jfr/" >> $@
+	$(ECHO) "oracle/jrockit/jfr/events/" >> $@
+	$(ECHO) "oracle/jrockit/jfr/openmbean/" >> $@
+	$(ECHO) "oracle/jrockit/jfr/parser/" >> $@
+	$(ECHO) "oracle/jrockit/jfr/settings/" >> $@
+	$(ECHO) "oracle/jrockit/jfr/tools/" >> $@
+endif
+endif
 
 
 # File order list for rt.jar
@@ -615,6 +648,20 @@
 	$(MV) $@.temp $@
 	@($(CD) $(CLASSBINDIR) && $(java-vm-cleanup))
 
+# Create jfr.jar
+JFR_JAR=
+ifndef OPENJDK
+ifndef JAVASE_EMBEDDED
+JFR_JAR=$(ABS_TEMPDIR)/jfr-orig.jar
+$(JFR_JAR): $(OTHER_JAR_MANIFEST_FILE)
+	$(prep-target)
+	$(CD) $(CLASSBINDIR) && \
+	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(OTHER_JAR_MANIFEST_FILE) $@ \
+		$(JFR_CLASSES_DIRS) $(BOOT_JAR_JFLAGS)
+	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
+endif
+endif
+
 # Create the rt.jar file list & non-class files list
 
 JARSPLIT_JARFILE = $(BUILDTOOLJARDIR)/jarsplit.jar
@@ -749,7 +796,7 @@
 # drive names like C:
 initial-image-jre:: initial-image-jre-setup \
 		    $(JRE_DOCFILES) \
-		    $(RT_JAR) $(RESOURCES_JAR) $(JSSE_JAR) \
+		    $(RT_JAR) $(RESOURCES_JAR) $(JSSE_JAR) $(JFR_JAR) \
 		    $(BUILDMETAINDEX_JARFILE)
 	@# Copy in bin directory
 	$(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_IMAGE_DIR)
@@ -777,6 +824,9 @@
 	$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
 	$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
 	$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
+ifneq ($(JFR_JAR),)
+	$(CP) $(JFR_JAR) $(JRE_IMAGE_DIR)/lib/jfr.jar
+endif
 	@# Generate meta-index to make boot and extension class loaders lazier
 	$(CD) $(JRE_IMAGE_DIR)/lib && \
 	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
@@ -786,6 +836,10 @@
 	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
 		-o meta-index *.jar
 	@$(CD) $(JRE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
+ifeq ($(PLATFORM), macosx)
+	@#install jobjc, apple mac only
+	$(CP) $(OUTPUTDIR)/JObjC.build/JObjC.jar $(JRE_IMAGE_DIR)/lib/JObjC.jar
+endif # macosx
 ifeq ($(PLATFORM), windows)
 	@# Remove certain *.lib files
 	$(CD) $(JRE_IMAGE_DIR)/lib && \
@@ -928,6 +982,16 @@
 	$(RM) $(JDK_IMAGE_DIR)/db/index.html $(JDK_IMAGE_DIR)/db/register.html
 endif
 
+# The launcher source files we need for src.zip
+FILES_launcher = $(wildcard $(SHARE_SRC)/bin/*) \
+                 $(wildcard $(PLATFORM_SRC)/bin/java_md*)
+
+ifeq ($(OS_VENDOR), OpenBSD)
+  FILES_FROM_ARG=-I
+else
+  FILES_FROM_ARG=-T
+endif
+
 # Standard jdk image
 initial-image-jdk:: initial-image-jdk-setup \
 		    initial-image-jdk-db \
@@ -1014,7 +1078,8 @@
 	@# generated by the more efficient solaris/windows method of copying files.
 	@# So for Linux, make use of the -T option (like Solaris' -I option) of
 	@# obtaining the list of files from a file. MKS tar has no such option.
-  ifneq (,$(findstring $(PLATFORM), linux bsd))
+
+  ifneq (,$(findstring $(PLATFORM), linux macosx bsd))
 	for d in $(SOURCE_DIRS); do \
 	  $(RM) $(ABS_TEMPDIR)/src-files.list; \
 	  ($(CD) $$d &&  \
@@ -1052,20 +1117,7 @@
 	$(RM) $(ABS_TEMPDIR)/src-files.list
 	$(CHMOD) -R +w $(JDK_IMAGE_DIR)/src
 	$(MKDIR) -p $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/java.c $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/java.h $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/manifest_info.h $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/parse_manifest.c $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/version_comp.c $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/version_comp.h $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/wildcard.h $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/wildcard.c $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/jli_util.h $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/jli_util.c $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/splashscreen_stubs.c $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(SHARE_SRC)/bin/splashscreen.h $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(PLATFORM_SRC)/bin/java_md.c $(JDK_IMAGE_DIR)/src/launcher
-	$(CP) $(PLATFORM_SRC)/bin/java_md.h $(JDK_IMAGE_DIR)/src/launcher
+	$(CP) $(FILES_launcher) $(JDK_IMAGE_DIR)/src/launcher
 	$(CD) $(JDK_IMAGE_DIR)/src && $(ZIPEXE) -qr ../src.zip *
 	$(RM) -r $(JDK_IMAGE_DIR)/src
 	@#
--- a/make/common/Rules.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/Rules.gmk	Thu May 17 16:18:58 2012 -0700
@@ -51,12 +51,23 @@
 #
 # All source tree areas for java/properties files (a few may be closed)
 #
-ifdef OPENJDK
-  ALL_CLASSES_SRC = $(SHARE_SRC)/classes $(PLATFORM_SRC)/classes
+ifeq ($(PLATFORM), macosx)
+  ifdef OPENJDK
+    ALL_CLASSES_SRC = $(call JavaSrcDirList,,classes)
+  else
+    # TODO(cpc): maybe we should modify JavaSrcDirList macro instead...
+    ALL_CLASSES_SRC = \
+	  $(CLOSED_SHARE_SRC)/classes $(CLOSED_PLATFORM_SRC)/classes \
+	  $(call JavaSrcDirList,,classes)
+  endif
 else
-  ALL_CLASSES_SRC = \
-	$(CLOSED_SHARE_SRC)/classes $(CLOSED_PLATFORM_SRC)/classes \
-	$(SHARE_SRC)/classes $(PLATFORM_SRC)/classes
+  ifdef OPENJDK
+    ALL_CLASSES_SRC = $(SHARE_SRC)/classes $(PLATFORM_SRC)/classes
+  else
+    ALL_CLASSES_SRC = \
+	  $(CLOSED_SHARE_SRC)/classes $(CLOSED_PLATFORM_SRC)/classes \
+	  $(SHARE_SRC)/classes $(PLATFORM_SRC)/classes
+  endif
 endif
 
 #
@@ -200,8 +211,15 @@
 
 $(CLASSDESTDIR)/%.class: $(GENSRCDIR)/%.java
 	@$(add-java-file)
+
+ifeq ($(PLATFORM), macosx)
+# TODO(cpc): need to document why this is necessary...
+$(CLASSDESTDIR)/%.class: $(JDK_TOPDIR)/src/macosx/classes/%.java
+	@$(add-java-file)
+endif
 $(CLASSDESTDIR)/%.class: $(PLATFORM_SRC)/classes/%.java
 	@$(add-java-file)
+
 $(CLASSDESTDIR)/%.class: $(SHARE_SRC)/classes/%.java
 	@$(add-java-file)
 
--- a/make/common/internal/NativeCompileRules.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/internal/NativeCompileRules.gmk	Thu May 17 16:18:58 2012 -0700
@@ -176,6 +176,24 @@
     endif
 	@$(check-conventions)
 
+# Obj-C files (Mac OS X only).
+ifeq ($(PLATFORM), macosx)
+$(OBJDIR)/%.$(OBJECT_SUFFIX): %.m
+	@$(prep-target)
+	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $(CFLAGS_GPROF) $<
+	@$(check-conventions)
+
+$(OBJDIR)/%.$(OBJECT_SUFFIX): %.mm
+	@$(prep-target)
+	$(COMPILE.cc) $(CC_OBJECT_OUTPUT_FLAG)$@ $(CFLAGS_GPROF) $<
+	@$(check-conventions)
+
+$(OBJDIR)/%.$(OBJECT_SUFFIX): %.c
+	@$(prep-target)
+	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $(CFLAGS_GPROF) $<
+	@$(check-conventions)
+endif # PLATFORM
+
 #
 # Quick hack for making the compiler generate just the assembly file.
 #	$ gnumake obj/sparc/myfile.s
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/common/shared/Compiler-llvm.gmk	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,59 @@
+#
+# 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.
+#
+
+#
+# LLVM Compiler settings
+#
+
+ifeq ($(PLATFORM), macosx)
+
+  # Settings specific to Mac OS X
+  ifeq ($(origin CC), default)
+   CC             = $(COMPILER_PATH)llvm-gcc
+  endif
+  CPP             = $(COMPILER_PATH)llvm-gcc -E
+  ifeq ($(origin CXX), default)
+   CXX            = $(COMPILER_PATH)llvm-g++
+  endif
+
+  REQUIRED_CC_VER = 4.2.1
+
+  # Option used to create a shared library
+  SHARED_LIBRARY_FLAG = -Wl,-install_name,@rpath/$(@F) -dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0
+  SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 )
+
+  AR = $(CC)
+  ARFLAGS = -nostdlib -r -arch i386 -arch x86_64 -o
+
+endif
+
+# Get llvm version
+_CC_VER :=$(shell $(CC) -dumpversion 2>&1 )
+CC_VER  :=$(call GetVersion,"$(_CC_VER)")
+
+# Name of compiler
+COMPILER_NAME = LLVM-GCC$(call MajorVersion,$(CC_VER))
+COMPILER_VERSION = $(COMPILER_NAME)
+
--- a/make/common/shared/Defs-java.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/shared/Defs-java.gmk	Thu May 17 16:18:58 2012 -0700
@@ -66,7 +66,12 @@
    -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput
 
 # JVM options
-JAVA_JVM_FLAGS = $(JAVA_HOTSPOT_DISABLE_PRINT_VMOPTIONS)
+# MMM: is headless option necessary?
+ifeq ($(PLATFORM), macosx)
+  JAVA_JVM_FLAGS = $(JAVA_HOTSPOT_DISABLE_PRINT_VMOPTIONS) -Djava.awt.headless=true
+else
+  JAVA_JVM_FLAGS = $(JAVA_HOTSPOT_DISABLE_PRINT_VMOPTIONS)
+endif
 
 ifeq ($(ADD_CLIENT_VM_OPTION), true)
   JAVA_JVM_FLAGS += -client
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/common/shared/Defs-macosx.gmk	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,252 @@
+#
+# Copyright (c) 2005, 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.
+#
+
+#
+# Definitions for Bsd.
+#
+
+# Default for COMPILER_WARNINGS_FATAL on Bsd (C & C++ compiler warnings)
+ifndef COMPILER_WARNINGS_FATAL
+  COMPILER_WARNINGS_FATAL=false
+endif
+
+# Bsd should use parallel compilation for best build times
+ifndef COMPILE_APPROACH
+  COMPILE_APPROACH = parallel
+endif
+
+# Indication that we are doing an incremental build.
+#    This may trigger the creation of make depend files.
+ifndef INCREMENTAL_BUILD
+  INCREMENTAL_BUILD = false
+endif
+
+# FullPath just makes sure it never ends with a / and no duplicates
+define FullPath
+$(shell cd $1 2> $(DEV_NULL) && pwd)
+endef
+
+# OptFullPath: Absolute path name of a dir that might not initially exist.
+define OptFullPath
+$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
+endef
+
+# Location on system where jdk installs might be
+USRJDKINSTANCES_PATH = $(PACKAGE_PATH)
+
+# UNIXCOMMAND_PATH: path to where the most common Unix commands are.
+#  NOTE: Must end with / so that it could be empty, allowing PATH usage.
+ifneq "$(origin ALT_UNIXCOMMAND_PATH)" "undefined"
+  UNIXCOMMAND_PATH :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH))
+else
+  UNIXCOMMAND_PATH  = /bin/
+endif
+
+# USRBIN_PATH: path to where the most common Unix commands are.
+#  NOTE: Must end with / so that it could be empty, allowing PATH usage.
+ifneq "$(origin ALT_USRBIN_PATH)" "undefined"
+  USRBIN_PATH :=$(call PrefixPath,$(ALT_USRBIN_PATH))
+else
+  USRBIN_PATH  = /usr/bin/
+endif
+
+# UNIXCCS_PATH: path to where the Solaris ported UNIX commands can be found
+#  NOTE: Must end with / so that it could be empty, allowing PATH usage.
+ifneq "$(origin ALT_UNIXCCS_PATH)" "undefined"
+  UNIXCCS_PATH :=$(call PrefixPath,$(ALT_UNIXCCS_PATH))
+else
+  UNIXCCS_PATH = /usr/ccs/bin/
+endif
+
+# SLASH_JAVA: location of all network accessable files
+ifdef ALT_SLASH_JAVA
+  SLASH_JAVA  :=$(ALT_SLASH_JAVA)
+else
+  SLASH_JAVA  := $(call DirExists,/java,/java,/NOT-SET)
+endif
+
+# JDK_DEVTOOLS_DIR: common path for all the java devtools
+ifdef ALT_JDK_DEVTOOLS_DIR
+  JDK_DEVTOOLS_DIR  =$(ALT_JDK_DEVTOOLS_DIR)
+else
+  JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools
+endif
+
+# COMPILER_PATH: path to where the compiler and tools are installed.
+#  NOTE: Must end with / so that it could be empty, allowing PATH usage.
+ifneq "$(origin ALT_COMPILER_PATH)" "undefined"
+  COMPILER_PATH :=$(call PrefixPath,$(ALT_COMPILER_PATH))
+else
+ ifeq ($(OS_VENDOR), Apple)
+  ifndef DEVELOPER_DIR
+   DEVELOPER_DIR = $(shell /usr/bin/xcode-select -print-path)/usr/bin/
+  endif
+  
+  COMPILER_PATH  := $(call DirExists,$(DEVELOPER_DIR),/usr/bin/,/NOT-SET)
+ else
+  COMPILER_PATH  =/usr/bin/
+ endif
+endif
+
+# OPENWIN_HOME: path to where the X11 environment is installed.
+#  NOTE: Must end with / so that it could be empty, allowing PATH usage.
+ifneq ($(ALT_OPENWIN_HOME),)
+  OPENWIN_HOME :=$(call PrefixPath,$(ALT_OPENWIN_HOME))
+else
+  OPENWIN_HOME  =$(X11_PATH)
+endif
+
+# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
+#  NOTE: Must end with / so that it could be empty, allowing PATH usage.
+ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined"
+  DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH))
+else
+  DEVTOOLS_PATH =$(PACKAGE_PATH)/bin/
+endif
+
+# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
+# _BOOTDIR2: Second choice
+ifndef ALT_BOOTDIR
+  _BOOTDIR1  =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH)
+  _BOOTDIR2  =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION)
+endif
+
+# Always build headless on Bsd
+BUILD_HEADLESS = true
+LIBM=-lm
+
+ifeq ($(OS_VENDOR), Apple)
+  _CUPS_HEADERS_PATH=/usr/include
+else
+  _CUPS_HEADERS_PATH=$(PACKAGE_PATH)/include
+endif
+
+# Import JDK images allow for partial builds, components not built are
+#    imported (or copied from) these import areas when needed.
+
+# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for 
+#   multiple platforms, e.g. windows-i586, solaris-sparc, bsd-586, etc.
+ifdef ALT_BUILD_JDK_IMPORT_PATH
+  BUILD_JDK_IMPORT_PATH  :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH))
+else
+  BUILD_JDK_IMPORT_PATH   = $(PROMOTED_BUILD_BINARIES)
+endif
+BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH)
+
+# JDK_IMPORT_PATH: location of JDK install tree (this version) to import
+ifdef ALT_JDK_IMPORT_PATH
+  JDK_IMPORT_PATH  :=$(call FullPath,$(ALT_JDK_IMPORT_PATH))
+else
+  JDK_IMPORT_PATH   = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT)
+endif
+JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH)
+
+# HOTSPOT_IMPORT_PATH: location of hotspot pre-built files
+ifdef ALT_HOTSPOT_IMPORT_PATH
+  HOTSPOT_IMPORT_PATH :=$(call FullPath,$(ALT_HOTSPOT_IMPORT_PATH))
+else
+  HOTSPOT_IMPORT_PATH =$(JDK_IMPORT_PATH)
+endif
+HOTSPOT_IMPORT_PATH:=$(call AltCheckValue,HOTSPOT_IMPORT_PATH)
+
+# HOTSPOT_CLIENT_PATH: location of client jvm library file.
+ifeq ($(ARCH_DATA_MODEL), 32)
+  ifdef ALT_HOTSPOT_CLIENT_PATH
+    HOTSPOT_CLIENT_PATH :=$(call FullPath,$(ALT_HOTSPOT_CLIENT_PATH))
+  else
+    HOTSPOT_CLIENT_PATH   =$(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/client
+  endif
+  HOTSPOT_CLIENT_PATH:=$(call AltCheckValue,HOTSPOT_CLIENT_PATH)
+endif
+
+# HOTSPOT_SERVER_PATH: location of server jvm library file.
+ifdef ALT_HOTSPOT_SERVER_PATH
+  HOTSPOT_SERVER_PATH :=$(call FullPath,$(ALT_HOTSPOT_SERVER_PATH))
+else
+  HOTSPOT_SERVER_PATH   =$(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/server
+endif
+HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
+
+# Special define for checking the binaries
+
+# Debug builds should downgrade warnings to just info
+MAPFILE_WARNING-DBG=INFO
+MAPFILE_WARNING-OPT=WARNING
+MAPFILE_WARNING-=WARNING
+MAPFILE_WARNING=$(MAPFILE_WARNING-$(VARIANT))
+
+# Macro to check it's input file for banned dependencies and verify the
+#   binary built properly. Relies on process exit code.
+ifndef CROSS_COMPILE_ARCH
+ifeq ($(OS_VENDOR), Apple)
+define binary_file_verification # binary_file
+( \
+  $(ECHO) "Checking for mapfile use in: $1" && \
+  if [ "`$(NM) -g $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
+    $(ECHO) "WARNING: File was not built with a mapfile: $1"; \
+  fi && \
+  $(ECHO) "Library loads for: $1" && \
+  $(OTOOL) -L $1 && \
+  $(ECHO) "RUNPATH for: $1" && \
+  ( $(OTOOL) -l $1 | $(EGREP) 'path ' ) \
+) || true
+endef
+else
+ifeq ($(OS_VENDOR), OpenBSD)
+define binary_file_verification # binary_file
+( \
+  $(ECHO) "Checking for mapfile use in: $1" && \
+  if [ "`$(OBJDUMP) -T $1 | $(EGREP) '[0-9a-f]* g *DF \.text.*SUNWprivate'`" = "" ] ; then \
+    $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \
+  fi && \
+  $(ECHO) "Library loads for: $1" && \
+  $(LDD) $1 && \
+  $(ECHO) "RUNPATH for: $1" && \
+  ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
+) || true
+endef
+else
+define binary_file_verification # binary_file
+( \
+  $(ECHO) "Checking for mapfile use in: $1" && \
+  if [ "`$(NM) -D -g --defined-only $1 | $(EGREP) 'SUNWprivate'`" = "" ] ; then \
+    $(ECHO) "$(MAPFILE_WARNING): File was not built with a mapfile: $1"; \
+  fi && \
+  $(ECHO) "Library loads for: $1" && \
+  $(LDD) $1 && \
+  $(ECHO) "RUNPATH for: $1" && \
+  ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
+)
+endef
+endif # OS_VENDOR == OpenBSD
+endif # OS_VENDOR == Apple
+else
+define binary_file_verification 
+( \
+  $(ECHO) "Skipping binary file verification for cross-compile build" \
+)
+endef
+endif
+
--- a/make/common/shared/Defs-utils.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/shared/Defs-utils.gmk	Thu May 17 16:18:58 2012 -0700
@@ -67,6 +67,13 @@
   UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH)
 endif
 
+ifeq ($(PLATFORM),macosx)
+  UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH)
+  UTILS_USR_BIN_PATH=$(USRBIN_PATH)
+  UTILS_CCS_BIN_PATH=$(USRBIN_PATH)
+  UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH)
+endif
+
 ifeq ($(PLATFORM),bsd)
   UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH)
   UTILS_USR_BIN_PATH=$(USRBIN_PATH)
@@ -133,7 +140,6 @@
 MSGFMT         = $(UTILS_USR_BIN_PATH)msgfmt
 MV             = $(UTILS_COMMAND_PATH)mv
 NAWK           = $(UTILS_USR_BIN_PATH)nawk
-NM             = $(UTILS_CCS_BIN_PATH)nm
 OTOOL          = $(UTILS_USR_BIN_PATH)otool
 PKGMK          = $(UTILS_COMMAND_PATH)pkgmk
 PRINTF         = $(UTILS_USR_BIN_PATH)printf
@@ -229,6 +235,30 @@
   ECHO           = /usr/bin/echo
 endif
 
+ifeq ($(PLATFORM), macosx) 
+  BASENAME     = $(UTILS_USR_BIN_PATH)basename
+  EGREP        = $(UTILS_USR_BIN_PATH)egrep
+  EXPR         = $(UTILS_COMMAND_PATH)expr
+  FMT          = $(UTILS_USR_BIN_PATH)fmt
+  GREP         = $(UTILS_USR_BIN_PATH)grep
+  GUNZIP       = $(UTILS_USR_BIN_PATH)gunzip
+  ID           = $(UTILS_USR_BIN_PATH)id
+  MSGFMT       = $(UTILS_DEVTOOL_PATH)msgfmt
+  SED          = $(UTILS_USR_BIN_PATH)sed
+  SORT         = $(UTILS_USR_BIN_PATH)sort
+  TEST         = $(UTILS_COMMAND_PATH)test
+  TOUCH        = $(UTILS_USR_BIN_PATH)touch
+  TRUE         = $(UTILS_USR_BIN_PATH)true
+  UNAME        = $(UTILS_USR_BIN_PATH)uname
+  NAWK         = $(UTILS_USR_BIN_PATH)awk
+  UNZIPSFX     = $(UTILS_USR_BIN_PATH)unzipsfx
+  ZIPEXE       = $(UTILS_USR_BIN_PATH)zip
+  CPIO         = $(UTILS_USR_BIN_PATH)cpio
+  TAR          = $(UTILS_USR_BIN_PATH)tar
+  # Builtin shell command, no -e option needed
+  ECHO         = echo
+endif
+
 # BSD specific
 ifeq ($(PLATFORM),bsd)
   BASENAME     = $(UTILS_USR_BIN_PATH)basename
@@ -245,14 +275,8 @@
   TOUCH        = $(UTILS_USR_BIN_PATH)touch
   TRUE         = $(UTILS_USR_BIN_PATH)true
   UNAME        = $(UTILS_USR_BIN_PATH)uname
+  UNZIP      = $(UTILS_DEVTOOL_PATH)unzip
   # BSD OS_VENDOR specific
-  ifeq ($(OS_VENDOR), Apple)
-    NAWK       = $(UTILS_USR_BIN_PATH)awk
-    UNZIPSFX   = $(UTILS_USR_BIN_PATH)unzipsfx
-    ZIPEXE     = $(UTILS_USR_BIN_PATH)zip
-  else
-    UNZIP      = $(UTILS_DEVTOOL_PATH)unzip
-  endif
   ifeq ($(OS_VENDOR), OpenBSD)
     NAWK       = $(UTILS_USR_BIN_PATH)awk
     OBJDUMP    = $(UTILS_USR_BIN_PATH)objdump
--- a/make/common/shared/Defs-versions.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/shared/Defs-versions.gmk	Thu May 17 16:18:58 2012 -0700
@@ -49,6 +49,11 @@
   override CC_VERSION = gcc
 endif
 
+# Mac OS X uses LLVM by default
+ifeq ($(PLATFORM), macosx)
+  override CC_VERSION = llvm
+endif
+
 ##########################################################################
 #
 # List of JDK official minimum, expected, or required versions:
@@ -169,6 +174,24 @@
   endif
 endif
 
+# BSD specific
+ifeq ($(PLATFORM), macosx)
+  REQUIRED_COMPILER_NAME      = GCC4
+  REQUIRED_COMPILER_VERSION   = GCC4
+  REQUIRED_CC_VER             = 4.2.1
+endif
+
+# Mac specific
+ifeq ($(PLATFORM), macosx)
+  REQUIRED_OS_NAME            = Darwin
+  REQUIRED_OS_VERSION         = 11.2
+  REQUIRED_OS_VARIANT_NAME    = MacOSX
+  REQUIRED_OS_VARIANT_VERSION = 10.7.2
+  REQUIRED_COMPILER_NAME      = GCC4
+  REQUIRED_COMPILER_VERSION   = GCC4
+  REQUIRED_CC_VER             = 4.2.1
+endif
+
 # Windows specific
 ifeq ($(PLATFORM), windows)
   REQUIRED_OS_NAME            = Windows
--- a/make/common/shared/Defs.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/shared/Defs.gmk	Thu May 17 16:18:58 2012 -0700
@@ -177,6 +177,19 @@
   fi)
 endef
 
+# Expand SRCDIR_LIST, which is used to automatically include various
+# platform and shared sources/headers.  This is mainly useful for the
+# Mac OS X build, which pulls its platform sources from the solaris and/or
+# macosx trees, depending on the component.
+ifeq ($(PLATFORM), macosx)
+  define JavaSrcDirList
+  $(JAVA_SRCDIR_LIST:%=$1$(JDK_TOPDIR)/%/$2)
+  endef
+  define NativeSrcDirList
+  $(NATIVE_SRCDIR_LIST:%=$1$(JDK_TOPDIR)/%/$2)
+  endef
+endif
+
 # Make sure certain variables are non-empty at this point
 _check_values:=\
 $(call CheckValue,ARCH,),\
--- a/make/common/shared/Platform.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/shared/Platform.gmk	Thu May 17 16:18:58 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 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
@@ -86,7 +86,7 @@
 SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files .hgignore .hgtags
 # When changing SCM_DIRs also change SCM_DIRS_rexp and SCM_DIRS_prune:
 SCM_DIRS_rexp = ".hg|.svn|CVS|RCS|SCCS|Codemgr_wsdata|deleted_files|.hgignore|.hgtags"
-SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files -o -name .hgignore -o -name .hgtags -o -name \*.orig \) -prune
+SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files -o -name .hgignore -o -name .hgtags \) -prune
 
 # Don't define this unless it's not defined
 ifndef VARIANT
@@ -147,8 +147,8 @@
   endif
   # Suffix for file bundles used in previous release
   BUNDLE_FILE_SUFFIX=.tar
-  # How much RAM does this machine have:
-  MB_OF_MEMORY=$(shell /usr/sbin/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
+  # How much RAM does this machine have (zones send an error to stderr):
+  MB_OF_MEMORY:=$(shell /usr/sbin/prtconf 2>/dev/null | fgrep 'Memory size:' | expand | cut -d' ' -f3)
 endif
 
 # Platform settings specific to Linux
@@ -224,6 +224,80 @@
   MB_OF_MEMORY := $(shell free -m | fgrep Mem: | awk '{print $$2;}' )
 endif
 
+ifeq ($(SYSTEM_UNAME), Darwin)
+  PLATFORM = macosx
+  OS_NAME = darwin
+  OS_VENDOR = Apple
+  GB_OF_MEMORY := $(shell system_profiler SPHardwareDataType | fgrep Memory: | awk '{print $$2}')
+  MB_OF_MEMORY := $(shell expr ${GB_OF_MEMORY} '*' 1024)
+endif
+
+# Platform settings specific to BSD/Mac OS X
+ifeq ($(PLATFORM), macosx)
+  OS_VERSION := $(shell uname -r)
+
+  # Arch and OS name/version
+  # Darwin x86 builds are i386/amd64 universal by default.
+  # Allow arch to be set from the environment to avoid this.
+  ifeq ($(origin ARCH), undefined)
+   ifeq ($(PLATFORM), macosx)
+# MMM: revisit when hotspot producinging universal libs
+#   mach := universal
+    mach := x86_64
+   else
+    mach := $(shell uname -m)
+   endif
+  else
+   mach := $(ARCH)
+  endif
+
+  archExpr = case "$(mach)" in \
+                i[3-9]86) \
+                    echo i586 \
+                    ;; \
+                sparc64) \
+                    echo sparcv9 \
+                    ;; \
+                sparc*) \
+                    echo sparc \
+                    ;; \
+                x86_64) \
+                    echo x86_64 \
+                    ;; \
+                "Power Macintosh") \
+                    echo ppc \
+                    ;; \
+                *) \
+                    echo $(mach) \
+                    ;; \
+      esac
+  ARCH        := $(shell $(archExpr) )
+  ARCH_FAMILY := $(ARCH)
+
+  # i586, sparc, and ppc are 32 bit, amd64 and sparc64 are 64
+  # ARCH_DATA_MODEL does not exactly mean anything in universal
+  # but it has to be one or the other, so pick 32
+  ifneq (,$(findstring $(ARCH), i586 sparc ppc universal))
+    ARCH_DATA_MODEL=32
+  else
+    ARCH_DATA_MODEL=64
+  endif
+
+  # Need to maintain the jre/lib/i386 location for 32-bit Intel
+  ifeq ($(ARCH), i586)
+    LIBARCH = i386
+  else
+    LIBARCH = $(ARCH)
+  endif
+
+  # Value of Java os.arch property
+  ARCHPROP  = $(LIBARCH)
+
+  # Suffix for file bundles used in previous release
+  BUNDLE_FILE_SUFFIX=.tar.gz
+  # How much RAM does this machine have:
+endif
+
 ifeq ($(SYSTEM_UNAME), FreeBSD)
   PLATFORM = bsd
   OS_NAME = freebsd
@@ -231,13 +305,6 @@
   REQUIRED_OS_VERSION = 6.0
 endif
 
-ifeq ($(SYSTEM_UNAME), Darwin)
-  PLATFORM = bsd
-  OS_NAME = darwin
-  OS_VENDOR = Apple
-  REQUIRED_OS_VERSION = 8.0
-endif
-
 ifeq ($(SYSTEM_UNAME), NetBSD)
   PLATFORM = bsd
   OS_NAME = netbsd
@@ -280,15 +347,6 @@
   ARCH        := $(shell $(archExpr) )
   ARCH_FAMILY := $(ARCH)
 
-  # Darwin builds may be 32-bit or 64-bit data model.
-  ifeq ($(SYSTEM_UNAME), Darwin)
-    ifeq ($(ARCH), i586)
-      ifeq ($(ARCH_DATA_MODEL), 64)
-        ARCH=amd64
-      endif
-    endif
-  endif
-
   # i586, sparc, and ppc are 32 bit, amd64 and sparc64 are 64
   ifneq (,$(findstring $(ARCH), i586 sparc ppc))
     ARCH_DATA_MODEL=32
@@ -308,7 +366,7 @@
 
   # Suffix for file bundles used in previous release
   BUNDLE_FILE_SUFFIX=.tar.gz
-  # Minimum disk space needed as determined by running 'du -sk' on 
+  # Minimum disk space needed as determined by running 'du -sk' on
   #    a fully built workspace.
   REQUIRED_FREE_SPACE=1500000
   # How much RAM does this machine have:
@@ -525,7 +583,15 @@
   # The suffix applied to runtime libraries
   LIBRARY_SUFFIX = dylib
   # The suffix applied to link libraries
-  LIB_SUFFIX = dylib
+  ifeq ($(ARCH), universal)
+    LIB_SUFFIX = o
+  else
+    LIB_SUFFIX = a
+  endif
+
+  ifeq ($(PLATFORM), macosx)
+  	ARCH_VM_SUBDIR=jre/lib
+  endif
 endif
 
 # Machines with 512Mb or less of real memory are considered low memory
--- a/make/common/shared/Sanity.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/common/shared/Sanity.gmk	Thu May 17 16:18:58 2012 -0700
@@ -113,6 +113,13 @@
   ALSA_VERSION := $(call GetVersion,$(_ALSA_VERSION))
 endif
 
+ifeq ($(PLATFORM), macosx)
+  # What kind of system we are using
+  OS_VERSION := $(shell uname -r)
+  OS_VARIANT_NAME := MacOSX
+  OS_VARIANT_VERSION := $(shell sw_vers -productVersion)
+endif
+
 ifeq ($(PLATFORM), windows)
   # Windows 2000 is 5.0, Windows XP is 5.1, Windows 2003 is 5.2
   #    Assume 5.0 (Windows 2000) if systeminfo does not help
@@ -1561,60 +1568,6 @@
   endif
 endif
 
-
-######################################################
-# SECURITY_BASELINE_131 test
-######################################################
-security_baseline_131:
-ifeq ($(PLATFORM), windows)
-	@if [ -z "$(SECURITY_BASELINE_131)" ]; then \
-	    $(ECHO) "WARNING: Your SECURITY_BASELINE_131 setting is empty.\n" \
-		"        Setting it to the default value of 1.3.1_20.\n" \
-		"        It is recommended to set SECURITY_BASELINE_131.\n" \
-		"" >> $(WARNING_FILE) ; \
-	fi
-endif
-
-######################################################
-# SECURITY_BASELINE_142 test
-######################################################
-security_baseline_142:
-ifeq ($(PLATFORM), windows)
-	@if [ -z "$(SECURITY_BASELINE_142)" ]; then \
-	    $(ECHO) "WARNING: Your SECURITY_BASELINE_142 setting is empty.\n" \
-		"        Setting it to the default value of 1.4.2_10.\n" \
-		"        It is recommended to set SECURITY_BASELINE_142.\n" \
-		"" >> $(WARNING_FILE) ; \
-	fi
-endif
-
-######################################################
-# SECURITY_BASELINE_150 test
-######################################################
-security_baseline_150:
-ifeq ($(PLATFORM), windows)
-	@if [ -z "$(SECURITY_BASELINE_150)" ]; then \
-	    $(ECHO) "WARNING: Your SECURITY_BASELINE_150 setting is empty.\n" \
-		"        Setting it to the default value of 1.5.0_07.\n" \
-		"        It is recommended to set SECURITY_BASELINE_150.\n" \
-		"" >> $(WARNING_FILE) ; \
-	fi
-endif
-
-######################################################
-# SECURITY_BASELINE_160 test
-######################################################
-security_baseline_160:
-ifeq ($(PLATFORM), windows)
-	@if [ -z "$(SECURITY_BASELINE_160)" ]; then \
-	    $(ECHO) "WARNING: Your SECURITY_BASELINE_160 setting is empty.\n" \
-		"        Setting it to the default value of 1.6.0_11.\n" \
-		"        It is recommended to set SECURITY_BASELINE_160.\n" \
-		"" >> $(WARNING_FILE) ; \
-	fi
-endif
-
-
 ######################################################
 # this should be the last rule in any target's sanity rule.
 ######################################################
--- a/make/docs/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/docs/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -70,6 +70,8 @@
 #    WARNING: This could cause thrashing on low memory machines.
 ifeq ($(ARCH_DATA_MODEL),64)
   MAX_VM_MEMORY = 1024
+else ifeq ($(ARCH),universal)
+  MAX_VM_MEMORY = 1024
 else
   MAX_VM_MEMORY = 512
 endif
--- a/make/docs/NON_CORE_PKGS.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/docs/NON_CORE_PKGS.gmk	Thu May 17 16:18:58 2012 -0700
@@ -88,6 +88,13 @@
 
 SCTPAPI_PKGS     = com.sun.nio.sctp
 
+ifeq ($(PLATFORM), macosx)
+APPLE_EXT_PKGS   = com.apple.concurrent   \
+                   com.apple.eawt         \
+                   com.apple.eawt.event   \
+                   com.apple.eio
+endif
+
 # non-core packages in rt.jar
 NON_CORE_PKGS    = $(DOMAPI_PKGS) \
                    $(MGMT_PKGS) \
@@ -97,5 +104,6 @@
                    $(OLD_JSSE_PKGS) \
                    $(HTTPSERVER_PKGS) \
                    $(SMARTCARDIO_PKGS) \
-                   $(SCTPAPI_PKGS)
+                   $(SCTPAPI_PKGS) \
+                   $(APPLE_EXT_PKGS)
 
--- a/make/java/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -57,6 +57,10 @@
   SUBDIRS += jexec
 endif # PLATFORM
 
+ifeq ($(PLATFORM), macosx)
+  SUBDIRS += jobjc
+endif # PLATFORM
+
 include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
--- a/make/java/awt/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/awt/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -57,7 +57,7 @@
 
 properties: $(LIBDIR) $(LIBPROPS)
 
-$(LIBDIR)/%.properties: $(PLATFORM_SRC)/lib/%.properties
+$(LIBDIR)/%.properties: $(PLATFORM_PROPERTIES)/%.properties
 	$(install-file)
 
 properties.clean :
--- a/make/java/fdlibm/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/fdlibm/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,12 @@
   FASTDEBUG_OPTIMIZATION_LEVEL = NONE
 endif
 
+ifeq ($(PLATFORM),macosx)
+  # Turn all optimizations off
+  OPTIMIZATION_LEVEL = NONE
+  FASTDEBUG_OPTIMIZATION_LEVEL = NONE
+endif
+
 #
 # Include path.
 #
--- a/make/java/instrument/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/instrument/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -102,9 +102,11 @@
   # equivalent of strcasecmp is stricmp on Windows
   CPPFLAGS_COMMON += -Dstrcasecmp=stricmp
 else
-ifeq ($(PLATFORM), bsd)
+ifneq (,$(findstring $(PLATFORM), macosx bsd))
   ifeq ($(OS_VENDOR), Apple)
-    LDFLAGS += -Wl,-all_load
+    ifneq ($(ARCH), universal)
+      LDFLAGS += -Wl,-all_load
+    endif
     LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a
     OTHER_LDLIBS += -liconv
   else
@@ -124,7 +126,7 @@
 else
   LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
   OTHER_LDLIBS += -ljli
-  OTHER_LDLIBS += $(LIBDL)
+  OTHER_LDLIBS += -ldl 
   ifeq ($(PLATFORM), solaris)
     LDFLAGS += -R \$$ORIGIN/jli
   endif
@@ -136,6 +138,10 @@
 endif
 endif
 
+ifeq ($(PLATFORM), macosx)
+  LDFLAGS += -framework Cocoa -framework Security -framework ApplicationServices
+endif
+
 #
 # Library to compile.
 #
--- a/make/java/java/FILES_java.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/java/FILES_java.gmk	Thu May 17 16:18:58 2012 -0700
@@ -51,6 +51,7 @@
     java/lang/SuppressWarnings.java \
     java/lang/AbstractStringBuilder.java \
     java/lang/ClassLoader.java \
+    java/lang/ClassLoaderHelper.java \
     java/lang/AssertionStatusDirectives.java \
     java/lang/Enum.java \
     java/lang/StrictMath.java \
--- a/make/java/java/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/java/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -94,6 +94,15 @@
 
 endif # PLATFORM
 
+ifeq ($(PLATFORM), macosx)
+FILES_c    +=   java_props_macosx.c
+FILES_java += 	java/util/prefs/MacOSXPreferences.java \
+		java/util/prefs/MacOSXPreferencesFile.java \
+		java/util/prefs/MacOSXPreferencesFactory.java
+
+CFLAGS_$(VARIANT)/java_props_md.o = -Os -x objective-c
+endif
+
 #
 # Make sure first rule does 'all'
 #
@@ -165,10 +174,12 @@
 # Is the altzone extern documented in ctime(3C) available?
 #
 ifneq ($(PLATFORM), windows)
+ifneq ($(PLATFORM), macosx)
 ifneq ($(PLATFORM), bsd)
 HAVE_ALTZONE=true
 endif
 endif
+endif
 
 ifeq ($(HAVE_ALTZONE),true)
 OTHER_CPPFLAGS += -DHAVE_ALTZONE
@@ -209,6 +220,12 @@
 else
 OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) $(LIBSCF) $(LIBDL) \
 		-L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
+ifeq ($(PLATFORM), macosx)
+OTHER_LDLIBS += \
+        -framework CoreFoundation \
+        -framework Security \
+        -framework SystemConfiguration
+endif
 endif
 
 #
@@ -245,8 +262,15 @@
 # UNIXProcess.java is different for solaris and linux. We need to copy
 # the correct UNIXProcess.java over to $(GENSRCDIR)/java/lang/.
 
-$(GENSRCDIR)/java/lang/UNIXProcess.java: \
+ifeq ($(PLATFORM), macosx)
+PLATFORM_UNIX_PROCESS = \
+    $(PLATFORM_SRC)/classes/java/lang/UNIXProcess.java.bsd
+else
+PLATFORM_UNIX_PROCESS = \
     $(PLATFORM_SRC)/classes/java/lang/UNIXProcess.java.$(PLATFORM)
+endif
+
+$(GENSRCDIR)/java/lang/UNIXProcess.java: $(PLATFORM_UNIX_PROCESS)
 	$(install-file)
 
 clean:: 
--- a/make/java/java/genlocales.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/java/genlocales.gmk	Thu May 17 16:18:58 2012 -0700
@@ -73,6 +73,26 @@
 LOCALEGEN_SH=localegen.sh
 RESOURCE_NAMES="FormatData CollationData TimeZoneNames LocaleNames CurrencyNames CalendarData"
 
+
+# On MacOSX sed does not enter a newline as it does on other platforms with the same pattern
+# Using awk instead
+
+ifeq ($(PLATFORM), macosx)
+
+$(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH)
+	@$(RM) $@.tmp.euro $@.tmp.noneuro;
+	@$(prep-target) 
+	@$(ECHO) $(Euro_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}'  > $@.tmp.euro;
+	@$(ECHO) $(Euro_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.euro;
+	@$(ECHO) $(NonEuro_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.noneuro;
+	@$(ECHO) $(NonEuro_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.noneuro;
+	NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \
+	     $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \
+		$@.tmp.noneuro $< $@
+	@$(RM) $@.tmp.euro $@.tmp.noneuro;
+
+else
+
 $(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH)
 	@$(RM) $@.tmp.euro $@.tmp.noneuro;
 	@$(prep-target) 
@@ -88,6 +108,7 @@
 	     $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \
 		$@.tmp.noneuro $< $@
 	@$(RM) $@.tmp.euro $@.tmp.noneuro;
+endif
 	
 genlocales : $(LocaleDataMetaInfo_Dest)  
 
--- a/make/java/java/localegen.sh	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/java/localegen.sh	Thu May 17 16:18:58 2012 -0700
@@ -52,6 +52,7 @@
 
 sed_script="$SED -e \"s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@\" " 
 
+# MMM: check two sed script changes below work other platforms than mac
 for FILE in $RESOURCE_NAMES 
 do
     getlocalelist $FILE $EURO_FILES_LIST
--- a/make/java/jli/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/jli/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 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
@@ -45,101 +45,120 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 ifneq ($(SYSTEM_ZLIB),true)
-ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
-endif
+  ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
+endif #SYSTEM_ZLIB
 LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
-LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
+
+# set the platform specific directory for macosx, also this platform shares
+# substantial family ties with its siblings (solaris and linux), thus we add
+# solaris src path to its compilation dependencies.
+ifeq ($(PLATFORM), macosx)
+ LAUNCHER_PLATFORM_SRC = $(BUILDDIR)/../src/macosx/bin
+ LAUNCHER_SOLARIS_PLATFORM_SRC  = $(BUILDDIR)/../src/solaris/bin
+else # !MACOSX
+ LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
+endif #PLATFORM
 
 ifeq ($(ZERO_BUILD), true)
-ERGO_FAMILY=zero
-else
-ifeq ($(ARCH_FAMILY), amd64)
-ERGO_FAMILY=i586
-else
-ERGO_FAMILY=$(ARCH_FAMILY)
-endif
-endif
-
+  ERGO_FAMILY=zero
+else # !ZERO_BUILD
+  ifneq (,$(findstring $(ARCH_FAMILY), amd64 x86_64))
+    ERGO_FAMILY=i586
+  else # !X86 FAMILY
+    ERGO_FAMILY=$(ARCH_FAMILY)
+  endif #ARCH_FAMILY
+endif # ZERO_BUILD
 
 #
 # Files to compile.
 #
-FILES_c = \
-	java.c \
-	splashscreen_stubs.c \
-	java_md.c \
-	parse_manifest.c \
-	version_comp.c \
-	wildcard.c \
-	jli_util.c
+FILES_c = java.c \
+          splashscreen_stubs.c \
+          parse_manifest.c \
+          version_comp.c \
+          wildcard.c \
+          jli_util.c
 
 ifneq ($(SYSTEM_ZLIB),true)
-FILES_c += \
-	inflate.c \
-	inftrees.c \
-	inffast.c \
-	zadler32.c \
-	zcrc32.c \
-	zutil.c
-endif
+  FILES_c += inflate.c \
+             inftrees.c \
+             inffast.c \
+             zadler32.c \
+             zcrc32.c \
+             zutil.c
+endif # SYSTEM_ZLIB
 
-ifneq ($(PLATFORM), windows)
-  FILES_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 $(LAUNCHER_PLATFORM_SRC)/$(ERGO_ARCH_FILE)),)
-    FILES_c += $(ERGO_ARCH_FILE)
-  else
-    OTHER_CPPFLAGS += -DUSE_GENERIC_ERGO
-  endif
-endif
+# add platform specific files
+ifeq ($(PLATFORM), windows)
+  FILES_c += java_md.c
+else # NIXES
+  FILES_c += java_md_common.c
+  ifeq ($(PLATFORM), macosx)
+    FILES_c += java_md_macosx.c
+  else # SOLARIS/LINUX
+    FILES_c += java_md_solinux.c
+    FILES_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 $(LAUNCHER_PLATFORM_SRC)/$(ERGO_ARCH_FILE)),)
+      FILES_c += $(ERGO_ARCH_FILE)
+    else # !ERGO_ARCH_FILE
+      OTHER_CPPFLAGS += -DUSE_GENERIC_ERGO
+    endif # ERGO_ARCH_FILE
+  endif #MACOSX
+endif #WINDOWS
 
 # Names of arch directories
 LIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
 ifeq ($(PLATFORM), solaris)
   LIBARCH_DEFINES += -DLIBARCH32NAME='"$(LIBARCH32)"'
   LIBARCH_DEFINES += -DLIBARCH64NAME='"$(LIBARCH64)"'
-endif
+endif # PLATFORM
 
-OTHER_CPPFLAGS += $(LIBARCH_DEFINES) -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
-
+ifneq (,$(findstring $(PLATFORM), macosx bsd))
+  OTHER_CPPFLAGS += $(LIBARCH_DEFINES) -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
+else # ! MACOSX || BSD
+  OTHER_CPPFLAGS += $(LIBARCH_DEFINES)
+endif #PLATFORM
 
 ifneq ($(PLATFORM), windows)	# UNIX systems
-        LD_RUNPATH_EXTRAS += ..
-	LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
-	# Note: its important to keep this order meaning -lc is the
-	# last library otherwise it could cause compatibility issues
-	# by pulling in SUNW_private symbols from libc
-	LDLIBS = $(LIBDL) -lc
-ifeq ($(USE_PTHREADS),true)
-	LDLIBS += -lpthread
-endif # USE_PTHREADS 
+  ifeq ($(PLATFORM), macosx)
+    LIB_LOCATION = $(LIBDIR)/jli
+  else # SOLARIS/LINUX
+    LD_RUNPATH_EXTRAS += ..
+    LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
+    # Note: it is important to keep this order, meaning -lc as the
+    # last library, otherwise it could cause compatibility issues
+    # by pulling in SUNW_private symbols from libc
+    LDLIBS = $(LIBDL) -lc
+    ifeq ($(USE_PTHREADS),true)
+      LDLIBS += -lpthread
+    endif # USE_PTHREADS 
+  endif # PLATFORM
 endif # PLATFORM
 
 ifeq ($(PLATFORM), windows)
-	EXTRA_LIBS = advapi32.lib \
-		     comctl32.lib \
-		     user32.lib
-
-	JAVALIB =
-	OTHER_LCF =  -export:JLI_Launch \
-		     -export:JLI_ManifestIterate \
-		     -export:JLI_SetTraceLauncher \
-		     -export:JLI_ReportErrorMessage \
-		     -export:JLI_ReportErrorMessageSys \
-		     -export:JLI_ReportMessage \
-		     -export:JLI_ReportExceptionDescription
-
-endif
+  EXTRA_LIBS = advapi32.lib \
+               comctl32.lib \
+               user32.lib
+  JAVALIB =
+  OTHER_LCF = -export:JLI_Launch \
+              -export:JLI_ManifestIterate \
+              -export:JLI_SetTraceLauncher \
+              -export:JLI_ReportErrorMessage \
+              -export:JLI_ReportErrorMessageSys \
+              -export:JLI_ReportMessage \
+              -export:JLI_ReportExceptionDescription
+endif # PLATFORM
 
 OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
 OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
 ifneq ($(SYSTEM_ZLIB),true)
   OTHER_INCLUDES += -I$(ZIP_SRC)
-else
+else # !SYSTEM_ZLIB
   LDLIBS += -lz
-endif
+endif # SYSTEM_ZLIB
 
 #
 # Library to compile.
@@ -160,39 +179,52 @@
 # library.
 #
 ifeq ($(PLATFORM), windows)
+  STATIC_LIBRARY = $(OBJDIR)/static/$(LIBPREFIX)$(LIBRARY).lib
 
-STATIC_LIBRARY = $(OBJDIR)/static/$(LIBPREFIX)$(LIBRARY).lib
-
-$(STATIC_LIBRARY): $(FILES_o)
+  $(STATIC_LIBRARY): $(FILES_o)
 	@$(prep-target)
 	$(LIBEXE) -nologo -out:$@ $(FILES_o)
 
-library:: $(STATIC_LIBRARY)
+  library:: $(STATIC_LIBRARY)
+endif # PLATFORM
 
-endif	# PLATFORM
-
-ifeq ($(PLATFORM), bsd)
+ifeq ($(PLATFORM), macosx)
+  # Some Obj-C code is embedded in java_md_macosx.c, we stipulate so, using
+  # "-x" option. Not doing so will cause the compiler to choose the language
+  # based on the filename suffix, also "-Os" optimizes the file for size.
+  CFLAGS_$(VARIANT)/java_md_macosx.o = -Os -x objective-c
+  # Needed for linking the various launchers
+  LDFLAGS += -framework Cocoa -framework Security \
+             -framework ApplicationServices
+  # Add solaris sources containing common logic to the header path
+  OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)
+endif # PLATFORM
 
 STATIC_LIBRARY_DIR = $(OBJDIR)/static
 STATIC_LIBRARY_NAME = lib$(LIBRARY).a
 STATIC_LIBRARY = $(STATIC_LIBRARY_DIR)/$(STATIC_LIBRARY_NAME)
 
-$(STATIC_LIBRARY_DIR): $(OBJDIR)
+$(STATIC_LIBRARY_DIR): | $(OBJDIR)
 	@$(MKDIR) $(STATIC_LIBRARY_DIR)
 
 $(STATIC_LIBRARY): $(STATIC_LIBRARY_DIR)
 	@$(prep-target)
-	$(AR) -r $@ $(FILES_o)
+	$(AR) $(ARFLAGS) $@ $(FILES_o)
 
 library:: $(STATIC_LIBRARY)
 
-endif  # PLATFORM
-
-#
-# Add to ambient vpath so we pick up the library files
-#
 vpath %.c $(LAUNCHER_SHARE_SRC) $(LAUNCHER_PLATFORM_SRC)
 ifneq ($(SYSTEM_ZLIB),true)
   vpath %.c $(ZIP_SRC)
-endif
-
+else # !SYSTEM_ZLIB
+  #
+  # Add to ambient vpath so we pick up the library files, for macos we add 
+  # solaris sources which contains the common logic for all nixes
+  #
+  ifeq ($(PLATFORM), macosx)
+    vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC) \
+          $(LAUNCHER_SOLARIS_PLATFORM_SRC)
+  else # !MACOSX
+    vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)
+  endif # MACOSX
+endif # SYSTEM_LIB
--- a/make/java/jli/mapfile-vers	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/jli/mapfile-vers	Thu May 17 16:18:58 2012 -0700
@@ -25,6 +25,7 @@
 
 # Define public interface.
 
+# MMM: Three JNI funcs added for Mac. Check this out!
 SUNWprivate_1.1 {
 	global:
 		JLI_Launch;
@@ -34,6 +35,9 @@
 		JLI_ReportErrorMessageSys;
 		JLI_ReportMessage;
 		JLI_ReportExceptionDescription;
+#		JNI_CreateJavaVM;
+#		JNI_GetCreatedJavaVMs;
+#		JNI_GetDefaultJavaVMInitArgs;
 	local:
 		*;
 };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/java/jobjc/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -0,0 +1,76 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile for building jobjc
+
+BUILDDIR = ../..
+include $(BUILDDIR)/common/Defs.gmk
+SRCDIR = $(JDK_TOPDIR)/src/macosx/native/jobjc
+
+ifeq ($(PLATFORM),macosx)
+
+# FRAMEWORKS for which we want to build bridge support
+FRAMEWORKS = Foundation CoreFoundation AppKit
+
+# metadata stuff
+GEN_DIR = $(OUTPUTDIR)/bridge_metadata
+STABLE_GEN_DIR = $(OUTPUTDIR)/stable_bridge_metadata
+STABLE_METADATA_FILES = $(addsuffix Full.bridgesupport,$(addprefix $(STABLE_GEN_DIR)/,$(FRAMEWORKS)))
+
+# source files
+CORE_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.hs" -or -name "*.java" -or -name "*.m" -or -name "*.h" -print)
+GENERATOR_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.java" -print)
+ADDITIONS_SRC = $(shell $(FIND) $(SRCDIR) -type f -name "*.java" -or -name "*.m" -or -name "*.h" -print)
+BUILD_SRC = $(SRCDIR)/JObjC.xcodeproj/project.pbxproj $(SRCDIR)/bridgesupport.gmk $(SRCDIR)/build.xml $(SRCDIR)/extract_classes.pl $(SRCDIR)/run-and-write-if-okay $(SRCDIR)/rungen $(SRCDIR)/runjava
+
+# jobjc products for jdk
+BUILT_DYLIB = $(OUTPUTDIR)/JObjC.dst/Debug/libJObjC.dylib
+BUILT_JAR = $(OUTPUTDIR)/JObjC.build/JObjC.jar
+
+$(GEN_DIR):
+	mkdir -p $(GEN_DIR)
+
+stabilize: $(GEN_DIR)
+	@echo Updating bridge support in $(GEN_DIR)
+	($(CD) $(GEN_DIR); $(MAKE) STABLE_GEN_DIR="$(STABLE_GEN_DIR)" FRAMEWORKS="$(FRAMEWORKS)" -f $(SRCDIR)/bridgesupport.gmk all)
+
+$(STABLE_METADATA_FILES): stabilize
+
+ABS_OUTPUTDIR=$(realpath $(OUTPUTDIR))
+ABS_STABLE_GEN_DIR=$(realpath $(STABLE_GEN_DIR))
+
+$(BUILT_DYLIB) $(BUILT_JAR): $(STABLE_METADATA_FILES) $(CORE_SRC) $(GENERATOR_SRC) $(ADDITIONS_SRC) $(BUILD_SRC)
+	@echo JObjC dylib or jar out of data wrt FRAMEWORKS '(' $(FRAMEWORKS) ')' or JObjC source '(' core, generator, additions, build ')'
+	@echo Running ant with java_home set to ${ALT_BOOTDIR}
+	(cd $(SRCDIR); OBJROOT="$(ABS_OUTPUTDIR)/JObjC.build" DSTROOT="$(ABS_OUTPUTDIR)/JObjC.dst" JAVA_HOME=${ALT_BOOTDIR} STABLE_GEN_DIR="$(ABS_STABLE_GEN_DIR)" /usr/bin/ant -verbose all)
+
+all: $(BUILD_DYLIB) $(BUILT_JAR)
+	$(CP) $(BUILT_DYLIB) $(LIB_LOCATION)/libJObjC.dylib
+
+clean clobber::
+	(cd $(SRCDIR); export OBJROOT=$(OUTPUTDIR)/JObjC.build; export DSTROOT=$(OUTPUTDIR)/JObjC.dst; /usr/bin/ant clean)
+
+endif
--- a/make/java/jvm/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/jvm/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -43,7 +43,6 @@
 $(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
 	$(install-file)
 
-JVMCFG_DIR = $(LIBDIR)/$(LIBARCH)
 JVMCFG = $(JVMCFG_DIR)/jvm.cfg
 
 #
@@ -55,6 +54,14 @@
 JVMCFG_ARCH = $(ARCH)
 endif
 
+ifeq ($(PLATFORM),macosx)
+  JVMCFG_SRC = $(PLATFORM_SRC_MACOS)/bin/$(JVMCFG_ARCH)/jvm.cfg
+  JVMCFG_DIR = $(LIBDIR)
+else
+  JVMCFG_SRC = $(PLATFORM_SRC)/bin/$(JVMCFG_ARCH)/jvm.cfg
+  JVMCFG_DIR = $(LIBDIR)/$(LIBARCH)
+endif
+
 ifdef BUILD_CLIENT_ONLY
 $(JVMCFG)::
 	$(MKDIR) -p $(JVMCFG_DIR)
@@ -67,7 +74,7 @@
 	$(ECHO) "-native ERROR">>$(JVMCFG)
 	$(ECHO) "-green ERROR">>$(JVMCFG)
 else
-$(JVMCFG): $(PLATFORM_SRC)/bin/$(JVMCFG_ARCH)/jvm.cfg
+$(JVMCFG): $(JVMCFG_SRC)
 	$(install-file)
 endif
 
--- a/make/java/management/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/management/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -77,6 +77,12 @@
 
 endif # PLATFORM linux
 
+ifeq ($(PLATFORM),macosx)
+
+FILES_c     += MacosxOperatingSystem.c
+
+endif # PLATFORM macosx
+
 endif # PLATFORM
 
 #
--- a/make/java/net/FILES_c.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/net/FILES_c.gmk	Thu May 17 16:18:58 2012 -0700
@@ -43,8 +43,12 @@
     FILES_c += linux_close.c
 endif
 
+ifeq ($(PLATFORM), macosx)
+    FILES_c += bsd_close.c
+endif
+
 ifeq ($(OS_VENDOR), FreeBSD)
-    FILES_c += $(CTARGDIR)bsd_close.c
+    FILES_c += bsd_close.c
 endif
 
 ifeq ($(PLATFORM), windows)
--- a/make/java/net/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/net/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -91,7 +91,7 @@
 
 include $(BUILDDIR)/common/Library.gmk
 
-ifeq ($(PLATFORM), bsd)
+ifneq (,$(findstring $(PLATFORM), macosx bsd))
 ifdef DONT_ENABLE_IPV6
   OTHER_CFLAGS += -DDONT_ENABLE_IPV6
 endif
@@ -107,7 +107,7 @@
 ifeq ($(PLATFORM), linux)
   OTHER_LDLIBS += -lpthread
 endif
-endif # PLATFORM == bsd
+endif # PLATFORM
 
 CLASSES.export += java.lang.Integer java.io.FileDescriptor java.net.InetAddressImplFactory java.net.Inet4AddressImpl java.net.Inet6AddressImpl
 
--- a/make/java/nio/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/nio/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -260,10 +260,13 @@
 	sun/nio/fs/UnixConstants.java
 endif # PLATFORM = linux
 
-ifeq ($(PLATFORM), bsd)
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
 FILES_java += \
         sun/nio/ch/AbstractPollSelectorImpl.java \
+	sun/nio/ch/BsdAsynchronousChannelProvider.java \
 	sun/nio/ch/InheritedChannel.java \
+	sun/nio/ch/KQueue.java \
+	sun/nio/ch/KQueuePort.java \
         sun/nio/ch/PollSelectorProvider.java \
         sun/nio/ch/PollSelectorImpl.java \
 	sun/nio/ch/Port.java \
@@ -306,10 +309,15 @@
 	GnomeFileTypeDetector.c \
 	BsdNativeDispatcher.c \
 	UnixCopyFile.c \
-	UnixNativeDispatcher.c
+	UnixNativeDispatcher.c \
+	\
+	KQueue.c \
+	KQueuePort.c
 
 FILES_export += \
 	sun/nio/ch/InheritedChannel.java \
+	sun/nio/ch/KQueue.java \
+	sun/nio/ch/KQueuePort.java \
 	sun/nio/ch/NativeThread.java \
 	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
@@ -321,7 +329,24 @@
 	
 FILES_gen += \
 	sun/nio/fs/UnixConstants.java
-endif # PLATFORM = bsd
+endif # PLATFORM = bsd, macosx
+
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
+FILES_java += \
+    sun/nio/ch/KQueueSelectorProvider.java \
+    sun/nio/ch/KQueueSelectorImpl.java \
+    sun/nio/ch/KQueueArrayWrapper.java
+
+FILES_c += \
+    KQueueArrayWrapper.c
+endif # PLATFORM = bsd, macosx
+
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
+
+vpath %.c $(call NativeSrcDirList,,native/sun/nio/fs)
+vpath %.c $(call NativeSrcDirList,,native/sun/nio/ch)
+
+else
 
 #
 # Find platform-specific C source files
@@ -330,6 +355,8 @@
 vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch
 vpath %.c $(SHARE_SRC)/native/sun/nio/ch
 
+endif # PLATFORM = macosx
+
 #
 # Various variables
 #
@@ -357,8 +384,8 @@
 ifeq ($(PLATFORM), linux)
 OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread $(LIBDL)
 endif
-ifeq ($(PLATFORM), bsd)
-OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -pthread
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
+OTHER_LDLIBS += -L$(LIBDIR) -ljava -lnet -pthread
 endif
 ifeq ($(PLATFORM), solaris)
 OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 $(LIBDL) -lsendfile \
@@ -382,7 +409,7 @@
 ifeq ($(PLATFORM), linux)
 FILES_m = mapfile-linux
 endif
-ifeq ($(PLATFORM), bsd)
+ifneq (,$(findstring $(PLATFORM), bsd macosx))
 FILES_m = mapfile-bsd
 endif
 include $(BUILDDIR)/common/Mapfile-vers.gmk
@@ -887,9 +914,15 @@
 $(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
 	$(install-file)
 
+ifeq ($(PLATFORM), macosx)
+  NIO_CC=$(HOST_CC)
+else
+  NIO_CC=$(CC)
+endif
+
 $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
 	$(prep-target)
-	($(CD) $(TEMPDIR); $(CC) $(CPPFLAGS) $(LDDFLAGS) \
+	($(CD) $(TEMPDIR); $(NIO_CC) $(CPPFLAGS) $(LDDFLAGS) \
 	   -o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
 
 ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
@@ -925,7 +958,7 @@
 
 $(GENUC_EXE) : $(GENUC_SRC)
 	$(prep-target)
-	$(CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
+	$(NIO_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
 
 ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
 $(SFS_GEN)/UnixConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/UnixConstants-$(PLATFORM)-$(ARCH).java
@@ -947,7 +980,7 @@
 
 $(GENSC_EXE) : $(GENSC_SRC)
 	$(prep-target)
-	$(CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
+	$(NIO_CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
 
 ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
 $(SFS_GEN)/SolarisConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/SolarisConstants-$(PLATFORM)-$(ARCH).java
--- a/make/java/nio/mapfile-bsd	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/nio/mapfile-bsd	Thu May 17 16:18:58 2012 -0700
@@ -73,6 +73,17 @@
                 Java_sun_nio_ch_IOUtil_makePipe;
                 Java_sun_nio_ch_IOUtil_randomBytes;
                 Java_sun_nio_ch_IOUtil_setfdVal;
+		Java_sun_nio_ch_KQueue_kqueue;
+		Java_sun_nio_ch_KQueue_keventRegister;
+		Java_sun_nio_ch_KQueue_keventPoll;
+		Java_sun_nio_ch_KQueue_keventSize;
+		Java_sun_nio_ch_KQueue_identOffset;
+		Java_sun_nio_ch_KQueue_filterOffset;
+		Java_sun_nio_ch_KQueue_flagsOffset;
+		Java_sun_nio_ch_KQueuePort_socketpair;
+		Java_sun_nio_ch_KQueuePort_interrupt;
+		Java_sun_nio_ch_KQueuePort_drain1;
+		Java_sun_nio_ch_KQueuePort_close0;
 		Java_sun_nio_ch_NativeThread_current;
 		Java_sun_nio_ch_NativeThread_init;
 		Java_sun_nio_ch_NativeThread_signal;
--- a/make/java/npt/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/npt/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -67,15 +67,16 @@
   OTHER_LCF += -export:nptInitialize -export:nptTerminate
 endif
 
+# Add location of iconv header
+ifeq ($(PLATFORM), macosx))
+  OTHER_LDLIBS += -liconv
+endif
+
 # Add location of iconv headers
 ifeq ($(PLATFORM), bsd)
-  ifeq ($(OS_VENDOR), Apple)
-    OTHER_LDLIBS += -liconv
-  else
-    ifneq ($(OS_NAME), netbsd)
-      CPPFLAGS += -I$(PACKAGE_PATH)/include
-      OTHER_LDLIBS += -L$(PACKAGE_PATH)/lib -liconv
-    endif
+  ifneq ($(OS_NAME), netbsd)
+    CPPFLAGS += -I$(PACKAGE_PATH)/include
+    OTHER_LDLIBS += -L$(PACKAGE_PATH)/lib -liconv
   endif
 endif
 
--- a/make/java/redist/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/redist/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -46,6 +46,8 @@
 
 ifeq ($(PLATFORM), windows)
   LIB_LOCATION = $(BINDIR)
+else ifeq ($(PLATFORM), macosx)
+  LIB_LOCATION = $(LIBDIR)
 else
   LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
 endif
--- a/make/java/redist/sajdi/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/redist/sajdi/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -29,6 +29,8 @@
 
 ifeq ($(PLATFORM), windows)
   LIB_LOCATION = $(BINDIR)
+else ifeq ($(PLATFORM), macosx)
+  LIB_LOCATION = $(LIBDIR)
 else
   LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
 endif
--- a/make/java/security/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/security/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -42,13 +42,20 @@
 ifeq ($(PLATFORM), solaris)
 PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-solaris
 
-else # PLATFORM
+else # NOT_SOLARIS
 
 # Register Microsoft CryptoAPI provider only on Windows platform.
 ifeq ($(PLATFORM), windows)
   PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-windows
-endif # windows
-endif # PLATFORM
+
+else # NOT_WINDOWS
+
+ifeq ($(PLATFORM), macosx)
+  PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-macosx
+endif # MACOSX
+
+endif # NOT_WINDOWS
+endif # NOT_SOLARIS
 
 
 PROPS_BUILD = $(LIBDIR)/security/java.security
--- a/make/java/zip/mapfile-vers	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/java/zip/mapfile-vers	Thu May 17 16:18:58 2012 -0700
@@ -30,6 +30,7 @@
 		Java_java_util_jar_JarFile_getMetaInfEntryNames;
 		Java_java_util_zip_Adler32_update;
 		Java_java_util_zip_Adler32_updateBytes;
+		Java_java_util_zip_Adler32_updateByteBuffer;
 		Java_java_util_zip_CRC32_update;
 		Java_java_util_zip_CRC32_updateBytes;
 		Java_java_util_zip_Deflater_deflateBytes;
--- a/make/javax/sound/FILES_c.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/javax/sound/FILES_c.gmk	Thu May 17 16:18:58 2012 -0700
@@ -36,6 +36,16 @@
 
 FILES_bsd =
 
+FILES_macosx = \
+    PLATFORM_API_MacOSX_MidiIn.c \
+    PLATFORM_API_MacOSX_MidiOut.c \
+    PLATFORM_API_MacOSX_MidiUtils.c
+
+FILES_cpp_macosx = \
+    PLATFORM_API_MacOSX_Utils.cpp \
+    PLATFORM_API_MacOSX_PCM.cpp \
+    PLATFORM_API_MacOSX_Ports.cpp
+
 FILES_windows = \
 	PLATFORM_API_WinOS_MidiIn.c \
 	PLATFORM_API_WinOS_MidiOut.c \
--- a/make/javax/sound/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/javax/sound/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
@@ -27,6 +27,11 @@
 PACKAGE = javax.sound
 LIBRARY = jsound
 PRODUCT = sun
+
+ifeq ($(PLATFORM),macosx)
+CPLUSPLUSLIBRARY = true
+endif
+
 include $(BUILDDIR)/common/Defs.gmk
 
 # include defines for sound
@@ -77,6 +82,7 @@
 	$(FILES_mkdirs)
 
 FILES_c += $(FILES_$(PLATFORM))
+FILES_cpp += $(FILES_cpp_$(PLATFORM))
 
 
 #
@@ -105,7 +111,6 @@
   #MXSPP_ADD = $(PLATFORM)-$(ARCH)/
 endif # PLATFORM linux
 
-# XXXBSD: ???
 ifeq ($(PLATFORM), bsd)
 ifeq ($(OS_VENDOR), FreeBSD)
   # ALSA handles directaudio, ports, and MIDI
@@ -121,6 +126,22 @@
 endif
 endif # PLATFORM bsd
 
+ifeq ($(PLATFORM), macosx)
+  CPPFLAGS += -DUSE_PORTS=TRUE \
+              -DUSE_DAUDIO=TRUE \
+              -DUSE_PLATFORM_MIDI_OUT=TRUE \
+              -DUSE_PLATFORM_MIDI_IN=TRUE
+
+  INCLUDE_PORTS = TRUE
+  INCLUDE_DAUDIO = TRUE
+  INCLUDE_MIDI = TRUE
+
+  LDFLAGS += -framework CoreAudio -framework CoreFoundation \
+             -framework CoreServices -framework AudioUnit -lstdc++ \
+             -framework CoreMIDI -framework AudioToolbox
+  CXXFLAGS += -I`xcode-select -print-path`/Extras/CoreAudio/PublicUtility
+endif
+
 ifeq ($(PLATFORM), solaris)
   # build with ports and direct audio
   CPPFLAGS += -DUSE_PORTS=TRUE 	\
@@ -160,6 +181,11 @@
 CPPFLAGS += \
 	-I$(SHARE_SRC)/native/com/sun/media/sound
 
+ifeq ($(PLATFORM), macosx)
+vpath %.c   $(call NativeSrcDirList,,native/com/sun/media/sound)
+vpath %.cpp $(call NativeSrcDirList,,native/com/sun/media/sound)
+
+else
 #
 # Add to the ambient VPATH.
 #
@@ -167,6 +193,7 @@
 vpath %.c $(PLATFORM_SRC)/native/com/sun/media/sound
 vpath %.cpp $(PLATFORM_SRC)/native/com/sun/media/sound
 
+endif
 
 #
 # Include rules
--- a/make/javax/sound/SoundDefs.gmk	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/javax/sound/SoundDefs.gmk	Thu May 17 16:18:58 2012 -0700
@@ -44,6 +44,10 @@
   CPPFLAGS += -DX_PLATFORM=X_BSD
 endif # PLATFORM bsd
 
+ifeq ($(PLATFORM), macosx)
+  CPPFLAGS += -DX_PLATFORM=X_MACOSX
+endif # PLATFORM macosx
+
 ifeq ($(PLATFORM), solaris)
   CPPFLAGS += -DX_PLATFORM=X_SOLARIS
 
--- a/make/jpda/transport/socket/Makefile	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/jpda/transport/socket/Makefile	Thu May 17 16:18:58 2012 -0700
@@ -36,11 +36,16 @@
 
 include $(BUILDDIR)/common/Defs.gmk
 
+ifeq ($(PLATFORM), bsd))
+  LIBSOCKET =
+  OTHER_LDLIBS += -pthread
+endif
+
 ifeq ($(PLATFORM), linux)
   OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET) -lpthread
 endif
 
-ifeq ($(PLATFORM), bsd)
+ifeq ($(PLATFORM), macosx))
   LIBSOCKET =
   OTHER_LDLIBS += -pthread
 endif
--- a/make/jprt.properties	Sun Mar 18 11:56:52 2012 -0700
+++ b/make/jprt.properties	Thu May 17 16:18:58 2012 -0700
@@ -25,268 +25,88 @@
 
 # Properties for jprt
 
-# At submit time, the release supplied will be in jprt.submit.release
-#    and will be one of the official release names defined in jprt.
-#    jprt supports property value expansion using ${property.name} syntax.
-
-# This tells jprt what default release we want to build
-jprt.tools.default.release=${jprt.submit.release}
+# Locked down to jdk7
+jprt.tools.default.release=jdk7
 
 # The different build flavors we want, we override here so we just get these 2
 jprt.build.flavors=product,fastdebug
 
-# Define the Windows we want (temporary)
-jprt.my.windows.i586.jdk7b107=windows_i586_5.0
-jprt.my.windows.i586.jdk7temp=windows_i586_5.0
-jprt.my.windows.i586.jdk7=windows_i586_5.1
-jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}}
-
 # Standard list of jprt build targets for this source tree
-jprt.build.targets= 						\
-    solaris_sparc_5.10-{product|fastdebug}, 			\
+jprt.build.targets=                                         	\
+    solaris_sparc_5.10-{product|fastdebug},                 	\
     solaris_sparcv9_5.10-{product|fastdebug}, 			\
     solaris_i586_5.10-{product|fastdebug}, 			\
     solaris_x64_5.10-{product|fastdebug}, 			\
     linux_i586_2.6-{product|fastdebug}, 			\
     linux_x64_2.6-{product|fastdebug}, 				\
-    ${jprt.my.windows.i586}-{product|fastdebug}, 		\
+    macosx_x64_10.7-{product|fastdebug}, 			\
+    windows_i586_5.1-{product|fastdebug}, 			\
     windows_x64_5.2-{product|fastdebug}
 
 # User can select the test set with jprt submit "-testset name" option
 jprt.my.test.set=${jprt.test.set}
 
-# Standard vm test target
+# Test target list (no fastdebug & limited c2 testing)
+jprt.my.test.target.set= \
+    solaris_sparc_5.10-product-c1-TESTNAME,                     \
+    solaris_sparcv9_5.10-product-c2-TESTNAME,                   \
+    solaris_i586_5.10-product-c1-TESTNAME,                      \
+    solaris_x64_5.10-product-c2-TESTNAME,                       \
+    linux_i586_2.6-product-{c1|c2}-TESTNAME,                    \
+    linux_x64_2.6-product-c2-TESTNAME,                          \
+    macosx_x64_10.7-product-c2-TESTNAME,                        \
+    windows_i586_5.1-product-c1-TESTNAME,                       \
+    windows_x64_5.2-product-c2-TESTNAME
+
+# Default vm test targets (testset=default)
 jprt.vm.default.test.targets=					\
-    solaris_sparc_5.10-product-c1-jvm98, 			\
-    solaris_sparcv9_5.10-product-c2-jvm98, 			\
-    solaris_i586_5.10-product-c1-jvm98, 			\
-    solaris_x64_5.10-product-c2-jvm98, 				\
-    linux_i586_2.6-product-{c1|c2}-jvm98, 			\
-    linux_x64_2.6-product-c2-jvm98, 				\
-    ${jprt.my.windows.i586}-product-c1-jvm98, 			\
-    windows_x64_5.2-product-c2-jvm98
+    ${jprt.my.test.target.set:TESTNAME=jvm98}
 
-# Select vm testlist to use (allow for testset to be empty too)
-jprt.vm.all.test.targets=${jprt.vm.default.test.targets}
-jprt.vm..test.targets=${jprt.vm.default.test.targets} 
-jprt.test.targets=${jprt.vm.${jprt.my.test.set}.test.targets} 
+# Default jdk test targets (testset=default)
+jprt.make.rule.default.test.targets=				\
+    ${jprt.my.test.target.set:TESTNAME=jdk_lang},               \
+    ${jprt.my.test.target.set:TESTNAME=jdk_math}
 
-# Default jdk test targets in test/Makefile (no fastdebug & limited c2)
-jprt.make.rule.default.test.targets=				\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_beans1, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_beans1, 		\
-    solaris_i586_5.10-product-c1-jdk_beans1, 			\
-    solaris_x64_5.10-product-c2-jdk_beans1, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_beans1, 			\
-    linux_x64_2.6-product-c2-jdk_beans1, 			\
-    ${jprt.my.windows.i586}-product-c1-jdk_beans1, 		\
-    windows_x64_5.2-product-c2-jdk_beans1, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_io, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_io, 			\
-    solaris_i586_5.10-product-c1-jdk_io, 			\
-    solaris_x64_5.10-product-c2-jdk_io, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_io, 			\
-    linux_x64_2.6-product-c2-jdk_io, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_io, 			\
-    windows_x64_5.2-product-c2-jdk_io, 				\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_lang, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_lang, 			\
-    solaris_i586_5.10-product-c1-jdk_lang, 			\
-    solaris_x64_5.10-product-c2-jdk_lang, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_lang, 			\
-    linux_x64_2.6-product-c2-jdk_lang, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_lang, 		\
-    windows_x64_5.2-product-c2-jdk_lang, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_math, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_math, 			\
-    solaris_i586_5.10-product-c1-jdk_math, 			\
-    solaris_x64_5.10-product-c2-jdk_math, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_math, 			\
-    linux_x64_2.6-product-c2-jdk_math, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_math, 		\
-    windows_x64_5.2-product-c2-jdk_math, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_misc, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_misc, 			\
-    solaris_i586_5.10-product-c1-jdk_misc, 			\
-    solaris_x64_5.10-product-c2-jdk_misc, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_misc, 			\
-    linux_x64_2.6-product-c2-jdk_misc, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_misc, 		\
-    windows_x64_5.2-product-c2-jdk_misc, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_net, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_net, 			\
-    solaris_i586_5.10-product-c1-jdk_net, 			\
-    solaris_x64_5.10-product-c2-jdk_net, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_net, 			\
-    linux_x64_2.6-product-c2-jdk_net, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_net, 		\
-    windows_x64_5.2-product-c2-jdk_net, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_nio1, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_nio1, 			\
-    solaris_i586_5.10-product-c1-jdk_nio1, 			\
-    solaris_x64_5.10-product-c2-jdk_nio1, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_nio1, 			\
-    linux_x64_2.6-product-c2-jdk_nio1, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_nio1, 		\
-    windows_x64_5.2-product-c2-jdk_nio1, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_nio2, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_nio2, 			\
-    solaris_i586_5.10-product-c1-jdk_nio2, 			\
-    solaris_x64_5.10-product-c2-jdk_nio2, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_nio2, 			\
-    linux_x64_2.6-product-c2-jdk_nio2, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_nio2, 		\
-    windows_x64_5.2-product-c2-jdk_nio2, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_nio3, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_nio3, 			\
-    solaris_i586_5.10-product-c1-jdk_nio3, 			\
-    solaris_x64_5.10-product-c2-jdk_nio3, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_nio3, 			\
-    linux_x64_2.6-product-c2-jdk_nio3, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_nio3, 		\
-    windows_x64_5.2-product-c2-jdk_nio3, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_security1, 		\
-    solaris_sparcv9_5.10-product-c2-jdk_security1, 		\
-    solaris_i586_5.10-product-c1-jdk_security1, 		\
-    solaris_x64_5.10-product-c2-jdk_security1, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_security1, 		\
-    linux_x64_2.6-product-c2-jdk_security1, 			\
-    ${jprt.my.windows.i586}-product-c1-jdk_security1, 		\
-    windows_x64_5.2-product-c2-jdk_security1, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_text, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_text, 			\
-    solaris_i586_5.10-product-c1-jdk_text, 			\
-    solaris_x64_5.10-product-c2-jdk_text, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_text, 			\
-    linux_x64_2.6-product-c2-jdk_text, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_text, 		\
-    windows_x64_5.2-product-c2-jdk_text, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_tools1, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_tools1, 		\
-    solaris_i586_5.10-product-c1-jdk_tools1, 			\
-    solaris_x64_5.10-product-c2-jdk_tools1, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_tools1, 			\
-    linux_x64_2.6-product-c2-jdk_tools1, 			\
-    ${jprt.my.windows.i586}-product-c1-jdk_tools1, 		\
-    windows_x64_5.2-product-c2-jdk_tools1, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_util, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_util, 			\
-    solaris_i586_5.10-product-c1-jdk_util, 			\
-    solaris_x64_5.10-product-c2-jdk_util, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_util, 			\
-    linux_x64_2.6-product-c2-jdk_util, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_util, 		\
-    windows_x64_5.2-product-c2-jdk_util
+# Core vm test targets (testset=core)
+jprt.vm.core.test.targets=					\
+    ${jprt.vm.default.test.target}
 
-# All jdk test targets in test/Makefile (still no fastdebug & limited c2)
+# Core jdk test targets (testset=core)
+jprt.make.rule.core.test.targets=				\
+    ${jprt.make.rule.default.test.targets},			\
+    ${jprt.my.test.target.set:TESTNAME=jdk_util},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_io},			\
+    ${jprt.my.test.target.set:TESTNAME=jdk_net},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_nio1},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_nio2},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_nio3},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_security1},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_security2},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_security3},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_rmi},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_management1},	\
+    ${jprt.my.test.target.set:TESTNAME=jdk_management2},	\
+    ${jprt.my.test.target.set:TESTNAME=jdk_text},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_tools1},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_tools2},		\
+    ${jprt.my.test.target.set:TESTNAME=jdk_misc}
+
+# All vm test targets (testset=all)
+jprt.vm.all.test.targets=                                       \
+    ${jprt.vm.default.test.targets},                            \
+    ${jprt.my.test.target.set:TESTNAME=runThese},               \
+    ${jprt.my.test.target.set:TESTNAME=jbb_default}
+
+# All jdk test targets (testset=all)
 jprt.make.rule.all.test.targets=    				\
-    								\
-   ${jprt.make.rule.default.test.targets}, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_awt, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_awt, 			\
-    solaris_i586_5.10-product-c1-jdk_awt, 			\
-    solaris_x64_5.10-product-c2-jdk_awt, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_awt, 			\
-    linux_x64_2.6-product-c2-jdk_awt, 				\
-    ${jprt.my.windows.i586}-product-c1-jdk_awt, 		\
-    windows_x64_5.2-product-c2-jdk_awt, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_beans2, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_beans2, 		\
-    solaris_i586_5.10-product-c1-jdk_beans2, 			\
-    solaris_x64_5.10-product-c2-jdk_beans2, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_beans2, 			\
-    linux_x64_2.6-product-c2-jdk_beans2, 			\
-    ${jprt.my.windows.i586}-product-c1-jdk_beans2, 		\
-    windows_x64_5.2-product-c2-jdk_beans2, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_beans3, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_beans3, 		\
-    solaris_i586_5.10-product-c1-jdk_beans3, 			\
-    solaris_x64_5.10-product-c2-jdk_beans3, 			\
-    linux_i586_2.6-product-{c1|c2}-jdk_beans3, 			\
-    linux_x64_2.6-product-c2-jdk_beans3, 			\
-    ${jprt.my.windows.i586}-product-c1-jdk_beans3, 		\
-    windows_x64_5.2-product-c2-jdk_beans3, 			\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_management1, 		\
-    solaris_sparcv9_5.10-product-c2-jdk_management1, 		\
-    solaris_i586_5.10-product-c1-jdk_management1, 		\
-    solaris_x64_5.10-product-c2-jdk_management1, 		\
-    linux_i586_2.6-product-{c1|c2}-jdk_management1, 		\
-    linux_x64_2.6-product-c2-jdk_management1, 			\
-    ${jprt.my.windows.i586}-product-c1-jdk_management1, 	\
-    windows_x64_5.2-product-c2-jdk_management1, 		\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_management2, 		\
-    solaris_sparcv9_5.10-product-c2-jdk_management2, 		\
-    solaris_i586_5.10-product-c1-jdk_management2, 		\
-    solaris_x64_5.10-product-c2-jdk_management2, 		\
-    linux_i586_2.6-product-{c1|c2}-jdk_management2, 		\
-    linux_x64_2.6-product-c2-jdk_management2, 			\
-    ${jprt.my.windows.i586}-product-c1-jdk_management2, 	\
-    windows_x64_5.2-product-c2-jdk_management2, 		\
-    								\
-    solaris_sparc_5.10-product-c1-jdk_rmi, 			\
-    solaris_sparcv9_5.10-product-c2-jdk_rmi, 			\