Fixes for building and running on Leopard

This includes fixes for all known issues related to Leopard and PPC, except the inability to build the dist/smalldist targets on Leopard due to the lack of pkgbuild.