1 dnl Process this file with autoconf to produce a configure script.
3 dnl $Id: configure.in,v 1.13.2.73 2003/07/29 11:50:39 guus Exp $
7 AM_INIT_AUTOMAKE(tinc, 1.0-cvs)
8 AM_CONFIG_HEADER(config.h)
11 dnl Include the macros from the m4/ directory
12 AM_ACLOCAL_INCLUDE(m4)
14 AM_GNU_GETTEXT([external])
15 AM_GNU_GETTEXT_VERSION(0.12.1)
17 # Enable GNU extensions.
18 # Define this here, not in acconfig's @TOP@ section, since definitions
19 # in the latter don't make it into the configure-time tests.
20 AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions])
21 AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions])
25 dnl Checks for programs.
28 AC_PROG_GCC_TRADITIONAL
43 AC_DEFINE(HAVE_LINUX, 1, [Linux])
44 [ rm -f src/device.c; ln -sf linux/device.c src/device.c ]
47 AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
48 [ rm -f src/device.c; ln -sf freebsd/device.c src/device.c ]
51 AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
52 [ rm -f src/device.c; ln -sf darwin/device.c src/device.c ]
55 AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
56 [ rm -f src/device.c; ln -sf solaris/device.c src/device.c ]
59 AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
60 [ rm -f src/device.c; ln -sf openbsd/device.c src/device.c ]
63 AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
64 [ rm -f src/device.c; ln -sf netbsd/device.c src/device.c ]
67 AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
68 [ rm -f src/device.c; ln -sf cygwin/device.c src/device.c ]
71 AC_DEFINE(HAVE_MINGW, 1, [MinGW])
72 [ rm -f src/device.c; ln -sf mingw/device.c src/device.c ]
75 AC_MSG_ERROR("Unknown operating system.")
81 if test -d /sw/include ; then
82 CPPFLAGS="$CPPFLAGS -I/sw/include"
84 if test -d /sw/lib ; then
85 LIBS="$LIBS -L/sw/lib"
88 dnl Checks for libraries.
90 dnl Checks for header files.
92 AC_CHECK_HEADERS([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 netinet/in_systm.h netinet/in.h])
93 AC_CHECK_HEADERS([net/ethernet.h net/if.h net/if_arp.h netinet/if_ether.h netinet/ip.h netinet/tcp.h netinet/ip_icmp.h netinet/ip6.h netinet/icmp6.h],
95 [#ifdef HAVE_SYS_TYPES_H
96 #include <sys/types.h>
98 #ifdef HAVE_SYS_SOCKET_H
99 #include <sys/socket.h>
101 #ifdef HAVE_NETINET_IN_SYSTM_H
102 #include <netinet/in_systm.h>
104 #ifdef HAVE_NETINET_IN_H
105 #include <netinet/in.h>
110 dnl Checks for typedefs, structures, and compiler characteristics.
117 AC_CHECK_TYPES([socklen_t, 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], , ,
118 [#ifdef HAVE_SYS_TYPES_H
119 #include <sys/types.h>
121 #ifdef HAVE_SYS_SOCKET_H
122 #include <sys/socket.h>
127 #ifdef HAVE_NET_IF_ARP_H
128 #include <net/if_arp.h>
130 #ifdef HAVE_NETINET_IF_ETHER_H
131 #include <netinet/if_ether.h>
133 #ifdef HAVE_NETINET_IN_SYSTM_H
134 #include <netinet/in_systm.h>
136 #ifdef HAVE_NETINET_IN_H
137 #include <netinet/in.h>
139 #ifdef HAVE_NETINET_IP_H
140 #include <netinet/ip.h>
142 #ifdef HAVE_NETINET_IP_ICMP_H
143 #include <netinet/ip_icmp.h>
145 #ifdef HAVE_NETINET_IP6_H
146 #include <netinet/ip6.h>
148 #ifdef HAVE_NETINET_ICMP6_H
149 #include <netinet/icmp6.h>
154 dnl Checks for library functions.
158 AC_CHECK_FUNCS([asprintf daemon fcloseall flock ftime fork get_current_dir_name gettimeofday mlockall putenv select strdup strerror strsignal strtol unsetenv vsyslog])
162 dnl Support for SunOS
164 AC_CHECK_FUNC(socket, [], [
165 AC_CHECK_LIB(socket, connect)
167 AC_CHECK_FUNC(gethostbyname, [], [
168 AC_CHECK_LIB(nsl, gethostbyname)
171 AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo inet_aton])
175 dnl These are defined in files in m4/
187 dnl Check if support for jumbograms is requested
188 AC_ARG_ENABLE(jumbograms,
189 AC_HELP_STRING([--enable-jumbograms], [enable support for jumbograms (packets up to 9000 bytes)]),
190 [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ]
193 dnl Check if checkpoint tracing has to be enabled
194 AC_ARG_ENABLE(tracing,
195 AC_HELP_STRING([--enable-tracing], [enable checkpoint tracing (debugging only)]),
196 [ AC_DEFINE(ENABLE_TRACING, 1, [Checkpoint tracing]) ]