3
AC_MSG_CHECKING([for zlib installation])
5
[ --with-zlib=DIR path to directory containing zlib library (default=
6
/usr/local or /usr if not found in /usr/local)],
8
if test "$withval"; then
10
AC_MSG_RESULT([using $ZLIB_HOME])
14
if test ! -f "$ZLIB_HOME/include/zlib.h"
18
AC_MSG_RESULT([$ZLIB_HOME])
21
CLAMDSCAN_LIBS="$FRESHCLAM_LIBS"
23
AC_ARG_ENABLE([zlib-vcheck],
24
[ --disable-zlib-vcheck do not check for buggy zlib version ],
25
zlib_check=$enableval, zlib_check="yes")
27
if test ! -f "$ZLIB_HOME/include/zlib.h"
29
AC_MSG_ERROR([Please install zlib and zlib-devel packages])
32
vuln=`grep "ZLIB_VERSION \"1.2.0" $ZLIB_HOME/include/zlib.h`
33
if test -z "$vuln"; then
34
vuln=`grep "ZLIB_VERSION \"1.2.1" $ZLIB_HOME/include/zlib.h`
37
if test -n "$vuln"; then
38
if test "$zlib_check" = "yes"; then
39
AC_MSG_ERROR(The installed zlib version may contain a security bug. Please upgrade to 1.2.2 or later: http://www.zlib.net. You can omit this check with --disable-zlib-vcheck but DO NOT REPORT any stability issues then!)
41
AC_MSG_WARN([****** This ClamAV installation may be linked against])
42
AC_MSG_WARN([****** a broken zlib version. Please DO NOT report any])
43
AC_MSG_WARN([****** stability problems to the ClamAV developers!])
48
if test "$ZLIB_HOME" != "/usr"; then
49
CPPFLAGS="$CPPFLAGS -I$ZLIB_HOME/include"
50
save_LDFLAGS="$LDFLAGS"
51
LDFLAGS="$LDFLAGS -L$ZLIB_HOME/lib"
52
AC_CHECK_LIB([z], [inflateEnd], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$ZLIB_HOME/lib -lz"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$ZLIB_HOME/lib -lz"], AC_MSG_ERROR([Please install zlib and zlib-devel packages]))
53
AC_CHECK_LIB([z], [gzopen], [], AC_MSG_ERROR([Your zlib is missing gzopen()]))
54
LDFLAGS="$save_LDFLAGS"
56
AC_CHECK_LIB([z], [inflateEnd], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz";FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lz"], AC_MSG_ERROR([Please install zlib and zlib-devel packages]))
57
AC_CHECK_LIB([z], [gzopen],[], AC_MSG_ERROR([Your zlib is missing gzopen()]))