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