Mailing List Archive

Help! PIL compiled into Tkinter in 1.5.2 (Tricky Bits!)
I'm trying to compile PIL (1.0b1) into the _tkinter module in 1.5.2's
Modules/Setup config file under Digital Unix 4.0d (from source on all
counts).

Since it might matter, I'm trying to do this under VPATH control from an
architecture-specific directory, where configure was run as:
<path to Python-1.5.2>/configure

I unpacked the 1.5.2 source into its own directory, separate from
/usr/local/lib/python-1.5, where I have the installation proper.

The Setup.in file lists the following 2 lines:
# *** Uncomment and edit for PIL (TkImaging) extension only:
# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \

Since the 1.5.2 source is living in its own pristine directory, and in
particular *has* no Extensions subdirectory, what is the proper way to
configure the above two lines in my architecture-specific Modules/Setup,
if I want to have PIL/TkImaging built in?

Things I've tried, and failed:

* Building PIL in-place, under a hand-built Extensions subdirectory of
the pristine 1.5.2 source directory.

* Hardwiring the path in Setup to my *old* PIL installation, found under
my 1.5.1 Extensions subdirectory. (I never managed to figure this out for
1.5.1 either, and so PIL isn't married to _tkinter in my 1.5.1 installaion
either)

* Slapping John Cleese on the side of his head with a large dead fish,
next to a canal, while dressed in Pith Helmet, Khaki shorts, and Khaki
shirt. (Ok, Ok, not really, but then, nobody expects the Spanish
Inquisition!)

Any help would be much appreciated!

Cheers,
Frank Horowitz

--
Frank Horowitz; frank@ned.dem.csiro.au
CSIRO Exploration & Mining/AGCRC; Perth, AUSTRALIA
Help! PIL compiled into Tkinter in 1.5.2 (Tricky Bits!) [ In reply to ]
frank <frank@ned.dem.csiro.au> wrote:
> The Setup.in file lists the following 2 lines:
> # *** Uncomment and edit for PIL (TkImaging) extension only:
> # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \

1. unpack Imaging-1.0b1.tar.gz on the same level as
you unpacked Python.

$ ls -l
drwxr-xr-x 8 eff effie 1024 Mar 29 11:11 Imaging-1.0b1
drwxr-xr-x 15 eff effie 1024 Mar 25 12:54 Python-1.5.2b2
drwxr-xr-x 14 eff effie 512 Mar 25 10:32 tcl8.0.5
drwxr-xr-x 16 eff effie 512 Mar 25 10:40 tk8.0.5

2. build a standard version of Python (preferrably with dynamically
loaded extensions)

3. build PIL according to the instructions in Imaging-1.0b1/README.

4. in Python-1.5.2/Modules/Setup, change the Tkinter
section to something like (this assumes that you've

# *** Always uncomment this (leave the leading underscore in!):
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-I/usr/local/include \
# *** Uncomment and edit to reflect where your X11 header files are:
-I/usr/include/X11 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
-DWITH_PIL -I../../Imaging-1.0b1/libImaging ../../Imaging-1.0b1/Tk/tkImaging.c \
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
-L/usr/local/lib \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
-ltk8.0 -ltcl8.0 \
# *** Uncomment and edit to reflect where your X11 libraries are:
-L/usr/lib \
# *** Always uncomment this; X11 libraries to link with:
-lX11

5. rebuild Python.

(works for me, at least)

</F>