[Apologies for the premature send on the previous.]
Unfortunately, that's not the correct fix. The code that's causing the error shouldn't be compiled at all on an NS build; it's in a large block that's conditioned on HAVE_PNG, which the NS build expects to be false, as that port supplies its on version of png_load().
The current incorrect configuration behavior appears to have been caused by:
fixes bug: http://debbugs.gnu.org/17339
committer: Paul Eggert <address@hidden
branch nick: trunk
timestamp: Sun 2014-05-04 14:28:08 -0700
Consult libpng-config more consistently.
This is mainly for simplicity, but it should also avoid
some future problems like the ones we recently had with NetBSD.
(LIBPNG): Configure after LIBZ. Use libpng-config
for cflags, too. Append -lz if we're not already doing that with
LIBZ. Do not bother appending -lm, since we always append that.
Coalesce some duplicate code.
* src/Makefile.in (PNG_CFLAGS): New var.
(ALL_CFLAGS): Use it.
* src/image.c [HAVE_PNG]: Don't worry about <libpng/png.h>, as
CFLAGS now handles this.