Category Archives: compilation

>Compiling zlib, libpng and pngquant on Mac OS X (updated)


Here are some instructions for compiling pngquant on Mac OS X. Included are instructions for compiling libpng (which is a dependency for pngquant) and zlib (which is a dependency for libpng).

Step 1. First, download pngquant from SourceForge:

as well as libpng and zlib:

Step 2. Unpack them all in the same directory and then generate symbolic links called libpng and zlib that point to the actual directories. E.g.:

total 16
lrwxr-xr-x 1 ernst ernst 13 Apr 29 19:27 libpng -> libpng-1.2.27
drwxr-xr-x 103 ernst ernst 3502 Apr 29 19:28 libpng-1.2.27
drwxr-xr-x 10 ernst ernst 340 Apr 29 19:18 pngquant-1.0
lrwxr-xr-x 1 ernst ernst 10 Apr 29 19:27 zlib -> zlib-1.2.3
drwxr-xr-x 64 ernst ernst 2176 Apr 29 19:22 zlib-1.2.3

Step 3. Now go to the zlib directory and execute ./configure followed by make.

Step 4. Go to the libpng directory and execute make -f scripts/makefile.darwin.

Step 5. Go to the directory that contains the pngquant source code and execute make -f Makefile.unx.

That’s it. You should now have a pngquant executable.

Updated (April 30, 2008): On request, here’s a link to the resulting executable: pngquant (for Mac OS X). MD5 checksum is 20820366a7fffc6305ada6b727656b7b.

1 Comment

Posted by on 29 April 2008 in cc, compilation, compile, libpng, mac, macos, macosx, make, png, pngquant, zlib