summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/util.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2009-12-24 13:06:39 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2009-12-24 13:06:39 (GMT)
commit728cc6110faa6e43baad195303e14fe6f97aea02 (patch)
tree8d1655c58a31e0f83f0fa87fd72a7f769b1acaab /Lib/distutils/util.py
parent9c236bfb9ff9a076eb6047a89286d0d9f701048a (diff)
downloadcpython-728cc6110faa6e43baad195303e14fe6f97aea02.zip
cpython-728cc6110faa6e43baad195303e14fe6f97aea02.tar.gz
cpython-728cc6110faa6e43baad195303e14fe6f97aea02.tar.bz2
On OSX the output of "uname -m" always reflects the 32-bit architecture
for the machine ("i386" or "ppc"), even if the executable is 64-bit. This patchs ensures that the distutils platform architecture represents the architecture for the executable when running a 64-bit only executable on OSX.
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r--Lib/distutils/util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index b8e4952..f4bb063 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -165,11 +165,21 @@ def get_platform():
raise ValueError(
"Don't know machine value for archs=%r"%(archs,))
+ elif machine == 'i386':
+ # On OSX the machine type returned by uname is always the
+ # 32-bit variant, even if the executable architecture is
+ # the 64-bit variant
+ if sys.maxint >= 2**32:
+ machine = 'x86_64'
elif machine in ('PowerPC', 'Power_Macintosh'):
# Pick a sane name for the PPC architecture.
machine = 'ppc'
+ # See 'i386' case
+ if sys.maxint >= 2**32:
+ machine = 'ppc64'
+
return "%s-%s-%s" % (osname, release, machine)