Index: /trunk/openjdk/corba/make/common/Defs-os2.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/Defs-os2.gmk	(revision 258)
+++ /trunk/openjdk/corba/make/common/Defs-os2.gmk	(revision 258)
@@ -0,0 +1,182 @@
+#
+# Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2010 netlabs.org. OS/2 parts
+#
+# 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.
+#
+
+#
+# Makefile to specify compiler flags for programs and libraries
+# targeted to Windows builds.  Should not contain any rules.
+#
+
+# Get shared JDK settings
+include $(BUILDDIR)/common/shared/Defs.gmk
+
+# LIB_LOCATION, which for OS/2 identifies where .exe files go, may be
+# set by each GNUmakefile. The default is BINDIR.
+ifndef LIB_LOCATION
+  LIB_LOCATION = $(BINDIR)
+endif # LIB_LOCATION
+
+# Part of INCREMENTAL_BUILD mechanism.
+#   Compiler emits things like:  file.obj: file.c file.h...
+#   We want something like: obj_path/file.obj: file.c file.h...
+CC_DEPEND	 = -MM -MT $(@:$(suffix $@)=.$(OBJECT_SUFFIX))
+CC_DEPEND_FILTER =
+
+ifndef PLATFORM_SRC
+  # We mostly reuse the windows code so far.
+  PLATFORM_SRC  = $(TOPDIR)/src/windows
+endif # PLATFORM_SRC
+
+ifndef PLATFORM_SRC_OS2
+  # OS/2 is based on Odin32 so PLATFORM_SRC is 'windows'. But in some cases we
+  # provide the native bits and need to refer to a separate 'os2' soorce tree
+  PLATFORM_SRC_OS2 = $(PLATFORM_SRC:%/windows=%/os2)
+endif
+
+ifeq ($(PLATFORM_SRC), $(PLATFORM_SRC_OS2))
+  $(error Both PLATFORM_SRC and PLATFORM_SRC_OS2 are '$(PLATFOROM_SRC)'!)
+endif
+
+# platform specific include files
+PLATFORM_INCLUDE_NAME = os2
+PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
+
+# suffix used for make dependencies files.
+DEPEND_SUFFIX = dep
+# The suffix applied to the library name for FDLIBM
+FDDLIBM_SUFFIX = lib
+# The suffix applied to scripts (.bat for windows, nothing for unix)
+SCRIPT_SUFFIX = cmd
+# CC compiler object code output directive flag value
+CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
+CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
+
+#
+# Default HPI libraries. Build will build only native, unless
+# overriden at the make command line. This makes it convenient for
+# people doing, say, a pthreads port -- they can create a posix
+# directory here, and say "gnumake HPIS=posix" at the top
+# level.
+#
+HPIS = windows
+
+#
+# Default optimization
+#
+CC_HIGHEST_OPT = -O3
+CC_HIGHER_OPT  = -O3
+CC_LOWER_OPT   = -O2
+CC_NO_OPT      =
+
+ifeq ($(PRODUCT), java)
+    _OPT = $(CC_HIGHER_OPT)
+else
+    _OPT = $(CC_LOWER_OPT)
+    CPPFLAGS_DBG    += -DLOGGING
+endif
+
+# If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off
+ifdef NO_OPTIMIZATIONS
+  CC_HIGHEST_OPT = $(CC_NO_OPT)
+  CC_HIGHER_OPT  = $(CC_NO_OPT)
+  CC_LOWER_OPT   = $(CC_NO_OPT)
+endif
+
+#
+# Selection of warning messages
+#
+GCC_INHIBIT	= -Wno-unused -Wno-parentheses
+GCC_STYLE	=
+GCC_WARNINGS	= -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
+
+# We compile a lot of MSVC code which seems to silently tolerate this
+GCC_WARNINGS += -Wno-sign-compare
+GCC_WARNINGS_C += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
+GCC_WARNINGS_CXX += -Wno-write-strings
+
+#
+# Treat compiler warnings as errors, if warnings not allowed
+#
+ifeq ($(COMPILER_WARNINGS_FATAL),true)
+  GCC_WARNINGS += -Werror
+endif
+
+#
+# Misc compiler options
+#
+CFLAGS_COMMON   = $(GCC_WARNINGS) $(GCC_WARNINGS_C) -march=i486 -mtune=generic -Zomf
+CFLAGS_OPT      = -s $(POPT)
+CFLAGS_DBG      = -g
+
+CXXFLAGS_COMMON = -DCC_NOEX $(GCC_WARNINGS) $(GCC_WARNINGS_CXX) -march=i486 -mtune=generic -Zomf
+CXXFLAGS_OPT	= $(CFLAGS_OPT)
+CXXFLAGS_DBG	= $(CFLAGS_DBG)
+
+#
+# Preprocessor macro definitions
+#
+CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DOS2 -D_LITTLE_ENDIAN $(VERSION_DEFINES)
+CPPFLAGS_OPT    =
+CPPFLAGS_DBG    = -DDEBUG
+
+#
+# Linker options
+#
+LDFLAGS_COMMON  = -Zomf -Zmap -Zstack 0x2000 -Zhigh-mem -Zno-fork -Zno-unix
+LDFLAGS_OPT     = -s
+LDFLAGS_DBG     =
+
+ifeq ($(EMXOMFLD_TYPE), WLINK)
+  LDFLAGS_COMMON += -Zlinker "DISABLE 1121"
+endif
+ifeq ($(EMXOMFLD_TYPE), VAC308)
+  LDFLAGS_COMMON += -Zlinker /OPTFUNC
+endif
+
+#
+# Additional libraries needed by all targets
+#
+
+CPPFLAGS_COMMON += -D__WIN32OS2__ -D__i386__ -DSTRICT -D_POSIX_SOURCE \
+                   -D_POSIX_C_SOURCE=200112 -D_EMX_SOURCE -D_XOPEN_SOURCE=600 \
+				   -D_SVID_SOURCE
+CPPFLAGS_COMMON += -I$(ODINSDK_PATH)/include/Win -I$(ODINSDK_PATH)/include \
+                   -DWINE_LARGE_INTEGER
+
+LDFLAGS_OPT     += -L$(ODINSDK_PATH)/lib/Release -L$(ODINSDK_PATH)/lib
+LDFLAGS_DBG     += -L$(ODINSDK_PATH)/lib/Debug -L$(ODINSDK_PATH)/lib
+LDFLAGS_COMMON  += -lkernel32.lib -luser32.lib -ladvapi32.lib \
+				   -lminivcrt.lib -lntdll.lib \
+				   -llibwrap0.lib -llibwrap1.lib
+
+#
+# Path and option to link against the VM, if you have to. 
+#
+JVMLIB	= $(BOOTDIR)/lib/jvm.lib
+JAVALIB =
+
+LIBRARY_SUFFIX = dll
+LIB_SUFFIX     = lib
Index: /trunk/openjdk/corba/make/common/Defs.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/Defs.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/Defs.gmk	(revision 258)
@@ -220,6 +220,7 @@
 INCLUDES = -I. -I$(CLASSHDRDIR) \
 	$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
+ifneq ($(PLATFORM), os2)
 OTHER_CPPFLAGS = $(INCLUDES)
-
+endif
 
 #
@@ -292,4 +293,10 @@
 $(MKDIR) -p $(@D)
 $(RM) $@
+endef
+
+# Prepare $@ target directory, remove old one and making sure parent exists
+define prep-dir-target
+$(MKDIR) -p $(@D)
+$(RM) -r $@
 endef
 
@@ -447,6 +454,11 @@
 CFLAGS          = $(CFLAGS_$(VARIANT)/BYFILE)   $(CFLAGS_COMMON) $(OTHER_CFLAGS)
 CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
+ifeq ($(PLATFORM), os2)
+CPPFLAGS        = $(INCLUDES) $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
+		  $(DEFINES) $(OPTIONS:%=-D%)
+else
 CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
 		  $(DEFINES) $(OPTIONS:%=-D%)
+endif
 LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
 LDLIBS          = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
Index: /trunk/openjdk/corba/make/common/Library.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/Library.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/Library.gmk	(revision 258)
@@ -35,5 +35,11 @@
 #
 
-ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
+ifneq ($(LIBRARY_SHORT),)
+LIBRARY_NAME = $(LIBRARY_SHORT)
+else
+LIBRARY_NAME = $(LIBRARY)
+endif
+
+ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY_NAME).$(LIBRARY_SUFFIX)
 ACTUAL_LIBRARY_DIR = $(LIB_LOCATION)
 ACTUAL_LIBRARY = $(ACTUAL_LIBRARY_DIR)/$(ACTUAL_LIBRARY_NAME)
@@ -186,5 +192,42 @@
 endif # INSTALL_DOT_LIB
 
-else # PLATFORM
+else # PLATFORM == windows
+
+ifeq ($(PLATFORM), os2)
+
+#
+# Library building rules.
+#
+
+$(LIBRARY).lib:: $(OBJDIR)
+
+$(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder) $(DEF_FILE)
+	@$(prep-target)
+	@$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), _OPT=$(_OPT)"
+	@$(ECHO) "Rebuilding $@ because of $?"
+	$(LINK) $(LDFLAGS) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS) $(DEF_FILE)
+	$(IMPLIB) -o $(OBJDIR)/$(LIBRARY).lib $@
+	cd $(@D) && $(MAPSYM) $(basename $(@F)).map
+
+#
+# Install a .lib file if required.
+#
+ifeq ($(INSTALL_DOT_LIB), true)
+
+$(ACTUAL_LIBRARY):: $(LIBDIR)/$(LIBRARY).lib
+
+clean::
+	-$(RM) $(LIBDIR)/$(LIBRARY).lib
+	-$(RM) $(LIBDIR)/$(LIBRARY).dll
+
+$(LIBDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lib
+	$(install-file)
+
+$(LIBDIR)/$(LIBRARY).dll:: $(ACTUAL_LIBRARY)
+	$(install-file)
+
+endif # INSTALL_DOT_LIB
+
+else # PLATFORM == os2
 
 #
@@ -202,5 +245,7 @@
 endif # WRITE_LIBVERSION
 
-endif # PLATFORM
+endif # PLATFORM == os2
+
+endif # PLATFORM == windows
 
 #
@@ -216,4 +261,12 @@
 #
 ifdef PACKAGE
+
+ifeq ($(PLATFORM), os2)
+# OS/2 specific vpath should come first
+vpath %.c $(PLATFORM_SRC_OS2)/native/$(PKGDIR)
+OTHER_INCLUDES += -I$(PLATFORM_SRC_OS2)/native/common
+OTHER_INCLUDES += -I$(PLATFORM_SRC_OS2)/native/$(PKGDIR)
+endif
+
 vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
 vpath %.c $(SHARE_SRC)/native/$(PKGDIR)
@@ -221,4 +274,5 @@
 OTHER_INCLUDES += -I$(SHARE_SRC)/native/$(PKGDIR) \
 		  -I$(PLATFORM_SRC)/native/$(PKGDIR)
+
 endif
 
Index: /trunk/openjdk/corba/make/common/internal/NativeCompileRules.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/internal/NativeCompileRules.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/internal/NativeCompileRules.gmk	(revision 258)
@@ -47,6 +47,7 @@
 	@$(ECHO) "Creating $@"
 	@$(RM) $@.temp
-	@$(CC) $(CC_DEPEND) $(CPPFLAGS) $< 2> $(DEV_NULL) | \
-	    $(CC_DEPEND_FILTER) > $@.temp
+	@$(CC) $(CC_DEPEND) $(CPPFLAGS) $< \
+	    $(if $(CC_DEPEND_FILTER), | $(CC_DEPEND_FILTER)) \
+	    > $@.temp
 	@$(MV) $@.temp $@
 
@@ -55,6 +56,7 @@
 	@$(ECHO) "Creating $@"
 	@$(RM) $@.temp
-	@$(CXX) $(CC_DEPEND) $(CPPFLAGS) $(CXXFLAGS) $< 2> $(DEV_NULL) | \
-	    $(CC_DEPEND_FILTER) > $@.temp
+	@$(CXX) $(CC_DEPEND) $(CPPFLAGS) $(CXXFLAGS) $< \
+	    $(if $(CC_DEPEND_FILTER), | $(CC_DEPEND_FILTER)) \
+	    > $@.temp
 	@$(MV) $@.temp $@
 
Index: /trunk/openjdk/corba/make/common/shared/Compiler-gcc.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/shared/Compiler-gcc.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/shared/Compiler-gcc.gmk	(revision 258)
@@ -53,4 +53,31 @@
   _LINK_VER :=$(shell $(LINK) 2>&1 | $(HEAD) -n 1)
   LINK_VER  :=$(call GetVersion,"$(_LINK_VER)")
+
+endif
+
+ifeq ($(PLATFORM), os2)
+
+  ifeq ($(EMXOMFLD_TYPE), WLINK)
+    $(error WLINK is not currently supported due to fixup-related bugs when building awt.dll. \
+            Use VAC308 ILINK instead)
+  endif
+
+  # Settings specific to OS/2
+  CC           = $(COMPILER_PATH)gcc
+  CPP          = $(COMPILER_PATH)gcc -E
+  CXX          = $(COMPILER_PATH)g++
+  REQUIRED_CC_VER = 3.2
+
+  LINK         = $(COMPILER_PATH)gcc
+  AR           = $(COMPILER_PATH)emxomfar
+  IMPLIB       = $(COMPILER_PATH)emximp
+  MAPSYM       = mapsym.exe
+
+  # Option used to create a shared library
+  SHARED_LIBRARY_FLAG = -Zdll
+  ifeq ($(EMXOMFLD_TYPE), VAC308)
+    # (for some reason -Zdll is not always converted to /DLL by emxomfld)
+    SHARED_LIBRARY_FLAG += -Zlinker /DLL
+  endif
 
 endif
Index: /trunk/openjdk/corba/make/common/shared/Compiler.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/shared/Compiler.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/shared/Compiler.gmk	(revision 258)
@@ -33,4 +33,9 @@
 endif
 
+# OS/2 uses GNU compilers by default
+ifeq ($(PLATFORM), os2)
+  override CC_VERSION = gcc
+endif
+
 # Solaris uses Sun Studio compilers by default
 ifeq ($(PLATFORM), solaris)
Index: /trunk/openjdk/corba/make/common/shared/Defs-java.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/shared/Defs-java.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/shared/Defs-java.gmk	(revision 258)
@@ -118,5 +118,6 @@
 
 # Needed for javah
-JAVAHFLAGS += -bootclasspath $(CLASSBINDIR)
+JAVAHFLAGS += -bootclasspath $(if $(filter $(CLASSBINDIR),$(CLASSDESTDIR)),\
+	$(CLASSBINDIR),$(CLASSDESTDIR)$(CLASSPATH_SEPARATOR)$(CLASSBINDIR))
 
 # Langtools
Index: /trunk/openjdk/corba/make/common/shared/Defs-os2.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/shared/Defs-os2.gmk	(revision 258)
+++ /trunk/openjdk/corba/make/common/shared/Defs-os2.gmk	(revision 258)
@@ -0,0 +1,172 @@
+#
+# Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2010 netlabs.org. OS/2 parts
+#
+# 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.
+#
+
+#
+# Definitions for OS/2.
+#
+
+# Default for COMPILER_WARNINGS_FATAL on OS/2 (C++ compiler warnings)
+#    Level: Default is 3, 0 means none, 4 is the most but may be unreliable
+#    Some makefiles may have set this to 0 to turn off warnings completely,
+#    which also effectively creates a COMPILER_WARNINGS_FATAL=false situation.
+#    Program.gmk may turn this down to 2 (building .exe's).
+ifndef COMPILER_WARNING_LEVEL
+  COMPILER_WARNING_LEVEL=3
+endif
+ifndef COMPILER_WARNINGS_FATAL
+  COMPILER_WARNINGS_FATAL=false
+endif
+
+# OS/2 should use parallel compilation for best build times
+ifndef COMPILE_APPROACH
+  COMPILE_APPROACH = normal
+endif
+
+# Indication that we are doing an incremental build.
+#    This may trigger the creation of make depend files.
+ifndef INCREMENTAL_BUILD
+  INCREMENTAL_BUILD = false
+endif
+
+# FullPath just makes sure it never ends with a / and no duplicates
+define FullPath
+$(shell cd $1 2> $(DEV_NULL) && pwd)
+endef
+
+# OptFullPath: Absolute path name of a dir that might not initially exist.
+define OptFullPath
+$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
+endef
+
+# 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)
+
+# SLASH_JAVA: location of all network accessable files
+ifdef ALT_SLASH_JAVA
+  xALT_SLASH_JAVA :="$(subst \,/,$(ALT_SLASH_JAVA))"
+  SLASH_JAVA      :=$(call FullPath,$(xALT_SLASH_JAVA))
+else
+  ifdef ALT_JDK_JAVA_DRIVE
+    SLASH_JAVA  =$(JDK_JAVA_DRIVE)
+  else
+    SLASH_JAVA  =J:
+  endif
+endif
+SLASH_JAVA:=$(call AltCheckSpaces,SLASH_JAVA)
+SLASH_JAVA:=$(call AltCheckValue,SLASH_JAVA)
+
+# JDK_DEVTOOLS_DIR: common path for all the java devtools
+ifdef ALT_JDK_DEVTOOLS_DIR
+  xALT_JDK_DEVTOOLS_DIR :="$(subst \,/,$(ALT_JDK_DEVTOOLS_DIR))"
+  JDK_DEVTOOLS_DIR      :=$(call FullPath,$(xALT_JDK_DEVTOOLS_DIR))
+else
+  JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools
+endif
+JDK_DEVTOOLS_DIR:=$(call AltCheckSpaces,JDK_DEVTOOLS_DIR)
+JDK_DEVTOOLS_DIR:=$(call AltCheckValue,JDK_DEVTOOLS_DIR)
+
+# COMPILER_PATH: path to where the compiler and tools are installed.
+#  NOTE: Must end with / so that it could be empty, allowing PATH usage.
+ifdef ALT_COMPILER_PATH
+  xALT_COMPILER_PATH  :="$(subst \,/,$(ALT_COMPILER_PATH))"
+  fxALT_COMPILER_PATH :=$(call FullPath,$(xALT_COMPILER_PATH))
+  COMPILER_PATH       :=$(call PrefixPath,$(fxALT_COMPILER_PATH))
+else
+  COMPILER_PATH :=$(call PrefixPath,$(_compiler_bin))
+endif
+COMPILER_PATH :=$(call AltCheckSpaces,COMPILER_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
+
+# ODINSDK_PATH: Path to the root directory of Odin32 SDK
+ifdef ALT_ODINSDK_PATH
+  xALT_ODINSDK_PATH :="$(subst \,/,$(ALT_ODINSDK_PATH))"
+  ODINSDK_PATH      :=$(call FullPath,$(xALT_ODINSDK_PATH))
+endif
+ODINSDK_PATH :=$(call AltCheckSpaces,ODINSDK_PATH)
+ODINSDK_PATH :=$(call AltCheckValue,ODINSDK_PATH)
+
+# Import JDK images allow for partial builds, components not built are
+#    imported (or copied from) these import areas when needed.
+
+# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for
+#   multiple platforms, e.g. windows-i586, solaris-sparc, linux-586, etc.
+ifdef ALT_BUILD_JDK_IMPORT_PATH
+  BUILD_JDK_IMPORT_PATH  :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH))
+else
+  BUILD_JDK_IMPORT_PATH   = $(PROMOTED_BUILD_BINARIES)
+endif
+BUILD_JDK_IMPORT_PATH:=$(call AltCheckSpaces,BUILD_JDK_IMPORT_PATH)
+BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH)
+
+# JDK_IMPORT_PATH: location of previously built JDK (this version) to import
+ifdef ALT_JDK_IMPORT_PATH
+  JDK_IMPORT_PATH  :=$(call FullPath,$(ALT_JDK_IMPORT_PATH))
+else
+  JDK_IMPORT_PATH   = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT)
+endif
+JDK_IMPORT_PATH:=$(call AltCheckSpaces,JDK_IMPORT_PATH)
+JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH)
Index: /trunk/openjdk/corba/make/common/shared/Defs-utils.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/shared/Defs-utils.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/shared/Defs-utils.gmk	(revision 258)
@@ -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)
@@ -158,4 +158,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/corba/make/common/shared/Defs.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/shared/Defs.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/shared/Defs.gmk	(revision 258)
@@ -116,5 +116,5 @@
 # Given a line of text, get the major.minor version number from it
 define GetVersion
-$(shell echo $1 | sed -e 's@[^1-9]*\([1-9][0-9]*\.[0-9][0-9]*\).*@\1@' )
+$(shell echo $1 | sed -ne 's@[^1-9]*\([1-9][0-9]*\.[0-9][0-9]*\).*@\1@p')
 endef
 
Index: /trunk/openjdk/corba/make/common/shared/Platform.gmk
===================================================================
--- /trunk/openjdk/corba/make/common/shared/Platform.gmk	(revision 257)
+++ /trunk/openjdk/corba/make/common/shared/Platform.gmk	(revision 258)
@@ -373,4 +373,57 @@
 endif
 
+# Platform settings specific to OS/2
+ifeq ($(SYSTEM_UNAME), OS/2)
+  PLATFORM = os2
+  OS_NAME = os2
+  OS_VERSION := $(shell uname -r)
+  OS_VENDOR = IBM
+  TEMP_DISK = $(subst \,/,$(TEMP))
+  ARCH_DATA_MODEL = 32
+  ARCH = i586
+  # LIBARCH is used to preserve the jre/lib/i386 directory name for 32-bit intel
+  LIBARCH = i386
+  # Value of Java os.arch property
+  ARCHPROP = x86
+  ARCH_FAMILY = $(ARCH)
+  # Where is unwanted output to be delivered?
+  DEV_NULL = nul
+  # Classpath separator
+  CLASSPATH_SEPARATOR = \;
+  # The suffix used for object file (.o for unix .obj for windows)
+  OBJECT_SUFFIX = obj
+  # The suffix applied to executables (.exe for windows, nothing for solaris)
+  EXE_SUFFIX = .exe
+  # The prefix applied to library files (lib for solaris, nothing for windows)
+  LIB_PREFIX =
+  LIBRARY_SUFFIX = dll
+  LIB_SUFFIX = lib
+  # User name determination (set _USER)
+  ifndef USER
+    ifdef USERNAME
+      _USER := $(USERNAME)
+    else
+      ifdef LOGNAME
+        _USER := $(LOGNAME)
+      else
+        _USER := $(shell id -un)
+      endif
+    endif
+  else
+    _USER:=$(USER)
+  endif
+  # Location of client/server directories
+  ARCH_VM_SUBDIR=jre/bin
+  # Suffix for file bundles used in previous release
+  BUNDLE_FILE_SUFFIX=.tar
+  # Minimum disk space needed as determined by running 'du -sk' on
+  #    a fully built workspace.
+  REQUIRED_FREE_SPACE=500000
+  # How much RAM does this machine have:
+  # @todo
+  # @todo We don't have JDK 1.6 yet so require 1.5
+  REQUIRED_BOOT_VER = 1.5
+endif
+
 # Machines with 512Mb or less of real memory are considered low memory
 #    build machines and adjustments will be made to prevent excessing
@@ -409,5 +462,5 @@
 
 # Unix type settings (same for all unix platforms)
-ifneq ($(PLATFORM), windows)
+ifneq ($(filter-out windows os2, $(PLATFORM)),)
   # Temporary disk area
   TEMP_DISK=/tmp
