diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2009-09-15 18:47:35 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2009-09-15 18:47:35 (GMT) |
commit | c6ddd7f9a7f6cfa06e6afc16d1cc300f8ac53a7c (patch) | |
tree | dca35b269541116ccfe49f9f0e3cfb34c47b8db9 /setup.py | |
parent | 0d28764d3dbc41c1398812c5a7739c61579e3fd8 (diff) | |
download | cpython-c6ddd7f9a7f6cfa06e6afc16d1cc300f8ac53a7c.zip cpython-c6ddd7f9a7f6cfa06e6afc16d1cc300f8ac53a7c.tar.gz cpython-c6ddd7f9a7f6cfa06e6afc16d1cc300f8ac53a7c.tar.bz2 |
Merged revisions 74798 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74798 | ronald.oussoren | 2009-09-15 20:33:33 +0200 (Tue, 15 Sep 2009) | 8 lines
MacOSX: detect the architectures supported by
Tk.framework and build _tkinter only for those
architectures.
This replaces the hardcoded solution that is no
longer valid now that 64-bit capable versions of
Tk are available on OSX.
........
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -1501,19 +1501,17 @@ class PyBuildExt(build_ext): # architectures. cflags = sysconfig.get_config_vars('CFLAGS')[0] archs = re.findall('-arch\s+(\w+)', cflags) - if 'x86_64' in archs or 'ppc64' in archs: - try: - archs.remove('x86_64') - except ValueError: - pass - try: - archs.remove('ppc64') - except ValueError: - pass - - for a in archs: - frameworks.append('-arch') - frameworks.append(a) + fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(F,)) + detected_archs = [] + for ln in fp: + a = ln.split()[-1] + if a in archs: + detected_archs.append(ln.split()[-1]) + fp.close() + + for a in detected_archs: + frameworks.append('-arch') + frameworks.append(a) ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], define_macros=[('WITH_APPINIT', 1)], |