emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117057: * configure.ac (LIBPNG): Add -lz -lm on


From: Paul Eggert
Subject: [Emacs-diffs] emacs-24 r117057: * configure.ac (LIBPNG): Add -lz -lm on platforms where they're needed
Date: Sun, 04 May 2014 06:34:21 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117057
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: emacs-24
timestamp: Sat 2014-05-03 23:34:04 -0700
message:
  * configure.ac (LIBPNG): Add -lz -lm on platforms where they're needed
  
  but libpng-config --libs omits them.  Problem reported by Glenn
  Morris.
modified:
  ChangeLog                      changelog-20091113204419-o5vbwnq5f7feedwu-1538
  configure.ac                   
configure.in-20091113204419-o5vbwnq5f7feedwu-783
=== modified file 'ChangeLog'
--- a/ChangeLog 2014-05-03 21:06:04 +0000
+++ b/ChangeLog 2014-05-04 06:34:04 +0000
@@ -1,3 +1,9 @@
+2014-05-04  Paul Eggert  <address@hidden>
+
+       * configure.ac (LIBPNG): Add -lz -lm on platforms where they're needed
+       but libpng-config --libs omits them.  Problem reported by Glenn
+       Morris.
+
 2014-05-03  Paul Eggert  <address@hidden>
 
        Require ImageMagick >= 6.3.5, due to PixelSetMagickColor (Bug#17339).

=== modified file 'configure.ac'
--- a/configure.ac      2014-05-03 21:06:04 +0000
+++ b/configure.ac      2014-05-04 06:34:04 +0000
@@ -3080,10 +3080,25 @@
     if png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` &&
        png_libs=`(libpng-config --libs) 2>&AS_MESSAGE_LOG_FD`
     then
-      HAVE_PNG=yes
-      PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"`
-      LIBPNG=$png_libs
-    else
+      # On some platforms, LIBPNG must also contain -lz -lm.
+      SAVE_CFLAGS=$CFLAGS
+      SAVE_LIBS=$LIBS
+      CFLAGS="$CFLAGS $png_cflags"
+      for png_libextras in '' ' -lz -lm'; do
+       LIBS="$png_libs$png_libextras $SAVE_LIBS"
+       AC_LINK_IFELSE(
+         [AC_LANG_PROGRAM([[#include <png.h>
+                          ]],
+                          [[return png_get_channels (0, 0);]])],
+         [HAVE_PNG=yes
+          PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"`
+          LIBPNG=$png_libs$png_libextras])
+       test $HAVE_PNG = yes && break
+      done
+      CFLAGS=$SAVE_CFLAGS
+      LIBS=$SAVE_LIBS
+    fi
+    if test $HAVE_PNG != yes; then
       # libpng-config does not work; configure it by hand.
       # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
       # in /usr/include/libpng.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]