SDL_image and mingw32

Has anyone managed to successfully compile sdl, sdl_image and the relevant
dependencies (zlib, libpng and libjpeg) on MinGW as DLLs? I’ve spent the best
part of two days trying to get everything working, and all I’ve managed to do
is waste 100MB of hard drive space.
Ordinarily I’d use the binaries from, but the PNG loader seems
to be bugged - if I try and load a PNG onto an SDL surface, my program
Has anyone got a set of patches/makefiles (or even a HOWTO) that will allow
me to compile libsdl for mingw32, preferably some that don’t involve the use
of Visual C++?

Phil. | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
philpem at | ViewFinder, 10BaseT Ethernet, 2-slice, | 48xCD, ARCINv6c IDE, SCSI
Failsafe - blows every part of the circuit except the fuse