3
[ --disable-bzip2 disable bzip2 support],
4
want_bzip2=$enableval, want_bzip2="yes")
7
if test "$want_bzip2" = "yes"
9
AC_LIB_LINKFLAGS([bz2])
10
save_LDFLAGS="$LDFLAGS"
11
# Only add -L if prefix is not empty
12
test -z "$LIBBZ2_PREFIX" || LDFLAGS="$LDFLAGS -L$LIBBZ2_PREFIX/$acl_libdirstem";
15
AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [have_bzprefix="yes"])
16
if test "x$have_bzprefix" = "xno"; then
17
AC_DEFINE([NOBZ2PREFIX],1,[bzip funtions do not have bz2 prefix])
19
LDFLAGS="$save_LDFLAGS"
20
if test "$HAVE_LIBBZ2" = "yes"; then
21
AC_CHECK_HEADER([bzlib.h],
23
[ac_cv_c_cve_2008_1372="no"])
24
if test "$ac_cv_c_cve_2008_1372" = "bugged"; then
25
AC_MSG_WARN([****** bzip2 libraries are affected by the CVE-2008-1372 bug])
26
AC_MSG_WARN([****** We strongly suggest you to update to bzip2 1.0.5.])
27
AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!])
28
bzip_check="bugged (CVE-2008-1372)"
30
if test "$ac_cv_c_cve_2008_1372" = "linkfailed"; then
31
dnl This shouldn't happen
32
dnl We failed to link but libtool may still be able to link, so don't disable bzip2 just yet
33
AC_MSG_WARN([****** Unable to link bzip2 testcase])
34
AC_MSG_WARN([****** You may be affected by CVE-2008-1372 bug, but I need to be able to link a testcase to verify])
35
AC_MSG_WARN([****** It is recommended to fix your build environment so that we can run the testcase!])
36
AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!])
37
bzip_check="link failed (CVE-2008-1372)"
40
case "$ac_cv_c_cve_2008_1372" in
49
if test "$HAVE_LIBBZ2" = "yes"; then
51
if test "$ac_cv_c_cve_2010_0405" = "bugged"; then
52
AC_MSG_WARN([****** bzip2 libraries are affected by the CVE-2010-0405 bug])
53
AC_MSG_WARN([****** We strongly suggest you to update bzip2])
54
AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!])
55
bzip_check="bugged (CVE-2010-0405)"
57
if test "$ac_cv_c_cve_2010_0405" = "linkfailed"; then
58
dnl This shouldn't happen
59
dnl We failed to link but libtool may still be able to link, so don't disable bzip2 just yet
60
AC_MSG_WARN([****** Unable to link bzip2 testcase])
61
AC_MSG_WARN([****** You may be affected by CVE-2010-0405 bug, but I need to be able to link a testcase to verify])
62
AC_MSG_WARN([****** It is recommended to fix your build environment so that we can run the testcase!])
63
AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!])
64
bzip_check="link failed (CVE-2010-0405)"
67
case "$ac_cv_c_cve_2010_0405" in
69
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS $LTLIBBZ2"
70
AC_DEFINE([HAVE_BZLIB_H],1,[have bzip2])
73
AC_MSG_WARN([****** bzip2 support disabled])
78
AC_MSG_WARN([****** bzip2 support disabled])
82
AM_CONDITIONAL([HAVE_LIBBZ2], test "x$HAVE_LIBBZ2" = "xyes")