configure: simplify libpng-config invocation

use --ldflags over --prefix + --libs combination

based on comment in issue #180.

Change-Id: If2ca06053d5237b6722ddf4117917e5f3c06ab59
This commit is contained in:
James Zern 2014-09-09 22:55:29 -07:00
parent e0a9932161
commit be70b86c57

View File

@ -296,15 +296,12 @@ AC_ARG_ENABLE([png], AS_HELP_STRING([--disable-png],
@<:@default=auto@:>@]))
AS_IF([test "x$enable_png" != "xno"], [
CLEAR_LIBVARS([PNG])
AC_PATH_PROGS(LIBPNG_CONFIG,
[libpng-config libpng15-config libpng14-config libpng12-config])
AC_PATH_PROGS([LIBPNG_CONFIG],
[libpng-config libpng16-config libpng15-config libpng14-config \
libpng12-config])
if test -n "$LIBPNG_CONFIG"; then
PNG_INCLUDES=`$LIBPNG_CONFIG --cflags`
PNG_PREFIX=`$LIBPNG_CONFIG --prefix`
if test "${PNG_PREFIX}/lib" != "/usr/lib" ; then
PNG_LIBS="-L${PNG_PREFIX}/lib"
fi
PNG_LIBS="$PNG_LIBS `$LIBPNG_CONFIG --libs`"
PNG_LIBS="`$LIBPNG_CONFIG --ldflags`"
fi
WITHLIB_OPTION([png], [PNG])