Can't seem to build python against custom tcl/tk

Russell E. Owen rowen at u.washington.edu
Wed Aug 13 20:41:45 CEST 2008


I'm trying to build a non-framework python on MacOS X 10.5 using a 
custom tcl/tk that lives in an arbitrary directory. (For complicated 
reasons we don't want the system tcl/tk). It is easy to build an X11 
tcl/tk this way (and we are content with X11) so I did that.

Unfortunately I can't seem to build Python in such a way that it sees 
this tcl/tk.

The only documented way to do this I found was to edit Modules/Setup or 
Setup.local, so I did the following:
$ /configure --prefix=/Users/rowen/TestBuild/pythonroot/ 
--disable-framework
Edit Modules/Setup.local to add this text (based on comments in 
Modules/Setup):
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
  -L/Users/rowen/TestBuild/tcltkroot/lib \
  -I/Users/rowen/TestBuild/tcltkroot/include \
  -ltk8.4 -ltcl8.4 \
  -I/usr/X11R6/include \
  -L/usr/X11R6/lib \
  -lX11
$ make
$ make install

This builds, but the resulting python is missing the _tkinter library.

I tried setting CFLAGS:
$ export CFLAGS="-I/Users/rowen/TestBuild/tcltkroot/include 
-L/Users/rowen/TestBuild/tcltkroot/bin"
before running configure, but that didn't help.

So...any advice? Any obvious mistake? (I did double-check each path in 
the text I added to Setup.local) Is there some way to convince configure 
to use my tcl/tk (that would potentially be simpler than editing 
Modules/Setup.local).

-- Russell



More information about the Python-list mailing list