1 dnl Process this file with autoconf to produce a configure script.
3 dnl $Id: configure.in,v 1.13.2.50 2002/06/10 14:35:18 guus Exp $
6 AM_INIT_AUTOMAKE(tinc, 1.0-cvs)
7 AM_CONFIG_HEADER(config.h)
9 dnl Include the macros from the m4/ directory
10 AM_ACLOCAL_INCLUDE(m4)
12 # Enable GNU extensions.
13 # Define this here, not in acconfig's @TOP@ section, since definitions
14 # in the latter don't make it into the configure-time tests.
15 AC_DEFINE([_GNU_SOURCE], [__USE_BSD])
19 dnl Checks for programs.
22 AC_PROG_GCC_TRADITIONAL
39 [ rm -f src/device.c; ln -sf linux/device.c src/device.c ]
42 AC_DEFINE(HAVE_FREEBSD)
43 [ rm -f src/device.c; ln -sf freebsd/device.c src/device.c ]
46 AC_DEFINE(HAVE_DARWIN)
47 [ rm -f src/device.c; ln -sf darwin/device.c src/device.c ]
50 AC_DEFINE(HAVE_SOLARIS)
51 [ rm -f src/device.c; ln -sf solaris/device.c src/device.c ]
54 AC_DEFINE(HAVE_OPENBSD)
55 [ rm -f src/device.c; ln -sf openbsd/device.c src/device.c ]
58 AC_DEFINE(HAVE_NETBSD)
59 [ rm -f src/device.c; ln -sf netbsd/device.c src/device.c ]
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.
79 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \
80 net/ethernet.h net/if.h netinet/in_systm.h netinet/ip.h netinet/tcp.h \
81 sys/file.h sys/ioctl.h sys/param.h sys/time.h])
83 dnl Checks for typedefs, structures, and compiler characteristics.
90 AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
93 [#include <sys/types.h>
94 #include <sys/socket.h>],
95 [socklen_t len = 42; return len;],
96 ac_cv_type_socklen_t=yes,
97 ac_cv_type_socklen_t=no)
99 if test $ac_cv_type_socklen_t = yes; then
100 AC_DEFINE(HAVE_SOCKLEN_T)
103 dnl Checks for library functions.
107 AC_CHECK_FUNCS([asprintf daemon fcloseall flock ftime get_current_dir_name \
108 putenv select strdup strerror strsignal strtol unsetenv getnameinfo])
114 dnl Support for SunOS
116 AC_CHECK_FUNC(socket, [], [
117 AC_CHECK_LIB(socket, connect)
119 AC_CHECK_FUNC(gethostbyname, [], [
120 AC_CHECK_LIB(nsl, gethostbyname)
125 dnl These are defined in files in m4/
130 dnl Check if support for jumbograms is requested
131 AC_ARG_ENABLE(jumbograms,
132 [ --enable-jumbograms enable support for jumbograms (packets up to 9000 bytes)],
133 [ AC_DEFINE(ENABLE_JUMBOGRAMS) ]
136 dnl Check if checkpoint tracing has to be enabled
137 AC_ARG_ENABLE(tracing,
138 [ --enable-tracing enable checkpoint tracing (debugging only)],
139 [ AC_DEFINE(ENABLE_TRACING) ]