Compiling pngcrush 1.6.4 on Mac OS X 10.4.10

19 Aug 2007

Just in case you are trying to compile pngcrush 1.6.4 on Mac OS 10.4.10. Apple's version of as (the assembler, based on GAS 1.3.8) is retarded. Anyways, it's easy to patch up.

Edit the pngcrush Makefile and replace the GAS_VERSION macro as such:


GAS_VERSION := $(shell as --version | grep "GNU assembler" | sed -e 's/GNU assembler //' -e 's/ .*//')


GAS_VERSION := $(shell echo "" | as -v 2>&1 | grep "GNU assembler" | sed -e 's/.*GNU assembler version //')

then do make, etc.

And if that doesn't work, change it to GAS_VERSION:= "Apple"

I'm sure this applies to other versions of pngcrush and other versions of OS X

Update 29-Aug-2007: You can use the most excellent macports to install this instead.

sudo  ports -v install pngcrush

Comment 2009-04-16 by None

btw it's "sudo port" not ports.