Removed definitions of ipv4_t, ipv6_t, port_t
[tinc] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 dnl $Id: configure.in,v 1.13.2.38 2001/11/15 23:49:46 zarq Exp $
4
5 AC_INIT(src/tincd.c)
6 AM_INIT_AUTOMAKE(tinc, 1.0-cvs)
7 AM_CONFIG_HEADER(config.h)
8
9 dnl Include the macros from the m4/ directory
10 AM_ACLOCAL_INCLUDE(m4)
11
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])
16
17 ALL_LINGUAS="nl"
18
19 dnl Checks for programs.
20 AC_PROG_CC
21 AC_PROG_CPP
22 AC_PROG_GCC_TRADITIONAL
23 AC_PROG_AWK
24 AC_PROG_INSTALL
25 AC_PROG_LN_S
26 AC_PROG_MAKE_SET
27 jm_PERL
28
29
30 AC_ISC_POSIX
31
32 dnl Check and set OS
33
34 AC_CANONICAL_HOST
35
36 case $host_os in
37   *linux*)
38     AC_DEFINE(HAVE_LINUX)
39     [ ln -sf linux/device.c src/device.c ]
40   ;;
41   *freebsd*)
42     AC_DEFINE(HAVE_FREEBSD)
43     [ ln -sf freebsd/device.c src/device.c ]
44   ;;
45   *solaris*)
46     AC_DEFINE(HAVE_SOLARIS)
47     [ ln -sf solaris/device.c src/device.c ]
48   ;;
49   *openbsd*)
50     AC_DEFINE(HAVE_OPENBSD)
51     [ ln -sf openbsd/device.c src/device.c ]
52   ;;
53 esac
54
55 AC_CACHE_SAVE
56
57 dnl Checks for libraries.
58
59 dnl Checks for header files.
60 AC_HEADER_STDC
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])
63
64 dnl Checks for typedefs, structures, and compiler characteristics.
65 AC_C_CONST
66 AC_TYPE_PID_T
67 AC_TYPE_SIZE_T
68 AC_HEADER_TIME
69 AC_STRUCT_TM
70
71 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
72   AC_TRY_COMPILE(
73     [
74 #include <sys/types.h>
75 #include <sys/socket.h>
76 #include <netdb.h>
77     ],
78     [ struct addrinfo s; s.ai_flags = 0; ],
79     [ ac_cv_have_struct_addrinfo="yes" ],
80     [ ac_cv_have_struct_addrinfo="no" ]
81   )])
82 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
83   AC_DEFINE(HAVE_STRUCT_ADDRINFO)
84 fi
85
86 dnl Checks for library functions.
87 AC_FUNC_MEMCMP
88 AC_FUNC_ALLOCA
89 AC_TYPE_SIGNAL
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])
93 jm_FUNC_MALLOC
94 jm_FUNC_REALLOC
95
96 AM_GNU_GETTEXT
97
98
99 dnl Support for SunOS
100
101 AC_CHECK_FUNC(socket, [], [
102   AC_CHECK_LIB(socket, connect)
103 ])
104 AC_CHECK_FUNC(gethostbyname, [], [
105   AC_CHECK_LIB(nsl, gethostbyname)
106 ])
107
108 AC_CACHE_SAVE
109
110 dnl These are defined in files in m4/
111 tinc_TUNTAP
112 tinc_OPENSSL
113
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) ]
118 )
119
120 AC_SUBST(INCLUDES)
121
122 AC_OUTPUT(Makefile
123 src/Makefile
124 doc/Makefile
125 doc/es/Makefile
126 intl/Makefile
127 lib/Makefile
128 m4/Makefile
129 po/Makefile.in
130 redhat/Makefile
131 debian/Makefile)