diff Lib/distutils/util.py @ 55975:ab4a87fef1ae 3.1

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) ........ ................
author Ronald Oussoren <ronaldoussoren@mac.com>
date Tue, 15 Sep 2009 19:16:40 +0000
parents 89dea3df4cb5
children a3cb812d80f9
line wrap: on
line diff
--- a/Lib/distutils/util.py	Tue Sep 15 19:11:53 2009 +0000
+++ b/Lib/distutils/util.py	Tue Sep 15 19:16:40 2009 +0000
@@ -141,11 +141,26 @@
                 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.