$OpenBSD: patch-corba_make_common_shared_Platform_gmk,v 1.2 2008/03/21 02:46:43 kurt Exp $
--- corba/make/common/shared/Platform.gmk.orig	Sat Dec  1 00:00:00 2007
+++ corba/make/common/shared/Platform.gmk	Thu Mar 20 09:05:23 2008
@@ -262,6 +262,73 @@ ifeq ($(SYSTEM_UNAME), Linux)
   MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2)
 endif
 
+ifeq ($(SYSTEM_UNAME), FreeBSD)
+  PLATFORM = bsd
+  OS_NAME = freebsd
+  OS_VENDOR = FreeBSD
+ REQUIRED_OS_VERSION = 6.0
+endif
+
+ifeq ($(SYSTEM_UNAME), NetBSD)
+  PLATFORM = bsd
+  OS_NAME = netbsd
+  OS_VENDOR = NetBSD
+  REQUIRED_OS_VERSION = 3.0
+endif
+
+ifeq ($(SYSTEM_UNAME), OpenBSD)
+  PLATFORM = bsd
+  OS_NAME = openbsd
+  OS_VENDOR = OpenBSD
+  REQUIRED_OS_VERSION = 4.2
+endif
+
+# Platform settings specific to BSD
+ifeq ($(PLATFORM), bsd)
+  OS_VERSION := $(shell uname -r)
+  # Arch and OS name/version
+  mach := $(shell uname -m)
+  archExpr = case "$(mach)" in \
+                i[3-9]86) \
+                    echo i586 \
+                    ;; \
+                *) \
+                    echo $(mach) \
+                    ;; \
+      esac
+  ARCH        := $(shell $(archExpr) )
+  ARCH_FAMILY := $(ARCH)
+
+  # i586 and sparc are 32 bit, amd64 and sparc64 are 64
+  ifneq (,$(findstring $(ARCH), i586 sparc))
+    ARCH_DATA_MODEL=32
+  else
+    ARCH_DATA_MODEL=64
+  endif
+
+  # Need to maintain the jre/lib/i386 location for 32-bit Intel
+  ifeq ($(ARCH), i586)
+    LIBARCH = i386
+  else
+    LIBARCH = $(ARCH)
+  endif
+
+  # Value of Java os.arch property
+  ARCHPROP  = $(LIBARCH)
+
+  # Suffix for file bundles used in previous release
+  BUNDLE_FILE_SUFFIX=.tar.gz
+  # Minimum disk space needed as determined by running 'du -sk' on 
+  #    a fully built workspace.
+  REQUIRED_FREE_SPACE=1500000
+  # How much RAM does this machine have:
+  ifeq ($(OS_VENDOR), OpenBSD)
+    MB_OF_MEMORY=$(shell perl -e 'printf "%d", `sysctl hw.physmem | cut -d'=' -f2` / 1048576' )
+  else
+    MB_OF_MEMORY := $(shell `sysctl hw.physmem | cut -d' ' -f2` / 1048576 )
+  endif
+endif
+
 # Windows with and without CYGWIN will be slightly different
 ifeq ($(SYSTEM_UNAME), Windows_NT)
   PLATFORM = windows
@@ -373,7 +440,7 @@ endif
 #    build machines and adjustments will be made to prevent excessing
 #    system swapping during the build.
 #    If we don't know, assume 512. Subtract 128 from MB for VM MAX.
-#    Don't set VM max over 1024-128=896.
+#    Don't set VM max over 864-128=736.
 ifneq ($(MB_OF_MEMORY),)
   LOW_MEMORY_MACHINE := $(shell \
     if [ $(MB_OF_MEMORY) -le 512 ] ; then \
@@ -382,10 +449,10 @@ ifneq ($(MB_OF_MEMORY),)
       echo "false"; \
     fi)
   MAX_VM_MEMORY := $(shell \
-    if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
+    if [ $(MB_OF_MEMORY) -le 864 ] ; then \
       expr $(MB_OF_MEMORY) '-' 128 ; \
     else \
-      echo "896"; \
+      echo "736"; \
     fi)
   MIN_VM_MEMORY := $(shell \
     if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
