diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2009-09-15 19:13:15 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2009-09-15 19:13:15 (GMT) |
commit | 5d90029041bd3ef4e5e1009b8fd741719283b928 (patch) | |
tree | 6f59a35f879f258e221cf5754e4f8b688e224800 /Lib/distutils/util.py | |
parent | 038f38d3ac8e9c671b18ce6b17f3a408503b3fe9 (diff) | |
download | cpython-5d90029041bd3ef4e5e1009b8fd741719283b928.zip cpython-5d90029041bd3ef4e5e1009b8fd741719283b928.tar.gz cpython-5d90029041bd3ef4e5e1009b8fd741719283b928.tar.bz2 |
Finish support for --with-universal-archs=intel
and --with-universal-archs=3-way (issue6245)
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r-- | Lib/distutils/util.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 459c3646..fe6851c 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -144,11 +144,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. |