summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2009-09-15 19:16:40 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2009-09-15 19:16:40 (GMT)
commit6b084241e8994903372520391b6732332be27cda (patch)
tree68475381f17306b83b30bc5111b8a19b318b8e82
parent38a4d8cec24136fd4ba2fec3b0e50ea77ec938fd (diff)
downloadcpython-6b084241e8994903372520391b6732332be27cda.zip
cpython-6b084241e8994903372520391b6732332be27cda.tar.gz
cpython-6b084241e8994903372520391b6732332be27cda.tar.bz2
Merged revisions 74808 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r74808 | ronald.oussoren | 2009-09-15 21:16:02 +0200 (Tue, 15 Sep 2009) | 10 lines Merged revisions 74806 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74806 | ronald.oussoren | 2009-09-15 21:13:15 +0200 (Tue, 15 Sep 2009) | 3 lines Finish support for --with-universal-archs=intel and --with-universal-archs=3-way (issue6245) ........ ................
-rw-r--r--Doc/distutils/apiref.rst7
-rw-r--r--Lib/distutils/util.py25
2 files changed, 26 insertions, 6 deletions
diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst
index 6438257..af19111 100644
--- a/Doc/distutils/apiref.rst
+++ b/Doc/distutils/apiref.rst
@@ -1095,7 +1095,10 @@ other utility module.
the univeral binary status instead of the architecture of the current
processor. For 32-bit universal binaries the architecture is ``fat``,
for 64-bit universal binaries the architecture is ``fat64``, and
- for 4-way universal binaries the architecture is ``universal``.
+ for 4-way universal binaries the architecture is ``universal``. Starting
+ from Python 2.7 and Python 3.2 the architecture ``fat3`` is used for
+ a 3-way universal build (ppc, i386, x86_64) and ``intel`` is used for
+ a univeral build with the i386 and x86_64 architectures
Examples of returned values on Mac OS X:
@@ -1105,6 +1108,8 @@ other utility module.
* ``macosx-10.5-universal``
+ * ``macosx-10.6-intel``
+
.. % XXX isn't this also provided by some other non-distutils module?
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index 4c1956a..5054d0c 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -141,11 +141,26 @@ def get_platform ():
machine = 'fat'
cflags = get_config_vars().get('CFLAGS')
- if '-arch x86_64' in cflags:
- if '-arch i386' in cflags:
- machine = 'universal'
- else:
- machine = 'fat64'
+ archs = re.findall('-arch\s+(\S+)', cflags)
+ archs.sort()
+ archs = tuple(archs)
+
+ if len(archs) == 1:
+ machine = archs[0]
+ elif archs == ('i386', 'ppc'):
+ machine = 'fat'
+ elif archs == ('i386', 'x86_64'):
+ machine = 'intel'
+ elif archs == ('i386', 'ppc', 'x86_64'):
+ machine = 'fat3'
+ elif archs == ('ppc64', 'x86_64'):
+ machine = 'fat64'
+ elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'):
+ machine = 'universal'
+ else:
+ raise ValueError(
+ "Don't know machine value for archs=%r"%(archs,))
+
elif machine in ('PowerPC', 'Power_Macintosh'):
# Pick a sane name for the PPC architecture.