3 AC_CONFIG_SRCDIR([tincd.c])
4 AM_INIT_AUTOMAKE(tinc, 2.0-svn)
5 AC_CONFIG_HEADERS([config.h])
8 dnl Include the macros from the m4/ directory
9 dnl AM_ACLOCAL_INCLUDE(m4)
11 dnl AM_GNU_GETTEXT([external])
12 dnl AM_GNU_GETTEXT_VERSION(0.14.1)
14 AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions])
15 AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions])
19 dnl Checks for programs.
22 AC_PROG_GCC_TRADITIONAL
37 AC_DEFINE(HAVE_LINUX, 1, [Linux])
40 AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
43 AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
46 AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
49 AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
52 AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
55 AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
58 AC_DEFINE(HAVE_MINGW, 1, [MinGW])
62 AC_MSG_ERROR("Unknown operating system.")
68 if test -d /sw/include ; then
69 CPPFLAGS="$CPPFLAGS -I/sw/include"
71 if test -d /sw/lib ; then
72 LIBS="$LIBS -L/sw/lib"
75 dnl Checks for libraries.
77 dnl Checks for header files.
78 dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
81 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])
82 AC_CHECK_HEADERS([net/if.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h],
84 [#ifdef HAVE_SYS_TYPES_H
85 #include <sys/types.h>
90 #ifdef HAVE_ARPA_INET_H
91 #include <arpa/inet.h>
93 #ifdef HAVE_SYS_SOCKET_H
94 #include <sys/socket.h>
98 AC_CHECK_HEADERS([netinet/if_ether.h netinet/ip.h netinet/ip6.h],
100 [#ifdef HAVE_SYS_TYPES_H
101 #include <sys/types.h>
106 #ifdef HAVE_ARPA_INET_H
107 #include <arpa/inet.h>
109 #ifdef HAVE_SYS_SOCKET_H
110 #include <sys/socket.h>
115 #ifdef HAVE_NETINET_IN_SYSTM_H
116 #include <netinet/in_systm.h>
118 #ifdef HAVE_NETINET_IN_H
119 #include <netinet/in.h>
121 #ifdef HAVE_NETINET_IN6_H
122 #include <netinet/in6.h>
124 #ifdef HAVE_NET_ETHERNET_H
125 #include <net/ethernet.h>
127 #ifdef HAVE_NET_IF_ARP_H
128 #include <net/if_arp.h>
132 AC_CHECK_HEADERS([netinet/tcp.h netinet/ip_icmp.h netinet/icmp6.h],
134 [#ifdef HAVE_SYS_TYPES_H
135 #include <sys/types.h>
140 #ifdef HAVE_ARPA_INET_H
141 #include <arpa/inet.h>
143 #ifdef HAVE_SYS_SOCKET_H
144 #include <sys/socket.h>
149 #ifdef HAVE_NETINET_IN_SYSTM_H
150 #include <netinet/in_systm.h>
152 #ifdef HAVE_NETINET_IN_H
153 #include <netinet/in.h>
155 #ifdef HAVE_NETINET_IP_H
156 #include <netinet/ip.h>
158 #ifdef HAVE_NETINET_IN6_H
159 #include <netinet/in6.h>
161 #ifdef HAVE_NETINET_IP6_H
162 #include <netinet/ip6.h>
164 #ifdef HAVE_NET_ETHERNET_H
165 #include <net/ethernet.h>
167 #ifdef HAVE_NET_IF_ARP_H
168 #include <net/if_arp.h>
170 #ifdef HAVE_NETINET_IF_ETHER_H
171 #include <netinet/if_ether.h>
176 dnl Checks for typedefs, structures, and compiler characteristics.
184 dnl tinc_ATTRIBUTE(__malloc__)
186 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], , ,
187 [#ifdef HAVE_SYS_TYPES_H
188 #include <sys/types.h>
193 #ifdef HAVE_ARPA_INET_H
194 #include <arpa/inet.h>
196 #ifdef HAVE_SYS_SOCKET_H
197 #include <sys/socket.h>
202 #ifdef HAVE_NETINET_IN_SYSTM_H
203 #include <netinet/in_systm.h>
205 #ifdef HAVE_NETINET_IN_H
206 #include <netinet/in.h>
208 #ifdef HAVE_NETINET_IP_H
209 #include <netinet/ip.h>
211 #ifdef HAVE_NETINET_TCP_H
212 #include <netinet/tcp.h>
214 #ifdef HAVE_NETINET_IN6_H
215 #include <netinet/in6.h>
217 #ifdef HAVE_NETINET_IP6_H
218 #include <netinet/ip6.h>
220 #ifdef HAVE_NET_ETHERNET_H
221 #include <net/ethernet.h>
223 #ifdef HAVE_NET_IF_ARP_H
224 #include <net/if_arp.h>
226 #ifdef HAVE_NETINET_IF_ETHER_H
227 #include <netinet/if_ether.h>
229 #ifdef HAVE_NETINET_IP_ICMP_H
230 #include <netinet/ip_icmp.h>
232 #ifdef HAVE_NETINET_ICMP6_H
233 #include <netinet/icmp6.h>
238 dnl Checks for library functions.
242 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])
246 dnl Support for SunOS
248 AC_CHECK_FUNC(socket, [], [
249 AC_CHECK_LIB(socket, connect)
251 AC_CHECK_FUNC(gethostbyname, [], [
252 AC_CHECK_LIB(nsl, gethostbyname)
255 AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo inet_aton])
259 dnl These are defined in files in m4/
271 AM_PATH_LIBGNUTLS([1.0.4], [], [AC_MSG_ERROR([GNUTLS library not found.]); break])
273 dnl Check if support for jumbograms is requested
274 dnl AC_ARG_ENABLE(jumbograms,
275 dnl AS_HELP_STRING(--enable-jumbograms,enable support for jumbograms (packets up to 9000 bytes)),
276 dnl [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ]
279 dnl Check if checkpoint tracing has to be enabled
280 dnl AC_ARG_ENABLE(tracing,
281 dnl AS_HELP_STRING(--enable-tracing,enable checkpoint tracing (debugging only)),
282 dnl [ AC_DEFINE(ENABLE_TRACING, 1, [Checkpoint tracing]) ]
285 dnl AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile doc/tincd.8 doc/tinc.conf.5 doc/tincinclude.texi lib/Makefile po/Makefile.in m4/Makefile])
286 AC_CONFIG_FILES([Makefile cfg/Makefile fd/Makefile logger/Makefile rt/Makefile support/Makefile tnl/Makefile vnd/Makefile])