~ubuntu-branches/ubuntu/raring/clamav/raring

« back to all changes in this revision

Viewing changes to m4/resolv.m4

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2008-09-05 17:25:34 UTC
  • mfrom: (0.35.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080905172534-yi3f8fkye1o7u1r3
* New upstream version (closes: #497662, #497773)
  - lots of new options for clamd.conf
  - fixes CVEs CVE-2008-3912, CVE-2008-3913, CVE-2008-3914, and
    CVE-2008-1389
* No longer supports --unzip option, so typo is gone (closes: #496276)
* Translations:
  - sv (thanks Martin Bagge <brother@bsnet.se>) (closes: #491760)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl AC_C_DNS
 
2
dnl Checks resolv.h presence and usability
 
3
dnl Checks for specific lresolv exports
 
4
dnl Checks for lresolve reentrance
 
5
dnl
 
6
dnl Note using AC_LINK_IFELSE instead of AC_CHECK_LIB
 
7
dnl as symbols are often redefined in resolv.h
 
8
 
 
9
AC_DEFUN([AC_C_DNS], [
 
10
 
 
11
AC_ARG_ENABLE([dns],
 
12
    AC_HELP_STRING([--disable-dns], [disable support for database verification through DNS]),
 
13
    [want_dns=$enableval], [want_dns=yes]
 
14
)
 
15
if test $want_dns = yes; then
 
16
    ac_cv_have_lresolv=no
 
17
    AC_CHECK_HEADER([resolv.h],
 
18
        [
 
19
            AC_CACHE_CHECK([for dn_expand in std libs], [ac_cv_have_lresolv_std], [
 
20
                ac_cv_have_lresolv_std='no'
 
21
                AC_LINK_IFELSE([
 
22
#include <sys/types.h>
 
23
#include <netinet/in.h>
 
24
#include <arpa/nameser.h>
 
25
#include <resolv.h>
 
26
int main() { return (long)dn_expand; }
 
27
                ],
 
28
                [
 
29
                    ac_cv_have_lresolv_std='yes'
 
30
                    ac_cv_have_lresolv=''
 
31
                ])
 
32
            ])
 
33
            if test "x$ac_cv_have_lresolv" = "xno"; then
 
34
            bklibs=$LIBS
 
35
            LIBS=-lresolv
 
36
            AC_CACHE_CHECK([for dn_expand in -lresolv], [ac_cv_have_lresolv_lresolv], [
 
37
                ac_cv_have_lresolv_lresolv='yes'
 
38
                AC_LINK_IFELSE([
 
39
#include <sys/types.h>
 
40
#include <netinet/in.h>
 
41
#include <arpa/nameser.h>
 
42
#include <resolv.h>
 
43
int main() { return (long)dn_expand; }
 
44
                ],
 
45
                [
 
46
                    ac_cv_have_lresolv_lresolv='yes'
 
47
                    ac_cv_have_lresolv=' -lresolv'
 
48
                ])
 
49
            ])
 
50
            LIBS=$bklibs;
 
51
            fi
 
52
        ],
 
53
        [ ac_cv_have_lresolv=no ],
 
54
        [
 
55
#include <sys/types.h>
 
56
#include <netinet/in.h>
 
57
#include <arpa/nameser.h>
 
58
    ])
 
59
    if test "x$ac_cv_have_lresolv" != "xno"; then
 
60
        FRESHCLAM_LIBS="$FRESHCLAM_LIBS$ac_cv_have_lresolv"
 
61
        CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS$ac_cv_have_lresolv"
 
62
        bklibs=$LIBS
 
63
        LIBS=$ac_cv_have_lresolv
 
64
        AC_DEFINE([HAVE_RESOLV_H],1,[have resolv.h])
 
65
        AC_CACHE_CHECK([for res_nquery in -lresolv], [ac_cv_have_lresolv_r], [
 
66
            ac_cv_have_lresolv_r='no'
 
67
            AC_LINK_IFELSE([
 
68
#include <sys/types.h>
 
69
#include <netinet/in.h>
 
70
#include <arpa/nameser.h>
 
71
#include <resolv.h>
 
72
int main() { return (long)res_nquery; }
 
73
            ],
 
74
            [
 
75
                ac_cv_have_lresolv_r='yes'
 
76
            ]),
 
77
        ])
 
78
        LIBS=$bklibs
 
79
        if test "x$ac_cv_have_lresolv_r" = "xyes"; then
 
80
            AC_DEFINE([HAVE_LRESOLV_R],1,[Define to 1 if -lresolv provides thread safe API's like res_nquery])
 
81
        fi
 
82
    else
 
83
        AC_MSG_WARN([****** DNS support disabled])
 
84
    fi
 
85
fi
 
86
 
 
87
])
 
88