Index: trunk/openjdk/jdk/make/common/Defs-os2.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 9)
+++ trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 10)
@@ -56,6 +56,5 @@
 endif
 
-# for backwards compatability, the old "win32" is used here instead of
-# the more proper "windows"
+# platform specific include files
 PLATFORM_INCLUDE_NAME = os2
 PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
Index: trunk/openjdk/jdk/make/common/shared/Defs-os2.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/shared/Defs-os2.gmk	(revision 9)
+++ trunk/openjdk/jdk/make/common/shared/Defs-os2.gmk	(revision 10)
@@ -62,2 +62,46 @@
 endef
 
+# System drive
+ifdef SYSTEM_INI
+  _system_drive :=$(firstword $(subst :, ,$(SYSTEM_INI))):
+endif
+_system_drive:=$(call CheckValue,_system_drive,C:)
+
+# Location on system where jdk installs might be
+ifndef PROGRAMS
+  USRJDKINSTANCES_PATH :="$(subst \,/,$(PROGRAMS))"
+else
+  USRJDKINSTANCES_PATH :=$(_system_drive)/
+endif
+USRJDKINSTANCES_PATH := $(call FullPath,$(USRJDKINSTANCES_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.
+ifdef ALT_UNIXCOMMAND_PATH
+  xALT_UNIXCOMMAND_PATH  :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
+  fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
+  UNIXCOMMAND_PATH       :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
+else
+  # assume commands are in PATH
+  UNIXCOMMAND_PATH :=
+endif
+UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
+
+# 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.
+ifdef ALT_DEVTOOLS_PATH
+  xALT_DEVTOOLS_PATH  :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
+  fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
+  DEVTOOLS_PATH       :=$(call PrefixPath,$(fxALT_DEVTOOLS_PATH))
+else
+  DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
+endif
+DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
+
+# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
+# _BOOTDIR2: Second choice
+ifndef ALT_BOOTDIR
+  _BOOTDIR1  =$(_system_drive)/jdk$(PREVIOUS_JDK_VERSION)
+  _BOOTDIR2  =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION)
+endif
+
Index: trunk/openjdk/jdk/make/common/shared/Defs-utils.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/shared/Defs-utils.gmk	(revision 9)
+++ trunk/openjdk/jdk/make/common/shared/Defs-utils.gmk	(revision 10)
@@ -32,5 +32,5 @@
 #         Unix Commands: Normally /bin/, /usr/bin/. or C:/mksnt/mksnt/
 #            UTILS_COMMAND_PATH
-#         /usr/bin/ 
+#         /usr/bin/
 #            UTILS_USR_BIN_PATH
 #         /usr/ccs/bin/ (sccs, m4, lex, yacc, as, ar, strip, mcs)
@@ -61,5 +61,5 @@
 endif
 
-ifeq ($(PLATFORM),windows)
+ifeq ($(filter-out windows os2,$(PLATFORM)),)
   UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH)
   UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH)
@@ -172,4 +172,10 @@
 endif
 
+# OS/2 specific
+ifeq ($(PLATFORM),os2)
+  ECHO   = $(UNIXCOMMAND_PATH)echo -e
+  NAWK   = $(UNIXCOMMAND_PATH)awk
+endif
+
 # Linux specific
 ifeq ($(PLATFORM),linux)
Index: trunk/openjdk/jdk/make/common/shared/Sanity.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/shared/Sanity.gmk	(revision 9)
+++ trunk/openjdk/jdk/make/common/shared/Sanity.gmk	(revision 10)
@@ -95,4 +95,9 @@
   DXSDK_VER := $(shell $(EGREP) DIRECTDRAW_VERSION $(DXSDK_INCLUDE_PATH)/ddraw.h 2>&1 | \
     $(EGREP) "\#define" | $(NAWK) '{print $$3}')
+endif
+
+ifeq ($(PLATFORM), os2)
+  FREE_SPACE := $(shell $(DF) -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
+  TEMP_FREE_SPACE := $(shell $(DF) -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
 endif
 
@@ -217,5 +222,5 @@
 # Check the BUILD_NUMBER to make sure it contains bNN
 ######################################################
-sane-build_number: 
+sane-build_number:
 	@if [ "`$(ECHO) $(BUILD_NUMBER) | $(SED) 's@.*b[0-9][0-9]*.*@bNN@'`" != "bNN" ] ; then \
 	    $(ECHO) "WARNING: The BUILD_NUMBER needs to contain b[0-9][0-9]*. Currently BUILD_NUMBER=$(BUILD_NUMBER). \n" \
@@ -290,5 +295,5 @@
 ######################################################
 sane-locale:
-ifneq ($(PLATFORM), windows)
+ifneq ($(filter-out windows os2,$(PLATFORM)),)
 	@if [ "$(LC_ALL)" != "" -a "$(LC_ALL)" != "C" ]; then \
 	  $(ECHO) "WARNING: LC_ALL has been set to $(LC_ALL), this can cause build failures. \n" \
@@ -662,7 +667,7 @@
 	    "" >> $(ERROR_FILE) ; \
 	fi
-  ifeq ($(PLATFORM), windows)
+  ifeq ($(filter-out windows os2,$(PLATFORM)),)
 	@if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -ci '^([a-z]:)'` -ne 1 ]; then \
-	  $(ECHO) "ERROR: On windows, ALT_OUTPUTDIR must contain the drive letter. \n" \
+	  $(ECHO) "ERROR: On Windows and OS/2, ALT_OUTPUTDIR must contain the drive letter. \n" \
 	    "" >> $(ERROR_FILE) ; \
 	fi
@@ -778,5 +783,5 @@
 MOTIF_CHECK_FILE=$(MOTIF_INCLUDE)/Xm/AtomMgr.h
 sane-motif:
-ifneq ($(PLATFORM), windows)
+ifneq ($(filter-out windows os2,$(PLATFORM)),)
   ifeq ($(MOTIF_REQUIRED), true)
     ifeq ($(PLATFORM), solaris)
@@ -788,5 +793,5 @@
 	    "" >> $(ERROR_FILE) ; \
 	fi
-    endif  
+    endif
     ifeq ($(PLATFORM), linux)
 	@if [ ! -r $(MOTIF_LIB)/libXm.a ]; then \
@@ -797,6 +802,6 @@
 	    "" >> $(ERROR_FILE) ; \
 	fi
-    endif  
-  endif  
+    endif
+  endif
 	@if [ ! -r $(MOTIF_CHECK_FILE) ]; then \
 	  $(ECHO) "ERROR: You do not have access to valid Motif 2.1 header files. \n" \
@@ -833,5 +838,5 @@
 else
 #do nothing  (not OpenJDK)
-sane-freetype: 
+sane-freetype:
 endif
 
@@ -1080,5 +1085,5 @@
 	    "" >> $(WARNING_FILE) ; \
 	fi
-endif	
+endif
 
 
@@ -1106,5 +1111,5 @@
 
 # Compare an interface file (Rule creates 2 temp files: %.h and %.h.IMPORT)
-#    Files jvm.h, jvm_md.h and jmm.h are special in that they are not publicly 
+#    Files jvm.h, jvm_md.h and jmm.h are special in that they are not publicly
 #    exported but do represent VM interfaces used by the rest of the jdk.
 #    So these 3 will not be found in a promoted build and can only
@@ -1218,6 +1223,6 @@
 
 ifeq ($(INCLUDE_SA), true)
-# Verify that hotspot Serviceability Agent files are present.  To keep 
-# it simple, we will just check for one of them.  The others have arch 
+# Verify that hotspot Serviceability Agent files are present.  To keep
+# it simple, we will just check for one of them.  The others have arch
 # dependent paths.
 
@@ -1327,5 +1332,5 @@
           "      and/or check your value of ALT_UNICOWS_LIB_PATH \n" \
 	  "" >> $(ERROR_FILE) ; \
-        fi 
+        fi
 	@if [ ! -r "$(UNICOWS_DLL_PATH)/unicows.dll" ]; then \
 	$(ECHO) "ERROR: You do not have access to the Microsoft Layer for Unicode (MSLU) runtime files.\n" \
@@ -1334,5 +1339,5 @@
           "      and/or check your value of ALT_UNICOWS_DLL_PATH \n" \
 	  "" >> $(ERROR_FILE) ; \
-        fi 
+        fi
   endif
 endif
@@ -1403,5 +1408,5 @@
 
 ######################################################
-# Check that ALSA headers and libs are installed and 
+# Check that ALSA headers and libs are installed and
 # that the header has the right version. We only
 # need /usr/include/alsa/*.h and /usr/lib/libasound.so
