debian has a patch if you just want to steal their's ... doxygen_1.4.6-1.diff.gz: doxygen-1.4.6.orig/debian/patches/system-libpng.dpatch
wget http://ftp.debian.org/debian/pool/main/d/doxygen/doxygen_1.4.6-2.diff.gz gzcat doxygen_1.4.6-2.diff.gz | patch -p0 -f cp doxygen-1.4.6/debian/patches/system-libpng.patch /usr/portage/*/doxygen/files/
Already in portage...