Remove forgotten braces.
[oweals/tinc.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 dnl $Id: configure.in,v 1.13.2.77 2003/07/31 11:17:39 guus Exp $
4
5 AC_PREREQ(2.57)
6 AC_INIT(src/tincd.c)
7 AM_INIT_AUTOMAKE(tinc, 1.0-cvs)
8 AM_CONFIG_HEADER(config.h)
9 AM_MAINTAINER_MODE
10
11 dnl Include the macros from the m4/ directory
12 AM_ACLOCAL_INCLUDE(m4)
13
14 AM_GNU_GETTEXT([external])
15 AM_GNU_GETTEXT_VERSION(0.12.1)
16
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])
22
23 ALL_LINGUAS="nl"
24
25 dnl Checks for programs.
26 AC_PROG_CC
27 AC_PROG_CPP
28 AC_PROG_GCC_TRADITIONAL
29 AC_PROG_AWK
30 AC_PROG_INSTALL
31 AC_PROG_LN_S
32 AC_PROG_MAKE_SET
33 AC_PROG_RANLIB
34
35 AC_ISC_POSIX
36
37 dnl Check and set OS
38
39 #AC_CANONICAL_HOST
40
41 case $host_os in
42   *linux*)
43     AC_DEFINE(HAVE_LINUX, 1, [Linux])
44     [ rm -f src/device.c; ln -sf linux/device.c src/device.c ]
45   ;;
46   *freebsd*)
47     AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
48     [ rm -f src/device.c; ln -sf freebsd/device.c src/device.c ]
49   ;;
50   *darwin*)
51     AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
52     [ rm -f src/device.c; ln -sf darwin/device.c src/device.c ]
53   ;;
54   *solaris*)
55     AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
56     [ rm -f src/device.c; ln -sf solaris/device.c src/device.c ]
57   ;;
58   *openbsd*)
59     AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
60     [ rm -f src/device.c; ln -sf openbsd/device.c src/device.c ]
61   ;;
62   *netbsd*)
63     AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
64     [ rm -f src/device.c; ln -sf netbsd/device.c src/device.c ]
65   ;;
66   *cygwin*)
67     AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
68     [ rm -f src/device.c; ln -sf cygwin/device.c src/device.c ]
69   ;;
70   *mingw*)
71     AC_DEFINE(HAVE_MINGW, 1, [MinGW])
72     [ rm -f src/device.c; ln -sf mingw/device.c src/device.c ]
73   ;;
74   *)
75     AC_MSG_ERROR("Unknown operating system.")
76   ;;
77 esac
78
79 AC_CACHE_SAVE
80
81 if test -d /sw/include ; then
82   CPPFLAGS="$CPPFLAGS -I/sw/include"
83 fi
84 if test -d /sw/lib ; then
85   LIBS="$LIBS -L/sw/lib"
86 fi
87
88 dnl Checks for libraries.
89
90 dnl Checks for header files.
91 AC_HEADER_STDC
92 AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/param.h sys/time.h sys/socket.h sys/wait.h sys/mman.h netdb.h arpa/inet.h netinet/in_systm.h netinet/in.h])
93 AC_CHECK_HEADERS([net/ethernet.h net/if.h net/if_arp.h netinet/if_ether.h netinet/ip.h netinet/tcp.h netinet/ip_icmp.h netinet/ip6.h netinet/icmp6.h],
94   [], [],
95   [#ifdef HAVE_SYS_TYPES_H
96    #include <sys/types.h>
97    #endif
98    #ifdef HAVE_SYS_SOCKET_H
99    #include <sys/socket.h>
100    #endif
101    #ifdef HAVE_NETINET_IN_SYSTM_H
102    #include <netinet/in_systm.h>
103    #endif
104    #ifdef HAVE_NETINET_IN_H
105    #include <netinet/in.h>
106    #endif
107   ]
108 )
109
110 dnl Checks for typedefs, structures, and compiler characteristics.
111 AC_C_CONST
112 AC_C_VOLATILE
113 AC_TYPE_PID_T
114 AC_TYPE_SIZE_T
115 AC_HEADER_TIME
116 AC_STRUCT_TM
117
118 tinc_ATTRIBUTE(__malloc__)
119
120 AC_CHECK_TYPES([socklen_t, struct arphdr, struct ether_arp, struct in_addr, struct addrinfo, struct ip, struct icmp, struct in6_addr, struct sockaddr_in6, struct ip6_hdr, struct icmp6_hdr, struct nd_neighbor_solicit, struct nd_opt_hdr], , ,
121   [#ifdef HAVE_SYS_TYPES_H
122    #include <sys/types.h>
123    #endif
124    #ifdef HAVE_SYS_SOCKET_H
125    #include <sys/socket.h>
126    #endif
127    #ifdef HAVE_NETDB_H
128    #include <netdb.h>
129    #endif
130    #ifdef HAVE_NET_IF_ARP_H
131    #include <net/if_arp.h>
132    #endif
133    #ifdef HAVE_NETINET_IF_ETHER_H
134    #include <netinet/if_ether.h>
135    #endif
136    #ifdef HAVE_NETINET_IN_SYSTM_H
137    #include <netinet/in_systm.h>
138    #endif
139    #ifdef HAVE_NETINET_IN_H
140    #include <netinet/in.h>
141    #endif
142    #ifdef HAVE_NETINET_IP_H
143    #include <netinet/ip.h>
144    #endif
145    #ifdef HAVE_NETINET_IP_ICMP_H
146    #include <netinet/ip_icmp.h>
147    #endif
148    #ifdef HAVE_NETINET_IP6_H
149    #include <netinet/ip6.h>
150    #endif
151    #ifdef HAVE_NETINET_ICMP6_H
152    #include <netinet/icmp6.h>
153    #endif
154   ]
155 )
156
157 dnl Checks for library functions.
158 AC_FUNC_MEMCMP
159 AC_FUNC_ALLOCA
160 AC_TYPE_SIGNAL
161 AC_CHECK_FUNCS([asprintf daemon fcloseall flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol unsetenv vsyslog])
162 jm_FUNC_MALLOC
163 jm_FUNC_REALLOC
164
165 dnl Support for SunOS
166
167 AC_CHECK_FUNC(socket, [], [
168   AC_CHECK_LIB(socket, connect)
169 ])
170 AC_CHECK_FUNC(gethostbyname, [], [
171   AC_CHECK_LIB(nsl, gethostbyname)
172 ])
173
174 AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo inet_aton])
175
176 AC_CACHE_SAVE
177
178 dnl These are defined in files in m4/
179
180 case $host_os in
181   *linux*)
182     tinc_TUNTAP
183   ;;
184 esac
185
186 tinc_OPENSSL
187 tinc_ZLIB
188 tinc_LZO
189
190 dnl Check if support for jumbograms is requested 
191 AC_ARG_ENABLE(jumbograms,
192   AC_HELP_STRING([--enable-jumbograms], [enable support for jumbograms (packets up to 9000 bytes)]),
193   [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ]
194 )
195
196 dnl Check if checkpoint tracing has to be enabled
197 AC_ARG_ENABLE(tracing,
198   AC_HELP_STRING([--enable-tracing], [enable checkpoint tracing (debugging only)]),
199   [ AC_DEFINE(ENABLE_TRACING, 1, [Checkpoint tracing]) ]
200 )
201
202 AC_SUBST(INCLUDES)
203
204 AC_OUTPUT(Makefile 
205 src/Makefile
206 doc/Makefile
207 lib/Makefile
208 po/Makefile.in
209 m4/Makefile
210 )