Use pkg-config to find libpng - still does the simple test as a backup...

This commit is contained in:
Michael R Sweet 2024-07-03 11:50:52 -04:00
parent b5516449a6
commit 944ae5b040
No known key found for this signature in database
GPG Key ID: BE67C75EC81F3244
1 changed files with 16 additions and 1 deletions

View File

@ -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])