From 06a8c73c53a78c84d736ee7176522ed21a501ab4 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 19 Dec 2020 12:33:40 +0100 Subject: Fix: replace the pkg-config check for bzip2 with a manual check The upstream package for bzip2 does not provide a pkg-config file. Some GNU/Linux distributions (e.g. Fedora) have added one, but others like Debian have not. Since Debian and its deriatives are much more wide spread, this makes the existance of a pkg-config file the exception, rather than the norm. This commit replaces the pkg-config based check in configure.ac with a manual check based on AC_CHECK_LIB and AC_CHECK_HEADERS, similar to what is already done for lzo2. Signed-off-by: David Oberhollenzer --- configure.ac | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index e5038d0..30f7a6a 100644 --- a/configure.ac +++ b/configure.ac @@ -143,13 +143,20 @@ fi ##### search for dependencies ##### -AS_IF([test "x$with_bzip2" != "xno"], [ - PKG_CHECK_MODULES(BZIP2, [bzip2], [with_bzip2="yes"], - [AS_IF([test "x$with_bzip2" != "xcheck"], - [AC_MSG_ERROR([cannot Bzip2 libs])], - [with_bzip2="no"])]) +AC_ARG_VAR([BZIP2_CFLAGS], [C compiler flags for lib bzip2]) +AC_ARG_VAR([BZIP2_LIBS], [linker flags for lib bzip2]) + +AS_IF([test -z "$BZIP2_LIBS" -a "x$with_bzip2" != "xno"], [ + AC_CHECK_LIB([bz2], [BZ2_bzCompress], + [AC_CHECK_HEADERS([bzlib.h], [BZIP2_LIBS="-lbz2"], [])], + []) ], []) +AS_IF([test -z "$BZIP2_LIBS"], [AS_IF([test "x$with_bzip2" = "xyes"], + [AC_MSG_ERROR([cannot find Bzip2 libs])], + [with_bzip2="no"])], + [with_bzip2="yes"]) + AS_IF([test "x$with_gzip" != "xno" -a "x$with_builtin_zlib" != "xyes"], [ PKG_CHECK_MODULES(ZLIB, [zlib], [with_gzip="yes"], [AS_IF([test "x$with_gzip" != "xcheck"], -- cgit v1.2.3