diff options
| author | Michael R Sweet <msweet@msweet.org> | 2024-07-03 11:50:52 -0400 |
|---|---|---|
| committer | Michael R Sweet <msweet@msweet.org> | 2024-07-03 11:50:52 -0400 |
| commit | 944ae5b0401f12b3b5a63c9b829e5614fe79f395 (patch) | |
| tree | df9a54c56ad2a545bd3c0a24ac1449d4fd21ec27 /configure.ac | |
| parent | b5516449a687f8493e5fd9682511e9611a5b4fb7 (diff) | |
Use pkg-config to find libpng - still does the simple test as a backup...
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 17 |
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]) |
