~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to m4/reorganization/libs/libz.m4

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
dnl Check for zlib
 
3
AC_MSG_CHECKING([for zlib installation])
 
4
AC_ARG_WITH([zlib],
 
5
[  --with-zlib=DIR        path to directory containing zlib library (default=
 
6
                          /usr/local or /usr if not found in /usr/local)],
 
7
[
 
8
if test "$withval"; then
 
9
  ZLIB_HOME="$withval"
 
10
  AC_MSG_RESULT([using $ZLIB_HOME])
 
11
fi
 
12
], [
 
13
ZLIB_HOME=/usr/local
 
14
if test ! -f "$ZLIB_HOME/include/zlib.h"
 
15
then
 
16
  ZLIB_HOME=/usr
 
17
fi
 
18
AC_MSG_RESULT([$ZLIB_HOME])
 
19
])
 
20
 
 
21
CLAMDSCAN_LIBS="$FRESHCLAM_LIBS"
 
22
 
 
23
AC_ARG_ENABLE([zlib-vcheck],
 
24
[  --disable-zlib-vcheck          do not check for buggy zlib version ],
 
25
zlib_check=$enableval, zlib_check="yes")
 
26
 
 
27
if test ! -f "$ZLIB_HOME/include/zlib.h"
 
28
then
 
29
    AC_MSG_ERROR([Please install zlib and zlib-devel packages])
 
30
else
 
31
 
 
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`
 
35
    fi
 
36
 
 
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!)
 
40
        else
 
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!])
 
44
        fi
 
45
    fi
 
46
 
 
47
    save_LIBS="$LIBS"
 
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"
 
55
    else
 
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()]))
 
58
    fi
 
59
    LIBS="$save_LIBS"
 
60
fi