Skip to content

Commit 0fa0c9c

Browse files
committed
Remove defunct libz from autoconf and make lack of bz2 fail
We now have a new --disable-bz2 to forcibly compile with limited functionality, copied from htslib, but note doing so will break the tests. This is obviously not recommended.
1 parent a6277e7 commit 0fa0c9c

File tree

3 files changed

+18
-69
lines changed

3 files changed

+18
-69
lines changed

configure.ac

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,24 @@ dnl Turn on C compiler warnings.
9090
VL_PROG_CC_WARNINGS
9191

9292
dnl Check for libraries
93-
ZLIB_CHECK_CONFIG(,,[have_zlib=yes], [have_zlib=no])
94-
95-
AC_CHECK_LIB([bz2], [BZ2_bzBuffToBuffCompress], [
93+
AC_ARG_ENABLE([bz2],
94+
[AS_HELP_STRING([--disable-bz2],
95+
[omit support for BZ2 within Arith streams])],
96+
[], [enable_bz2=yes])
97+
98+
if test "$enable_bz2" != no; then
99+
bz2_devel=ok
100+
AC_CHECK_LIB([bz2], [BZ2_bzBuffToBuffCompress], [
96101
LIBS="-lbz2 $LIBS"
97-
AC_DEFINE([HAVE_LIBBZ2],1,[Define to 1 if you have the libbz2 library.])])
102+
AC_DEFINE([HAVE_LIBBZ2],1,[Define to 1 if you have the libbz2 library.])], [bz2_devel=missing])
103+
if test "$bz2_devel" != "ok"; then
104+
AC_MSG_ERROR([libbzip2 development files not found.
105+
106+
This is needed for some options of the arithmetic coder. It can be disabled
107+
with configure --disable-bz2, but be aware some data streams will become
108+
unable to be decompressed and arith tests will fail.])
109+
fi
110+
fi
98111

99112
dnl AC_CHECK_LIB([lzma], [lzma_easy_buffer_encode], [
100113
dnl LIBS="-llzma $LIBS"

htscodecs/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ libhtscodecs_la_SOURCES += rANS_static32x16pr_neon.c
9090
endif
9191

9292
libhtscodecs_la_LDFLAGS = -version-info @VERS_CURRENT@:@VERS_REVISION@:@VERS_AGE@
93-
libhtscodecs_la_LIBADD += @LIBZ@ -lm
93+
libhtscodecs_la_LIBADD += -lm
9494

9595
# Fuzz testing version of the library. This is build using -fsanitize=fuzzer
9696
# and defines FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION to prevent things like

m4/zlib.m4

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)