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.
This commit is contained in:
Ronald Oussoren 2009-09-15 18:33:33 +00:00
parent ea7120c7c1
commit 91a11a46c0
1 changed files with 10 additions and 12 deletions

View File

@ -1499,17 +1499,15 @@ 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
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 archs:
for a in detected_archs:
frameworks.append('-arch')
frameworks.append(a)