building from SVN on Mac OS X 10.5

Just got a new Mac, and went with Python 2.6 from on OS X
10.5. My experience building Matplotlib was less than smooth, and I
thought I'd pass along what eventually wound up working.

To summarize:
1. Rolling your own libpng and freetype in /usr/local appears to lead
to a lot of architecture mismatch heartache, even though the libs
compile fine out of the box
2. The official recommendation at
doesn't work because OS X doesn't ship with wget and because the
download URLs for zlib, libpng, and freetype are broken in
3. I had success by following the instructions at, but I had to
change the build command to:
env ARCHFLAGS='-arch i386' CFLAGS="-Os -arch i386" LDFLAGS="-Os -arch
i386" python build
The ARCHFLAGS suggestion was taken from,
which had a few other scary ideas that I didn't have the heart to try.

This built (I think) an intel-only i386 (32 bit) Matplotlib, which is
fine for my local use. If I can help debug a better build process, let
me know; I can probably help test for the next week on this new