summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac17
1 files changed, 16 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index b508d4573..901c59a87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -766,7 +766,22 @@ AS_IF([test x$enable_localzlib != xyes], [
# but only, if the builtin lib is not requested
syspnglib_ok=no
syspnginc_ok=no
-AS_IF([test x$enable_localpng != xyes], [
+AS_IF([test x$enable_localpng != xyes -a x$PKGCONFIG != x], [
+ AC_MSG_CHECKING([for libpng-1.6.x])
+ AS_IF([$PKGCONFIG --exists libpng16], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_PNG_H], 1, [Have PNG library?])
+ syspnginc_ok=yes
+ syspnglib_ok=yes
+ PNGINC="$($PKGCONFIG --cflags libpng16)"
+ IMAGELIBS="$($PKGCONFIG --libs libpng16) $IMAGELIBS"
+ STATICIMAGELIBS="$($PKGCONFIG --libs libpng16) $STATICIMAGELIBS"
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+])
+
+AS_IF([test x$enable_localpng != xyes -a $syspnglib_ok = no], [
AC_CHECK_LIB([png], [png_read_info], [
AC_CHECK_HEADER([png.h], [
AC_DEFINE([HAVE_PNG_H])