]> The Tcpdump Group git mirrors - libpcap/blob - configure.in
Have routines to set various internal debugging flags.
[libpcap] / configure.in
1 dnl
2 dnl Copyright (c) 1994, 1995, 1996, 1997
3 dnl The Regents of the University of California. All rights reserved.
4 dnl
5 dnl Process this file with autoconf to produce a configure script.
6 dnl
7
8 #
9 # See
10 #
11 # http://ftp.gnu.org/gnu/config/README
12 #
13 # for the URLs to use to fetch new versions of config.guess and
14 # config.sub.
15 #
16
17 AC_PREREQ(2.61)
18 AC_INIT(pcap.c)
19
20 AC_CANONICAL_SYSTEM
21
22 AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
23 AC_PROG_CC
24 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
25 AC_LBL_SHLIBS_INIT
26 AC_LBL_C_INLINE
27 AC_C___ATTRIBUTE__
28 if test "$ac_cv___attribute__" = "yes"; then
29 AC_C___ATTRIBUTE___UNUSED
30 AC_C___ATTRIBUTE___FORMAT
31 fi
32
33 AC_CHECK_HEADERS(sys/bitypes.h)
34
35 AC_CHECK_TYPE([int8_t], ,
36 [AC_DEFINE([int8_t], [signed char],
37 [Define to `signed char' if int8_t not defined.])],
38 [AC_INCLUDES_DEFAULT
39 #ifdef HAVE_SYS_BITYPES_H
40 #include <sys/bitypes.h>
41 #endif])
42 AC_CHECK_TYPE([u_int8_t], ,
43 [AC_DEFINE([u_int8_t], [unsigned char],
44 [Define to `unsigned char' if u_int8_t not defined.])],
45 [AC_INCLUDES_DEFAULT
46 #ifdef HAVE_SYS_BITYPES_H
47 #include <sys/bitypes.h>
48 #endif])
49 AC_CHECK_TYPE([int16_t], ,
50 [AC_DEFINE([int16_t], [short],
51 [Define to `short' if int16_t not defined.])]
52 [AC_INCLUDES_DEFAULT
53 #ifdef HAVE_SYS_BITYPES_H
54 #include <sys/bitypes.h>
55 #endif])
56 AC_CHECK_TYPE([u_int16_t], ,
57 [AC_DEFINE([u_int16_t], [unsigned short],
58 [Define to `unsigned short' if u_int16_t not defined.])],
59 [AC_INCLUDES_DEFAULT
60 #ifdef HAVE_SYS_BITYPES_H
61 #include <sys/bitypes.h>
62 #endif])
63 AC_CHECK_TYPE([int32_t], ,
64 [AC_DEFINE([int32_t], [int],
65 [Define to `int' if int32_t not defined.])],
66 [AC_INCLUDES_DEFAULT
67 #ifdef HAVE_SYS_BITYPES_H
68 #include <sys/bitypes.h>
69 #endif])
70 AC_CHECK_TYPE([u_int32_t], ,
71 [AC_DEFINE([u_int32_t], [unsigned int],
72 [Define to `unsigned int' if u_int32_t not defined.])],
73 [AC_INCLUDES_DEFAULT
74 #ifdef HAVE_SYS_BITYPES_H
75 #include <sys/bitypes.h>
76 #endif])
77 AC_CHECK_TYPE([int64_t], ,
78 [AC_DEFINE([int64_t], [long long],
79 [Define to `long long' if int64_t not defined.])],
80 [AC_INCLUDES_DEFAULT
81 #ifdef HAVE_SYS_BITYPES_H
82 #include <sys/bitypes.h>
83 #endif])
84 AC_CHECK_TYPE([u_int64_t], ,
85 [AC_DEFINE([u_int64_t], [unsigned long long],
86 [Define to `unsigned long long' if u_int64_t not defined.])],
87 [AC_INCLUDES_DEFAULT
88 #ifdef HAVE_SYS_BITYPES_H
89 #include <sys/bitypes.h>
90 #endif])
91
92 #
93 # Try to arrange for large file support.
94 #
95 AC_SYS_LARGEFILE
96 AC_FUNC_FSEEKO
97
98 dnl
99 dnl Even if <net/bpf.h> were, on all OSes that support BPF, fixed to
100 dnl include <sys/ioccom.h>, and we were to drop support for older
101 dnl releases without that fix, so that pcap-bpf.c doesn't need to
102 dnl include <sys/ioccom.h>, the test program in "AC_LBL_FIXINCLUDES"
103 dnl in "aclocal.m4" uses it, so we would still have to test for it
104 dnl and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
105 dnl "AC_LBL_FIXINCLUDES" wouldn't work on some platforms such as Solaris.
106 dnl
107 AC_CHECK_HEADERS(sys/ioccom.h sys/select.h sys/sockio.h limits.h)
108 AC_CHECK_HEADERS(linux/types.h)
109 AC_CHECK_HEADERS(linux/if_packet.h netpacket/packet.h netpacket/if_packet.h)
110 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
111 #include <sys/socket.h>
112 #include <net/if.h>])
113 if test "$ac_cv_header_net_pfvar_h" = yes; then
114 #
115 # Check for various PF actions.
116 #
117 AC_MSG_CHECKING(whether net/pfvar.h defines PF_NAT through PF_NORDR)
118 AC_TRY_COMPILE(
119 [#include <sys/types.h>
120 #include <sys/socket.h>
121 #include <net/if.h>
122 #include <net/pfvar.h>],
123 [return PF_NAT+PF_NONAT+PF_BINAT+PF_NOBINAT+PF_RDR+PF_NORDR;],
124 [
125 AC_MSG_RESULT(yes)
126 AC_DEFINE(HAVE_PF_NAT_THROUGH_PF_NORDR, 1,
127 [define if net/pfvar.h defines PF_NAT through PF_NORDR])
128 ],
129 AC_MSG_RESULT(no))
130 fi
131 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
132 #include <sys/socket.h>])
133 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
134 #
135 # The simple test didn't work.
136 # Do we need to include <net/if.h> first?
137 # Unset ac_cv_header_netinet_if_ether_h so we don't
138 # treat the previous failure as a cached value and
139 # suppress the next test.
140 #
141 AC_MSG_NOTICE([Rechecking with some additional includes])
142 unset ac_cv_header_netinet_if_ether_h
143 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
144 #include <sys/socket.h>
145 #include <netinet/in.h>
146 struct mbuf;
147 struct rtentry;
148 #include <net/if.h>])
149 fi
150
151 case "$host_os" in
152 linux*|uclinux*)
153 AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,
154 [
155 #include <sys/socket.h>
156 #include <linux/if.h>
157 ])
158 ;;
159 esac
160
161 AC_LBL_FIXINCLUDES
162
163 AC_CHECK_FUNCS(strerror strlcpy)
164
165 needsnprintf=no
166 AC_CHECK_FUNCS(vsnprintf snprintf,,
167 [needsnprintf=yes])
168 if test $needsnprintf = yes; then
169 AC_LIBOBJ([snprintf])
170 fi
171
172 #
173 # Do this before checking for ether_hostton(), as it's a
174 # "gethostbyname() -ish function".
175 #
176 AC_LBL_LIBRARY_NET
177
178 #
179 # You are in a twisty little maze of UN*Xes, all different.
180 # Some might not have ether_hostton().
181 # Some might have it, but not declare it in any header file.
182 # Some might have it, but declare it in <netinet/if_ether.h>.
183 # Some might have it, but declare it in <netinet/ether.h>
184 # (And some might have it but document it as something declared in
185 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
186 #
187 # Before you is a C compiler.
188 #
189 AC_CHECK_FUNCS(ether_hostton)
190 if test "$ac_cv_func_ether_hostton" = yes; then
191 #
192 # OK, we have ether_hostton(). Do we have <netinet/if_ether.h>?
193 #
194 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
195 #
196 # Yes. Does it declare ether_hostton()?
197 #
198 AC_CHECK_DECL(ether_hostton,
199 [
200 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
201 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
202 ],,
203 [
204 #include <sys/types.h>
205 #include <sys/socket.h>
206 #include <netinet/in.h>
207 #include <arpa/inet.h>
208 struct mbuf;
209 struct rtentry;
210 #include <net/if.h>
211 #include <netinet/if_ether.h>
212 ])
213 fi
214 #
215 # Did that succeed?
216 #
217 if test "$ac_cv_have_decl_ether_hostton" != yes; then
218 #
219 # No, how about <netinet/ether.h>, as on Linux?
220 #
221 AC_CHECK_HEADERS(netinet/ether.h)
222 if test "$ac_cv_header_netinet_ether_h" = yes; then
223 #
224 # We have it - does it declare ether_hostton()?
225 # Unset ac_cv_have_decl_ether_hostton so we don't
226 # treat the previous failure as a cached value and
227 # suppress the next test.
228 #
229 unset ac_cv_have_decl_ether_hostton
230 AC_CHECK_DECL(ether_hostton,
231 [
232 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
233 [Define to 1 if netinet/ether.h declares `ether_hostton'])
234 ],,
235 [
236 #include <netinet/ether.h>
237 ])
238 fi
239 fi
240 #
241 # Is ether_hostton() declared?
242 #
243 if test "$ac_cv_have_decl_ether_hostton" != yes; then
244 #
245 # No, we'll have to declare it ourselves.
246 # Do we have "struct ether_addr"?
247 #
248 AC_CHECK_TYPES(struct ether_addr,,,
249 [
250 #include <sys/types.h>
251 #include <sys/socket.h>
252 #include <netinet/in.h>
253 #include <arpa/inet.h>
254 struct mbuf;
255 struct rtentry;
256 #include <net/if.h>
257 #include <netinet/if_ether.h>
258 ])
259 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 0,
260 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
261 don't.])
262 else
263 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
264 [Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
265 don't.])
266 fi
267 fi
268
269 dnl to pacify those who hate protochain insn
270 AC_MSG_CHECKING(if --disable-protochain option is specified)
271 AC_ARG_ENABLE(protochain,
272 AC_HELP_STRING([--disable-protochain],[disable \"protochain\" insn]))
273 case "x$enable_protochain" in
274 xyes) enable_protochain=enabled ;;
275 xno) enable_protochain=disabled ;;
276 x) enable_protochain=enabled ;;
277 esac
278
279 if test "$enable_protochain" = "disabled"; then
280 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
281 fi
282 AC_MSG_RESULT(${enable_protochain})
283
284 #
285 # valgrindtest directly uses the native capture mechanism, but
286 # only tests with BPF and PF_PACKET sockets; only enable it if
287 # we have BPF or PF_PACKET sockets.
288 #
289 VALGRINDTEST=
290
291 #
292 # SITA support is mutually exclusive with native capture support;
293 # "--with-sita" selects SITA support.
294 #
295 AC_ARG_WITH(sita,
296 AC_HELP_STRING([--with-sita],[include SITA support]),
297 [
298 if test ! "x$withval" = "xno" ; then
299 AC_DEFINE(SITA,1,[include ACN support])
300 AC_MSG_NOTICE(Enabling SITA ACN support)
301 V_PCAP=sita
302 V_FINDALLDEVS=sita
303 fi
304 ],
305 [
306 dnl
307 dnl Not all versions of test support -c (character special) but it's a
308 dnl better way of testing since the device might be protected. So we
309 dnl check in our normal order using -r and then check the for the /dev
310 dnl guys again using -c.
311 dnl
312 dnl XXX This could be done for cross-compiling, but for now it's not.
313 dnl
314 if test -z "$with_pcap" && test "$cross_compiling" = yes; then
315 AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
316 fi
317 AC_ARG_WITH(pcap,
318 AC_HELP_STRING([--with-pcap=TYPE],[use packet capture TYPE]))
319 AC_MSG_CHECKING(packet capture type)
320 if test ! -z "$with_pcap" ; then
321 V_PCAP="$withval"
322 elif test -r /dev/bpf -o -h /dev/bpf ; then
323 #
324 # Cloning BPF device.
325 #
326 V_PCAP=bpf
327 AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
328
329 #
330 # We have BPF, so build valgrindtest with "make test".
331 #
332 VALGRINDTEST=valgrindtest
333 elif test -r /dev/bpf0 ; then
334 V_PCAP=bpf
335
336 #
337 # We have BPF, so build valgrindtest with "make test".
338 #
339 VALGRINDTEST=valgrindtest
340 elif test -r /usr/include/net/pfilt.h ; then
341 V_PCAP=pf
342 elif test -r /dev/enet ; then
343 V_PCAP=enet
344 elif test -r /dev/nit ; then
345 V_PCAP=snit
346 elif test -r /usr/include/sys/net/nit.h ; then
347 V_PCAP=nit
348 elif test -r /usr/include/linux/socket.h ; then
349 V_PCAP=linux
350
351 #
352 # XXX - this won't work with older kernels that have SOCK_PACKET
353 # sockets but not PF_PACKET sockets.
354 #
355 VALGRINDTEST=valgrindtest
356 elif test -r /usr/include/net/raw.h ; then
357 V_PCAP=snoop
358 elif test -r /usr/include/odmi.h ; then
359 #
360 # On AIX, the BPF devices might not yet be present - they're
361 # created the first time libpcap runs after booting.
362 # We check for odmi.h instead.
363 #
364 V_PCAP=bpf
365 elif test -c /dev/bpf0 ; then # check again in case not readable
366 V_PCAP=bpf
367
368 #
369 # We have BPF, so build valgrindtest with "make test".
370 #
371 VALGRINDTEST=valgrindtest
372 elif test -r /usr/include/sys/dlpi.h ; then
373 V_PCAP=dlpi
374 elif test -c /dev/enet ; then # check again in case not readable
375 V_PCAP=enet
376 elif test -c /dev/nit ; then # check again in case not readable
377 V_PCAP=snit
378 else
379 V_PCAP=null
380 fi
381 AC_MSG_RESULT($V_PCAP)
382 AC_SUBST(VALGRINDTEST)
383
384 #
385 # Do capture-mechanism-dependent tests.
386 #
387 case "$V_PCAP" in
388 dlpi)
389 #
390 # Needed for common functions used by pcap-[dlpi,libdlpi].c
391 #
392 SSRC="dlpisubs.c"
393
394 #
395 # Checks for some header files.
396 #
397 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
398
399 #
400 # Checks to see if Solaris has the public libdlpi(3LIB) library.
401 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
402 # public libdlpi(3LIB) version. Before libdlpi was made public, a
403 # private version also existed, which did not have the same APIs.
404 # Due to a gcc bug, the default search path for 32-bit libraries does
405 # not include /lib, we add it explicitly here.
406 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
407 # Also, due to the bug above applications that link to libpcap with
408 # libdlpi will have to add "-L/lib" option to "configure".
409 #
410 saved_ldflags=$LDFLAGS
411 LDFLAGS="$LIBS -L/lib"
412 AC_CHECK_LIB(dlpi, dlpi_walk,
413 [
414 LIBS="-ldlpi $LIBS"
415 V_PCAP=libdlpi
416 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists])
417 ],
418 V_PCAP=dlpi)
419 LDFLAGS=$saved_ldflags
420
421 #
422 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
423 # versions of DLPI.
424 #
425 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
426 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
427 AC_TRY_COMPILE(
428 [
429 #include <sys/types.h>
430 #include <sys/time.h>
431 #include <sys/dlpi.h>
432 ],
433 [int i = DL_PROMISC_PHYS;],
434 ac_cv_sys_dlpi_usable=yes,
435 ac_cv_sys_dlpi_usable=no))
436 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
437 if test $ac_cv_sys_dlpi_usable = no ; then
438 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
439 fi
440
441 #
442 # Check whether we have a /dev/dlpi device or have multiple devices.
443 #
444 AC_MSG_CHECKING(for /dev/dlpi device)
445 if test -c /dev/dlpi ; then
446 AC_MSG_RESULT(yes)
447 AC_DEFINE(HAVE_DEV_DLPI, 1, [define if you have a /dev/dlpi])
448 else
449 AC_MSG_RESULT(no)
450 dir="/dev/dlpi"
451 AC_MSG_CHECKING(for $dir directory)
452 if test -d $dir ; then
453 AC_MSG_RESULT(yes)
454 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir", [/dev/dlpi directory])
455 else
456 AC_MSG_RESULT(no)
457 fi
458 fi
459
460 #
461 # This check is for Solaris with DLPI support for passive modes.
462 # See dlpi(7P) for more details.
463 #
464 AC_LBL_DL_PASSIVE_REQ_T
465 ;;
466
467 linux)
468 #
469 # Do we have the wireless extensions?
470 #
471 AC_CHECK_HEADERS(linux/wireless.h, [], [],
472 [
473 #include <sys/socket.h>
474 #include <linux/if.h>
475 #include <linux/types.h>
476 ])
477
478 #
479 # Do we have libnl?
480 #
481 AC_ARG_WITH(libnl,
482 AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
483 with_libnl=$withval,,)
484
485 if test x$with_libnl != xno ; then
486 have_any_nl="no"
487
488 incdir=-I/usr/include/libnl3
489 libnldir=
490 if test x$withval != x ; then
491 libnldir=-L${withval}/lib/.libs
492 incdir=-I${withval}/include
493 fi
494
495 #
496 # Try libnl 3.x first.
497 #
498 AC_CHECK_LIB(nl-3, nl_socket_alloc,
499 [
500 #
501 # Yes, we have libnl 3.x.
502 #
503 LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
504 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
505 AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x])
506 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
507 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
508 V_INCLS="$V_INCLS ${incdir}"
509 have_any_nl="yes"
510 ],[], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
511
512 if test x$have_any_nl = xno ; then
513 #
514 # Try libnl 2.x
515 #
516 AC_CHECK_LIB(nl, nl_socket_alloc,
517 [
518 #
519 # Yes, we have libnl 2.x.
520 #
521 LIBS="${libnldir} -lnl-genl -lnl $LIBS"
522 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
523 AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x])
524 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
525 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
526 have_any_nl="yes"
527 ])
528 fi
529
530 if test x$have_any_nl = xno ; then
531 #
532 # No, we don't; do we have libnl 1.x?
533 #
534 AC_CHECK_LIB(nl, nl_handle_alloc,
535 [
536 #
537 # Yes.
538 #
539 LIBS="${libnldir} -lnl $LIBS"
540 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
541 have_any_nl="yes"
542 ])
543 fi
544
545 if test x$have_any_nl = xno ; then
546 #
547 # No, we don't have libnl at all.
548 #
549 if test x$with_libnl = xyes ; then
550 AC_MSG_ERROR([libnl support requested but libnl not found])
551 fi
552 fi
553 fi
554
555 AC_CHECK_HEADERS(linux/ethtool.h,,,
556 [
557 AC_INCLUDES_DEFAULT
558 #include <linux/types.h>
559 ])
560 AC_LBL_TPACKET_STATS
561 AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI
562 ;;
563
564 bpf)
565 #
566 # Check whether we have the *BSD-style ioctls.
567 #
568 AC_CHECK_HEADERS(net/if_media.h)
569
570 AC_MSG_CHECKING(whether the system supports zerocopy BPF)
571 AC_TRY_COMPILE(
572 [#include <sys/socket.h>
573 #include <sys/ioctl.h>
574 #include <net/if.h>
575 #include <net/bpf.h>],
576 [return (BIOCROTZBUF + BPF_BUFMODE_ZBUF);],
577 [
578 AC_MSG_RESULT(yes)
579 AC_DEFINE(HAVE_ZEROCOPY_BPF, 1,
580 [define if the system supports zerocopy BPF])
581 ],
582 AC_MSG_RESULT(no))
583
584 #
585 # Check whether we have struct BPF_TIMEVAL.
586 #
587 AC_CHECK_TYPES(struct BPF_TIMEVAL,,,
588 [
589 #include <sys/types.h>
590 #include <sys/ioctl.h>
591 #ifdef HAVE_SYS_IOCCOM_H
592 #include <sys/ioccom.h>
593 #endif
594 #include <net/bpf.h>
595 ])
596 ;;
597
598 dag)
599 V_DEFS="$V_DEFS -DDAG_ONLY"
600 ;;
601
602 septel)
603 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
604 ;;
605
606 snf)
607 V_DEFS="$V_DEFS -DSNF_ONLY"
608 ;;
609
610 null)
611 AC_MSG_WARN(cannot determine packet capture interface)
612 AC_MSG_WARN((see the INSTALL doc for more info))
613 ;;
614 esac
615
616 dnl
617 dnl Now figure out how we get a list of interfaces and addresses,
618 dnl if we support capturing. Don't bother if we don't support
619 dnl capturing.
620 dnl
621 if test "$V_PCAP" = null
622 then
623 #
624 # We can't capture, so we can't open any capture
625 # devices, so we won't return any interfaces.
626 #
627 V_FINDALLDEVS=null
628 else
629 AC_CHECK_FUNC(getifaddrs,[
630 #
631 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
632 # as well, just in case some platform is really weird.
633 #
634 AC_CHECK_HEADER(ifaddrs.h,[
635 #
636 # We have the header, so we use "getifaddrs()" to
637 # get the list of interfaces.
638 #
639 V_FINDALLDEVS=getad
640 ],[
641 #
642 # We don't have the header - give up.
643 # XXX - we could also fall back on some other
644 # mechanism, but, for now, this'll catch this
645 # problem so that we can at least try to figure
646 # out something to do on systems with "getifaddrs()"
647 # but without "ifaddrs.h", if there is something
648 # we can do on those systems.
649 #
650 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
651 ])
652 ],[
653 #
654 # Well, we don't have "getifaddrs()", so we have to use
655 # some other mechanism; determine what that mechanism is.
656 #
657 # The first thing we use is the type of capture mechanism,
658 # which is somewhat of a proxy for the OS we're using.
659 #
660 case "$V_PCAP" in
661
662 dlpi|libdlpi)
663 #
664 # This might be Solaris 8 or later, with
665 # SIOCGLIFCONF, or it might be some other OS
666 # or some older version of Solaris, with
667 # just SIOCGIFCONF.
668 #
669 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
670 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
671 AC_TRY_COMPILE(
672 [#include <sys/param.h>
673 #include <sys/file.h>
674 #include <sys/ioctl.h>
675 #include <sys/socket.h>
676 #include <sys/sockio.h>],
677 [ioctl(0, SIOCGLIFCONF, (char *)0);],
678 ac_cv_lbl_have_siocglifconf=yes,
679 ac_cv_lbl_have_siocglifconf=no))
680 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
681 if test $ac_cv_lbl_have_siocglifconf = yes ; then
682 V_FINDALLDEVS=glifc
683 else
684 V_FINDALLDEVS=gifc
685 fi
686 ;;
687
688 *)
689 #
690 # Assume we just have SIOCGIFCONF.
691 # (XXX - on at least later Linux kernels, there's
692 # another mechanism, and we should be using that
693 # instead.)
694 #
695 V_FINDALLDEVS=gifc
696 ;;
697 esac])
698 fi
699 ])
700
701 AC_MSG_CHECKING(for socklen_t)
702 AC_TRY_COMPILE([
703 #include <sys/types.h>
704 #include <sys/socket.h>
705 ],
706 [ socklen_t x; ],
707 have_socklen_t=yes,
708 have_socklen_t=no)
709 if test "x$have_socklen_t" = "xyes"; then
710 AC_DEFINE(HAVE_SOCKLEN_T, 1, [define if socklen_t is defined])
711 fi
712 AC_MSG_RESULT($have_socklen_t)
713
714 AC_ARG_ENABLE(ipv6,
715 AC_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes, if getaddrinfo available@:>@]),
716 [],
717 [enable_ipv6=ifavailable])
718 if test "$enable_ipv6" != "no"; then
719 AC_CHECK_FUNC(getaddrinfo,
720 [
721 AC_DEFINE(INET6,1,[IPv6])
722 ],
723 [
724 if test "$enable_ipv6" != "ifavailable"; then
725 AC_MSG_FAILURE([--enable-ipv6 was given, but getaddrinfo isn't available])
726 fi
727 ])
728 fi
729
730 AC_MSG_CHECKING(whether to build optimizer debugging code)
731 AC_ARG_ENABLE(optimizer-dbg,
732 AC_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
733 if test "$enable_optimizer_dbg" = "yes"; then
734 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
735 fi
736 AC_MSG_RESULT(${enable_optimizer_dbg-no})
737
738 AC_MSG_CHECKING(whether to build parser debugging code)
739 AC_ARG_ENABLE(yydebug,
740 AC_HELP_STRING([--enable-yydebug],[build parser debugging code]))
741 if test "$enable_yydebug" = "yes"; then
742 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
743 fi
744 AC_MSG_RESULT(${enable_yydebug-no})
745
746 # Check for Endace DAG card support.
747 AC_ARG_WITH([dag],
748 AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
749 [
750 if test "$withval" = no
751 then
752 # User doesn't want DAG support.
753 want_dag=no
754 elif test "$withval" = yes
755 then
756 # User wants DAG support but hasn't specified a directory.
757 want_dag=yes
758 else
759 # User wants DAG support and has specified a directory, so use the provided value.
760 want_dag=yes
761 dag_root=$withval
762 fi
763 ],[
764 if test "$V_PCAP" = dag; then
765 # User requested DAG-only libpcap, so we'd better have
766 # the DAG API.
767 want_dag=yes
768 else
769 #
770 # Use DAG API if present, otherwise don't
771 #
772 want_dag=ifpresent
773 fi
774 ])
775
776 AC_ARG_WITH([dag-includes],
777 AC_HELP_STRING([--with-dag-includes=IDIR],[Endace DAG include directory, if not DIR/include]),
778 [
779 # User wants DAG support and has specified a header directory, so use the provided value.
780 want_dag=yes
781 dag_include_dir=$withval
782 ],[])
783
784 AC_ARG_WITH([dag-libraries],
785 AC_HELP_STRING([--with-dag-libraries=LDIR],[Endace DAG library directory, if not DIR/lib]),
786 [
787 # User wants DAG support and has specified a library directory, so use the provided value.
788 want_dag=yes
789 dag_lib_dir=$withval
790 ],[])
791
792 ac_cv_lbl_dag_api=no
793 if test "$want_dag" != no; then
794
795 AC_MSG_CHECKING([whether we have DAG API headers])
796
797 # If necessary, set default paths for DAG API headers and libraries.
798 if test -z "$dag_root"; then
799 dag_root=/usr/local
800 fi
801
802 if test -z "$dag_include_dir"; then
803 dag_include_dir="$dag_root/include"
804 fi
805
806 if test -z "$dag_lib_dir"; then
807 dag_lib_dir="$dag_root/lib"
808 fi
809
810 if test -z "$dag_tools_dir"; then
811 dag_tools_dir="$dag_root/tools"
812 fi
813
814 if test -r $dag_include_dir/dagapi.h; then
815 ac_cv_lbl_dag_api=yes
816 fi
817
818 if test "$ac_cv_lbl_dag_api" = yes; then
819 AC_MSG_RESULT([yes ($dag_include_dir)])
820
821 V_INCLS="$V_INCLS -I$dag_include_dir"
822
823 if test $V_PCAP != dag ; then
824 SSRC="$SSRC pcap-dag.c"
825 fi
826
827 # See if we can find a general version string.
828 # Don't need to save and restore LIBS to prevent -ldag being
829 # included if there's a found-action (arg 3).
830 saved_ldflags=$LDFLAGS
831 LDFLAGS="-L$dag_lib_dir"
832 AC_CHECK_LIB([dag], [dag_attach_stream], [dag_streams="1"], [dag_streams="0"])
833 AC_CHECK_LIB([dag],[dag_get_erf_types], [
834 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
835 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
836 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
837
838 LDFLAGS=$saved_ldflags
839
840 if test "$dag_streams" = 1; then
841 AC_DEFINE(HAVE_DAG_STREAMS_API, 1, [define if you have streams capable DAG API])
842 LIBS="$LIBS -ldag"
843 LDFLAGS="$LDFLAGS -L$dag_lib_dir"
844
845 AC_CHECK_LIB([vdag],[vdag_set_device_info], [ac_dag_have_vdag="1"], [ac_dag_have_vdag="0"])
846 if test "$ac_dag_have_vdag" = 1; then
847 AC_DEFINE(HAVE_DAG_VDAG, 1, [define if you have vdag_set_device_info()])
848 LIBS="$LIBS -lpthread"
849 fi
850 fi
851
852 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
853 else
854 AC_MSG_RESULT(no)
855
856 if test "$V_PCAP" = dag; then
857 # User requested "dag" capture type but we couldn't
858 # find the DAG API support.
859 AC_MSG_ERROR([DAG support requested with --with-pcap=dag, but the DAG headers weren't found at $dag_include_dir: make sure the DAG support is installed, specify a different path or paths if necessary, or don't request DAG support])
860 fi
861
862 if test "$want_dag" = yes; then
863 # User wanted DAG support but we couldn't find it.
864 AC_MSG_ERROR([DAG support requested with --with-dag, but the DAG headers weren't found at $dag_include_dir: make sure the DAG support is installed, specify a different path or paths if necessary, or don't request DAG support])
865 fi
866 fi
867 fi
868
869 AC_ARG_WITH(septel,
870 AC_HELP_STRING([--with-septel@<:@=DIR@:>@],[include Septel support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
871 [
872 if test "$withval" = no
873 then
874 want_septel=no
875 elif test "$withval" = yes
876 then
877 want_septel=yes
878 septel_root=
879 else
880 want_septel=yes
881 septel_root=$withval
882 fi
883 ],[
884 if test "$V_PCAP" = septel; then
885 # User requested Septel-only libpcap, so we'd better have
886 # the Septel API.
887 want_septel=yes
888 else
889 #
890 # Use Septel API if present, otherwise don't
891 #
892 want_septel=ifpresent
893 fi
894 ])
895
896 ac_cv_lbl_septel_api=no
897 if test "$with_septel" != no; then
898
899 AC_MSG_CHECKING([whether we have Septel API headers])
900
901 # If necessary, set default paths for Septel API headers and libraries.
902 if test -z "$septel_root"; then
903 septel_root=$srcdir/../septel
904 fi
905
906 septel_tools_dir="$septel_root"
907 septel_include_dir="$septel_root/INC"
908
909 if test -r "$septel_include_dir/msg.h"; then
910 ac_cv_lbl_septel_api=yes
911 fi
912
913 if test "$ac_cv_lbl_septel_api" = yes; then
914 AC_MSG_RESULT([yes ($septel_include_dir)])
915
916 V_INCLS="$V_INCLS -I$septel_include_dir"
917 ADDLOBJS="$ADDLOBJS $septel_tools_dir/asciibin.o $septel_tools_dir/bit2byte.o $septel_tools_dir/confirm.o $septel_tools_dir/fmtmsg.o $septel_tools_dir/gct_unix.o $septel_tools_dir/hqueue.o $septel_tools_dir/ident.o $septel_tools_dir/mem.o $septel_tools_dir/pack.o $septel_tools_dir/parse.o $septel_tools_dir/pool.o $septel_tools_dir/sdlsig.o $septel_tools_dir/strtonum.o $septel_tools_dir/timer.o $septel_tools_dir/trace.o"
918 ADDLARCHIVEOBJS="$ADDLARCHIVEOBJS $septel_tools_dir/asciibin.o $septel_tools_dir/bit2byte.o $septel_tools_dir/confirm.o $septel_tools_dir/fmtmsg.o $septel_tools_dir/gct_unix.o $septel_tools_dir/hqueue.o $septel_tools_dir/ident.o $septel_tools_dir/mem.o $septel_tools_dir/pack.o $septel_tools_dir/parse.o $septel_tools_dir/pool.o $septel_tools_dir/sdlsig.o $septel_tools_dir/strtonum.o $septel_tools_dir/timer.o $septel_tools_dir/trace.o"
919
920 if test "$V_PCAP" != septel ; then
921 SSRC="$SSRC pcap-septel.c"
922 fi
923
924 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have the Septel API])
925 else
926 AC_MSG_RESULT(no)
927
928 if test "$V_PCAP" = septel; then
929 # User requested "septel" capture type but
930 # we couldn't find the Septel API support.
931 AC_MSG_ERROR([Septel support requested with --with-pcap=septel, but the Septel headers weren't found at $septel_include_dir: make sure the Septel support is installed, specify a different path or paths if necessary, or don't request Septel support])
932 fi
933
934 if test "$want_septel" = yes; then
935 # User wanted Septel support but we couldn't find it.
936 AC_MSG_ERROR([Septel support requested with --with-septel, but the Septel headers weren't found at $septel_include_dir: make sure the Septel support is installed, specify a different path or paths if necessary, or don't request Septel support])
937 fi
938 fi
939 fi
940
941 # Check for Myricom SNF support.
942 AC_ARG_WITH([snf],
943 AC_HELP_STRING([--with-snf@<:@=DIR@:>@],[include Myricom SNF support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
944 [
945 if test "$withval" = no
946 then
947 # User explicitly doesn't want SNF
948 want_snf=no
949 elif test "$withval" = yes
950 then
951 # User wants SNF support but hasn't specified a directory.
952 want_snf=yes
953 else
954 # User wants SNF support with a specified directory.
955 want_snf=yes
956 snf_root=$withval
957 fi
958 ],[
959 if test "$V_PCAP" = snf; then
960 # User requested Sniffer-only libpcap, so we'd better have
961 # the Sniffer API.
962 want_snf=yes
963 else
964 #
965 # Use Sniffer API if present, otherwise don't
966 #
967 want_snf=ifpresent
968 fi
969 ])
970
971 AC_ARG_WITH([snf-includes],
972 AC_HELP_STRING([--with-snf-includes=IDIR],[Myricom SNF include directory, if not DIR/include]),
973 [
974 # User wants SNF with specific header directory
975 want_snf=yes
976 snf_include_dir=$withval
977 ],[])
978
979 AC_ARG_WITH([snf-libraries],
980 AC_HELP_STRING([--with-snf-libraries=LDIR],[Myricom SNF library directory, if not DIR/lib]),
981 [
982 # User wants SNF with specific lib directory
983 want_snf=yes
984 snf_lib_dir=$withval
985 ],[])
986
987 ac_cv_lbl_snf_api=no
988 if test "$with_snf" != no; then
989
990 AC_MSG_CHECKING(whether we have Myricom Sniffer API)
991
992 # If necessary, set default paths for Sniffer headers and libraries.
993 if test -z "$snf_root"; then
994 snf_root=/opt/snf
995 fi
996
997 if test -z "$snf_include_dir"; then
998 snf_include_dir="$snf_root/include"
999 fi
1000
1001 if test -z "$snf_lib_dir"; then
1002 snf_lib_dir="$snf_root/lib"
1003 fi
1004
1005 if test -f "$snf_include_dir/snf.h"; then
1006 # We found a header; make sure we can link with the library
1007 saved_ldflags=$LDFLAGS
1008 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1009 AC_CHECK_LIB([snf], [snf_init], [ac_cv_lbl_snf_api="yes"])
1010 LDFLAGS="$saved_ldflags"
1011 if test "$ac_cv_lbl_snf_api" = no; then
1012 AC_MSG_ERROR(SNF API cannot correctly be linked; check config.log)
1013 fi
1014 fi
1015
1016 if test "$ac_cv_lbl_snf_api" = yes; then
1017 AC_MSG_RESULT([yes ($snf_root)])
1018
1019 V_INCLS="$V_INCLS -I$snf_include_dir"
1020 LIBS="$LIBS -lsnf"
1021 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1022
1023 if test "$V_PCAP" != snf ; then
1024 SSRC="$SSRC pcap-snf.c"
1025 fi
1026
1027 AC_DEFINE(HAVE_SNF_API, 1, [define if you have the Myricom SNF API])
1028 else
1029 AC_MSG_RESULT(no)
1030
1031 if test "$want_snf" = yes; then
1032 # User requested "snf" capture type but
1033 # we couldn't find the Sniffer API support.
1034 AC_MSG_ERROR([Myricom Sniffer support requested with --with-pcap=snf, but the Sniffer headers weren't found at $snf_include_dir: make sure the Sniffer support is installed, specify a different path or paths if necessary, or don't request Sniffer support])
1035 fi
1036
1037 if test "$want_snf" = yes; then
1038 AC_MSG_ERROR([Myricom Sniffer support requested with --with-snf, but the Sniffer headers weren't found at $snf_include_dir: make sure the Sniffer support is installed, specify a different path or paths if necessary, or don't request Sniffer support])
1039 fi
1040 fi
1041 fi
1042
1043 # Check for Riverbed TurboCap support.
1044 AC_ARG_WITH([turbocap],
1045 AC_HELP_STRING([--with-turbocap@<:@=DIR@:>@],[include Riverbed TurboCap support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1046 [
1047 if test "$withval" = no
1048 then
1049 # User explicitly doesn't want TurboCap
1050 want_turbocap=no
1051 elif test "$withval" = yes
1052 then
1053 # User wants TurboCap support but hasn't specified a directory.
1054 want_turbocap=yes
1055 else
1056 # User wants TurboCap support with a specified directory.
1057 want_turbocap=yes
1058 turbocap_root=$withval
1059 fi
1060 ],[
1061 #
1062 # Use TurboCap API if present, otherwise don't
1063 #
1064 want_turbocap=ifpresent
1065 ])
1066
1067 ac_cv_lbl_turbocap_api=no
1068 if test "$want_turbocap" != no; then
1069
1070 AC_MSG_CHECKING(whether TurboCap is supported)
1071
1072 save_CFLAGS="$CFLAGS"
1073 save_LIBS="$LIBS"
1074 if test ! -z "$turbocap_root"; then
1075 TURBOCAP_CFLAGS="-I$turbocap_root/include"
1076 TURBOCAP_LIBS="-L$turbocap_root/lib"
1077 CFLAGS="$CFLAGS $TURBOCAP_CFLAGS"
1078 fi
1079
1080 AC_TRY_COMPILE(
1081 [
1082 #include <TcApi.h>
1083 ],
1084 [
1085 TC_INSTANCE a; TC_PORT b; TC_BOARD c;
1086 TC_INSTANCE i;
1087 (void)TcInstanceCreateByName("foo", &i);
1088 ],
1089 ac_cv_lbl_turbocap_api=yes)
1090
1091 CFLAGS="$save_CFLAGS"
1092 if test $ac_cv_lbl_turbocap_api = yes; then
1093 AC_MSG_RESULT(yes)
1094
1095 SSRC="$SSRC pcap-tc.c"
1096 V_INCLS="$V_INCLS $TURBOCAP_CFLAGS"
1097 LIBS="$LIBS $TURBOCAP_LIBS -lTcApi -lpthread -lstdc++"
1098
1099 AC_DEFINE(HAVE_TC_API, 1, [define if you have the TurboCap API])
1100 else
1101 AC_MSG_RESULT(no)
1102
1103 if test "$want_turbocap" = yes; then
1104 # User wanted Turbo support but we couldn't find it.
1105 AC_MSG_ERROR([TurboCap support requested with --with-turbocap, but the TurboCap headers weren't found: make sure the TurboCap support is installed or don't request TurboCap support])
1106 fi
1107 fi
1108 fi
1109
1110 #
1111 # Look for {f}lex.
1112 #
1113 AC_PROG_LEX
1114 if test "$LEX" = ":"; then
1115 AC_MSG_ERROR([Neither flex nor lex was found.])
1116 fi
1117
1118 #
1119 # Make sure {f}lex supports the -P, --header-file, and --nounput flags
1120 # and supports processing our scanner.l.
1121 #
1122 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
1123 if $LEX -P pcap_ --header-file=/dev/null --nounput -t $srcdir/scanner.l > /dev/null 2>&1; then
1124 tcpdump_cv_capable_lex=yes
1125 else
1126 tcpdump_cv_capable_lex=insufficient
1127 fi)
1128 if test $tcpdump_cv_capable_lex = insufficient ; then
1129 AC_MSG_ERROR([$LEX is insufficient to compile libpcap.
1130 libpcap requires Flex 2.5.31 or later, or a compatible version of lex.])
1131 fi
1132
1133 #
1134 # Look for yacc/bison/byacc.
1135 #
1136 AC_PROG_YACC
1137
1138 #
1139 # Make sure it supports the -p flag and supports processing our
1140 # grammar.y.
1141 #
1142 AC_CACHE_CHECK([for capable yacc/bison], tcpdump_cv_capable_yacc,
1143 if $YACC -p pcap_ -o /dev/null $srcdir/grammar.y >/dev/null 2>&1; then
1144 tcpdump_cv_capable_yacc=yes
1145 else
1146 tcpdump_cv_capable_yacc=insufficient
1147 fi)
1148 if test $tcpdump_cv_capable_yacc = insufficient ; then
1149 AC_MSG_ERROR([$YACC is insufficient to compile libpcap.
1150 libpcap requires Bison, Berkeley YACC, or another YACC compatible with them.])
1151 fi
1152
1153 #
1154 # Assume, by default, no support for shared libraries and V7/BSD convention
1155 # for man pages (file formats in section 5, miscellaneous info in section 7).
1156 # Individual cases can override this.
1157 #
1158 DYEXT="none"
1159 MAN_FILE_FORMATS=5
1160 MAN_MISC_INFO=7
1161 case "$host_os" in
1162
1163 aix*)
1164 dnl Workaround to enable certain features
1165 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
1166
1167 #
1168 # AIX makes it fun to build shared and static libraries,
1169 # because they're *both* ".a" archive libraries. We
1170 # build the static library for the benefit of the traditional
1171 # scheme of building libpcap and tcpdump in subdirectories of
1172 # the same directory, with tcpdump statically linked with the
1173 # libpcap in question, but we also build a shared library as
1174 # "libpcap.shareda" and install *it*, rather than the static
1175 # library, as "libpcap.a".
1176 #
1177 DYEXT="shareda"
1178
1179 case "$V_PCAP" in
1180
1181 dlpi)
1182 #
1183 # If we're using DLPI, applications will need to
1184 # use /lib/pse.exp if present, as we use the
1185 # STREAMS routines.
1186 #
1187 pseexe="/lib/pse.exp"
1188 AC_MSG_CHECKING(for $pseexe)
1189 if test -f $pseexe ; then
1190 AC_MSG_RESULT(yes)
1191 LIBS="-I:$pseexe"
1192 fi
1193 ;;
1194
1195 bpf)
1196 #
1197 # If we're using BPF, we need "-lodm" and "-lcfg", as
1198 # we use them to load the BPF module.
1199 #
1200 LIBS="-lodm -lcfg"
1201 ;;
1202 esac
1203 ;;
1204
1205 darwin*)
1206 DYEXT="dylib"
1207 V_CCOPT="$V_CCOPT -fno-common"
1208 AC_ARG_ENABLE(universal,
1209 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
1210 if test "$enable_universal" != "no"; then
1211 case "$host_os" in
1212
1213 darwin[0-7].*)
1214 #
1215 # Pre-Tiger. Build only for 32-bit PowerPC; no
1216 # need for any special compiler or linker flags.
1217 #
1218 ;;
1219
1220 darwin8.[0123]*)
1221 #
1222 # Tiger, prior to Intel support. Build for 32-bit
1223 # PowerPC and 64-bit PowerPC, with 32-bit PowerPC
1224 # first. (I'm guessing that's what Apple does.)
1225 #
1226 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64"
1227 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64"
1228 ;;
1229
1230 darwin8.[456]*)
1231 #
1232 # Tiger, subsequent to Intel support but prior to
1233 # x86-64 support. Build for 32-bit PowerPC, 64-bit
1234 # PowerPC, and x86, with 32-bit PowerPC first.
1235 # (I'm guessing that's what Apple does.)
1236 #
1237 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386"
1238 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386"
1239 ;;
1240
1241 darwin8.*)
1242 #
1243 # All other Tiger, so subsequent to x86-64
1244 # support. Build for 32-bit PowerPC, 64-bit
1245 # PowerPC, x86, and x86-64, and with 32-bit PowerPC
1246 # first. (I'm guessing that's what Apple does.)
1247 #
1248 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1249 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1250 ;;
1251
1252 darwin9.*)
1253 #
1254 # Leopard. Build for 32-bit PowerPC, 64-bit
1255 # PowerPC, x86, and x86-64, with 32-bit PowerPC
1256 # first. (That's what Apple does.)
1257 #
1258 V_CCOPT="$V_CCOPT -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1259 LDFLAGS="$LDFLAGS -arch ppc -arch ppc64 -arch i386 -arch x86_64"
1260 ;;
1261
1262 darwin10.*)
1263 #
1264 # Snow Leopard. Build for x86-64, x86, and
1265 # 32-bit PowerPC, with x86-64 first. (That's
1266 # what Apple does, even though Snow Leopard
1267 # doesn't run on PPC, so PPC libpcap runs under
1268 # Rosetta, and Rosetta doesn't support BPF
1269 # ioctls, so PPC programs can't do live
1270 # captures.)
1271 #
1272 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386 -arch ppc"
1273 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386 -arch ppc"
1274 ;;
1275
1276 darwin*)
1277 #
1278 # Post-Snow Leopard. Build for x86-64 and
1279 # x86, with x86-64 first. (That's probably what
1280 # Apple does, given that Rosetta is gone.)
1281 # XXX - update if and when Apple drops support
1282 # for 32-bit x86 code.
1283 #
1284 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
1285 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
1286 ;;
1287 esac
1288 fi
1289 ;;
1290
1291 hpux9*)
1292 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
1293
1294 #
1295 # Use System V conventions for man pages.
1296 #
1297 MAN_FILE_FORMATS=4
1298 MAN_MISC_INFO=5
1299 ;;
1300
1301 hpux10.0*)
1302
1303 #
1304 # Use System V conventions for man pages.
1305 #
1306 MAN_FILE_FORMATS=4
1307 MAN_MISC_INFO=5
1308 ;;
1309
1310 hpux10.1*)
1311
1312 #
1313 # Use System V conventions for man pages.
1314 #
1315 MAN_FILE_FORMATS=4
1316 MAN_MISC_INFO=5
1317 ;;
1318
1319 hpux*)
1320 dnl HPUX 10.20 and above is similar to HPUX 9, but
1321 dnl not the same....
1322 dnl
1323 dnl XXX - DYEXT should be set to "sl" if this is building
1324 dnl for 32-bit PA-RISC, but should be left as "so" for
1325 dnl 64-bit PA-RISC or, I suspect, IA-64.
1326 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
1327 if test "`uname -m`" = "ia64"; then
1328 DYEXT="so"
1329 else
1330 DYEXT="sl"
1331 fi
1332
1333 #
1334 # "-b" builds a shared library; "+h" sets the soname.
1335 #
1336 SHLIB_OPT="-b"
1337 SONAME_OPT="+h"
1338
1339 #
1340 # Use System V conventions for man pages.
1341 #
1342 MAN_FILE_FORMATS=4
1343 MAN_MISC_INFO=5
1344 ;;
1345
1346 irix*)
1347 #
1348 # Use System V conventions for man pages.
1349 #
1350 MAN_FILE_FORMATS=4
1351 MAN_MISC_INFO=5
1352 ;;
1353
1354 linux*|freebsd*|netbsd*|openbsd*|dragonfly*|kfreebsd*|gnu*)
1355 DYEXT="so"
1356
1357 #
1358 # Compiler assumed to be GCC; run-time linker may require a -R
1359 # flag.
1360 #
1361 if test "$libdir" != "/usr/lib"; then
1362 V_RFLAGS=-Wl,-R$libdir
1363 fi
1364 ;;
1365
1366 osf*)
1367 DYEXT="so"
1368
1369 #
1370 # Use System V conventions for man pages.
1371 #
1372 MAN_FILE_FORMATS=4
1373 MAN_MISC_INFO=5
1374 ;;
1375
1376 sinix*)
1377 AC_MSG_CHECKING(if SINIX compiler defines sinix)
1378 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
1379 AC_TRY_COMPILE(
1380 [],
1381 [int i = sinix;],
1382 ac_cv_cc_sinix_defined=yes,
1383 ac_cv_cc_sinix_defined=no))
1384 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
1385 if test $ac_cv_cc_sinix_defined = no ; then
1386 AC_DEFINE(sinix,1,[on sinix])
1387 fi
1388 ;;
1389
1390 solaris*)
1391 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
1392
1393 DYEXT="so"
1394 #
1395 # Use System V conventions for man pages.
1396 #
1397 MAN_FILE_FORMATS=4
1398 MAN_MISC_INFO=5
1399 ;;
1400 esac
1401
1402 AC_ARG_ENABLE(shared,
1403 AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@]))
1404 test "x$enable_shared" = "xno" && DYEXT="none"
1405
1406 AC_PROG_RANLIB
1407 AC_CHECK_TOOL([AR], [ar])
1408
1409 AC_PROG_LN_S
1410 AC_SUBST(LN_S)
1411
1412 AC_LBL_DEVEL(V_CCOPT)
1413
1414 AC_LBL_SOCKADDR_SA_LEN
1415
1416 AC_LBL_SOCKADDR_STORAGE
1417
1418 AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1
1419
1420 AC_LBL_UNALIGNED_ACCESS
1421
1422 #
1423 # Makefile.in includes rules to generate version.h, so we assume
1424 # that it will be generated if autoconf is used.
1425 #
1426 AC_DEFINE(HAVE_VERSION_H, 1, [define if version.h is generated in the build procedure])
1427
1428 rm -f net
1429 ln -s ${srcdir}/bpf/net net
1430
1431 AC_SUBST(V_CCOPT)
1432 AC_SUBST(V_DEFS)
1433 AC_SUBST(V_FINDALLDEVS)
1434 AC_SUBST(V_INCLS)
1435 AC_SUBST(V_LEX)
1436 AC_SUBST(V_PCAP)
1437 AC_SUBST(V_SHLIB_CMD)
1438 AC_SUBST(V_SHLIB_OPT)
1439 AC_SUBST(V_SONAME_OPT)
1440 AC_SUBST(V_RPATH_OPT)
1441 AC_SUBST(V_YACC)
1442 AC_SUBST(ADDLOBJS)
1443 AC_SUBST(ADDLARCHIVEOBJS)
1444 AC_SUBST(SSRC)
1445 AC_SUBST(DYEXT)
1446 AC_SUBST(MAN_FILE_FORMATS)
1447 AC_SUBST(MAN_MISC_INFO)
1448
1449 AC_ARG_ENABLE([usb],
1450 [AC_HELP_STRING([--enable-usb],[enable nusb support @<:@default=yes, if support available@:>@])],
1451 [],
1452 [enable_usb=yes])
1453
1454 if test "x$enable_usb" != "xno" ; then
1455 dnl check for USB sniffing support
1456 AC_MSG_CHECKING(for USB sniffing support)
1457 case "$host_os" in
1458 linux*)
1459 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
1460 USB_SRC=pcap-usb-linux.c
1461 AC_MSG_RESULT(yes)
1462 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
1463 if test $? -ne 0 ; then
1464 ac_usb_dev_name="usbmon"
1465 fi
1466 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
1467 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
1468 #
1469 # Do we have a version of <linux/compiler.h> available?
1470 # If so, we might need it for <linux/usbdevice_fs.h>.
1471 #
1472 AC_CHECK_HEADERS(linux/compiler.h)
1473 if test "$ac_cv_header_linux_compiler_h" = yes; then
1474 #
1475 # Yes - include it when testing for <linux/usbdevice_fs.h>.
1476 #
1477 AC_CHECK_HEADERS(linux/usbdevice_fs.h,,,[#include <linux/compiler.h>])
1478 else
1479 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
1480 fi
1481 if test "$ac_cv_header_linux_usbdevice_fs_h" = yes; then
1482 #
1483 # OK, does it define bRequestType? Older versions of the kernel
1484 # define fields with names like "requesttype, "request", and
1485 # "value", rather than "bRequestType", "bRequest", and
1486 # "wValue".
1487 #
1488 AC_MSG_CHECKING(if usbdevfs_ctrltransfer struct has bRequestType member)
1489 AC_CACHE_VAL(ac_cv_usbdevfs_ctrltransfer_has_bRequestType,
1490 AC_TRY_COMPILE([
1491 AC_INCLUDES_DEFAULT
1492 #ifdef HAVE_SYS_BITYPES_H
1493 #include <sys/bitypes.h>
1494 #endif
1495 #ifdef HAVE_LINUX_COMPILER_H
1496 #include <linux/compiler.h>
1497 #endif
1498 #include <linux/usbdevice_fs.h>],
1499 [u_int i = sizeof(((struct usbdevfs_ctrltransfer *)0)->bRequestType)],
1500 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=yes,
1501 ac_cv_usbdevfs_ctrltransfer_has_bRequestType=no))
1502 AC_MSG_RESULT($ac_cv_usbdevfs_ctrltransfer_has_bRequestType)
1503 if test $ac_cv_usbdevfs_ctrltransfer_has_bRequestType = yes ; then
1504 AC_DEFINE(HAVE_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE,1,
1505 [if struct usbdevfs_ctrltransfer has bRequestType])
1506 fi
1507 fi
1508 ;;
1509 *)
1510 AC_MSG_RESULT(no)
1511 ;;
1512 esac
1513 fi
1514 AC_SUBST(PCAP_SUPPORT_USB)
1515 AC_SUBST(USB_SRC)
1516
1517 dnl check for netfilter sniffing support
1518 AC_MSG_CHECKING(whether the platform could support netfilter sniffing)
1519 case "$host_os" in
1520 linux*)
1521 AC_MSG_RESULT(yes)
1522 #
1523 # Life's too short to deal with trying to get this to compile
1524 # if you don't get the right types defined with
1525 # __KERNEL_STRICT_NAMES getting defined by some other include.
1526 #
1527 # Check whether the includes Just Work. If not, don't turn on
1528 # netfilter support.
1529 #
1530 AC_MSG_CHECKING(whether we can compile the netfilter support)
1531 AC_CACHE_VAL(ac_cv_netfilter_can_compile,
1532 AC_TRY_COMPILE([
1533 AC_INCLUDES_DEFAULT
1534 #include <sys/socket.h>
1535 #include <netinet/in.h>
1536 #include <linux/types.h>
1537
1538 #include <linux/netlink.h>
1539 #include <linux/netfilter.h>
1540 #include <linux/netfilter/nfnetlink.h>
1541 #include <linux/netfilter/nfnetlink_log.h>
1542 #include <linux/netfilter/nfnetlink_queue.h>],
1543 [],
1544 ac_cv_netfilter_can_compile=yes,
1545 ac_cv_netfilter_can_compile=no))
1546 AC_MSG_RESULT($ac_cv_netfilter_can_compile)
1547 if test $ac_cv_netfilter_can_compile = yes ; then
1548 AC_DEFINE(PCAP_SUPPORT_NETFILTER, 1,
1549 [target host supports netfilter sniffing])
1550 NETFILTER_SRC=pcap-netfilter-linux.c
1551 fi
1552 ;;
1553 *)
1554 AC_MSG_RESULT(no)
1555 ;;
1556 esac
1557 AC_SUBST(PCAP_SUPPORT_NETFILTER)
1558 AC_SUBST(NETFILTER_SRC)
1559
1560 AC_ARG_ENABLE([bluetooth],
1561 [AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
1562 [],
1563 [enable_bluetooth=ifsupportavailable])
1564
1565 if test "x$enable_bluetooth" != "xno" ; then
1566 dnl check for Bluetooth sniffing support
1567 case "$host_os" in
1568 linux*)
1569 AC_CHECK_HEADER(bluetooth/bluetooth.h,
1570 [
1571 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
1572 BT_SRC=pcap-bt-linux.c
1573 AC_MSG_NOTICE(Bluetooth sniffing is supported)
1574
1575 #
1576 # OK, does struct sockaddr_hci have an hci_channel
1577 # member?
1578 #
1579 AC_MSG_CHECKING(if struct sockaddr_hci has hci_channel member)
1580 AC_CACHE_VAL(ac_cv_lbl_sockaddr_hci_has_hci_channel,
1581 AC_TRY_COMPILE(
1582 [
1583 #include <bluetooth/bluetooth.h>
1584 #include <bluetooth/hci.h>
1585 ],
1586 [u_int i = sizeof(((struct sockaddr_hci *)0)->hci_channel)],
1587 ac_cv_lbl_sockaddr_hci_has_hci_channel=yes,
1588 ac_cv_lbl_sockaddr_hci_has_hci_channel=no))
1589 AC_MSG_RESULT($ac_cv_lbl_sockaddr_hci_has_hci_channel)
1590 if test $ac_cv_lbl_sockaddr_hci_has_hci_channel = yes ; then
1591 AC_DEFINE(SOCKADDR_HCI_HAS_HCI_CHANNEL,,
1592 [if struct sockaddr_hci has hci_channel member])
1593
1594 #
1595 # OK, is HCI_CHANNEL_MONITOR defined?
1596 #
1597 AC_MSG_CHECKING(if HCI_CHANNEL_MONITOR is defined)
1598 AC_CACHE_VAL(ac_cv_lbl_hci_channel_monitor_is_defined,
1599 AC_TRY_COMPILE(
1600 [
1601 #include <bluetooth/bluetooth.h>
1602 #include <bluetooth/hci.h>
1603 ],
1604 [u_int i = HCI_CHANNEL_MONITOR],
1605 ac_cv_lbl_hci_channel_monitor_is_defined=yes,
1606 ac_cv_lbl_hci_channel_monitor_is_defined=no))
1607 AC_MSG_RESULT($ac_cv_lbl_hci_channel_monitor_is_defined)
1608 if test $ac_cv_lbl_hci_channel_monitor_is_defined = yes ; then
1609 AC_DEFINE(PCAP_SUPPORT_BT_MONITOR,,
1610 [target host supports Bluetooth Monitor])
1611 BT_MONITOR_SRC=pcap-bt-monitor-linux.c
1612 fi
1613 fi
1614 ac_lbl_bluetooth_available=yes
1615 ],
1616 ac_lbl_bluetooth_available=no
1617 )
1618 if test "x$ac_lbl_bluetooth_available" == "xno" ; then
1619 if test "x$enable_bluetooth" = "xyes" ; then
1620 AC_MSG_ERROR(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1621 else
1622 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
1623 fi
1624 fi
1625 ;;
1626 *)
1627 if test "x$enable_bluetooth" = "xyes" ; then
1628 AC_MSG_ERROR(no Bluetooth sniffing support implemented for $host_os)
1629 else
1630 AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
1631 fi
1632 ;;
1633 esac
1634 AC_SUBST(PCAP_SUPPORT_BT)
1635 AC_SUBST(BT_SRC)
1636 AC_SUBST(BT_MONITOR_SRC)
1637 fi
1638
1639 AC_ARG_ENABLE([canusb],
1640 [AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])],
1641 [],
1642 [enable_canusb=ifsupportavailable])
1643
1644 if test "x$enable_canusb" != "xno" ; then
1645 dnl check for canusb support
1646 case "$host_os" in
1647 linux*|uclinux*)
1648 AC_CHECK_HEADER(libusb-1.0/libusb.h,
1649 [
1650 AC_CHECK_LIB(usb-1.0, libusb_init,
1651 [
1652 AC_DEFINE(PCAP_SUPPORT_CANUSB, 1, [target host supports canusb])
1653 CANUSB_SRC=pcap-canusb-linux.c
1654 LIBS="-lusb-1.0 -lpthread $LIBS"
1655 ac_lbl_has_libusb=yes
1656 ],
1657 ac_lbl_has_libusb=no,
1658 -lpthread
1659 )
1660 ],
1661 ac_lbl_has_libusb=no
1662 )
1663 if test "x$ac_lbl_has_libusb" = "xyes" ; then
1664 AC_MSG_NOTICE(canusb sniffing is supported)
1665 else
1666 if test "x$enable_canusb" = "xyes" ; then
1667 AC_MSG_ERROR(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
1668 else
1669 AC_MSG_NOTICE(canusb sniffing is not supported; install libusb1.0 lib devel to enable it)
1670 fi
1671 fi
1672 ;;
1673 *)
1674 if test "x$enable_canusb" = "xyes" ; then
1675 AC_MSG_ERROR(no canusb support implemented for $host_os)
1676 else
1677 AC_MSG_NOTICE(no canusb support implemented for $host_os)
1678 fi
1679 ;;
1680 esac
1681 AC_SUBST(PCAP_SUPPORT_CANUSB)
1682 AC_SUBST(CANUSB_SRC)
1683 fi
1684
1685 AC_ARG_ENABLE([can],
1686 [AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])],
1687 [],
1688 [enable_can=ifsupportavailable])
1689
1690 if test "x$enable_can" != "xno" ; then
1691 dnl check for CAN sniffing support
1692 case "$host_os" in
1693 linux*)
1694 AC_CHECK_HEADER(linux/can.h,
1695 [
1696 AC_DEFINE(PCAP_SUPPORT_CAN, 1, [target host supports CAN sniffing])
1697 CAN_SRC=pcap-can-linux.c
1698 AC_MSG_NOTICE(CAN sniffing is supported)
1699 ],
1700 [
1701 if test "x$enable_can" = "xyes" ; then
1702 AC_MSG_ERROR(CAN sniffing is not supported)
1703 else
1704 AC_MSG_NOTICE(CAN sniffing is not supported)
1705 fi
1706 ],
1707 [#include <sys/socket.h>]
1708 )
1709 ;;
1710 *)
1711 if test "x$enable_can" = "xyes" ; then
1712 AC_MSG_ERROR(no CAN sniffing support implemented for $host_os)
1713 else
1714 AC_MSG_NOTICE(no CAN sniffing support implemented for $host_os)
1715 fi
1716 ;;
1717 esac
1718 AC_SUBST(PCAP_SUPPORT_CAN)
1719 AC_SUBST(CAN_SRC)
1720 fi
1721
1722 AC_ARG_ENABLE([dbus],
1723 [AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])],
1724 [],
1725 [enable_dbus=ifavailable])
1726
1727 if test "x$enable_dbus" != "xno"; then
1728 if test "x$enable_dbus" = "xyes"; then
1729 case "$host_os" in
1730
1731 darwin*)
1732 #
1733 # We don't support D-Bus sniffing on OS X; see
1734 #
1735 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
1736 #
1737 # The user requested it, so fail.
1738 #
1739 AC_MSG_ERROR([Due to freedesktop.org bug 74029, D-Bus capture support is not available on OS X])
1740 esac
1741 else
1742 case "$host_os" in
1743
1744 darwin*)
1745 #
1746 # We don't support D-Bus sniffing on OS X; see
1747 #
1748 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
1749 #
1750 # The user dind't explicitly request it, so just
1751 # silently refuse to enable it.
1752 #
1753 enable_dbus="no"
1754 ;;
1755 esac
1756 fi
1757 fi
1758
1759 if test "x$enable_dbus" != "xno"; then
1760 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])
1761 if test "x$PKGCONFIG" != "xno"; then
1762 AC_MSG_CHECKING([for D-Bus])
1763 if "$PKGCONFIG" dbus-1; then
1764 AC_MSG_RESULT([yes])
1765 DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
1766 DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
1767 save_CFLAGS="$CFLAGS"
1768 save_LIBS="$LIBS"
1769 CFLAGS="$CFLAGS $DBUS_CFLAGS"
1770 LIBS="$LIBS $DBUS_LIBS"
1771 AC_MSG_CHECKING(whether the D-Bus library defines dbus_connection_read_write)
1772 AC_TRY_LINK(
1773 [#include <string.h>
1774
1775 #include <time.h>
1776 #include <sys/time.h>
1777
1778 #include <dbus/dbus.h>],
1779 [return dbus_connection_read_write(NULL, 0);],
1780 [
1781 AC_MSG_RESULT([yes])
1782 AC_DEFINE(PCAP_SUPPORT_DBUS, 1, [support D-Bus sniffing])
1783 DBUS_SRC=pcap-dbus.c
1784 V_INCLS="$V_INCLS $DBUS_CFLAGS"
1785 ],
1786 [
1787 AC_MSG_RESULT([no])
1788 if test "x$enable_dbus" = "xyes"; then
1789 AC_MSG_ERROR([--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()])
1790 fi
1791 LIBS="$save_LIBS"
1792 ])
1793 CFLAGS="$save_CFLAGS"
1794 else
1795 AC_MSG_RESULT([no])
1796 if test "x$enable_dbus" = "xyes"; then
1797 AC_MSG_ERROR([--enable-dbus was given, but the dbus-1 package is not installed])
1798 fi
1799 fi
1800 fi
1801 AC_SUBST(PCAP_SUPPORT_DBUS)
1802 AC_SUBST(DBUS_SRC)
1803 fi
1804
1805 dnl check for hardware timestamp support
1806 case "$host_os" in
1807 linux*)
1808 AC_CHECK_HEADERS([linux/net_tstamp.h])
1809 ;;
1810 *)
1811 AC_MSG_NOTICE(no hardware timestamp support implemented for $host_os)
1812 ;;
1813 esac
1814
1815 dnl The packet ring capture facility of Linux, described in
1816 dnl Documentation/networking/packet_mmap.txt, is not 32/64-bit compatible before
1817 dnl version 2.6.27. A 32-bit kernel requires a 32-bit userland, and likewise for
1818 dnl 64-bit. The effect of this is that a 32-bit libpcap binary will not run
1819 dnl correctly on a 64-bit kernel (the binary will use the wrong offsets into a
1820 dnl kernel struct). This problem was solved in Linux 2.6.27. Use
1821 dnl --disable-packet-ring whenever a 32-bit application must run on a 64-bit
1822 dnl target host, and either the build host or the target host run Linux 2.6.26
1823 dnl or earlier.
1824 AC_ARG_ENABLE([packet-ring],
1825 [AC_HELP_STRING([--enable-packet-ring],[enable Linux packet ring support @<:@default=yes@:>@])],
1826 ,enable_packet_ring=yes)
1827
1828 if test "x$enable_packet_ring" != "xno" ; then
1829 AC_DEFINE(PCAP_SUPPORT_PACKET_RING, 1, [use Linux packet ring capture if available])
1830 AC_SUBST(PCAP_SUPPORT_PACKET_RING)
1831 fi
1832
1833 AC_PROG_INSTALL
1834
1835 AC_CONFIG_HEADER(config.h)
1836
1837 AC_OUTPUT_COMMANDS([if test -f .devel; then
1838 echo timestamp > stamp-h
1839 cat Makefile-devel-adds >> Makefile
1840 make depend
1841 fi])
1842 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
1843 pcap-tstamp.manmisc pcap-savefile.manfile pcap.3pcap
1844 pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap
1845 pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap
1846 pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap
1847 pcap_open_offline.3pcap pcap_set_tstamp_precision.3pcap
1848 pcap_set_tstamp_type.3pcap)
1849 exit 0