1 | dnl Process this file with autoconf to produce a configure script. |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | |
2 | |
3 | AC_PREREQ(2.59) |
3 | AC_PREREQ(2.69) |
4 | AC_INIT |
4 | AC_INIT |
5 | AC_CONFIG_SRCDIR([src/gvpe.C]) |
5 | AC_CONFIG_SRCDIR([src/gvpe.C]) |
6 | AC_CANONICAL_TARGET |
6 | AC_CANONICAL_TARGET |
7 | AM_INIT_AUTOMAKE(gvpe, 2.01) |
7 | AM_INIT_AUTOMAKE(gvpe, 2.25) |
8 | AC_CONFIG_HEADERS([config.h]) |
8 | AC_CONFIG_HEADERS([config.h]) |
9 | AM_MAINTAINER_MODE |
9 | AM_MAINTAINER_MODE |
10 | |
10 | |
11 | AH_TOP([ |
11 | AH_TOP([ |
12 | #ifndef CONFIG_H__ |
12 | #ifndef CONFIG_H__ |
… | |
… | |
46 | #else |
46 | #else |
47 | # define CLOCALE <locale.h> |
47 | # define CLOCALE <locale.h> |
48 | #endif |
48 | #endif |
49 | ]) |
49 | ]) |
50 | |
50 | |
51 | dnl Include the macros from the m4/ directory |
|
|
52 | AM_ACLOCAL_INCLUDE(m4) |
|
|
53 | |
|
|
54 | AM_GNU_GETTEXT([external]) |
51 | AM_GNU_GETTEXT([external]) |
55 | AM_GNU_GETTEXT_VERSION(0.11.5) |
52 | AM_GNU_GETTEXT_VERSION(0.11.5) |
56 | |
53 | |
57 | # Enable GNU extensions. |
54 | # Enable GNU extensions. |
58 | # Define this here, not in acconfig's @TOP@ section, since definitions |
55 | # Define this here, not in acconfig's @TOP@ section, since definitions |
… | |
… | |
64 | dnl AC_DEFINE([_XOPEN_SOURCE], 500, [Enable XOPEN extensions]) |
61 | dnl AC_DEFINE([_XOPEN_SOURCE], 500, [Enable XOPEN extensions]) |
65 | |
62 | |
66 | ALL_LINGUAS="" |
63 | ALL_LINGUAS="" |
67 | |
64 | |
68 | dnl Checks for programs. |
65 | dnl Checks for programs. |
69 | AC_PROG_CC |
|
|
70 | AC_PROG_CPP |
66 | AC_PROG_CPP |
71 | AC_PROG_CXX |
67 | AC_PROG_CXX |
72 | AC_PROG_GCC_TRADITIONAL |
68 | AC_PROG_GCC_TRADITIONAL |
73 | AC_PROG_AWK |
69 | AC_PROG_AWK |
74 | AC_PROG_INSTALL |
70 | AC_PROG_INSTALL |
… | |
… | |
158 | AC_CACHE_SAVE |
154 | AC_CACHE_SAVE |
159 | |
155 | |
160 | dnl Checks for libraries. |
156 | dnl Checks for libraries. |
161 | |
157 | |
162 | AC_LANG(C++) |
158 | AC_LANG(C++) |
163 | AC_CHECK_HEADERS(ext/hash_map clocale) |
159 | AC_CHECK_HEADERS(tr1/unordered_map ext/hash_map clocale) |
164 | |
160 | |
165 | dnl Checks for header files. |
161 | dnl Checks for header files. |
166 | AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ |
162 | AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ |
167 | sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h \ |
163 | sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h \ |
168 | sys/mman.h netinet/in.h]) |
164 | sys/mman.h netinet/in.h]) |
… | |
… | |
227 | AC_CHECK_FUNC(gethostbyname, [], [ |
223 | AC_CHECK_FUNC(gethostbyname, [], [ |
228 | AC_CHECK_LIB(nsl, gethostbyname) |
224 | AC_CHECK_LIB(nsl, gethostbyname) |
229 | ]) |
225 | ]) |
230 | |
226 | |
231 | dnl libev support |
227 | dnl libev support |
232 | m4_include([libev/ev.m4]) |
228 | m4_include([libev/libev.m4]) |
233 | |
229 | |
234 | AC_LANG_POP |
230 | AC_LANG_POP |
235 | |
231 | |
236 | dnl AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo]) |
232 | dnl AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo]) |
237 | |
233 | |
… | |
… | |
244 | if test "x$openssl_include" != x; then |
240 | if test "x$openssl_include" != x; then |
245 | CXXFLAGS="$CXXFLAGS -I$openssl_include" |
241 | CXXFLAGS="$CXXFLAGS -I$openssl_include" |
246 | fi |
242 | fi |
247 | dnl tinc_ZLIB |
243 | dnl tinc_ZLIB |
248 | |
244 | |
|
|
245 | AC_ARG_ENABLE(threads, |
|
|
246 | [AS_HELP_STRING(--enable-threads,try to use threads for long-running asynchronous operations (default enabled).)], |
|
|
247 | [try_threads=$enableval], |
|
|
248 | [try_threads=yes] |
|
|
249 | ) |
|
|
250 | |
|
|
251 | if test "x$try_threads" = xyes; then |
|
|
252 | AC_CHECK_HEADER(pthread.h,[ |
|
|
253 | LIBS="$LIBS -lpthread" |
|
|
254 | AC_COMPILE_IFELSE( |
|
|
255 | [AC_LANG_PROGRAM([#include <pthread.h>], [pthread_t id; pthread_create (&id, 0, 0, 0);])], |
|
|
256 | [AC_DEFINE_UNQUOTED(ENABLE_PTHREADS, 1, [POSIX thread support.])] |
|
|
257 | ) |
|
|
258 | ]) |
|
|
259 | fi |
|
|
260 | |
249 | AC_ARG_ENABLE(static-daemon, |
261 | AC_ARG_ENABLE(static-daemon, |
250 | [AS_HELP_STRING(--enable-static-daemon,enable statically linked daemon.)], |
262 | [AS_HELP_STRING(--enable-static-daemon,enable statically linked daemon.)], |
251 | [LDFLAGS_DAEMON=-static] |
263 | [LDFLAGS_DAEMON=-static] |
252 | ) |
264 | ) |
253 | AC_SUBST(LDFLAGS_DAEMON) |
265 | AC_SUBST(LDFLAGS_DAEMON) |
254 | |
266 | |
255 | AC_ARG_ENABLE(rohc, |
267 | dnl AC_ARG_ENABLE(rohc, |
256 | [AS_HELP_STRING(--enable-rohc,enable robust header compression (rfc3095).)], |
268 | dnl [AS_HELP_STRING(--enable-rohc,enable robust header compression (rfc3095).)], |
257 | [ |
269 | dnl [ |
258 | echo |
270 | dnl echo |
259 | echo "**********************************************************************" |
271 | dnl echo "**********************************************************************" |
260 | echo "**********************************************************************" |
272 | dnl echo "**********************************************************************" |
261 | echo "**** --enable-rohc is highly experimental, do not use ****************" |
273 | dnl echo "**** --enable-rohc is highly experimental, do not use ****************" |
262 | echo "**********************************************************************" |
274 | dnl echo "**********************************************************************" |
263 | echo "**********************************************************************" |
275 | dnl echo "**********************************************************************" |
264 | echo |
276 | dnl echo |
265 | rohc=true |
277 | dnl rohc=true |
266 | AC_DEFINE_UNQUOTED(ENABLE_ROHC, 1, [ROHC support]) |
278 | dnl AC_DEFINE_UNQUOTED(ENABLE_ROHC, 1, [ROHC support]) |
267 | ] |
279 | dnl ] |
268 | ) |
280 | dnl ) |
269 | |
281 | |
270 | AM_CONDITIONAL(ROHC, test x$rohc = xtrue) |
282 | AM_CONDITIONAL(ROHC, test x$rohc = xtrue) |
271 | |
283 | |
272 | dnl AC_ARG_ENABLE(bridging, |
284 | dnl AC_ARG_ENABLE(bridging, |
273 | dnl [AS_HELP_STRING(--enable-bridging,enable bridging support (default disabled).)], |
285 | dnl [AS_HELP_STRING(--enable-bridging,enable bridging support (default disabled).)], |
274 | dnl AC_DEFINE_UNQUOTED(ENABLE_BRIDGING, 1, [bridging support.]) |
286 | dnl AC_DEFINE_UNQUOTED(ENABLE_BRIDGING, 1, [bridging support.]) |
275 | dnl ) |
287 | dnl ) |
276 | |
288 | |
|
|
289 | ICMP=1 |
277 | AC_ARG_ENABLE(icmp, |
290 | AC_ARG_ENABLE(icmp, |
278 | [AS_HELP_STRING(--enable-icmp,enable icmp protocol support (default disabled).)], |
291 | [AS_HELP_STRING(--disable-icmp,enable icmp protocol support (default enabled).)], |
|
|
292 | if test "x$enableval" = xno; then |
|
|
293 | ICMP=0 |
|
|
294 | fi |
|
|
295 | ) |
|
|
296 | if test "x$ICMP" = x1; then |
279 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
297 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
280 | ) |
298 | fi |
281 | |
299 | |
|
|
300 | TCP=1 |
282 | AC_ARG_ENABLE(tcp, |
301 | AC_ARG_ENABLE(tcp, |
283 | [AS_HELP_STRING(--enable-tcp,enable tcp protocol support (default disabled).)], |
302 | [AS_HELP_STRING(--disable-tcp,enable tcp protocol support (default enabled).)], |
|
|
303 | if test "x$enableval" = xno; then |
|
|
304 | TCP=0 |
|
|
305 | fi |
|
|
306 | ) |
|
|
307 | if test "x$TCP" = x1; then |
284 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
308 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
|
|
309 | fi |
|
|
310 | |
|
|
311 | HTTP=1 |
|
|
312 | AC_ARG_ENABLE(http-proxy, |
|
|
313 | [AS_HELP_STRING(--disable-http-proxy,enable http proxy connect support (default enabled).)], |
|
|
314 | if test "x$enableval" = xno; then |
|
|
315 | HTTP=0 |
|
|
316 | fi |
285 | ) |
317 | ) |
|
|
318 | if test "x$HTTP" = x1; then |
|
|
319 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
|
|
320 | fi |
286 | |
321 | |
287 | AC_ARG_ENABLE(dns, |
322 | AC_ARG_ENABLE(dns, |
288 | [AS_HELP_STRING(--enable-dns,enable dns tunnel protocol support (DOES NOT WORK).)], |
323 | [AS_HELP_STRING(--enable-dns,enable dns tunnel protocol support (default disabled).)], |
289 | [ |
324 | [ |
290 | AC_CHECK_HEADER(gmp.h,,[AC_MSG_ERROR([gmp.h not found, required for --enable-dns])]) |
325 | AC_CHECK_HEADER(gmp.h,,[AC_MSG_ERROR([gmp.h not found, required for --enable-dns])]) |
291 | AC_CHECK_LIB(gmp,main,,[AC_MSG_ERROR([libgmp not found, required for --enable-dns])]) |
326 | AC_CHECK_LIB(gmp,main,,[AC_MSG_ERROR([libgmp not found, required for --enable-dns])]) |
292 | |
327 | |
293 | AC_DEFINE_UNQUOTED(ENABLE_DNS, 1, [DNS tunnel protocol support.]) |
328 | AC_DEFINE_UNQUOTED(ENABLE_DNS, 1, [DNS tunnel protocol support.]) |
294 | ] |
329 | ] |
295 | ) |
330 | ) |
296 | |
331 | |
297 | AC_ARG_ENABLE(http-proxy, |
332 | RSA=3072 |
298 | [AS_HELP_STRING(--enable-http-proxy,enable http proxy connect support (default disabled).)], |
333 | AC_ARG_ENABLE(rsa-length, |
299 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
334 | [AS_HELP_STRING(--enable-rsa-length=BITS,[ |
|
|
335 | use BITS rsa keys (default 3072). Allowed values are 2048-10240.])], |
|
|
336 | RSA=$enableval |
300 | ) |
337 | ) |
|
|
338 | AC_DEFINE_UNQUOTED(RSABITS, $RSA, [Size of RSA keys.]) |
301 | |
339 | |
302 | HMAC=12 |
340 | HMAC=12 |
303 | AC_ARG_ENABLE(hmac-length, |
341 | AC_ARG_ENABLE(hmac-length, |
304 | [AS_HELP_STRING(--enable-hmac-length=BYTES,[ |
342 | [AS_HELP_STRING(--enable-hmac-length=BYTES,[ |
305 | use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])], |
343 | use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])], |
… | |
… | |
314 | RAND=$enableval |
352 | RAND=$enableval |
315 | ) |
353 | ) |
316 | AC_DEFINE_UNQUOTED(RAND_SIZE, $RAND, [Add this many bytes of randomness to each packet.]) |
354 | AC_DEFINE_UNQUOTED(RAND_SIZE, $RAND, [Add this many bytes of randomness to each packet.]) |
317 | |
355 | |
318 | MTU=1500 |
356 | MTU=1500 |
319 | AC_ARG_ENABLE(mtu, |
357 | AC_ARG_ENABLE(max-mtu, |
320 | [AS_HELP_STRING(--enable-max-mtu=BYTES,enable mtu sizes upto BYTES bytes (default 1500). Use 9100 for jumbogram support.)], |
358 | [AS_HELP_STRING(--enable-max-mtu=BYTES,enable mtu sizes upto BYTES bytes (default 1500). Use 9100 for jumbogram support.)], |
321 | MTU=$enableval |
359 | MTU=$enableval |
322 | ) |
360 | ) |
323 | AC_DEFINE_UNQUOTED(MAX_MTU, $MTU + 14, [Maximum MTU supported.]) |
361 | AC_DEFINE_UNQUOTED(MAX_MTU, ($MTU + 14), [Maximum MTU supported.]) |
324 | |
362 | |
325 | COMPRESS=1 |
363 | COMPRESS=1 |
326 | AC_ARG_ENABLE(compression, |
364 | AC_ARG_ENABLE(compression, |
327 | [AS_HELP_STRING(--disable-compression,Disable compression support.)], |
365 | [AS_HELP_STRING(--disable-compression,Disable compression support.)], |
328 | if test "x$enableval" = xno; then |
366 | if test "x$enableval" = xno; then |
… | |
… | |
331 | ) |
369 | ) |
332 | AC_DEFINE_UNQUOTED(ENABLE_COMPRESSION, $COMPRESS, [Enable compression support.]) |
370 | AC_DEFINE_UNQUOTED(ENABLE_COMPRESSION, $COMPRESS, [Enable compression support.]) |
333 | |
371 | |
334 | CIPHER=aes_128_cbc |
372 | CIPHER=aes_128_cbc |
335 | AC_ARG_ENABLE(cipher, |
373 | AC_ARG_ENABLE(cipher, |
336 | [AS_HELP_STRING(--enable-cipher,[ |
374 | [AS_HELP_STRING(--enable-cipher=CIPHER,[ |
337 | Select the symmetric cipher (default "aes-128"). |
375 | Select the symmetric cipher (default "aes-128"). |
338 | Must be one of "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])], |
376 | Must be one of "bf" (blowfish), "aes-128" (rijndael), "aes-192", "aes-256", "camellia-128" or "camellia-256".])], |
339 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
377 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
340 | if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi |
378 | if test "x$enableval" = xaes-128 ; then CIPHER=aes_128_cbc ; fi |
341 | if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi |
379 | if test "x$enableval" = xaes-192 ; then CIPHER=aes_192_cbc ; fi |
342 | if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi |
380 | if test "x$enableval" = xaes-256 ; then CIPHER=aes_256_cbc ; fi |
|
|
381 | if test "x$enableval" = xcamellia-128; then CIPHER=camellia_128_cbc; fi |
|
|
382 | if test "x$enableval" = xcamellia-256; then CIPHER=camellia_256_cbc; fi |
343 | ) |
383 | ) |
344 | AC_DEFINE_UNQUOTED(ENABLE_CIPHER, EVP_${CIPHER}, [Select the symmetric cipher to use.]) |
384 | AC_DEFINE_UNQUOTED(ENABLE_CIPHER, EVP_${CIPHER}, [Select the symmetric cipher to use.]) |
345 | |
385 | |
346 | DIGEST=ripemd160 |
386 | DIGEST=sha1 |
347 | AC_ARG_ENABLE(digest, |
387 | AC_ARG_ENABLE(digest, |
348 | [AS_HELP_STRING(--enable-digest,[ |
388 | [AS_HELP_STRING(--enable-digest=DIGEST,[ |
349 | Select the digest algorithm to use (default "ripemd160"). Must be one of |
389 | Select the digest algorithm to use (default "sha1"). Must be one of |
350 | "sha512", "sha256", "sha1", "ripemd160", "md5" or "md4" (insecure).])], |
390 | "sha512", "sha256", "sha1", "ripemd160", "whirlpool".])], |
|
|
391 | if test "x$enableval" = xwhirlpool; then DIGEST=whirlpool; fi |
351 | if test "x$enableval" = xsha512 ; then DIGEST=sha512 ; fi |
392 | if test "x$enableval" = xsha512 ; then DIGEST=sha512 ; fi |
352 | if test "x$enableval" = xsha256 ; then DIGEST=sha256 ; fi |
393 | if test "x$enableval" = xsha256 ; then DIGEST=sha256 ; fi |
353 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
394 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
354 | if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi |
395 | if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi |
355 | if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi |
|
|
356 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
|
|
357 | ) |
396 | ) |
358 | AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) |
397 | AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) |
|
|
398 | |
|
|
399 | AUTH=sha512 |
|
|
400 | AC_ARG_ENABLE(auth-digest, |
|
|
401 | [AS_HELP_STRING(--enable-auth-digest=DIGEST,[ |
|
|
402 | Select the hmac algorithm to use (default "sha512"). Must be one of |
|
|
403 | "sha512", "sha256", "whirlpool".])], |
|
|
404 | if test "x$enableval" = xwhirlpool; then AUTH=whirlpool; fi |
|
|
405 | if test "x$enableval" = xsha512 ; then AUTH=sha512 ; fi |
|
|
406 | if test "x$enableval" = xsha256 ; then AUTH=sha256 ; fi |
|
|
407 | ) |
|
|
408 | AC_DEFINE_UNQUOTED(ENABLE_AUTH, EVP_${AUTH}, [Select the auth digest algorithm to use.]) |
359 | |
409 | |
360 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
410 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
361 | CXXFLAGS="$CXXFLAGS -fno-rtti" |
411 | CXXFLAGS="$CXXFLAGS -fno-rtti" |
362 | fi |
412 | fi |
363 | |
413 | |
364 | if $CXX -v --help 2>&1 | grep -q fexceptions; then |
414 | #if $CXX -v --help 2>&1 | grep -q fexceptions; then |
365 | CXXFLAGS="$CXXFLAGS -fno-exceptions" |
415 | # CXXFLAGS="$CXXFLAGS -fno-exceptions" |
366 | fi |
416 | #fi |
|
|
417 | |
|
|
418 | LIBS="$EXTRA_LIBS $LIBS" |
367 | |
419 | |
368 | dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then |
420 | dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then |
369 | dnl CXXFLAGS="$CXXFLAGS -ffunction-sections" |
421 | dnl CXXFLAGS="$CXXFLAGS -ffunction-sections" |
370 | dnl fi |
422 | dnl fi |
371 | dnl |
423 | dnl |
… | |
… | |
386 | echo |
438 | echo |
387 | echo "***" |
439 | echo "***" |
388 | echo "*** Configuration Summary" |
440 | echo "*** Configuration Summary" |
389 | echo "***" |
441 | echo "***" |
390 | echo "*** Kernel Iface: $IFTYPE/$IFSUBTYPE" |
442 | echo "*** Kernel Iface: $IFTYPE/$IFSUBTYPE" |
|
|
443 | echo "*** RSA size: $RSA" |
391 | echo "*** Cipher used: $CIPHER" |
444 | echo "*** Cipher used: $CIPHER" |
392 | echo "*** Digest used: $DIGEST" |
445 | echo "*** Digest used: $DIGEST" |
|
|
446 | echo "*** Authdigest: $AUTH" |
393 | echo "*** HMAC length: $HMAC" |
447 | echo "*** HMAC length: $HMAC" |
394 | echo "*** RAND used: $RAND" |
448 | echo "*** RAND used: $RAND" |
395 | echo "*** Max. MTU: $MTU" |
449 | echo "*** Max. MTU: $MTU" |
396 | |
450 | |
397 | echo "***" |
451 | echo "***" |
398 | echo "*** Enable options:" |
452 | echo "*** Enable options:" |
399 | grep ENABLE_ config.h | sed -e 's/^/*** /' |
453 | grep ENABLE_ config.h | sed -e 's/^/*** /' |
400 | |
454 | |
401 | if test "x$DIGEST" = xmd4; then |
|
|
402 | echo "***" |
|
|
403 | echo "*** WARNING: The digest you have chosen ($DIGEST) is known to be insecure" |
|
|
404 | fi |
|
|
405 | |
|
|
406 | if test "$HMAC" -lt 12; then |
455 | if test "$HMAC" -lt 12; then |
407 | echo "***" |
456 | echo "***" |
408 | echo "*** WARNING: The hmac length you have chosen ($HMAC) is probably insecure" |
457 | echo "*** WARNING: The hmac length you have chosen ($HMAC) is quite insecure" |
409 | fi |
458 | fi |
410 | |
459 | |
411 | if test "$RAND" -lt 8; then |
460 | if test "$RAND" -lt 8; then |
412 | echo "***" |
461 | echo "***" |
413 | echo "*** WARNING: The random prefix you have chosen ($RAND) is probably insecure" |
462 | echo "*** WARNING: The random prefix you have chosen ($RAND) is probably insecure" |