Skip to content

Commit

Permalink
build: uname -m is a lie on 64-bit Darwin. Add a workaround.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed May 9, 2011
1 parent 106216d commit f8514d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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##*/}}
Expand Down

0 comments on commit f8514d9

Please sign in to comment.