In addition to Andreas' compiler flag notes, you might like to try these.
-fast
Optimises for G5 with a whole bunch of other options rolled in (including -O3 and others, see gcc man pages for details). To make it work on late model G4s (MDD), do this:
-fast -mcpu=7450
I've found that PHP generates vast numbers of pointer signedness warnings, which you can suppress by adding:
-Wno-pointer-sign
If you're compiling with links to packages installed via Fink, you can also add:
-I/sw/include
If you stick these in your global environment file (/etc/profile, /etc/zshenv etc), everything you compile will use those settings, like this:
export CFLAGS='-fast -mcpu=7450 -DBIND_8_COMPAT=1 -DEAPI -Wno-pointer-sign -I/sw/include'
export CXXFLAGS="${CFLAGS}"