summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-06 11:46:45 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-07 20:28:43 +0000
commit22a93f8b9b4a79eefbdd0b2c412526f6141ac7a8 (patch)
treeab5a6d543e70cdce44cf7233c1d7421df36718b0
parent0ae62706c34e4abc581d4c42ce9807e2898fac1d (diff)
downloadlibpciaccess-22a93f8b9b4a79eefbdd0b2c412526f6141ac7a8.tar.gz
configure.ac: Use pkg-config to find zlib dependency info
Matches what we already do in meson.build Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--configure.ac11
1 files 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