Welcome to mirror list, hosted at ThFree Co, Russian Federation.

resolv.m4 « m4 - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dc3c6d7bdf608f35f931d204bb991bc5519fe255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# LIBRESOLV_CHECK_CONFIG ([DEFAULT-ACTION])
# ----------------------------------------------------------
#
# Checks for DNS functions.

AC_DEFUN([LIBRESOLV_TRY_LINK],
[
am_save_LIBS="$LIBS"
LIBS="$LIBS $1"
AC_TRY_LINK(
[
#ifdef HAVE_SYS_TYPES_H
#	include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
#	include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#	include <arpa/nameser.h>
#endif
#ifdef HAVE_RESOLV_H
#	include <resolv.h>
#endif
#ifndef C_IN
#	define C_IN	ns_c_in
#endif	/* C_IN */
#ifndef T_SOA
#	define T_SOA	ns_t_soa
#endif	/* T_SOA */
],
[
	char	*buf;

	res_init();
	res_query("", C_IN, T_SOA, (unsigned char *)buf, 0);
],
found_resolv="yes"
RESOLV_LIBS="$1")
LIBS="$am_save_LIBS"
])dnl

AC_DEFUN([LIBRESOLV_CHECK_CONFIG],
[
	AC_MSG_CHECKING(for DNS lookup functions)

	LIBRESOLV_TRY_LINK([])

	if test "x$found_resolv" != "xyes"; then
		LIBRESOLV_TRY_LINK([-lresolv])
	fi
	if test "x$found_resolv" != "xyes"; then
		LIBRESOLV_TRY_LINK([-lbind])
	fi
	if test "x$found_resolv" != "xyes"; then
		LIBRESOLV_TRY_LINK([-lsocket])
	fi

	if test "x$found_resolv" = "xyes"; then
		AC_DEFINE([HAVE_RES_QUERY], 1, [Define to 1 if you have the DNS functions])
	else
		AC_MSG_RESULT(no)
	fi

	AC_MSG_RESULT($found_resolv)

	AC_SUBST(RESOLV_LIBS)
])dnl