if test "$opsys" = mingw32; then
AC_CHECK_HEADER([png.h], [HAVE_PNG=yes])
elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
- AC_MSG_CHECKING([for png])
+ EMACS_CHECK_MODULES([PNG], [libpng >= 1.0.0])
+ if test $HAVE_PNG = no; then
+ # Test old way in case pkg-config doesn't have it (older machines).
+ AC_MSG_CHECKING([for libpng not configured by pkg-config])
+
png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` &&
png_ldflags=`(libpng-config --ldflags) 2>&AS_MESSAGE_LOG_FD` || {
# libpng-config does not work; configure by hand.
CFLAGS=$SAVE_CFLAGS
LIBS=$SAVE_LIBS
AC_MSG_RESULT([$HAVE_PNG])
+ fi
fi
fi
if test $HAVE_PNG = yes; then