ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/configure.ac
Revision: 1.36
Committed: Thu Mar 17 23:59:37 2005 UTC (19 years, 2 months ago) by pcg
Branch: MAIN
Changes since 1.35: +3 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.59)
4 AC_INIT
5 AC_CONFIG_SRCDIR([src/vped.C])
6 AC_CANONICAL_TARGET
7 AM_INIT_AUTOMAKE(gvpe, 1.8)
8 AC_CONFIG_HEADERS([config.h])
9 AM_MAINTAINER_MODE
10
11 AH_TOP([
12 #ifndef CONFIG_H__
13 #define CONFIG_H__
14
15 #ifdef __cplusplus
16 using namespace std;
17 #endif
18
19 ])
20
21 AH_BOTTOM([
22 typedef unsigned char u8;
23 typedef signed char s8;
24
25 #if __CYGWIN__
26
27 typedef unsigned short u16;
28 typedef unsigned int u32;
29 typedef signed short s16;
30 typedef signed int s32;
31
32 #else
33 #include <inttypes.h>
34
35 /* old modula-2 habits */
36 typedef uint16_t u16;
37 typedef uint32_t u32;
38 typedef int16_t s16;
39 typedef int32_t s32;
40 #endif
41
42 #endif
43 ])
44
45 dnl Include the macros from the m4/ directory
46 AM_ACLOCAL_INCLUDE(m4)
47
48 AM_GNU_GETTEXT([external])
49 AM_GNU_GETTEXT_VERSION(0.11.5)
50
51 # Enable GNU extensions.
52 # Define this here, not in acconfig's @TOP@ section, since definitions
53 # in the latter don't make it into the configure-time tests.
54 AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions])
55
56 # do NOT define POSIX_SOURCE, sicne this clashes with many BSDs
57 dnl AC_DEFINE([_POSIX_SOURCE], 1, [Enable POSIX 1003.1 extensions])
58 dnl AC_DEFINE([_XOPEN_SOURCE], 500, [Enable XOPEN extensions])
59
60 ALL_LINGUAS=""
61
62 dnl Checks for programs.
63 AC_PROG_CC
64 AC_PROG_CPP
65 AC_PROG_CXX
66 AC_PROG_GCC_TRADITIONAL
67 AC_PROG_AWK
68 AC_PROG_INSTALL
69 AC_PROG_LN_S
70 AC_PROG_MAKE_SET
71 AC_PROG_RANLIB
72
73 AC_ARG_ENABLE(iftype,
74 [AS_HELP_STRING(--enable-iftype=TYPE/SUBTYPE,
75 Use kernel/net device interface TYPE/SUBTYPE.
76 Working combinations are:
77 "native/linux"
78 "tincd/linux"
79 "tincd/freebsd"
80 "tincd/openbsd"
81 "tincd/darwin"
82 "native/cygwin";
83 Untested combinations are:
84 "tincd/netbsd"
85 "tincd/solaris"
86 "tincd/mingw"
87 "tincd/raw_socket"
88 "tincd/uml_socket";
89 Broken combinations are:
90 "tincd/cygwin";
91 The default is to autodetect.
92 )],
93 [
94 IFTYPE=`echo $enableval | sed s%/.*%%`
95 IFSUBTYPE=`echo $enableval | sed s%.*/%%`
96 ]
97 )
98
99 dnl Check and set OS
100 AC_MSG_CHECKING(for kernel networking interface type)
101
102 if test "x$IFTYPE" = "x"; then
103 case $target_os in
104 *linux*)
105 IFTYPE=native
106 IFSUBTYPE=linux
107 AC_DEFINE(HAVE_LINUX, 1, [Linux])
108 ;;
109 *freebsd*)
110 IFTYPE=tincd
111 IFSUBTYPE=freebsd
112 AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
113 ;;
114 *darwin*)
115 IFTYPE=tincd
116 IFSUBTYPE=darwin
117 AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
118 ;;
119 *solaris*)
120 IFTYPE=tincd
121 IFSUBTYPE=solaris
122 AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
123 ;;
124 *openbsd*)
125 IFTYPE=tincd
126 IFSUBTYPE=openbsd
127 AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
128 ;;
129 *netbsd*)
130 IFTYPE=tincd
131 IFSUBTYPE=netbsd
132 AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
133 ;;
134 *cygwin*)
135 IFTYPE=native
136 IFSUBTYPE=cygwin
137 AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
138 ;;
139 *)
140 AC_MSG_ERROR("Unknown operating system.")
141 ;;
142 esac
143 fi
144 AC_MSG_RESULT($IFTYPE/$IFSUBTYPE)
145 AC_SUBST(IFTYPE,$IFTYPE)
146 AC_SUBST(IFSUBTYPE,$IFSUBTYPE)
147 AC_DEFINE_UNQUOTED(IFTYPE,"$IFTYPE",[kernel interface type])
148 AC_DEFINE_UNQUOTED(IFSUBTYPE,"$IFSUBTYPE",[kernel interface subtype])
149
150 AC_CACHE_SAVE
151
152 dnl Checks for libraries.
153
154 AC_LANG(C++)
155 AC_CHECK_HEADERS(ext/hash_map)
156
157 dnl Checks for header files.
158 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \
159 sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h \
160 sys/mman.h netinet/in.h])
161 AC_CHECK_HEADERS([arpa/inet.h net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [],
162 [
163 #include <sys/types.h>
164 #include <sys/socket.h>
165 #ifdef HAVE_NETINET_IN_H
166 # include <netinet/in.h>
167 #endif
168 #ifdef HAVE_ARPA_INET_H
169 # include <arpa/inet.h>
170 #endif
171 #ifdef HAVE_NETINET_IN_SYSTM_H
172 # include <netinet/in_systm.h>
173 #endif
174 ])
175
176 dnl Checks for typedefs, structures, and compiler characteristics.
177 AC_C_CONST
178 AC_TYPE_PID_T
179 AC_TYPE_SIZE_T
180 AC_HEADER_TIME
181 AC_STRUCT_TM
182
183 AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
184 [
185 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
186 #include <sys/socket.h>]], [[socklen_t len = 42; return len;]])],[ac_cv_type_socklen_t=yes],[ac_cv_type_socklen_t=no])
187 ])
188 if test $ac_cv_type_socklen_t = yes; then
189 AC_DEFINE(HAVE_SOCKLEN_T, 1, [socklen_t available])
190 fi
191
192 AC_CACHE_CHECK([for struct addrinfo], ac_cv_struct_addrinfo,
193 [
194 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
195 #include <sys/socket.h>
196 #include <netdb.h>]], [[struct addrinfo ai; ai.ai_family = AF_INET; return ai.ai_family;]])],[ac_cv_struct_addrinfo=yes],[ac_cv_struct_addrinfo=no])
197 ])
198 if test $ac_cv_struct_addrinfo = yes; then
199 AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [struct addrinfo available])
200 fi
201
202 dnl Checks for library functions.
203 AC_TYPE_SIGNAL
204
205 AC_LANG_PUSH(C)
206
207 AC_HEADER_STDC
208
209 dnl argl, could somebody catapult darwin into the 21st century???
210 AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall)
211
212 AC_FUNC_ALLOCA
213
214 dnl Support for SunOS
215
216 AC_CHECK_FUNC(socket, [], [
217 AC_CHECK_LIB(socket, connect)
218 ])
219 AC_CHECK_FUNC(gethostbyname, [], [
220 AC_CHECK_LIB(nsl, gethostbyname)
221 ])
222
223 AC_LANG_POP
224
225 dnl AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo])
226
227 AC_CACHE_SAVE
228
229 dnl These are defined in files in m4/
230 tinc_TUNTAP
231
232 tinc_OPENSSL
233 if test "x$openssl_include" != x; then
234 CXXFLAGS="$CXXFLAGS -I$openssl_include"
235 fi
236 dnl tinc_ZLIB
237
238 AC_ARG_ENABLE(static-daemon,
239 [AS_HELP_STRING(--enable-static-daemon,enable statically linked daemon.)],
240 [LDFLAGS_DAEMON=-static]
241 )
242 AC_SUBST(LDFLAGS_DAEMON)
243
244 AC_ARG_ENABLE(rohc,
245 [AS_HELP_STRING(--enable-rohc,enable robust header compression (rfc3095).)],
246 [
247 echo
248 echo "**********************************************************************"
249 echo "**********************************************************************"
250 echo "**** --enable-rohc is highly experimental, do not use ****************"
251 echo "**********************************************************************"
252 echo "**********************************************************************"
253 echo
254 rohc=true
255 AC_DEFINE_UNQUOTED(ENABLE_ROHC, 1, [ROHC support])
256 ]
257 )
258
259 AM_CONDITIONAL(ROHC, test x$rohc = xtrue)
260
261 AC_ARG_ENABLE(icmp,
262 [AS_HELP_STRING(--enable-icmp,enable icmp protocol support (default disabled).)],
263 AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.])
264 )
265
266 AC_ARG_ENABLE(tcp,
267 [AS_HELP_STRING(--enable-tcp,enable tcp protocol support (default disabled).)],
268 AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.])
269 )
270
271 AC_ARG_ENABLE(dns,
272 [AS_HELP_STRING(--enable-dns,enable dns tunnel protocol support (DOES NOT WORK).)],
273 [
274 AC_CHECK_HEADER(gmp.h,,[AC_MSG_ERROR([gmp.h not found, required for --enable-dns])])
275 AC_CHECK_LIB(gmp,main,,[AC_MSG_ERROR([libgmp not found, required for --enable-dns])])
276
277 AC_DEFINE_UNQUOTED(ENABLE_DNS, 1, [DNS tunnel protocol support.])
278 ]
279 )
280
281 AC_ARG_ENABLE(http-proxy,
282 [AS_HELP_STRING(--enable-http-proxy,enable http proxy connect support (default disabled).)],
283 AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.])
284 )
285
286 HMAC=12
287 AC_ARG_ENABLE(hmac-length,
288 [AS_HELP_STRING(--enable-hmac-length=BYTES,[
289 use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])],
290 HMAC=$enableval
291 )
292 AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.])
293
294 RAND=8
295 AC_ARG_ENABLE(rand-length,
296 [AS_HELP_STRING(--enable-rand-length=BYTES,
297 [use BYTES bytes of extra randomness (default 8). Allowed values are 0, 4, 8.])],
298 RAND=$enableval
299 )
300 AC_DEFINE_UNQUOTED(RAND_SIZE, $RAND, [Add this many bytes of randomness to each packet.])
301
302 MTU=1500
303 AC_ARG_ENABLE(mtu,
304 [AS_HELP_STRING(--enable-max-mtu=BYTES,enable mtu sizes upto BYTES bytes (default 1500). Use 9100 for jumbogram support.)],
305 MTU=$enableval
306 )
307 AC_DEFINE_UNQUOTED(MAX_MTU, $MTU + 14, [Maximum MTU supported.])
308
309 COMPRESS=1
310 AC_ARG_ENABLE(compression,
311 [AS_HELP_STRING(--disable-compression,Disable compression support.)],
312 if test "x$enableval" = xno; then
313 COMPRESS=0
314 fi
315 )
316 AC_DEFINE_UNQUOTED(ENABLE_COMPRESSION, $COMPRESS, [Enable compression support.])
317
318 CIPHER=bf_cbc
319 AC_ARG_ENABLE(cipher,
320 [AS_HELP_STRING(--enable-cipher,[
321 Select the symmetric cipher (default "bf").
322 Must be one of "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])],
323 if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi
324 if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi
325 if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi
326 if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi
327 )
328 AC_DEFINE_UNQUOTED(ENABLE_CIPHER, EVP_${CIPHER}, [Select the symmetric cipher to use.])
329
330 DIGEST=sha1
331 AC_ARG_ENABLE(digest,
332 [AS_HELP_STRING(--enable-digest,[
333 Select the digets algorithm to use (default "sha1"). Must be one of
334 "sha1", "ripemd160", "md5" or "md4" (insecure).])],
335 if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi
336 if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi
337 if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi
338 if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi
339 )
340 AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.])
341
342 if $CXX -v --help 2>&1 | grep -q fno-rtti; then
343 CXXFLAGS="$CXXFLAGS -fno-rtti"
344 fi
345
346 if $CXX -v --help 2>&1 | grep -q fexceptions; then
347 CXXFLAGS="$CXXFLAGS -fno-exceptions"
348 fi
349
350 dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then
351 dnl CXXFLAGS="$CXXFLAGS -ffunction-sections"
352 dnl fi
353 dnl
354 dnl if $LD -v --help 2>&1 | grep -q gc-sections; then
355 dnl LDFLAGS="$LDFLAGS -Wl,--gc-sections"
356 dnl fi
357
358 AC_CONFIG_COMMANDS_POST([
359
360 echo
361 echo "***"
362 echo "*** Configuration Summary"
363 echo "***"
364 echo "*** Kernel Iface: $IFTYPE/$IFSUBTYPE"
365 echo "*** Cipher used: $CIPHER"
366 echo "*** Digest used: $DIGEST"
367 echo "*** HMAC length: $HMAC"
368 echo "*** RAND used: $RAND"
369 echo "*** Max. MTU: $MTU"
370 echo "*** Compression: $COMPRESS"
371
372 if test "x$DIGEST" = xmd4; then
373 echo "***"
374 echo "*** WARNING: The digest you have chosen ($DIGEST) is known to be insecure"
375 fi
376
377 if test "$HMAC" -lt 12; then
378 echo "***"
379 echo "*** WARNING: The hmac length you have chosen ($HMAC) is probably insecure"
380 fi
381
382 if test "$RAND" -lt 8; then
383 echo "***"
384 echo "*** WARNING: The random prefix you have chosen ($RAND) is probably insecure"
385 fi
386
387 echo "***"
388
389 echo
390
391 ])
392
393 AC_SUBST(INCLUDES)
394
395 AC_CONFIG_FILES([Makefile po/Makefile.in
396 src/Makefile
397 doc/Makefile
398 lib/Makefile
399 m4/Makefile
400 ])
401 AC_OUTPUT