1 dnl Process this file with autoconf to produce a configure script.
3 dnl $Id: configure.in,v 1.13.2.38 2001/11/15 23:49:46 zarq 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 [ ln -sf linux/device.c src/device.c ]
42 AC_DEFINE(HAVE_FREEBSD)
43 [ ln -sf freebsd/device.c src/device.c ]
46 AC_DEFINE(HAVE_SOLARIS)
47 [ ln -sf solaris/device.c src/device.c ]
50 AC_DEFINE(HAVE_OPENBSD)
51 [ ln -sf openbsd/device.c src/device.c ]
57 dnl Checks for libraries.
59 dnl Checks for header files.
61 AC_CHECK_HEADERS([fcntl.h limits.h sys/ioctl.h syslog.h unistd.h \
62 sys/time.h malloc.h strings.h sys/file.h])
64 dnl Checks for typedefs, structures, and compiler characteristics.
71 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
74 #include <sys/types.h>
75 #include <sys/socket.h>
78 [ struct addrinfo s; s.ai_flags = 0; ],
79 [ ac_cv_have_struct_addrinfo="yes" ],
80 [ ac_cv_have_struct_addrinfo="no" ]
82 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
83 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
86 dnl Checks for library functions.
90 AC_CHECK_FUNCS([ftime socket select strtol strerror flock unsetenv \
91 asprintf putenv strdup fcloseall daemon strsignal get_current_dir_name \
92 getaddrinfo getnameinfo gai_strerror freeaddrinfo])
101 AC_CHECK_FUNC(socket, [], [
102 AC_CHECK_LIB(socket, connect)
104 AC_CHECK_FUNC(gethostbyname, [], [
105 AC_CHECK_LIB(nsl, gethostbyname)
110 dnl These are defined in files in m4/
114 dnl Check if checkpoint tracing has to be enabled
115 AC_ARG_ENABLE(tracing,
116 [ --enable-tracing enable checkpoint tracing (debugging only)],
117 [ AC_DEFINE(ENABLE_TRACING) ]