summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac13
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b0d403b0f4..c79e1b01976 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-01 Glenn Morris <rgm@gnu.org>
+
+ * configure.ac (LIBPNG): Consult libpng-config for the precise
+ form of "-lpng" to use. (Bug#17339)
+
2014-04-29 Glenn Morris <rgm@gnu.org>
* configure.ac: Treat MirBSD as OpenBSD. (Bug#17339)
diff --git a/configure.ac b/configure.ac
index c51d7b03e18..5aed265849e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3101,8 +3101,15 @@ elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
fi
if test "${HAVE_PNG}" = "yes"; then
- AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
- LIBPNG="-lpng -lz -lm"
+ AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library.])
+
+ dnl Some systems, eg NetBSD 6, only provide eg "libpng16", not "libpng".
+ lpng=`libpng-config --libs 2> /dev/null`
+ case $lpng in
+ -l*) : ;;
+ *) lpng="-lpng" ;;
+ esac
+ LIBPNG="$lpng -lz -lm"
AC_CHECK_DECL(png_longjmp,
[],
@@ -4976,7 +4983,7 @@ echo " Does Emacs use -lXpm? ${HAVE_XPM}"
echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
echo " Does Emacs use a gif library? ${HAVE_GIF} $LIBGIF"
-echo " Does Emacs use -lpng? ${HAVE_PNG}"
+echo " Does Emacs use a png library? ${HAVE_PNG} $LIBPNG"
echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}"
echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}"