[gimp/wip/Jehan/meson-windows-official] configure: prioritize pkg-config check for libmng.



commit 5d058575d868b39eb4ef95af062f7176171f9c42
Author: Jehan <jehan girinstud io>
Date:   Thu Mar 31 15:29:03 2022 +0200

    configure: prioritize pkg-config check for libmng.
    
    Make the code similar to the change we made in meson: first pkg-config,
    then a basic library check with actual function test.

 configure.ac | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ac6ff66eb5..1b9e23b3b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1615,17 +1615,22 @@ AC_ARG_WITH(libmng,  [  --without-libmng        build without MNG support])
 have_libmng=no
 if test "x$with_libmng" != xno && test -z "$MNG_LIBS" &&
    test -n "$PNG_LIBS" && test -n "$JPEG_LIBS" && test -n "$Z_LIBS"; then
-  AC_CHECK_LIB(mng, mng_create,
-    [AC_CHECK_HEADER(libmng.h, mng_ok=yes)],
-    [have_libmng="no (MNG library not found)"], -lz -lm)
-  if test "$mng_ok" = yes; then
-    have_libmng=yes
-    FILE_MNG='file-mng$(EXEEXT)'; MNG_LIBS="-lmng $JPEG_LIBS $PNG_LIBS"; MNG_CFLAGS="$PNG_CFLAGS"
-    if test "x$platform_win32" = "xyes"; then
-      MNG_CFLAGS="$MNG_CFLAGS -DMNG_USE_DLL"
+
+  PKG_CHECK_MODULES(MNG, libmng, have_libmng=yes, have_libmng=no)
+
+  if test "x$have_libmng" != xyes; then
+    AC_CHECK_LIB(mng, mng_create,
+      [AC_CHECK_HEADER(libmng.h, mng_ok=yes)],
+      [have_libmng="no (MNG library not found)"], -lz -lm)
+    if test "$mng_ok" = yes; then
+      have_libmng=yes
+      FILE_MNG='file-mng$(EXEEXT)'; MNG_LIBS="-lmng $JPEG_LIBS $PNG_LIBS"; MNG_CFLAGS="$PNG_CFLAGS"
+      if test "x$platform_win32" = "xyes"; then
+        MNG_CFLAGS="$MNG_CFLAGS -DMNG_USE_DLL"
+      fi
+    else
+      have_libmng="no (MNG header file not found)"
     fi
-  else
-    have_libmng="no (MNG header file not found)"
   fi
 fi
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]