diff -Naur pilot-link-0.12.2.orig/configure.ac pilot-link-0.12.2/configure.ac --- pilot-link-0.12.2.orig/configure.ac 2007-02-09 22:50:17.000000000 +0100 +++ pilot-link-0.12.2/configure.ac 2007-08-25 17:38:42.000000000 +0200 @@ -220,47 +220,52 @@ dnl ****************************** dnl PNG Support dnl ****************************** +msg_png=no if test "x$enable_conduits" != "xno"; then have_png=no AC_ARG_WITH(libpng, [ --with-libpng Prefix where libpng is installed]) - case $with_libpng in - /*) - PNG_CFLAGS="-I$withval/include" - PNG_LIBS="-L$withval/lib" - ;; - esac + if test "x$with_libpng" != "xno"; then + + case $with_libpng in + /*) + PNG_CFLAGS="-I$withval/include" + PNG_LIBS="-L$withval/lib" + ;; + esac + + save_CFLAGS="$CFLAGS" + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS $PNG_CFLAGS" + CPPFLAGS="$CPPFLAGS $PNG_CFLAGS" + LDFLAGS="$LDFLAGS $PNG_LIBS" - save_CFLAGS="$CFLAGS" - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - CFLAGS="$CFLAGS $PNG_CFLAGS" - CPPFLAGS="$CPPFLAGS $PNG_CFLAGS" - LDFLAGS="$LDFLAGS $PNG_LIBS" - - AC_CHECK_LIB(png, main, [have_png=yes; PNG_LIBS="$PNG_LIBS -lpng"],[have_png=no],[-lm]) - if test "$have_png" = yes; then - AC_CHECK_HEADER(png.h, , have_png=no) + AC_CHECK_LIB(png, main, [have_png=yes; PNG_LIBS="$PNG_LIBS -lpng"],[have_png=no],[-lm]) if test "$have_png" = yes; then - AC_MSG_CHECKING(for png setjmp support) - AC_EGREP_CPP(yes, - [#include - #ifdef PNG_SETJMP_SUPPORTED - yes - #endif], , have_png=no) - AC_MSG_RESULT($have_png) + AC_CHECK_HEADER(png.h, , have_png=no) if test "$have_png" = yes; then - AC_DEFINE(HAVE_PNG, 1, [Define if we have PNG support]) - have_png=yes + AC_MSG_CHECKING(for png setjmp support) + AC_EGREP_CPP(yes, + [#include + #ifdef PNG_SETJMP_SUPPORTED + yes + #endif], , have_png=no) + AC_MSG_RESULT($have_png) + if test "$have_png" = yes; then + AC_DEFINE(HAVE_PNG, 1, [Define if we have PNG support]) + have_png=yes + msg_png=yes + fi fi fi - fi - CFLAGS="$save_CFLAGS" - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" + CFLAGS="$save_CFLAGS" + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi else have_png="none" PNG_CFLAGS=