Merge
authorlana
Tue, 23 Feb 2010 10:17:16 -0800
changeset 4924 5751e91f963a
parent 4914 ec04396710d4 (current diff)
parent 4923 cd2829ef32e2 (diff)
child 4925 14630886280c
Merge
jdk/make/java/text/FILES_java.gmk
--- a/jdk/make/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -240,7 +240,12 @@
 
 all build:: sanity-all post-sanity-all
 
-SUBDIRS    = tools java javax org sun sunw com jpda mkdemo mksample launchers
+SUBDIRS       = tools java javax sun com
+SUBDIRS_tools = launchers
+SUBDIRS_misc  = org sunw jpda mkdemo mksample
+
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = sun
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -38,10 +38,19 @@
   endif
 endif
 
+# jarsigner is part of JRE
+SUBDIRS = java security net/ssl jarsigner
+
+SUBDIRS_management = jmx
+SUBDIRS_desktop    = image inputmethods
+SUBDIRS_enterprise = crypto/provider jndi \
+                     org xml rowset net/httpserver
+SUBDIRS_misc       = $(SCRIPT_SUBDIR) tracing servicetag nio demo
+
 # Omit mirror since it's built with the apt tool.
-SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \
-    java inputmethods org xml rowset net/httpserver net/ssl demo \
-    tools jarsigner tracing servicetag nio
+SUBDIRS_tools      = tools
+
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/com/sun/demo/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/demo/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -38,6 +38,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = jvmti
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/demo/jvmti/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/demo/jvmti/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -38,6 +38,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = hprof
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/inputmethods/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/inputmethods/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = indicim thaiim
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/java/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/java/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -31,7 +31,10 @@
 PRODUCT = plugin
 include $(BUILDDIR)/common/Defs.gmk
 
-SUBDIRS = browser pack
+SUBDIRS = pack
+SUBDIRS_misc = browser
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/java/browser/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/java/browser/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = dom net
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/jmx/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/jmx/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -51,6 +51,8 @@
   SUBDIRS = snmp
 endif
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build:
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/jndi/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/jndi/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -31,6 +31,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = toolkit cosnaming ldap rmi dns
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/jndi/rmi/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/jndi/rmi/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -31,6 +31,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = registry
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/nio/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/nio/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -31,6 +31,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = sctp
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/org/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/org/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS =  apache
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/org/apache/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/org/apache/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -31,6 +31,7 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = xml
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/com/sun/security/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/security/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -30,7 +30,10 @@
 BUILDDIR = ../../..
 include $(BUILDDIR)/common/Defs.gmk
 
-SUBDIRS = jgss sasl auth auth/module
+SUBDIRS = auth
+SUBDIRS_misc = jgss sasl auth/module
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/com/sun/tools/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/tools/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -35,6 +35,8 @@
 AUTO_FILES_JAVA_DIRS = com/sun/tools/extcheck
 
 SUBDIRS = attach
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build:
 	$(SUBDIRS-loop)
 clean clobber::
--- a/jdk/make/com/sun/tracing/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/com/sun/tracing/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -33,6 +33,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = dtrace
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build:
 	$(SUBDIRS-loop)
 clean clobber::
--- a/jdk/make/common/Defs.gmk	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/common/Defs.gmk	Tue Feb 23 10:17:16 2010 -0800
@@ -576,17 +576,17 @@
 define install-file
 $(prep-target)
 $(CP) $< $@
-$(install-module-file)
+@$(install-module-file)
 endef
 
 define chmod-file
 $(CHMOD) $1 $@
-$(call chmod-module-file, $1)
+@$(call chmod-module-file, $1)
 endef
 
 define install-sym-link
 $(LN) -s $1 $@
-$(call install-module-sym-link, $1)
+@$(call install-module-sym-link, $1)
 endef
 
 #
@@ -607,131 +607,9 @@
 if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
 endef
 
-# Default make settings for processing SUBDIRS with clobber or clean names
-SUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false
-SUBDIRS_MAKEFLAGS-clean   = INCREMENTAL_BUILD=false
-
 # Current directory
 CURRENT_DIRECTORY := $(shell $(PWD))
 
-# If no timing wanted, we need to define these as empty
-ifdef NO_TIMING
-
-TIMING_ID:=NA
-
-define TIMING_start
-t=0:0:0:0
-endef
-
-define TIMING_end
-time_used=0
-endef
-
-else # NO_TIMING
-
-# Default timing id
-TIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY))
-
-# Timing start (must be used in same shell, e.g. same command line)
-#    Defines the shell variable $1 to have the start time.
-define TIMING_start
-$1=`$(DATE) +%j:%H:%M:%S`
-endef
-
-# Timing end (must be used in same shell, e.g. same command line)
-#    Expects shell variable $1 to have been defined as the start time.
-#    Expects shell variable $2 to have timing id string
-#    Sets total_seconds shell variable as the total seconds used.
-#    Sets time_used shell variable to contain format "%dh%dm%ds"
-define TIMING_end
-begTime="$${$1}"; \
-timing_id="$${$2}"; \
-endTime=`$(DATE) +%j:%H:%M:%S`; \
-d1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
-if [ "$${d1}" = "" ] ; then d1=0; fi; \
-h1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
-if [ "$${h1}" = "" ] ; then h1=0; fi; \
-m1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
-if [ "$${m1}" = "" ] ; then m1=0; fi; \
-s1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
-if [ "$${s1}" = "" ] ; then s1=0; fi; \
-d2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
-if [ "$${d2}" = "" ] ; then d2=0; fi; \
-h2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
-if [ "$${h2}" = "" ] ; then h2=0; fi; \
-m2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
-if [ "$${m2}" = "" ] ; then m2=0; fi; \
-s2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
-if [ "$${s2}" = "" ] ; then s2=0; fi; \
-t1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \
-		 '+' $${m1} '*' 60 '+' $${s1}`; \
-t2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \
-		 '+' $${m2} '*' 60 '+' $${s2}`; \
-total_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \
-if [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \
-t_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \
-t_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \
-t_sec=`$(EXPR) $${total_seconds} '%' 60`s; \
-time_used=$${t_sec}; \
-if [ "$${t_hour}" != "0h" ] ; then \
-time_used=$${t_hour}$${t_min}$${t_sec}; \
-elif [ "$${t_min}" != "0m" ] ; then \
-time_used=$${t_min}$${t_sec}; \
-else \
-time_used=$${t_sec}; \
-fi; \
-$(PRINTF) "  Timing: %05d seconds or %s for %s\n" \
-    $${total_seconds} $${time_used} $${timing_id}
-endef
-
-endif # NO_TIMING
-
-# Given a SUBDIRS list, cd into them and make them
-#   SUBDIRS_MAKEFLAGS      Make settings for a subdir make
-#   SUBDIRS_MAKEFLAGS-$@   Make settings specific to this target
-define SUBDIRS-loop
-@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)"
-@for i in DUMMY $(SUBDIRS) ; do \
-  if [ "$$i" != "DUMMY" ] ; then \
-    $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
-    timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
-    $(call TIMING_start,startTime); \
-    curDir=$(CURRENT_DIRECTORY); \
-    $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
-			  $(SUBDIRS_MAKEFLAGS) \
-			  $(SUBDIRS_MAKEFLAGS-$@) \
-			  FULL_VERSION=$(FULL_VERSION) \
-			  RELEASE=$(RELEASE) || exit 1; \
-	       $(CD) $${curDir}; \
-    $(call TIMING_end,startTime,timing_id); \
-    $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
-  fi ; \
-done
-@$(ECHO) "Done Processing SUBDIRS: $(SUBDIRS)"
-endef
-
-# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
-#   OTHERSUBDIRS_MAKEFLAGS      Make settings for a subdir make
-define OTHERSUBDIRS-loop
-@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
-@for i in DUMMY $(OTHERSUBDIRS) ; do \
-  if [ "$$i" != "DUMMY" ] ; then \
-    $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
-    timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
-    $(call TIMING_start,startTime); \
-    curDir=$(CURRENT_DIRECTORY); \
-    $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
-		          $(OTHERSUBDIRS_MAKEFLAGS) \
-			  FULL_VERSION=$(FULL_VERSION) \
-			  RELEASE=$(RELEASE) || exit 1; \
-	       $(CD) $${curDir}; \
-    $(call TIMING_end,startTime,timing_id); \
-    $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
-  fi ; \
-done
-@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
-endef
-
 #
 # Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
 #    used for this file, otherwise the default settings are used.
@@ -819,7 +697,7 @@
 
 define install-import-file
 $(install-importonly-file)
-$(install-module-file)
+@$(install-module-file)
 endef
 
 .PHONY: all build clean clobber
--- a/jdk/make/common/Sanity.gmk	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/common/Sanity.gmk	Tue Feb 23 10:17:16 2010 -0800
@@ -71,7 +71,8 @@
     sane-cacerts \
     sane-ant_version \
     sane-zip_version \
-    sane-msvcrt_path
+    sane-msvcrt_path \
+    sane-build_modules
 
 # The rules sanity-* have a one-to-one correspondence with the major targets
 # Each sanity-* rule should have no body to ensure that the post-sanity-* is the
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/common/Subdirs.gmk	Tue Feb 23 10:17:16 2010 -0800
@@ -0,0 +1,204 @@
+# Copyright 2010 Sun Microsystems, Inc.  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.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions
+#
+
+#
+# Generic makefile for building subdirectories.
+#
+# SUBDIRS variables to specify the subdirectories to build recursively.
+# Makefile has to include Subdirs.gmk AFTER all SUBDIRS variables are
+# defined.
+#
+# This file does not contain any rule.
+#
+# WARNING: This file is shared with other workspaces.
+#          So when it includes other files, it must use JDK_TOPDIR.
+
+#
+# SUBDIRS          subdirs for the base module always get built
+# SUBDIRS_<group>  subdirs for the named group
+#
+# By default, subdirs specified in the SUBDIRS and all SUBDIRS_* 
+# variables will be built.
+# 
+# BUILD_MODULES variable can be used to specify one or more groups
+# to be built (BUILD_MODULES=all will build all groups).
+#
+# Variables of the currently supported groups are:
+#  SUBDIRS_desktop    
+#  SUBDIRS_management
+#  SUBDIRS_enterprise
+#  SUBDIRS_misc
+#  SUBDIRS_tools
+# 
+# Change to the above list also need to update 
+# make/common/shared/Sanity.gmk.  NOTE: this list is subject
+# to change till the JDK 7 SE profiles/modules are finalized.
+# 
+# Eventually we want to restructure the make directory
+# according to these grouping (e.g. make/desktop/...) and
+# the SUBDIRS_<group> variables would not be needed.
+# 
+# To build the desktop and tools groups only, you can do:
+# gnumake BUILD_MODULES="desktop tools" ...
+# 
+
+# Iterate the subdirectories specified in $1.
+# - cd into each subdir and make them
+
+# Given a SUBDIRS* list (first argument), cd into them and make them
+#   SUBDIRS_MAKEFLAGS      Make settings for a subdir make
+#   SUBDIRS_MAKEFLAGS-$@   Make settings specific to this target
+#
+define subdirs-group-loop
+@$(ECHO) "Begin Processing SUBDIRS: $($1)"
+@for i in DUMMY $($1) ; do \
+  if [ "$$i" != "DUMMY" ] ; then \
+    $(MAKE) -C $$i $@ $(SUBDIRS_MAKEFLAGS) $(SUBDIRS_MAKEFLAGS-$@) \
+            FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \
+  fi ; \
+done
+@$(ECHO) "Done Processing SUBDIRS: $($1)"
+endef
+
+# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
+#   OTHERSUBDIRS_MAKEFLAGS      Make settings for a subdir make
+define OTHERSUBDIRS-loop
+@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
+@for i in DUMMY $(OTHERSUBDIRS) ; do \
+  if [ "$$i" != "DUMMY" ] ; then \
+    $(MAKE) -C $$i $@ $(OTHERSUBDIRS_MAKEFLAGS) \
+            FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \
+  fi ; \
+done
+@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
+endef
+
+#
+# Iterate the list specified in SUBDIRS_<group> only if
+# SUBDIRS_<group> is set and <group> or "all" is specified
+# in the BUILD_MODULES variable
+#
+ifdef SUBDIRS_desktop 
+  ifneq (,$(findstring desktop, $(BUILD_MODULES)))
+      define subdirs-desktop-loop
+         @$(call subdirs-group-loop,SUBDIRS_desktop)
+      endef
+  else
+    define subdirs-desktop-loop
+    endef
+  endif
+else   
+  define subdirs-desktop-loop
+  endef
+endif   # SUBDIRS_desktop 
+
+ifdef SUBDIRS_enterprise 
+  ifneq (,$(findstring enterprise, $(BUILD_MODULES)))
+      define subdirs-enterprise-loop
+         @$(call subdirs-group-loop,SUBDIRS_enterprise)
+      endef
+  else
+    define subdirs-enterprise-loop
+    endef
+  endif
+else   
+define subdirs-enterprise-loop
+endef
+endif   # SUBDIRS_enterprise 
+
+ifdef SUBDIRS_management 
+  ifneq (,$(findstring management, $(BUILD_MODULES)))
+      define subdirs-management-loop
+         @$(call subdirs-group-loop,SUBDIRS_management)
+      endef
+  else
+    define subdirs-management-loop
+    endef
+  endif
+else   
+define subdirs-management-loop
+endef
+endif   # SUBDIRS_management 
+
+ifdef SUBDIRS_misc 
+  ifneq (,$(findstring misc, $(BUILD_MODULES)))
+      define subdirs-misc-loop
+         @$(call subdirs-group-loop,SUBDIRS_misc)
+      endef
+  else
+    define subdirs-misc-loop
+    endef
+  endif
+else   
+define subdirs-misc-loop
+endef
+endif   # SUBDIRS_misc 
+
+ifdef SUBDIRS_tools 
+  ifneq (,$(findstring tools, $(BUILD_MODULES)))
+      define subdirs-tools-loop
+         @$(call subdirs-group-loop,SUBDIRS_tools)
+      endef
+  else
+    define subdirs-tools-loop
+    endef
+  endif
+else   
+define subdirs-tools-loop
+endef
+endif   # SUBDIRS_tools 
+
+#
+# If BUILD_MODULES is not set or it's set to "all",
+# iterate all groups.
+SUBDIRS_all = $(SUBDIRS) $(SUBDIRS_desktop) $(SUBDIRS_enterprise) \
+	      $(SUBDIRS_management) $(SUBDIRS_misc) $(SUBDIRS_tools)
+
+ifndef BUILD_MODULES
+define SUBDIRS-loop
+  @$(call subdirs-group-loop,SUBDIRS_all)
+endef
+
+else
+
+ifneq (,$(findstring all, $(BUILD_MODULES)))
+define SUBDIRS-loop
+  @$(call subdirs-group-loop,SUBDIRS_all)
+endef
+
+else # BUILD_MODULES set 
+#
+# Iterate SUBDIRS and the groups specified in BUILD_MODULES
+#
+define SUBDIRS-loop
+  @$(call subdirs-group-loop,SUBDIRS)
+  @$(subdirs-desktop-loop)
+  @$(subdirs-enterprise-loop)
+  @$(subdirs-management-loop)
+  @$(subdirs-misc-loop)
+  @$(subdirs-tools-loop)
+endef
+
+endif
+endif # BUILD_MODULES
--- a/jdk/make/common/shared/Sanity.gmk	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/common/shared/Sanity.gmk	Tue Feb 23 10:17:16 2010 -0800
@@ -218,7 +218,8 @@
 	sane-zip_version \
 	sane-unzip_version \
  	sane-msvcrt_path \
-        sane-freetype
+        sane-freetype \
+        sane-build_modules
 
 ######################################################
 # check for COPYRIGHT_YEAR variable
@@ -845,6 +846,21 @@
 endif
 
 ######################################################
+# if specified, BUILD_MODULES must contain valid values.
+######################################################
+MODULES_REGEX="all|base|desktop|management|enterprise|misc|tools"
+sane-build_modules:
+ifdef BUILD_MODULES
+	@for m in $(BUILD_MODULES) ; do \
+            valid=`$(ECHO) $$m | $(EGREP) $(MODULES_REGEX)`; \
+            if [ "x$$valid" = "x" ] ; then \
+                $(ECHO) "ERROR: $$m set in the BUILD_MODULES variable is invalid.\n" \
+                "" >> $(ERROR_FILE); \
+            fi \
+	done
+endif
+
+######################################################
 # CUPS_HEADERS_PATH must be valid
 ######################################################
 sane-cups:
--- a/jdk/make/java/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -38,9 +38,13 @@
 
 # Others
 #    Note: java_crw_demo java_hprof_demo are demos but must be delivered built in sdk
-SUBDIRS += security npt java_crw_demo java_hprof_demo \
-	    math awt util text applet net nio dyn \
-	    sql rmi jar beans logging management instrument
+
+SUBDIRS += security math util text net nio jar
+
+SUBDIRS_desktop    = awt applet beans
+SUBDIRS_management = management
+SUBDIRS_misc       = npt java_crw_demo java_hprof_demo \
+                     logging instrument dyn sql rmi
 
 
 ifeq ($(PLATFORM), solaris)
@@ -53,6 +57,8 @@
   SUBDIRS += jexec
 endif # PLATFORM
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/java/hpi/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/hpi/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -34,6 +34,8 @@
 # Build specified the HPI implementations
 #
 SUBDIRS = $(HPIS)
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/java/java/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/java/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -218,6 +218,8 @@
 endif
 
 SUBDIRS = reflect
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build:
 	$(SUBDIRS-loop)
 clean clobber::
--- a/jdk/make/java/java/genlocales.gmk	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/java/genlocales.gmk	Tue Feb 23 10:17:16 2010 -0800
@@ -49,7 +49,7 @@
 # $(BUILDDIR)/java/text/FILES_java.gmk contains the "sun.text.resources" for 
 # European language support
 
-include $(BUILDDIR)/java/text/FILES_java.gmk
+include $(BUILDDIR)/java/text/base/FILES_java.gmk
 
 Euro_Resources_java += $(FILES_java)
 
--- a/jdk/make/java/main/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/main/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -36,6 +36,8 @@
 else 
 SUBDIRS = java
 endif 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/java/nio/FILES_java.gmk	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/nio/FILES_java.gmk	Tue Feb 23 10:17:16 2010 -0800
@@ -26,7 +26,6 @@
 FILES_src = \
 	java/nio/Bits.java \
 	java/nio/Buffer.java \
-	java/nio/BufferPoolMXBean.java \
 	java/nio/ByteOrder.java \
 	java/nio/MappedByteBuffer.java \
 	java/nio/StringCharBuffer.java \
--- a/jdk/make/java/nio/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/nio/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -304,7 +304,11 @@
 # Rules
 #
 
+SUBDIRS_management = mxbean
+include $(BUILDDIR)/common/Subdirs.gmk
+
 build: sources
+	$(SUBDIRS-loop)
 
 clean clobber::
 	$(RM) -r $(NIO_GEN) $(SNIO_GEN)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/java/nio/mxbean/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -0,0 +1,34 @@
+#
+# Copyright 2010 Sun Microsystems, Inc.  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.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+BUILDDIR = ../../..
+MODULE   = management
+PACKAGE  = java.nio
+PRODUCT  = java
+include $(BUILDDIR)/common/Defs.gmk
+
+FILES_java = java/nio/BufferPoolMXBean.java
+
+include $(BUILDDIR)/common/Classes.gmk
--- a/jdk/make/java/redist/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/redist/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -62,7 +62,10 @@
 # Needed to do file copy
 ABS_BUILDDIR :=$(call FullPath,$(BUILDDIR))
 
-SUBDIRS = fonts sajdi
+SUBDIRS_desktop = fonts
+SUBDIRS_tools   = sajdi
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/java/text/FILES_java.gmk	Fri Feb 19 15:13:37 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-#
-# Copyright 1996-2007 Sun Microsystems, Inc.  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.  Sun designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-# CA 95054 USA or visit www.sun.com if you need additional information or
-# have any questions.
-#
-
-FILES_java = \
-    java/text/Annotation.java \
-    java/text/AttributedCharacterIterator.java \
-    java/text/AttributedString.java \
-    java/text/BreakDictionary.java \
-    java/text/BreakIterator.java \
-    java/text/Bidi.java \
-    java/text/CharacterIterator.java \
-    java/text/CharacterIteratorFieldDelegate.java \
-    java/text/ChoiceFormat.java \
-    java/text/Collator.java \
-    java/text/CollationElementIterator.java \
-    java/text/CollationKey.java \
-    java/text/CollationRules.java \
-    java/text/DateFormat.java \
-    java/text/DateFormatSymbols.java \
-    java/text/DecimalFormat.java \
-    java/text/DictionaryBasedBreakIterator.java \
-    java/text/DigitList.java \
-    java/text/EntryPair.java \
-    java/text/Format.java \
-    java/text/FieldPosition.java \
-    java/text/DontCareFieldPosition.java \
-    java/text/MergeCollation.java \
-    java/text/MessageFormat.java \
-    java/text/Normalizer.java \
-    java/text/NumberFormat.java \
-    java/text/DecimalFormatSymbols.java \
-    java/text/ParseException.java \
-    java/text/ParsePosition.java \
-    java/text/PatternEntry.java \
-    java/text/RBCollationTables.java \
-    java/text/RBTableBuilder.java \
-    java/text/RuleBasedBreakIterator.java \
-    java/text/RuleBasedCollator.java \
-    java/text/RuleBasedCollationKey.java \
-    java/text/SimpleDateFormat.java \
-    java/text/StringCharacterIterator.java \
-    java/text/spi/BreakIteratorProvider.java \
-    java/text/spi/CollatorProvider.java \
-    java/text/spi/DateFormatProvider.java \
-    java/text/spi/DateFormatSymbolsProvider.java \
-    java/text/spi/DecimalFormatSymbolsProvider.java \
-    java/text/spi/NumberFormatProvider.java \
-        sun/text/SupplementaryCharacterData.java \
-        sun/text/CodePointIterator.java \
-        sun/text/CollatorUtilities.java \
-        sun/text/CompactByteArray.java \
-        sun/text/ComposedCharIter.java \
-        sun/text/IntHashtable.java \
-        sun/text/Normalizer.java \
-        sun/text/SupplementaryCharacterData.java \
-        sun/text/UCompactIntArray.java \
-            sun/text/bidi/BidiBase.java \
-            sun/text/bidi/BidiLine.java \
-            sun/text/bidi/BidiRun.java \
-            \
-            sun/text/normalizer/CharTrie.java \
-            sun/text/normalizer/CharacterIteratorWrapper.java \
-            sun/text/normalizer/ICUBinary.java \
-            sun/text/normalizer/ICUData.java \
-            sun/text/normalizer/IntTrie.java \
-            sun/text/normalizer/NormalizerBase.java \
-            sun/text/normalizer/NormalizerDataReader.java \
-            sun/text/normalizer/NormalizerImpl.java \
-            sun/text/normalizer/RangeValueIterator.java \
-            sun/text/normalizer/Replaceable.java \
-            sun/text/normalizer/ReplaceableString.java \
-            sun/text/normalizer/ReplaceableUCharacterIterator.java \
-            sun/text/normalizer/RuleCharacterIterator.java \
-            sun/text/normalizer/SymbolTable.java \
-            sun/text/normalizer/Trie.java \
-            sun/text/normalizer/TrieIterator.java \
-            sun/text/normalizer/UBiDiProps.java \
-            sun/text/normalizer/UCharacter.java \
-            sun/text/normalizer/UCharacterIterator.java \
-            sun/text/normalizer/UCharacterProperty.java \
-            sun/text/normalizer/UCharacterPropertyReader.java \
-            sun/text/normalizer/UTF16.java \
-            sun/text/normalizer/UnicodeMatcher.java \
-            sun/text/normalizer/UnicodeSet.java \
-            sun/text/normalizer/UnicodeSetIterator.java \
-            sun/text/normalizer/Utility.java \
-            sun/text/normalizer/VersionInfo.java \
-	\
-        sun/text/resources/BreakIteratorInfo.java \
-	\
-        sun/text/resources/CollationData.java \
-        sun/text/resources/CollationData_be.java \
-        sun/text/resources/CollationData_bg.java \
-        sun/text/resources/CollationData_ca.java \
-        sun/text/resources/CollationData_cs.java \
-        sun/text/resources/CollationData_da.java \
-        sun/text/resources/CollationData_de.java \
-        sun/text/resources/CollationData_el.java \
-        sun/text/resources/CollationData_en.java \
-        sun/text/resources/CollationData_es.java \
-        sun/text/resources/CollationData_et.java \
-        sun/text/resources/CollationData_fi.java \
-        sun/text/resources/CollationData_fr.java \
-        sun/text/resources/CollationData_hr.java \
-        sun/text/resources/CollationData_hu.java \
-        sun/text/resources/CollationData_is.java \
-        sun/text/resources/CollationData_it.java \
-        sun/text/resources/CollationData_lt.java \
-        sun/text/resources/CollationData_lv.java \
-        sun/text/resources/CollationData_mk.java \
-        sun/text/resources/CollationData_nl.java \
-        sun/text/resources/CollationData_no.java \
-        sun/text/resources/CollationData_pl.java \
-        sun/text/resources/CollationData_pt.java \
-        sun/text/resources/CollationData_ro.java \
-        sun/text/resources/CollationData_ru.java \
-        sun/text/resources/CollationData_sk.java \
-        sun/text/resources/CollationData_sl.java \
-        sun/text/resources/CollationData_sq.java \
-        sun/text/resources/CollationData_sr.java \
-        sun/text/resources/CollationData_sv.java \
-        sun/text/resources/CollationData_tr.java \
-        sun/text/resources/CollationData_uk.java \
-	\
-        sun/text/resources/FormatData.java \
-        sun/text/resources/FormatData_be.java \
-        sun/text/resources/FormatData_be_BY.java \
-        sun/text/resources/FormatData_bg.java \
-        sun/text/resources/FormatData_bg_BG.java \
-        sun/text/resources/FormatData_ca.java \
-        sun/text/resources/FormatData_ca_ES.java \
-        sun/text/resources/FormatData_cs.java \
-        sun/text/resources/FormatData_cs_CZ.java \
-        sun/text/resources/FormatData_da.java \
-        sun/text/resources/FormatData_da_DK.java \
-        sun/text/resources/FormatData_de.java \
-        sun/text/resources/FormatData_de_AT.java \
-        sun/text/resources/FormatData_de_CH.java \
-        sun/text/resources/FormatData_de_DE.java \
-        sun/text/resources/FormatData_de_LU.java \
-        sun/text/resources/FormatData_el.java \
-        sun/text/resources/FormatData_el_CY.java \
-        sun/text/resources/FormatData_el_GR.java \
-        sun/text/resources/FormatData_en.java \
-        sun/text/resources/FormatData_en_US.java \
-        sun/text/resources/FormatData_en_AU.java \
-        sun/text/resources/FormatData_en_CA.java \
-        sun/text/resources/FormatData_en_GB.java \
-        sun/text/resources/FormatData_en_IE.java \
-        sun/text/resources/FormatData_en_IN.java \
-        sun/text/resources/FormatData_en_MT.java \
-        sun/text/resources/FormatData_en_NZ.java \
-        sun/text/resources/FormatData_en_PH.java \
-        sun/text/resources/FormatData_en_SG.java \
-        sun/text/resources/FormatData_en_ZA.java \
-        sun/text/resources/FormatData_es.java \
-        sun/text/resources/FormatData_es_BO.java \
-        sun/text/resources/FormatData_es_AR.java \
-        sun/text/resources/FormatData_es_CL.java \
-        sun/text/resources/FormatData_es_CO.java \
-        sun/text/resources/FormatData_es_CR.java \
-        sun/text/resources/FormatData_es_DO.java \
-        sun/text/resources/FormatData_es_EC.java \
-        sun/text/resources/FormatData_es_ES.java \
-        sun/text/resources/FormatData_es_GT.java \
-        sun/text/resources/FormatData_es_HN.java \
-        sun/text/resources/FormatData_es_MX.java \
-        sun/text/resources/FormatData_es_NI.java \
-        sun/text/resources/FormatData_es_PA.java \
-        sun/text/resources/FormatData_es_PE.java \
-        sun/text/resources/FormatData_es_PR.java \
-        sun/text/resources/FormatData_es_PY.java \
-        sun/text/resources/FormatData_es_SV.java \
-        sun/text/resources/FormatData_es_US.java \
-        sun/text/resources/FormatData_es_UY.java \
-        sun/text/resources/FormatData_es_VE.java \
-        sun/text/resources/FormatData_et.java \
-        sun/text/resources/FormatData_et_EE.java \
-        sun/text/resources/FormatData_fi.java \
-        sun/text/resources/FormatData_fi_FI.java \
-        sun/text/resources/FormatData_fr.java \
-        sun/text/resources/FormatData_fr_BE.java \
-        sun/text/resources/FormatData_fr_CA.java \
-        sun/text/resources/FormatData_fr_CH.java \
-        sun/text/resources/FormatData_fr_FR.java \
-        sun/text/resources/FormatData_fr_LU.java \
-        sun/text/resources/FormatData_ga.java \
-        sun/text/resources/FormatData_ga_IE.java \
-        sun/text/resources/FormatData_hr.java \
-        sun/text/resources/FormatData_hr_HR.java \
-        sun/text/resources/FormatData_hu.java \
-        sun/text/resources/FormatData_hu_HU.java \
-        sun/text/resources/FormatData_in.java \
-        sun/text/resources/FormatData_in_ID.java \
-        sun/text/resources/FormatData_is.java \
-        sun/text/resources/FormatData_is_IS.java \
-        sun/text/resources/FormatData_it.java \
-        sun/text/resources/FormatData_it_CH.java \
-        sun/text/resources/FormatData_it_IT.java \
-        sun/text/resources/FormatData_lt.java \
-        sun/text/resources/FormatData_lt_LT.java \
-        sun/text/resources/FormatData_lv.java \
-        sun/text/resources/FormatData_lv_LV.java \
-        sun/text/resources/FormatData_mk.java \
-        sun/text/resources/FormatData_mk_MK.java \
-        sun/text/resources/FormatData_ms.java \
-        sun/text/resources/FormatData_ms_MY.java \
-        sun/text/resources/FormatData_mt.java \
-        sun/text/resources/FormatData_mt_MT.java \
-        sun/text/resources/FormatData_nl.java \
-        sun/text/resources/FormatData_nl_BE.java \
-        sun/text/resources/FormatData_nl_NL.java \
-        sun/text/resources/FormatData_no.java \
-        sun/text/resources/FormatData_no_NO.java \
-        sun/text/resources/FormatData_no_NO_NY.java \
-        sun/text/resources/FormatData_pl.java \
-        sun/text/resources/FormatData_pl_PL.java \
-        sun/text/resources/FormatData_pt.java \
-        sun/text/resources/FormatData_pt_BR.java \
-        sun/text/resources/FormatData_pt_PT.java \
-        sun/text/resources/FormatData_ro.java \
-        sun/text/resources/FormatData_ro_RO.java \
-        sun/text/resources/FormatData_ru.java \
-        sun/text/resources/FormatData_ru_RU.java \
-        sun/text/resources/FormatData_sk.java \
-        sun/text/resources/FormatData_sk_SK.java \
-        sun/text/resources/FormatData_sl.java \
-        sun/text/resources/FormatData_sl_SI.java \
-        sun/text/resources/FormatData_sq.java \
-        sun/text/resources/FormatData_sq_AL.java \
-        sun/text/resources/FormatData_sr.java \
-        sun/text/resources/FormatData_sr_BA.java \
-        sun/text/resources/FormatData_sr_CS.java \
-        sun/text/resources/FormatData_sr_ME.java \
-        sun/text/resources/FormatData_sr_RS.java \
-        sun/text/resources/FormatData_sv.java \
-        sun/text/resources/FormatData_sv_SE.java \
-        sun/text/resources/FormatData_tr.java \
-        sun/text/resources/FormatData_tr_TR.java \
-        sun/text/resources/FormatData_uk.java \
-        sun/text/resources/FormatData_uk_UA.java
--- a/jdk/make/java/text/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/java/text/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2010 Sun Microsystems, Inc.  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
@@ -23,86 +23,19 @@
 # have any questions.
 #
 
+#
+# Makefile for building all of java.text
+#
+
 BUILDDIR = ../..
-MODULE  = base
-PACKAGE = java.text
 PRODUCT = sun
-
 include $(BUILDDIR)/common/Defs.gmk
 
-#
-# Files
-#
-include FILES_java.gmk
-
-#
-# Include
-#
-include $(BUILDDIR)/common/Classes.gmk
-
-#
-# Rules to add data files BreakIterator
-#
-TEXT_CLASSES = $(BUILDTOOLCLASSDIR)/java.text/classes
-
-# input
-#
-#   Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime.
-#     They are used at JDK build phase in order to create $(BIFILES) which
-#     are used on runtime instead.
-#
-TEXT_SRCDIR  = $(SHARE_SRC)/classes/sun/text/resources
-TEXT_SOURCES = $(TEXT_SRCDIR)/BreakIteratorRules.java \
-               $(TEXT_SRCDIR)/BreakIteratorInfo.java
-UNICODEDATA  = $(BUILDDIR)/tools/UnicodeData
-
-# output
-TEXT_CLASSDIR  = $(CLASSBINDIR)/sun/text/resources
-BIFILES = $(TEXT_CLASSDIR)/CharacterBreakIteratorData \
-          $(TEXT_CLASSDIR)/WordBreakIteratorData \
-          $(TEXT_CLASSDIR)/LineBreakIteratorData \
-          $(TEXT_CLASSDIR)/SentenceBreakIteratorData
-
-ICU_FILES = $(TEXT_CLASSDIR)/unorm.icu \
-            $(TEXT_CLASSDIR)/uprops.icu \
-            $(TEXT_CLASSDIR)/ubidi.icu
+SUBDIRS         = base
+SUBDIRS_desktop = bidi
 
-# builder
-GENERATEBREAKITERATORDATA_JARFILE = \
-    $(BUILDTOOLJARDIR)/generatebreakiteratordata.jar
-
-$(BIFILES): $(GENERATEBREAKITERATORDATA_JARFILE) \
-    $(UNICODEDATA)/UnicodeData.txt \
-    $(TEXT_SOURCES)
-	$(prep-target)
-	$(RM) -r $(TEXT_CLASSES)
-	$(MKDIR) -p $(TEXT_CLASSES)
-	$(BOOT_JAVAC_CMD) -d $(TEXT_CLASSES) \
-		-sourcepath $(TEXT_SRCDIR) \
-		$(TEXT_SOURCES)
-	$(MKDIR) -p  $(TEXT_CLASSDIR)
-	$(BOOT_JAVA_CMD) -Xbootclasspath/p:$(TEXT_CLASSES) \
-		-jar $(GENERATEBREAKITERATORDATA_JARFILE) \
-		-o $(TEXT_CLASSDIR) \
-		-spec $(UNICODEDATA)/UnicodeData.txt
-	@$(java-vm-cleanup)
+include $(BUILDDIR)/common/Subdirs.gmk
 
-build: $(BIFILES) $(ICU_FILES)
-
-#
-# Extra rules to copy unorm.icu, uprops.icu, and ubidi.icu
-#
-$(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu
-	$(install-file)
+all build clean clobber::
+	$(SUBDIRS-loop)
 
-$(TEXT_CLASSDIR)/uprops.icu: $(TEXT_SRCDIR)/uprops.icu
-	$(install-file)
-
-$(TEXT_CLASSDIR)/ubidi.icu: $(TEXT_SRCDIR)/ubidi.icu
-	$(install-file)
-
-clean clobber::
-	$(RM) -r $(TEXT_CLASSES)
-	$(RM) -r $(BIFILES)
-	$(RM) $(ICU_FILES)
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/java/text/base/FILES_java.gmk	Tue Feb 23 10:17:16 2010 -0800
@@ -0,0 +1,258 @@
+#
+# Copyright 1996-2007 Sun Microsystems, Inc.  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.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+FILES_java = \
+    java/text/Annotation.java \
+    java/text/AttributedCharacterIterator.java \
+    java/text/AttributedString.java \
+    java/text/BreakDictionary.java \
+    java/text/BreakIterator.java \
+    java/text/CharacterIterator.java \
+    java/text/CharacterIteratorFieldDelegate.java \
+    java/text/ChoiceFormat.java \
+    java/text/Collator.java \
+    java/text/CollationElementIterator.java \
+    java/text/CollationKey.java \
+    java/text/CollationRules.java \
+    java/text/DateFormat.java \
+    java/text/DateFormatSymbols.java \
+    java/text/DecimalFormat.java \
+    java/text/DictionaryBasedBreakIterator.java \
+    java/text/DigitList.java \
+    java/text/EntryPair.java \
+    java/text/Format.java \
+    java/text/FieldPosition.java \
+    java/text/DontCareFieldPosition.java \
+    java/text/MergeCollation.java \
+    java/text/MessageFormat.java \
+    java/text/Normalizer.java \
+    java/text/NumberFormat.java \
+    java/text/DecimalFormatSymbols.java \
+    java/text/ParseException.java \
+    java/text/ParsePosition.java \
+    java/text/PatternEntry.java \
+    java/text/RBCollationTables.java \
+    java/text/RBTableBuilder.java \
+    java/text/RuleBasedBreakIterator.java \
+    java/text/RuleBasedCollator.java \
+    java/text/RuleBasedCollationKey.java \
+    java/text/SimpleDateFormat.java \
+    java/text/StringCharacterIterator.java \
+    java/text/spi/BreakIteratorProvider.java \
+    java/text/spi/CollatorProvider.java \
+    java/text/spi/DateFormatProvider.java \
+    java/text/spi/DateFormatSymbolsProvider.java \
+    java/text/spi/DecimalFormatSymbolsProvider.java \
+    java/text/spi/NumberFormatProvider.java \
+        sun/text/SupplementaryCharacterData.java \
+        sun/text/CodePointIterator.java \
+        sun/text/CollatorUtilities.java \
+        sun/text/CompactByteArray.java \
+        sun/text/ComposedCharIter.java \
+        sun/text/IntHashtable.java \
+        sun/text/Normalizer.java \
+        sun/text/SupplementaryCharacterData.java \
+        sun/text/UCompactIntArray.java \
+            sun/text/normalizer/CharTrie.java \
+            sun/text/normalizer/CharacterIteratorWrapper.java \
+            sun/text/normalizer/ICUBinary.java \
+            sun/text/normalizer/ICUData.java \
+            sun/text/normalizer/IntTrie.java \
+            sun/text/normalizer/NormalizerBase.java \
+            sun/text/normalizer/NormalizerDataReader.java \
+            sun/text/normalizer/NormalizerImpl.java \
+            sun/text/normalizer/RangeValueIterator.java \
+            sun/text/normalizer/Replaceable.java \
+            sun/text/normalizer/ReplaceableString.java \
+            sun/text/normalizer/ReplaceableUCharacterIterator.java \
+            sun/text/normalizer/RuleCharacterIterator.java \
+            sun/text/normalizer/SymbolTable.java \
+            sun/text/normalizer/Trie.java \
+            sun/text/normalizer/TrieIterator.java \
+            sun/text/normalizer/UBiDiProps.java \
+            sun/text/normalizer/UCharacter.java \
+            sun/text/normalizer/UCharacterIterator.java \
+            sun/text/normalizer/UCharacterProperty.java \
+            sun/text/normalizer/UCharacterPropertyReader.java \
+            sun/text/normalizer/UTF16.java \
+            sun/text/normalizer/UnicodeMatcher.java \
+            sun/text/normalizer/UnicodeSet.java \
+            sun/text/normalizer/UnicodeSetIterator.java \
+            sun/text/normalizer/Utility.java \
+            sun/text/normalizer/VersionInfo.java \
+	\
+        sun/text/resources/BreakIteratorInfo.java \
+	\
+        sun/text/resources/CollationData.java \
+        sun/text/resources/CollationData_be.java \
+        sun/text/resources/CollationData_bg.java \
+        sun/text/resources/CollationData_ca.java \
+        sun/text/resources/CollationData_cs.java \
+        sun/text/resources/CollationData_da.java \
+        sun/text/resources/CollationData_de.java \
+        sun/text/resources/CollationData_el.java \
+        sun/text/resources/CollationData_en.java \
+        sun/text/resources/CollationData_es.java \
+        sun/text/resources/CollationData_et.java \
+        sun/text/resources/CollationData_fi.java \
+        sun/text/resources/CollationData_fr.java \
+        sun/text/resources/CollationData_hr.java \
+        sun/text/resources/CollationData_hu.java \
+        sun/text/resources/CollationData_is.java \
+        sun/text/resources/CollationData_it.java \
+        sun/text/resources/CollationData_lt.java \
+        sun/text/resources/CollationData_lv.java \
+        sun/text/resources/CollationData_mk.java \
+        sun/text/resources/CollationData_nl.java \
+        sun/text/resources/CollationData_no.java \
+        sun/text/resources/CollationData_pl.java \
+        sun/text/resources/CollationData_pt.java \
+        sun/text/resources/CollationData_ro.java \
+        sun/text/resources/CollationData_ru.java \
+        sun/text/resources/CollationData_sk.java \
+        sun/text/resources/CollationData_sl.java \
+        sun/text/resources/CollationData_sq.java \
+        sun/text/resources/CollationData_sr.java \
+        sun/text/resources/CollationData_sv.java \
+        sun/text/resources/CollationData_tr.java \
+        sun/text/resources/CollationData_uk.java \
+	\
+        sun/text/resources/FormatData.java \
+        sun/text/resources/FormatData_be.java \
+        sun/text/resources/FormatData_be_BY.java \
+        sun/text/resources/FormatData_bg.java \
+        sun/text/resources/FormatData_bg_BG.java \
+        sun/text/resources/FormatData_ca.java \
+        sun/text/resources/FormatData_ca_ES.java \
+        sun/text/resources/FormatData_cs.java \
+        sun/text/resources/FormatData_cs_CZ.java \
+        sun/text/resources/FormatData_da.java \
+        sun/text/resources/FormatData_da_DK.java \
+        sun/text/resources/FormatData_de.java \
+        sun/text/resources/FormatData_de_AT.java \
+        sun/text/resources/FormatData_de_CH.java \
+        sun/text/resources/FormatData_de_DE.java \
+        sun/text/resources/FormatData_de_LU.java \
+        sun/text/resources/FormatData_el.java \
+        sun/text/resources/FormatData_el_CY.java \
+        sun/text/resources/FormatData_el_GR.java \
+        sun/text/resources/FormatData_en.java \
+        sun/text/resources/FormatData_en_US.java \
+        sun/text/resources/FormatData_en_AU.java \
+        sun/text/resources/FormatData_en_CA.java \
+        sun/text/resources/FormatData_en_GB.java \
+        sun/text/resources/FormatData_en_IE.java \
+        sun/text/resources/FormatData_en_IN.java \
+        sun/text/resources/FormatData_en_MT.java \
+        sun/text/resources/FormatData_en_NZ.java \
+        sun/text/resources/FormatData_en_PH.java \
+        sun/text/resources/FormatData_en_SG.java \
+        sun/text/resources/FormatData_en_ZA.java \
+        sun/text/resources/FormatData_es.java \
+        sun/text/resources/FormatData_es_BO.java \
+        sun/text/resources/FormatData_es_AR.java \
+        sun/text/resources/FormatData_es_CL.java \
+        sun/text/resources/FormatData_es_CO.java \
+        sun/text/resources/FormatData_es_CR.java \
+        sun/text/resources/FormatData_es_DO.java \
+        sun/text/resources/FormatData_es_EC.java \
+        sun/text/resources/FormatData_es_ES.java \
+        sun/text/resources/FormatData_es_GT.java \
+        sun/text/resources/FormatData_es_HN.java \
+        sun/text/resources/FormatData_es_MX.java \
+        sun/text/resources/FormatData_es_NI.java \
+        sun/text/resources/FormatData_es_PA.java \
+        sun/text/resources/FormatData_es_PE.java \
+        sun/text/resources/FormatData_es_PR.java \
+        sun/text/resources/FormatData_es_PY.java \
+        sun/text/resources/FormatData_es_SV.java \
+        sun/text/resources/FormatData_es_US.java \
+        sun/text/resources/FormatData_es_UY.java \
+        sun/text/resources/FormatData_es_VE.java \
+        sun/text/resources/FormatData_et.java \
+        sun/text/resources/FormatData_et_EE.java \
+        sun/text/resources/FormatData_fi.java \
+        sun/text/resources/FormatData_fi_FI.java \
+        sun/text/resources/FormatData_fr.java \
+        sun/text/resources/FormatData_fr_BE.java \
+        sun/text/resources/FormatData_fr_CA.java \
+        sun/text/resources/FormatData_fr_CH.java \
+        sun/text/resources/FormatData_fr_FR.java \
+        sun/text/resources/FormatData_fr_LU.java \
+        sun/text/resources/FormatData_ga.java \
+        sun/text/resources/FormatData_ga_IE.java \
+        sun/text/resources/FormatData_hr.java \
+        sun/text/resources/FormatData_hr_HR.java \
+        sun/text/resources/FormatData_hu.java \
+        sun/text/resources/FormatData_hu_HU.java \
+        sun/text/resources/FormatData_in.java \
+        sun/text/resources/FormatData_in_ID.java \
+        sun/text/resources/FormatData_is.java \
+        sun/text/resources/FormatData_is_IS.java \
+        sun/text/resources/FormatData_it.java \
+        sun/text/resources/FormatData_it_CH.java \
+        sun/text/resources/FormatData_it_IT.java \
+        sun/text/resources/FormatData_lt.java \
+        sun/text/resources/FormatData_lt_LT.java \
+        sun/text/resources/FormatData_lv.java \
+        sun/text/resources/FormatData_lv_LV.java \
+        sun/text/resources/FormatData_mk.java \
+        sun/text/resources/FormatData_mk_MK.java \
+        sun/text/resources/FormatData_ms.java \
+        sun/text/resources/FormatData_ms_MY.java \
+        sun/text/resources/FormatData_mt.java \
+        sun/text/resources/FormatData_mt_MT.java \
+        sun/text/resources/FormatData_nl.java \
+        sun/text/resources/FormatData_nl_BE.java \
+        sun/text/resources/FormatData_nl_NL.java \
+        sun/text/resources/FormatData_no.java \
+        sun/text/resources/FormatData_no_NO.java \
+        sun/text/resources/FormatData_no_NO_NY.java \
+        sun/text/resources/FormatData_pl.java \
+        sun/text/resources/FormatData_pl_PL.java \
+        sun/text/resources/FormatData_pt.java \
+        sun/text/resources/FormatData_pt_BR.java \
+        sun/text/resources/FormatData_pt_PT.java \
+        sun/text/resources/FormatData_ro.java \
+        sun/text/resources/FormatData_ro_RO.java \
+        sun/text/resources/FormatData_ru.java \
+        sun/text/resources/FormatData_ru_RU.java \
+        sun/text/resources/FormatData_sk.java \
+        sun/text/resources/FormatData_sk_SK.java \
+        sun/text/resources/FormatData_sl.java \
+        sun/text/resources/FormatData_sl_SI.java \
+        sun/text/resources/FormatData_sq.java \
+        sun/text/resources/FormatData_sq_AL.java \
+        sun/text/resources/FormatData_sr.java \
+        sun/text/resources/FormatData_sr_BA.java \
+        sun/text/resources/FormatData_sr_CS.java \
+        sun/text/resources/FormatData_sr_ME.java \
+        sun/text/resources/FormatData_sr_RS.java \
+        sun/text/resources/FormatData_sv.java \
+        sun/text/resources/FormatData_sv_SE.java \
+        sun/text/resources/FormatData_tr.java \
+        sun/text/resources/FormatData_tr_TR.java \
+        sun/text/resources/FormatData_uk.java \
+        sun/text/resources/FormatData_uk_UA.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/java/text/base/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -0,0 +1,108 @@
+#
+# Copyright 1996-2006 Sun Microsystems, Inc.  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.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+BUILDDIR = ../../..
+MODULE  = base
+PACKAGE = java.text
+PRODUCT = sun
+
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+include FILES_java.gmk
+
+#
+# Include
+#
+include $(BUILDDIR)/common/Classes.gmk
+
+#
+# Rules to add data files BreakIterator
+#
+TEXT_CLASSES = $(BUILDTOOLCLASSDIR)/java.text/classes
+
+# input
+#
+#   Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime.
+#     They are used at JDK build phase in order to create $(BIFILES) which
+#     are used on runtime instead.
+#
+TEXT_SRCDIR  = $(SHARE_SRC)/classes/sun/text/resources
+TEXT_SOURCES = $(TEXT_SRCDIR)/BreakIteratorRules.java \
+               $(TEXT_SRCDIR)/BreakIteratorInfo.java
+UNICODEDATA  = $(BUILDDIR)/tools/UnicodeData
+
+# output
+TEXT_CLASSDIR  = $(CLASSBINDIR)/sun/text/resources
+BIFILES = $(TEXT_CLASSDIR)/CharacterBreakIteratorData \
+          $(TEXT_CLASSDIR)/WordBreakIteratorData \
+          $(TEXT_CLASSDIR)/LineBreakIteratorData \
+          $(TEXT_CLASSDIR)/SentenceBreakIteratorData
+
+ICU_FILES = $(TEXT_CLASSDIR)/unorm.icu \
+            $(TEXT_CLASSDIR)/uprops.icu \
+            $(TEXT_CLASSDIR)/ubidi.icu
+
+# builder
+GENERATEBREAKITERATORDATA_JARFILE = \
+    $(BUILDTOOLJARDIR)/generatebreakiteratordata.jar
+
+$(BIFILES): $(GENERATEBREAKITERATORDATA_JARFILE) \
+    $(UNICODEDATA)/UnicodeData.txt \
+    $(TEXT_SOURCES)
+	$(prep-target)
+	$(RM) -r $(TEXT_CLASSES)
+	$(MKDIR) -p $(TEXT_CLASSES)
+	$(BOOT_JAVAC_CMD) -d $(TEXT_CLASSES) \
+		-sourcepath $(TEXT_SRCDIR) \
+		$(TEXT_SOURCES)
+	$(MKDIR) -p  $(TEXT_CLASSDIR)
+	$(BOOT_JAVA_CMD) -Xbootclasspath/p:$(TEXT_CLASSES) \
+		-jar $(GENERATEBREAKITERATORDATA_JARFILE) \
+		-o $(TEXT_CLASSDIR) \
+		-spec $(UNICODEDATA)/UnicodeData.txt
+	@$(java-vm-cleanup)
+
+build: $(BIFILES) $(ICU_FILES)
+
+#
+# Extra rules to copy unorm.icu, uprops.icu, and ubidi.icu
+#
+$(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu
+	$(install-file)
+
+$(TEXT_CLASSDIR)/uprops.icu: $(TEXT_SRCDIR)/uprops.icu
+	$(install-file)
+
+$(TEXT_CLASSDIR)/ubidi.icu: $(TEXT_SRCDIR)/ubidi.icu
+	$(install-file)
+
+clean clobber::
+	$(RM) -r $(TEXT_CLASSES)
+	$(RM) -r $(BIFILES)
+	$(RM) $(ICU_FILES)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/java/text/bidi/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -0,0 +1,44 @@
+#
+# Copyright 2010 Sun Microsystems, Inc.  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.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+BUILDDIR = ../../..
+PACKAGE = java.text
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files for Bidi that is not in the base module
+#
+FILES_java = \
+    java/text/Bidi.java \
+    sun/text/bidi/BidiBase.java \
+    sun/text/bidi/BidiLine.java \
+    sun/text/bidi/BidiRun.java \
+    sun/text/CodePointIterator.java
+
+#
+# Include
+#
+include $(BUILDDIR)/common/Classes.gmk
--- a/jdk/make/javax/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/javax/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -30,19 +30,24 @@
 BUILDDIR = ..
 include $(BUILDDIR)/common/Defs.gmk
 
-# imageio uses xml, so build it last
+SUBDIRS = others
+
+SUBDIRS_management = management
+
+SUBDIRS_misc = \
+        crypto \
+        sql \
+        rmi
 
-SUBDIRS = \
-	others \
-	accessibility \
-	print \
-	swing \
-	crypto \
-	sound \
-	sql \
-	rmi \
-	management \
-	imageio
+# imageio uses xml, so build it last
+SUBDIRS_desktop = \
+        accessibility \
+        print \
+        swing \
+        sound \
+        imageio
+
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build:
 	$(SUBDIRS-loop)
--- a/jdk/make/javax/rmi/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/javax/rmi/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -31,6 +31,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = ssl
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/javax/sound/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/javax/sound/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -159,6 +159,7 @@
 # Include rules
 #
 include $(BUILDDIR)/common/Library.gmk
+include $(BUILDDIR)/common/Subdirs.gmk
 
 #
 # Rules that copy files.
--- a/jdk/make/javax/swing/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/javax/swing/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -40,6 +40,7 @@
 SUBDIRS = html32dtd plaf
 
 include $(BUILDDIR)/common/Classes.gmk
+include $(BUILDDIR)/common/Subdirs.gmk
 
 build: other_files
 	$(SUBDIRS-loop)
--- a/jdk/make/jpda/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/jpda/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -35,6 +35,7 @@
 # Core.
 #
 SUBDIRS    = jdwp back front transport expr tty bdi gui
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/jpda/transport/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/jpda/transport/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -36,6 +36,8 @@
 ifeq ($(PLATFORM), windows)
 SUBDIRS += shmem
 endif # PLATFORM
+
+include $(BUILDDIR)/common/Subdirs.gmk
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mkdemo/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mkdemo/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -31,7 +31,13 @@
 PRODUCT = demos
 include $(BUILDDIR)/common/Defs.gmk
 
-SUBDIRS = applets jfc jvmti management jni scripting jpda
+SUBDIRS            = jni
+SUBDIRS_desktop    = applets jfc
+SUBDIRS_management = management
+SUBDIRS_misc       = scripting
+SUBDIRS_tools      = jpda jvmti
+
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build:: nbproject
 	$(SUBDIRS-loop)
--- a/jdk/make/mkdemo/applets/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mkdemo/applets/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -40,6 +40,7 @@
 
 SUBDIRS_MAKEFLAGS += DEMO_IS_APPLET=true
 
+include $(BUILDDIR)/common/Subdirs.gmk
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mkdemo/jfc/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mkdemo/jfc/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -46,6 +46,7 @@
   SUBDIRS += Java2D SwingSet2 Stylepad
 endif
 
+include $(BUILDDIR)/common/Subdirs.gmk
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mkdemo/jni/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mkdemo/jni/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -37,6 +37,8 @@
   SUBDIRS += Poller
 endif
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mkdemo/jvmti/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mkdemo/jvmti/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -48,6 +48,8 @@
 	  waiters \
 	  hprof
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mkdemo/management/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mkdemo/management/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -38,6 +38,8 @@
 	  MemoryMonitor  \
 	  JTop
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mkdemo/scripting/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mkdemo/scripting/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,7 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = jconsole-plugin
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/mksample/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mksample/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -37,13 +37,18 @@
   WEBSERVICES_SUBDIR = webservices
 endif
 
-SUBDIRS = nio jmx scripting $(WEBSERVICES_SUBDIR) nbproject
+SUBDIRS =
+SUBDIRS_misc = nio scripting nbproject
+SUBDIRS_enterprise = $(WEBSERVICES_SUBDIR)
+SUBDIRS_management = jmx
 
 # include dtrace samples in Solaris builds
 ifeq ($(PLATFORM), solaris) 
 	SUBDIRS += dtrace
 endif
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mksample/jmx/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mksample/jmx/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = jmx-scandir
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mksample/nio/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mksample/nio/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = file multicast server
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mksample/scripting/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mksample/scripting/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = scriptpad
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/mksample/webservices/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/mksample/webservices/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,7 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = EbayClient EbayServer
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/org/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/org/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,7 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = ietf jcp
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/org/ietf/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/org/ietf/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -31,6 +31,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = jgss
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -58,13 +58,18 @@
 else
   RENDER_SUBDIR = dcpr
 endif
+
 # nio need to be compiled before awt to have all charsets ready
-SUBDIRS = jar security javazic misc jkernel net audio $(RENDER_SUBDIR) image \
-	  nio awt splashscreen $(XAWT_SUBDIR) \
-          $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
-	  font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \
-	  jawt text launcher management $(ORG_SUBDIR) \
-          native2ascii serialver tools jconsole tracing
+SUBDIRS            = jar security javazic misc net nio text launcher
+SUBDIRS_desktop    = audio $(RENDER_SUBDIR) image \
+                     awt splashscreen $(XAWT_SUBDIR) \
+                     $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
+                     jawt font jpeg cmm applet beans
+SUBDIRS_management = management
+SUBDIRS_misc       = jkernel $(ORG_SUBDIR) \
+                     rmi $(JDBC_SUBDIR) tracing
+SUBDIRS_tools      = native2ascii serialver tools jconsole
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/sun/cmm/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/cmm/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -36,6 +36,8 @@
     ICCPROFILE_SRC_DIR = $(CLOSED_SRC)/share/lib/cmm/kcms
 endif # OPENJDK
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 #
 # ICC Profiles used by the CMM.
 #
--- a/jdk/make/sun/image/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/image/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -43,6 +43,8 @@
   endif
 endif
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/management/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/management/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -47,6 +47,8 @@
 endif
 SUBDIRS += jmxremote
  
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/net/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/net/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -29,6 +29,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = others spi
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/net/spi/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/net/spi/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -26,7 +26,9 @@
 BUILDDIR = ../../..
 include $(BUILDDIR)/common/Defs.gmk
 
-SUBDIRS = nameservice 
+SUBDIRS_misc = nameservice 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/net/spi/nameservice/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/net/spi/nameservice/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -27,6 +27,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = dns 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/nio/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/nio/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -29,6 +29,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = cs
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/org/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/org/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS =  mozilla
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/org/mozilla/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/org/mozilla/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -32,6 +32,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = javascript
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/make/sun/rmi/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/rmi/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -43,6 +43,8 @@
     SUBDIRS += cgi
 endif # PLATFORM
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 # Then do the rest
 all build clean clobber ::
 	$(SUBDIRS-loop)
--- a/jdk/make/sun/security/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/security/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -67,8 +67,10 @@
   INTREE_EC =
 endif
 
-SUBDIRS = $(INTREE_EC) other action util tools jgss krb5 smartcardio \
-	  $(PKCS11) $(JGSS_WRAPPER) $(MSCAPI)
+SUBDIRS       = $(INTREE_EC) other action util krb5
+SUBDIRS_misc  = jgss $(PKCS11) $(JGSS_WRAPPER) $(MSCAPI) smartcardio
+SUBDIRS_tools = tools
+include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/sun/tracing/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/sun/tracing/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -33,6 +33,8 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = dtrace
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build:
 	$(SUBDIRS-loop)
 clean clobber::
--- a/jdk/make/tools/Makefile	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/make/tools/Makefile	Tue Feb 23 10:17:16 2010 -0800
@@ -56,6 +56,8 @@
   SUBDIRS += generate_nimbus
 endif
 
+include $(BUILDDIR)/common/Subdirs.gmk
+
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java	Tue Feb 23 10:17:16 2010 -0800
@@ -27,7 +27,6 @@
 
 import java.io.*;
 import java.util.*;
-import java.util.logging.Level;
 import com.sun.java.util.jar.pack.Package.Class;
 import com.sun.java.util.jar.pack.Package.File;
 import com.sun.java.util.jar.pack.Package.InnerClass;
@@ -162,7 +161,7 @@
 
             ok = true;
         } catch (Exception ee) {
-            Utils.log.log(Level.WARNING, "Error on input: "+ee, ee);
+            Utils.log.warning("Error on input: "+ee, ee);
             if (verbose > 0)
                 Utils.log.info("Stream offsets:"+
                                  " served="+in.getBytesServed()+
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java	Tue Feb 23 10:17:16 2010 -0800
@@ -27,7 +27,6 @@
 
 import java.io.*;
 import java.util.*;
-import java.util.logging.Level;
 import com.sun.java.util.jar.pack.Package.Class;
 import com.sun.java.util.jar.pack.Package.File;
 import com.sun.java.util.jar.pack.Package.InnerClass;
@@ -84,7 +83,7 @@
 
             ok = true;
         } catch (Exception ee) {
-            Utils.log.log(Level.WARNING, "Error on output: "+ee, ee);
+            Utils.log.warning("Error on output: "+ee, ee);
             //if (verbose > 0)  ee.printStackTrace();
             // Write partial output only if we are verbose.
             if (verbose > 0)  finalOut.close();
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java	Tue Feb 23 10:17:16 2010 -0800
@@ -28,9 +28,10 @@
 import java.util.*;
 import java.util.jar.*;
 import java.util.zip.*;
-import java.util.logging.*;
 import java.io.*;
 
+import sun.util.logging.PlatformLogger;
+
 class Utils {
     static final String COM_PREFIX = "com.sun.java.util.jar.pack.";
     static final String METAINF    = "META-INF";
@@ -130,31 +131,53 @@
         = Boolean.getBoolean(Utils.COM_PREFIX+"nolog");
 
 
-    static final Logger log
-        = new Logger("java.util.jar.Pack200", null) {
-            public void log(LogRecord record) {
-                int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
-                if (verbose > 0) {
-                    if (nolog &&
-                        record.getLevel().intValue() < Level.WARNING.intValue()) {
-                        System.out.println(record.getMessage());
-                    } else {
-                        super.log(record);
-                    }
+    static class Pack200Logger {
+        private final String name;
+        private PlatformLogger log;
+        Pack200Logger(String name) {
+            this.name = name;
+        }
+
+        private synchronized PlatformLogger getLogger() {
+            if (log == null) {
+                log = PlatformLogger.getLogger(name);
+            }
+            return log;
+        }
+
+        public void warning(String msg, Object param) {
+            int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
+            if (verbose > 0) {
+                getLogger().warning(msg, param);
+            }
+        }
+
+        public void warning(String msg) {
+            warning(msg, null);
+        }
+
+        public void info(String msg) {
+            int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
+            if (verbose > 0) {
+                if (nolog) {
+                    System.out.println(msg);
+                } else {
+                    getLogger().info(msg);
                 }
             }
+        }
 
-            public void fine(String msg) {
-                int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
-                if (verbose > 0) {
-                        System.out.println(msg);
-                }
+        public void fine(String msg) {
+            int verbose = currentPropMap().getInteger(DEBUG_VERBOSE);
+            if (verbose > 0) {
+                    System.out.println(msg);
             }
-        };
-    static {
-        LogManager.getLogManager().addLogger(log);
+        }
     }
 
+    static final Pack200Logger log
+        = new Pack200Logger("java.util.jar.Pack200");
+
     // Returns the Max Version String of this implementation
     static String getVersionString() {
         return "Pack200, Vendor: Sun Microsystems, Version: " +
--- a/jdk/src/share/classes/sun/management/Flag.java	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/share/classes/sun/management/Flag.java	Tue Feb 23 10:17:16 2010 -0800
@@ -68,27 +68,42 @@
     }
 
     static Flag getFlag(String name) {
-        Flag[] fs = new Flag[1];
         String[] names = new String[1];
         names[0] = name;
-        int count = getFlags(names, fs, 1);
-        if (count == 1) {
-            return fs[0];
+
+        List<Flag> flags = getFlags(names, 1);
+        if (flags.isEmpty()) {
+            return null;
         } else {
-            return null;
+            // flags should have only one element
+            return flags.get(0);
         }
     }
 
     static List<Flag> getAllFlags() {
         int numFlags = getInternalFlagCount();
-        Flag[] fs = new Flag[numFlags];
 
         // Get all internal flags with names = null
-        int count = getFlags(null, fs, numFlags);
-        return Arrays.asList(fs);
+        return getFlags(null, numFlags);
+    }
+
+    private static List<Flag> getFlags(String[] names, int numFlags) {
+        Flag[] flags = new Flag[numFlags];
+        int count = getFlags(names, flags, numFlags);
+
+        List<Flag> result = new ArrayList<Flag>();
+        for (Flag f : flags) {
+            if (f != null) {
+                result.add(f);
+            }
+        }
+        return result;
     }
 
     private static native String[] getAllFlagNames();
+    // getFlags sets each element in the given flags array
+    // with a Flag object only if the name is valid and the
+    // type is supported. The flags array may contain null elements.
     private static native int getFlags(String[] names, Flag[] flags, int count);
     private static native int getInternalFlagCount();
 
--- a/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java	Tue Feb 23 10:17:16 2010 -0800
@@ -111,7 +111,7 @@
      * at the same time, then all but the first will block until
      * the first completes its authentication.
      */
-    static private HashMap requests = new HashMap ();
+    static private HashMap<String,Thread> requests = new HashMap<>();
 
     /* check if a request for this destination is in progress
      * return false immediately if not. Otherwise block until
@@ -125,7 +125,7 @@
         synchronized (requests) {
             Thread t, c;
             c = Thread.currentThread();
-            if ((t=(Thread)requests.get(key))==null) {
+            if ((t = requests.get(key)) == null) {
                 requests.put (key, c);
                 return false;
             }
@@ -147,8 +147,11 @@
      */
     static private void requestCompleted (String key) {
         synchronized (requests) {
-            boolean waspresent = requests.remove (key) != null;
-            assert waspresent;
+            Thread thread = requests.get(key);
+            if (thread != null && thread == Thread.currentThread()) {
+                boolean waspresent = requests.remove(key) != null;
+                assert waspresent;
+            }
             requests.notifyAll();
         }
     }
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Tue Feb 23 10:17:16 2010 -0800
@@ -423,7 +423,7 @@
 
             // Try keep-alive only on first attempt
             if (!failedOnce && http.getHttpKeepAliveSet()) {
-                if (http.usingProxy) {
+                if (http.usingProxy && tunnelState() != TunnelState.TUNNELING) {
                     requests.setIfNotSet("Proxy-Connection", "keep-alive");
                 } else {
                     requests.setIfNotSet("Connection", "keep-alive");
--- a/jdk/src/share/classes/sun/security/tools/KeyTool.java	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java	Tue Feb 23 10:17:16 2010 -0800
@@ -151,7 +151,7 @@
 
     enum Command {
         CERTREQ("Generates a certificate request",
-            ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE,
+            ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME,
             STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
             PROVIDERARG, PROVIDERPATH, V, PROTECTED),
         CHANGEALIAS("Changes an entry's alias",
@@ -167,7 +167,7 @@
             STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG,
             PROVIDERPATH, V, PROTECTED),
         GENKEYPAIR("Generates a key pair",
-            ALIAS, KEYALG, KEYSIZE, SIGALG, DESTALIAS,
+            ALIAS, KEYALG, KEYSIZE, SIGALG, DESTALIAS, DNAME,
             STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE,
             STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
             PROVIDERARG, PROVIDERPATH, V, PROTECTED),
@@ -176,7 +176,7 @@
             STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
             PROVIDERARG, PROVIDERPATH, V, PROTECTED),
         GENCERT("Generates certificate from a certificate request",
-            RFC, INFILE, OUTFILE, ALIAS, SIGALG,
+            RFC, INFILE, OUTFILE, ALIAS, SIGALG, DNAME,
             STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE,
             STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS,
             PROVIDERARG, PROVIDERPATH, V, PROTECTED),
--- a/jdk/src/share/native/sun/management/Flag.c	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/share/native/sun/management/Flag.c	Tue Feb 23 10:17:16 2010 -0800
@@ -84,6 +84,7 @@
 
     jint num_flags, i, index;
     jmmVMGlobal* globals;
+    size_t gsize;
     const char* class_name = "sun/management/Flag";
     const char* signature = "(Ljava/lang/String;Ljava/lang/Object;ZZLcom/sun/management/VMOption$Origin;)V";
     jobject origin;
@@ -100,12 +101,14 @@
         return 0;
     }
 
-    globals = (jmmVMGlobal*) malloc(count * sizeof(jmmVMGlobal));
+    gsize = count * sizeof(jmmVMGlobal);
+    globals = (jmmVMGlobal*) malloc(gsize);
     if (globals == NULL) {
         JNU_ThrowOutOfMemoryError(env, 0);
         return 0;
     }
 
+    memset(globals, 0, gsize);
     num_flags = jmm_interface->GetVMGlobals(env, names, globals, count);
     if (num_flags == 0) {
         free(globals);
--- a/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c	Tue Feb 23 10:17:16 2010 -0800
@@ -44,6 +44,7 @@
  * The GConf-2 settings used are:
  * - /system/http_proxy/use_http_proxy          boolean
  * - /system/http_proxy/use_authentcation       boolean
+ * - /system/http_proxy/use_same_proxy          boolean
  * - /system/http_proxy/host                    string
  * - /system/http_proxy/authentication_user     string
  * - /system/http_proxy/authentication_password string
@@ -158,6 +159,7 @@
   char *mode = NULL;
   int pport = 0;
   int use_proxy;
+  int use_same_proxy = 0;
   const char* urlhost;
   jobject isa = NULL;
   jobject proxy = NULL;
@@ -179,6 +181,15 @@
          * entries.
          */
 
+        use_same_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_same_proxy", NULL);
+        if (use_same_proxy) {
+          use_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_http_proxy", NULL);
+          if (use_proxy) {
+            phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL);
+            pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL);
+          }
+        }
+
         /**
          * HTTP:
          * /system/http_proxy/use_http_proxy (boolean)
@@ -188,8 +199,10 @@
         if (strcasecmp(cproto, "http") == 0) {
           use_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_http_proxy", NULL);
           if (use_proxy) {
-            phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL);
-            pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL);
+            if (!use_same_proxy) {
+              phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL);
+              pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL);
+            }
             CHECK_NULL(type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID));
           }
         }
@@ -203,8 +216,10 @@
         if (strcasecmp(cproto, "https") == 0) {
           mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
           if (mode != NULL && (strcasecmp(mode,"manual") == 0)) {
-            phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL);
-            pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL);
+            if (!use_same_proxy) {
+              phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL);
+              pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL);
+            }
             use_proxy = (phost != NULL);
             if (use_proxy)
               type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
@@ -220,8 +235,10 @@
         if (strcasecmp(cproto, "ftp") == 0) {
           mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
           if (mode != NULL && (strcasecmp(mode,"manual") == 0)) {
-            phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL);
-            pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL);
+            if (!use_same_proxy) {
+              phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL);
+              pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL);
+            }
             use_proxy = (phost != NULL);
             if (use_proxy)
               type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
@@ -237,8 +254,10 @@
         if (strcasecmp(cproto, "gopher") == 0) {
           mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
           if (mode != NULL && (strcasecmp(mode,"manual") == 0)) {
-            phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL);
-            pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL);
+            if (!use_same_proxy) {
+              phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL);
+              pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL);
+            }
             use_proxy = (phost != NULL);
             if (use_proxy)
               type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
@@ -254,8 +273,10 @@
         if (strcasecmp(cproto, "socks") == 0) {
           mode =  (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL);
           if (mode != NULL && (strcasecmp(mode,"manual") == 0)) {
-            phost = (*my_get_string_func)(gconf_client, "/system/proxy/socks_host", NULL);
-            pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL);
+            if (!use_same_proxy) {
+              phost = (*my_get_string_func)(gconf_client, "/system/proxy/socks_host", NULL);
+              pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL);
+            }
             use_proxy = (phost != NULL);
             if (use_proxy)
               type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_socksID);
--- a/jdk/test/ProblemList.txt	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/test/ProblemList.txt	Tue Feb 23 10:17:16 2010 -0800
@@ -692,7 +692,6 @@
 java/net/URLConnection/ZeroContentLength.java		 	generic-all
 
 # Solaris 11 i586 fails with samevm, not sure why
-java/net/Authenticator/B4769350.java				generic-all
 java/net/HttpURLConnection/HttpResponseCode.java		generic-all
 java/net/ResponseCache/B6181108.java				generic-all
 java/net/ResponseCache/ResponseCacheTest.java			generic-all
--- a/jdk/test/java/net/Authenticator/B4769350.java	Fri Feb 19 15:13:37 2010 -0800
+++ b/jdk/test/java/net/Authenticator/B4769350.java	Tue Feb 23 10:17:16 2010 -0800
@@ -26,9 +26,12 @@
  * @bug 4769350
  * @library ../../../sun/net/www/httptest/
  * @build HttpCallback HttpServer ClosedChannelList HttpTransaction AbstractCallback
- * @run main B4769350 server
- * @run main B4769350 proxy
+ * @run main/othervm B4769350 server
+ * @run main/othervm B4769350 proxy
  * @summary proxy authentication username and password caching only works in serial case
+ * Run in othervm since the test sets system properties that are read by the
+ * networking stack and cached when the HTTP handler is invoked, and previous
+ * tests may already have invoked the HTTP handler.
  */
 
 import java.io.*;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/ProxySelector/SystemProxies.java	Tue Feb 23 10:17:16 2010 -0800
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  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.
+ *
+ * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * This is a manual test to determine the proxies set on the system for various
+ * protocols. See bug 6912868.
+ */
+import java.net.Proxy;
+import java.net.ProxySelector;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+public class SystemProxies {
+
+    static final String uriAuthority = "myMachine/";
+    static final ProxySelector proxySel = ProxySelector.getDefault();
+
+    public static void main(String[] args) {
+        if (! "true".equals(System.getProperty("java.net.useSystemProxies"))) {
+            System.out.println("Usage: java -Djava.net.useSystemProxies SystemProxies");
+            return;
+        }
+
+        printProxies("http://");
+        printProxies("https://");
+        printProxies("ftp://");
+    }
+
+    static void printProxies(String proto) {
+        String uriStr =  proto + uriAuthority;
+        try {
+            List<Proxy> proxies = proxySel.select(new URI(uriStr));
+            System.out.println("Proxies returned for " + uriStr);
+            for (Proxy proxy : proxies)
+                System.out.println("\t" + proxy);
+        } catch (URISyntaxException e) {
+            System.err.println(e);
+        }
+    }
+}