]> The Tcpdump Group git mirrors - libpcap/blob - configure.ac
Clean up some whitespaces
[libpcap] / configure.ac
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.64)
18
19 AC_INIT(pcap, m4_esyscmd_s([cat VERSION]))
20 AC_CONFIG_SRCDIR(pcap.c)
21 AC_SUBST(PACKAGE_NAME)
22
23 AC_CANONICAL_SYSTEM
24
25 AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
26 #
27 # Try to enable as many C99 features as we can.
28 # At minimum, we want C++/C99-style // comments.
29 #
30 AC_PROG_CC_C99
31 if test "$ac_cv_prog_cc_c99" = "no"; then
32 AC_MSG_WARN([The C compiler does not support C99; there may be compiler errors])
33 fi
34 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
35 AC_LBL_SHLIBS_INIT
36 AC_LBL_C_INLINE
37
38 #
39 # Try to arrange for large file support.
40 #
41 AC_SYS_LARGEFILE
42 AC_FUNC_FSEEKO
43
44 dnl
45 dnl Even if <net/bpf.h> were, on all OSes that support BPF, fixed to
46 dnl include <sys/ioccom.h>, and we were to drop support for older
47 dnl releases without that fix, so that pcap-bpf.c doesn't need to
48 dnl include <sys/ioccom.h>, the test program in "AC_LBL_FIXINCLUDES"
49 dnl in "aclocal.m4" uses it, so we would still have to test for it
50 dnl and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
51 dnl "AC_LBL_FIXINCLUDES" wouldn't work on some platforms such as Solaris.
52 dnl
53 AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h)
54 AC_CHECK_HEADERS(netpacket/packet.h)
55 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
56 #include <sys/socket.h>
57 #include <net/if.h>])
58 if test "$ac_cv_header_net_pfvar_h" = yes; then
59 #
60 # Check for various PF actions.
61 #
62 AC_MSG_CHECKING(whether net/pfvar.h defines PF_NAT through PF_NORDR)
63 AC_TRY_COMPILE(
64 [#include <sys/types.h>
65 #include <sys/socket.h>
66 #include <net/if.h>
67 #include <net/pfvar.h>],
68 [return PF_NAT+PF_NONAT+PF_BINAT+PF_NOBINAT+PF_RDR+PF_NORDR;],
69 [
70 AC_MSG_RESULT(yes)
71 AC_DEFINE(HAVE_PF_NAT_THROUGH_PF_NORDR, 1,
72 [define if net/pfvar.h defines PF_NAT through PF_NORDR])
73 ],
74 AC_MSG_RESULT(no))
75 fi
76
77 case "$host_os" in
78 linux*|uclinux*)
79 #
80 # linux/if_bonding.h requires sys/socket.h.
81 #
82 AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,
83 [
84 #include <sys/socket.h>
85 #include <linux/if.h>
86 ])
87
88 #
89 # Check for the eventfd header.
90 #
91 AC_CHECK_HEADERS(sys/eventfd.h)
92 ;;
93 esac
94
95 AC_LBL_FIXINCLUDES
96
97 AC_CHECK_FUNCS(strerror strerror_r strerror_s)
98
99 #
100 # Thanks, IBM, for not providing vsyslog() in AIX!
101 #
102 AC_CHECK_FUNCS(vsyslog)
103
104 needsnprintf=no
105 AC_CHECK_FUNCS(vsnprintf snprintf,,
106 [needsnprintf=yes])
107 if test $needsnprintf = yes; then
108 AC_LIBOBJ([snprintf])
109 fi
110
111 needstrlcat=no
112 AC_CHECK_FUNCS(strlcat,,
113 [needstrlcat=yes])
114 if test $needstrlcat = yes; then
115 AC_LIBOBJ([strlcat])
116 fi
117
118 needstrlcpy=no
119 AC_CHECK_FUNCS(strlcpy,,
120 [needstrlcpy=yes])
121 if test $needstrlcpy = yes; then
122 AC_LIBOBJ([strlcpy])
123 fi
124
125 needstrtok_r=no
126 AC_CHECK_FUNCS(strtok_r,,
127 [needstrtok_r=yes])
128 if test $needstrtok_r = yes; then
129 AC_LIBOBJ([strtok_r])
130 fi
131
132 #
133 # Do we have ffs(), and is it declared in <strings.h>?
134 #
135 AC_CHECK_FUNCS(ffs)
136 if test "$ac_cv_func_ffs" = yes; then
137 #
138 # We have ffs(); is it declared in <strings.h>?
139 #
140 # This test fails if we don't have <strings.h> or if we do
141 # but it doesn't declare ffs().
142 #
143 AC_CHECK_DECL(ffs,
144 [
145 AC_DEFINE(STRINGS_H_DECLARES_FFS,,
146 [Define to 1 if strings.h declares `ffs'])
147 ],,
148 [
149 #include <strings.h>
150 ])
151 fi
152
153 #
154 # Do this before checking for ether_hostton(), as it's a
155 # "getaddrinfo()-ish function".
156 #
157 AC_LBL_LIBRARY_NET
158
159 #
160 # Check for reentrant versions of getnetbyname_r(), as provided by
161 # Linux (glibc), Solaris/IRIX, and AIX (with three different APIs!).
162 # If we don't find one, we just use getnetbyname(), which uses
163 # thread-specific data on many platforms, but doesn't use it on
164 # NetBSD or OpenBSD, and may not use it on older versions of other
165 # platforms.
166 #
167 # Only do the check if we have a declaration of getnetbyname_r();
168 # without it, we can't check which API it has. (We assume that
169 # if there's a declaration, it has a prototype, so that the API
170 # can be checked.)
171 #
172 AC_CHECK_DECL(getnetbyname_r,
173 [
174 AC_MSG_CHECKING([for the Linux getnetbyname_r()])
175 AC_TRY_LINK(
176 [#include <netdb.h>],
177 [
178 struct netent netent_buf;
179 char buf[1024];
180 struct netent *resultp;
181 int h_errnoval;
182
183 return getnetbyname_r((const char *)0, &netent_buf, buf, sizeof buf, &resultp, &h_errnoval);
184 ],
185 [
186 AC_MSG_RESULT(yes)
187 AC_DEFINE(HAVE_LINUX_GETNETBYNAME_R, 1,
188 [define if we have the Linux getnetbyname_r()])
189 ],
190 [
191 AC_MSG_RESULT(no)
192
193 AC_MSG_CHECKING([for Solaris/IRIX getnetbyname_r()])
194 AC_TRY_LINK(
195 [#include <netdb.h>],
196 [
197 struct netent netent_buf;
198 char buf[1024];
199
200 return getnetbyname_r((const char *)0, &netent_buf, buf, (int)sizeof buf) != NULL;
201 ],
202 [
203 AC_MSG_RESULT(yes)
204 AC_DEFINE(HAVE_SOLARIS_IRIX_GETNETBYNAME_R, 1,
205 [define if we have the Solaris/IRIX getnetbyname_r()])
206 ],
207 [
208 AC_MSG_RESULT(no)
209
210 AC_MSG_CHECKING([for AIX getnetbyname_r()])
211 AC_TRY_LINK(
212 [#include <netdb.h>],
213 [
214 struct netent netent_buf;
215 struct netent_data net_data;
216
217 return getnetbyname_r((const char *)0, &netent_buf, &net_data);
218 ],
219 [
220 AC_MSG_RESULT(yes)
221 AC_DEFINE(HAVE_AIX_GETNETBYNAME_R, 1,
222 [define if we have the AIX getnetbyname_r()])
223 ],
224 [
225 AC_MSG_RESULT(no)
226 ])
227 ])
228 ])
229 ],,[#include <netdb.h>])
230
231 #
232 # Check for reentrant versions of getprotobyname_r(), as provided by
233 # Linux (glibc), Solaris/IRIX, and AIX (with three different APIs!).
234 # If we don't find one, we just use getprotobyname(), which uses
235 # thread-specific data on many platforms, but doesn't use it on
236 # NetBSD or OpenBSD, and may not use it on older versions of other
237 # platforms.
238 #
239 # Only do the check if we have a declaration of getprotobyname_r();
240 # without it, we can't check which API it has. (We assume that
241 # if there's a declaration, it has a prototype, so that the API
242 # can be checked.)
243 #
244 AC_CHECK_DECL(getprotobyname_r,
245 [
246 AC_MSG_CHECKING([for the Linux getprotobyname_r()])
247 AC_TRY_LINK(
248 [#include <netdb.h>],
249 [
250 struct protoent protoent_buf;
251 char buf[1024];
252 struct protoent *resultp;
253
254 return getprotobyname_r((const char *)0, &protoent_buf, buf, sizeof buf, &resultp);
255 ],
256 [
257 AC_MSG_RESULT(yes)
258 AC_DEFINE(HAVE_LINUX_GETPROTOBYNAME_R, 1,
259 [define if we have the Linux getprotobyname_r()])
260 ],
261 [
262 AC_MSG_RESULT(no)
263
264 AC_MSG_CHECKING([for Solaris/IRIX getprotobyname_r()])
265 AC_TRY_LINK(
266 [#include <netdb.h>],
267 [
268 struct protoent protoent_buf;
269 char buf[1024];
270
271 return getprotobyname_r((const char *)0, &protoent_buf, buf, (int)sizeof buf) != NULL;
272 ],
273 [
274 AC_MSG_RESULT(yes)
275 AC_DEFINE(HAVE_SOLARIS_IRIX_GETPROTOBYNAME_R, 1,
276 [define if we have the Solaris/IRIX getprotobyname_r()])
277 ],
278 [
279 AC_MSG_RESULT(no)
280
281 AC_MSG_CHECKING([for AIX getprotobyname_r()])
282 AC_TRY_LINK(
283 [#include <netdb.h>],
284 [
285 struct protoent protoent_buf;
286 struct protoent_data proto_data;
287
288 return getprotobyname_r((const char *)0, &protoent_buf, &proto_data);
289 ],
290 [
291 AC_MSG_RESULT(yes)
292 AC_DEFINE(HAVE_AIX_GETPROTOBYNAME_R, 1,
293 [define if we have the AIX getprotobyname_r()])
294 ],
295 [
296 AC_MSG_RESULT(no)
297 ])
298 ])
299 ])
300 ],,[#include <netdb.h>])
301
302 #
303 # You are in a twisty little maze of UN*Xes, all different.
304 # Some might not have ether_hostton().
305 # Some might have it and declare it in <net/ethernet.h>.
306 # Some might have it and declare it in <netinet/ether.h>
307 # Some might have it and declare it in <sys/ethernet.h>.
308 # Some might have it and declare it in <arpa/inet.h>.
309 # Some might have it and declare it in <netinet/if_ether.h>.
310 # Some might have it and not declare it in any header file.
311 #
312 # Before you is a C compiler.
313 #
314 AC_CHECK_FUNCS(ether_hostton)
315 if test "$ac_cv_func_ether_hostton" = yes; then
316 #
317 # OK, we have ether_hostton(). Is it declared in <net/ethernet.h>?
318 #
319 # This test fails if we don't have <net/ethernet.h> or if we do
320 # but it doesn't declare ether_hostton().
321 #
322 AC_CHECK_DECL(ether_hostton,
323 [
324 AC_DEFINE(NET_ETHERNET_H_DECLARES_ETHER_HOSTTON,,
325 [Define to 1 if net/ethernet.h declares `ether_hostton'])
326 ],,
327 [
328 #include <net/ethernet.h>
329 ])
330 #
331 # Did that succeed?
332 #
333 if test "$ac_cv_have_decl_ether_hostton" != yes; then
334 #
335 # No, how about <netinet/ether.h>, as on Linux?
336 #
337 # This test fails if we don't have <netinet/ether.h>
338 # or if we do but it doesn't declare ether_hostton().
339 #
340 # Unset ac_cv_have_decl_ether_hostton so we don't
341 # treat the previous failure as a cached value and
342 # suppress the next test.
343 #
344 unset ac_cv_have_decl_ether_hostton
345 AC_CHECK_DECL(ether_hostton,
346 [
347 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON,,
348 [Define to 1 if netinet/ether.h declares `ether_hostton'])
349 ],,
350 [
351 #include <netinet/ether.h>
352 ])
353 fi
354 #
355 # Did that succeed?
356 #
357 if test "$ac_cv_have_decl_ether_hostton" != yes; then
358 #
359 # No, how about <sys/ethernet.h>, as on Solaris 10
360 # and later?
361 #
362 # This test fails if we don't have <sys/ethernet.h>
363 # or if we do but it doesn't declare ether_hostton().
364 #
365 # Unset ac_cv_have_decl_ether_hostton so we don't
366 # treat the previous failure as a cached value and
367 # suppress the next test.
368 #
369 unset ac_cv_have_decl_ether_hostton
370 AC_CHECK_DECL(ether_hostton,
371 [
372 AC_DEFINE(SYS_ETHERNET_H_DECLARES_ETHER_HOSTTON,,
373 [Define to 1 if sys/ethernet.h declares `ether_hostton'])
374 ],,
375 [
376 #include <sys/ethernet.h>
377 ])
378 fi
379 #
380 # Did that succeed?
381 #
382 if test "$ac_cv_have_decl_ether_hostton" != yes; then
383 #
384 # No, how about <arpa/inet.h>, as in AIX?
385 #
386 # This test fails if we don't have <arpa/inet.h>
387 # (if we have ether_hostton(), we should have
388 # networking, and if we have networking, we should
389 # have <arapa/inet.h>) or if we do but it doesn't
390 # declare ether_hostton().
391 #
392 # Unset ac_cv_have_decl_ether_hostton so we don't
393 # treat the previous failure as a cached value and
394 # suppress the next test.
395 #
396 unset ac_cv_have_decl_ether_hostton
397 AC_CHECK_DECL(ether_hostton,
398 [
399 AC_DEFINE(ARPA_INET_H_DECLARES_ETHER_HOSTTON,,
400 [Define to 1 if arpa/inet.h declares `ether_hostton'])
401 ],,
402 [
403 #include <arpa/inet.h>
404 ])
405 fi
406 #
407 # Did that succeed?
408 #
409 if test "$ac_cv_have_decl_ether_hostton" != yes; then
410 #
411 # No, how about <netinet/if_ether.h>?
412 # On some platforms, it requires <net/if.h> and
413 # <netinet/in.h>, and we always include it with
414 # both of them, so test it with both of them.
415 #
416 # This test fails if we don't have <netinet/if_ether.h>
417 # and the headers we include before it, or if we do but
418 # <netinet/if_ether.h> doesn't declare ether_hostton().
419 #
420 # Unset ac_cv_have_decl_ether_hostton so we don't
421 # treat the previous failure as a cached value and
422 # suppress the next test.
423 #
424 unset ac_cv_have_decl_ether_hostton
425 AC_CHECK_DECL(ether_hostton,
426 [
427 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON,,
428 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
429 ],,
430 [
431 #include <sys/types.h>
432 #include <sys/socket.h>
433 #include <net/if.h>
434 #include <netinet/in.h>
435 #include <netinet/if_ether.h>
436 ])
437 fi
438 #
439 # After all that, is ether_hostton() declared?
440 #
441 if test "$ac_cv_have_decl_ether_hostton" = yes; then
442 #
443 # Yes.
444 #
445 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
446 [Define to 1 if you have the declaration of `ether_hostton'])
447 else
448 #
449 # No, we'll have to declare it ourselves.
450 # Do we have "struct ether_addr" if we include
451 # <netinet/if_ether.h>?
452 #
453 AC_CHECK_TYPES(struct ether_addr,,,
454 [
455 #include <sys/types.h>
456 #include <sys/socket.h>
457 #include <net/if.h>
458 #include <netinet/in.h>
459 #include <netinet/if_ether.h>
460 ])
461 fi
462 fi
463
464 #
465 # For various things that might use pthreads.
466 #
467 AC_CHECK_HEADER(pthread.h,
468 [
469 #
470 # OK, we have pthread.h. Do we have pthread_create in the
471 # system libraries?
472 #
473 AC_CHECK_FUNC(pthread_create,
474 [
475 #
476 # Yes.
477 #
478 ac_lbl_have_pthreads="found"
479 ],
480 [
481 #
482 # No - do we have it in -lpthreads?
483 #
484 AC_CHECK_LIB(pthreads, pthread_create,
485 [
486 #
487 # Yes - add -lpthreads.
488 #
489 ac_lbl_have_pthreads="found"
490 PTHREAD_LIBS="$PTHREAD_LIBS -lpthreads"
491 ],
492 [
493 #
494 # No - do we have it in -lpthread?
495 #
496 AC_CHECK_LIB(pthread, pthread_create,
497 [
498 #
499 # Yes - add -lpthread.
500 #
501 ac_lbl_have_pthreads="found"
502 PTHREAD_LIBS="$PTHREAD_LIBS -lpthread"
503 ],
504 [
505 #
506 # No.
507 #
508 ac_lbl_have_pthreads="not found"
509 ])
510 ])
511 ])
512 ],
513 [
514 #
515 # We didn't find pthread.h.
516 #
517 ac_lbl_have_pthreads="not found"
518 ]
519 )
520
521 dnl to pacify those who hate protochain insn
522 AC_MSG_CHECKING(if --disable-protochain option is specified)
523 AC_ARG_ENABLE(protochain,
524 AC_HELP_STRING([--disable-protochain],[disable \"protochain\" insn]))
525 case "x$enable_protochain" in
526 xyes) enable_protochain=enabled ;;
527 xno) enable_protochain=disabled ;;
528 x) enable_protochain=enabled ;;
529 esac
530
531 if test "$enable_protochain" = "disabled"; then
532 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
533 fi
534 AC_MSG_RESULT(${enable_protochain})
535
536 #
537 # valgrindtest directly uses the native capture mechanism, but
538 # only tests with BPF and PF_PACKET sockets; only enable it if
539 # we have BPF or PF_PACKET sockets.
540 #
541 VALGRINDTEST_SRC=
542
543 AC_ARG_WITH(pcap,
544 AC_HELP_STRING([--with-pcap=TYPE],[use packet capture TYPE]))
545 if test ! -z "$with_pcap" ; then
546 V_PCAP="$withval"
547 else
548 #
549 # Check for a bunch of headers for various packet
550 # capture mechanisms.
551 #
552 AC_CHECK_HEADERS(net/bpf.h)
553 if test "$ac_cv_header_net_bpf_h" = yes; then
554 #
555 # Does it define BIOCSETIF?
556 # I.e., is it a header for an LBL/BSD-style capture
557 # mechanism, or is it just a header for a BPF filter
558 # engine? Some versions of Arch Linux, for example,
559 # have a net/bpf.h that doesn't define BIOCSETIF;
560 # as it's a Linux, it should use packet sockets,
561 # instead.
562 #
563 # We need:
564 #
565 # sys/types.h, because FreeBSD 10's net/bpf.h
566 # requires that various BSD-style integer types
567 # be defined;
568 #
569 # sys/time.h, because AIX 5.2 and 5.3's net/bpf.h
570 # doesn't include it but does use struct timeval
571 # in ioctl definitions;
572 #
573 # sys/ioctl.h and, if we have it, sys/ioccom.h,
574 # because net/bpf.h defines ioctls;
575 #
576 # net/if.h, because it defines some structures
577 # used in ioctls defined by net/bpf.h;
578 #
579 # sys/socket.h, because OpenBSD 5.9's net/bpf.h
580 # defines some structure fields as being
581 # struct sockaddrs;
582 #
583 # and net/bpf.h doesn't necessarily include all
584 # of those headers itself.
585 #
586 AC_MSG_CHECKING(if net/bpf.h defines BIOCSETIF)
587 AC_CACHE_VAL(ac_cv_lbl_bpf_h_defines_biocsetif,
588 AC_TRY_COMPILE(
589 [
590 #include <sys/types.h>
591 #include <sys/time.h>
592 #include <sys/ioctl.h>
593 #include <sys/socket.h>
594 #ifdef HAVE_SYS_IOCCOM_H
595 #include <sys/ioccom.h>
596 #endif
597 #include <net/bpf.h>
598 #include <net/if.h>
599 ],
600 [u_int i = BIOCSETIF;],
601 ac_cv_lbl_bpf_h_defines_biocsetif=yes,
602 ac_cv_lbl_bpf_h_defines_biocsetif=no))
603 AC_MSG_RESULT($ac_cv_lbl_bpf_h_defines_biocsetif)
604 fi
605 AC_CHECK_HEADERS(net/pfilt.h net/enet.h)
606 AC_CHECK_HEADERS(net/nit.h sys/net/nit.h)
607 AC_CHECK_HEADERS(linux/socket.h net/raw.h sys/dlpi.h)
608
609 if test "$ac_cv_lbl_bpf_h_defines_biocsetif" = yes; then
610 #
611 # BPF.
612 # Check this before DLPI, so that we pick BPF on
613 # Solaris 11 and later.
614 #
615 V_PCAP=bpf
616
617 #
618 # We have BPF, so build valgrindtest with "make test"
619 # on macOS and FreeBSD (add your OS once there's a
620 # valgrind for it).
621 #
622 case "$host_os" in
623
624 freebsd*|darwin*|linux*)
625 VALGRINDTEST_SRC=valgrindtest.c
626 ;;
627 esac
628 elif test "$ac_cv_header_linux_socket_h" = yes; then
629 #
630 # No prizes for guessing this one.
631 #
632 V_PCAP=linux
633
634 #
635 # XXX - this won't work with older kernels that have
636 # SOCK_PACKET sockets but not PF_PACKET sockets.
637 #
638 VALGRINDTEST_SRC=valgrindtest.c
639 elif test "$ac_cv_header_net_pfilt_h" = yes; then
640 #
641 # DEC OSF/1, Digital UNIX, Tru64 UNIX
642 #
643 V_PCAP=pf
644 elif test "$ac_cv_header_net_enet_h" = yes; then
645 #
646 # Stanford Enetfilter.
647 #
648 V_PCAP=enet
649 elif test "$ac_cv_header_net_nit_h" = yes; then
650 #
651 # SunOS 4.x STREAMS NIT.
652 #
653 V_PCAP=snit
654 elif test "$ac_cv_header_sys_net_nit_h" = yes; then
655 #
656 # Pre-SunOS 4.x non-STREAMS NIT.
657 #
658 V_PCAP=nit
659 elif test "$ac_cv_header_net_raw_h" = yes; then
660 #
661 # IRIX snoop.
662 #
663 V_PCAP=snoop
664 elif test "$ac_cv_header_sys_dlpi_h" = yes; then
665 #
666 # DLPI on pre-Solaris 11 SunOS 5, HP-UX, possibly others.
667 #
668 V_PCAP=dlpi
669 else
670 #
671 # Nothing we support.
672 #
673 V_PCAP=null
674 AC_MSG_WARN(cannot determine packet capture interface)
675 AC_MSG_WARN((see the INSTALL doc for more info))
676 fi
677 fi
678 AC_MSG_CHECKING(packet capture type)
679 AC_MSG_RESULT($V_PCAP)
680 AC_SUBST(VALGRINDTEST_SRC)
681
682 #
683 # Do capture-mechanism-dependent tests.
684 #
685 case "$V_PCAP" in
686 dlpi)
687 #
688 # Needed for common functions used by pcap-[dlpi,libdlpi].c
689 #
690 SSRC="dlpisubs.c"
691
692 #
693 # Checks for some header files.
694 #
695 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
696
697 #
698 # Checks to see if Solaris has the public libdlpi(3LIB) library.
699 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
700 # public libdlpi(3LIB) version. Before libdlpi was made public, a
701 # private version also existed, which did not have the same APIs.
702 # Due to a gcc bug, the default search path for 32-bit libraries does
703 # not include /lib, we add it explicitly here.
704 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
705 # Also, due to the bug above applications that link to libpcap with
706 # libdlpi will have to add "-L/lib" option to "configure".
707 #
708 saved_ldflags=$LDFLAGS
709 LDFLAGS="$LIBS -L/lib"
710 AC_CHECK_LIB(dlpi, dlpi_walk,
711 [
712 LIBS="-ldlpi $LIBS"
713 V_PCAP=libdlpi
714 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists])
715 ],
716 V_PCAP=dlpi)
717 LDFLAGS=$saved_ldflags
718
719 #
720 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
721 # versions of DLPI.
722 #
723 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
724 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
725 AC_TRY_COMPILE(
726 [
727 #include <sys/types.h>
728 #include <sys/time.h>
729 #include <sys/dlpi.h>
730 ],
731 [int i = DL_PROMISC_PHYS;],
732 ac_cv_sys_dlpi_usable=yes,
733 ac_cv_sys_dlpi_usable=no))
734 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
735 if test $ac_cv_sys_dlpi_usable = no ; then
736 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
737 fi
738
739 #
740 # Check to see if Solaris has the dl_passive_req_t struct defined
741 # in <sys/dlpi.h>.
742 # This check is for DLPI support for passive modes.
743 # See dlpi(7P) for more details.
744 #
745 AC_CHECK_TYPES(dl_passive_req_t,,,
746 [
747 #include <sys/types.h>
748 #include <sys/dlpi.h>
749 ])
750 ;;
751
752 linux)
753 #
754 # Do we have the wireless extensions?
755 #
756 AC_CHECK_HEADERS(linux/wireless.h, [], [],
757 [
758 #include <sys/socket.h>
759 #include <linux/if.h>
760 #include <linux/types.h>
761 ])
762
763 #
764 # Do we have libnl?
765 #
766 AC_ARG_WITH(libnl,
767 AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
768 with_libnl=$withval,with_libnl=if_available)
769
770 if test x$with_libnl != xno ; then
771 have_any_nl="no"
772
773 incdir=-I/usr/include/libnl3
774 libnldir=
775 case "$with_libnl" in
776
777 yes|if_available)
778 ;;
779
780 *)
781 if test -d $withval; then
782 libnldir=-L${withval}/lib/.libs
783 incdir=-I${withval}/include
784 fi
785 ;;
786 esac
787
788 #
789 # Try libnl 3.x first.
790 #
791 AC_CHECK_LIB(nl-3, nl_socket_alloc,
792 [
793 #
794 # Yes, we have libnl 3.x.
795 #
796 LIBS="${libnldir} -lnl-genl-3 -lnl-3 $LIBS"
797 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
798 AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x])
799 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
800 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
801 V_INCLS="$V_INCLS ${incdir}"
802 have_any_nl="yes"
803 ],[], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
804
805 if test x$have_any_nl = xno ; then
806 #
807 # Try libnl 2.x
808 #
809 AC_CHECK_LIB(nl, nl_socket_alloc,
810 [
811 #
812 # Yes, we have libnl 2.x.
813 #
814 LIBS="${libnldir} -lnl-genl -lnl $LIBS"
815 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
816 AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x])
817 AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE])
818 AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api])
819 have_any_nl="yes"
820 ])
821 fi
822
823 if test x$have_any_nl = xno ; then
824 #
825 # No, we don't; do we have libnl 1.x?
826 #
827 AC_CHECK_LIB(nl, nl_handle_alloc,
828 [
829 #
830 # Yes.
831 #
832 LIBS="${libnldir} -lnl $LIBS"
833 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
834 have_any_nl="yes"
835 ])
836 fi
837
838 if test x$have_any_nl = xno ; then
839 #
840 # No, we don't have libnl at all.
841 #
842 if test x$with_libnl = xyes ; then
843 AC_MSG_ERROR([libnl support requested but libnl not found])
844 fi
845 fi
846 fi
847
848 AC_CHECK_HEADERS(linux/ethtool.h,,,
849 [
850 AC_INCLUDES_DEFAULT
851 #include <linux/types.h>
852 ])
853
854 #
855 # Check to see if struct tpacket_stats is defined in
856 # <linux/if_packet.h>. If so, then pcap-linux.c can use this
857 # to report proper statistics.
858 #
859 # -Scott Barron
860 #
861 AC_CHECK_TYPES(struct tpacket_stats,,,
862 [
863 #include <linux/if_packet.h>
864 ])
865
866 #
867 # Check to see if the tpacket_auxdata struct has a tp_vlan_tci member.
868 #
869 # NOTE: any failure means we conclude that it doesn't have that
870 # member, so if we don't have tpacket_auxdata, we conclude it
871 # doesn't have that member (which is OK, as either we won't be
872 # using code that would use that member, or we wouldn't compile
873 # in any case).
874 AC_CHECK_MEMBERS([struct tpacket_auxdata.tp_vlan_tci],,,
875 [
876 #include <sys/types.h>
877 #include <linux/if_packet.h>
878 ])
879 ;;
880
881 bpf)
882 #
883 # Check whether we have the *BSD-style ioctls.
884 #
885 AC_CHECK_HEADERS(net/if_media.h)
886
887 #
888 # Check whether we have struct BPF_TIMEVAL.
889 #
890 AC_CHECK_TYPES(struct BPF_TIMEVAL,,,
891 [
892 #include <sys/types.h>
893 #include <sys/ioctl.h>
894 #ifdef HAVE_SYS_IOCCOM_H
895 #include <sys/ioccom.h>
896 #endif
897 #include <net/bpf.h>
898 ])
899 ;;
900
901 dag)
902 #
903 # --with-pcap=dag is the only way to get here, and it means
904 # "DAG support but nothing else"
905 #
906 V_DEFS="$V_DEFS -DDAG_ONLY"
907 xxx_only=yes
908 ;;
909
910 dpdk)
911 #
912 # --with-pcap=dpdk is the only way to get here, and it means
913 # "DPDK support but nothing else"
914 #
915 V_DEFS="$V_DEFS -DDPDK_ONLY"
916 xxx_only=yes
917 ;;
918
919 septel)
920 #
921 # --with-pcap=septel is the only way to get here, and it means
922 # "Septel support but nothing else"
923 #
924 V_DEFS="$V_DEFS -DSEPTEL_ONLY"
925 xxx_only=yes
926 ;;
927
928 snf)
929 #
930 # --with-pcap=snf is the only way to get here, and it means
931 # "SNF support but nothing else"
932 #
933 V_DEFS="$V_DEFS -DSNF_ONLY"
934 xxx_only=yes
935 ;;
936
937 null)
938 ;;
939
940 *)
941 AC_MSG_ERROR($V_PCAP is not a valid pcap type)
942 ;;
943 esac
944
945 dnl
946 dnl Now figure out how we get a list of interfaces and addresses,
947 dnl if we support capturing. Don't bother if we don't support
948 dnl capturing.
949 dnl
950 if test "$V_PCAP" != null
951 then
952 AC_CHECK_FUNC(getifaddrs,[
953 #
954 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
955 # as well, just in case some platform is really weird.
956 #
957 AC_CHECK_HEADER(ifaddrs.h,[
958 #
959 # We have the header, so we use "getifaddrs()" to
960 # get the list of interfaces.
961 #
962 V_FINDALLDEVS=fad-getad.c
963 ],[
964 #
965 # We don't have the header - give up.
966 # XXX - we could also fall back on some other
967 # mechanism, but, for now, this'll catch this
968 # problem so that we can at least try to figure
969 # out something to do on systems with "getifaddrs()"
970 # but without "ifaddrs.h", if there is something
971 # we can do on those systems.
972 #
973 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
974 ])
975 ],[
976 #
977 # Well, we don't have "getifaddrs()", at least not with the
978 # libraries with which we've decided we need to link
979 # libpcap with, so we have to use some other mechanism.
980 #
981 # Note that this may happen on Solaris, which has
982 # getifaddrs(), but in -lsocket, not in -lxnet, so we
983 # won't find it if we link with -lxnet, which we want
984 # to do for other reasons.
985 #
986 # For now, we use either the SIOCGIFCONF ioctl or the
987 # SIOCGLIFCONF ioctl, preferring the latter if we have
988 # it; the latter is a Solarisism that first appeared
989 # in Solaris 8. (Solaris's getifaddrs() appears to
990 # be built atop SIOCGLIFCONF; using it directly
991 # avoids a not-all-that-useful middleman.)
992 #
993 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
994 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
995 AC_TRY_COMPILE(
996 [#include <sys/param.h>
997 #include <sys/file.h>
998 #include <sys/ioctl.h>
999 #include <sys/socket.h>
1000 #include <sys/sockio.h>],
1001 [ioctl(0, SIOCGLIFCONF, (char *)0);],
1002 ac_cv_lbl_have_siocglifconf=yes,
1003 ac_cv_lbl_have_siocglifconf=no))
1004 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
1005 if test $ac_cv_lbl_have_siocglifconf = yes ; then
1006 V_FINDALLDEVS=fad-glifc.c
1007 else
1008 V_FINDALLDEVS=fad-gifc.c
1009 fi
1010 ])
1011 fi
1012
1013 dnl check for hardware timestamp support
1014 case "$host_os" in
1015 linux*)
1016 AC_CHECK_HEADERS([linux/net_tstamp.h])
1017 ;;
1018 *)
1019 AC_MSG_NOTICE(no hardware timestamp support implemented for $host_os)
1020 ;;
1021 esac
1022
1023 AC_ARG_ENABLE([packet-ring],
1024 [AC_HELP_STRING([--enable-packet-ring],[enable packet ring support on Linux @<:@default=yes@:>@])],
1025 ,enable_packet_ring=yes)
1026
1027 if test "x$enable_packet_ring" != "xno" ; then
1028 AC_DEFINE(PCAP_SUPPORT_PACKET_RING, 1, [use packet ring capture support on Linux if available])
1029 AC_SUBST(PCAP_SUPPORT_PACKET_RING)
1030 fi
1031
1032 #
1033 # Check for socklen_t.
1034 #
1035 AC_CHECK_TYPES(socklen_t,,,
1036 [
1037 #include <sys/types.h>
1038 #include <sys/socket.h>
1039 ])
1040
1041 AC_ARG_ENABLE(ipv6,
1042 AC_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes@:>@]),
1043 [],
1044 [enable_ipv6=yes])
1045 if test "$enable_ipv6" != "no"; then
1046 #
1047 # We've already made sure we have getaddrinfo above in
1048 # AC_LBL_LIBRARY_NET.
1049 #
1050 AC_DEFINE(INET6,1,[IPv6])
1051 fi
1052
1053 #
1054 # Do we have pkg-config?
1055 #
1056 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])
1057
1058 # Check for Endace DAG card support.
1059 AC_ARG_WITH([dag],
1060 AC_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1061 [
1062 if test "$withval" = no
1063 then
1064 # User doesn't want DAG support.
1065 want_dag=no
1066 elif test "$withval" = yes
1067 then
1068 # User wants DAG support but hasn't specified a directory.
1069 want_dag=yes
1070 else
1071 # User wants DAG support and has specified a directory, so use the provided value.
1072 want_dag=yes
1073 dag_root=$withval
1074 fi
1075 ],[
1076 if test "$V_PCAP" = dag; then
1077 # User requested DAG-only libpcap, so we'd better have
1078 # the DAG API.
1079 want_dag=yes
1080 elif test "xxx_only" = yes; then
1081 # User requested something-else-only pcap, so they don't
1082 # want DAG support.
1083 want_dag=no
1084 else
1085 #
1086 # Use DAG API if present, otherwise don't
1087 #
1088 want_dag=ifpresent
1089 fi
1090 ])
1091
1092 AC_ARG_WITH([dag-includes],
1093 AC_HELP_STRING([--with-dag-includes=IDIR],[Endace DAG include directory, if not DIR/include]),
1094 [
1095 # User wants DAG support and has specified a header directory, so use the provided value.
1096 want_dag=yes
1097 dag_include_dir=$withval
1098 ],[])
1099
1100 AC_ARG_WITH([dag-libraries],
1101 AC_HELP_STRING([--with-dag-libraries=LDIR],[Endace DAG library directory, if not DIR/lib]),
1102 [
1103 # User wants DAG support and has specified a library directory, so use the provided value.
1104 want_dag=yes
1105 dag_lib_dir=$withval
1106 ],[])
1107
1108 if test "$want_dag" != no; then
1109
1110 # If necessary, set default paths for DAG API headers and libraries.
1111 if test -z "$dag_root"; then
1112 dag_root=/usr/local
1113 fi
1114
1115 if test -z "$dag_include_dir"; then
1116 dag_include_dir="$dag_root/include"
1117 fi
1118
1119 if test -z "$dag_lib_dir"; then
1120 dag_lib_dir="$dag_root/lib"
1121 fi
1122
1123 V_INCLS="$V_INCLS -I$dag_include_dir"
1124
1125 AC_CHECK_HEADERS([dagapi.h])
1126
1127 if test "$ac_cv_header_dagapi_h" = yes; then
1128
1129 if test $V_PCAP != dag ; then
1130 MSRC="$MSRC pcap-dag.c"
1131 fi
1132
1133 # Check for various DAG API functions.
1134 # Don't need to save and restore LIBS to prevent -ldag being
1135 # included if there's a found-action (arg 3).
1136 saved_ldflags=$LDFLAGS
1137 LDFLAGS="-L$dag_lib_dir"
1138 AC_CHECK_LIB([dag], [dag_attach_stream],
1139 [],
1140 [AC_MSG_ERROR(DAG library lacks streams support)])
1141 AC_CHECK_LIB([dag], [dag_attach_stream64], [dag_large_streams="1"], [dag_large_streams="0"])
1142 AC_CHECK_LIB([dag],[dag_get_erf_types], [
1143 AC_DEFINE(HAVE_DAG_GET_ERF_TYPES, 1, [define if you have dag_get_erf_types()])])
1144 AC_CHECK_LIB([dag],[dag_get_stream_erf_types], [
1145 AC_DEFINE(HAVE_DAG_GET_STREAM_ERF_TYPES, 1, [define if you have dag_get_stream_erf_types()])])
1146
1147 LDFLAGS=$saved_ldflags
1148
1149 #
1150 # We assume that if we have libdag we have libdagconf,
1151 # as they're installed at the same time from the same
1152 # package.
1153 #
1154 LIBS="$LIBS -ldag -ldagconf"
1155 LDFLAGS="$LDFLAGS -L$dag_lib_dir"
1156
1157 if test "$dag_large_streams" = 1; then
1158 AC_DEFINE(HAVE_DAG_LARGE_STREAMS_API, 1, [define if you have large streams capable DAG API])
1159 AC_CHECK_LIB([vdag],[vdag_set_device_info], [ac_dag_have_vdag="1"], [ac_dag_have_vdag="0"])
1160 if test "$ac_dag_have_vdag" = 1; then
1161 AC_DEFINE(HAVE_DAG_VDAG, 1, [define if you have vdag_set_device_info()])
1162 if test "$ac_lbl_have_pthreads" != "found"; then
1163 AC_MSG_ERROR([DAG requires pthreads, but we didn't find them])
1164 fi
1165 LIBS="$LIBS $PTHREAD_LIBS"
1166 fi
1167 fi
1168
1169 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
1170 else
1171
1172 if test "$V_PCAP" = dag; then
1173 # User requested "dag" capture type but we couldn't
1174 # find the DAG API support.
1175 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])
1176 fi
1177
1178 if test "$want_dag" = yes; then
1179 # User wanted DAG support but we couldn't find it.
1180 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])
1181 fi
1182 fi
1183 fi
1184
1185 AC_ARG_WITH(septel,
1186 AC_HELP_STRING([--with-septel@<:@=DIR@:>@],[include Septel support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1187 [
1188 if test "$withval" = no
1189 then
1190 want_septel=no
1191 elif test "$withval" = yes
1192 then
1193 want_septel=yes
1194 septel_root=
1195 else
1196 want_septel=yes
1197 septel_root=$withval
1198 fi
1199 ],[
1200 if test "$V_PCAP" = septel; then
1201 # User requested Septel-only libpcap, so we'd better have
1202 # the Septel API.
1203 want_septel=yes
1204 elif test "xxx_only" = yes; then
1205 # User requested something-else-only pcap, so they don't
1206 # want Septel support.
1207 want_septel=no
1208 else
1209 #
1210 # Use Septel API if present, otherwise don't
1211 #
1212 want_septel=ifpresent
1213 fi
1214 ])
1215
1216 ac_cv_lbl_septel_api=no
1217 if test "$with_septel" != no; then
1218
1219 AC_MSG_CHECKING([whether we have Septel API headers])
1220
1221 # If necessary, set default paths for Septel API headers and libraries.
1222 if test -z "$septel_root"; then
1223 septel_root=$srcdir/../septel
1224 fi
1225
1226 septel_tools_dir="$septel_root"
1227 septel_include_dir="$septel_root/INC"
1228
1229 if test -r "$septel_include_dir/msg.h"; then
1230 ac_cv_lbl_septel_api=yes
1231 fi
1232
1233 if test "$ac_cv_lbl_septel_api" = yes; then
1234 AC_MSG_RESULT([yes ($septel_include_dir)])
1235
1236 V_INCLS="$V_INCLS -I$septel_include_dir"
1237 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"
1238 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"
1239
1240 if test "$V_PCAP" != septel ; then
1241 MSRC="$MSRC pcap-septel.c"
1242 fi
1243
1244 AC_DEFINE(HAVE_SEPTEL_API, 1, [define if you have the Septel API])
1245 else
1246 AC_MSG_RESULT(no)
1247
1248 if test "$V_PCAP" = septel; then
1249 # User requested "septel" capture type but
1250 # we couldn't find the Septel API support.
1251 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])
1252 fi
1253
1254 if test "$want_septel" = yes; then
1255 # User wanted Septel support but we couldn't find it.
1256 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])
1257 fi
1258 fi
1259 fi
1260
1261 # Check for Myricom SNF support.
1262 AC_ARG_WITH([snf],
1263 AC_HELP_STRING([--with-snf@<:@=DIR@:>@],[include Myricom SNF support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1264 [
1265 if test "$withval" = no
1266 then
1267 # User explicitly doesn't want SNF
1268 want_snf=no
1269 elif test "$withval" = yes
1270 then
1271 # User wants SNF support but hasn't specified a directory.
1272 want_snf=yes
1273 else
1274 # User wants SNF support with a specified directory.
1275 want_snf=yes
1276 snf_root=$withval
1277 fi
1278 ],[
1279 if test "$V_PCAP" = snf; then
1280 # User requested Sniffer-only libpcap, so we'd better have
1281 # the Sniffer API.
1282 want_snf=yes
1283 elif test "xxx_only" = yes; then
1284 # User requested something-else-only pcap, so they don't
1285 # want SNF support.
1286 want_snf=no
1287 else
1288 #
1289 # Use Sniffer API if present, otherwise don't
1290 #
1291 want_snf=ifpresent
1292 fi
1293 ])
1294
1295 AC_ARG_WITH([snf-includes],
1296 AC_HELP_STRING([--with-snf-includes=IDIR],[Myricom SNF include directory, if not DIR/include]),
1297 [
1298 # User wants SNF with specific header directory
1299 want_snf=yes
1300 snf_include_dir=$withval
1301 ],[])
1302
1303 AC_ARG_WITH([snf-libraries],
1304 AC_HELP_STRING([--with-snf-libraries=LDIR],[Myricom SNF library directory, if not DIR/lib]),
1305 [
1306 # User wants SNF with specific lib directory
1307 want_snf=yes
1308 snf_lib_dir=$withval
1309 ],[])
1310
1311 ac_cv_lbl_snf_api=no
1312 if test "$with_snf" != no; then
1313
1314 AC_MSG_CHECKING(whether we have Myricom Sniffer API)
1315
1316 # If necessary, set default paths for Sniffer headers and libraries.
1317 if test -z "$snf_root"; then
1318 snf_root=/opt/snf
1319 fi
1320
1321 if test -z "$snf_include_dir"; then
1322 snf_include_dir="$snf_root/include"
1323 fi
1324
1325 if test -z "$snf_lib_dir"; then
1326 snf_lib_dir="$snf_root/lib"
1327 fi
1328
1329 if test -f "$snf_include_dir/snf.h"; then
1330 # We found a header; make sure we can link with the library
1331 saved_ldflags=$LDFLAGS
1332 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1333 AC_CHECK_LIB([snf], [snf_init], [ac_cv_lbl_snf_api="yes"])
1334 LDFLAGS="$saved_ldflags"
1335 if test "$ac_cv_lbl_snf_api" = no; then
1336 AC_MSG_ERROR(SNF API cannot correctly be linked; check config.log)
1337 fi
1338 fi
1339
1340 if test "$ac_cv_lbl_snf_api" = yes; then
1341 AC_MSG_RESULT([yes ($snf_root)])
1342
1343 V_INCLS="$V_INCLS -I$snf_include_dir"
1344 LIBS="$LIBS -lsnf"
1345 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1346
1347 if test "$V_PCAP" != snf ; then
1348 MSRC="$MSRC pcap-snf.c"
1349 fi
1350
1351 AC_DEFINE(HAVE_SNF_API, 1, [define if you have the Myricom SNF API])
1352 else
1353 AC_MSG_RESULT(no)
1354
1355 if test "$want_snf" = yes; then
1356 # User requested "snf" capture type but
1357 # we couldn't find the Sniffer API support.
1358 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])
1359 fi
1360
1361 if test "$want_snf" = yes; then
1362 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])
1363 fi
1364 fi
1365 fi
1366
1367 # Check for Riverbed TurboCap support.
1368 AC_ARG_WITH([turbocap],
1369 AC_HELP_STRING([--with-turbocap@<:@=DIR@:>@],[include Riverbed TurboCap support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1370 [
1371 if test "$withval" = no
1372 then
1373 # User explicitly doesn't want TurboCap
1374 want_turbocap=no
1375 elif test "$withval" = yes
1376 then
1377 # User wants TurboCap support but hasn't specified a directory.
1378 want_turbocap=yes
1379 else
1380 # User wants TurboCap support with a specified directory.
1381 want_turbocap=yes
1382 turbocap_root=$withval
1383 fi
1384 ],[
1385 if test "xxx_only" = yes; then
1386 # User requested something-else-only pcap, so they don't
1387 # want TurboCap support.
1388 want_turbocap=no
1389 else
1390 #
1391 # Use TurboCap API if present, otherwise don't
1392 #
1393 want_turbocap=ifpresent
1394 fi
1395 ])
1396
1397 ac_cv_lbl_turbocap_api=no
1398 if test "$want_turbocap" != no; then
1399
1400 AC_MSG_CHECKING(whether TurboCap is supported)
1401
1402 save_CFLAGS="$CFLAGS"
1403 save_LIBS="$LIBS"
1404 if test ! -z "$turbocap_root"; then
1405 TURBOCAP_CFLAGS="-I$turbocap_root/include"
1406 TURBOCAP_LIBS="-L$turbocap_root/lib"
1407 CFLAGS="$CFLAGS $TURBOCAP_CFLAGS"
1408 fi
1409
1410 AC_TRY_COMPILE(
1411 [
1412 #include <TcApi.h>
1413 ],
1414 [
1415 TC_INSTANCE a; TC_PORT b; TC_BOARD c;
1416 TC_INSTANCE i;
1417 (void)TcInstanceCreateByName("foo", &i);
1418 ],
1419 ac_cv_lbl_turbocap_api=yes)
1420
1421 CFLAGS="$save_CFLAGS"
1422 if test $ac_cv_lbl_turbocap_api = yes; then
1423 AC_MSG_RESULT(yes)
1424
1425 MSRC="$MSRC pcap-tc.c"
1426 V_INCLS="$V_INCLS $TURBOCAP_CFLAGS"
1427 LIBS="$LIBS $TURBOCAP_LIBS -lTcApi -lpthread -lstdc++"
1428
1429 AC_DEFINE(HAVE_TC_API, 1, [define if you have the TurboCap API])
1430 else
1431 AC_MSG_RESULT(no)
1432
1433 if test "$want_turbocap" = yes; then
1434 # User wanted Turbo support but we couldn't find it.
1435 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])
1436 fi
1437 fi
1438 fi
1439
1440 dnl
1441 dnl Allow the user to enable remote capture.
1442 dnl It's off by default, as that increases the attack surface of
1443 dnl libpcap, exposing it to malicious servers.
1444 dnl
1445 AC_MSG_CHECKING([whether to enable remote packet capture])
1446 AC_ARG_ENABLE(remote,
1447 [ --enable-remote enable remote packet capture @<:@default=no@:>@
1448 --disable-remote disable remote packet capture],,
1449 enableval=no)
1450 case "$enableval" in
1451 yes) AC_MSG_RESULT(yes)
1452 AC_WARN([Remote packet capture may expose libpcap-based applications])
1453 AC_WARN([to attacks by malicious remote capture servers!])
1454 #
1455 # rpcapd requires pthreads on UN*X.
1456 #
1457 if test "$ac_lbl_have_pthreads" != "found"; then
1458 AC_MSG_ERROR([rpcapd requires pthreads, but we didn't find them])
1459 fi
1460 #
1461 # It also requires crypt().
1462 # Do we have it in the system libraries?
1463 #
1464 AC_CHECK_FUNC(crypt,,
1465 [
1466 #
1467 # No. Do we have it in -lcrypt?
1468 #
1469 AC_CHECK_LIB(crypt, crypt,
1470 [
1471 #
1472 # Yes; add -lcrypt to the libraries for rpcapd.
1473 #
1474 RPCAPD_LIBS="$RPCAPD_LIBS -lcrypt"
1475 ],
1476 [
1477 AC_MSG_ERROR([rpcapd requires crypt(), but we didn't find it])
1478 ])
1479 ])
1480
1481 #
1482 # OK, we have crypt(). Do we have getspnam()?
1483 #
1484 AC_CHECK_FUNCS(getspnam)
1485
1486 #
1487 # Check for various members of struct msghdr.
1488 #
1489 AC_CHECK_MEMBERS([struct msghdr.msg_control],,,
1490 [
1491 #include "ftmacros.h"
1492 #include <sys/socket.h>
1493 ])
1494 AC_CHECK_MEMBERS([struct msghdr.msg_flags],,,
1495 [
1496 #include "ftmacros.h"
1497 #include <sys/socket.h>
1498 ])
1499
1500 #
1501 # Optionally, we may want to support SSL.
1502 # Check for OpenSSL/libressl.
1503 #
1504 # First, try looking for it as a regular system library.
1505 # Make sure we can find SSL_library_init() using the
1506 # standard headers, just in case we're running a version
1507 # of macOS that ships with the OpenSSL library but not
1508 # the OpenSSL headers, and have also installed another
1509 # version of OpenSSL with headers.
1510 #
1511 save_LIBS="$LIBS"
1512 LIBS="-lssl -lcrypto"
1513 AC_MSG_CHECKING(whether we have a system OpenSSL/libressl that we can use)
1514 AC_TRY_LINK(
1515 [
1516 #include <openssl/ssl.h>
1517 ],
1518 [
1519 SSL_library_init();
1520 return 0;
1521 ],
1522 [
1523 AC_MSG_RESULT(yes)
1524 HAVE_OPENSSL=yes
1525 OPENSSL_LIBS="-lssl -lcrypto"
1526 ],
1527 AC_MSG_RESULT(no))
1528 LIBS="$save_LIBS"
1529
1530 #
1531 # If we didn't find it, check for it with pkg-config.
1532 #
1533 if test "x$HAVE_OPENSSL" != "xyes"; then
1534 if test "x$PKGCONFIG" != "xno"; then
1535 #
1536 # We have pkg-config; see if we have OpenSSL/
1537 # libressl installed as a package.
1538 #
1539 AC_MSG_CHECKING([for OpenSSL/libressl with pkg-config])
1540 if "$PKGCONFIG" openssl; then
1541 AC_MSG_RESULT([found])
1542 HAVE_OPENSSL=yes
1543 OPENSSL_CFLAGS=`"$PKGCONFIG" --cflags openssl`
1544 OPENSSL_LIBS=`"$PKGCONFIG" --libs openssl`
1545 else
1546 AC_MSG_RESULT([not found])
1547 fi
1548 fi
1549 fi
1550
1551 #
1552 # OK, did we find it?
1553 #
1554 if test "x$HAVE_OPENSSL" = "xyes"; then
1555 AC_DEFINE([HAVE_OPENSSL], [1], [Use OpenSSL])
1556 CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
1557 LIBS="$LIBS $OPENSSL_LIBS"
1558 else
1559 AC_MSG_NOTICE(OpenSSL not found)
1560 fi
1561
1562 AC_DEFINE(ENABLE_REMOTE,,
1563 [Define to 1 if remote packet capture is to be supported])
1564 MSRC="$MSRC pcap-new.c pcap-rpcap.c rpcap-protocol.c sockutils.c sslutils.c"
1565 BUILD_RPCAPD=build-rpcapd
1566 INSTALL_RPCAPD=install-rpcapd
1567 ;;
1568 *) AC_MSG_RESULT(no)
1569 ;;
1570 esac
1571
1572 AC_MSG_CHECKING(whether to build optimizer debugging code)
1573 AC_ARG_ENABLE(optimizer-dbg,
1574 AC_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
1575 if test "$enable_optimizer_dbg" = "yes"; then
1576 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
1577 fi
1578 AC_MSG_RESULT(${enable_optimizer_dbg-no})
1579
1580 AC_MSG_CHECKING(whether to build parser debugging code)
1581 AC_ARG_ENABLE(yydebug,
1582 AC_HELP_STRING([--enable-yydebug],[build parser debugging code]))
1583 if test "$enable_yydebug" = "yes"; then
1584 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
1585 fi
1586 AC_MSG_RESULT(${enable_yydebug-no})
1587
1588 #
1589 # Look for {f}lex.
1590 #
1591 AC_PROG_LEX
1592 if test "$LEX" = ":"; then
1593 AC_MSG_ERROR([Neither flex nor lex was found.])
1594 fi
1595
1596 #
1597 # Make sure {f}lex supports the -P, --header-file, and --nounput flags
1598 # and supports processing our scanner.l.
1599 #
1600 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
1601 if $LEX -P pcap_ --header-file=/dev/null --nounput -t $srcdir/scanner.l > /dev/null 2>&1; then
1602 tcpdump_cv_capable_lex=yes
1603 else
1604 tcpdump_cv_capable_lex=insufficient
1605 fi)
1606 if test $tcpdump_cv_capable_lex = insufficient ; then
1607 AC_MSG_ERROR([$LEX is insufficient to compile libpcap.
1608 libpcap requires Flex 2.5.31 or later, or a compatible version of lex.])
1609 fi
1610
1611 #
1612 # Look for yacc/bison/byacc.
1613 #
1614 AC_PROG_YACC
1615
1616 #
1617 # Make sure it supports the -p flag and supports processing our
1618 # grammar.y.
1619 #
1620 AC_CACHE_CHECK([for capable yacc/bison], tcpdump_cv_capable_yacc,
1621 if $YACC -p pcap_ -o /dev/null $srcdir/grammar.y >/dev/null 2>&1; then
1622 tcpdump_cv_capable_yacc=yes
1623 else
1624 tcpdump_cv_capable_yacc=insufficient
1625 fi)
1626 if test $tcpdump_cv_capable_yacc = insufficient ; then
1627 AC_MSG_ERROR([$YACC is insufficient to compile libpcap.
1628 libpcap requires Bison, a newer version of Berkeley YACC with support
1629 for reentrant parsers, or another YACC compatible with them.])
1630 fi
1631
1632 #
1633 # Do various checks for various OSes and versions of those OSes.
1634 #
1635 # Assume, by default, no support for shared libraries and V7/BSD
1636 # convention for man pages (devices in section 4, file formats in
1637 # section 5, miscellaneous info in section 7, administrative commands
1638 # and daemons in section 8). Individual cases can override this.
1639 #
1640 DYEXT="none"
1641 MAN_DEVICES=4
1642 MAN_FILE_FORMATS=5
1643 MAN_MISC_INFO=7
1644 MAN_ADMIN_COMMANDS=8
1645 case "$host_os" in
1646
1647 aix*)
1648 dnl Workaround to enable certain features
1649 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
1650
1651 #
1652 # AIX makes it fun to build shared and static libraries,
1653 # because they're *both* ".a" archive libraries. We
1654 # build the static library for the benefit of the traditional
1655 # scheme of building libpcap and tcpdump in subdirectories of
1656 # the same directory, with tcpdump statically linked with the
1657 # libpcap in question, but we also build a shared library as
1658 # "libpcap.shareda" and install *it*, rather than the static
1659 # library, as "libpcap.a".
1660 #
1661 DYEXT="shareda"
1662
1663 case "$V_PCAP" in
1664
1665 dlpi)
1666 #
1667 # If we're using DLPI, applications will need to
1668 # use /lib/pse.exp if present, as we use the
1669 # STREAMS routines.
1670 #
1671 pseexe="/lib/pse.exp"
1672 AC_MSG_CHECKING(for $pseexe)
1673 if test -f $pseexe ; then
1674 AC_MSG_RESULT(yes)
1675 LIBS="-I:$pseexe"
1676 fi
1677 ;;
1678
1679 bpf)
1680 #
1681 # If we're using BPF, we need "-lodm" and "-lcfg", as
1682 # we use them to load the BPF module.
1683 #
1684 LIBS="-lodm -lcfg"
1685 ;;
1686 esac
1687 ;;
1688
1689 darwin*)
1690 DYEXT="dylib"
1691 V_CCOPT="$V_CCOPT -fno-common"
1692 AC_ARG_ENABLE(universal,
1693 AC_HELP_STRING([--disable-universal],[don't build universal on macOS]))
1694 if test "$enable_universal" != "no"; then
1695 case "$host_os" in
1696
1697 darwin[[0-7]].*)
1698 #
1699 # Pre-Tiger. Build only for 32-bit PowerPC; no
1700 # need for any special compiler or linker flags.
1701 #
1702 ;;
1703
1704 darwin8.[[0123]]|darwin8.[[0123]].*)
1705 #
1706 # Tiger, prior to Intel support. Build
1707 # libraries and executables for 32-bit PowerPC
1708 # and 64-bit PowerPC, with 32-bit PowerPC first.
1709 # (I'm guessing that's what Apple does.)
1710 #
1711 # (The double brackets are needed because
1712 # autotools/m4 use brackets as a quoting
1713 # character; the double brackets turn into
1714 # single brackets in the generated configure
1715 # file.)
1716 #
1717 V_LIB_CCOPT_FAT="-arch ppc -arch ppc64"
1718 V_LIB_LDFLAGS_FAT="-arch ppc -arch ppc64"
1719 V_PROG_CCOPT_FAT="-arch ppc -arch ppc64"
1720 V_PROG_LDFLAGS_FAT="-arch ppc -arch ppc64"
1721 ;;
1722
1723 darwin8.[[456]]|darwin.[[456]].*)
1724 #
1725 # Tiger, subsequent to Intel support but prior
1726 # to x86-64 support. Build libraries and
1727 # executables for 32-bit PowerPC, 64-bit
1728 # PowerPC, and 32-bit x86, with 32-bit PowerPC
1729 # first. (I'm guessing that's what Apple does.)
1730 #
1731 # (The double brackets are needed because
1732 # autotools/m4 use brackets as a quoting
1733 # character; the double brackets turn into
1734 # single brackets in the generated configure
1735 # file.)
1736 #
1737 V_LIB_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386"
1738 V_LIB_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386"
1739 V_PROG_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386"
1740 V_PROG_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386"
1741 ;;
1742
1743 darwin8.*)
1744 #
1745 # All other Tiger, so subsequent to x86-64
1746 # support. Build libraries and executables for
1747 # 32-bit PowerPC, 64-bit PowerPC, 32-bit x86,
1748 # and x86-64, with 32-bit PowerPC first. (I'm
1749 # guessing that's what Apple does.)
1750 #
1751 V_LIB_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
1752 V_LIB_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
1753 V_PROG_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
1754 V_PROG_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
1755 ;;
1756
1757 darwin9.*)
1758 #
1759 # Leopard. Build libraries for 32-bit PowerPC,
1760 # 64-bit PowerPC, 32-bit x86, and x86-64, with
1761 # 32-bit PowerPC first, and build executables
1762 # for 32-bit x86 and 32-bit PowerPC, with 32-bit
1763 # x86 first. (That's what Apple does.)
1764 #
1765 V_LIB_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
1766 V_LIB_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
1767 V_PROG_CCOPT_FAT="-arch i386 -arch ppc"
1768 V_PROG_LDFLAGS_FAT="-arch i386 -arch ppc"
1769 ;;
1770
1771 darwin10.*)
1772 #
1773 # Snow Leopard. Build libraries for x86-64,
1774 # 32-bit x86, and 32-bit PowerPC, with x86-64
1775 # first, and build executables for x86-64 and
1776 # 32-bit x86, with x86-64 first. (That's what
1777 # Apple does, even though Snow Leopard doesn't
1778 # run on PPC, so PPC libpcap runs under Rosetta,
1779 # and Rosetta doesn't support BPF ioctls, so PPC
1780 # programs can't do live captures.)
1781 #
1782 V_LIB_CCOPT_FAT="-arch x86_64 -arch i386 -arch ppc"
1783 V_LIB_LDFLAGS_FAT="-arch x86_64 -arch i386 -arch ppc"
1784 V_PROG_CCOPT_FAT="-arch x86_64 -arch i386"
1785 V_PROG_LDFLAGS_FAT="-arch x86_64 -arch i386"
1786 ;;
1787
1788 darwin*)
1789 #
1790 # Post-Snow Leopard. Build libraries for x86-64
1791 # and 32-bit x86, with x86-64 first, and build
1792 # executables only for x86-64. (That's what
1793 # Apple does.) This requires no special flags
1794 # for programs.
1795 # XXX - update if and when Apple drops support
1796 # for 32-bit x86 code and if and when Apple adds
1797 # ARM-based Macs. (You're on your own for iOS
1798 # etc.)
1799 #
1800 # XXX - check whether we *can* build for
1801 # i386 and, if not, suggest that the user
1802 # install the /usr/include headers if they
1803 # want to build fat.
1804 #
1805 AC_MSG_CHECKING(whether building for 32-bit x86 is supported)
1806 save_CFLAGS="$CFLAGS"
1807 CFLAGS="$CFLAGS -arch i386"
1808 AC_TRY_COMPILE(
1809 [],
1810 [return 0;],
1811 [
1812 AC_MSG_RESULT(yes)
1813 V_LIB_CCOPT_FAT="-arch x86_64"
1814 V_LIB_LDFLAGS_FAT="-arch x86_64"
1815
1816 #
1817 # OpenSSL installation on macOS seems
1818 # to install only the libs for 64-bit
1819 # x86 - at least that's what Brew does:
1820 # only configure 32-bit builds if we
1821 # don't have OpenSSL.
1822 #
1823 if test "$HAVE_OPENSSL" != yes; then
1824 V_LIB_CCOPT_FAT="$V_LIB_CCOPT_FAT -arch i386"
1825 V_LIB_LDFLAGS_FAT="$V_LIB_LDFLAGS_FAT -arch i386"
1826 fi
1827 ],
1828 [
1829 AC_MSG_RESULT(no)
1830 V_LIB_CCOPT_FAT="-arch x86_64"
1831 V_LIB_LDFLAGS_FAT="-arch x86_64"
1832 case "$host_os" in
1833
1834 darwin18.*)
1835 #
1836 # Mojave; you need to install the
1837 # /usr/include headers to get
1838 # 32-bit x86 builds to work.
1839 #
1840 AC_MSG_WARN([Compiling for 32-bit x86 gives an error; try installing the command-line tools and, after that, installing the /usr/include headers from the /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg package])
1841 ;;
1842
1843 *)
1844 #
1845 # Pre-Mojave; the command-line
1846 # tools should be sufficient to
1847 # enable 32-bit x86 builds.
1848 #
1849 AC_MSG_WARN([Compiling for 32-bit x86 gives an error; try installing the command-line tools])
1850 ;;
1851 esac
1852 ])
1853 CFLAGS="$save_CFLAGS"
1854 if test "$HAVE_OPENSSL" = yes; then
1855 #
1856 # If all else fails, look for OpenSSL in
1857 # /usr/local/opt.
1858 #
1859 CFLAGS="$CFLAGS -I/usr/local/opt/openssl/include"
1860 LIBS="$LIBS -L/usr/local/opt/openssl/lib"
1861 fi
1862 ;;
1863 esac
1864 fi
1865 ;;
1866
1867 hpux9*)
1868 AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
1869
1870 #
1871 # Use System V conventions for man pages.
1872 #
1873 MAN_ADMIN_COMMANDS=1m
1874 MAN_FILE_FORMATS=4
1875 MAN_MISC_INFO=5
1876 ;;
1877
1878 hpux10.0*)
1879
1880 #
1881 # Use System V conventions for man pages.
1882 #
1883 MAN_ADMIN_COMMANDS=1m
1884 MAN_FILE_FORMATS=4
1885 MAN_MISC_INFO=5
1886 ;;
1887
1888 hpux10.1*)
1889
1890 #
1891 # Use System V conventions for man pages.
1892 #
1893 MAN_ADMIN_COMMANDS=1m
1894 MAN_FILE_FORMATS=4
1895 MAN_MISC_INFO=5
1896 ;;
1897
1898 hpux*)
1899 dnl HPUX 10.20 and above is similar to HPUX 9, but
1900 dnl not the same....
1901 dnl
1902 dnl XXX - DYEXT should be set to "sl" if this is building
1903 dnl for 32-bit PA-RISC, but should be left as "so" for
1904 dnl 64-bit PA-RISC or, I suspect, IA-64.
1905 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
1906 if test "`uname -m`" = "ia64"; then
1907 DYEXT="so"
1908 else
1909 DYEXT="sl"
1910 fi
1911
1912 #
1913 # "-b" builds a shared library; "+h" sets the soname.
1914 #
1915 SHLIB_OPT="-b"
1916 SONAME_OPT="+h"
1917
1918 #
1919 # Use System V conventions for man pages.
1920 #
1921 MAN_FILE_FORMATS=4
1922 MAN_MISC_INFO=5
1923 ;;
1924
1925 irix*)
1926 #
1927 # Use IRIX conventions for man pages; they're the same as the
1928 # System V conventions, except that they use section 8 for
1929 # administrative commands and daemons.
1930 #
1931 MAN_FILE_FORMATS=4
1932 MAN_MISC_INFO=5
1933 ;;
1934
1935 linux*|freebsd*|netbsd*|openbsd*|dragonfly*|kfreebsd*|gnu*)
1936 DYEXT="so"
1937
1938 #
1939 # Compiler assumed to be GCC; run-time linker may require a -R
1940 # flag.
1941 #
1942 if test "$libdir" != "/usr/lib"; then
1943 V_RFLAGS=-Wl,-R$libdir
1944 fi
1945 ;;
1946
1947 osf*)
1948 DYEXT="so"
1949
1950 #
1951 # DEC OSF/1, a/k/a Digial UNIX, a/k/a Tru64 UNIX.
1952 # Use Tru64 UNIX conventions for man pages; they're the same as
1953 # the System V conventions except that they use section 8 for
1954 # administrative commands and daemons.
1955 #
1956 MAN_FILE_FORMATS=4
1957 MAN_MISC_INFO=5
1958 MAN_DEVICES=7
1959 ;;
1960
1961 sinix*)
1962 AC_MSG_CHECKING(if SINIX compiler defines sinix)
1963 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
1964 AC_TRY_COMPILE(
1965 [],
1966 [int i = sinix;],
1967 ac_cv_cc_sinix_defined=yes,
1968 ac_cv_cc_sinix_defined=no))
1969 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
1970 if test $ac_cv_cc_sinix_defined = no ; then
1971 AC_DEFINE(sinix,1,[on sinix])
1972 fi
1973 ;;
1974
1975 solaris*)
1976 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
1977
1978 DYEXT="so"
1979
1980 #
1981 # Make sure errno is thread-safe, in case we're called in
1982 # a multithreaded program. We don't guarantee that two
1983 # threads can use the *same* pcap_t safely, but the
1984 # current version does guarantee that you can use different
1985 # pcap_t's in different threads, and even that pcap_compile()
1986 # is thread-safe (it wasn't thread-safe in some older versions).
1987 #
1988 V_CCOPT="$V_CCOPT -D_TS_ERRNO"
1989
1990 case "`uname -r`" in
1991
1992 5.12)
1993 ;;
1994
1995 *)
1996 #
1997 # Use System V conventions for man pages.
1998 #
1999 MAN_ADMIN_COMMANDS=1m
2000 MAN_FILE_FORMATS=4
2001 MAN_MISC_INFO=5
2002 MAN_DEVICES=7D
2003 esac
2004 ;;
2005 esac
2006
2007 AC_ARG_ENABLE(shared,
2008 AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@]))
2009 test "x$enable_shared" = "xno" && DYEXT="none"
2010
2011 AC_PROG_RANLIB
2012 AC_CHECK_TOOL([AR], [ar])
2013
2014 AC_PROG_LN_S
2015 AC_SUBST(LN_S)
2016
2017 AC_LBL_DEVEL(V_CCOPT)
2018
2019 #
2020 # Check to see if the sockaddr struct has the 4.4 BSD sa_len member.
2021 #
2022 AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,
2023 [
2024 #include <sys/types.h>
2025 #include <sys/socket.h>
2026 ])
2027
2028 #
2029 # Check to see if there's a sockaddr_storage structure.
2030 #
2031 AC_CHECK_TYPES(struct sockaddr_storage,,,
2032 [
2033 #include <sys/types.h>
2034 #include <sys/socket.h>
2035 ])
2036
2037 #
2038 # Check to see if the dl_hp_ppa_info_t struct has the HP-UX 11.00
2039 # dl_module_id_1 member.
2040 #
2041 # NOTE: any failure means we conclude that it doesn't have that member,
2042 # so if we don't have DLPI, don't have a <sys/dlpi_ext.h> header, or
2043 # have one that doesn't declare a dl_hp_ppa_info_t type, we conclude
2044 # it doesn't have that member (which is OK, as either we won't be
2045 # using code that would use that member, or we wouldn't compile in
2046 # any case).
2047 #
2048 AC_CHECK_MEMBERS([dl_hp_ppa_info_t.dl_module_id_1],,,
2049 [
2050 #include <sys/types.h>
2051 #include <sys/dlpi.h>
2052 #include <sys/dlpi_ext.h>
2053 ])
2054
2055 AC_SUBST(V_CCOPT)
2056 AC_SUBST(V_LIB_CCOPT_FAT)
2057 AC_SUBST(V_LIB_LDFLAGS_FAT)
2058 AC_SUBST(V_PROG_CCOPT_FAT)
2059 AC_SUBST(V_PROG_LDFLAGS_FAT)
2060 AC_SUBST(V_DEFS)
2061 AC_SUBST(V_FINDALLDEVS)
2062 AC_SUBST(V_INCLS)
2063 AC_SUBST(V_LEX)
2064 AC_SUBST(V_PCAP)
2065 AC_SUBST(V_SHLIB_CCOPT)
2066 AC_SUBST(V_SHLIB_CMD)
2067 AC_SUBST(V_SHLIB_OPT)
2068 AC_SUBST(V_SONAME_OPT)
2069 AC_SUBST(V_RPATH_OPT)
2070 AC_SUBST(V_YACC)
2071 AC_SUBST(ADDLOBJS)
2072 AC_SUBST(ADDLARCHIVEOBJS)
2073 AC_SUBST(MSRC)
2074 AC_SUBST(SSRC)
2075 AC_SUBST(DYEXT)
2076 AC_SUBST(MAN_DEVICES)
2077 AC_SUBST(MAN_FILE_FORMATS)
2078 AC_SUBST(MAN_MISC_INFO)
2079 AC_SUBST(MAN_ADMIN_COMMANDS)
2080 AC_SUBST(PTHREAD_LIBS)
2081 AC_SUBST(BUILD_RPCAPD)
2082 AC_SUBST(INSTALL_RPCAPD)
2083 AC_SUBST(RPCAPD_LIBS)
2084 AC_SUBST(EXTRA_NETWORK_LIBS)
2085
2086 AC_ARG_ENABLE([usb],
2087 [AC_HELP_STRING([--enable-usb],[enable USB capture support @<:@default=yes, if support available@:>@])],
2088 [],
2089 [enable_usb=yes])
2090
2091 if test "xxx_only" = yes; then
2092 # User requested something-else-only pcap, so they don't
2093 # want USB support.
2094 enable_usb=no
2095 fi
2096
2097 if test "x$enable_usb" != "xno" ; then
2098 dnl check for USB sniffing support
2099 AC_MSG_CHECKING(for USB sniffing support)
2100 case "$host_os" in
2101 linux*)
2102 AC_DEFINE(PCAP_SUPPORT_USB, 1, [target host supports USB sniffing])
2103 MSRC="$MSRC pcap-usb-linux.c"
2104 AC_MSG_RESULT(yes)
2105 ac_usb_dev_name=`udevinfo -q name -p /sys/class/usb_device/usbmon 2>/dev/null`
2106 if test $? -ne 0 ; then
2107 ac_usb_dev_name="usbmon"
2108 fi
2109 AC_DEFINE_UNQUOTED(LINUX_USB_MON_DEV, "/dev/$ac_usb_dev_name", [path for device for USB sniffing])
2110 AC_MSG_NOTICE(Device for USB sniffing is /dev/$ac_usb_dev_name)
2111 #
2112 # Do we have a version of <linux/compiler.h> available?
2113 # If so, we might need it for <linux/usbdevice_fs.h>.
2114 #
2115 AC_CHECK_HEADERS(linux/compiler.h)
2116 if test "$ac_cv_header_linux_compiler_h" = yes; then
2117 #
2118 # Yes - include it when testing for <linux/usbdevice_fs.h>.
2119 #
2120 AC_CHECK_HEADERS(linux/usbdevice_fs.h,,,[#include <linux/compiler.h>])
2121 else
2122 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
2123 fi
2124 if test "$ac_cv_header_linux_usbdevice_fs_h" = yes; then
2125 #
2126 # OK, does it define bRequestType? Older versions of the kernel
2127 # define fields with names like "requesttype, "request", and
2128 # "value", rather than "bRequestType", "bRequest", and
2129 # "wValue".
2130 #
2131 AC_CHECK_MEMBERS([struct usbdevfs_ctrltransfer.bRequestType],,,
2132 [
2133 AC_INCLUDES_DEFAULT
2134 #ifdef HAVE_LINUX_COMPILER_H
2135 #include <linux/compiler.h>
2136 #endif
2137 #include <linux/usbdevice_fs.h>
2138 ])
2139 fi
2140 ;;
2141 freebsd*)
2142 #
2143 # This just uses BPF in FreeBSD 8.4 and later; we don't need
2144 # to check for anything special for capturing.
2145 #
2146 AC_MSG_RESULT([yes, in FreeBSD 8.4 and later])
2147 ;;
2148
2149 *)
2150 AC_MSG_RESULT(no)
2151 ;;
2152 esac
2153 fi
2154 AC_SUBST(PCAP_SUPPORT_USB)
2155
2156 dnl check for netfilter sniffing support
2157 if test "xxx_only" != yes; then
2158 AC_MSG_CHECKING(whether the platform could support netfilter sniffing)
2159 case "$host_os" in
2160 linux*)
2161 AC_MSG_RESULT(yes)
2162 #
2163 # Life's too short to deal with trying to get this to compile
2164 # if you don't get the right types defined with
2165 # __KERNEL_STRICT_NAMES getting defined by some other include.
2166 #
2167 # Check whether the includes Just Work. If not, don't turn on
2168 # netfilter support.
2169 #
2170 AC_MSG_CHECKING(whether we can compile the netfilter support)
2171 AC_CACHE_VAL(ac_cv_netfilter_can_compile,
2172 AC_TRY_COMPILE([
2173 AC_INCLUDES_DEFAULT
2174 #include <sys/socket.h>
2175 #include <netinet/in.h>
2176 #include <linux/types.h>
2177
2178 #include <linux/netlink.h>
2179 #include <linux/netfilter.h>
2180 #include <linux/netfilter/nfnetlink.h>
2181 #include <linux/netfilter/nfnetlink_log.h>
2182 #include <linux/netfilter/nfnetlink_queue.h>],
2183 [],
2184 ac_cv_netfilter_can_compile=yes,
2185 ac_cv_netfilter_can_compile=no))
2186 AC_MSG_RESULT($ac_cv_netfilter_can_compile)
2187 if test $ac_cv_netfilter_can_compile = yes ; then
2188 AC_DEFINE(PCAP_SUPPORT_NETFILTER, 1,
2189 [target host supports netfilter sniffing])
2190 MSRC="$MSRC pcap-netfilter-linux.c"
2191 fi
2192 ;;
2193 *)
2194 AC_MSG_RESULT(no)
2195 ;;
2196 esac
2197 fi
2198 AC_SUBST(PCAP_SUPPORT_NETFILTER)
2199
2200 AC_ARG_ENABLE([netmap],
2201 [AC_HELP_STRING([--enable-netmap],[enable netmap support @<:@default=yes, if support available@:>@])],
2202 [],
2203 [enable_netmap=yes])
2204
2205 if test "x$enable_netmap" != "xno" ; then
2206 #
2207 # Check whether net/netmap_user.h is usable if NETMAP_WITH_LIBS is
2208 # defined; it's not usable on DragonFly BSD 4.6 if NETMAP_WITH_LIBS
2209 # is defined, for example, as it includes a non-existent malloc.h
2210 # header.
2211 #
2212 AC_MSG_CHECKING(whether we can compile the netmap support)
2213 AC_CACHE_VAL(ac_cv_net_netmap_user_can_compile,
2214 AC_TRY_COMPILE([
2215 AC_INCLUDES_DEFAULT
2216 #define NETMAP_WITH_LIBS
2217 #include <net/netmap_user.h>],
2218 [],
2219 ac_cv_net_netmap_user_can_compile=yes,
2220 ac_cv_net_netmap_user_can_compile=no))
2221 AC_MSG_RESULT($ac_cv_net_netmap_user_can_compile)
2222 if test $ac_cv_net_netmap_user_can_compile = yes ; then
2223 AC_DEFINE(PCAP_SUPPORT_NETMAP, 1,
2224 [target host supports netmap])
2225 MSRC="$MSRC pcap-netmap.c"
2226 fi
2227 AC_SUBST(PCAP_SUPPORT_NETMAP)
2228 fi
2229
2230 # Check for DPDK support.
2231 AC_ARG_WITH([dpdk],
2232 AC_HELP_STRING([--with-dpdk@<:@=DIR@:>@],[include DPDK support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
2233 [
2234 if test "$withval" = no
2235 then
2236 # User doesn't want DPDK support.
2237 want_dpdk=no
2238 elif test "$withval" = yes
2239 then
2240 # User wants DPDK support but hasn't specified a directory.
2241 want_dpdk=yes
2242 else
2243 # User wants DPDK support and has specified a directory, so use the provided value.
2244 want_dpdk=yes
2245 dpdk_dir=$withval
2246 dpdk_inc_dir="$dpdk_dir/include"
2247 dpdk_lib_dir="$dpdk_dir/lib"
2248 fi
2249 ],[
2250 if test "$V_PCAP" = dpdk; then
2251 # User requested DPDK-only libpcap, so we'd better have
2252 # the DPDK API.
2253 want_dpdk=yes
2254 elif test "xxx_only" = yes; then
2255 # User requested something-else-only pcap, so they don't
2256 # want DPDK support.
2257 want_dpdk=no
2258 else
2259 #
2260 # Use DPDK API if present, otherwise don't
2261 #
2262 want_dpdk=ifpresent
2263 fi
2264 ])
2265
2266 if test "$want_dpdk" != no; then
2267 if test -z "$dpdk_dir"; then
2268 dpdk_inc_dir="/usr/local/include/dpdk"
2269 dpdk_lib_dir="/usr/local/lib"
2270 fi
2271 DPDK_MACHINE_CFLAGS="-march=native"
2272 DPDK_CFLAGS="$DPDK_MACHINE_CFLAGS -I$dpdk_inc_dir"
2273 DPDK_LDFLAGS="-L$dpdk_lib_dir -ldpdk -lrt -lm -lnuma -ldl -pthread"
2274
2275 save_CFLAGS="$CFLAGS"
2276 save_LIBS="$LIBS"
2277 save_LDFLAGS="$LDFLAGS"
2278 CFLAGS="$CFLAGS $DPDK_CFLAGS"
2279 LIBS="$LIBS $DPDK_LDFLAGS"
2280 LDFLAGS="$LDFLAGS $DPDK_LDFLAGS"
2281
2282 AC_MSG_CHECKING(whether we can compile the DPDK support)
2283 AC_CACHE_VAL(ac_cv_dpdk_can_compile,
2284 AC_TRY_COMPILE([
2285 AC_INCLUDES_DEFAULT
2286 #include <rte_common.h>],
2287 [],
2288 ac_cv_dpdk_can_compile=yes,
2289 ac_cv_dpdk_can_compile=no))
2290 AC_MSG_RESULT($ac_cv_dpdk_can_compile)
2291
2292 CFLAGS="$save_CFLAGS"
2293 LIBS="$save_LIBS"
2294 LDFLAGS="$save_LDFLAGS"
2295
2296 if test "$ac_cv_dpdk_can_compile" = yes; then
2297 CFLAGS="$CFLAGS $DPDK_CFLAGS"
2298 LIBS="$LIBS $DPDK_LDFLAGS"
2299 LDFLAGS="$LDFLAGS $DPDK_LDFLAGS"
2300 V_INCLS="$V_INCLS $DPDK_CFLAGS"
2301 AC_DEFINE(PCAP_SUPPORT_DPDK, 1, [target host supports DPDK])
2302 if test $V_PCAP != dpdk ; then
2303 MSRC="$MSRC pcap-dpdk.c"
2304 fi
2305 else
2306 if test "$V_PCAP" = dpdk; then
2307 # User requested "dpdk" capture type but we couldn't
2308 # find the DPDK API support.
2309 AC_MSG_ERROR([DPDK support requested with --with-pcap=dpdk, but the DPDK headers weren't found at $dpdk_inc_dir: make sure the DPDK support is installed, specify a different path or paths if necessary, or don't request DPDK support])
2310 fi
2311
2312 if test "$want_dpdk" = yes; then
2313 # User wanted DPDK support but we couldn't find it.
2314 AC_MSG_ERROR([DPDK support requested with --with-pcap=dpdk, but the DPDK headers weren't found at $dpdk_inc_dir: make sure the DPDK support is installed, specify a different path or paths if necessary, or don't request DPDK support])
2315 fi
2316 fi
2317 fi
2318 AC_SUBST(PCAP_SUPPORT_DPDK)
2319
2320 AC_ARG_ENABLE([bluetooth],
2321 [AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
2322 [],
2323 [enable_bluetooth=ifsupportavailable])
2324
2325 if test "xxx_only" = yes; then
2326 # User requested something-else-only pcap, so they don't
2327 # want Bluetooth support.
2328 enable_bluetooth=no
2329 fi
2330
2331 if test "x$enable_bluetooth" != "xno" ; then
2332 dnl check for Bluetooth sniffing support
2333 case "$host_os" in
2334 linux*)
2335 AC_CHECK_HEADER(bluetooth/bluetooth.h,
2336 [
2337 #
2338 # We have bluetooth.h, so we support Bluetooth
2339 # sniffing.
2340 #
2341 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
2342 MSRC="$MSRC pcap-bt-linux.c"
2343 AC_MSG_NOTICE(Bluetooth sniffing is supported)
2344 ac_lbl_bluetooth_available=yes
2345
2346 #
2347 # OK, does struct sockaddr_hci have an hci_channel
2348 # member?
2349 #
2350 AC_CHECK_MEMBERS([struct sockaddr_hci.hci_channel],
2351 [
2352 #
2353 # Yes; is HCI_CHANNEL_MONITOR defined?
2354 #
2355 AC_MSG_CHECKING(if HCI_CHANNEL_MONITOR is defined)
2356 AC_CACHE_VAL(ac_cv_lbl_hci_channel_monitor_is_defined,
2357 AC_TRY_COMPILE(
2358 [
2359 #include <bluetooth/bluetooth.h>
2360 #include <bluetooth/hci.h>
2361 ],
2362 [
2363 u_int i = HCI_CHANNEL_MONITOR;
2364 ],
2365 [
2366 AC_MSG_RESULT(yes)
2367 AC_DEFINE(PCAP_SUPPORT_BT_MONITOR,,
2368 [target host supports Bluetooth Monitor])
2369 MSRC="$MSRC pcap-bt-monitor-linux.c"
2370 ],
2371 [
2372 AC_MSG_RESULT(no)
2373 ]))
2374 ],,
2375 [
2376 #include <bluetooth/bluetooth.h>
2377 #include <bluetooth/hci.h>
2378 ])
2379 ],
2380 [
2381 #
2382 # We don't have bluetooth.h, so we don't support
2383 # Bluetooth sniffing.
2384 #
2385 if test "x$enable_bluetooth" = "xyes" ; then
2386 AC_MSG_ERROR(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
2387 else
2388 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
2389 fi
2390 ])
2391 ;;
2392 *)
2393 if test "x$enable_bluetooth" = "xyes" ; then
2394 AC_MSG_ERROR(no Bluetooth sniffing support implemented for $host_os)
2395 else
2396 AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
2397 fi
2398 ;;
2399 esac
2400 AC_SUBST(PCAP_SUPPORT_BT)
2401 fi
2402
2403 AC_ARG_ENABLE([dbus],
2404 [AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])],
2405 [],
2406 [enable_dbus=ifavailable])
2407
2408 if test "xxx_only" = yes; then
2409 # User requested something-else-only pcap, so they don't
2410 # want D-Bus support.
2411 enable_dbus=no
2412 fi
2413
2414 if test "x$enable_dbus" != "xno"; then
2415 if test "x$enable_dbus" = "xyes"; then
2416 case "$host_os" in
2417
2418 darwin*)
2419 #
2420 # We don't support D-Bus sniffing on macOS; see
2421 #
2422 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
2423 #
2424 # The user requested it, so fail.
2425 #
2426 AC_MSG_ERROR([Due to freedesktop.org bug 74029, D-Bus capture support is not available on macOS])
2427 esac
2428 else
2429 case "$host_os" in
2430
2431 darwin*)
2432 #
2433 # We don't support D-Bus sniffing on macOS; see
2434 #
2435 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
2436 #
2437 # The user dind't explicitly request it, so just
2438 # silently refuse to enable it.
2439 #
2440 enable_dbus="no"
2441 ;;
2442 esac
2443 fi
2444 fi
2445
2446 if test "x$enable_dbus" != "xno"; then
2447 if test "x$PKGCONFIG" != "xno"; then
2448 AC_MSG_CHECKING([for D-Bus])
2449 if "$PKGCONFIG" dbus-1; then
2450 AC_MSG_RESULT([yes])
2451 DBUS_CFLAGS=`"$PKGCONFIG" --cflags dbus-1`
2452 DBUS_LIBS=`"$PKGCONFIG" --libs dbus-1`
2453 save_CFLAGS="$CFLAGS"
2454 save_LIBS="$LIBS"
2455 CFLAGS="$CFLAGS $DBUS_CFLAGS"
2456 LIBS="$LIBS $DBUS_LIBS"
2457 AC_MSG_CHECKING(whether the D-Bus library defines dbus_connection_read_write)
2458 AC_TRY_LINK(
2459 [#include <string.h>
2460
2461 #include <time.h>
2462 #include <sys/time.h>
2463
2464 #include <dbus/dbus.h>],
2465 [return dbus_connection_read_write(NULL, 0);],
2466 [
2467 AC_MSG_RESULT([yes])
2468 AC_DEFINE(PCAP_SUPPORT_DBUS, 1, [support D-Bus sniffing])
2469 MSRC="$MSRC pcap-dbus.c"
2470 V_INCLS="$V_INCLS $DBUS_CFLAGS"
2471 ],
2472 [
2473 AC_MSG_RESULT([no])
2474 if test "x$enable_dbus" = "xyes"; then
2475 AC_MSG_ERROR([--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()])
2476 fi
2477 LIBS="$save_LIBS"
2478 ])
2479 CFLAGS="$save_CFLAGS"
2480 else
2481 AC_MSG_RESULT([no])
2482 if test "x$enable_dbus" = "xyes"; then
2483 AC_MSG_ERROR([--enable-dbus was given, but the dbus-1 package is not installed])
2484 fi
2485 fi
2486 fi
2487 AC_SUBST(PCAP_SUPPORT_DBUS)
2488 fi
2489
2490 AC_ARG_ENABLE([rdma],
2491 [AC_HELP_STRING([--enable-rdma],[enable RDMA capture support @<:@default=yes, if support available@:>@])],
2492 [],
2493 [enable_rdma=ifavailable])
2494
2495 if test "xxx_only" = yes; then
2496 # User requested something-else-only pcap, so they don't
2497 # want RDMA support.
2498 enable_rdma=no
2499 fi
2500
2501 if test "x$enable_rdma" != "xno"; then
2502 AC_CHECK_LIB(ibverbs, ibv_get_device_list, [
2503 AC_CHECK_HEADER(infiniband/verbs.h, [
2504 #
2505 # ibv_create_flow may be defined as a static inline
2506 # function in infiniband/verbs.h, so we can't
2507 # use AC_CHECK_LIB.
2508 #
2509 # Too bad autoconf has no AC_SYMBOL_EXISTS()
2510 # macro that works like CMake's check_symbol_exists()
2511 # function, to check do a compile check like
2512 # this (they do a clever trick to avoid having
2513 # to know the function's signature).
2514 #
2515 AC_MSG_CHECKING(whether libibverbs defines ibv_create_flow)
2516 AC_TRY_LINK(
2517 [
2518 #include <infiniband/verbs.h>
2519 ],
2520 [
2521 (void) ibv_create_flow((struct ibv_qp *) NULL,
2522 (struct ibv_flow_attr *) NULL);
2523 ],
2524 [
2525 AC_MSG_RESULT([yes])
2526 AC_DEFINE(PCAP_SUPPORT_RDMASNIFF, , [target host supports RDMA sniffing])
2527 MSRC="$MSRC pcap-rdmasniff.c"
2528 LIBS="-libverbs $LIBS"
2529 ],
2530 [
2531 AC_MSG_RESULT([no])
2532 ]
2533 )
2534 ])
2535 ])
2536 AC_SUBST(PCAP_SUPPORT_RDMASNIFF)
2537 fi
2538
2539 AC_PROG_INSTALL
2540
2541 AC_CONFIG_HEADER(config.h)
2542
2543 AC_OUTPUT_COMMANDS([if test -f .devel; then
2544 echo timestamp > stamp-h
2545 cat $srcdir/Makefile-devel-adds >> Makefile
2546 make depend
2547 fi])
2548 AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc
2549 pcap-tstamp.manmisc pcap-savefile.manfile pcap.3pcap
2550 pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap
2551 pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap
2552 pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap
2553 pcap_open_offline.3pcap pcap_set_immediate_mode.3pcap
2554 pcap_set_tstamp_precision.3pcap pcap_set_tstamp_type.3pcap
2555 rpcapd/Makefile rpcapd/rpcapd.manadmin rpcapd/rpcapd-config.manfile
2556 testprogs/Makefile)
2557 exit 0