2
dnl Checks resolv.h presence and usability
3
dnl Checks for specific lresolv exports
4
dnl Checks for lresolve reentrance
6
dnl Note using AC_LINK_IFELSE instead of AC_CHECK_LIB
7
dnl as symbols are often redefined in resolv.h
12
AC_HELP_STRING([--disable-dns], [disable support for database verification through DNS]),
13
[want_dns=$enableval], [want_dns=yes]
15
if test $want_dns = yes; then
17
AC_CHECK_HEADER([resolv.h],
19
AC_CACHE_CHECK([for dn_expand in std libs], [ac_cv_have_lresolv_std], [
20
ac_cv_have_lresolv_std='no'
22
#include <sys/types.h>
23
#include <netinet/in.h>
24
#include <arpa/nameser.h>
26
int main() { return (long)dn_expand; }
29
ac_cv_have_lresolv_std='yes'
33
if test "x$ac_cv_have_lresolv" = "xno"; then
36
AC_CACHE_CHECK([for dn_expand in -lresolv], [ac_cv_have_lresolv_lresolv], [
37
ac_cv_have_lresolv_lresolv='yes'
39
#include <sys/types.h>
40
#include <netinet/in.h>
41
#include <arpa/nameser.h>
43
int main() { return (long)dn_expand; }
46
ac_cv_have_lresolv_lresolv='yes'
47
ac_cv_have_lresolv=' -lresolv'
53
[ ac_cv_have_lresolv=no ],
55
#include <sys/types.h>
56
#include <netinet/in.h>
57
#include <arpa/nameser.h>
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"
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'
68
#include <sys/types.h>
69
#include <netinet/in.h>
70
#include <arpa/nameser.h>
72
int main() { return (long)res_nquery; }
75
ac_cv_have_lresolv_r='yes'
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])
83
AC_MSG_WARN([****** DNS support disabled])