Commit 3c0aa7e7 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

[Patch #850977] Detect Tcl/Tk libraries on FreeBSD/OpenBSD. Bugfix candidate

parent e240d9bc
...@@ -973,17 +973,25 @@ class PyBuildExt(build_ext): ...@@ -973,17 +973,25 @@ class PyBuildExt(build_ext):
# Now check for the header files # Now check for the header files
if tklib and tcllib: if tklib and tcllib:
# Check for the include files on Debian, where # Check for the include files on Debian and {Free,Open}BSD, where
# they're put in /usr/include/{tcl,tk}X.Y # they're put in /usr/include/{tcl,tk}X.Y
debian_tcl_include = [ '/usr/include/tcl' + version ] dotversion = version
debian_tk_include = [ '/usr/include/tk' + version ] + \ if '.' not in dotversion and "bsd" in sys.platform.lower():
debian_tcl_include # OpenBSD and FreeBSD use Tcl/Tk library names like libtcl83.a,
tcl_includes = find_file('tcl.h', inc_dirs, debian_tcl_include) # but the include subdirs are named like .../include/tcl8.3.
tk_includes = find_file('tk.h', inc_dirs, debian_tk_include) dotversion = dotversion[:-1] + '.' + dotversion[-1]
tcl_include_sub = []
tk_include_sub = []
for dir in inc_dirs:
tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
tk_include_sub += [dir + os.sep + "tk" + dotversion]
tk_include_sub += tcl_include_sub
tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
if (tcllib is None or tklib is None or if (tcllib is None or tklib is None or
tcl_includes is None or tk_includes is None): tcl_includes is None or tk_includes is None):
# Something's missing, so give up self.announce("INFO: Can't locate Tcl/Tk libs and/or headers", 2)
return return
# OK... everything seems to be present for Tcl/Tk. # OK... everything seems to be present for Tcl/Tk.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment