1 dnl Process this file with autoconf to produce a configure script.
3 dnl $Id: configure.in,v 1.13.2.62 2003/07/06 17:15:24 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_MSG_ERROR("Unknown operating system.")
77 if test -d /sw/include ; then
78 CPPFLAGS="$CPPFLAGS -I/sw/include"
80 if test -d /sw/lib ; then
81 LIBS="$LIBS -L/sw/lib"
84 dnl Checks for libraries.
86 dnl Checks for header files.
88 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \
89 sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h])
90 AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h], [], [],
91 [#include <sys/types.h>
92 #include <sys/socket.h>
93 #ifdef HAVE_NETINET_IN_SYSTM_H
94 #include <netinet/in_systm.h>
97 dnl Checks for typedefs, structures, and compiler characteristics.
104 AC_CHECK_TYPES([socklen_t, struct addrinfo, struct sockaddr_in6], , ,
105 [#include <sys/types.h>
106 #include <sys/socket.h>
108 #include <netinet/in.h>
112 dnl Checks for library functions.
116 AC_CHECK_FUNCS([asprintf daemon fcloseall flock ftime get_current_dir_name \
117 putenv select strdup strerror strsignal strtol unsetenv mlockall])
121 dnl Support for SunOS
123 AC_CHECK_FUNC(socket, [], [
124 AC_CHECK_LIB(socket, connect)
126 AC_CHECK_FUNC(gethostbyname, [], [
127 AC_CHECK_LIB(nsl, gethostbyname)
130 AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo])
134 dnl These are defined in files in m4/
140 dnl Check if support for jumbograms is requested
141 AC_ARG_ENABLE(jumbograms,
142 [ --enable-jumbograms enable support for jumbograms (packets up to 9000 bytes)],
143 [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ]
146 dnl Check if checkpoint tracing has to be enabled
147 AC_ARG_ENABLE(tracing,
148 [ --enable-tracing enable checkpoint tracing (debugging only)],
149 [ AC_DEFINE(ENABLE_TRACING, 1, [Checkpoint tracing]) ]