[PATCH] Check libpng with pkg-config as well

KO Myung-Hun <[email protected]> Tue, 7 Jul 2026 20:23:09 +0900
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
---
 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index ae2861848..b6c17ec7f 100755
--- a/configure
+++ b/configure
@@ -5536,13 +5536,14 @@ int main(void) {
   return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
 }
 EOF
-    cc_check -lpng -lz && _png=yes
+    for ld_tmp in "$($_pkg_config --libs libpng)" "-lpng -lz"; do
+      cc_check $ld_tmp && _png=yes && extra_ldflags="$extra_ldflags $ld_tmp" && break
+    done
   fi
 fi
 echores "$_png"
 if test "$_png" = yes ; then
   def_png='#define CONFIG_PNG 1'
-  extra_ldflags="$extra_ldflags -lpng -lz"
 else
   def_png='#undef CONFIG_PNG'
 fi
-- 
2.50.1

_______________________________________________
MPlayer-dev-eng mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo/%(_internal_name)s