aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-05-08 20:45:29 -0700
committerPatrick Walton <[email protected]>2011-05-08 21:10:42 -0700
commitf8514d95d07e48f766ee7a4b8d65d5d5256466f6 (patch)
tree44c7f1ff9425c18b0e46b0948a1feca8e2acffb2 /configure
parentrustc: Stop emitting zero-length arrays (diff)
downloadrust-f8514d95d07e48f766ee7a4b8d65d5d5256466f6.tar.xz
rust-f8514d95d07e48f766ee7a4b8d65d5d5256466f6.zip
build: `uname -m` is a lie on 64-bit Darwin. Add a workaround.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure b/configure
index 79175dd7..897209a3 100755
--- a/configure
+++ b/configure
@@ -127,7 +127,17 @@ need_cmd sed
msg "inspecting environment"
CFG_OSTYPE=$(uname -s)
+
CFG_CPUTYPE=$(uname -m)
+if [ $CFG_OSTYPE = Darwin -a $CFG_CPUTYPE = i386 ]
+then
+ # Darwin's `uname -s` lies and always returns i386. We have to use sysctl
+ # instead.
+ if sysctl hw.optional.x86_64 | grep ': 1'
+ then
+ CFG_CPUTYPE=x86_64
+ fi
+fi
CFG_SELF=$(echo $0 | tr '\\' '/')
CFG_SRC_DIR=${CFG_SELF%${CFG_SELF##*/}}