Commit bccf1cd6b43030950bd4b297396c6d29feee4b49

suzuki toshiya 2022-10-16T18:02:27

[build] use AC_CHECK_PROG() macro for libpng-config detection * builds/unix/configure.raw: use AC_CHECK_PROG() instead of `which` to find `libpng-config`.

diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index fb943fd..43a7656 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -406,16 +406,12 @@ if test x"$with_png" = xyes -o x"$with_png" = xauto; then
       have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
     else
       # fall back to config script
-      AC_MSG_CHECKING([for libpng-config])
-      if which libpng-config > /dev/null 2>&1; then
+      AC_CHECK_PROG(have_libpng, [libpng-config], [yes (libpng-config)], [no])
+      if test "$have_libpng" != no; then
         LIBPNG_CFLAGS=`libpng-config --cflags`
         LIBPNG_LIBS=`libpng-config --ldflags`
         libpng_libspriv=`libpng-config --static --ldflags`
         libpng_libsstaticconf="$libpng_libspriv"
-        have_libpng="yes (libpng-config)"
-        AC_MSG_RESULT([yes])
-      else
-        AC_MSG_RESULT([no])
       fi
     fi
   fi