]> The Tcpdump Group git mirrors - tcpdump/blob - configure.in
s/u_short/u_int16_t/ for KAME-origin source codes
[tcpdump] / configure.in
1 dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.114 2000-04-27 10:50:28 itojun Exp $ (LBL)
2 dnl
3 dnl Copyright (c) 1994, 1995, 1996, 1997
4 dnl The Regents of the University of California. All rights reserved.
5 dnl
6 dnl Process this file with autoconf to produce a configure script.
7 dnl
8
9 AC_REVISION($Revision: 1.114 $)
10 AC_PREREQ(2.13)
11 AC_INIT(tcpdump.c)
12
13 AC_CANONICAL_SYSTEM
14
15 umask 002
16
17 if test -z "$PWD" ; then
18 PWD=`pwd`
19 fi
20
21 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
22 AC_C_INLINE
23 AC_C___ATTRIBUTE__
24
25 AC_CHECK_HEADERS(fcntl.h malloc.h memory.h rpc/rpcent.h)
26 AC_HEADER_TIME
27
28 case "$target_os" in
29
30 linux*)
31 AC_MSG_CHECKING(Linux kernel version)
32 AC_CACHE_VAL(ac_cv_linux_vers,
33 ac_cv_linux_vers=`uname -r 2>&1 | \
34 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
35 AC_MSG_RESULT($ac_cv_linux_vers)
36 if test $ac_cv_linux_vers -lt 2 ; then
37 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
38 fi
39 AC_DEFINE(HAVE_NET_SLIP_H)
40 ;;
41
42 *)
43 AC_CHECK_HEADERS(net/slip.h)
44 ;;
45 esac
46
47
48 AC_CHECK_HEADERS(smi.h)
49 AC_CHECK_LIB(smi, main)
50 AC_MSG_CHECKING([whether to enable libsmi])
51 AC_TRY_RUN([ /* libsmi available check */
52 #include <smi.h>
53 main()
54 {
55 if (smiInit(""))
56 exit(1);
57 else
58 exit(0);
59 }
60 ],
61 [ AC_MSG_RESULT(yes)
62 AC_DEFINE(LIBSMI)
63 libsmi=yes],
64 [ AC_MSG_RESULT(no)
65 libsmi=no],
66 [ AC_MSG_RESULT(not when cross-compiling)
67 libsmi=no]
68 )
69
70
71 CFLAGS="$CFLAGS -Dss_family=__ss_family -Dss_len=__ss_len"
72 AC_MSG_CHECKING([whether to enable ipv6])
73 AC_ARG_ENABLE(ipv6,
74 [ --enable-ipv6 enable ipv6 (with ipv4) support
75 --disable-ipv6 disable ipv6 support],
76 [ case "$enableval" in
77 yes) AC_MSG_RESULT(yes)
78 AC_DEFINE(ENABLE_IPV6)
79 LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
80 AC_DEFINE(INET6)
81 ipv6=yes
82 ;;
83 *)
84 AC_MSG_RESULT(no)
85 ipv6=no
86 ;;
87 esac ],
88
89 AC_TRY_RUN([ /* AF_INET6 available check */
90 #include <sys/types.h>
91 #include <sys/socket.h>
92 main()
93 {
94 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
95 exit(1);
96 else
97 exit(0);
98 }
99 ],
100 [ AC_MSG_RESULT(yes)
101 AC_DEFINE(ENABLE_IPV6)
102 LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
103 AC_DEFINE(INET6)
104 ipv6=yes],
105 [ AC_MSG_RESULT(no)
106 ipv6=no],
107 [ AC_MSG_RESULT(no)
108 ipv6=no]
109 ))
110
111 ipv6type=unknown
112 ipv6lib=none
113 ipv6trylibc=no
114
115 if test "$ipv6" = "yes"; then
116 AC_MSG_CHECKING([ipv6 stack type])
117 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
118 case $i in
119 inria)
120 dnl http://www.kame.net/
121 AC_EGREP_CPP(yes, [dnl
122 #include <netinet/in.h>
123 #ifdef IPV6_INRIA_VERSION
124 yes
125 #endif],
126 [ipv6type=$i;
127 CFLAGS="-DINET6 $CFLAGS"])
128 ;;
129 kame)
130 dnl http://www.kame.net/
131 AC_EGREP_CPP(yes, [dnl
132 #include <netinet/in.h>
133 #ifdef __KAME__
134 yes
135 #endif],
136 [ipv6type=$i;
137 ipv6lib=inet6;
138 ipv6libdir=/usr/local/v6/lib;
139 ipv6trylibc=yes;
140 CFLAGS="-DINET6 $CFLAGS"])
141 ;;
142 linux-glibc)
143 dnl http://www.v6.linux.or.jp/
144 AC_EGREP_CPP(yes, [dnl
145 #include <features.h>
146 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
147 yes
148 #endif],
149 [ipv6type=$i;
150 CFLAGS="-DINET6 $CFLAGS"])
151 ;;
152 linux-libinet6)
153 dnl http://www.v6.linux.or.jp/
154 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
155 ipv6type=$i
156 ipv6lib=inet6
157 ipv6libdir=/usr/inet6/lib
158 ipv6trylibc=yes;
159 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
160 fi
161 ;;
162 toshiba)
163 AC_EGREP_CPP(yes, [dnl
164 #include <sys/param.h>
165 #ifdef _TOSHIBA_INET6
166 yes
167 #endif],
168 [ipv6type=$i;
169 ipv6lib=inet6;
170 ipv6libdir=/usr/local/v6/lib;
171 CFLAGS="-DINET6 $CFLAGS"])
172 ;;
173 v6d)
174 AC_EGREP_CPP(yes, [dnl
175 #include </usr/local/v6/include/sys/v6config.h>
176 #ifdef __V6D__
177 yes
178 #endif],
179 [ipv6type=$i;
180 ipv6lib=v6;
181 ipv6libdir=/usr/local/v6/lib;
182 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
183 ;;
184 zeta)
185 AC_EGREP_CPP(yes, [dnl
186 #include <sys/param.h>
187 #ifdef _ZETA_MINAMI_INET6
188 yes
189 #endif],
190 [ipv6type=$i;
191 ipv6lib=inet6;
192 ipv6libdir=/usr/local/v6/lib;
193 CFLAGS="-DINET6 $CFLAGS"])
194 ;;
195 esac
196 if test "$ipv6type" != "unknown"; then
197 break
198 fi
199 done
200 AC_MSG_RESULT($ipv6type)
201 fi
202
203 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
204 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
205 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
206 echo "You have $ipv6lib library, using it"
207 else
208 if test "$ipv6trylibc" = "yes"; then
209 echo "You do not have $ipv6lib library, using libc"
210 else
211 echo 'Fatal: no $ipv6lib library found. cannot continue.'
212 echo "You need to fetch lib$ipv6lib.a from appropriate"
213 echo 'ipv6 kit and compile beforehand.'
214 exit 1
215 fi
216 fi
217 fi
218
219
220 if test "$ipv6" = "yes"; then
221 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
222 AC_MSG_CHECKING(getaddrinfo bug)
223 AC_TRY_RUN([
224 #include <sys/types.h>
225 #include <netdb.h>
226 #include <string.h>
227 #include <sys/socket.h>
228 #include <netinet/in.h>
229
230 main()
231 {
232 int passive, gaierr, inet4 = 0, inet6 = 0;
233 struct addrinfo hints, *ai, *aitop;
234 char straddr[INET6_ADDRSTRLEN], strport[16];
235
236 for (passive = 0; passive <= 1; passive++) {
237 memset(&hints, 0, sizeof(hints));
238 hints.ai_family = AF_UNSPEC;
239 hints.ai_flags = passive ? AI_PASSIVE : 0;
240 hints.ai_socktype = SOCK_STREAM;
241 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
242 (void)gai_strerror(gaierr);
243 goto bad;
244 }
245 for (ai = aitop; ai; ai = ai->ai_next) {
246 if (ai->ai_addr == NULL ||
247 ai->ai_addrlen == 0 ||
248 getnameinfo(ai->ai_addr, ai->ai_addrlen,
249 straddr, sizeof(straddr), strport, sizeof(strport),
250 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
251 goto bad;
252 }
253 switch (ai->ai_family) {
254 case AF_INET:
255 if (strcmp(strport, "54321") != 0) {
256 goto bad;
257 }
258 if (passive) {
259 if (strcmp(straddr, "0.0.0.0") != 0) {
260 goto bad;
261 }
262 } else {
263 if (strcmp(straddr, "127.0.0.1") != 0) {
264 goto bad;
265 }
266 }
267 inet4++;
268 break;
269 case AF_INET6:
270 if (strcmp(strport, "54321") != 0) {
271 goto bad;
272 }
273 if (passive) {
274 if (strcmp(straddr, "::") != 0) {
275 goto bad;
276 }
277 } else {
278 if (strcmp(straddr, "::1") != 0) {
279 goto bad;
280 }
281 }
282 inet6++;
283 break;
284 case AF_UNSPEC:
285 goto bad;
286 break;
287 #ifdef AF_UNIX
288 case AF_UNIX:
289 #else
290 #ifdef AF_LOCAL
291 case AF_LOCAL:
292 #endif
293 #endif
294 default:
295 /* another family support? */
296 break;
297 }
298 }
299 }
300
301 /* supported family should be 2, unsupported family should be 0 */
302 if (!(inet4 == 0 || inet4 == 2))
303 goto bad;
304 if (!(inet6 == 0 || inet6 == 2))
305 goto bad;
306
307 if (aitop)
308 freeaddrinfo(aitop);
309 exit(0);
310
311 bad:
312 if (aitop)
313 freeaddrinfo(aitop);
314 exit(1);
315 }
316 ],
317 AC_MSG_RESULT(good)
318 buggygetaddrinfo=no,
319 AC_MSG_RESULT(buggy)
320 buggygetaddrinfo=yes,
321 AC_MSG_RESULT(buggy)
322 buggygetaddrinfo=yes)], [buggygetaddrinfo=yes])
323
324 if test "$buggygetaddrinfo" = "yes"; then
325 if test "$ipv6type" != "linux"; then
326 echo 'Fatal: You must get working getaddrinfo() function.'
327 echo ' or you can specify "--disable-ipv6"'.
328 exit 1
329 else
330 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
331 echo ' Better upgreade your system library to newest version'
332 echo ' of GNU C library (aka glibc).'
333 fi
334 fi
335 AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
336 fi
337 AC_REPLACE_FUNCS(inet_ntop inet_pton inet_aton)
338
339 dnl check for struct icmp6_mld and struct mld6_hdr
340
341 AC_CACHE_CHECK([for struct icmp6_mld],
342 ac_cv_struct_icmp6_mld,
343 [AC_EGREP_CPP([icmp6_mld],[dnl
344 #include <sys/types.h>
345 #include <netinet/icmp6.h>
346 ],
347 ac_cv_struct_icmp6_mld=yes,
348 ac_cv_struct_icmp6_mld=no)])
349 if test "$ac_cv_struct_icmp6_mld" = "yes"; then
350 AC_DEFINE(HAVE_STRUCT_ICMP6_MLD, 1, [define if you have struct icmp6_mld])
351 fi
352
353
354 AC_CACHE_CHECK([for struct mld6_hdr],
355 ac_cv_struct_mld6_hdr,
356 [AC_EGREP_CPP([mld6_hdr],[dnl
357 #include <sys/types.h>
358 #include <netinet/icmp6.h>
359 ],
360 ac_cv_struct_mld6_hdr=yes,
361 ac_cv_struct_mld6_hdr=no)])
362 if test "$ac_cv_struct_mld6_hdr" = "yes"; then
363 AC_DEFINE(HAVE_STRUCT_MLD6_HDR, 1, [define if you have struct mld6hdr])
364 fi
365
366
367 dnl portability macros for getaddrinfo/getnameinfo
368 dnl
369 dnl Check for sa_len
370 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
371 if test "$ac_cv_sockaddr_has_sa_len" = no; then
372 missing_includes=yes
373 fi
374
375 dnl
376 dnl check __P macro
377 AC_CHECK_PORTABLE_PROTO(ac_cv_portable_proto)
378 if test "$ac_cv_portable_proto" = no; then
379 missing_includes=yes
380 fi
381
382 dnl
383 dnl check sizeof basic types.
384 dnl They're very likely to be wrong for cross-compiling.
385 AC_CHECK_SIZEOF(char, 1)
386 AC_CHECK_SIZEOF(short, 2)
387 AC_CHECK_SIZEOF(int, 4)
388 AC_CHECK_SIZEOF(long, 4)
389
390 dnl
391 dnl Checks for u_intXX_t
392 dnl AC_CHECK_BITTYPES(ac_cv_bittypes)
393 dnl if test "$ac_cv_bittypes" = no; then
394 dnl missing_includes=yes
395 dnl fi
396
397 dnl
398 dnl Checks for addrinfo structure
399 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
400 if test "$ac_cv_addrinfo" = no; then
401 missing_includes=yes
402 fi
403
404 dnl
405 dnl Checks for NI_MAXSERV
406 AC_NI_MAXSERV(ac_cv_maxserv)
407 if test "$ac_cv_maxserv" = no; then
408 missing_includes=yes
409 fi
410
411 dnl
412 dnl Checks for NI_NAMEREQD
413 AC_NI_NAMEREQD(ac_cv_namereqd)
414 if test "$ac_cv_namereqd" = no; then
415 missing_includes=yes
416 fi
417
418 dnl
419 dnl Checks for sockaddr_storage structure
420 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
421 if test "$ac_cv_sa_storage" = no; then
422 missing_includes=yes
423 fi
424
425 dnl
426 dnl Checks for IN[6]ADDRSZ
427 AC_CHECK_ADDRSZ(ac_cv_addrsz)
428 if test "$ac_cv_addrsz" = no; then
429 missing_includes=yes
430 fi
431
432 dnl
433 dnl Checks for RES_USE_INET6
434 AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
435 if test "$ac_cv_res_inet6" = no; then
436 missing_includes=yes
437 fi
438
439 dnl
440 dnl Checks for res_state_ext structure
441 AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
442 if test "$ac_cv_res_state_ext" = no; then
443 missing_includes=yes
444 fi
445
446 dnl
447 dnl Checks if res_state structure has nsort member.
448 AC_STRUCT_RES_STATE(ac_cv_res_state)
449
450 dnl
451 dnl set additional include path if necessary
452 if test "$missing_includes" = "yes"; then
453 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
454 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
455 fi
456
457
458 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy)
459 AC_CHECK_FUNCS(ether_ntohost setlinebuf gethostbyname2)
460
461 usegetipnodeby=yes
462 AC_CHECK_FUNCS(getipnodebyname getipnodebyaddr freeaddrinfo,
463 [], [usegetipnodeby=no])
464 if test $usegetipnodeby = yes; then
465 AC_DEFINE(USE_GETIPNODEBY)
466 fi
467
468 needsnprintf=no
469 AC_CHECK_FUNCS(vsnprintf snprintf asprintf asnprintf vasprintf vasnprintf,,
470 [needsnprintf=yes])
471 if test $needsnprintf = yes; then
472 LIBOBJS="$LIBOBJS snprintf.o"
473 fi
474
475 dnl The following generates a warning from autoconf...
476 errprint(__file__:__line__: please ignore the next warning:
477 )dnl
478 AC_C_BIGENDIAN
479
480 AC_CHECK_LIB(dnet, main)
481 AC_CHECK_LIB(rpc, main)
482 AC_CHECK_LIB(nsl, getrpcbynumber)
483 dnl AC_CHECK_LIB(z, uncompress)
484 dnl AC_CHECK_HEADERS(zlib.h)
485
486 AC_LBL_TYPE_SIGNAL
487
488 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
489
490 V_GROUP=0
491 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
492 V_GROUP=wheel
493 fi
494 case "$target_os" in
495
496 aix*)
497 dnl Workaround to enable certain features
498 AC_DEFINE(_SUN)
499 ;;
500
501 irix*)
502 V_GROUP=sys
503 ;;
504
505 linux*)
506 V_INCLS="$V_INCLS -I\$(srcdir)/linux-include"
507 ;;
508
509 osf*)
510 V_GROUP=system
511 dnl Workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
512 AC_DEFINE(__STDC__,2)
513 ;;
514
515 solaris*)
516 V_GROUP=sys
517 ;;
518 esac
519
520 if test -f /dev/bpf0 ; then
521 V_GROUP=bpf
522 fi
523
524 AC_LBL_CHECK_TYPE(u_int8_t, u_char)
525 AC_LBL_CHECK_TYPE(int16_t, short)
526 AC_LBL_CHECK_TYPE(u_int16_t, u_short)
527 AC_LBL_CHECK_TYPE(int32_t, int)
528 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
529
530 AC_LBL_DEVEL(V_CCOPT)
531
532 AC_LBL_SOCKADDR_SA_LEN
533
534 AC_MSG_CHECKING(if ether_header uses ether_addr structs)
535 AC_CACHE_VAL(ac_cv_ether_header_has_ea,
536 LBL_SAVE_CFLAGS="$CFLAGS"
537 CFLAGS="$CFLAGS $V_INCLS"
538 AC_TRY_COMPILE([
539 # include <sys/types.h>
540 # if __STDC__
541 /* osf3 has REALLY good prototyes */
542 struct mbuf;
543 struct rtentry;
544 # endif
545 # include <sys/socket.h>
546 # include <net/if.h>
547 # include <netinet/in.h>
548 # include <netinet/if_ether.h>],
549 [u_int i =
550 sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)],
551 ac_cv_ether_header_has_ea=yes,
552 ac_cv_ether_header_has_ea=no)
553 CFLAGS="$LBL_SAVE_CFLAGS")
554 AC_MSG_RESULT($ac_cv_ether_header_has_ea)
555 if test $ac_cv_ether_header_has_ea = yes ; then
556 AC_DEFINE(ETHER_HEADER_HAS_EA)
557 fi
558
559 AC_MSG_CHECKING(if ether_arp uses ether_addr structs)
560 AC_CACHE_VAL(ac_cv_ether_arp_has_ea,
561 LBL_SAVE_CFLAGS="$CFLAGS"
562 CFLAGS="$CFLAGS $V_INCLS"
563 AC_TRY_COMPILE([
564 # include <sys/types.h>
565 # if __STDC__
566 /* osf3 has REALLY good prototyes */
567 struct mbuf;
568 struct rtentry;
569 # endif
570 # include <sys/socket.h>
571 # include <net/if.h>
572 # include <netinet/in.h>
573 # include <netinet/if_ether.h>],
574 [u_int i =
575 sizeof(((struct ether_arp *)0)->arp_sha.ether_addr_octet)],
576 ac_cv_ether_arp_has_ea=yes,
577 ac_cv_ether_arp_has_ea=no)
578 CFLAGS="$LBL_SAVE_CFLAGS")
579 AC_MSG_RESULT($ac_cv_ether_arp_has_ea)
580 if test $ac_cv_ether_arp_has_ea = yes ; then
581 AC_DEFINE(ETHER_ARP_HAS_EA)
582 fi
583
584 AC_MSG_CHECKING(if ether_arp uses erp_xsha member)
585 AC_CACHE_VAL(ac_cv_struct_ether_arp_x,
586 LBL_SAVE_CFLAGS="$CFLAGS"
587 CFLAGS="$CFLAGS $V_INCLS"
588 AC_TRY_COMPILE([
589 # include <sys/types.h>
590 # include <sys/socket.h>
591 # if __STDC__
592 /* osf3 has REALLY good prototyes */
593 struct mbuf;
594 struct rtentry;
595 # endif
596 # include <net/if.h>
597 # include <netinet/in.h>
598 # include <netinet/if_ether.h>],
599 [u_int i = sizeof( ((struct ether_arp *)0)->arp_xsha)],
600 ac_cv_struct_ether_arp_x=yes,
601 ac_cv_struct_ether_arp_x=no)
602 CFLAGS="$LBL_SAVE_CFLAGS")
603 AC_MSG_RESULT($ac_cv_struct_ether_arp_x)
604 if test $ac_cv_struct_ether_arp_x = yes ; then
605 AC_DEFINE(ETHER_ARP_HAS_X)
606 fi
607
608 AC_LBL_UNALIGNED_ACCESS
609
610 AC_VAR_H_ERRNO
611
612 AC_ARG_WITH(crypto, [ --without-crypto disable crypto support],
613 [], [
614 AC_MSG_CHECKING(for SSLeay)
615 ac_cv_ssleay_path=no
616 incdir=no
617 for dir in /usr /usr/local /usr/local/ssl /usr/pkg; do
618 if test -d $dir/lib -a -f $dir/lib/libcrypto.a; then
619 ac_cv_ssleay_path=$dir
620 fi
621 if test -d $dir/include/ssleay -a -f $dir/include/ssleay/des.h; then
622 incdir="-I$dir/include/ssleay"
623 elif test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
624 incdir="-I$dir/include -I$dir/include/openssl"
625 elif test -d $dir/include -a -f $dir/include/des.h; then
626 incdir="-I$dir/include"
627 fi
628 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
629 break;
630 else
631 ac_cv_ssleay_path=no
632 incdir=no
633 fi
634 done
635 AC_MSG_RESULT($ac_cv_ssleay_path)
636 if test "$ac_cv_ssleay_path" != no; then
637 V_INCLS="$V_INCLS $incdir"
638 LIBS="$LIBS -L$dir/lib"
639 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
640 LIBS="$LIBS -lRSAglue"
641 fi
642 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
643 LIBS="$LIBS -lrsaref"
644 fi
645 AC_CHECK_LIB(crypto, des_cbc_encrypt)
646
647 bak_CPPFLAGS=$CPPFLAGS
648 CPPFLAGS="$CPPFLAGS $V_INCLS"
649 AC_CHECK_HEADERS(cast.h rc5.h)
650
651 if test "$ac_cv_header_cast_h" = "yes"; then
652 AC_MSG_CHECKING(for buggy CAST128)
653 AC_TRY_RUN(dnl
654 [
655 #include <cast.h>
656 main()
657 {
658 unsigned char key[] = {0x01,0x23,0x45,0x67,0x12};
659 unsigned char in[] = {0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF};
660 unsigned char out[sizeof(in)];
661 unsigned char ok[] = {0x7A,0xC8,0x16,0xD1,0x6E,0x9B,0x30,0x2E};
662 CAST_KEY ks;
663 CAST_set_key(&ks, sizeof(key), key);
664 CAST_ecb_encrypt(in, out, &ks, CAST_ENCRYPT);
665 if (memcmp(out, ok, sizeof(ok)) != 0)
666 return 0;
667 else
668 return 1;
669 }],
670 [buggy_cast128=yes],
671 [buggy_cast128=no],
672 [buggy_cast128="cross-compiling, assume yes"])
673 AC_MSG_RESULT($buggy_cast128)
674 if test "$buggy_cast128" != no; then
675 echo "NOTE: SSLeay 0.9.0b has a bug in CAST128 en/decoding routine."
676 echo "disabling CAST128 support."
677 AC_DEFINE(HAVE_BUGGY_CAST128)
678 fi
679 fi
680
681 CPPFLAGS=$bak_CPPFLAGS
682 fi
683 ])
684
685 if test -r ${srcdir}/lbl/gnuc.h ; then
686 rm -f gnuc.h
687 ln -s ${srcdir}/lbl/gnuc.h gnuc.h
688 fi
689
690 AC_SUBST(V_CCOPT)
691 AC_SUBST(V_GROUP)
692 AC_SUBST(V_INCLS)
693 AC_SUBST(V_PCAPDEP)
694 AC_SUBST(LOCALSRC)
695
696 AC_PROG_INSTALL
697
698 AC_CONFIG_HEADER(config.h)
699
700 AC_OUTPUT_COMMANDS([if test -f .devel; then
701 echo timestamp > stamp-h
702 cat Makefile-devel-adds >> Makefile
703 make depend
704 fi])
705 AC_OUTPUT(Makefile)
706 exit 0