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.57) |
3 | AC_PREREQ(2.57) |
4 | AC_INIT(src/vped.C) |
4 | AC_INIT(src/vped.C) |
5 | AC_CANONICAL_TARGET |
5 | AC_CANONICAL_TARGET |
6 | AM_INIT_AUTOMAKE(vpe, 1.0) |
6 | AM_INIT_AUTOMAKE(vpe, 1.2) |
7 | AM_CONFIG_HEADER(config.h) |
7 | AM_CONFIG_HEADER(config.h) |
8 | AM_MAINTAINER_MODE |
8 | AM_MAINTAINER_MODE |
9 | |
9 | |
10 | AH_TOP([ |
10 | AH_TOP([ |
11 | #ifndef CONFIG_H__ |
11 | #ifndef CONFIG_H__ |
… | |
… | |
65 | |
65 | |
66 | AC_ARG_ENABLE(iftype, |
66 | AC_ARG_ENABLE(iftype, |
67 | [AC_HELP_STRING(--enable-iftype[=TYPE/SUBTYPE], [ |
67 | [AC_HELP_STRING(--enable-iftype[=TYPE/SUBTYPE], [ |
68 | Use kernel/net device interface TYPE/SUBTYPE. |
68 | Use kernel/net device interface TYPE/SUBTYPE. |
69 | Working combinations are: |
69 | Working combinations are: |
70 | "native/linux" "tincd/linux"; |
70 | "native/linux" "tincd/linux" "tincd/freebsd"; |
71 | Untested combinations are: |
71 | Untested combinations are: |
72 | "tincd/freebsd" "tincd/netbsd" "tincd/darwin" "tincd/solaris" |
72 | "tincd/netbsd" "tincd/darwin" "tincd/solaris" |
73 | "tincd/openbsd" "tincd/netbsd" "tincd/cygwin"; |
73 | "tincd/openbsd" "tincd/cygwin"; |
74 | Broken combinations are: |
74 | Broken combinations are: |
75 | "native/cygwin"; |
75 | "native/cygwin"; |
76 | The default is autodetected. |
76 | The default is to autodetect. |
77 | ])], |
77 | ])], |
78 | [ |
78 | [ |
79 | IFTYPE=`echo $enableval | sed s%/.*%%` |
79 | IFTYPE=`echo $enableval | sed s%/.*%%` |
80 | IFSUBTYPE=`echo $enableval | sed s%.*/%%` |
80 | IFSUBTYPE=`echo $enableval | sed s%.*/%%` |
81 | ] |
81 | ] |
… | |
… | |
137 | AC_LANG(C++) |
137 | AC_LANG(C++) |
138 | AC_CHECK_HEADERS(ext/hash_map) |
138 | AC_CHECK_HEADERS(ext/hash_map) |
139 | |
139 | |
140 | dnl Checks for header files. |
140 | dnl Checks for header files. |
141 | AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ |
141 | AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \ |
142 | sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h cygwin.h arpa/inet.h netinet/in.h]) |
142 | sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h cygwin.h arpa/inet.h \ |
|
|
143 | sys/poll.h sys/mman.h netinet/in.h]) |
143 | AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], |
144 | AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], |
144 | [ |
145 | [ |
145 | #include <sys/types.h> |
146 | #include <sys/types.h> |
146 | #include <sys/socket.h> |
147 | #include <sys/socket.h> |
147 | #ifdef HAVE_NETINET_IN_H |
148 | #ifdef HAVE_NETINET_IN_H |
… | |
… | |
159 | AC_C_CONST |
160 | AC_C_CONST |
160 | AC_TYPE_PID_T |
161 | AC_TYPE_PID_T |
161 | AC_TYPE_SIZE_T |
162 | AC_TYPE_SIZE_T |
162 | AC_HEADER_TIME |
163 | AC_HEADER_TIME |
163 | AC_STRUCT_TM |
164 | AC_STRUCT_TM |
|
|
165 | |
|
|
166 | dnl argl, could somebody catapult darwin into the 21st century??? |
|
|
167 | AC_CHECK_FUNCS(poll) |
164 | |
168 | |
165 | AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, |
169 | AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, |
166 | [ |
170 | [ |
167 | AC_TRY_COMPILE( |
171 | AC_TRY_COMPILE( |
168 | [#include <sys/types.h> |
172 | [#include <sys/types.h> |
… | |
… | |
239 | echo |
243 | echo |
240 | ] |
244 | ] |
241 | ) |
245 | ) |
242 | |
246 | |
243 | AC_ARG_ENABLE(icmp, |
247 | AC_ARG_ENABLE(icmp, |
244 | [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support.])], |
248 | [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support (default disabled).])], |
245 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
249 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
246 | ) |
250 | ) |
247 | |
251 | |
248 | AC_ARG_ENABLE(tcp, |
252 | AC_ARG_ENABLE(tcp, |
249 | [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support.])], |
253 | [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support (default disabled).])], |
250 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
254 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
251 | ) |
255 | ) |
252 | |
256 | |
253 | AC_ARG_ENABLE(http-proxy, |
257 | AC_ARG_ENABLE(http-proxy, |
254 | [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support.])], |
258 | [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support (default disabled).])], |
255 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
259 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
256 | ) |
260 | ) |
257 | |
261 | |
258 | HMAC=16 dnl see also the AC_HELP_STRING |
262 | HMAC=12 dnl see also the AC_HELP_STRING |
259 | AC_ARG_ENABLE(hmac-length, |
263 | AC_ARG_ENABLE(hmac-length, |
260 | [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 16). Allowed values are 4, 8, 12, 16.])], |
264 | [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])], |
261 | HMAC=$enableval |
265 | HMAC=$enableval |
262 | ) |
266 | ) |
263 | AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) |
267 | AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) |
264 | |
268 | |
265 | RAND=8 dnl see also the AC_HELP_STRING |
269 | RAND=8 dnl see also the AC_HELP_STRING |
… | |
… | |
287 | |
291 | |
288 | CIPHER=bf_cbc |
292 | CIPHER=bf_cbc |
289 | AC_ARG_ENABLE(cipher, |
293 | AC_ARG_ENABLE(cipher, |
290 | [AC_HELP_STRING(--enable-cipher, [ |
294 | [AC_HELP_STRING(--enable-cipher, [ |
291 | Select the symmetric cipher (default "bf"). Must be one of |
295 | Select the symmetric cipher (default "bf"). Must be one of |
292 | "bf" (blowfish), "aes-128", "aes-192" or "aes-256".])], |
296 | "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])], |
293 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
297 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
294 | if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi |
298 | if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi |
295 | if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi |
299 | if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi |
296 | if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi |
300 | if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi |
297 | ) |
301 | ) |
… | |
… | |
299 | |
303 | |
300 | DIGEST=sha1 |
304 | DIGEST=sha1 |
301 | AC_ARG_ENABLE(digest, |
305 | AC_ARG_ENABLE(digest, |
302 | [AC_HELP_STRING(--enable-digest, [ |
306 | [AC_HELP_STRING(--enable-digest, [ |
303 | Select the digets algorithm to use (default "sha1"). Must be one of |
307 | Select the digets algorithm to use (default "sha1"). Must be one of |
304 | "sha1", "ripemd160", "md4" or "md5".])], |
308 | "sha1", "ripemd160", "md5" or "md4" (insecure).])], |
305 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
309 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
306 | if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi |
310 | if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi |
|
|
311 | if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi |
307 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
312 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
308 | if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi |
|
|
309 | ) |
313 | ) |
310 | AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) |
314 | AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) |
311 | |
315 | |
312 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
316 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
313 | CXXFLAGS="$CXXFLAGS -fno-rtti" |
317 | CXXFLAGS="$CXXFLAGS -fno-rtti" |