diff options
| author | Paul Eggert | 2016-12-24 17:03:22 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-12-24 17:03:53 -0800 |
| commit | 2dae636237603b436b48e77e2f893bb4d42f3ce7 (patch) | |
| tree | 784fbcc19b67b7933d2bb380ac4fc5f0e0dae719 | |
| parent | da52e939aa26b0fc241151ba554bdca6ea1ef38c (diff) | |
| download | emacs-2dae636237603b436b48e77e2f893bb4d42f3ce7.tar.gz emacs-2dae636237603b436b48e77e2f893bb4d42f3ce7.zip | |
Use libpng-config --ldflags, not --libs
Problem reported by James K. Lowden (Bug#25268).
* configure.ac (LIBPNG): Pass --ldflags, not --libs, to libpng-config.
| -rw-r--r-- | configure.ac | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 5aaf006c549..cd6c689a52c 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -3476,7 +3476,7 @@ elif test "${with_png}" != no; then | |||
| 3476 | elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then | 3476 | elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then |
| 3477 | AC_MSG_CHECKING([for png]) | 3477 | AC_MSG_CHECKING([for png]) |
| 3478 | png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` && | 3478 | png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` && |
| 3479 | png_libs=`(libpng-config --libs) 2>&AS_MESSAGE_LOG_FD` || { | 3479 | png_ldflags=`(libpng-config --ldflags) 2>&AS_MESSAGE_LOG_FD` || { |
| 3480 | # libpng-config does not work; configure by hand. | 3480 | # libpng-config does not work; configure by hand. |
| 3481 | # Debian unstable as of July 2003 has multiple libpngs, and puts png.h | 3481 | # Debian unstable as of July 2003 has multiple libpngs, and puts png.h |
| 3482 | # in /usr/include/libpng. | 3482 | # in /usr/include/libpng. |
| @@ -3486,18 +3486,18 @@ elif test "${with_png}" != no; then | |||
| 3486 | else | 3486 | else |
| 3487 | png_cflags= | 3487 | png_cflags= |
| 3488 | fi | 3488 | fi |
| 3489 | png_libs='-lpng' | 3489 | png_ldflags='-lpng' |
| 3490 | } | 3490 | } |
| 3491 | SAVE_CFLAGS=$CFLAGS | 3491 | SAVE_CFLAGS=$CFLAGS |
| 3492 | SAVE_LIBS=$LIBS | 3492 | SAVE_LIBS=$LIBS |
| 3493 | CFLAGS="$CFLAGS $png_cflags" | 3493 | CFLAGS="$CFLAGS $png_cflags" |
| 3494 | LIBS="$png_libs -lz -lm $LIBS" | 3494 | LIBS="$png_ldflags -lz -lm $LIBS" |
| 3495 | AC_LINK_IFELSE( | 3495 | AC_LINK_IFELSE( |
| 3496 | [AC_LANG_PROGRAM([[#include <png.h>]], | 3496 | [AC_LANG_PROGRAM([[#include <png.h>]], |
| 3497 | [[return !png_get_channels (0, 0);]])], | 3497 | [[return !png_get_channels (0, 0);]])], |
| 3498 | [HAVE_PNG=yes | 3498 | [HAVE_PNG=yes |
| 3499 | PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"` | 3499 | PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"` |
| 3500 | LIBPNG=$png_libs | 3500 | LIBPNG=$png_ldflags |
| 3501 | # $LIBPNG requires explicit -lz in some cases. | 3501 | # $LIBPNG requires explicit -lz in some cases. |
| 3502 | # We don't know what those cases are, exactly, so play it safe and | 3502 | # We don't know what those cases are, exactly, so play it safe and |
| 3503 | # append -lz to any nonempty $LIBPNG, unless we're already using LIBZ. | 3503 | # append -lz to any nonempty $LIBPNG, unless we're already using LIBZ. |