[pypy-commit] pypy default: Pick the first of /usr/include/tcl{, 8.6, 8.5} that exists, and select the

arigo noreply at buildbot.pypy.org
Tue Apr 7 11:26:10 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r76732:394dd8a2203a
Date: 2015-04-07 11:26 +0200
http://bitbucket.org/pypy/pypy/changeset/394dd8a2203a/

Log:	Pick the first of /usr/include/tcl{,8.6,8.5} that exists, and select
	the libraries to link with by appending the same version number.

diff --git a/lib_pypy/_tkinter/tklib.py b/lib_pypy/_tkinter/tklib.py
--- a/lib_pypy/_tkinter/tklib.py
+++ b/lib_pypy/_tkinter/tklib.py
@@ -135,9 +135,12 @@
     linklibs = ['tcl', 'tk']
     libdirs = []
 else:
-    incdirs=['/usr/include/tcl', '/usr/include/tcl8.6', '/usr/include/tcl8.5']
-    linklibs=['tcl', 'tk']
-    libdirs = []
+    for _ver in ['', '8.6', '8.5', '']:
+        incdirs = ['/usr/include/tcl' + _ver]
+        linklibs = ['tcl' + _ver, 'tk' + _ver]
+        libdirs = []
+        if os.path.isdir(incdirs[0]):
+            break
 
 tklib = tkffi.verify("""
 #include <tcl.h>


More information about the pypy-commit mailing list