Index: trunk/env.cmd
===================================================================
--- trunk/env.cmd	(revision 26)
+++ trunk/env.cmd	(revision 27)
@@ -85,4 +85,5 @@
  */
 call EnvSetIfEmtpy 'ALT_BOOTDIR', UnixSlashes(G.PATH_TOOL_BOOT_JDK)
+call EnvSetIfEmtpy 'ALT_ODINSDK_PATH', UnixSlashes(G.PATH_LIB_ODIN32)
 call EnvSetIfEmtpy 'ALT_FREETYPE_HEADERS_PATH', UnixSlashes(ScriptDir'libs\freetype\include')
 call EnvSetIfEmtpy 'ALT_FREETYPE_LIB_PATH', UnixSlashes(ScriptDir'libs\freetype\lib')
Index: trunk/openjdk/Makefile
===================================================================
--- trunk/openjdk/Makefile	(revision 26)
+++ trunk/openjdk/Makefile	(revision 27)
@@ -116,5 +116,5 @@
 endif
 
-build:: sanity 
+build:: sanity
 
 clobber::
@@ -141,5 +141,5 @@
 
 ifeq ($(BUILD_HOTSPOT), true)
-  build:: $(HOTSPOT) 
+  build:: $(HOTSPOT)
   clobber:: hotspot-clobber
 endif
@@ -168,5 +168,5 @@
 #   ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
 #   The resulting j2sdk-image is used by the install makefiles to create a
-#     debug install bundle jdk-*-debug-** bundle (tar or zip) 
+#     debug install bundle jdk-*-debug-** bundle (tar or zip)
 #     which will install in the debug or fastdebug subdirectory of the
 #     normal product install area.
@@ -281,5 +281,5 @@
 	@$(ECHO) "================================================="
 	@$(ECHO) " "
-    
+
     endif
   endif
@@ -294,5 +294,5 @@
 clean: clobber
 
-all:: 
+all::
 	@$(ECHO) Control build finished: `$(DATE) '+%y-%m-%d %H:%M'`
 
@@ -384,4 +384,5 @@
 MSDEVTOOLS_PATH.desc       = Root directory of VC++ tools (e.g. rc.exe)
 MSVCRT_DLL_PATH.desc       = Directory containing mscvrt.dll
+ODINSDK_PATH.desc          = Root directory of Odin32 SDK (OS/2)
 
 # Make variables to print out (description and value)
@@ -402,5 +403,5 @@
     JDK_IMPORT_PATH             \
     COMPILER_PATH               \
-    DEVTOOLS_PATH 
+    DEVTOOLS_PATH
 
 # Make variables that should refer to files that exist
@@ -420,4 +421,15 @@
     MSDEVTOOLS_PATH             \
     MSVCRT_DLL_PATH
+
+endif
+
+# Some are OS/2 specific
+ifeq ($(PLATFORM), os2)
+
+VARIABLE_PRINTVAL_LIST +=       \
+    ODINSDK_PATH
+
+VARIABLE_CHECKDIR_LIST +=       \
+    ODINSDK_PATH
 
 endif
@@ -483,7 +495,7 @@
 # Cycle build. Build the jdk, use it to build the jdk again.
 ################################################################
-  
+
 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
-  
+
 boot_cycle:
 	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) product_build
Index: trunk/openjdk/jdk/make/Makefile
===================================================================
--- trunk/openjdk/jdk/make/Makefile	(revision 26)
+++ trunk/openjdk/jdk/make/Makefile	(revision 27)
@@ -106,4 +106,5 @@
 UNICOWS_DLL_PATH.desc      = Directory containing unicows.dll
 UNICOWS_LIB_PATH.desc      = Directory containing unicows.lib
+ODINSDK_PATH.desc          = Root directory of Odin32 SDK (OS/2)
 
 # Make variables to print out (description and value)
@@ -151,4 +152,15 @@
     UNICOWS_DLL_PATH            \
     UNICOWS_LIB_PATH
+
+endif
+
+# Some are OS/2 specific
+ifeq ($(PLATFORM), os2)
+
+VARIABLE_PRINTVAL_LIST +=       \
+    ODINSDK_PATH
+
+VARIABLE_CHECKDIR_LIST +=       \
+    ODINSDK_PATH
 
 endif
@@ -213,5 +225,5 @@
 # 'all' target intro
 #
-all:: 
+all::
 	@$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: $(shell $(DATE) '+%y-%m-%d %H:%M')
 
@@ -283,5 +295,5 @@
 # workspace, and if it is a Teamware workspace, then see if there are
 # any files which are not under SCCS control.
-clean clobber:: 
+clean clobber::
 ifndef EXTERNALSANITYCONTROL
 	@if [ -d $(TOPDIR)/Codemgr_wsdata ]; then \
Index: trunk/openjdk/jdk/make/common/Defs-os2.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 26)
+++ trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 27)
@@ -44,5 +44,6 @@
 
 ifndef PLATFORM_SRC
-  PLATFORM_SRC  = $(BUILDDIR)/../src/os2
+  # We mostly reuse the windows code so far.
+  PLATFORM_SRC  = $(BUILDDIR)/../src/windows
 endif # PLATFORM_SRC
 
@@ -75,5 +76,5 @@
 # level.
 #
-HPIS = os2
+HPIS = windows
 
 #
@@ -134,7 +135,16 @@
 # Linker options
 #
-LDFLAGS_COMMON  = -Zomf -Zstack 0x2000 -Zlinker "DISABLE 1121" -Zhigh-mem
+LDFLAGS_COMMON  = -Zomf -Zmap -Zstack 0x2000 -Zlinker "DISABLE 1121" -Zhigh-mem
 LDFLAGS_OPT     = -s
 LDFLAGS_DBG     =
+
+#
+# Additional libraries needed by all targets
+#
+
+CPPFLAGS_COMMON += -D__WIN32OS2__ -D__i386__
+CPPFLAGS_COMMON += -I$(ODINSDK_PATH)/include/Win -I$(ODINSDK_PATH)/include
+LDFLAGS_COMMON  += -L$(ODINSDK_PATH)/lib -L$(ODINSDK_PATH)/lib/Release
+EXTRA_LIBS      +=
 
 #
Index: trunk/openjdk/jdk/make/common/Library.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/Library.gmk	(revision 26)
+++ trunk/openjdk/jdk/make/common/Library.gmk	(revision 27)
@@ -40,5 +40,5 @@
 
 ifeq ($(LIBRARY), fdlibm)
-ifeq ($(PLATFORM),windows)
+ifeq ($(filter-out windows os2,$(PLATFORM)),)
 ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(FDDLIBM_SUFFIX)
 ACTUAL_LIBRARY_DIR = $(OBJDIR)
@@ -177,5 +177,5 @@
 		@$(OBJDIR)/$(LIBRARY).lcf $(OTHER_LCF) $(LDLIBS_COMMON)
 else # LIBRARY
-# build it into $(OBJDIR) so that the other generated files get put 
+# build it into $(OBJDIR) so that the other generated files get put
 # there, then copy just the DLL (and MAP file) to the requested directory.
 #
@@ -196,9 +196,9 @@
 	@$(prep-target)
 	@$(MKDIR) -p $(TEMPDIR)
-	@$(ECHO) $(FILES_o) > $@ 
+	@$(ECHO) $(FILES_o) > $@
 ifndef LOCAL_RESOURCE_FILE
 	@$(ECHO) $(OBJDIR)/$(LIBRARY).res >> $@
 endif
-	@$(ECHO) Created $@ 
+	@$(ECHO) Created $@
 
 # J2SE name required here
@@ -219,5 +219,5 @@
 $(ACTUAL_LIBRARY):: $(LIBDIR)/$(LIBRARY).lib
 
-clean:: 
+clean::
 	-$(RM) $(LIBDIR)/$(LIBRARY).lib
 
@@ -257,5 +257,5 @@
 ifeq ($(PLATFORM),solaris)
 lint.errors : $(FILES_ln)
-	$(LINT.c) $(FILES_ln) $(LDLIBS) 
+	$(LINT.c) $(FILES_ln) $(LDLIBS)
 endif
 
Index: trunk/openjdk/jdk/make/common/Sanity.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/Sanity.gmk	(revision 26)
+++ trunk/openjdk/jdk/make/common/Sanity.gmk	(revision 27)
@@ -73,5 +73,6 @@
     sane-ant_version \
     sane-zip_version \
-    sane-msvcrt_path
+    sane-msvcrt_path \
+    sane-odinsdk
 
 # The rules sanity-* have a one-to-one correspondence with the major targets
Index: trunk/openjdk/jdk/make/common/shared/Defs-os2.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/shared/Defs-os2.gmk	(revision 26)
+++ trunk/openjdk/jdk/make/common/shared/Defs-os2.gmk	(revision 27)
@@ -140,4 +140,12 @@
   _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
Index: trunk/openjdk/jdk/make/common/shared/Sanity-Settings.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/shared/Sanity-Settings.gmk	(revision 26)
+++ trunk/openjdk/jdk/make/common/shared/Sanity-Settings.gmk	(revision 27)
@@ -247,4 +247,7 @@
   endif
 endif
+ifeq ($(PLATFORM),os2)
+  ALL_SETTINGS+=$(call addAltSetting,ODINSDK_PATH)
+endif
 ALL_SETTINGS+=$(call addAltSetting,CACERTS_FILE)
 ifndef OPENJDK
Index: trunk/openjdk/jdk/make/common/shared/Sanity.gmk
===================================================================
--- trunk/openjdk/jdk/make/common/shared/Sanity.gmk	(revision 26)
+++ trunk/openjdk/jdk/make/common/shared/Sanity.gmk	(revision 27)
@@ -1344,4 +1344,29 @@
 
 ######################################################
+# Check for Odin32 SDK directory
+######################################################
+sane-odinsdk:
+ifeq ($(PLATFORM), os2)
+	@if [ ! -r $(ODINSDK_PATH)/include/odin.h  ]; then \
+	$(ECHO) "ERROR: You do not have access to a valid Odin32 SDK include dir.\n" \
+	  "      The value of ODINSDK_PATH must point a valid Odin32 SDK dir.\n" \
+	  "      Please check your access to \n" \
+	  "          $(ODINSDK_PATH)/include \n" \
+	  "      and/or check your value of ALT_ODINSDK_PATH.\n" \
+	  "" >> $(ERROR_FILE) ; \
+	fi
+	@if [ ! -r $(ODINSDK_PATH)/lib/odincrt.lib -a \
+	      ! -r $(ODINSDK_PATH)/lib/Release/odincrt.lib ]; then \
+	$(ECHO) "ERROR: You do not have access to a valid Odin32 SDK lib dir.\n" \
+	  "      The value of ODINSDK_PATH must point a valid Odin32 SDK dir.\n" \
+	  "      Please check your access to \n" \
+	  "          $(ODINSDK_PATH)/lib          or \n" \
+	  "          $(ODINSDK_PATH)/lib/Release \n" \
+	  "      and/or check your value of ALT_ODINSDK_PATH.\n" \
+	  "" >> $(ERROR_FILE) ; \
+	fi
+endif
+
+######################################################
 # Check the linker version(s)
 ######################################################
