ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/configure.ac
(Generate patch)

Comparing gvpe/configure.ac (file contents):
Revision 1.4 by pcg, Tue Apr 8 03:00:44 2003 UTC vs.
Revision 1.23 by pcg, Tue Jan 27 06:05:02 2004 UTC

1dnl Process this file with autoconf to produce a configure script. 1dnl Process this file with autoconf to produce a configure script.
2 2
3AC_PREREQ(2.57) 3AC_PREREQ(2.57)
4AC_INIT(src/vped.C) 4AC_INIT(src/vped.C)
5AC_CANONICAL_TARGET 5AC_CANONICAL_TARGET
6AM_INIT_AUTOMAKE(vpe, 0.1) 6AM_INIT_AUTOMAKE(vpe, 1.5)
7AM_CONFIG_HEADER(config.h) 7AM_CONFIG_HEADER(config.h)
8AM_MAINTAINER_MODE 8AM_MAINTAINER_MODE
9 9
10AH_TOP([ 10AH_TOP([
11#ifndef CONFIG_H__ 11#ifndef CONFIG_H__
44 44
45# Enable GNU extensions. 45# Enable GNU extensions.
46# Define this here, not in acconfig's @TOP@ section, since definitions 46# Define this here, not in acconfig's @TOP@ section, since definitions
47# in the latter don't make it into the configure-time tests. 47# in the latter don't make it into the configure-time tests.
48AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions]) 48AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions])
49AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions]) 49
50# do NOT define POSIX_SOURCE, sicne this clashes with many BSDs
51dnl AC_DEFINE([_POSIX_SOURCE], 1, [Enable POSIX 1003.1 extensions])
52dnl AC_DEFINE([_XOPEN_SOURCE], 500, [Enable XOPEN extensions])
50 53
51ALL_LINGUAS="" 54ALL_LINGUAS=""
52 55
53dnl Checks for programs. 56dnl Checks for programs.
54AC_PROG_CC 57AC_PROG_CC
59AC_PROG_INSTALL 62AC_PROG_INSTALL
60AC_PROG_LN_S 63AC_PROG_LN_S
61AC_PROG_MAKE_SET 64AC_PROG_MAKE_SET
62AC_PROG_RANLIB 65AC_PROG_RANLIB
63 66
64AC_ISC_POSIX 67AC_ARG_ENABLE(iftype,
68 [AC_HELP_STRING(--enable-iftype[=TYPE/SUBTYPE], [
69 Use kernel/net device interface TYPE/SUBTYPE.
70 Working combinations are:
71 "native/linux"
72 "tincd/linux"
73 "tincd/freebsd"
74 "tincd/openbsd"
75 "tincd/darwin"
76 "native/cygwin";
77 Untested combinations are:
78 "tincd/netbsd"
79 "tincd/solaris"
80 "tincd/mingw";
81 Broken combinations are:
82 "tincd/cygwin";
83 The default is to autodetect.
84 ])],
85 [
86 IFTYPE=`echo $enableval | sed s%/.*%%`
87 IFSUBTYPE=`echo $enableval | sed s%.*/%%`
88 ]
89)
65 90
66m4_if([
67dnl Check and set OS 91dnl Check and set OS
92AC_MSG_CHECKING(for kernel networking interface type)
68 93
94if test "x$IFTYPE" = "x"; then
69case $target_os in 95 case $target_os in
70 *linux*) 96 *linux*)
97 IFTYPE=native
98 IFSUBTYPE=linux
71 AC_DEFINE(HAVE_LINUX, 1, [Linux]) 99 AC_DEFINE(HAVE_LINUX, 1, [Linux])
72 [ rm -f src/device.c; ln -sf linux/device.c src/device.c ] 100 ;;
73 ;;
74 *freebsd*) 101 *freebsd*)
102 IFTYPE=tincd
103 IFSUBTYPE=freebsd
75 AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD]) 104 AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
76 [ rm -f src/device.c; ln -sf freebsd/device.c src/device.c ] 105 ;;
77 ;;
78 *darwin*) 106 *darwin*)
107 IFTYPE=tincd
108 IFSUBTYPE=darwin
79 AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)]) 109 AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
80 [ rm -f src/device.c; ln -sf darwin/device.c src/device.c ] 110 ;;
81 ;;
82 *solaris*) 111 *solaris*)
112 IFTYPE=tincd
113 IFSUBTYPE=solaris
83 AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS]) 114 AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
84 [ rm -f src/device.c; ln -sf solaris/device.c src/device.c ] 115 ;;
85 ;;
86 *openbsd*) 116 *openbsd*)
117 IFTYPE=tincd
118 IFSUBTYPE=openbsd
87 AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD]) 119 AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
88 [ rm -f src/device.c; ln -sf openbsd/device.c src/device.c ] 120 ;;
89 ;;
90 *netbsd*) 121 *netbsd*)
122 IFTYPE=tincd
123 IFSUBTYPE=netbsd
91 AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) 124 AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
92 [ rm -f src/device.c; ln -sf netbsd/device.c src/device.c ] 125 ;;
93 ;;
94 *cygwin*) 126 *cygwin*)
127 IFTYPE=native
128 IFSUBTYPE=cygwin
95 AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) 129 AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
96 [ rm -f src/device.c; ln -sf cygwin/device.c src/device.c ] 130 ;;
97 ;; 131 *)
98 *)
99 AC_MSG_ERROR("Unknown operating system.") 132 AC_MSG_ERROR("Unknown operating system.")
100 ;; 133 ;;
101esac 134 esac
102]) 135fi
136AC_MSG_RESULT($IFTYPE/$IFSUBTYPE)
137AC_SUBST(IFTYPE,$IFTYPE)
138AC_SUBST(IFSUBTYPE,$IFSUBTYPE)
139AC_DEFINE_UNQUOTED(IFTYPE,"$IFTYPE",[kernel interface type])
140AC_DEFINE_UNQUOTED(IFSUBTYPE,"$IFSUBTYPE",[kernel interface subtype])
103 141
104AC_CACHE_SAVE 142AC_CACHE_SAVE
105 143
106dnl Checks for libraries. 144dnl Checks for libraries.
107 145
108AC_LANG(C++) 146AC_LANG(C++)
109AC_CHECK_HEADERS(ext/hash_map) 147AC_CHECK_HEADERS(ext/hash_map)
110 148
111dnl Checks for header files. 149dnl Checks for header files.
112AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ 150AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \
113 sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h cygwin.h]) 151 sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h \
152 sys/mman.h netinet/in.h])
114AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h], [], [], 153AC_CHECK_HEADERS([arpa/inet.h net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [],
154[
115 [#include <sys/types.h> 155#include <sys/types.h>
116 #include <sys/socket.h> 156#include <sys/socket.h>
157#ifdef HAVE_NETINET_IN_H
158# include <netinet/in.h>
159#endif
160#ifdef HAVE_ARPA_INET_H
161# include <arpa/inet.h>
162#endif
117 #ifdef HAVE_NETINET_IN_SYSTM_H 163#ifdef HAVE_NETINET_IN_SYSTM_H
118 #include <netinet/in_systm.h> 164# include <netinet/in_systm.h>
119 #endif]) 165#endif
166])
120 167
121dnl Checks for typedefs, structures, and compiler characteristics. 168dnl Checks for typedefs, structures, and compiler characteristics.
122AC_C_CONST 169AC_C_CONST
123AC_TYPE_PID_T 170AC_TYPE_PID_T
124AC_TYPE_SIZE_T 171AC_TYPE_SIZE_T
157 204
158AC_LANG_PUSH(C) 205AC_LANG_PUSH(C)
159 206
160AC_HEADER_STDC 207AC_HEADER_STDC
161 208
209dnl argl, could somebody catapult darwin into the 21st century???
162AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall) 210AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall)
163 211
164AC_FUNC_ALLOCA 212AC_FUNC_ALLOCA
165 213
166dnl Support for SunOS 214dnl Support for SunOS
178 226
179AC_CACHE_SAVE 227AC_CACHE_SAVE
180 228
181dnl These are defined in files in m4/ 229dnl These are defined in files in m4/
182tinc_TUNTAP 230tinc_TUNTAP
231
183tinc_OPENSSL 232tinc_OPENSSL
233if test "x$openssl_include" != x; then
234 CXXFLAGS="$CXXFLAGS -I$openssl_include"
235fi
184dnl tinc_ZLIB 236dnl tinc_ZLIB
185 237
238AC_ARG_ENABLE(rohc,
239 [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])],
240 [
241 echo
242 echo "**********************************************************************"
243 echo "**********************************************************************"
244 echo "**** --enable-rohc not yet implemented *******************************"
245 echo "**********************************************************************"
246 echo "**** uuh sorry, I am such an ass, but I didn't find any rfc3095 (ROHC)"
247 echo "**** implementation to be used in GPL code on the web."
248 echo "**** so this option is just a fake. Please implement one and send it"
249 echo "**** to me ;)"
250 echo "**********************************************************************"
251 echo "**********************************************************************"
252 echo "**********************************************************************"
253 echo "**********************************************************************"
254 echo
255 ]
256)
257
186AC_ARG_ENABLE(icmp, 258AC_ARG_ENABLE(icmp,
187 [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support.])], 259 [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support (default disabled).])],
188 AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) 260 AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.])
189) 261)
190 262
191AC_ARG_ENABLE(tcp, 263AC_ARG_ENABLE(tcp,
192 [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support.])], 264 [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support (default disabled).])],
193 AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) 265 AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.])
194) 266)
195 267
196AC_ARG_ENABLE(http-proxy, 268AC_ARG_ENABLE(http-proxy,
197 [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support.])], 269 [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support (default disabled).])],
198 AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) 270 AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.])
199) 271)
200 272
201HMAC=16 dnl see also the AC_HELP_STRING 273HMAC=8 dnl see also the AC_HELP_STRING
202AC_ARG_ENABLE(hmac-length, 274AC_ARG_ENABLE(hmac-length,
203 [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 16). Allowed values are 4, 8, 12, 16.])], 275 [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])],
204 HMAC=$enableval 276 HMAC=$enableval
205) 277)
206AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) 278AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.])
207 279
208RAND=8 dnl see also the AC_HELP_STRING 280RAND=8 dnl see also the AC_HELP_STRING
230 302
231CIPHER=bf_cbc 303CIPHER=bf_cbc
232AC_ARG_ENABLE(cipher, 304AC_ARG_ENABLE(cipher,
233 [AC_HELP_STRING(--enable-cipher, [ 305 [AC_HELP_STRING(--enable-cipher, [
234 Select the symmetric cipher (default "bf"). Must be one of 306 Select the symmetric cipher (default "bf"). Must be one of
235 "bf" (blowfish), "aes-128", "aes-192" or "aes-256".])], 307 "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])],
236 if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi 308 if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi
237 if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi 309 if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi
238 if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi 310 if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi
239 if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi 311 if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi
240) 312)
242 314
243DIGEST=sha1 315DIGEST=sha1
244AC_ARG_ENABLE(digest, 316AC_ARG_ENABLE(digest,
245 [AC_HELP_STRING(--enable-digest, [ 317 [AC_HELP_STRING(--enable-digest, [
246 Select the digets algorithm to use (default "sha1"). Must be one of 318 Select the digets algorithm to use (default "sha1"). Must be one of
247 "sha1", "ripemd160", "md4" or "md5".])], 319 "sha1", "ripemd160", "md5" or "md4" (insecure).])],
248 if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi 320 if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi
249 if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi 321 if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi
322 if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi
250 if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi 323 if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi
251 if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi
252) 324)
253AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) 325AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.])
254
255TRUST=1
256m4_if([
257AC_ARG_ENABLE(trust,
258 [AC_HELP_STRING(--enable-trust, [
259 Make authentication faster but allow decoding by all hosts of a VPN.
260 Use this when the VPN hosts DO trust each other and you don't care
261 wether man-in-the-middle sniffing attacks are possible by admins
262 of other VPN hosts. On pentiums or similar machines this can cut down
263 the time for reconnects by 0.4 seconds or more.])],
264 if test "x$enableval" = xyes; then
265 TRUST=1
266 fi
267)
268])
269AC_DEFINE_UNQUOTED(ENABLE_TRUST, $TRUST, [Faster, but VPN hosts may sniff each others data.])
270 326
271if $CXX -v --help 2>&1 | grep -q fno-rtti; then 327if $CXX -v --help 2>&1 | grep -q fno-rtti; then
272 CXXFLAGS="$CXXFLAGS -fno-rtti" 328 CXXFLAGS="$CXXFLAGS -fno-rtti"
273fi 329fi
274 330
275if $CXX -v --help 2>&1 | grep -q fexceptions; then 331if $CXX -v --help 2>&1 | grep -q fexceptions; then
276 CXXFLAGS="$CXXFLAGS -fno-exceptions" 332 CXXFLAGS="$CXXFLAGS -fno-exceptions"
277fi 333fi
278 334
279if $CXX -v --help 2>&1 | grep -q ffunction-sections; then 335dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then
280 CXXFLAGS="$CXXFLAGS -ffunction-sections" 336dnl CXXFLAGS="$CXXFLAGS -ffunction-sections"
281fi 337dnl fi
282 338dnl
283if $LD -v --help 2>&1 | grep -q gc-sections; then 339dnl if $LD -v --help 2>&1 | grep -q gc-sections; then
284 LDFLAGS="$LDFLAGS -Wl,--gc-sections" 340dnl LDFLAGS="$LDFLAGS -Wl,--gc-sections"
285fi 341dnl fi
286 342
287AC_CONFIG_COMMANDS_POST([ 343AC_CONFIG_COMMANDS_POST([
288 344
289echo 345echo
290echo "***" 346echo "***"
291echo "*** Configuration Summary" 347echo "*** Configuration Summary"
292echo "***" 348echo "***"
349echo "*** Kernel Iface: $IFTYPE/$IFSUBTYPE"
293echo "*** Cipher used: $CIPHER" 350echo "*** Cipher used: $CIPHER"
294echo "*** Digest used: $DIGEST" 351echo "*** Digest used: $DIGEST"
295echo "*** HMAC length: $HMAC" 352echo "*** HMAC length: $HMAC"
296echo "*** RAND used: $RAND" 353echo "*** RAND used: $RAND"
297echo "*** Max. MTU: $MTU" 354echo "*** Max. MTU: $MTU"
298echo "*** Compression: $COMPRESS" 355echo "*** Compression: $COMPRESS"
299dnl echo "*** Trusted Mode: $TRUST"
300echo "***" 356echo "***"
357
358if test "x$DIGEST" = xmd4; then
359echo "*** WARNING"
360echo "*** The digest you have chosen ($DIGEST) is known to be insecure"
361echo "***"
362fi
363
301echo 364echo
302 365
303]) 366])
304 367
305AC_SUBST(INCLUDES) 368AC_SUBST(INCLUDES)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines