--- openjdk/jdk/make/common/shared/Platform.gmk.orig	2008-10-27 11:44:47.000000000 +0100
+++ openjdk/jdk/make/common/shared/Platform.gmk	2008-10-27 11:52:17.000000000 +0100
@@ -191,6 +191,9 @@
   OS_VERSION := $(shell uname -r)
   # Arch and OS name/version
   mach := $(shell uname -m)
+  ifneq (,$(wildcard /usr/bin/dpkg-architecture))
+    mach := $(shell (dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null || echo $(mach)) | sed 's/powerpc$$/ppc/;s/hppa/parisc/')
+  endif
   archExpr = case "$(mach)" in \
                 i[3-9]86) \
                     echo i586 \
--- openjdk/corba/make/common/shared/Platform.gmk.orig	2008-10-27 11:44:47.000000000 +0100
+++ openjdk/corba/make/common/shared/Platform.gmk	2008-10-27 11:53:01.000000000 +0100
@@ -181,6 +181,9 @@
   OS_VERSION := $(shell uname -r)
   # Arch and OS name/version
   mach := $(shell uname -m)
+  ifneq (,$(wildcard /usr/bin/dpkg-architecture))
+    mach := $(shell (dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null || echo $(mach)) | sed 's/powerpc$$/ppc/;s/hppa/parisc/')
+  endif
   archExpr = case "$(mach)" in \
                 i[3-9]86) \
                     echo i586 \
