configure: simplify libpng-config invocation

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

based on comment in issue #180.

(cherry picked from commit be70b86c57)

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

View File

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