Skip to contentSkip to conversation

Darwin: Check for x86_64 only on i386

PATCH New Alexander Graf 1 participant 1 message Feb 22, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Darwin: Check for x86_64 only on i386

The sysctl variable if we're 64-bit capable only exists on i386. So we should only check it if we're on i386.

This suppresses a warning on PowerPC spotted by Andreas Faerber.

---
 configure |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
configure +3 -3
index c3fbbbe..62925d8 100755
@@ -244,9 +244,9 @@ Darwin)
 bsd="yes"
 darwin="yes"
 # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code
-is_x86_64=`sysctl -n hw.optional.x86_64`
-if [ "$is_x86_64" = "1" ]; then
-    cpu=x86_64
+if [ "$cpu" = "i386" ] ; then
+    is_x86_64=`sysctl -n hw.optional.x86_64`
+    [ "$is_x86_64" = "1" ] && cpu=x86_64
 fi
 if [ "$cpu" = "x86_64" ] ; then
     OS_CFLAGS="-arch x86_64"
Signature · 1 line
1.5.3.1