Index: /trunk/openjdk/jdk/make/common/Defs-os2.gmk
===================================================================
--- /trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 7)
+++ /trunk/openjdk/jdk/make/common/Defs-os2.gmk	(revision 7)
@@ -0,0 +1,125 @@
+#
+# 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.
+#
+# WARNING: This file is shared with other workspaces.
+#          So when it includes other files, it must use JDK_TOPDIR.
+#
+
+# Get shared JDK settings
+include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
+
+HPIS = os2
+
+# 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
+
+ifndef PLATFORM_SRC
+  PLATFORM_SRC  = $(BUILDDIR)/../src/os2
+endif # PLATFORM_SRC
+
+# Platform specific closed sources
+ifndef OPENJDK
+  ifndef CLOSED_PLATFORM_SRC
+    CLOSED_PLATFORM_SRC  = $(BUILDDIR)/../src/closed/os2
+  endif
+endif
+
+# for backwards compatability, the old "win32" is used here instead of
+# the more proper "windows"
+PLATFORM_INCLUDE_NAME = os2
+PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
+
+# C Compiler flag definitions
+
+#
+# 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)
+
+#
+# Treat compiler warnings as errors, if warnings not allowed
+#
+ifeq ($(COMPILER_WARNINGS_FATAL),true)
+  GCC_WARNINGS += -Werror
+endif
+
+#
+# Preprocessor macro definitions
+#
+
+#
+# Output options (use specific filenames to avoid parallel compile errors)
+#
+
+#
+# Path and option to link against the VM, if you have to.
+#
+JVMLIB = $(LIBDIR)/jvm.lib
+JAVALIB = $(LIBDIR)/java.lib
+
+LIBRARY_SUFFIX = dll
+LIB_SUFFIX     = lib
+
+# Settings for the JDI - Serviceability Agent binding.
+HOTSPOT_SALIB_PATH   = $(HOTSPOT_IMPORT_PATH)/jre/bin
+SALIB_NAME = $(LIB_PREFIX)sawindbg.$(LIBRARY_SUFFIX)
+SAMAP_NAME = $(LIB_PREFIX)sawindbg.map
+
+# SA is not supported so far.
+INCLUDE_SA = false
+
Index: /trunk/openjdk/jdk/make/common/shared/Compiler.gmk
===================================================================
--- /trunk/openjdk/jdk/make/common/shared/Compiler.gmk	(revision 6)
+++ /trunk/openjdk/jdk/make/common/shared/Compiler.gmk	(revision 7)
@@ -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/jdk/make/common/shared/Defs-os2.gmk
===================================================================
--- /trunk/openjdk/jdk/make/common/shared/Defs-os2.gmk	(revision 7)
+++ /trunk/openjdk/jdk/make/common/shared/Defs-os2.gmk	(revision 7)
@@ -0,0 +1,63 @@
+#
+# 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.
+#    (This may not be working on windows yet, always force to false.)
+override INCREMENTAL_BUILD = false
+
+# 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
+
Index: /trunk/openjdk/jdk/make/common/shared/Platform.gmk
===================================================================
--- /trunk/openjdk/jdk/make/common/shared/Platform.gmk	(revision 6)
+++ /trunk/openjdk/jdk/make/common/shared/Platform.gmk	(revision 7)
@@ -73,5 +73,5 @@
 #     LIBARCH32                   solaris only: sparc or i386
 #     LIBARCH64                   solaris only: sparcv9 or amd64
-#     REQUIRED_WINDOWS_VERSION    windows only: specific version of windows 
+#     REQUIRED_WINDOWS_VERSION    windows only: specific version of windows
 #     USING_CYGWIN                windows only: true or false
 #     WINDOWS_NT_VERSION_STRING   windows only: long version name
@@ -86,5 +86,5 @@
 #     REQUIRED_LINUX_FULLVER      linux only: required full version of linux
 #     REQUIRED_ALSA_VERSION       linux only: required version of ALSA
-#     REQUIRED_FREETYPE_VERSION   openjdk only: required version of freetype 
+#     REQUIRED_FREETYPE_VERSION   openjdk only: required version of freetype
 
 SYSTEM_UNAME := $(shell uname)
@@ -174,5 +174,5 @@
     REQUIRED_OS_VERSION = 5.8
   endif
-  # Minimum disk space needed as determined by running 'du -sk' on 
+  # Minimum disk space needed as determined by running 'du -sk' on
   #    a fully built workspace.
   ifeq ($(ARCH_FAMILY), sparc)
@@ -250,5 +250,5 @@
   # Suffix for file bundles used in previous release
   BUNDLE_FILE_SUFFIX=.tar.gz
-  # Minimum disk space needed as determined by running 'du -sk' on 
+  # Minimum disk space needed as determined by running 'du -sk' on
   #    a fully built workspace.
   REQUIRED_FREE_SPACE=1460000
@@ -372,5 +372,5 @@
   # Suffix for file bundles used in previous release
   BUNDLE_FILE_SUFFIX=.tar
-  # Minimum disk space needed as determined by running 'du -sk' on 
+  # Minimum disk space needed as determined by running 'du -sk' on
   #    a fully built workspace.
   REQUIRED_FREE_SPACE=500000
@@ -389,4 +389,55 @@
       echo "512"; \
     fi)
+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
 endif
 
@@ -427,5 +478,5 @@
 
 # Unix type settings (same for all unix platforms)
-ifneq ($(PLATFORM), windows)
+ifneq ($(filter-out windows os2, $(PLATFORM)),)
   # Temporary disk area
   TEMP_DISK=/tmp
@@ -433,5 +484,5 @@
   DEV_NULL = /dev/null
   export DEV_NULL
-  # Character used between entries in classpath 
+  # Character used between entries in classpath
   CLASSPATH_SEPARATOR = :
   # suffix used for object file (.o for unix .obj for windows)
