summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setup.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/setup.py b/setup.py
index 62f61d6..38b24e7 100644
--- a/setup.py
+++ b/setup.py
@@ -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)],