diff --git a/builds/unix/configure.ac b/builds/unix/configure.ac index e00d2cc..6d4259d 100644 --- a/builds/unix/configure.ac +++ b/builds/unix/configure.ac @@ -69,6 +69,7 @@ AC_SUBST(EXEEXT_BUILD) # auxiliary programs AC_CHECK_PROG([RMDIR], [rmdir], [rmdir]) +PKG_PROG_PKG_CONFIG # Since this file will be finally moved to another directory we make @@ -286,18 +287,8 @@ AC_ARG_WITH([png], AS_HELP_STRING([--without-png], [do not support png compressed OpenType embedded bitmaps])) if test x$with_png != xno; then - AC_MSG_CHECKING([for libpng]) - if test -z "$LIBPNG_CFLAGS" -a -z "$LIBPNG_LDFLAGS"; then - if ! which libpng-config >/dev/null; then - AC_MSG_ERROR([`libpng-config' not found; -either set the LIBPNG_CFLAGS and LIBPNG_LDFLAGS environment variables, -or pass `--without-png' to the `configure' script.]) - fi - LIBPNG_CFLAGS="`libpng-config --cflags`" - LIBPNG_LDFLAGS="`libpng-config --ldflags`" - fi + PKG_CHECK_MODULES(LIBPNG, libpng) HAVE_LIBPNG=yes - AC_MSG_RESULT([$LIBPNG_LDFLAGS]) fi @@ -739,7 +730,7 @@ if test x$SYSTEM_LIBBZ2 = xyes; then fi if test x$HAVE_LIBPNG = xyes; then CFLAGS="$CFLAGS $LIBPNG_CFLAGS -DFT_CONFIG_OPTION_USE_PNG" - LDFLAGS="$LDFLAGS $LIBPNG_LDFLAGS" + LDFLAGS="$LDFLAGS $LIBPNG_LIBS" fi AC_SUBST([CFLAGS])