--- gvpe/configure.ac 2003/10/14 15:48:15 1.9 +++ gvpe/configure.ac 2005/03/01 06:27:20 1.33 @@ -1,10 +1,11 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.57) -AC_INIT(src/vped.C) +AC_PREREQ(2.59) +AC_INIT +AC_CONFIG_SRCDIR([src/vped.C]) AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE(vpe, 1.2) -AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(gvpe, 1.7) +AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE AH_TOP([ @@ -18,19 +19,24 @@ ]) AH_BOTTOM([ +typedef unsigned char u8; +typedef signed char s8; + #if __CYGWIN__ -typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; +typedef signed short s16; +typedef signed int s32; #else #include /* old modula-2 habits */ -typedef unsigned char u8; typedef uint16_t u16; typedef uint32_t u32; +typedef int16_t s16; +typedef int32_t s32; #endif #endif @@ -46,7 +52,10 @@ # Define this here, not in acconfig's @TOP@ section, since definitions # in the latter don't make it into the configure-time tests. AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions]) -AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions]) + +# do NOT define POSIX_SOURCE, sicne this clashes with many BSDs +dnl AC_DEFINE([_POSIX_SOURCE], 1, [Enable POSIX 1003.1 extensions]) +dnl AC_DEFINE([_XOPEN_SOURCE], 500, [Enable XOPEN extensions]) ALL_LINGUAS="" @@ -61,20 +70,24 @@ AC_PROG_MAKE_SET AC_PROG_RANLIB -AC_ISC_POSIX - AC_ARG_ENABLE(iftype, - [AC_HELP_STRING(--enable-iftype[=TYPE/SUBTYPE], [ + [AS_HELP_STRING(--enable-iftype=TYPE/SUBTYPE, Use kernel/net device interface TYPE/SUBTYPE. Working combinations are: - "native/linux" "tincd/linux" "tincd/freebsd"; + "native/linux" + "tincd/linux" + "tincd/freebsd" + "tincd/openbsd" + "tincd/darwin" + "native/cygwin"; Untested combinations are: - "tincd/netbsd" "tincd/darwin" "tincd/solaris" - "tincd/openbsd" "tincd/cygwin"; + "tincd/netbsd" + "tincd/solaris" + "tincd/mingw"; Broken combinations are: - "native/cygwin"; + "tincd/cygwin"; The default is to autodetect. - ])], + )], [ IFTYPE=`echo $enableval | sed s%/.*%%` IFSUBTYPE=`echo $enableval | sed s%.*/%%` @@ -117,7 +130,7 @@ AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) ;; *cygwin*) - IFTYPE=tincd + IFTYPE=native IFSUBTYPE=cygwin AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) ;; @@ -129,6 +142,8 @@ AC_MSG_RESULT($IFTYPE/$IFSUBTYPE) AC_SUBST(IFTYPE,$IFTYPE) AC_SUBST(IFSUBTYPE,$IFSUBTYPE) +AC_DEFINE_UNQUOTED(IFTYPE,"$IFTYPE",[kernel interface type]) +AC_DEFINE_UNQUOTED(IFSUBTYPE,"$IFSUBTYPE",[kernel interface subtype]) AC_CACHE_SAVE @@ -139,8 +154,9 @@ dnl Checks for header files. AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ - sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h cygwin.h arpa/inet.h netinet/in.h]) -AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], + sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h \ + sys/mman.h netinet/in.h]) +AC_CHECK_HEADERS([arpa/inet.h net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], [ #include #include @@ -164,12 +180,8 @@ AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, [ - AC_TRY_COMPILE( - [#include - #include ], - [socklen_t len = 42; return len;], - ac_cv_type_socklen_t=yes, - ac_cv_type_socklen_t=no) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include ]], [[socklen_t len = 42; return len;]])],[ac_cv_type_socklen_t=yes],[ac_cv_type_socklen_t=no]) ]) if test $ac_cv_type_socklen_t = yes; then AC_DEFINE(HAVE_SOCKLEN_T, 1, [socklen_t available]) @@ -177,13 +189,9 @@ AC_CACHE_CHECK([for struct addrinfo], ac_cv_struct_addrinfo, [ - AC_TRY_COMPILE( - [#include + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include - #include ], - [struct addrinfo ai; ai.ai_family = AF_INET; return ai.ai_family;], - ac_cv_struct_addrinfo=yes, - ac_cv_struct_addrinfo=no) + #include ]], [[struct addrinfo ai; ai.ai_family = AF_INET; return ai.ai_family;]])],[ac_cv_struct_addrinfo=yes],[ac_cv_struct_addrinfo=no]) ]) if test $ac_cv_struct_addrinfo = yes; then AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [struct addrinfo available]) @@ -196,6 +204,7 @@ AC_HEADER_STDC +dnl argl, could somebody catapult darwin into the 21st century??? AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall) AC_FUNC_ALLOCA @@ -217,68 +226,82 @@ dnl These are defined in files in m4/ tinc_TUNTAP + tinc_OPENSSL +if test "x$openssl_include" != x; then + CXXFLAGS="$CXXFLAGS -I$openssl_include" +fi dnl tinc_ZLIB +AC_ARG_ENABLE(static-daemon, + [AS_HELP_STRING(--enable-static-daemon,enable statically linked daemon.)], + [LDFLAGS_DAEMON=-static] +) +AC_SUBST(LDFLAGS_DAEMON) + AC_ARG_ENABLE(rohc, - [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])], + [AS_HELP_STRING(--enable-rohc,enable robust header compression (rfc3095).)], [ echo echo "**********************************************************************" echo "**********************************************************************" - echo "**** --enable-rohc not yet implemented *******************************" - echo "**********************************************************************" - echo "**** uuh sorry, I am such an ass, but I didn't find any rfc3095 (ROHC)" - echo "**** implementation to be used in GPL code on the web." - echo "**** so this option is just a fake. Please implement one and send it" - echo "**** to me ;)" - echo "**********************************************************************" - echo "**********************************************************************" + echo "**** --enable-rohc is highly experimental, do not use ****************" echo "**********************************************************************" echo "**********************************************************************" echo + rohc=true + AC_DEFINE_UNQUOTED(ENABLE_ROHC, 1, [ROHC support]) ] ) +AM_CONDITIONAL(ROHC, test x$rohc = xtrue) + AC_ARG_ENABLE(icmp, - [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support (default disabled).])], + [AS_HELP_STRING(--enable-icmp,enable icmp protocol support (default disabled).)], AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) ) AC_ARG_ENABLE(tcp, - [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support (default disabled).])], + [AS_HELP_STRING(--enable-tcp,enable tcp protocol support (default disabled).)], AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) ) +AC_ARG_ENABLE(dns, + [AS_HELP_STRING(--enable-dns,enable dns tunnel protocol support (DOES NOT WORK).)], + AC_DEFINE_UNQUOTED(ENABLE_DNS, 1, [DNS tunnel protocol support.]) +) + AC_ARG_ENABLE(http-proxy, - [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support (default disabled).])], + [AS_HELP_STRING(--enable-http-proxy,enable http proxy connect support (default disabled).)], AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) ) -HMAC=12 dnl see also the AC_HELP_STRING +HMAC=12 AC_ARG_ENABLE(hmac-length, - [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])], + [AS_HELP_STRING(--enable-hmac-length=BYTES,[ + use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])], HMAC=$enableval ) AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) -RAND=8 dnl see also the AC_HELP_STRING +RAND=8 AC_ARG_ENABLE(rand-length, - [AC_HELP_STRING(--enable-rand-length=BYTES, [use BYTES bytes of extra randomness (default 8). Allowed values are 0, 4, 8.])], + [AS_HELP_STRING(--enable-rand-length=BYTES, + [use BYTES bytes of extra randomness (default 8). Allowed values are 0, 4, 8.])], RAND=$enableval ) AC_DEFINE_UNQUOTED(RAND_SIZE, $RAND, [Add this many bytes of randomness to each packet.]) -MTU=1500 dnl see also the AC_HELP_STRING +MTU=1500 AC_ARG_ENABLE(mtu, - [AC_HELP_STRING(--enable-max-mtu=BYTES, enable mtu sizes upto BYTES bytes (default 1500). Use 9100 for jumbogram support.)], + [AS_HELP_STRING(--enable-max-mtu=BYTES,enable mtu sizes upto BYTES bytes (default 1500). Use 9100 for jumbogram support.)], MTU=$enableval ) AC_DEFINE_UNQUOTED(MAX_MTU, $MTU + 14, [Maximum MTU supported.]) COMPRESS=1 AC_ARG_ENABLE(compression, - [AC_HELP_STRING(--disable-compression, Disable compression support.)], + [AS_HELP_STRING(--disable-compression,Disable compression support.)], if test "x$enableval" = xno; then COMPRESS=0 fi @@ -287,9 +310,9 @@ CIPHER=bf_cbc AC_ARG_ENABLE(cipher, - [AC_HELP_STRING(--enable-cipher, [ - Select the symmetric cipher (default "bf"). Must be one of - "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])], + [AS_HELP_STRING(--enable-cipher,[ + Select the symmetric cipher (default "bf"). + Must be one of "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])], if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi @@ -299,9 +322,9 @@ DIGEST=sha1 AC_ARG_ENABLE(digest, - [AC_HELP_STRING(--enable-digest, [ - Select the digets algorithm to use (default "sha1"). Must be one of - "sha1", "ripemd160", "md5" or "md4" (insecure).])], + [AS_HELP_STRING(--enable-digest,[ + Select the digets algorithm to use (default "sha1"). Must be one of + "sha1", "ripemd160", "md5" or "md4" (insecure).])], if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi @@ -317,13 +340,13 @@ CXXFLAGS="$CXXFLAGS -fno-exceptions" fi -if $CXX -v --help 2>&1 | grep -q ffunction-sections; then - CXXFLAGS="$CXXFLAGS -ffunction-sections" -fi - -if $LD -v --help 2>&1 | grep -q gc-sections; then - LDFLAGS="$LDFLAGS -Wl,--gc-sections" -fi +dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then +dnl CXXFLAGS="$CXXFLAGS -ffunction-sections" +dnl fi +dnl +dnl if $LD -v --help 2>&1 | grep -q gc-sections; then +dnl LDFLAGS="$LDFLAGS -Wl,--gc-sections" +dnl fi AC_CONFIG_COMMANDS_POST([ @@ -338,23 +361,34 @@ echo "*** RAND used: $RAND" echo "*** Max. MTU: $MTU" echo "*** Compression: $COMPRESS" -echo "***" if test "x$DIGEST" = xmd4; then -echo "*** WARNING" -echo "*** The digest you have chosen ($DIGEST) is known to be insecure" echo "***" +echo "*** WARNING: The digest you have chosen ($DIGEST) is known to be insecure" fi +if test "$HMAC" -lt 12; then +echo "***" +echo "*** WARNING: The hmac length you have chosen ($HMAC) is probably insecure" +fi + +if test "$RAND" -lt 8; then +echo "***" +echo "*** WARNING: The random prefix you have chosen ($RAND) is probably insecure" +fi + +echo "***" + echo ]) AC_SUBST(INCLUDES) -AC_OUTPUT(Makefile po/Makefile.in +AC_CONFIG_FILES([Makefile po/Makefile.in src/Makefile doc/Makefile lib/Makefile m4/Makefile -) +]) +AC_OUTPUT