1 dnl Process this file with autoconf to produce a configure script.
3 dnl $Id: configure.in,v 1.13.2.67 2003/07/17 15:06:25 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.11.5)
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_CYGWIN, 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 \
93 sys/time.h sys/socket.h sys/wait.h netdb.h arpa/inet.h netinet/in_systm.h])
94 AC_CHECK_HEADERS([net/ethernet.h net/if.h net/if_arp.h netinet/if_ether.h netinet/ip.h \
95 netinet/tcp.h netinet/ip_icmp.h netinet/ip6.h netinet/icmp6.h],
97 [#include <sys/types.h>
98 #include <sys/socket.h>
99 #ifdef HAVE_NETINET_IN_SYSTM_H
100 #include <netinet/in_systm.h>
105 dnl Checks for typedefs, structures, and compiler characteristics.
112 AC_CHECK_TYPES([socklen_t, struct addrinfo, struct in6_addr, struct sockaddr_in6], , ,
113 [#include <sys/types.h>
114 #include <sys/socket.h>
116 #include <netinet/in.h>
120 dnl Checks for library functions.
124 AC_CHECK_FUNCS([asprintf daemon fcloseall flock ftime get_current_dir_name \
125 putenv select strdup strerror strsignal strtol unsetenv mlockall vsyslog])
129 dnl Support for SunOS
131 AC_CHECK_FUNC(socket, [], [
132 AC_CHECK_LIB(socket, connect)
134 AC_CHECK_FUNC(gethostbyname, [], [
135 AC_CHECK_LIB(nsl, gethostbyname)
138 AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo inet_aton])
142 dnl These are defined in files in m4/
148 dnl Check if support for jumbograms is requested
149 AC_ARG_ENABLE(jumbograms,
150 [ --enable-jumbograms enable support for jumbograms (packets up to 9000 bytes)],
151 [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ]
154 dnl Check if checkpoint tracing has to be enabled
155 AC_ARG_ENABLE(tracing,
156 [ --enable-tracing enable checkpoint tracing (debugging only)],
157 [ AC_DEFINE(ENABLE_TRACING, 1, [Checkpoint tracing]) ]