setup.py breaks Modules/Setup.local
Mike Romberg
romberg at smaug.fsl.noaa.gov
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 setup.py. 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
setup.py does not find. It looks like this:
# Edit this file for local setup changes
*shared*
_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 \
-lX11
# 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
*static*
Now when I build python I see this:
1. _tkinter.o is built with the -I switches I want (this is good)
2. _tkinter.so is linked with the -L switches I want (also good)
3. setup.py runs and relinks _tkinter.so 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/_tkinter.so
case $MAKEFLAGS in \
*-s*) CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build;; \
*) CC='gcc' LDSHARED='gcc -shared' OPT='-DNDEBUG -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py build;; \
esac
running build
running build_ext
[snip]
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/_tkinter.so
Is there some way to prevent this? Or is there something that I'm
not doing correctly?
Thanks,
Mike Romberg (romberg at fsl.noaa.gov)
More information about the Python-list
mailing list