summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/util.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index 28337fa..042306e 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -99,7 +99,11 @@ def get_platform ():
if not macver:
macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET')
- if not macver:
+ if 1:
+ # Always calculate the release of the running machine,
+ # needed to determine if we can build fat binaries or not.
+
+ macrelease = macver
# Get the system version. Reading this plist is a documented
# way to get the system version (see the documentation for
# the Gestalt Manager)
@@ -115,16 +119,18 @@ def get_platform ():
r'<string>(.*?)</string>', f.read())
f.close()
if m is not None:
- macver = '.'.join(m.group(1).split('.')[:2])
+ macrelease = '.'.join(m.group(1).split('.')[:2])
# else: fall back to the default behaviour
+ if not macver:
+ macver = macrelease
+
if macver:
from distutils.sysconfig import get_config_vars
release = macver
osname = "macosx"
-
- if (release + '.') >= '10.4.' and \
+ if (macrelease + '.') >= '10.4.' and \
'-arch' in get_config_vars().get('CFLAGS', '').strip():
# The universal build will build fat binaries, but not on
# systems before 10.4
@@ -133,9 +139,13 @@ def get_platform ():
# 'universal' instead of 'fat'.
machine = 'fat'
+ cflags = get_config_vars().get('CFLAGS')
- if '-arch x86_64' in get_config_vars().get('CFLAGS'):
- machine = 'universal'
+ if '-arch x86_64' in cflags:
+ if '-arch i386' in cflags:
+ machine = 'universal'
+ else:
+ machine = 'fat64'
elif machine in ('PowerPC', 'Power_Macintosh'):
# Pick a sane name for the PPC architecture.