$NetBSD: patch-ah,v 1.5 2013/06/23 17:39:43 jperkin Exp $

DragonFly support.

Disable SunOS multiarch.

--- jdk/make/common/shared/Platform.gmk.orig	2014-01-25 07:34:08.000000000 +0000
+++ jdk/make/common/shared/Platform.gmk
@@ -119,7 +119,7 @@ ifeq ($(SYSTEM_UNAME), SunOS)
     ARCH := $(shell isainfo -n)
     # ISA_DIR is used to locate 64-bit specific libraries which are generally
     # in the same general place as other libraries under the ./$(ARCH) directory
-    ISA_DIR = /$(ARCH)
+    NOMULTIARCHISA_DIR = /$(ARCH)
   endif
   # Need to maintain the jre/lib/i386 location for 32-bit Intel
   ifeq ($(ARCH), i586)
@@ -224,6 +224,13 @@ ifeq ($(SYSTEM_UNAME), Linux)
   MB_OF_MEMORY := $(shell free -m | fgrep Mem: | awk '{print $$2;}' )
 endif
 
+ifeq ($(SYSTEM_UNAME), DragonFly)
+  PLATFORM = bsd
+  OS_NAME = dragonfly
+  OS_VENDOR = DragonFlyBSD
+  REQUIRED_OS_VERSION = 2.4
+endif
+
 ifeq ($(SYSTEM_UNAME), Darwin)
   PLATFORM = macosx
   OS_NAME = darwin
@@ -323,7 +330,11 @@ endif
 ifeq ($(PLATFORM), bsd)
   OS_VERSION := $(shell uname -r)
   # Arch and OS name/version
-  mach := $(shell uname -m)
+  ifdef CROSS_COMPILE_ARCH
+    mach := $(CROSS_COMPILE_ARCH)
+  else
+    mach := $(shell uname -m)
+  endif
   archExpr = case "$(mach)" in \
                 i[3-9]86) \
                     echo i586 \
@@ -349,9 +360,9 @@ ifeq ($(PLATFORM), bsd)
 
   # i586, sparc, and ppc are 32 bit, amd64 and sparc64 are 64
   ifneq (,$(findstring $(ARCH), i586 sparc ppc))
-    ARCH_DATA_MODEL=32
+    ARCH_DATA_MODEL?=32
   else
-    ARCH_DATA_MODEL=64
+    ARCH_DATA_MODEL?=64
   endif
 
   # Need to maintain the jre/lib/i386 location for 32-bit Intel
@@ -371,9 +382,9 @@ ifeq ($(PLATFORM), bsd)
   REQUIRED_FREE_SPACE=1500000
   # How much RAM does this machine have:
   ifeq ($(OS_VENDOR), OpenBSD)
-    MB_OF_MEMORY=$(shell sysctl -n hw.physmem | awk '{print int($$NF / 1048576); }' )
+    MB_OF_MEMORY=$(shell /sbin/sysctl -n hw.physmem | awk '{print int($$NF / 1048576); }' )
   else
-    MB_OF_MEMORY=$(shell (sysctl -n hw.physmem64 2> /dev/null || sysctl -n hw.physmem) | awk '{print int($$NF / 1048576); }' )
+    MB_OF_MEMORY=$(shell (/sbin/sysctl -n hw.physmem64 2> /dev/null || sysctl -n hw.physmem) | awk '{print int($$NF / 1048576); }' )
   endif
 endif
 
