From d8e6685dcc9ec4922a73c272972da070844158f0 Mon Sep 17 00:00:00 2001
From: Torsten Maehne <Torsten.Maehne@gmx.de>
Date: Tue, 30 Apr 2013 18:21:36 +0200
Subject: [PATCH] Fix detection of powerpc64 on Darwin in lib/config.guess.

On Darwin (OS X) `uname -p' returns powerpc even if the CPU and OS are 64-bit-capable. This problem has been already observed and resolved for the x86 platform. The same fix works on the powerpc platform.
---
 lib/config.guess | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/config.guess b/lib/config.guess
index 2055429..a2726ac 100755
--- a/lib/config.guess
+++ b/lib/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2013-04-24'
+timestamp='2013-04-30'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -1255,7 +1255,17 @@ EOF
 		      UNAME_PROCESSOR="x86_64"
 		  fi
 		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
+	    powerpc | unknown)
+		UNAME_PROCESSOR=powerpc
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		      grep IS_64BIT_ARCH >/dev/null
+		  then
+		      UNAME_PROCESSOR="powerpc64"
+		  fi
+		fi ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
-- 
1.8.2.2

