-if test "$withval" != "no" -a "$zlib" = "true" ; then
- for testpngdir in "." $trypngdir /usr/local /usr /opt ; do
- if test -f "$testpngdir/lib/libpng.a" ; then
- if test ! -f "$testpngdir/include/png.h" ; then
- AC_MSG_ERROR([PNG library found, but png.h not found. Check PNG installation])
- else
- grep PNG_LIBPNG_VER_STRING "$testpngdir/include/png.h" | grep 9 > /dev/null
- if test "$?" = "0" ; then
- AC_MSG_ERROR([Your version of libpng in $testpngdir is too old -- please upgrade])
- fi
- fi
- LDFLAGS="$LDFLAGS -L$testpngdir/lib"
- CFLAGS="$CFLAGS -I$testpngdir/include"
- pngdir="$testpngdir"
- AC_DEFINE(HAVE_PNG)
- break
- elif test -f "$testpngdir/libpng.a" ; then
- if test ! -f "$testpngdir/png.h" ; then
- AC_MSG_ERROR([PNG library found, but png.h not found. Check PNG installation])
- else
- grep PNG_LIBPNG_VER_STRING "$testpngdir/png.h" | grep 9 > /dev/null
- if test "$?" = "0" ; then
- AC_MSG_ERROR([Your version of libpng in $testpngdir is too old -- please upgrade])
- fi
- fi
- LDFLAGS="$LDFLAGS -L$testpngdir"
- CFLAGS="$CFLAGS -I$testpngdir"
- pngdir="$testpngdir"
- AC_DEFINE(HAVE_PNG)
- break
- fi
- done
- AC_MSG_RESULT($pngdir)
- AM_CONDITIONAL(HAVE_PNG, test -n "$pngdir")
-else
- AC_MSG_RESULT([no])
-fi
-