How to disable tk inclusion in py build

venkatbo at yahoo.com venkatbo at yahoo.com
Thu Jun 29 12:27:05 EDT 2006


> I'd like to disable the inclusion of tk graphics lib in my py build.
> Looked around but couldn't find a clear answer. Which one of
> the following would I need to use in the configure step:
>   --disable-tkbuild
>   --without-tk

In case anyone is intereted, as it turns out, one way of achieving
this is to disable the following statement in python's setup.py:
    self.detect_tkinter(inc_dirs, lib_dirs)
of
    def detect_modules(self):
This will ignore the compilation of _tkinter.c and tkappinit.c of
the python distribution.

This will totally skip the detection and inclusion of tk/tcl into
the "built-in" pkg, irrespective of its presence on the buildbox.
This will also work in the case of cross-compile builds of python.
In the cross-compile case, there is a likelihood of the build process
attempting to pick tk/tcl lib files from the buildbox (platform) and
using it wrongly for the different target platform.

In addition, one would also have to skip the inclusion of the
    python2.x/Lib/lib-tk/*.py
files in the final dist. Just this exclusion is not enuff, the earlier
detection step change is also needed to prevent all the buildtime
errors.

Thanks,
/venkat




More information about the Python-list mailing list