[vlc-devel] [PATCH 1/2] configure.ac: use pkg-config for zlib

Alexandre Janniaux ajanni at videolabs.io
Thu Sep 26 16:08:30 CEST 2019


---
 configure.ac | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 210b4ca5371..1a9d30c14ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -933,13 +933,16 @@ AS_IF([test -n "${PKG_CONFIG}" ],[
 dnl
 dnl Check for zlib.h and -lz if available
 dnl
-AC_CHECK_HEADERS([zlib.h], [ have_zlib=yes ], [ have_zlib=no ])
-AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
-if test "${have_zlib}" = "yes"
-then
-  VLC_ADD_LIBS([sap],[-lz])
-fi
 
+have_zlib = "no"
+PKG_CHECK_MODULES(ZLIB, [zlib], [
+  VLC_ADD_CFLAGS([sap],[${ZLIB_CFLAGS}])
+  VLC_ADD_LIBS([sap],[${ZLIB_LIBS}])
+  have_zlib = "yes"
+], [
+    AC_MSG_WARN(["ZLIB not found: ${ZLIB_PKG_ERRORS}"])
+])
+AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
 
 dnl
 dnl Domain name i18n support via GNU libidn
-- 
2.23.0



More information about the vlc-devel mailing list