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" |
|
|
71 | "tincd/linux" |
|
|
72 | "tincd/freebsd" |
|
|
73 | "tincd/openbsd" |
|
|
74 | "native/cygwin"; |
71 | Untested combinations are: |
75 | Untested combinations are: |
72 | "tincd/freebsd" "tincd/netbsd" "tincd/darwin" "tincd/solaris" |
76 | "tincd/netbsd" |
73 | "tincd/openbsd" "tincd/netbsd" "tincd/cygwin"; |
77 | "tincd/darwin" |
|
|
78 | "tincd/solaris" |
|
|
79 | "tincd/mingw"; |
74 | Broken combinations are: |
80 | Broken combinations are: |
75 | "native/cygwin"; |
81 | "tincd/cygwin"; |
76 | The default is autodetected. |
82 | The default is to autodetect. |
77 | ])], |
83 | ])], |
78 | [ |
84 | [ |
79 | IFTYPE=`echo $enableval | sed s%/.*%%` |
85 | IFTYPE=`echo $enableval | sed s%/.*%%` |
80 | IFSUBTYPE=`echo $enableval | sed s%.*/%%` |
86 | IFSUBTYPE=`echo $enableval | sed s%.*/%%` |
81 | ] |
87 | ] |
… | |
… | |
115 | IFTYPE=tincd |
121 | IFTYPE=tincd |
116 | IFSUBTYPE=netbsd |
122 | IFSUBTYPE=netbsd |
117 | AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) |
123 | AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) |
118 | ;; |
124 | ;; |
119 | *cygwin*) |
125 | *cygwin*) |
120 | IFTYPE=tincd |
126 | IFTYPE=native |
121 | IFSUBTYPE=cygwin |
127 | IFSUBTYPE=cygwin |
122 | AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) |
128 | AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) |
123 | ;; |
129 | ;; |
124 | *) |
130 | *) |
125 | AC_MSG_ERROR("Unknown operating system.") |
131 | AC_MSG_ERROR("Unknown operating system.") |
… | |
… | |
137 | AC_LANG(C++) |
143 | AC_LANG(C++) |
138 | AC_CHECK_HEADERS(ext/hash_map) |
144 | AC_CHECK_HEADERS(ext/hash_map) |
139 | |
145 | |
140 | dnl Checks for header files. |
146 | 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 \ |
147 | 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]) |
148 | sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h arpa/inet.h \ |
|
|
149 | 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], [], [], |
150 | AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], |
144 | [ |
151 | [ |
145 | #include <sys/types.h> |
152 | #include <sys/types.h> |
146 | #include <sys/socket.h> |
153 | #include <sys/socket.h> |
147 | #ifdef HAVE_NETINET_IN_H |
154 | #ifdef HAVE_NETINET_IN_H |
… | |
… | |
194 | |
201 | |
195 | AC_LANG_PUSH(C) |
202 | AC_LANG_PUSH(C) |
196 | |
203 | |
197 | AC_HEADER_STDC |
204 | AC_HEADER_STDC |
198 | |
205 | |
|
|
206 | dnl argl, could somebody catapult darwin into the 21st century??? |
199 | AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall) |
207 | AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall poll) |
200 | |
208 | |
201 | AC_FUNC_ALLOCA |
209 | AC_FUNC_ALLOCA |
202 | |
210 | |
203 | dnl Support for SunOS |
211 | dnl Support for SunOS |
204 | |
212 | |
… | |
… | |
215 | |
223 | |
216 | AC_CACHE_SAVE |
224 | AC_CACHE_SAVE |
217 | |
225 | |
218 | dnl These are defined in files in m4/ |
226 | dnl These are defined in files in m4/ |
219 | tinc_TUNTAP |
227 | tinc_TUNTAP |
|
|
228 | |
220 | tinc_OPENSSL |
229 | tinc_OPENSSL |
|
|
230 | if test "x$openssl_include" != x; then |
|
|
231 | CXXFLAGS="$CXXFLAGS -I$openssl_include" |
|
|
232 | fi |
221 | dnl tinc_ZLIB |
233 | dnl tinc_ZLIB |
222 | |
234 | |
223 | AC_ARG_ENABLE(rohc, |
235 | AC_ARG_ENABLE(rohc, |
224 | [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])], |
236 | [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])], |
225 | [ |
237 | [ |
… | |
… | |
239 | echo |
251 | echo |
240 | ] |
252 | ] |
241 | ) |
253 | ) |
242 | |
254 | |
243 | AC_ARG_ENABLE(icmp, |
255 | AC_ARG_ENABLE(icmp, |
244 | [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support.])], |
256 | [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support (default disabled).])], |
245 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
257 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
246 | ) |
258 | ) |
247 | |
259 | |
248 | AC_ARG_ENABLE(tcp, |
260 | AC_ARG_ENABLE(tcp, |
249 | [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support.])], |
261 | [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support (default disabled).])], |
250 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
262 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
251 | ) |
263 | ) |
252 | |
264 | |
253 | AC_ARG_ENABLE(http-proxy, |
265 | AC_ARG_ENABLE(http-proxy, |
254 | [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support.])], |
266 | [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.]) |
267 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
256 | ) |
268 | ) |
257 | |
269 | |
258 | HMAC=16 dnl see also the AC_HELP_STRING |
270 | HMAC=12 dnl see also the AC_HELP_STRING |
259 | AC_ARG_ENABLE(hmac-length, |
271 | 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.])], |
272 | [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 |
273 | HMAC=$enableval |
262 | ) |
274 | ) |
263 | AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) |
275 | AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) |
264 | |
276 | |
265 | RAND=8 dnl see also the AC_HELP_STRING |
277 | RAND=8 dnl see also the AC_HELP_STRING |
… | |
… | |
287 | |
299 | |
288 | CIPHER=bf_cbc |
300 | CIPHER=bf_cbc |
289 | AC_ARG_ENABLE(cipher, |
301 | AC_ARG_ENABLE(cipher, |
290 | [AC_HELP_STRING(--enable-cipher, [ |
302 | [AC_HELP_STRING(--enable-cipher, [ |
291 | Select the symmetric cipher (default "bf"). Must be one of |
303 | Select the symmetric cipher (default "bf"). Must be one of |
292 | "bf" (blowfish), "aes-128", "aes-192" or "aes-256".])], |
304 | "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])], |
293 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
305 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
294 | if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi |
306 | 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 |
307 | 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 |
308 | if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi |
297 | ) |
309 | ) |
… | |
… | |
299 | |
311 | |
300 | DIGEST=sha1 |
312 | DIGEST=sha1 |
301 | AC_ARG_ENABLE(digest, |
313 | AC_ARG_ENABLE(digest, |
302 | [AC_HELP_STRING(--enable-digest, [ |
314 | [AC_HELP_STRING(--enable-digest, [ |
303 | Select the digets algorithm to use (default "sha1"). Must be one of |
315 | Select the digets algorithm to use (default "sha1"). Must be one of |
304 | "sha1", "ripemd160", "md4" or "md5".])], |
316 | "sha1", "ripemd160", "md5" or "md4" (insecure).])], |
305 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
317 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
306 | if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi |
318 | if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi |
|
|
319 | if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi |
307 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
320 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
308 | if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi |
|
|
309 | ) |
321 | ) |
310 | AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) |
322 | AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) |
311 | |
323 | |
312 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
324 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
313 | CXXFLAGS="$CXXFLAGS -fno-rtti" |
325 | CXXFLAGS="$CXXFLAGS -fno-rtti" |