GD/gdmodule on Win XP

Kevin Dahlhausen kdahlhaus at yahoo.com
Tue Feb 3 15:16:53 EST 2004


I just went through a similar process in getting a native 2.3 version
of the jpgraph charting library to build on windows.   While not
exactly, the same, I hope these notes will help you out.

Things build fairly straightforward using MINGW and MINSYS to build
the python extentions.   The process is went like this:

Install MINGW and MINSYS

Run dll tool on Python23 to make libpython23.a: 
[from: http://sebsauvage.net/python/mingw.html)
pexports python23.dll > python23.def
(get it from http://starship.python.net/crew/kernr/mingw32/pexports-0.42h.zip)
dlltool --dllname python23.dll --def python23.def --output-lib
libpython23.a
Copy libpython23.a to c:\python23\libs\
]


Then for each module, one at a time, perform the following sequence:

Untar the source archive.
Open a minsys window and do a compile.  Config generally works when
they have them.  Other changes are to add the python include dir to
CFLAGS and to add python23 to the linker libs and the python 'libs'
dir to the LD library path.
Copy all the resulting "lib*.a" files to C:\mingw\lib (adjusting for
your installation of course!).
Inspect the makefile install target to determine what ".h" files
should be copied.  Copy these over to c:\mingw\include.
For python modules, copy the .pyd files to your python home
\lib\site-packages directory.

After some trial and error, I found I had to build the modules in the
following order:

freetype-2.1.5
zlib-1.2.1
libpng-1.2.5
jpeg-6b
gd-1.8.4
gdmodule-0.26
jpgraph-1.5.3

I'm sure there's room for improvement, for example make install might
have worked.  I didn't really care about the amount of manual copying
in this process as I just wanted the resulting python library.



More information about the Python-list mailing list