3 AC_CONFIG_SRCDIR([src/tincd.c])
4 AM_INIT_AUTOMAKE(tinc, 2.0-svn)
5 AC_CONFIG_HEADERS([config.h])
8 AM_GNU_GETTEXT([external])
9 AM_GNU_GETTEXT_VERSION(0.16.1)
11 AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions])
15 dnl Checks for programs.
29 AC_DEFINE(HAVE_LINUX, 1, [Linux])
32 AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
35 AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
38 AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
41 AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
44 AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
47 AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
50 AC_DEFINE(HAVE_MINGW, 1, [MinGW])
54 AC_MSG_ERROR("Unknown operating system.")
60 dnl Checks for libraries.
62 dnl Checks for header files.
63 dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
66 AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/param.h sys/time.h sys/socket.h sys/wait.h sys/mman.h netdb.h arpa/inet.h])
67 AC_CHECK_HEADERS([net/if.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h],
69 [#ifdef HAVE_SYS_TYPES_H
70 #include <sys/types.h>
75 #ifdef HAVE_ARPA_INET_H
76 #include <arpa/inet.h>
78 #ifdef HAVE_SYS_SOCKET_H
79 #include <sys/socket.h>
83 AC_CHECK_HEADERS([netinet/if_ether.h netinet/ip.h netinet/ip6.h],
85 [#ifdef HAVE_SYS_TYPES_H
86 #include <sys/types.h>
91 #ifdef HAVE_ARPA_INET_H
92 #include <arpa/inet.h>
94 #ifdef HAVE_SYS_SOCKET_H
95 #include <sys/socket.h>
100 #ifdef HAVE_NETINET_IN_SYSTM_H
101 #include <netinet/in_systm.h>
103 #ifdef HAVE_NETINET_IN_H
104 #include <netinet/in.h>
106 #ifdef HAVE_NETINET_IN6_H
107 #include <netinet/in6.h>
109 #ifdef HAVE_NET_ETHERNET_H
110 #include <net/ethernet.h>
112 #ifdef HAVE_NET_IF_ARP_H
113 #include <net/if_arp.h>
117 AC_CHECK_HEADERS([netinet/tcp.h netinet/ip_icmp.h netinet/icmp6.h],
119 [#ifdef HAVE_SYS_TYPES_H
120 #include <sys/types.h>
125 #ifdef HAVE_ARPA_INET_H
126 #include <arpa/inet.h>
128 #ifdef HAVE_SYS_SOCKET_H
129 #include <sys/socket.h>
134 #ifdef HAVE_NETINET_IN_SYSTM_H
135 #include <netinet/in_systm.h>
137 #ifdef HAVE_NETINET_IN_H
138 #include <netinet/in.h>
140 #ifdef HAVE_NETINET_IP_H
141 #include <netinet/ip.h>
143 #ifdef HAVE_NETINET_IN6_H
144 #include <netinet/in6.h>
146 #ifdef HAVE_NETINET_IP6_H
147 #include <netinet/ip6.h>
149 #ifdef HAVE_NET_ETHERNET_H
150 #include <net/ethernet.h>
152 #ifdef HAVE_NET_IF_ARP_H
153 #include <net/if_arp.h>
155 #ifdef HAVE_NETINET_IF_ETHER_H
156 #include <netinet/if_ether.h>
161 dnl Checks for typedefs, structures, and compiler characteristics.
169 dnl tinc_ATTRIBUTE(__malloc__)
171 AC_CHECK_TYPES([socklen_t, struct ether_header, struct arphdr, struct ether_arp, struct in_addr, struct addrinfo, struct ip, struct icmp, struct in6_addr, struct sockaddr_in6, struct ip6_hdr, struct icmp6_hdr, struct nd_neighbor_solicit, struct nd_opt_hdr], , ,
172 [#ifdef HAVE_SYS_TYPES_H
173 #include <sys/types.h>
178 #ifdef HAVE_ARPA_INET_H
179 #include <arpa/inet.h>
181 #ifdef HAVE_SYS_SOCKET_H
182 #include <sys/socket.h>
187 #ifdef HAVE_NETINET_IN_SYSTM_H
188 #include <netinet/in_systm.h>
190 #ifdef HAVE_NETINET_IN_H
191 #include <netinet/in.h>
193 #ifdef HAVE_NETINET_IP_H
194 #include <netinet/ip.h>
196 #ifdef HAVE_NETINET_TCP_H
197 #include <netinet/tcp.h>
199 #ifdef HAVE_NETINET_IN6_H
200 #include <netinet/in6.h>
202 #ifdef HAVE_NETINET_IP6_H
203 #include <netinet/ip6.h>
205 #ifdef HAVE_NET_ETHERNET_H
206 #include <net/ethernet.h>
208 #ifdef HAVE_NET_IF_ARP_H
209 #include <net/if_arp.h>
211 #ifdef HAVE_NETINET_IF_ETHER_H
212 #include <netinet/if_ether.h>
214 #ifdef HAVE_NETINET_IP_ICMP_H
215 #include <netinet/ip_icmp.h>
217 #ifdef HAVE_NETINET_ICMP6_H
218 #include <netinet/icmp6.h>
223 dnl Checks for library functions.
227 AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv vsyslog])
231 dnl Support for SunOS
233 AC_CHECK_FUNC(socket, [], [
234 AC_CHECK_LIB(socket, connect)
236 AC_CHECK_FUNC(gethostbyname, [], [
237 AC_CHECK_LIB(nsl, gethostbyname)
240 AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo inet_aton])
246 AM_PATH_LIBGNUTLS([1.4.0], [], [AC_MSG_ERROR([GNUTLS library not found.]); break])
247 AM_PATH_LIBGNUTLS_EXTRA([1.4.0], [], [AC_MSG_ERROR([GNUTLS extra library not found.]); break])
248 AM_PATH_LIBGCRYPT([1.2.0], [], [AC_MSG_ERROR([Gcrypt library not found.]); break])
250 AC_CONFIG_FILES([Makefile m4/Makefile])