From cd2f071f0372c0612ff9580e924b9fe4bab67a31 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Wed, 10 Aug 2011 03:21:08 +0000
Subject: [PATCH] Get the architecture from ld rather than uname on OS X.

---
 src/build/Common.gmake | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/build/Common.gmake b/src/build/Common.gmake
index c145c4c026..29ae1ca3b4 100644
--- a/src/build/Common.gmake
+++ b/src/build/Common.gmake
@@ -196,8 +196,13 @@ ifndef os
 endif
 os      :=	$(shell echo $(os) | tr '[A-Z]' '[a-z]' | tr ' ' '_')
 
-machine		:=	$(shell if uname -m | egrep -v "(i[3456789]*|x)86" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; fi)
-machine		:=	$(shell if uname -m | egrep "64" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; else echo $(machine) ; fi)
+ifeq ($(os),darwin)
+ machine		:=	$(shell ld -w 2>&1 | sed -E 's/.*[[:space:]]//')
+else
+ machine		:=	$(shell if uname -m | egrep -v "(i[3456789]*|x)86" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; fi)
+ machine		:=	$(shell if uname -m | egrep "64" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; else echo $(machine) ; fi)
+endif
+
 ifeq ($(machine),x86_64)
  machine	:= x64
 endif
-- 
GitLab