ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/configure.ac
Revision: 1.25
Committed: Sun Feb 8 07:24:25 2004 UTC (20 years, 3 months ago) by pcg
Branch: MAIN
Changes since 1.24: +6 -8 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.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 pcg 1.23 AM_INIT_AUTOMAKE(vpe, 1.5)
7 pcg 1.1 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 pcg 1.22
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 pcg 1.1
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 pcg 1.8 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 pcg 1.14 "native/linux"
72     "tincd/linux"
73 pcg 1.16 "tincd/freebsd"
74 pcg 1.17 "tincd/openbsd"
75 pcg 1.18 "tincd/darwin"
76 pcg 1.16 "native/cygwin";
77 pcg 1.8 Untested combinations are:
78 pcg 1.14 "tincd/netbsd"
79     "tincd/solaris"
80 pcg 1.17 "tincd/mingw";
81 pcg 1.8 Broken combinations are:
82 pcg 1.14 "tincd/cygwin";
83 pcg 1.9 The default is to autodetect.
84 pcg 1.8 ])],
85     [
86     IFTYPE=`echo $enableval | sed s%/.*%%`
87     IFSUBTYPE=`echo $enableval | sed s%.*/%%`
88     ]
89     )
90    
91 pcg 1.1 dnl Check and set OS
92 pcg 1.8 AC_MSG_CHECKING(for kernel networking interface type)
93 pcg 1.1
94 pcg 1.8 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 pcg 1.15 IFTYPE=native
128 pcg 1.8 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 pcg 1.19 AC_DEFINE_UNQUOTED(IFTYPE,"$IFTYPE",[kernel interface type])
140     AC_DEFINE_UNQUOTED(IFSUBTYPE,"$IFSUBTYPE",[kernel interface subtype])
141 pcg 1.1
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 pcg 1.22 sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h sys/cygwin.h \
152 pcg 1.21 sys/mman.h netinet/in.h])
153 pcg 1.22 AC_CHECK_HEADERS([arpa/inet.h net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h netinet/in_systm.h], [], [],
154 pcg 1.8 [
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 pcg 1.1
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 pcg 1.10
175 pcg 1.1 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 pcg 1.11 dnl argl, could somebody catapult darwin into the 21st century???
210 pcg 1.21 AC_CHECK_FUNCS(asprintf daemon get_current_dir_name putenv select strerror strsignal strtol unsetenv mlockall)
211 pcg 1.1
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 pcg 1.15
232 pcg 1.1 tinc_OPENSSL
233 pcg 1.15 if test "x$openssl_include" != x; then
234     CXXFLAGS="$CXXFLAGS -I$openssl_include"
235     fi
236 pcg 1.1 dnl tinc_ZLIB
237    
238 pcg 1.5 AC_ARG_ENABLE(rohc,
239     [AC_HELP_STRING(--enable-rohc, [enable robust header compression (rfc3095).])],
240     [
241     echo
242     echo "**********************************************************************"
243     echo "**********************************************************************"
244 pcg 1.25 echo "**** --enable-rohc is highly experimental, do not use ****************"
245 pcg 1.5 echo "**********************************************************************"
246     echo "**********************************************************************"
247     echo
248 pcg 1.25 rohc=true
249     AC_DEFINE_UNQUOTED(ENABLE_ROHC, 1, [ROHC support])
250 pcg 1.5 ]
251     )
252    
253 pcg 1.25 AM_CONDITIONAL(ROHC, test x$rohc = xtrue)
254    
255 pcg 1.4 AC_ARG_ENABLE(icmp,
256 pcg 1.9 [AC_HELP_STRING(--enable-icmp, [enable icmp protocol support (default disabled).])],
257 pcg 1.4 AC_DEFINE_UNQUOTED(ENABLE_ICMP, 1, [ICMP protocol support.])
258     )
259    
260 pcg 1.2 AC_ARG_ENABLE(tcp,
261 pcg 1.9 [AC_HELP_STRING(--enable-tcp, [enable tcp protocol support (default disabled).])],
262 pcg 1.2 AC_DEFINE_UNQUOTED(ENABLE_TCP, 1, [TCP protocol support.])
263     )
264    
265 pcg 1.3 AC_ARG_ENABLE(http-proxy,
266 pcg 1.9 [AC_HELP_STRING(--enable-http-proxy, [enable http proxy connect support (default disabled).])],
267 pcg 1.3 AC_DEFINE_UNQUOTED(ENABLE_HTTP_PROXY, 1, [http proxy connect support.])
268     )
269    
270 pcg 1.18 HMAC=8 dnl see also the AC_HELP_STRING
271 pcg 1.1 AC_ARG_ENABLE(hmac-length,
272 pcg 1.9 [AC_HELP_STRING(--enable-hmac-length=BYTES, [use a hmac of length BYTES bytes (default 12). Allowed values are 4, 8, 12, 16.])],
273 pcg 1.1 HMAC=$enableval
274     )
275     AC_DEFINE_UNQUOTED(HMACLENGTH, $HMAC, [Size of HMAC in each packet in bytes.])
276    
277     RAND=8 dnl see also the AC_HELP_STRING
278     AC_ARG_ENABLE(rand-length,
279     [AC_HELP_STRING(--enable-rand-length=BYTES, [use BYTES bytes of extra randomness (default 8). Allowed values are 0, 4, 8.])],
280     RAND=$enableval
281     )
282     AC_DEFINE_UNQUOTED(RAND_SIZE, $RAND, [Add this many bytes of randomness to each packet.])
283    
284     MTU=1500 dnl see also the AC_HELP_STRING
285     AC_ARG_ENABLE(mtu,
286     [AC_HELP_STRING(--enable-max-mtu=BYTES, enable mtu sizes upto BYTES bytes (default 1500). Use 9100 for jumbogram support.)],
287     MTU=$enableval
288     )
289     AC_DEFINE_UNQUOTED(MAX_MTU, $MTU + 14, [Maximum MTU supported.])
290    
291     COMPRESS=1
292     AC_ARG_ENABLE(compression,
293     [AC_HELP_STRING(--disable-compression, Disable compression support.)],
294     if test "x$enableval" = xno; then
295     COMPRESS=0
296     fi
297     )
298     AC_DEFINE_UNQUOTED(ENABLE_COMPRESSION, $COMPRESS, [Enable compression support.])
299    
300     CIPHER=bf_cbc
301     AC_ARG_ENABLE(cipher,
302     [AC_HELP_STRING(--enable-cipher, [
303     Select the symmetric cipher (default "bf"). Must be one of
304 pcg 1.9 "bf" (blowfish), "aes-128" (rijndael), "aes-192" or "aes-256".])],
305 pcg 1.1 if test "x$enableval" = xbf ; then CIPHER=bf_cbc ; fi
306     if test "x$enableval" = xaes-128; then CIPHER=aes_128_cbc; fi
307     if test "x$enableval" = xaes-192; then CIPHER=aes_192_cbc; fi
308     if test "x$enableval" = xaes-256; then CIPHER=aes_256_cbc; fi
309     )
310     AC_DEFINE_UNQUOTED(ENABLE_CIPHER, EVP_${CIPHER}, [Select the symmetric cipher to use.])
311    
312     DIGEST=sha1
313     AC_ARG_ENABLE(digest,
314     [AC_HELP_STRING(--enable-digest, [
315     Select the digets algorithm to use (default "sha1"). Must be one of
316 pcg 1.9 "sha1", "ripemd160", "md5" or "md4" (insecure).])],
317 pcg 1.1 if test "x$enableval" = xsha1 ; then DIGEST=sha1 ; fi
318     if test "x$enableval" = xripemd160; then DIGEST=ripemd160; fi
319 pcg 1.9 if test "x$enableval" = xmd5 ; then DIGEST=md5 ; fi
320 pcg 1.1 if test "x$enableval" = xmd4 ; then DIGEST=md4 ; fi
321     )
322     AC_DEFINE_UNQUOTED(ENABLE_DIGEST, EVP_${DIGEST}, [Select the digest algorithm to use.])
323    
324     if $CXX -v --help 2>&1 | grep -q fno-rtti; then
325     CXXFLAGS="$CXXFLAGS -fno-rtti"
326     fi
327    
328     if $CXX -v --help 2>&1 | grep -q fexceptions; then
329     CXXFLAGS="$CXXFLAGS -fno-exceptions"
330     fi
331    
332 pcg 1.20 dnl if $CXX -v --help 2>&1 | grep -q ffunction-sections; then
333     dnl CXXFLAGS="$CXXFLAGS -ffunction-sections"
334     dnl fi
335     dnl
336     dnl if $LD -v --help 2>&1 | grep -q gc-sections; then
337     dnl LDFLAGS="$LDFLAGS -Wl,--gc-sections"
338     dnl fi
339 pcg 1.1
340     AC_CONFIG_COMMANDS_POST([
341    
342     echo
343     echo "***"
344     echo "*** Configuration Summary"
345     echo "***"
346 pcg 1.8 echo "*** Kernel Iface: $IFTYPE/$IFSUBTYPE"
347 pcg 1.1 echo "*** Cipher used: $CIPHER"
348     echo "*** Digest used: $DIGEST"
349     echo "*** HMAC length: $HMAC"
350     echo "*** RAND used: $RAND"
351     echo "*** Max. MTU: $MTU"
352     echo "*** Compression: $COMPRESS"
353 pcg 1.24
354     if test "x$DIGEST" = xmd4; then
355 pcg 1.1 echo "***"
356 pcg 1.24 echo "*** WARNING: The digest you have chosen ($DIGEST) is known to be insecure"
357     fi
358 pcg 1.8
359 pcg 1.24 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 pcg 1.8 echo "***"
366 pcg 1.24 echo "*** WARNING: The random prefix you have chosen ($RAND) might be insecure"
367 pcg 1.8 fi
368 pcg 1.24
369     echo "***"
370 pcg 1.8
371 pcg 1.1 echo
372    
373     ])
374    
375     AC_SUBST(INCLUDES)
376    
377     AC_OUTPUT(Makefile po/Makefile.in
378     src/Makefile
379 pcg 1.25 src/rohc/Makefile
380 pcg 1.1 doc/Makefile
381     lib/Makefile
382     m4/Makefile
383     )