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.5) |
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__ |
… | |
… | |
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. |
48 | AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions]) |
48 | AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions]) |
49 | AC_DEFINE([__USE_BSD], 1, [Enable BSD extensions]) |
49 | |
|
|
50 | # do NOT define POSIX_SOURCE, sicne this clashes with many BSDs |
|
|
51 | dnl AC_DEFINE([_POSIX_SOURCE], 1, [Enable POSIX 1003.1 extensions]) |
|
|
52 | dnl AC_DEFINE([_XOPEN_SOURCE], 500, [Enable XOPEN extensions]) |
50 | |
53 | |
51 | ALL_LINGUAS="" |
54 | ALL_LINGUAS="" |
52 | |
55 | |
53 | dnl Checks for programs. |
56 | dnl Checks for programs. |
54 | AC_PROG_CC |
57 | AC_PROG_CC |
… | |
… | |
59 | AC_PROG_INSTALL |
62 | AC_PROG_INSTALL |
60 | AC_PROG_LN_S |
63 | AC_PROG_LN_S |
61 | AC_PROG_MAKE_SET |
64 | AC_PROG_MAKE_SET |
62 | AC_PROG_RANLIB |
65 | AC_PROG_RANLIB |
63 | |
66 | |
64 | AC_ISC_POSIX |
|
|
65 | |
|
|
66 | AC_ARG_ENABLE(iftype, |
67 | AC_ARG_ENABLE(iftype, |
67 | [AC_HELP_STRING(--enable-iftype[=TYPE/SUBTYPE], [ |
68 | [AC_HELP_STRING(--enable-iftype[=TYPE/SUBTYPE], [ |
68 | Use kernel/net device interface TYPE/SUBTYPE. |
69 | Use kernel/net device interface TYPE/SUBTYPE. |
69 | Working combinations are: |
70 | Working combinations are: |
70 | "native/linux" "tincd/linux"; |
71 | "native/linux" |
|
|
72 | "tincd/linux" |
|
|
73 | "tincd/freebsd" |
|
|
74 | "tincd/openbsd" |
|
|
75 | "tincd/darwin" |
|
|
76 | "native/cygwin"; |
71 | Untested combinations are: |
77 | Untested combinations are: |
72 | "tincd/freebsd" "tincd/netbsd" "tincd/darwin" "tincd/solaris" |
78 | "tincd/netbsd" |
73 | "tincd/openbsd" "tincd/netbsd" "tincd/cygwin"; |
79 | "tincd/solaris" |
|
|
80 | "tincd/mingw"; |
74 | Broken combinations are: |
81 | Broken combinations are: |
75 | "native/cygwin"; |
82 | "tincd/cygwin"; |
76 | The default is autodetected. |
83 | The default is to autodetect. |
77 | ])], |
84 | ])], |
78 | [ |
85 | [ |
79 | IFTYPE=`echo $enableval | sed s%/.*%%` |
86 | IFTYPE=`echo $enableval | sed s%/.*%%` |
80 | IFSUBTYPE=`echo $enableval | sed s%.*/%%` |
87 | IFSUBTYPE=`echo $enableval | sed s%.*/%%` |
81 | ] |
88 | ] |
… | |
… | |
115 | IFTYPE=tincd |
122 | IFTYPE=tincd |
116 | IFSUBTYPE=netbsd |
123 | IFSUBTYPE=netbsd |
117 | AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) |
124 | AC_DEFINE(HAVE_NETBSD, 1, [NetBSD]) |
118 | ;; |
125 | ;; |
119 | *cygwin*) |
126 | *cygwin*) |
120 | IFTYPE=tincd |
127 | IFTYPE=native |
121 | IFSUBTYPE=cygwin |
128 | IFSUBTYPE=cygwin |
122 | AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) |
129 | AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin]) |
123 | ;; |
130 | ;; |
124 | *) |
131 | *) |
125 | AC_MSG_ERROR("Unknown operating system.") |
132 | AC_MSG_ERROR("Unknown operating system.") |
… | |
… | |
127 | esac |
134 | esac |
128 | fi |
135 | fi |
129 | AC_MSG_RESULT($IFTYPE/$IFSUBTYPE) |
136 | AC_MSG_RESULT($IFTYPE/$IFSUBTYPE) |
130 | AC_SUBST(IFTYPE,$IFTYPE) |
137 | AC_SUBST(IFTYPE,$IFTYPE) |
131 | AC_SUBST(IFSUBTYPE,$IFSUBTYPE) |
138 | AC_SUBST(IFSUBTYPE,$IFSUBTYPE) |
|
|
139 | AC_DEFINE_UNQUOTED(IFTYPE,"$IFTYPE",[kernel interface type]) |
|
|
140 | AC_DEFINE_UNQUOTED(IFSUBTYPE,"$IFSUBTYPE",[kernel interface subtype]) |
132 | |
141 | |
133 | AC_CACHE_SAVE |
142 | AC_CACHE_SAVE |
134 | |
143 | |
135 | dnl Checks for libraries. |
144 | dnl Checks for libraries. |
136 | |
145 | |
137 | AC_LANG(C++) |
146 | AC_LANG(C++) |
138 | AC_CHECK_HEADERS(ext/hash_map) |
147 | AC_CHECK_HEADERS(ext/hash_map) |
139 | |
148 | |
140 | dnl Checks for header files. |
149 | 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 \ |
150 | 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]) |
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]) |
143 | AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], |
153 | AC_CHECK_HEADERS([arpa/inet.h net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [], |
144 | [ |
154 | [ |
145 | #include <sys/types.h> |
155 | #include <sys/types.h> |
146 | #include <sys/socket.h> |
156 | #include <sys/socket.h> |
147 | #ifdef HAVE_NETINET_IN_H |
157 | #ifdef HAVE_NETINET_IN_H |
148 | # include <netinet/in.h> |
158 | # include <netinet/in.h> |
… | |
… | |
194 | |
204 | |
195 | AC_LANG_PUSH(C) |
205 | AC_LANG_PUSH(C) |
196 | |
206 | |
197 | AC_HEADER_STDC |
207 | AC_HEADER_STDC |
198 | |
208 | |
|
|
209 | 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) |
210 | AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall) |
200 | |
211 | |
201 | AC_FUNC_ALLOCA |
212 | AC_FUNC_ALLOCA |
202 | |
213 | |
203 | dnl Support for SunOS |
214 | dnl Support for SunOS |
… | |
… | |
215 | |
226 | |
216 | AC_CACHE_SAVE |
227 | AC_CACHE_SAVE |
217 | |
228 | |
218 | dnl These are defined in files in m4/ |
229 | dnl These are defined in files in m4/ |
219 | tinc_TUNTAP |
230 | tinc_TUNTAP |
|
|
231 | |
220 | tinc_OPENSSL |
232 | tinc_OPENSSL |
|
|
233 | if test "x$openssl_include" != x; then |
|
|
234 | CXXFLAGS="$CXXFLAGS -I$openssl_include" |
|
|
235 | fi |
221 | dnl tinc_ZLIB |
236 | dnl tinc_ZLIB |
222 | |
237 | |
223 | AC_ARG_ENABLE(rohc, |
238 | AC_ARG_ENABLE(rohc, |
224 | [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])], |
239 | [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])], |
225 | [ |
240 | [ |
… | |
… | |
239 | echo |
254 | echo |
240 | ] |
255 | ] |
241 | ) |
256 | ) |
242 | |
257 | |
243 | AC_ARG_ENABLE(icmp, |
258 | AC_ARG_ENABLE(icmp, |
244 | [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support.])], |
259 | [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support (default disabled).])], |
245 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
260 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
246 | ) |
261 | ) |
247 | |
262 | |
248 | AC_ARG_ENABLE(tcp, |
263 | AC_ARG_ENABLE(tcp, |
249 | [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support.])], |
264 | [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support (default disabled).])], |
250 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
265 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
251 | ) |
266 | ) |
252 | |
267 | |
253 | AC_ARG_ENABLE(http-proxy, |
268 | AC_ARG_ENABLE(http-proxy, |
254 | [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).])], |
255 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
270 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
256 | ) |
271 | ) |
257 | |
272 | |
258 | HMAC=16 dnl see also the AC_HELP_STRING |
273 | HMAC=8 dnl see also the AC_HELP_STRING |
259 | AC_ARG_ENABLE(hmac-length, |
274 | 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.])], |
275 | [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 |
276 | HMAC=$enableval |
262 | ) |
277 | ) |
263 | AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) |
278 | AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.]) |
264 | |
279 | |
265 | RAND=8 dnl see also the AC_HELP_STRING |
280 | RAND=8 dnl see also the AC_HELP_STRING |
… | |
… | |
287 | |
302 | |
288 | CIPHER=bf_cbc |
303 | CIPHER=bf_cbc |
289 | AC_ARG_ENABLE(cipher, |
304 | AC_ARG_ENABLE(cipher, |
290 | [AC_HELP_STRING(--enable-cipher, [ |
305 | [AC_HELP_STRING(--enable-cipher, [ |
291 | Select the symmetric cipher (default "bf"). Must be one of |
306 | Select the symmetric cipher (default "bf"). Must be one of |
292 | "bf" (blowfish), "aes-128", "aes-192" or "aes-256".])], |
307 | "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])], |
293 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
308 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
294 | 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 |
295 | 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 |
296 | 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 |
297 | ) |
312 | ) |
… | |
… | |
299 | |
314 | |
300 | DIGEST=sha1 |
315 | DIGEST=sha1 |
301 | AC_ARG_ENABLE(digest, |
316 | AC_ARG_ENABLE(digest, |
302 | [AC_HELP_STRING(--enable-digest, [ |
317 | [AC_HELP_STRING(--enable-digest, [ |
303 | 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 |
304 | "sha1", "ripemd160", "md4" or "md5".])], |
319 | "sha1", "ripemd160", "md5" or "md4" (insecure).])], |
305 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
320 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
306 | 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 |
307 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
323 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
308 | if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi |
|
|
309 | ) |
324 | ) |
310 | AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) |
325 | AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.]) |
311 | |
326 | |
312 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
327 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
313 | CXXFLAGS="$CXXFLAGS -fno-rtti" |
328 | CXXFLAGS="$CXXFLAGS -fno-rtti" |
… | |
… | |
315 | |
330 | |
316 | if $CXX -v --help 2>&1 | grep -q fexceptions; then |
331 | if $CXX -v --help 2>&1 | grep -q fexceptions; then |
317 | CXXFLAGS="$CXXFLAGS -fno-exceptions" |
332 | CXXFLAGS="$CXXFLAGS -fno-exceptions" |
318 | fi |
333 | fi |
319 | |
334 | |
320 | if $CXX -v --help 2>&1 | grep -q ffunction-sections; then |
335 | dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then |
321 | CXXFLAGS="$CXXFLAGS -ffunction-sections" |
336 | dnl CXXFLAGS="$CXXFLAGS -ffunction-sections" |
322 | fi |
337 | dnl fi |
323 | |
338 | dnl |
324 | if $LD -v --help 2>&1 | grep -q gc-sections; then |
339 | dnl if $LD -v --help 2>&1 | grep -q gc-sections; then |
325 | LDFLAGS="$LDFLAGS -Wl,--gc-sections" |
340 | dnl LDFLAGS="$LDFLAGS -Wl,--gc-sections" |
326 | fi |
341 | dnl fi |
327 | |
342 | |
328 | AC_CONFIG_COMMANDS_POST([ |
343 | AC_CONFIG_COMMANDS_POST([ |
329 | |
344 | |
330 | echo |
345 | echo |
331 | echo "***" |
346 | echo "***" |
… | |
… | |
336 | echo "*** Digest used: $DIGEST" |
351 | echo "*** Digest used: $DIGEST" |
337 | echo "*** HMAC length: $HMAC" |
352 | echo "*** HMAC length: $HMAC" |
338 | echo "*** RAND used: $RAND" |
353 | echo "*** RAND used: $RAND" |
339 | echo "*** Max. MTU: $MTU" |
354 | echo "*** Max. MTU: $MTU" |
340 | echo "*** Compression: $COMPRESS" |
355 | echo "*** Compression: $COMPRESS" |
341 | echo "***" |
|
|
342 | |
356 | |
343 | if test "x$DIGEST" = xmd4; then |
357 | if test "x$DIGEST" = xmd4; then |
344 | echo "*** WARNING" |
358 | echo "***" |
345 | echo "*** The digest you have chosen ($DIGEST) is known to be insecure" |
359 | echo "*** WARNING: The digest you have chosen ($DIGEST) is known to be insecure" |
346 | echo "***" |
|
|
347 | fi |
360 | fi |
|
|
361 | |
|
|
362 | if test "$HMAC" -lt 12; then |
|
|
363 | echo "***" |
|
|
364 | echo "*** WARNING: The hmac length you have chosen ($HMAC) might be insecure" |
|
|
365 | fi |
|
|
366 | |
|
|
367 | if test "$RAND" -lt 8; then |
|
|
368 | echo "***" |
|
|
369 | echo "*** WARNING: The random prefix you have chosen ($RAND) might be insecure" |
|
|
370 | fi |
|
|
371 | |
|
|
372 | echo "***" |
348 | |
373 | |
349 | echo |
374 | echo |
350 | |
375 | |
351 | ]) |
376 | ]) |
352 | |
377 | |