aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-12-19 12:33:40 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-12-19 12:33:40 +0100
commit06a8c73c53a78c84d736ee7176522ed21a501ab4 (patch)
tree3b2f0e38aa688a50679fa94937dee6d1ac9587d5
parent2d92372ea6a64ce898a872f496e62524c19d4b21 (diff)
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 <david.oberhollenzer@sigma-star.at>
-rw-r--r--configure.ac17
1 files changed, 12 insertions, 5 deletions
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"],