This version of gdmodule is written assuming you have PNG, JPEG, FreeType, and Xpm libraries incorporated into your copy of GD. If you have an incomplete version you will have difficulty getting this one to build.
Now, for gdmodule, you'll need to do one of two things. You have the option to link the gdmodule into Python itself or to make it dynamically loadable.
python -c 'import
sys;print sys.prefix'
". Once you have determined the install
prefix, then grab the file Makefile.pre.in
from
prefix/lib/python1.5/config.
I have provided a sample of this file, from Python 1.5, but you would do well to copy the one from your build. Also, if you are using Mingw32 (to build for Windows) you are on your own at the moment.
Now that Makefile.pre.in is in the same directory as the gdmodule.c source and Setup.in, edit Setup.in to ensure that the GD library include and lib paths are correct.
Now type "make -f Makefile.pre.in boot; make
". You
should now have a working gdmodule.so. You should be able to
execute the "gddemo.py" script with no errors. Once you have
determined that it's all compiled ok, copy gdmodule.so to
prefix/lib/python1.5/site-packages (you may need to actually
make this directory).
Once you've done that, you'll need to delete the "Setup" file and type "make Setup". Then go up to the main Python directory and type "make install" and you're done. You should now be able to execute the "gddemo.py" script with no errors.# Richard Jones' GD module. gd gdmodule.c -I/usr/local/include -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -lgd -lz -lpng -ljpeg -lttf -lX11 -lXpm