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, 0.1) |
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 |
67 | AC_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 | |
66 | m4_if([ |
|
|
67 | dnl Check and set OS |
91 | dnl Check and set OS |
|
|
92 | AC_MSG_CHECKING(for kernel networking interface type) |
68 | |
93 | |
|
|
94 | if test "x$IFTYPE" = "x"; then |
69 | case $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 | ;; |
101 | esac |
134 | esac |
102 | ]) |
135 | fi |
|
|
136 | AC_MSG_RESULT($IFTYPE/$IFSUBTYPE) |
|
|
137 | AC_SUBST(IFTYPE,$IFTYPE) |
|
|
138 | AC_SUBST(IFSUBTYPE,$IFSUBTYPE) |
|
|
139 | AC_DEFINE_UNQUOTED(IFTYPE,"$IFTYPE",[kernel interface type]) |
|
|
140 | AC_DEFINE_UNQUOTED(IFSUBTYPE,"$IFSUBTYPE",[kernel interface subtype]) |
103 | |
141 | |
104 | AC_CACHE_SAVE |
142 | AC_CACHE_SAVE |
105 | |
143 | |
106 | dnl Checks for libraries. |
144 | dnl Checks for libraries. |
107 | |
145 | |
108 | AC_LANG(C++) |
146 | AC_LANG(C++) |
109 | AC_CHECK_HEADERS(ext/hash_map) |
147 | AC_CHECK_HEADERS(ext/hash_map) |
110 | |
148 | |
111 | dnl Checks for header files. |
149 | dnl Checks for header files. |
112 | 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 \ |
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]) |
114 | AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h], [], [], |
153 | AC_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 | |
121 | dnl Checks for typedefs, structures, and compiler characteristics. |
168 | dnl Checks for typedefs, structures, and compiler characteristics. |
122 | AC_C_CONST |
169 | AC_C_CONST |
123 | AC_TYPE_PID_T |
170 | AC_TYPE_PID_T |
124 | AC_TYPE_SIZE_T |
171 | AC_TYPE_SIZE_T |
… | |
… | |
157 | |
204 | |
158 | AC_LANG_PUSH(C) |
205 | AC_LANG_PUSH(C) |
159 | |
206 | |
160 | AC_HEADER_STDC |
207 | AC_HEADER_STDC |
161 | |
208 | |
|
|
209 | dnl argl, could somebody catapult darwin into the 21st century??? |
162 | 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) |
163 | |
211 | |
164 | AC_FUNC_ALLOCA |
212 | AC_FUNC_ALLOCA |
165 | |
213 | |
166 | dnl Support for SunOS |
214 | dnl Support for SunOS |
… | |
… | |
178 | |
226 | |
179 | AC_CACHE_SAVE |
227 | AC_CACHE_SAVE |
180 | |
228 | |
181 | dnl These are defined in files in m4/ |
229 | dnl These are defined in files in m4/ |
182 | tinc_TUNTAP |
230 | tinc_TUNTAP |
|
|
231 | |
183 | tinc_OPENSSL |
232 | tinc_OPENSSL |
|
|
233 | if test "x$openssl_include" != x; then |
|
|
234 | CXXFLAGS="$CXXFLAGS -I$openssl_include" |
|
|
235 | fi |
184 | dnl tinc_ZLIB |
236 | dnl tinc_ZLIB |
185 | |
237 | |
|
|
238 | AC_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 is highly experimental, do not use ****************" |
|
|
245 | echo "**********************************************************************" |
|
|
246 | echo "**********************************************************************" |
|
|
247 | echo |
|
|
248 | rohc=true |
|
|
249 | AC_DEFINE_UNQUOTED(ENABLE_ROHC, 1, [ROHC support]) |
|
|
250 | ] |
|
|
251 | ) |
|
|
252 | |
|
|
253 | AM_CONDITIONAL(ROHC, test x$rohc = xtrue) |
|
|
254 | |
|
|
255 | AC_ARG_ENABLE(icmp, |
|
|
256 | [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support (default disabled).])], |
|
|
257 | AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.]) |
|
|
258 | ) |
|
|
259 | |
186 | AC_ARG_ENABLE(tcp, |
260 | AC_ARG_ENABLE(tcp, |
187 | [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support.])], |
261 | [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support (default disabled).])], |
188 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
262 | AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.]) |
189 | ) |
263 | ) |
190 | |
264 | |
|
|
265 | AC_ARG_ENABLE(http-proxy, |
|
|
266 | [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support (default disabled).])], |
|
|
267 | AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.]) |
|
|
268 | ) |
|
|
269 | |
191 | HMAC=16 dnl see also the AC_HELP_STRING |
270 | HMAC=8 dnl see also the AC_HELP_STRING |
192 | AC_ARG_ENABLE(hmac-length, |
271 | AC_ARG_ENABLE(hmac-length, |
193 | [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.])], |
194 | HMAC=$enableval |
273 | HMAC=$enableval |
195 | ) |
274 | ) |
196 | 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.]) |
197 | |
276 | |
198 | RAND=8 dnl see also the AC_HELP_STRING |
277 | RAND=8 dnl see also the AC_HELP_STRING |
… | |
… | |
220 | |
299 | |
221 | CIPHER=bf_cbc |
300 | CIPHER=bf_cbc |
222 | AC_ARG_ENABLE(cipher, |
301 | AC_ARG_ENABLE(cipher, |
223 | [AC_HELP_STRING(--enable-cipher, [ |
302 | [AC_HELP_STRING(--enable-cipher, [ |
224 | Select the symmetric cipher (default "bf"). Must be one of |
303 | Select the symmetric cipher (default "bf"). Must be one of |
225 | "bf" (blowfish), "aes-128", "aes-192" or "aes-256".])], |
304 | "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])], |
226 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
305 | if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi |
227 | 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 |
228 | 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 |
229 | 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 |
230 | ) |
309 | ) |
… | |
… | |
232 | |
311 | |
233 | DIGEST=sha1 |
312 | DIGEST=sha1 |
234 | AC_ARG_ENABLE(digest, |
313 | AC_ARG_ENABLE(digest, |
235 | [AC_HELP_STRING(--enable-digest, [ |
314 | [AC_HELP_STRING(--enable-digest, [ |
236 | 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 |
237 | "sha1", "ripemd160", "md4" or "md5".])], |
316 | "sha1", "ripemd160", "md5" or "md4" (insecure).])], |
238 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
317 | if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi |
239 | 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 |
240 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
320 | if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi |
241 | if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi |
|
|
242 | ) |
321 | ) |
243 | 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.]) |
244 | |
|
|
245 | TRUST=1 |
|
|
246 | m4_if([ |
|
|
247 | AC_ARG_ENABLE(trust, |
|
|
248 | [AC_HELP_STRING(--enable-trust, [ |
|
|
249 | Make authentication faster but allow decoding by all hosts of a VPN. |
|
|
250 | Use this when the VPN hosts DO trust each other and you don't care |
|
|
251 | wether man-in-the-middle sniffing attacks are possible by admins |
|
|
252 | of other VPN hosts. On pentiums or similar machines this can cut down |
|
|
253 | the time for reconnects by 0.4 seconds or more.])], |
|
|
254 | if test "x$enableval" = xyes; then |
|
|
255 | TRUST=1 |
|
|
256 | fi |
|
|
257 | ) |
|
|
258 | ]) |
|
|
259 | AC_DEFINE_UNQUOTED(ENABLE_TRUST, $TRUST, [Faster, but VPN hosts may sniff each others data.]) |
|
|
260 | |
323 | |
261 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
324 | if $CXX -v --help 2>&1 | grep -q fno-rtti; then |
262 | CXXFLAGS="$CXXFLAGS -fno-rtti" |
325 | CXXFLAGS="$CXXFLAGS -fno-rtti" |
263 | fi |
326 | fi |
264 | |
327 | |
265 | if $CXX -v --help 2>&1 | grep -q fexceptions; then |
328 | if $CXX -v --help 2>&1 | grep -q fexceptions; then |
266 | CXXFLAGS="$CXXFLAGS -fno-exceptions" |
329 | CXXFLAGS="$CXXFLAGS -fno-exceptions" |
267 | fi |
330 | fi |
268 | |
331 | |
269 | if $CXX -v --help 2>&1 | grep -q ffunction-sections; then |
332 | dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then |
270 | CXXFLAGS="$CXXFLAGS -ffunction-sections" |
333 | dnl CXXFLAGS="$CXXFLAGS -ffunction-sections" |
271 | fi |
334 | dnl fi |
272 | |
335 | dnl |
273 | if $LD -v --help 2>&1 | grep -q gc-sections; then |
336 | dnl if $LD -v --help 2>&1 | grep -q gc-sections; then |
274 | LDFLAGS="$LDFLAGS -Wl,--gc-sections" |
337 | dnl LDFLAGS="$LDFLAGS -Wl,--gc-sections" |
275 | fi |
338 | dnl fi |
276 | |
339 | |
277 | AC_CONFIG_COMMANDS_POST([ |
340 | AC_CONFIG_COMMANDS_POST([ |
278 | |
341 | |
279 | echo |
342 | echo |
280 | echo "***" |
343 | echo "***" |
281 | echo "*** Configuration Summary" |
344 | echo "*** Configuration Summary" |
282 | echo "***" |
345 | echo "***" |
|
|
346 | echo "*** Kernel Iface: $IFTYPE/$IFSUBTYPE" |
283 | echo "*** Cipher used: $CIPHER" |
347 | echo "*** Cipher used: $CIPHER" |
284 | echo "*** Digest used: $DIGEST" |
348 | echo "*** Digest used: $DIGEST" |
285 | echo "*** HMAC length: $HMAC" |
349 | echo "*** HMAC length: $HMAC" |
286 | echo "*** RAND used: $RAND" |
350 | echo "*** RAND used: $RAND" |
287 | echo "*** Max. MTU: $MTU" |
351 | echo "*** Max. MTU: $MTU" |
288 | echo "*** Compression: $COMPRESS" |
352 | echo "*** Compression: $COMPRESS" |
289 | dnl echo "*** Trusted Mode: $TRUST" |
353 | |
|
|
354 | if test "x$DIGEST" = xmd4; then |
290 | echo "***" |
355 | echo "***" |
|
|
356 | echo "*** WARNING: The digest you have chosen ($DIGEST) is known to be insecure" |
|
|
357 | fi |
|
|
358 | |
|
|
359 | if test "$HMAC" -lt 12; then |
|
|
360 | echo "***" |
|
|
361 | echo "*** WARNING: The hmac length you have chosen ($HMAC) might be insecure" |
|
|
362 | fi |
|
|
363 | |
|
|
364 | if test "$RAND" -lt 8; then |
|
|
365 | echo "***" |
|
|
366 | echo "*** WARNING: The random prefix you have chosen ($RAND) might be insecure" |
|
|
367 | fi |
|
|
368 | |
|
|
369 | echo "***" |
|
|
370 | |
291 | echo |
371 | echo |
292 | |
372 | |
293 | ]) |
373 | ]) |
294 | |
374 | |
295 | AC_SUBST(INCLUDES) |
375 | AC_SUBST(INCLUDES) |
296 | |
376 | |
297 | AC_OUTPUT(Makefile po/Makefile.in |
377 | AC_OUTPUT(Makefile po/Makefile.in |
298 | src/Makefile |
378 | src/Makefile |
|
|
379 | src/rohc/Makefile |
299 | doc/Makefile |
380 | doc/Makefile |
300 | lib/Makefile |
381 | lib/Makefile |
301 | m4/Makefile |
382 | m4/Makefile |
302 | ) |
383 | ) |