breaks Modules/Setup.local

Mike Romberg romberg at
Wed Jun 12 12:31:45 EDT 2002

  I am attempting to get Modules/Setup.local working to build python
2.2.1.  But there seems to be a bad interaction with  I have
a Modules/Setup.local which contains a definition for the _tkinter
module.  I would like to use a Tcl/Tk release from a location that does not find.  It looks like this:

# Edit this file for local setup changes

_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
        -L/usr/local/tcltk-8.3.2/lib \
        -I/usr/local/tcltk-8.3.2/include \
        -I/usr/X11R6/include \
        -ltk8.3 -ltcl8.3 \
        -L/usr/X11R6/lib \

# We don't want ssl sockets 'cause this opens
# up a whole can of DLL heck (often missing on stock redhat setups).
_socket socketmodule.c


  Now when I build python I see this:

  1.  _tkinter.o is built with the -I switches I want (this is good)

  2. is linked with the -L switches I want (also good)

  3. runs and relinks with the incorrect -L
     switches.  (not good)

gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H  -DWITH_APPINIT -I/usr/local/tcltk-8.3.2/include -I/usr/X11R6/include -c ./Modules/_tkinter.c -o Modules/_tkinter.o
gcc -shared  Modules/_tkinter.o Modules/tkappinit.o  -L/usr/local/tcltk-8.3.2/lib -ltk8.3 -ltcl8.3 -L/usr/X11R6/lib -lX11  -o Modules/
case $MAKEFLAGS in \
*-s*) CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./ -q build;; \
*) CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./ build;; \
running build
running build_ext


building '_tkinter' extension
skipping /scratch/Python-2.2.1/Modules/_tkinter.c (build/temp.linux-i686-2.2/_tkinter.o up-to-date)
skipping /scratch/Python-2.2.1/Modules/tkappinit.c (build/temp.linux-i686-2.2/tkappinit.o up-to-date)
gcc -shared build/temp.linux-i686-2.2/_tkinter.o build/temp.linux-i686-2.2/tkappinit.o -L/usr/X11R6/lib -L/usr/local/lib -ltk8.3 -ltcl8.3 -lX11 -o build/lib.linux-i686-2.2/

  Is there some way to prevent this?  Or is there something that I'm
not doing correctly?


Mike Romberg (romberg at


More information about the Python-list mailing list