ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/configure.ac
Revision: 1.22
Committed: Sat Jan 17 15:43:02 2004 UTC (20 years, 3 months ago) by pcg
Branch: MAIN
CVS Tags: VPE_1_4
Changes since 1.21: +6 -5 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.57)
4 AC_INIT(src/vped.C)
5 AC_CANONICAL_TARGET
6 AM_INIT_AUTOMAKE(vpe, 1.4)
7 AM_CONFIG_HEADER(config.h)
8 AM_MAINTAINER_MODE
9
10 AH_TOP([
11 #ifndef CONFIG_H__
12 #define CONFIG_H__
13
14 #ifdef __cplusplus
15 using namespace std;
16 #endif
17
18 ])
19
20 AH_BOTTOM([
21 #if __CYGWIN__
22
23 typedef unsigned char u8;
24 typedef unsigned short u16;
25 typedef unsigned int u32;
26
27 #else
28 #include <inttypes.h>
29
30 /* old modula-2 habits */
31 typedef unsigned char u8;
32 typedef uint16_t u16;
33 typedef uint32_t u32;
34 #endif
35
36 #endif
37 ])
38
39 dnl Include the macros from the m4/ directory
40 AM_ACLOCAL_INCLUDE(m4)
41
42 AM_GNU_GETTEXT([external])
43 AM_GNU_GETTEXT_VERSION(0.11.5)
44
45 # Enable GNU extensions.
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.
48 AC_DEFINE([_GNU_SOURCE], 1, [Enable GNU extenstions])
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])
53
54 ALL_LINGUAS=""
55
56 dnl Checks for programs.
57 AC_PROG_CC
58 AC_PROG_CPP
59 AC_PROG_CXX
60 AC_PROG_GCC_TRADITIONAL
61 AC_PROG_AWK
62 AC_PROG_INSTALL
63 AC_PROG_LN_S
64 AC_PROG_MAKE_SET
65 AC_PROG_RANLIB
66
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 )
90
91 dnl Check and set OS
92 AC_MSG_CHECKING(for kernel networking interface type)
93
94 if test "x$IFTYPE" = "x"; then
95 case $target_os in
96 *linux*)
97 IFTYPE=native
98 IFSUBTYPE=linux
99 AC_DEFINE(HAVE_LINUX, 1, [Linux])
100 ;;
101 *freebsd*)
102 IFTYPE=tincd
103 IFSUBTYPE=freebsd
104 AC_DEFINE(HAVE_FREEBSD, 1, [FreeBSD])
105 ;;
106 *darwin*)
107 IFTYPE=tincd
108 IFSUBTYPE=darwin
109 AC_DEFINE(HAVE_DARWIN, 1, [Darwin (MacOS/X)])
110 ;;
111 *solaris*)
112 IFTYPE=tincd
113 IFSUBTYPE=solaris
114 AC_DEFINE(HAVE_SOLARIS, 1, [Solaris/SunOS])
115 ;;
116 *openbsd*)
117 IFTYPE=tincd
118 IFSUBTYPE=openbsd
119 AC_DEFINE(HAVE_OPENBSD, 1, [OpenBSD])
120 ;;
121 *netbsd*)
122 IFTYPE=tincd
123 IFSUBTYPE=netbsd
124 AC_DEFINE(HAVE_NETBSD, 1, [NetBSD])
125 ;;
126 *cygwin*)
127 IFTYPE=native
128 IFSUBTYPE=cygwin
129 AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
130 ;;
131 *)
132 AC_MSG_ERROR("Unknown operating system.")
133 ;;
134 esac
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])
141
142 AC_CACHE_SAVE
143
144 dnl Checks for libraries.
145
146 AC_LANG(C++)
147 AC_CHECK_HEADERS(ext/hash_map)
148
149 dnl Checks for header files.
150 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.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])
153 AC_CHECK_HEADERS([arpa/inet.h net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [],
154 [
155 #include <sys/types.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
163 #ifdef HAVE_NETINET_IN_SYSTM_H
164 # include <netinet/in_systm.h>
165 #endif
166 ])
167
168 dnl Checks for typedefs, structures, and compiler characteristics.
169 AC_C_CONST
170 AC_TYPE_PID_T
171 AC_TYPE_SIZE_T
172 AC_HEADER_TIME
173 AC_STRUCT_TM
174
175 AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
176 [
177 AC_TRY_COMPILE(
178 [#include <sys/types.h>
179 #include <sys/socket.h>],
180 [socklen_t len = 42; return len;],
181 ac_cv_type_socklen_t=yes,
182 ac_cv_type_socklen_t=no)
183 ])
184 if test $ac_cv_type_socklen_t = yes; then
185 AC_DEFINE(HAVE_SOCKLEN_T, 1, [socklen_t available])
186 fi
187
188 AC_CACHE_CHECK([for struct addrinfo], ac_cv_struct_addrinfo,
189 [
190 AC_TRY_COMPILE(
191 [#include <sys/types.h>
192 #include <sys/socket.h>
193 #include <netdb.h>],
194 [struct addrinfo ai; ai.ai_family = AF_INET; return ai.ai_family;],
195 ac_cv_struct_addrinfo=yes,
196 ac_cv_struct_addrinfo=no)
197 ])
198 if test $ac_cv_struct_addrinfo = yes; then
199 AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [struct addrinfo available])
200 fi
201
202 dnl Checks for library functions.
203 AC_TYPE_SIGNAL
204
205 AC_LANG_PUSH(C)
206
207 AC_HEADER_STDC
208
209 dnl argl, could somebody catapult darwin into the 21st century???
210 AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall)
211
212 AC_FUNC_ALLOCA
213
214 dnl Support for SunOS
215
216 AC_CHECK_FUNC(socket, [], [
217 AC_CHECK_LIB(socket, connect)
218 ])
219 AC_CHECK_FUNC(gethostbyname, [], [
220 AC_CHECK_LIB(nsl, gethostbyname)
221 ])
222
223 AC_LANG_POP
224
225 dnl AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo])
226
227 AC_CACHE_SAVE
228
229 dnl These are defined in files in m4/
230 tinc_TUNTAP
231
232 tinc_OPENSSL
233 if test "x$openssl_include" != x; then
234 CXXFLAGS="$CXXFLAGS -I$openssl_include"
235 fi
236 dnl tinc_ZLIB
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 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
258 AC_ARG_ENABLE(icmp,
259 [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support (default disabled).])],
260 AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.])
261 )
262
263 AC_ARG_ENABLE(tcp,
264 [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support (default disabled).])],
265 AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.])
266 )
267
268 AC_ARG_ENABLE(http-proxy,
269 [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support (default disabled).])],
270 AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.])
271 )
272
273 HMAC=8 dnl see also the AC_HELP_STRING
274 AC_ARG_ENABLE(hmac-length,
275 [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])],
276 HMAC=$enableval
277 )
278 AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.])
279
280 RAND=8 dnl see also the AC_HELP_STRING
281 AC_ARG_ENABLE(rand-length,
282 [AC_HELP_STRING(--enable-rand-length=BYTES, [use BYTES bytes of extra randomness (default 8). Allowed values are 0, 4, 8.])],
283 RAND=$enableval
284 )
285 AC_DEFINE_UNQUOTED(RAND_SIZE, $RAND, [Add this many bytes of randomness to each packet.])
286
287 MTU=1500 dnl see also the AC_HELP_STRING
288 AC_ARG_ENABLE(mtu,
289 [AC_HELP_STRING(--enable-max-mtu=BYTES, enable mtu sizes upto BYTES bytes (default 1500). Use 9100 for jumbogram support.)],
290 MTU=$enableval
291 )
292 AC_DEFINE_UNQUOTED(MAX_MTU, $MTU + 14, [Maximum MTU supported.])
293
294 COMPRESS=1
295 AC_ARG_ENABLE(compression,
296 [AC_HELP_STRING(--disable-compression, Disable compression support.)],
297 if test "x$enableval" = xno; then
298 COMPRESS=0
299 fi
300 )
301 AC_DEFINE_UNQUOTED(ENABLE_COMPRESSION, $COMPRESS, [Enable compression support.])
302
303 CIPHER=bf_cbc
304 AC_ARG_ENABLE(cipher,
305 [AC_HELP_STRING(--enable-cipher, [
306 Select the symmetric cipher (default "bf"). Must be one of
307 "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])],
308 if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi
309 if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi
310 if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi
311 if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi
312 )
313 AC_DEFINE_UNQUOTED(ENABLE_CIPHER, EVP_${CIPHER}, [Select the symmetric cipher to use.])
314
315 DIGEST=sha1
316 AC_ARG_ENABLE(digest,
317 [AC_HELP_STRING(--enable-digest, [
318 Select the digets algorithm to use (default "sha1"). Must be one of
319 "sha1", "ripemd160", "md5" or "md4" (insecure).])],
320 if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi
321 if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi
322 if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi
323 if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi
324 )
325 AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.])
326
327 if $CXX -v --help 2>&1 | grep -q fno-rtti; then
328 CXXFLAGS="$CXXFLAGS -fno-rtti"
329 fi
330
331 if $CXX -v --help 2>&1 | grep -q fexceptions; then
332 CXXFLAGS="$CXXFLAGS -fno-exceptions"
333 fi
334
335 dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then
336 dnl CXXFLAGS="$CXXFLAGS -ffunction-sections"
337 dnl fi
338 dnl
339 dnl if $LD -v --help 2>&1 | grep -q gc-sections; then
340 dnl LDFLAGS="$LDFLAGS -Wl,--gc-sections"
341 dnl fi
342
343 AC_CONFIG_COMMANDS_POST([
344
345 echo
346 echo "***"
347 echo "*** Configuration Summary"
348 echo "***"
349 echo "*** Kernel Iface: $IFTYPE/$IFSUBTYPE"
350 echo "*** Cipher used: $CIPHER"
351 echo "*** Digest used: $DIGEST"
352 echo "*** HMAC length: $HMAC"
353 echo "*** RAND used: $RAND"
354 echo "*** Max. MTU: $MTU"
355 echo "*** Compression: $COMPRESS"
356 echo "***"
357
358 if test "x$DIGEST" = xmd4; then
359 echo "*** WARNING"
360 echo "*** The digest you have chosen ($DIGEST) is known to be insecure"
361 echo "***"
362 fi
363
364 echo
365
366 ])
367
368 AC_SUBST(INCLUDES)
369
370 AC_OUTPUT(Makefile po/Makefile.in
371 src/Makefile
372 doc/Makefile
373 lib/Makefile
374 m4/Makefile
375 )