]> The Tcpdump Group git mirrors - tcpdump/blob - configure.in
add support for GMPLS related objects as per rfc3473
[tcpdump] / configure.in
1 dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.163 2003-05-02 08:48:25 guy 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.163 $)
10 AC_PREREQ(2.13)
11 AC_INIT(tcpdump.c)
12
13 AC_CANONICAL_HOST
14
15 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
16 AC_LBL_C_INLINE
17 AC_C___ATTRIBUTE__
18
19 AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netinet/if_ether.h netdnet/dnetdb.h netinet/ether.h)
20 AC_HEADER_TIME
21
22 case "$host_os" in
23
24 linux*)
25 AC_MSG_CHECKING(Linux kernel version)
26 if test "$cross_compiling" = yes; then
27 AC_CACHE_VAL(ac_cv_linux_vers,
28 ac_cv_linux_vers=unknown)
29 else
30 AC_CACHE_VAL(ac_cv_linux_vers,
31 ac_cv_linux_vers=`uname -r 2>&1 | \
32 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
33 fi
34 AC_MSG_RESULT($ac_cv_linux_vers)
35 if test $ac_cv_linux_vers = unknown ; then
36 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
37 fi
38 if test $ac_cv_linux_vers -lt 2 ; then
39 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
40 fi
41 ;;
42
43 *)
44 ;;
45 esac
46
47
48 AC_CHECK_HEADERS(smi.h)
49 AC_CHECK_LIB(smi, smiInit)
50 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
51 then
52 AC_MSG_CHECKING([whether to enable libsmi])
53 AC_TRY_RUN([ /* libsmi available check */
54 #include <smi.h>
55 main()
56 {
57 int current, revision, age, n;
58 const int required = 2;
59 if (smiInit(""))
60 exit(1);
61 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
62 exit(2);
63 n = sscanf(smi_library_version, "%d:%d:%d", &current, &revision, &age);
64 if (n != 3)
65 exit(3);
66 if (required < current - age || required > current)
67 exit(4);
68 exit(0);
69 }
70 ],
71 [ AC_MSG_RESULT(yes)
72 AC_DEFINE(LIBSMI)
73 libsmi=yes],
74 dnl autoconf documentation says that $? contains the exit value.
75 dnl reality is that it does not. We leave this in just in case
76 dnl autoconf ever comes back to match the documentation.
77 [ case $? in
78 1) AC_MSG_RESULT(no - smiInit failed) ;;
79 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
80 3) AC_MSG_RESULT(no - can't determine library version) ;;
81 4) AC_MSG_RESULT(no - too old) ;;
82 *) AC_MSG_RESULT(no) ;;
83 esac
84 libsmi=no],
85 [ AC_MSG_RESULT(not when cross-compiling)
86 libsmi=no]
87 )
88 fi
89
90 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
91 AC_ARG_ENABLE(smb,
92 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
93 --disable-smb disable possibly-buggy SMB printer],,
94 enableval=yes)
95 case "$enableval" in
96 yes) AC_MSG_RESULT(yes)
97 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
98 AC_DEFINE(TCPDUMP_DO_SMB)
99 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
100 ;;
101 *) AC_MSG_RESULT(no)
102 ;;
103 esac
104
105 AC_MSG_CHECKING([whether to enable ipv6])
106 AC_ARG_ENABLE(ipv6,
107 [ --enable-ipv6 enable ipv6 (with ipv4) support
108 --disable-ipv6 disable ipv6 support],
109 [ case "$enableval" in
110 yes) AC_MSG_RESULT(yes)
111 LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
112 AC_DEFINE(INET6)
113 ipv6=yes
114 ;;
115 *)
116 AC_MSG_RESULT(no)
117 ipv6=no
118 ;;
119 esac ],
120
121 AC_TRY_RUN([ /* AF_INET6 available check */
122 #include <sys/types.h>
123 #include <sys/socket.h>
124 main()
125 {
126 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
127 exit(1);
128 else
129 exit(0);
130 }
131 ],
132 [ AC_MSG_RESULT(yes)
133 LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
134 AC_DEFINE(INET6)
135 ipv6=yes],
136 [ AC_MSG_RESULT(no)
137 ipv6=no],
138 [ AC_MSG_RESULT(no)
139 ipv6=no]
140 ))
141
142 ipv6type=unknown
143 ipv6lib=none
144 ipv6trylibc=no
145
146 if test "$ipv6" = "yes"; then
147 AC_MSG_CHECKING([ipv6 stack type])
148 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
149 case $i in
150 inria)
151 dnl http://www.kame.net/
152 AC_EGREP_CPP(yes, [dnl
153 #include <netinet/in.h>
154 #ifdef IPV6_INRIA_VERSION
155 yes
156 #endif],
157 [ipv6type=$i;
158 CFLAGS="-DINET6 $CFLAGS"])
159 ;;
160 kame)
161 dnl http://www.kame.net/
162 AC_EGREP_CPP(yes, [dnl
163 #include <netinet/in.h>
164 #ifdef __KAME__
165 yes
166 #endif],
167 [ipv6type=$i;
168 ipv6lib=inet6;
169 ipv6libdir=/usr/local/v6/lib;
170 ipv6trylibc=yes;
171 CFLAGS="-DINET6 $CFLAGS"])
172 ;;
173 linux-glibc)
174 dnl http://www.v6.linux.or.jp/
175 AC_EGREP_CPP(yes, [dnl
176 #include <features.h>
177 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
178 yes
179 #endif],
180 [ipv6type=$i;
181 CFLAGS="-DINET6 $CFLAGS"])
182 ;;
183 linux-libinet6)
184 dnl http://www.v6.linux.or.jp/
185 dnl
186 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
187 dnl and possibly other versions of those OSes
188 dnl
189 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
190 ipv6type=$i
191 ipv6lib=inet6
192 ipv6libdir=/usr/inet6/lib
193 ipv6trylibc=yes;
194 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
195 fi
196 ;;
197 toshiba)
198 AC_EGREP_CPP(yes, [dnl
199 #include <sys/param.h>
200 #ifdef _TOSHIBA_INET6
201 yes
202 #endif],
203 [ipv6type=$i;
204 ipv6lib=inet6;
205 ipv6libdir=/usr/local/v6/lib;
206 CFLAGS="-DINET6 $CFLAGS"])
207 ;;
208 v6d)
209 AC_EGREP_CPP(yes, [dnl
210 #include </usr/local/v6/include/sys/v6config.h>
211 #ifdef __V6D__
212 yes
213 #endif],
214 [ipv6type=$i;
215 ipv6lib=v6;
216 ipv6libdir=/usr/local/v6/lib;
217 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
218 ;;
219 zeta)
220 AC_EGREP_CPP(yes, [dnl
221 #include <sys/param.h>
222 #ifdef _ZETA_MINAMI_INET6
223 yes
224 #endif],
225 [ipv6type=$i;
226 ipv6lib=inet6;
227 ipv6libdir=/usr/local/v6/lib;
228 CFLAGS="-DINET6 $CFLAGS"])
229 ;;
230 esac
231 if test "$ipv6type" != "unknown"; then
232 break
233 fi
234 done
235 AC_MSG_RESULT($ipv6type)
236 fi
237
238 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
239 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
240 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
241 echo "You have $ipv6lib library, using it"
242 else
243 if test "$ipv6trylibc" = "yes"; then
244 echo "You do not have $ipv6lib library, using libc"
245 else
246 echo 'Fatal: no $ipv6lib library found. cannot continue.'
247 echo "You need to fetch lib$ipv6lib.a from appropriate"
248 echo 'ipv6 kit and compile beforehand.'
249 exit 1
250 fi
251 fi
252 fi
253
254
255 if test "$ipv6" = "yes"; then
256 #
257 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
258 # function in libc; there are "ngetaddrinfo()" and
259 # "ogetaddrinfo()" functions, and <netdb.h> #defines
260 # "getaddrinfo" to be either "ngetaddrinfo" or
261 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
262 # or _XOPEN_SOURCE_EXTENDED are defined or not.
263 #
264 # So this test doesn't work on Tru64 5.1, and possibly
265 # on other 5.x releases. This causes the configure
266 # script to become confused, and results in libpcap
267 # being unbuildable.
268 #
269 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
270 AC_MSG_CHECKING(getaddrinfo bug)
271 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
272 #include <sys/types.h>
273 #include <netdb.h>
274 #include <string.h>
275 #include <sys/socket.h>
276 #include <netinet/in.h>
277
278 main()
279 {
280 int passive, gaierr, inet4 = 0, inet6 = 0;
281 struct addrinfo hints, *ai, *aitop;
282 char straddr[INET6_ADDRSTRLEN], strport[16];
283
284 for (passive = 0; passive <= 1; passive++) {
285 memset(&hints, 0, sizeof(hints));
286 hints.ai_family = AF_UNSPEC;
287 hints.ai_flags = passive ? AI_PASSIVE : 0;
288 hints.ai_socktype = SOCK_STREAM;
289 hints.ai_protocol = IPPROTO_TCP;
290 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
291 (void)gai_strerror(gaierr);
292 goto bad;
293 }
294 for (ai = aitop; ai; ai = ai->ai_next) {
295 if (ai->ai_addr == NULL ||
296 ai->ai_addrlen == 0 ||
297 getnameinfo(ai->ai_addr, ai->ai_addrlen,
298 straddr, sizeof(straddr), strport, sizeof(strport),
299 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
300 goto bad;
301 }
302 switch (ai->ai_family) {
303 case AF_INET:
304 if (strcmp(strport, "54321") != 0) {
305 goto bad;
306 }
307 if (passive) {
308 if (strcmp(straddr, "0.0.0.0") != 0) {
309 goto bad;
310 }
311 } else {
312 if (strcmp(straddr, "127.0.0.1") != 0) {
313 goto bad;
314 }
315 }
316 inet4++;
317 break;
318 case AF_INET6:
319 if (strcmp(strport, "54321") != 0) {
320 goto bad;
321 }
322 if (passive) {
323 if (strcmp(straddr, "::") != 0) {
324 goto bad;
325 }
326 } else {
327 if (strcmp(straddr, "::1") != 0) {
328 goto bad;
329 }
330 }
331 inet6++;
332 break;
333 case AF_UNSPEC:
334 goto bad;
335 break;
336 #ifdef AF_UNIX
337 case AF_UNIX:
338 #else
339 #ifdef AF_LOCAL
340 case AF_LOCAL:
341 #endif
342 #endif
343 default:
344 /* another family support? */
345 break;
346 }
347 }
348 }
349
350 /* supported family should be 2, unsupported family should be 0 */
351 if (!(inet4 == 0 || inet4 == 2))
352 goto bad;
353 if (!(inet6 == 0 || inet6 == 2))
354 goto bad;
355
356 if (aitop)
357 freeaddrinfo(aitop);
358 exit(0);
359
360 bad:
361 if (aitop)
362 freeaddrinfo(aitop);
363 exit(1);
364 }
365 ],
366 td_cv_buggygetaddrinfo=no,
367 td_cv_buggygetaddrinfo=yes,
368 td_cv_buggygetaddrinfo=yes)])
369 if test "$td_cv_buggygetaddrinfo" = no; then
370 AC_MSG_RESULT(good)
371 else
372 AC_MSG_RESULT(buggy)
373 fi
374
375 if test "$td_cv_buggygetaddrinfo" = "yes"; then
376 #
377 # XXX - it doesn't appear that "ipv6type" can ever be
378 # set to "linux". Should this be testing for
379 # "linux-glibc", or for that *or* "linux-libinet6"?
380 # If the latter, note that "linux-libinet6" is also
381 # the type given to some non-Linux OSes.
382 #
383 if test "$ipv6type" != "linux"; then
384 echo 'Fatal: You must get working getaddrinfo() function.'
385 echo ' or you can specify "--disable-ipv6"'.
386 exit 1
387 else
388 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
389 echo ' Better upgrade your system library to newest version'
390 echo ' of GNU C library (aka glibc).'
391 fi
392 fi
393 ])
394 AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
395 fi
396
397 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
398 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
399 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
400 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
401 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
402 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
403 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
404 fi
405
406 dnl
407 dnl check sizeof basic types.
408 dnl They're very likely to be wrong for cross-compiling.
409 AC_CHECK_SIZEOF(char, 1)
410 AC_CHECK_SIZEOF(short, 2)
411 AC_CHECK_SIZEOF(int, 4)
412 AC_CHECK_SIZEOF(long, 4)
413
414 dnl
415 dnl Checks for u_intXX_t
416 dnl AC_CHECK_BITTYPES(ac_cv_bittypes)
417 dnl if test "$ac_cv_bittypes" = no; then
418 dnl missing_includes=yes
419 dnl fi
420
421 dnl
422 dnl Checks for addrinfo structure
423 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
424 if test "$ac_cv_addrinfo" = no; then
425 missing_includes=yes
426 fi
427
428 dnl
429 dnl Checks for NI_MAXSERV
430 AC_NI_MAXSERV(ac_cv_maxserv)
431 if test "$ac_cv_maxserv" = no; then
432 missing_includes=yes
433 fi
434
435 dnl
436 dnl Checks for NI_NAMEREQD
437 AC_NI_NAMEREQD(ac_cv_namereqd)
438 if test "$ac_cv_namereqd" = no; then
439 missing_includes=yes
440 fi
441
442 dnl
443 dnl Checks for sockaddr_storage structure
444 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
445 if test "$ac_cv_sa_storage" = no; then
446 missing_includes=yes
447 fi
448
449 dnl
450 dnl Checks for IN[6]ADDRSZ
451 AC_CHECK_ADDRSZ(ac_cv_addrsz)
452 if test "$ac_cv_addrsz" = no; then
453 missing_includes=yes
454 fi
455
456 dnl
457 dnl Checks for RES_USE_INET6
458 AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
459 if test "$ac_cv_res_inet6" = no; then
460 missing_includes=yes
461 fi
462
463 dnl
464 dnl Checks for res_state_ext structure
465 AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
466 if test "$ac_cv_res_state_ext" = no; then
467 missing_includes=yes
468 fi
469
470 dnl
471 dnl Checks if res_state structure has nsort member.
472 AC_STRUCT_RES_STATE(ac_cv_res_state)
473
474 dnl
475 dnl set additional include path if necessary
476 if test "$missing_includes" = "yes"; then
477 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
478 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
479 fi
480
481
482 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
483 AC_CHECK_FUNCS(ether_ntohost, [
484 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
485 AC_TRY_RUN([
486 #include <netdb.h>
487 #include <sys/types.h>
488 #include <sys/param.h>
489 #include <sys/socket.h>
490
491 int
492 main(int argc, char **argv)
493 {
494 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
495 char name[MAXHOSTNAMELEN];
496
497 ether_ntohost(name, (struct ether_addr *)ea);
498 exit(0);
499 }
500 ], [ac_cv_buggy_ether_ntohost=no],
501 [ac_cv_buggy_ether_ntohost=yes],
502 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
503 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
504 AC_DEFINE(USE_ETHER_NTOHOST)
505 fi
506 ])
507 AC_CHECK_FUNCS(setlinebuf)
508
509 needsnprintf=no
510 AC_CHECK_FUNCS(vsnprintf snprintf,,
511 [needsnprintf=yes])
512 if test $needsnprintf = yes; then
513 LIBOBJS="$LIBOBJS snprintf.o"
514 fi
515
516 AC_LBL_TYPE_SIGNAL
517
518 AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
519
520 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
521
522 dnl HP/UX may need -lnsl for getrpcbynumber.
523 AC_SEARCH_LIBS(getrpcbynumber, nsl)
524
525 dnl AC_CHECK_LIB(z, uncompress)
526 dnl AC_CHECK_HEADERS(zlib.h)
527
528 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
529
530 #
531 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
532 # libraries (e.g., "-lsocket -lnsl" on Solaris).
533 #
534 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
535 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
536 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
537 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
538 # it does not ship with a libc symbol "inet_ntop()", it ships with
539 # "_inet_ntop()", and has a #define macro in one of the system headers
540 # to rename it.
541 #
542 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
543 AC_MSG_CHECKING(for inet_ntop)
544 AC_TRY_LINK([#include <sys/types.h>
545 #include <sys/socket.h>
546 #include <netinet/in.h>
547 #include <arpa/inet.h>], [char src[4], dst[128];
548 inet_ntop(AF_INET, src, dst, sizeof(dst));],
549 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
550 LIBOBJS="$LIBOBJS inet_ntop.o"])
551 AC_MSG_CHECKING(for inet_pton)
552 AC_TRY_LINK([#include <sys/types.h>
553 #include <sys/socket.h>
554 #include <netinet/in.h>
555 #include <arpa/inet.h>], [char src[128], dst[4];
556 inet_pton(AF_INET, src, dst);],
557 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
558 LIBOBJS="$LIBOBJS inet_pton.o"])
559 AC_MSG_CHECKING(for inet_aton)
560 AC_TRY_LINK([#include <sys/types.h>
561 #include <netinet/in.h>
562 #include <arpa/inet.h>], [char src[128];
563 struct in_addr dst;
564 inet_aton(src, &dst);],
565 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
566 LIBOBJS="$LIBOBJS inet_aton.o"])
567
568 dnl portability macros for getaddrinfo/getnameinfo
569 dnl
570 dnl Check for sa_len
571 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
572 if test "$ac_cv_sockaddr_has_sa_len" = no; then
573 missing_includes=yes
574 fi
575
576 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
577 if test $ac_cv_func_pcap_lib_version = "no" ; then
578 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
579 AC_TRY_LINK([],
580 [
581 char *
582 return_pcap_version(void)
583 {
584 extern char pcap_version[];
585
586 return pcap_version;
587 }
588 ],
589 ac_lbl_cv_pcap_version_defined=yes,
590 ac_lbl_cv_pcap_version_defined=no)
591 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
592 AC_MSG_RESULT(yes)
593 AC_DEFINE(HAVE_PCAP_VERSION)
594 else
595 AC_MSG_RESULT(no)
596 fi
597 fi
598 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
599 AC_TRY_LINK([],
600 [
601 int
602 return_pcap_debug(void)
603 {
604 extern int pcap_debug;
605
606 return pcap_debug;
607 }
608 ],
609 ac_lbl_cv_pcap_debug_defined=yes,
610 ac_lbl_cv_pcap_debug_defined=no)
611 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
612 AC_MSG_RESULT(yes)
613 AC_DEFINE(HAVE_PCAP_DEBUG)
614 else
615 AC_MSG_RESULT(no)
616 #
617 # OK, what about "yydebug"?
618 #
619 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
620 AC_TRY_LINK([],
621 [
622 int
623 return_yydebug(void)
624 {
625 extern int yydebug;
626
627 return yydebug;
628 }
629 ],
630 ac_lbl_cv_yydebug_defined=yes,
631 ac_lbl_cv_yydebug_defined=no)
632 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
633 AC_MSG_RESULT(yes)
634 AC_DEFINE(HAVE_YYDEBUG)
635 else
636 AC_MSG_RESULT(no)
637 fi
638 fi
639 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
640
641 V_GROUP=0
642 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
643 V_GROUP=wheel
644 fi
645 case "$host_os" in
646
647 aix*)
648 dnl Workaround to enable certain features
649 AC_DEFINE(_SUN)
650 ;;
651
652 irix*)
653 V_GROUP=sys
654 ;;
655
656 osf*)
657 V_GROUP=system
658 ;;
659
660 solaris*)
661 V_GROUP=sys
662 ;;
663 esac
664
665 if test -f /dev/bpf0 ; then
666 V_GROUP=bpf
667 fi
668
669 AC_LBL_CHECK_TYPE(int8_t, signed char)
670 AC_LBL_CHECK_TYPE(u_int8_t, u_char)
671 AC_LBL_CHECK_TYPE(int16_t, short)
672 AC_LBL_CHECK_TYPE(u_int16_t, u_short)
673 AC_LBL_CHECK_TYPE(int32_t, int)
674 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
675
676 AC_LBL_DEVEL(V_CCOPT)
677
678 AC_LBL_SOCKADDR_SA_LEN
679
680 AC_LBL_UNALIGNED_ACCESS
681
682 AC_VAR_H_ERRNO
683
684 AC_ARG_WITH(crypto, [ --without-crypto disable crypto support],
685 [], [
686 AC_MSG_CHECKING(for SSLeay)
687 ac_cv_ssleay_path=no
688 incdir=no
689 for dir in /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
690 if test -d $dir/lib -a -f $dir/lib/libcrypto.a; then
691 ac_cv_ssleay_path=$dir
692 fi
693 if test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
694 incdir="-I$dir/include"
695 fi
696 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
697 break;
698 else
699 ac_cv_ssleay_path=no
700 incdir=no
701 fi
702 done
703 AC_MSG_RESULT($ac_cv_ssleay_path)
704 if test "$ac_cv_ssleay_path" != no; then
705 V_INCLS="$V_INCLS $incdir"
706 LDFLAGS="-L$dir/lib $LDFLAGS"
707 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
708 LIBS="$LIBS -lRSAglue"
709 fi
710 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
711 LIBS="$LIBS -lrsaref"
712 fi
713 AC_CHECK_LIB(crypto, des_cbc_encrypt)
714
715 bak_CPPFLAGS=$CPPFLAGS
716 CPPFLAGS="$CPPFLAGS $V_INCLS"
717 AC_CHECK_HEADERS(openssl/cast.h)
718
719 if test "$ac_cv_header_openssl_cast_h" = "yes"; then
720 AC_MSG_CHECKING(for buggy CAST128)
721 AC_CACHE_VAL(td_cv_buggy_cast128, [AC_TRY_RUN(dnl
722 [
723 #include <openssl/cast.h>
724 main()
725 {
726 unsigned char key[] = {0x01,0x23,0x45,0x67,0x12};
727 unsigned char in[] = {0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF};
728 unsigned char out[sizeof(in)];
729 unsigned char ok[] = {0x7A,0xC8,0x16,0xD1,0x6E,0x9B,0x30,0x2E};
730 CAST_KEY ks;
731 CAST_set_key(&ks, sizeof(key), key);
732 CAST_ecb_encrypt(in, out, &ks, CAST_ENCRYPT);
733 if (memcmp(out, ok, sizeof(ok)) != 0)
734 return 0;
735 else
736 return 1;
737 }],
738 [td_cv_buggy_cast128=yes],
739 [td_cv_buggy_cast128=no],
740 [td_cv_buggy_cast128="cross-compiling, assume yes"])])
741 AC_MSG_RESULT($td_cv_buggy_cast128)
742 if test "$td_cv_buggy_cast128" != no; then
743 echo "NOTE: SSLeay 0.9.0b has a bug in CAST128 en/decoding routine."
744 echo "disabling CAST128 support."
745 AC_DEFINE(HAVE_BUGGY_CAST128)
746 fi
747 fi
748
749 CPPFLAGS=$bak_CPPFLAGS
750 fi
751 ])
752 AC_CHECK_HEADERS(openssl/rc5.h)
753
754 AC_SUBST(V_CCOPT)
755 AC_SUBST(V_GROUP)
756 AC_SUBST(V_INCLS)
757 AC_SUBST(V_PCAPDEP)
758 AC_SUBST(LOCALSRC)
759
760 AC_PROG_INSTALL
761
762 AC_CONFIG_HEADER(config.h)
763
764 AC_OUTPUT_COMMANDS([if test -f .devel; then
765 echo timestamp > stamp-h
766 cat Makefile-devel-adds >> Makefile
767 make depend
768 fi])
769 AC_OUTPUT(Makefile)
770 exit 0