From 22a93f8b9b4a79eefbdd0b2c412526f6141ac7a8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 6 Apr 2022 11:46:45 -0700 Subject: configure.ac: Use pkg-config to find zlib dependency info Matches what we already do in meson.build Signed-off-by: Alan Coopersmith --- configure.ac | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index f2b69cc..4453aa6 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,7 @@ m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS +PKG_PROG_PKG_CONFIG pciids_path=/usr/share/hwdata AC_ARG_WITH(pciids-path, AS_HELP_STRING([--with-pciids-path=PCIIDS_PATH], @@ -59,12 +60,10 @@ AC_ARG_WITH(zlib, AS_HELP_STRING([--with-zlib], [Enable zlib support to read gzip compressed pci.ids]), [use_zlib="$withval"]) if test "x$use_zlib" = xyes; then - AC_CHECK_LIB(z, gzopen, - [PCIACCESS_LIBS="$PCIACCESS_LIBS -lz"], - [AC_MSG_ERROR(Check for zlib library failed)]) - AC_CHECK_HEADER([zlib.h], - [AC_DEFINE(HAVE_ZLIB, 1, [Use zlib to read gzip compressed pci.ids])], - [AC_MSG_ERROR(Check for zlib.h header file failed)]) + PKG_CHECK_MODULES([ZLIB], [zlib]) + PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS $ZLIB_CFLAGS" + PCIACCESS_LIBS="$PCIACCESS_LIBS $ZLIB_LIBS" + AC_DEFINE(HAVE_ZLIB, 1, [Use zlib to read gzip compressed pci.ids]) fi case $host_os in -- cgit v1.2.3