/
configure.ac
87 lines (72 loc) · 1.9 KB
/
configure.ac
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
dnl configure.ac: this file is processed by autoconf to produce ./configure.
AC_PREREQ(2.60)
sinclude(../eggmod.m4)
AC_INIT([Eggdrop DNS Module],[1.8.4],[bugs@eggheads.org])
AC_CONFIG_SRCDIR(coredns.c)
AC_CONFIG_AUX_DIR(../../../misc)
AC_COPYRIGHT([Copyright (C) 1999 - 2018 Eggheads Development Team])
AC_REVISION([m4_esyscmd([../../../misc/getcommit])])
AC_PROG_CC([gcc cc clang])
dns_reslib_avail="false"
AC_HEADER_RESOLV
for lib in '' -lresolv -lbind -lsocket -lnetwork
do
LIBS="$lib"
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h> /* inet_ functions / structs */
#endif
#ifdef HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h> /* DNS HEADER struct */
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#include <resolv.h>
], [
res_init();
res_mkquery(0, NULL, 0, 0, NULL, 0, NULL, NULL, 0);
;
return 0;
])
], [
RESLIB="$lib"
dns_reslib_avail="true"
break
])
done
AC_MSG_CHECKING([for a working resolver library])
if test "$dns_reslib_avail" = "true"; then
AC_MSG_RESULT([yes ($LIBS)])
else
AC_MSG_RESULT(no)
# Cygwin checks.
case $host_os in
*cygwin* )
AC_MSG_CHECKING([for /usr/local/bind/lib/libbind.a])
if test -r /usr/local/bind/lib/libbind.a; then
AC_MSG_RESULT([yes])
RESLIB="${RESLIB} -L/usr/local/bind/lib -lbind"
RESINCLUDE="-I/usr/local/bind/include"
dns_reslib_avail="true"
else
AC_MSG_RESULT([no])
fi
;;
esac
fi
if test "${dns_reslib_avail}" = "false"; then
cat >&2 <<EOF
configure: warning:
Your system provides no functional resolver library. The DNS
module will therefore be disabled.
EOF
EGG_REMOVE_MOD(dns)
fi
AC_SUBST(RESLIB)
AC_SUBST(RESINCLUDE)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT