On Gentoo Linux we don't use any bundled libraries and try to link as much as possible against system-wide libs. I'm aware that the ghostscript bundled version is libpng 1.2.42, which works quite fine. Error when compiling against libpng-1.4.0: ./obj/../soobj/echogs -e .dev -w- -l-dev2 -b -s -l-include -l./obj/../soobj/page -l-obj ./obj/../soobj/pksmraw ./obj/../soobj/gdevpbm.o ./obj/../soobj/gdevppla.o ./obj/../soobj/gdevmpla.o ./obj/../soobj/echogs -e .dev -w- -l-dev2 -b -s -l-include -l./obj/../soobj/page -l-obj ./obj/../soobj/plan9bm ./obj/../soobj/gdevpbm.o ./obj/../soobj/gdevppla.o ./obj/../soobj/gdevmpla.o make[1]: *** No rule to make target `src/png.c', needed by `obj/../soobj/png.o'. Stop. make[1]: Leaving directory `/var/tmp/portage/app-text/ghostscript-gpl-8.70-r1/work/ghostscript-8.70' make: *** [so] Error 2 Attached is a patch which works around the problem, author of the patch is Lars Wendler (Polynomial-C) <polynomial-c@gentoo.org>, added the original bugreport on our Gentoo bugtracker in URL.
Created attachment 5955 [details] ghostscript-gpl-8.71-libpng-1.4.0-compile-fix.patch
Created attachment 6041 [details] ghostscript-gpl-8.71-libpng-1.4.0-compile-fix-v2.patch
Grabbing a Ralph's bugs.
(In reply to comment #2) > Created an attachment (id=6041) [details] > ghostscript-gpl-8.71-libpng-1.4.0-compile-fix-v2.patch Sorry, the patch is wrong - in 1.4.0, png_check_sig() is removed and replaced by png_sig_cmp() so applying it would break building against linpng 1.2.x . It would be far better to modify configure to check for a function which is common to both 1.2.x and 1.4.x, rather than switching between the two. e.g. check if png_struct is defined or png_create_write_struct() is defined. (these are actually used by the png device so rather more appropriate than either png_check_sig() or png_sig_cmp()).
r11449 switches the png test away from png_sig_cmp() (obsolete/removed in libpng 1.4) to png_create_write_struct() which is actually used by the png device, and common to both libpng 1.2.x and 1.4.x , to allow building against either versions. As explained, the submitted patch was wrong. Also, configure.ac is usually sym-link to "base/configure.ac", so only two files needed to be modified, rather than three.