-dnl Check for debug mode
-AC_ARG_ENABLE(debug,
-[ --enable-debug Turn on debugging],
-[case "${enableval}" in
- yes) debug=true
- CFLAGS="$CFLAGS -g"
- ;;
- no) debug=false
- CFLAGS="$CFLAGS -O2"
- ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug)
- ;;
-esac],[debug=false])
-AM_CONDITIONAL(DEBUG, test "$debug" = "true")
-
-dnl Set PNG directory
-AC_MSG_CHECKING([for PNG library installation])
-AC_ARG_WITH(png,
-[ --with-png[=PATH] Set path of lib PNG installation ],
-[
- if test "$withval" != "no" ; then
- trypngdir=$withval
- if test "$prefix" != "NONE" ; then
- trypngdir="$trypngdir $prefix"
- fi
- fi
-]
-)
-
-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
-