2 dnl Copyright (c) 1994, 1995, 1996, 1997
3 dnl The Regents of the University of California. All rights reserved.
5 dnl Process this file with autoconf to produce a configure script.
11 # https://ftp.gnu.org/gnu/config/README
13 # for the URLs to use to fetch new versions of config.guess and
19 AC_INIT([pcap],[m4_esyscmd_s(cat VERSION)],[https://github.com/the-tcpdump-group/libpcap/issues])
20 AC_CONFIG_SRCDIR(pcap.c)
21 AC_SUBST(PACKAGE_NAME)
24 # These are the variables that are used in Makefile, pcap-config, and
27 # CFLAGS: inherited from the environment, not modified by us except
28 # for flags required for the platform for which we're building (and
29 # except temporarily during tests that involve compilation). Used only
30 # when compiling C source.
32 # LDFLAGS: inherited from the environment, not modified by us.
34 # LIBS: inherited from the environment; we add libraries required by
35 # libpcap. Libraries that the core libpcap code requires are added
36 # first; libraries required by additional pcap modules are first
37 # added to ADDITIONAL_LIBS, and only added to LIBS at the end, after
38 # we're finished doing configuration tests for the modules.
40 # LIBS_STATIC: libraries with which a program using the libpcap *static*
41 # library needs to be linked. This is a superset of LIBS, used in
42 # pcap-config, so that "pcap-config --libs --static" will report them.
43 # Initialized to LIBS.
45 # REQUIRES_PRIVATE: pkg-config package names for additional libraries
46 # with which a program using the libpcap *static* library needs to be
47 # linked and for which a .pc file exists. This is used in libpcap.pc,
48 # so that "pkg-config --libs --static" will report them, and so that
49 # those libraries will be determined using the library's .pc file, not
50 # from our .pc file. Initialized to an empty string.
52 # V_CCOPT: additional compiler flags other than -I and -D flags
53 # needed when compiling libpcap. Used in Makefile for both C and
56 # V_DEFS: additional -D compiler flags needed when compiling
57 # libpcap. Used in Makefile for both C and C++ source.
59 # V_INCLS: additional -I compiler flags needed when compiling
60 # libpcap. Used in Makefile for both C and C++ source.
62 # ADDITIONAL_LIBS: additional libraries with which the libpcap dynamic
63 # library needs to be linked. Used in Makefile; not used in pcap-config
64 # or libpcap.pc, as, in all platforms on which we run, if a dynamic
65 # library is linked with other dynamic libraries, a program using
66 # that dynamic library doesn't have to link with those libraries -
67 # they will be automatically loaded at run time. Initialized to an
70 # ADDITIONAL_LIBS_STATIC: additional libraries with which a program
71 # using the libpcap *static* library needs to be linked. This is used
72 # in pcap-config, so that "pcap-config --libs --static" will report
73 # them. Initialized to an empty string.
75 # REQUIRES_PRIVATE: pkg-config package names for additional libraries
76 # with which a program using the libpcap *static* library needs to be
77 # linked and for which a .pc file exists. This is used in libpcap.pc,
78 # so that "pkg-config --libs --static" will report them, and so that
79 # those libraries will be determined using the library's .pc file, not
80 # from our .pc file. Initialized to an empty string.
82 # LIBS_PRIVATE: pkg-config package names for additional libraries with
83 # which a program using the libpcap *static* library needs to be linked
84 # and for which a .pc file does not exist. This is used in libpcap.pc,
85 # so that "pkg-config --libs --static" will report them (those libraries
86 # cannot be determined using the library's .pc file, as there is no such
87 # file, so it has to come from our .pc file. Initialized to an empty
98 AC_SUBST(REQUIRES_PRIVATE)
99 AC_SUBST(LIBS_PRIVATE)
103 AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
105 # We require C99 or later.
106 # Try to get it, which may involve adding compiler flags;
107 # if that fails, give up.
110 if test "$ac_cv_prog_cc_c99" = "no"; then
111 AC_MSG_WARN([The C compiler does not support C99; there may be compiler errors])
115 # Try to arrange for large file support.
121 # Get the size of a void *, to determine whether this is a 32-bit
124 AC_CHECK_SIZEOF([void *])
125 ac_lbl_c_sizeof_void_p="$ac_cv_sizeof_void_p"
128 # Get the size of a time_t, to know whether it's 32-bit or 64-bit.
130 AC_CHECK_SIZEOF([time_t],,[#include <time.h>])
132 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
137 dnl HAVE_SYS_IOCCOM_H will be required for a few workarounds until all
138 dnl supported OSes that use BPF have <net/bpf.h> that includes <sys/ioccom.h>
139 dnl (this might have already happened).
141 AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h)
142 AC_CHECK_HEADERS(netpacket/packet.h)
145 # Check whether the platform for which we're compiling requires extra
146 # defines and libraries. If so, add them to CFLAGS and LIBS, as we want
147 # all subsequent tests to be done with those defines and libraries.
152 # Haiku needs _BSD_SOURCE for the _IO* macros because it doesn't
155 CFLAGS="$CFLAGS -D_BSD_SOURCE"
157 # Haiku has getpass in libbsd.
159 AC_CHECK_LIB(bsd, getpass)
163 AC_CHECK_FUNC(strerror_r,
166 # We have strerror_r; if we define _GNU_SOURCE, is it a
167 # POSIX-compliant strerror_r() or a GNU strerror_r()?
169 AC_MSG_CHECKING(whether strerror_r is GNU-style)
176 /* Define it GNU-style; that will cause an error if it's not GNU-style */
177 extern char *strerror_r(int, char *, size_t);
189 AC_DEFINE(HAVE_GNU_STRERROR_R, 1,
190 [Define to 1 if you have a GNU-style `strerror_r' function.])
194 AC_DEFINE(HAVE_POSIX_STRERROR_R, 1,
195 [Define to 1 if you have a POSIX-style `strerror_r' function.])
200 # We don't have strerror_r; do we have _wcserror_s?
202 AC_CHECK_FUNCS(_wcserror_s)
206 # Thanks, IBM, for not providing vsyslog() in AIX!
208 AC_CHECK_FUNCS(vsyslog)
211 # Require a proof of suitable snprintf(3), same as in tcpdump.
213 AC_MSG_CHECKING([whether snprintf is suitable])
219 #include <inttypes.h>
220 #include <sys/types.h>
222 #if defined(_WIN32) && !defined(_SSIZE_T_DEFINED)
224 * On UN*Xes, this is a signed integer type of the same size as size_t.
226 * It's not defined by Visual Studio; we assume that ptrdiff_t will
227 * be a type that is a signed integer type of the same size as size_t.
229 typedef ptrdiff_t ssize_t;
233 * Avoid trying to cast negative values to unsigned types, or doing
234 * shifts of signed types, in order not to have the test program fail
235 * if we're building with undefined-behavior sanitizers enabled.
240 unsigned int ui = sizeof(buf);
242 int64_t i64 = INT64_C(0x100000000);
243 uint64_t ui64 = UINT64_C(0x100000000);
245 snprintf(buf, sizeof(buf), "%zu", (size_t)ui);
246 if (strncmp(buf, "100", sizeof(buf)))
249 snprintf(buf, sizeof(buf), "%zd", (ssize_t)(-i));
250 if (strncmp(buf, "-100", sizeof(buf)))
253 snprintf(buf, sizeof(buf), "%" PRId64, -i64);
254 if (strncmp(buf, "-4294967296", sizeof(buf)))
257 snprintf(buf, sizeof(buf), "0o%" PRIo64, ui64);
258 if (strncmp(buf, "0o40000000000", sizeof(buf)))
261 snprintf(buf, sizeof(buf), "0x%" PRIx64, ui64);
262 if (strncmp(buf, "0x100000000", sizeof(buf)))
265 snprintf(buf, sizeof(buf), "%" PRIu64, ui64);
266 if (strncmp(buf, "4294967296", sizeof(buf)))
279 [The snprintf(3) implementation in this libc is not suitable,
280 libpcap would not work correctly even if it managed to compile.])
283 AC_MSG_RESULT(not while cross-compiling)
288 AC_CHECK_FUNCS(vasprintf asprintf,,
290 if test $needasprintf = yes; then
291 AC_LIBOBJ([asprintf])
295 AC_CHECK_FUNCS(strlcat,,
297 if test $needstrlcat = yes; then
302 AC_CHECK_FUNCS(strlcpy,,
304 if test $needstrlcpy = yes; then
309 AC_CHECK_FUNCS(strtok_r,,
311 if test $needstrtok_r = yes; then
312 AC_LIBOBJ([strtok_r])
316 # Do this before checking for ether_hostton(), as it's a
317 # "getaddrinfo()-ish function".
322 # Check for reentrant versions of getnetbyname_r(), as provided by
323 # Linux (glibc), Solaris, and AIX (with three different APIs!).
324 # If we don't find one, we just use getnetbyname(), which uses
325 # thread-specific data on many platforms, but doesn't use it on
326 # NetBSD or OpenBSD, and may not use it on older versions of other
329 # Only do the check if we have a declaration of getnetbyname_r();
330 # without it, we can't check which API it has. (We assume that
331 # if there's a declaration, it has a prototype, so that the API
334 AC_CHECK_DECL(getnetbyname_r,
336 AC_MSG_CHECKING([for the Linux getnetbyname_r()])
337 AC_LINK_IFELSE([AC_LANG_PROGRAM(
338 [[#include <netdb.h>]],
340 struct netent netent_buf;
342 struct netent *resultp;
345 return getnetbyname_r((const char *)0, &netent_buf, buf, sizeof buf, &resultp, &h_errnoval);
349 AC_DEFINE(HAVE_LINUX_GETNETBYNAME_R, 1,
350 [define if we have the Linux getnetbyname_r()])
355 AC_MSG_CHECKING([for Solaris getnetbyname_r()])
356 AC_LINK_IFELSE([AC_LANG_PROGRAM(
357 [[#include <netdb.h>]],
359 struct netent netent_buf;
362 return getnetbyname_r((const char *)0, &netent_buf, buf, (int)sizeof buf) != NULL;
366 AC_DEFINE(HAVE_SOLARIS_GETNETBYNAME_R, 1,
367 [define if we have the Solaris getnetbyname_r()])
372 AC_MSG_CHECKING([for AIX getnetbyname_r()])
373 AC_LINK_IFELSE([AC_LANG_PROGRAM(
374 [[#include <netdb.h>]],
376 struct netent netent_buf;
377 struct netent_data net_data;
379 return getnetbyname_r((const char *)0, &netent_buf, &net_data);
383 AC_DEFINE(HAVE_AIX_GETNETBYNAME_R, 1,
384 [define if we have the AIX getnetbyname_r()])
391 ],,[#include <netdb.h>])
394 # Check for reentrant versions of getprotobyname_r(), as provided by
395 # Linux (glibc), Solaris, and AIX (with three different APIs!).
396 # If we don't find one, we just use getprotobyname(), which uses
397 # thread-specific data on many platforms, but doesn't use it on
398 # NetBSD or OpenBSD, and may not use it on older versions of other
401 # Only do the check if we have a declaration of getprotobyname_r();
402 # without it, we can't check which API it has. (We assume that
403 # if there's a declaration, it has a prototype, so that the API
406 AC_CHECK_DECL(getprotobyname_r,
408 AC_MSG_CHECKING([for the Linux getprotobyname_r()])
409 AC_LINK_IFELSE([AC_LANG_PROGRAM(
410 [[#include <netdb.h>]],
412 struct protoent protoent_buf;
414 struct protoent *resultp;
416 return getprotobyname_r((const char *)0, &protoent_buf, buf, sizeof buf, &resultp);
420 AC_DEFINE(HAVE_LINUX_GETPROTOBYNAME_R, 1,
421 [define if we have the Linux getprotobyname_r()])
426 AC_MSG_CHECKING([for Solaris getprotobyname_r()])
427 AC_LINK_IFELSE([AC_LANG_PROGRAM(
428 [[#include <netdb.h>]],
430 struct protoent protoent_buf;
433 return getprotobyname_r((const char *)0, &protoent_buf, buf, (int)sizeof buf) != NULL;
437 AC_DEFINE(HAVE_SOLARIS_GETPROTOBYNAME_R, 1,
438 [define if we have the Solaris getprotobyname_r()])
443 AC_MSG_CHECKING([for AIX getprotobyname_r()])
444 AC_LINK_IFELSE([AC_LANG_PROGRAM(
445 [[#include <netdb.h>]],
447 struct protoent protoent_buf;
448 struct protoent_data proto_data;
450 return getprotobyname_r((const char *)0, &protoent_buf, &proto_data);
454 AC_DEFINE(HAVE_AIX_GETPROTOBYNAME_R, 1,
455 [define if we have the AIX getprotobyname_r()])
462 ],,[#include <netdb.h>])
465 # You are in a twisty little maze of UN*Xes, all different.
466 # Some might not have ether_hostton().
467 # Some might have it and declare it in <net/ethernet.h>.
468 # Some might have it and declare it in <netinet/ether.h>
469 # Some might have it and declare it in <sys/ethernet.h>.
470 # Some might have it and declare it in <arpa/inet.h>.
471 # Some might have it and declare it in <netinet/if_ether.h>.
472 # Some might have it and not declare it in any header file.
474 # Before you is a C compiler.
476 AC_CHECK_FUNCS(ether_hostton)
477 if test "$ac_cv_func_ether_hostton" = yes; then
479 # OK, we have ether_hostton(). Is it declared in <net/ethernet.h>?
481 # This test fails if we don't have <net/ethernet.h> or if we do
482 # but it doesn't declare ether_hostton().
484 AC_CHECK_DECL(ether_hostton,
486 AC_DEFINE(NET_ETHERNET_H_DECLARES_ETHER_HOSTTON, 1,
487 [Define to 1 if net/ethernet.h declares `ether_hostton'])
490 #include <net/ethernet.h>
495 if test "$ac_cv_have_decl_ether_hostton" != yes; then
497 # No, how about <netinet/ether.h>, as on Linux?
499 # This test fails if we don't have <netinet/ether.h>
500 # or if we do but it doesn't declare ether_hostton().
502 # Unset ac_cv_have_decl_ether_hostton so we don't
503 # treat the previous failure as a cached value and
504 # suppress the next test.
506 unset ac_cv_have_decl_ether_hostton
507 AC_CHECK_DECL(ether_hostton,
509 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON, 1,
510 [Define to 1 if netinet/ether.h declares `ether_hostton'])
513 #include <netinet/ether.h>
519 if test "$ac_cv_have_decl_ether_hostton" != yes; then
521 # No, how about <sys/ethernet.h>, as on Solaris 10
524 # This test fails if we don't have <sys/ethernet.h>
525 # or if we do but it doesn't declare ether_hostton().
527 # Unset ac_cv_have_decl_ether_hostton so we don't
528 # treat the previous failure as a cached value and
529 # suppress the next test.
531 unset ac_cv_have_decl_ether_hostton
532 AC_CHECK_DECL(ether_hostton,
534 AC_DEFINE(SYS_ETHERNET_H_DECLARES_ETHER_HOSTTON, 1,
535 [Define to 1 if sys/ethernet.h declares `ether_hostton'])
538 #include <sys/ethernet.h>
544 if test "$ac_cv_have_decl_ether_hostton" != yes; then
546 # No, how about <arpa/inet.h>, as in AIX?
548 # This test fails if we don't have <arpa/inet.h>
549 # (if we have ether_hostton(), we should have
550 # networking, and if we have networking, we should
551 # have <arpa/inet.h>) or if we do but it doesn't
552 # declare ether_hostton().
554 # Unset ac_cv_have_decl_ether_hostton so we don't
555 # treat the previous failure as a cached value and
556 # suppress the next test.
558 unset ac_cv_have_decl_ether_hostton
559 AC_CHECK_DECL(ether_hostton,
561 AC_DEFINE(ARPA_INET_H_DECLARES_ETHER_HOSTTON, 1,
562 [Define to 1 if arpa/inet.h declares `ether_hostton'])
565 #include <arpa/inet.h>
571 if test "$ac_cv_have_decl_ether_hostton" != yes; then
573 # No, how about <netinet/if_ether.h>?
574 # On some platforms, it requires <net/if.h> and
575 # <netinet/in.h>, and we always include it with
576 # both of them, so test it with both of them.
578 # This test fails if we don't have <netinet/if_ether.h>
579 # and the headers we include before it, or if we do but
580 # <netinet/if_ether.h> doesn't declare ether_hostton().
582 # Unset ac_cv_have_decl_ether_hostton so we don't
583 # treat the previous failure as a cached value and
584 # suppress the next test.
586 unset ac_cv_have_decl_ether_hostton
587 AC_CHECK_DECL(ether_hostton,
589 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON, 1,
590 [Define to 1 if netinet/if_ether.h declares `ether_hostton'])
593 #include <sys/types.h>
594 #include <sys/socket.h>
596 #include <netinet/in.h>
597 #include <netinet/if_ether.h>
601 # After all that, is ether_hostton() declared?
603 if test "$ac_cv_have_decl_ether_hostton" = yes; then
607 AC_DEFINE(HAVE_DECL_ETHER_HOSTTON, 1,
608 [Define to 1 if you have the declaration of `ether_hostton'])
611 # No, we'll have to declare it ourselves.
612 # Do we have "struct ether_addr" if we include
613 # <netinet/if_ether.h>?
615 AC_CHECK_TYPES(struct ether_addr,,,
617 #include <sys/types.h>
618 #include <sys/socket.h>
620 #include <netinet/in.h>
621 #include <netinet/if_ether.h>
627 # For various things that might use pthreads.
629 AC_CHECK_HEADER(pthread.h,
632 # OK, we have pthread.h. Do we have pthread_create in the
635 AC_CHECK_FUNC(pthread_create,
640 ac_lbl_have_pthreads="found"
644 # No - do we have it in -lpthreads?
646 AC_CHECK_LIB(pthreads, pthread_create,
649 # Yes - add -lpthreads.
651 ac_lbl_have_pthreads="found"
652 PTHREAD_LIBS="$PTHREAD_LIBS -lpthreads"
656 # No - do we have it in -lpthread?
658 AC_CHECK_LIB(pthread, pthread_create,
661 # Yes - add -lpthread.
663 ac_lbl_have_pthreads="found"
664 PTHREAD_LIBS="$PTHREAD_LIBS -lpthread"
670 ac_lbl_have_pthreads="not found"
677 # We didn't find pthread.h.
679 ac_lbl_have_pthreads="not found"
683 AC_MSG_CHECKING([whether to enable the instrument functions code])
684 AC_ARG_ENABLE([instrument-functions],
685 [AS_HELP_STRING([--enable-instrument-functions],
686 [enable instrument functions code [default=no]])],
690 yes) AC_MSG_RESULT(yes)
691 AC_DEFINE(ENABLE_INSTRUMENT_FUNCTIONS, 1,
692 [define if you want to build the instrument functions code])
693 # Add '-finstrument-functions' instrumentation option to generate
694 # instrumentation calls for entry and exit to functions.
695 # Use '--enable-instrument-functions' also with tcpdump (or tcpslice)
696 # to see the output. See also https://www.tcpdump.org/faq.html#q17.
697 CFLAGS="$CFLAGS -O0 -ggdb -finstrument-functions"
703 dnl to pacify those who hate protochain insn
704 AC_MSG_CHECKING(if --disable-protochain option is specified)
705 AC_ARG_ENABLE(protochain,
706 AS_HELP_STRING([--disable-protochain],[disable \"protochain\" insn]))
707 case "x$enable_protochain" in
708 xyes) enable_protochain=enabled ;;
709 xno) enable_protochain=disabled ;;
710 x) enable_protochain=enabled ;;
713 if test "$enable_protochain" = "disabled"; then
714 AC_DEFINE(NO_PROTOCHAIN,1,[do not use protochain])
716 AC_MSG_RESULT(${enable_protochain})
719 # valgrindtest directly uses the native capture mechanism, but
720 # only tests with BPF and PF_PACKET sockets; only enable it if
721 # we have BPF or PF_PACKET sockets.
726 AS_HELP_STRING([--with-pcap=TYPE],[use packet capture TYPE]))
727 if test ! -z "$with_pcap" ; then
731 # Check for a bunch of headers for various packet
732 # capture mechanisms.
734 AC_CHECK_HEADERS(net/bpf.h)
735 if test "$ac_cv_header_net_bpf_h" = yes; then
737 # Does it define BIOCSETIF?
738 # I.e., is it a header for an LBL/BSD-style capture
739 # mechanism, or is it just a header for a BPF filter
740 # engine? Some versions of Arch Linux, for example,
741 # have a net/bpf.h that doesn't define BIOCSETIF;
742 # as it's a Linux, it should use packet sockets,
747 # sys/types.h, because FreeBSD 10's net/bpf.h
748 # requires that various BSD-style integer types
751 # sys/time.h, because AIX 5.2 and 5.3's net/bpf.h
752 # doesn't include it but does use struct timeval
753 # in ioctl definitions;
755 # sys/ioctl.h and, if we have it, sys/ioccom.h,
756 # because net/bpf.h defines ioctls;
758 # net/if.h, because it defines some structures
759 # used in ioctls defined by net/bpf.h;
761 # sys/socket.h, because OpenBSD 5.9's net/bpf.h
762 # defines some structure fields as being
765 # and net/bpf.h doesn't necessarily include all
766 # of those headers itself.
768 AC_MSG_CHECKING(if net/bpf.h defines BIOCSETIF)
769 AC_CACHE_VAL(ac_cv_lbl_bpf_h_defines_biocsetif,
770 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
772 #include <sys/types.h>
773 #include <sys/time.h>
774 #include <sys/ioctl.h>
775 #include <sys/socket.h>
776 #ifdef HAVE_SYS_IOCCOM_H
777 #include <sys/ioccom.h>
782 [[u_int i = BIOCSETIF;]])],
783 [ac_cv_lbl_bpf_h_defines_biocsetif=yes],
784 [ac_cv_lbl_bpf_h_defines_biocsetif=no]))
785 AC_MSG_RESULT($ac_cv_lbl_bpf_h_defines_biocsetif)
787 AC_CHECK_HEADERS(linux/socket.h sys/dlpi.h)
788 AC_CHECK_HEADERS(config/HaikuConfig.h)
789 AC_CHECK_HEADERS(hurd.h)
791 if test "$ac_cv_lbl_bpf_h_defines_biocsetif" = yes; then
794 # Check this before DLPI, so that we pick BPF on
795 # Solaris 11 and later.
800 # We have BPF, so build valgrindtest with "make test"
801 # on macOS and FreeBSD (add your OS once there's a
806 freebsd*|darwin*|linux*)
807 VALGRINDTEST_SRC=valgrindtest.c
810 elif test "$ac_cv_header_linux_socket_h" = yes; then
812 # No prizes for guessing this one.
815 VALGRINDTEST_SRC=valgrindtest.c
816 elif test "$ac_cv_header_sys_dlpi_h" = yes; then
818 # DLPI on pre-Solaris 11 SunOS 5, HP-UX, possibly others.
821 elif test "$ac_cv_header_config_HaikuConfig_h" = yes; then
826 elif test "$ac_cv_header_hurd_h" = yes; then
833 # We don't have any capture type we know about.
834 # Report an error, and tell the user to configure with
835 # --with-pcap=null if they want a libpcap that can't
836 # capture but that can read capture files. That way,
837 # nobody gets surprised by getting a no-capture
838 # libpcap without asking for that.
840 AC_MSG_ERROR([No supported packet capture interface was found.
841 See the INSTALL.md file for information on packet capture support in
842 various operating systems.
843 If you want a libpcap that cannot capture packets but that can read
844 pcap and pcapng files, run configure with --with-pcap=null.])
847 AC_MSG_CHECKING(packet capture type)
848 AC_MSG_RESULT($V_PCAP)
849 AC_SUBST(VALGRINDTEST_SRC)
852 # Do we have pkg-config?
857 # Do we have the brew command from Homebrew?
859 AC_PATH_PROG([BREW], [brew])
862 # Solaris pkg-config is annoying. For at least one package (D-Bus, I'm
863 # looking at *you*!), there are separate include files for 32-bit and
864 # 64-bit builds (I guess using "unsigned long long" as a 64-bit integer
865 # type on a 64-bit build is like crossing the beams or something), and
866 # there are two separate .pc files, so if we're doing a 32-bit build we
867 # should make sure we look in /usr/lib/pkgconfig for .pc files and if
868 # we're doing a 64-bit build we should make sure we look in
869 # /usr/lib/amd64/pkgconfig for .pc files.
874 if test "$ac_cv_sizeof_void_p" -eq 8; then
876 # 64-bit build. If the path is empty, set it to
877 # /usr/lib/amd64/pkgconfig; otherwise, if
878 # /usr/lib/pkgconfig appears in the path, prepend
879 # /usr/lib/amd64/pkgconfig to it; otherwise, put
880 # /usr/lib/amd64/pkgconfig at the end.
882 if test -z "$PKG_CONFIG_PATH"; then
884 # Not set, or empty. Set it to
885 # /usr/lib/amd64/pkgconfig.
887 PKG_CONFIG_PATH=/usr/lib/amd64/pkgconfig
888 elif test ! -z `echo "$PKG_CONFIG_PATH" | grep "/usr/lib/pkgconfig"`; then
890 # It contains /usr/lib/pkgconfig. Prepend
891 # /usr/lib/amd64/pkgconfig to /usr/lib/pkgconfig.
893 PKG_CONFIG_PATH=`echo "$PKG_CONFIG_PATH" | sed "s;/usr/lib/pkgconfig;/usr/lib/amd64/pkgconfig:/usr/lib/pkgconfig;"`
896 # Not empty, but doesn't contain /usr/lib/pkgconfig.
897 # Append /usr/lib/amd64/pkgconfig to it.
899 PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/amd64/pkgconfig"
901 export PKG_CONFIG_PATH
902 elif test "$ac_cv_sizeof_void_p" -eq 4; then
904 # 32-bit build. If /usr/amd64/lib/pkgconfig appears
905 # in the path, prepend /usr/lib/pkgconfig to it.
907 if test ! -z `echo "$PKG_CONFIG_PATH" | grep "/usr/lib/amd64/pkgconfig"`; then
909 # It contains /usr/lib/amd64/pkgconfig. Prepend
910 # /usr/lib/pkgconfig to /usr/lib/amd64/pkgconfig.
912 PKG_CONFIG_PATH=`echo "$PKG_CONFIG_PATH" | sed "s;/usr/lib/amd64/pkgconfig;/usr/lib/pkgconfig:/usr/lib/amd64/pkgconfig;"`
913 export PKG_CONFIG_PATH
919 # Handle each capture type.
924 # Checks for some header files.
926 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
929 # Checks to see if Solaris has the public libdlpi(3LIB) library.
930 # Note: The existence of /usr/include/libdlpi.h does not mean it is the
931 # public libdlpi(3LIB) version. Before libdlpi was made public, a
932 # private version also existed, which did not have the same APIs.
933 # Due to a gcc bug, the default search path for 32-bit libraries does
934 # not include /lib, we add it explicitly here.
935 # [http://bugs.opensolaris.org/view_bug.do?bug_id=6619485].
936 # Also, due to the bug above applications that link to libpcap with
937 # libdlpi will have to add "-L/lib" option to "configure".
939 save_LDFLAGS="$LDFLAGS"
940 LDFLAGS="$LIBS -L/lib"
941 AC_CHECK_LIB(dlpi, dlpi_walk,
944 LIBS_STATIC="-ldlpi $LIBS_STATIC"
945 LIBS_PRIVATE="-ldlpi $LIBS_PRIVATE"
949 # Capture module plus common code needed for
950 # common functions used by pcap-[dlpi,libdlpi].c
952 PLATFORM_C_SRC="pcap-libdlpi.c dlpisubs.c"
953 AC_DEFINE(HAVE_LIBDLPI,1,[if libdlpi exists])
959 # Capture module plus common code needed for
960 # common functions used by pcap-[dlpi,libdlpi].c
962 PLATFORM_C_SRC="pcap-dlpi.c dlpisubs.c"
964 LDFLAGS="$save_LDFLAGS"
967 # Checks whether <sys/dlpi.h> is usable, to catch weird SCO
970 AC_MSG_CHECKING(whether <sys/dlpi.h> is usable)
971 AC_CACHE_VAL(ac_cv_sys_dlpi_usable,
972 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
974 #include <sys/types.h>
975 #include <sys/time.h>
976 #include <sys/dlpi.h>
978 [[int i = DL_PROMISC_PHYS;]])],
979 [ac_cv_sys_dlpi_usable=yes],
980 [ac_cv_sys_dlpi_usable=no]))
981 AC_MSG_RESULT($ac_cv_sys_dlpi_usable)
982 if test $ac_cv_sys_dlpi_usable = no ; then
983 AC_MSG_ERROR(<sys/dlpi.h> is not usable on this system; it probably has a non-standard DLPI)
987 # Check to see if Solaris has the dl_passive_req_t struct defined
989 # This check is for DLPI support for passive modes.
990 # See dlpi(7P) for more details.
992 AC_CHECK_TYPES(dl_passive_req_t,,,
994 #include <sys/types.h>
995 #include <sys/dlpi.h>
1003 PLATFORM_C_SRC="pcap-haiku.c"
1010 PLATFORM_C_SRC="pcap-linux.c"
1014 # We only want version 3. Version 2 was, apparently,
1015 # short-lived, and version 1 is source and binary
1016 # incompatible with version 3, and it appears that,
1017 # these days, everybody's using version 3. We're
1018 # not supporting older versions of the Linux kernel;
1019 # let's drop support for older versions of libnl, too.
1022 AS_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
1023 with_libnl=$withval,with_libnl=if_available)
1025 if test x$with_libnl != xno ; then
1027 # Check for libnl-genl-3.0 with pkg-config.
1029 PKG_CHECK_MODULE(LIBNL, libnl-genl-3.0,
1031 pkg_config_found_libnl=yes
1032 V_INCLS="$V_INCLS $LIBNL_CFLAGS"
1033 ADDITIONAL_LIBS="$LIBNL_LIBS $ADDITIONAL_LIBS"
1034 ADDITIONAL_LIBS_STATIC="$LIBNL_LIBS_STATIC $ADDITIONAL_LIBS_STATIC"
1035 REQUIRES_PRIVATE="libnl-genl-3.0 $REQUIRES_PRIVATE"
1036 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
1039 if test x$pkg_config_found_libnl != xyes; then
1041 # Check for libnl-tiny with pkg-config.
1043 PKG_CHECK_MODULE(LIBNL, libnl-tiny,
1045 pkg_config_found_libnl=yes
1046 V_INCLS="$V_INCLS $LIBNL_CFLAGS"
1047 ADDITIONAL_LIBS="$LIBNL_LIBS $ADDITIONAL_LIBS"
1048 ADDITIONAL_LIBS_STATIC="$LIBNL_LIBS_STATIC $ADDITIONAL_LIBS_STATIC"
1049 REQUIRES_PRIVATE="libnl-tiny $REQUIRES_PRIVATE"
1050 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
1054 if test x$pkg_config_found_libnl != xyes; then
1056 # OK, either we don't have pkg-config or there
1057 # wasn't a .pc file for it; Check for it directly.
1059 case "$with_libnl" in
1062 incdir=-I/usr/include/libnl3
1067 if test -d $withval; then
1068 libnldir=-L${withval}/lib
1069 incdir=-I${withval}/include
1074 AC_CHECK_LIB(nl-3, nl_socket_alloc,
1077 # Yes, we have libnl 3.x.
1079 ADDITIONAL_LIBS="${libnldir} -lnl-genl-3 -lnl-3 $ADDITIONAL_LIBS"
1080 ADDITIONAL_LIBS_STATIC="${libnldir} -lnl-genl-3 -lnl-3 $ADDITIONAL_LIBS_STATIC"
1081 LIBS_PRIVATE="${libnldir} -lnl-genl-3 -lnl-3 $LIBS_PRIVATE"
1082 AC_DEFINE(HAVE_LIBNL,1,[if libnl exists])
1083 V_INCLS="$V_INCLS ${incdir}"
1086 # No, we don't have libnl at all.
1087 # Fail if the user explicitly requested
1090 if test x$with_libnl = xyes ; then
1091 AC_MSG_ERROR([libnl support requested but libnl not found])
1093 ], ${incdir} ${libnldir} -lnl-genl-3 -lnl-3 )
1098 # Check to see if the tpacket_auxdata struct has a tp_vlan_tci member.
1100 # NOTE: any failure means we conclude that it doesn't have that
1101 # member, so if we don't have tpacket_auxdata, we conclude it
1102 # doesn't have that member (which is OK, as either we won't be
1103 # using code that would use that member, or we wouldn't compile
1105 AC_CHECK_MEMBERS([struct tpacket_auxdata.tp_vlan_tci],,,
1107 #include <sys/types.h>
1108 #include <linux/if_packet.h>
1111 # This check is for TESTrun purposes, not for the C code.
1112 AC_CHECK_DECLS([SKF_AD_VLAN_TAG_PRESENT], [], [], [[#include <linux/filter.h>]])
1119 PLATFORM_C_SRC="pcap-bpf.c"
1122 # Check whether we have the *BSD-style ioctls.
1124 AC_CHECK_HEADERS(net/if_media.h)
1127 # Check whether we have struct BPF_TIMEVAL.
1129 AC_CHECK_TYPES(struct BPF_TIMEVAL,,,
1131 #include <sys/types.h>
1132 #include <sys/ioctl.h>
1133 #ifdef HAVE_SYS_IOCCOM_H
1134 #include <sys/ioccom.h>
1136 #include <net/bpf.h>
1140 # Check whether there's a net/ipnet.h header and,
1141 # if so, whether it defines IPNET_ANY_LINK - if so,
1142 # we assume we have the "any" device (that's a
1143 # Solaris header, and later versions of Solaris
1144 # have an "any" device).
1146 # Attempting to include it at compile time could
1147 # be a pain, as it's a kernel header.
1149 AC_MSG_CHECKING(whether the Solaris "any" device is supported)
1150 if test -e /usr/include/inet/ipnet.h &&
1151 grep -q IPNET_ANY_LINK /usr/include/inet/ipnet.h; then
1153 AC_DEFINE(HAVE_SOLARIS_ANY_DEVICE, 1, [target host supports Solaris "any" device])
1160 PLATFORM_C_SRC="pcap-hurd.c"
1166 # --with-pcap=dag is the only way to get here, and it means
1167 # "DAG support but nothing else"
1169 V_DEFS="$V_DEFS -DDAG_ONLY"
1170 PLATFORM_C_SRC="pcap-dag.c"
1176 # --with-pcap=dpdk is the only way to get here, and it means
1177 # "DPDK support but nothing else"
1179 V_DEFS="$V_DEFS -DDPDK_ONLY"
1180 PLATFORM_C_SRC="pcap-dpdk.c"
1186 # --with-pcap=snf is the only way to get here, and it means
1187 # "SNF support but nothing else"
1189 V_DEFS="$V_DEFS -DSNF_ONLY"
1190 PLATFORM_C_SRC="pcap-snf.c"
1198 PLATFORM_C_SRC="pcap-null.c"
1202 AC_MSG_ERROR($V_PCAP is not a valid pcap type)
1207 dnl Now figure out how we get a list of interfaces and addresses,
1208 dnl if we support capturing. Don't bother if we don't support
1211 if test "$V_PCAP" != null
1213 AC_CHECK_FUNC(getifaddrs,[
1215 # We have "getifaddrs()"; make sure we have <ifaddrs.h>
1216 # as well, just in case some platform is really weird.
1218 AC_CHECK_HEADER(ifaddrs.h,[
1220 # We have the header, so we use "getifaddrs()" to
1221 # get the list of interfaces.
1223 PLATFORM_C_SRC="$PLATFORM_C_SRC fad-getad.c"
1226 # We don't have the header - give up.
1227 # XXX - we could also fall back on some other
1228 # mechanism, but, for now, this'll catch this
1229 # problem so that we can at least try to figure
1230 # out something to do on systems with "getifaddrs()"
1231 # but without "ifaddrs.h", if there is something
1232 # we can do on those systems.
1234 AC_MSG_ERROR([Your system has getifaddrs() but doesn't have a usable <ifaddrs.h>.])
1238 # Well, we don't have "getifaddrs()", at least not with the
1239 # libraries with which we've decided we need to link
1240 # libpcap with, so we have to use some other mechanism.
1242 # Note that this may happen on Solaris, which has
1243 # getifaddrs(), but in -lsocket, not in -lxnet, so we
1244 # won't find it if we link with -lxnet, which we want
1245 # to do for other reasons.
1247 # For now, we use either the SIOCGIFCONF ioctl or the
1248 # SIOCGLIFCONF ioctl, preferring the latter if we have
1249 # it; the latter is a Solarisism that first appeared
1250 # in Solaris 8. (Solaris's getifaddrs() appears to
1251 # be built atop SIOCGLIFCONF; using it directly
1252 # avoids a not-all-that-useful middleman.)
1254 AC_MSG_CHECKING(whether we have SIOCGLIFCONF)
1255 AC_CACHE_VAL(ac_cv_lbl_have_siocglifconf,
1256 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1257 [[#include <sys/param.h>
1258 #include <sys/file.h>
1259 #include <sys/ioctl.h>
1260 #include <sys/socket.h>
1261 #include <sys/sockio.h>]],
1262 [[ioctl(0, SIOCGLIFCONF, (char *)0);]])],
1263 [ac_cv_lbl_have_siocglifconf=yes],
1264 [ac_cv_lbl_have_siocglifconf=no]))
1265 AC_MSG_RESULT($ac_cv_lbl_have_siocglifconf)
1266 if test $ac_cv_lbl_have_siocglifconf = yes ; then
1267 PLATFORM_C_SRC="$PLATFORM_C_SRC fad-glifc.c"
1269 PLATFORM_C_SRC="$PLATFORM_C_SRC fad-gifc.c"
1274 dnl check for hardware timestamp support
1277 AC_CHECK_HEADERS([linux/net_tstamp.h])
1280 AC_MSG_NOTICE(no hardware timestamp support implemented for $host_os)
1285 # Check for socklen_t.
1287 AC_CHECK_TYPES(socklen_t,,,
1289 #include <sys/types.h>
1290 #include <sys/socket.h>
1294 AS_HELP_STRING([--enable-ipv6],[build IPv6-capable version @<:@default=yes@:>@]),
1297 if test "$enable_ipv6" != "no"; then
1299 # We've already made sure we have getaddrinfo above in
1300 # AC_LBL_LIBRARY_NET.
1302 AC_DEFINE(INET6,1,[IPv6])
1305 # Check for Endace DAG card support.
1307 AS_HELP_STRING([--with-dag@<:@=DIR@:>@],[include Endace DAG support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1309 if test "$withval" = no
1311 # User doesn't want DAG support.
1313 elif test "$withval" = yes
1315 # User wants DAG support but hasn't specified a directory.
1318 # User wants DAG support and has specified a directory, so use the provided value.
1323 if test "$V_PCAP" = dag; then
1324 # User requested DAG-only libpcap, so we'd better have
1327 elif test "$xxx_only" = yes; then
1328 # User requested something-else-only pcap, so they don't
1333 # Use DAG API if present, otherwise don't
1339 AC_ARG_WITH([dag-includes],
1340 AS_HELP_STRING([--with-dag-includes=IDIR],[Endace DAG include directory, if not DIR/include]),
1342 # User wants DAG support and has specified a header directory, so use the provided value.
1344 dag_include_dir=$withval
1347 AC_ARG_WITH([dag-libraries],
1348 AS_HELP_STRING([--with-dag-libraries=LDIR],[Endace DAG library directory, if not DIR/lib]),
1350 # User wants DAG support and has specified a library directory, so use the provided value.
1352 dag_lib_dir=$withval
1355 if test "$want_dag" != no; then
1357 # If necessary, set default paths for DAG API headers and libraries.
1358 if test -z "$dag_root"; then
1362 if test -z "$dag_include_dir"; then
1363 dag_include_dir="$dag_root/include"
1366 if test -z "$dag_lib_dir"; then
1367 dag_lib_dir="$dag_root/lib"
1369 # Handle multiarch systems.
1371 if test -d "$dag_lib_dir/$host"
1373 dag_lib_dir="$dag_lib_dir/$host"
1377 AC_LBL_SAVE_CHECK_STATE
1378 CFLAGS="$CFLAGS -I$dag_include_dir"
1379 AC_CHECK_HEADERS([dagapi.h])
1380 AC_LBL_RESTORE_CHECK_STATE
1382 if test "$ac_cv_header_dagapi_h" = yes; then
1384 V_INCLS="$V_INCLS -I$dag_include_dir"
1386 if test $V_PCAP != dag ; then
1387 MODULE_C_SRC="$MODULE_C_SRC pcap-dag.c"
1390 # Check for various DAG API functions.
1391 # Don't need to save and restore LIBS to prevent -ldag being
1392 # included if there's a found-action (arg 3).
1393 AC_LBL_SAVE_CHECK_STATE
1394 LDFLAGS="-L$dag_lib_dir"
1395 AC_CHECK_LIB([dag], [dag_attach_stream64],
1398 # We assume that if we have libdag we have
1399 # libdagconf, as they're installed at the
1400 # same time from the same package.
1402 ADDITIONAL_LIBS="-L$dag_lib_dir $ADDITIONAL_LIBS -ldag -ldagconf"
1403 ADDITIONAL_LIBS_STATIC="-L$dag_lib_dir $ADDITIONAL_LIBS_STATIC -ldag -ldagconf"
1404 LIBS_PRIVATE="-L$dag_lib_dir $LIBS_PRIVATE -ldag -ldagconf"
1406 [AC_MSG_ERROR(DAG library lacks 64-bit streams support)])
1407 AC_LBL_RESTORE_CHECK_STATE
1410 # We assume that if we have libdag we have libdagconf,
1411 # as they're installed at the same time from the same
1414 AC_LBL_SAVE_CHECK_STATE
1415 LIBS="$LIBS -ldag -ldagconf"
1416 LDFLAGS="$LDFLAGS -L$dag_lib_dir"
1417 AC_CHECK_LIB([vdag],[vdag_set_device_info], [ac_dag_have_vdag="1"], [ac_dag_have_vdag="0"])
1418 AC_LBL_RESTORE_CHECK_STATE
1419 if test "$ac_dag_have_vdag" = 1; then
1420 AC_DEFINE(HAVE_DAG_VDAG, 1, [define if you have vdag_set_device_info()])
1421 if test "$ac_lbl_have_pthreads" != "found"; then
1422 AC_MSG_ERROR([DAG requires pthreads, but we didn't find them])
1424 ADDITIONAL_LIBS="$ADDITIONAL_LIBS $PTHREAD_LIBS"
1425 ADDITIONAL_LIBS_STATIC="$ADDITIONAL_LIBS_STATIC $PTHREAD_LIBS"
1426 LIBS_PRIVATE="$LIBS_PRIVATE $PTHREAD_LIBS"
1429 AC_MSG_NOTICE([using Endace DAG API headers from $dag_include_dir])
1430 AC_MSG_NOTICE([using Endace DAG API libraries from $dag_lib_dir])
1431 AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
1433 AC_MSG_CHECKING([whether to enable Endace DAG transmit support (EXPERIMENTAL)])
1434 AC_ARG_ENABLE(dag-tx,
1435 AS_HELP_STRING([--enable-dag-tx],
1436 [enable Endace DAG transmit support (EXPERIMENTAL) @<:@default=no@:>@]
1439 if test "$enable_dag_tx" = "yes"; then
1440 AC_DEFINE(ENABLE_DAG_TX, 1, [Define to 1 if DAG transmit support is enabled])
1442 AC_MSG_RESULT(${enable_dag_tx-no})
1444 if test "$V_PCAP" = dag; then
1445 # User requested "dag" capture type but we couldn't
1446 # find the DAG API support.
1447 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])
1450 if test "$want_dag" = yes; then
1451 # User wanted DAG support but we couldn't find it.
1452 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])
1457 # Check for Myricom SNF support.
1459 AS_HELP_STRING([--with-snf@<:@=DIR@:>@],[include Myricom SNF support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1461 if test "$withval" = no
1463 # User explicitly doesn't want SNF
1465 elif test "$withval" = yes
1467 # User wants SNF support but hasn't specified a directory.
1470 # User wants SNF support with a specified directory.
1475 if test "$V_PCAP" = snf; then
1476 # User requested Sniffer-only libpcap, so we'd better have
1479 elif test "$xxx_only" = yes; then
1480 # User requested something-else-only pcap, so they don't
1485 # Use Sniffer API if present, otherwise don't
1491 AC_ARG_WITH([snf-includes],
1492 AS_HELP_STRING([--with-snf-includes=IDIR],[Myricom SNF include directory, if not DIR/include]),
1494 # User wants SNF with specific header directory
1496 snf_include_dir=$withval
1499 AC_ARG_WITH([snf-libraries],
1500 AS_HELP_STRING([--with-snf-libraries=LDIR],[Myricom SNF library directory, if not DIR/lib]),
1502 # User wants SNF with specific lib directory
1504 snf_lib_dir=$withval
1507 if test "$want_snf" != no; then
1508 # If necessary, set default paths for Sniffer headers and libraries.
1509 if test -z "$snf_root"; then
1513 if test -z "$snf_include_dir"; then
1514 snf_include_dir="$snf_root/include"
1517 if test -z "$snf_lib_dir"; then
1518 snf_lib_dir="$snf_root/lib"
1520 # Handle multiarch systems.
1522 if test -d "$snf_lib_dir/$host"
1524 snf_lib_dir="$snf_lib_dir/$host"
1528 AC_LBL_SAVE_CHECK_STATE
1529 CFLAGS="$CFLAGS -I$snf_include_dir"
1530 # Do not define a symbol.
1531 AC_CHECK_HEADER(snf.h)
1532 AC_LBL_RESTORE_CHECK_STATE
1534 if test "$ac_cv_header_snf_h" = yes; then
1535 # We found a header; make sure we can link with the library
1536 AC_LBL_SAVE_CHECK_STATE
1537 LDFLAGS="$LDFLAGS -L$snf_lib_dir"
1538 # Do not define a symbol.
1539 AC_CHECK_LIB([snf], [snf_init], [ac_cv_lbl_snf_api="yes"])
1540 AC_LBL_RESTORE_CHECK_STATE
1543 if test "$ac_cv_lbl_snf_api" = yes; then
1544 AC_MSG_NOTICE([using Myricom SNF API headers from $snf_include_dir])
1545 AC_MSG_NOTICE([using Myricom SNF API libraries from $snf_lib_dir])
1547 V_INCLS="$V_INCLS -I$snf_include_dir"
1548 ADDITIONAL_LIBS="$ADDITIONAL_LIBS -L$snf_lib_dir -lsnf"
1549 ADDITIONAL_LIBS_STATIC="$ADDITIONAL_LIBS_STATIC -L$snf_lib_dir -lsnf"
1550 LIBS_PRIVATE="$LIBS_PRIVATE -L$snf_lib_dir -lsnf"
1552 if test "$V_PCAP" != snf ; then
1553 MODULE_C_SRC="$MODULE_C_SRC pcap-snf.c"
1556 AC_DEFINE(HAVE_SNF_API, 1, [define if you have the Myricom SNF API])
1558 if test "$V_PCAP" = snf; then
1559 # User requested "snf" capture type but
1560 # we couldn't find the Sniffer API support.
1561 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])
1564 if test "$want_snf" = yes; then
1565 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])
1571 dnl Allow the user to enable remote capture.
1572 dnl It's off by default, as that increases the attack surface of
1573 dnl libpcap, exposing it to malicious servers.
1575 AC_MSG_CHECKING([whether to enable remote packet capture])
1576 AC_ARG_ENABLE([remote],
1577 [AS_HELP_STRING([--enable-remote],
1578 [enable remote packet capture @<:@default=no@:>@])],
1581 case "$enableval" in
1582 yes) AC_MSG_RESULT(yes)
1583 AC_MSG_WARN(Remote packet capture may expose libpcap-based applications)
1584 AC_MSG_WARN(to attacks by malicious remote capture servers!)
1586 # rpcapd requires pthreads on UN*X.
1588 if test "$ac_lbl_have_pthreads" != "found"; then
1589 AC_MSG_ERROR([rpcapd requires pthreads, but we didn't find them])
1592 # It also requires crypt().
1593 # Do we have it in the system libraries?
1595 AC_CHECK_FUNC(crypt,,
1598 # No. Do we have it in -lcrypt?
1600 AC_CHECK_LIB(crypt, crypt,
1603 # Yes; add -lcrypt to the libraries for rpcapd.
1605 RPCAPD_LIBS="$RPCAPD_LIBS -lcrypt"
1608 AC_MSG_ERROR([rpcapd requires crypt(), but we didn't find it])
1613 # OK, we have crypt(). Do we have getspnam()?
1615 AC_CHECK_FUNCS(getspnam)
1618 # Check for various members of struct msghdr.
1620 AC_CHECK_MEMBERS([struct msghdr.msg_control],,,
1622 #include "ftmacros.h"
1623 #include <sys/socket.h>
1625 AC_CHECK_MEMBERS([struct msghdr.msg_flags],,,
1627 #include "ftmacros.h"
1628 #include <sys/socket.h>
1632 # Optionally, we may want to support SSL.
1633 # Check for OpenSSL/libressl.
1635 # First, try looking for it with pkg-config, if we have it.
1637 # Homebrew's pkg-config does not, by default, look for
1638 # pkg-config files for packages it has installed.
1639 # Furthermore, at least for OpenSSL, they appear to be
1640 # dumped in package-specific directories whose paths are
1641 # not only package-specific but package-version-specific.
1643 # So the only way to find openssl is to get the value of
1644 # PKG_CONFIG_PATH from "brew --env openssl" and add that
1645 # to PKG_CONFIG_PATH. (No, we can't just assume it's under
1646 # /usr/local; Homebrew have conveniently chosen to put it
1647 # under /opt/homebrew on ARM.)
1649 # That's the nice thing about Homebrew - it makes things easier!
1652 save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
1653 if test -n "$BREW"; then
1654 openssl_pkgconfig_dir=`$BREW --env --plain openssl | sed -n 's/PKG_CONFIG_PATH: //p'`
1655 PKG_CONFIG_PATH="$openssl_pkgconfig_dir:$PKG_CONFIG_PATH"
1657 PKG_CHECK_MODULE(OPENSSL, openssl,
1660 # We found OpenSSL/libressl.
1663 REQUIRES_PRIVATE="$REQUIRES_PRIVATE openssl"
1665 PKG_CONFIG_PATH="$save_PKG_CONFIG_PATH"
1668 # If it wasn't found, and we have Homebrew installed, see
1669 # if it's in Homebrew.
1671 if test "x$HAVE_OPENSSL" != "xyes" -a -n "$BREW"; then
1672 AC_MSG_CHECKING(for openssl in Homebrew)
1674 # The brew man page lies when it speaks of
1675 # $BREW --prefix --installed <formula>
1676 # outputting nothing. In Homebrew 3.3.16,
1677 # it produces output regardless of whether
1678 # the formula is installed or not, so we
1679 # send the standard output and error to
1682 if $BREW --prefix --installed openssl >/dev/null 2>&1; then
1684 # Yes. Get the include directory and library
1685 # directory. (No, we can't just assume it's
1686 # under /usr/local; Homebrew have conveniently
1687 # chosen to put it under /opt/homebrew on ARM.)
1691 openssl_path=`$BREW --prefix openssl`
1692 OPENSSL_CFLAGS="-I$openssl_path/include"
1693 OPENSSL_LIBS="-L$openssl_path/lib -lssl -lcrypto"
1694 OPENSSL_LIBS_STATIC="-L$openssl_path/lib -lssl -lcrypto"
1695 OPENSSL_LIBS_PRIVATE="-L$openssl_path/lib -lssl -lcrypto"
1702 # If it wasn't found, and /usr/local/include and /usr/local/lib
1703 # exist, check if it's in /usr/local. (We check whether they
1704 # exist because, if they don't exist, the compiler will warn
1705 # about that and then ignore the argument, so they test
1706 # using just the system header files and libraries.)
1708 # We include the standard include file to 1) make sure that
1709 # it's installed (if it's just a shared library for the
1710 # benefit of existing programs, that's not useful) and 2)
1711 # because SSL_library_init() is a library routine in some
1712 # versions and a #defined wrapper around OPENSSL_init_ssl()
1715 if test "x$HAVE_OPENSSL" != "xyes" -a -d "/usr/local/include" -a -d "/usr/local/lib"; then
1716 AC_LBL_SAVE_CHECK_STATE
1717 CFLAGS="$CFLAGS -I/usr/local/include"
1718 LIBS="$LIBS -L/usr/local/lib -lssl -lcrypto"
1719 AC_MSG_CHECKING(whether we have OpenSSL/libressl in /usr/local that we can use)
1720 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1722 #include <openssl/ssl.h>
1731 OPENSSL_CFLAGS="-I/usr/local/include"
1732 OPENSSL_LIBS="-L/usr/local/lib -lssl -lcrypto"
1733 OPENSSL_LIBS_STATIC="-L/usr/local/lib -lssl -lcrypto"
1734 OPENSSL_LIBS_PRIVATE="-L/usr/local/lib -lssl -lcrypto"
1737 AC_LBL_RESTORE_CHECK_STATE
1741 # If it wasn't found, check if it's a system library.
1743 # We include the standard include file to 1) make sure that
1744 # it's installed (if it's just a shared library for the
1745 # benefit of existing programs, that's not useful) and 2)
1746 # because SSL_library_init() is a library routine in some
1747 # versions and a #defined wrapper around OPENSSL_init_ssl()
1750 if test "x$HAVE_OPENSSL" != "xyes"; then
1751 AC_LBL_SAVE_CHECK_STATE
1752 LIBS="$LIBS -lssl -lcrypto"
1753 AC_MSG_CHECKING(whether we have a system OpenSSL/libressl that we can use)
1754 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1756 #include <openssl/ssl.h>
1765 OPENSSL_LIBS="-lssl -lcrypto"
1766 OPENSSL_LIBS_STATIC="-lssl -lcrypto"
1767 OPENSSL_LIBS_PRIVATE="-lssl -lcrypto"
1770 AC_LBL_RESTORE_CHECK_STATE
1774 # OK, did we find it?
1776 if test "x$HAVE_OPENSSL" = "xyes"; then
1777 AC_DEFINE([HAVE_OPENSSL], [1], [Use OpenSSL])
1778 V_INCLS="$V_INCLS $OPENSSL_CFLAGS"
1779 ADDITIONAL_LIBS="$ADDITIONAL_LIBS $OPENSSL_LIBS"
1780 ADDITIONAL_LIBS_STATIC="$ADDITIONAL_LIBS_STATIC $OPENSSL_LIBS_STATIC"
1781 LIBS_PRIVATE="$LIBS_PRIVATE $OPENSSL_LIBS_PRIVATE"
1782 REQUIRES_PRIVATE="$REQUIRES_PRIVATE $OPENSSL_REQUIRES_PRIVATE"
1783 REMOTE_C_SRC="$REMOTE_C_SRC sslutils.c"
1785 AC_MSG_NOTICE(OpenSSL not found)
1788 AC_DEFINE(ENABLE_REMOTE, 1,
1789 [Define to 1 if remote packet capture is to be supported])
1790 REMOTE_C_SRC="$REMOTE_C_SRC pcap-rpcap.c rpcap-protocol.c sockutils.c"
1791 BUILD_RPCAPD=build-rpcapd
1792 INSTALL_RPCAPD=install-rpcapd
1794 *) AC_MSG_RESULT(no)
1798 AC_MSG_CHECKING(whether to build optimizer debugging code)
1799 AC_ARG_ENABLE(optimizer-dbg,
1800 AS_HELP_STRING([--enable-optimizer-dbg],[build optimizer debugging code]))
1801 if test "$enable_optimizer_dbg" = "yes"; then
1802 AC_DEFINE(BDEBUG,1,[Enable optimizer debugging])
1804 AC_MSG_RESULT(${enable_optimizer_dbg-no})
1806 AC_MSG_CHECKING(whether to build parser debugging code)
1807 AC_ARG_ENABLE(yydebug,
1808 AS_HELP_STRING([--enable-yydebug],[build parser debugging code]))
1809 if test "$enable_yydebug" = "yes"; then
1810 AC_DEFINE(YYDEBUG,1,[Enable parser debugging])
1812 AC_MSG_RESULT(${enable_yydebug-no})
1817 AC_PROG_LEX(noyywrap)
1818 if test "$LEX" = ":"; then
1819 AC_MSG_ERROR([Neither flex nor lex was found.])
1823 # Make sure {f}lex supports the -P, --header-file, and --nounput flags
1824 # and supports processing our scanner.l.
1826 AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
1827 if $LEX -P pcap_ --header-file=/dev/null --nounput -t $srcdir/scanner.l > /dev/null 2>&1; then
1828 tcpdump_cv_capable_lex=yes
1830 tcpdump_cv_capable_lex=insufficient
1832 if test $tcpdump_cv_capable_lex = insufficient ; then
1833 AC_MSG_ERROR([$LEX is insufficient to compile libpcap.
1834 libpcap requires Flex 2.5.31 or later, or a compatible version of lex.
1835 If a suitable version of Lex/Flex is available as a non-standard command
1836 and/or not in the PATH, you can specify it using the LEX environment
1837 variable. That said, on some systems the error can mean that Flex/Lex is
1838 actually acceptable, but m4 is not. Likewise, if a suitable version of
1839 m4 (such as GNU M4) is available but has not been detected, you can
1840 specify it using the M4 environment variable.])
1844 # Look for yacc/bison/byacc.
1845 # If it's Bison, we do not want -y, as 1) we will be using -o to cause
1846 # the output for XXX.y to be written to XXX.c and 2) we don't want
1847 # it to issue warnings about stuff not supported by POSIX YACC - we
1848 # want to use that stuff, and don't care whether plain YACC supports
1849 # it or not, we require either Bison or Berkeley YACC.
1855 AC_CHECK_PROGS(BISON_BYACC, bison)
1856 if test x"$BISON_BYACC" != x; then
1860 # Bison prior to 2.4(.1) doesn't support "%define api.pure", so use
1863 bison_major_version=`$BISON_BYACC -V | sed -n 's/.* \(@<:@1-9@:>@@<:@0-9@:>@*\)\.@<:@0-9@:>@@<:@0-9.@:>@*/\1/p'`
1864 bison_minor_version=`$BISON_BYACC -V | sed -n 's/.* @<:@1-9@:>@@<:@0-9@:>@*\.\(@<:@0-9@:>@+\).*/\1/p'`
1865 if test "$bison_major_version" -lt 2 -o \
1866 \( "$bison_major_version" -eq 2 -a "$bison_major_version" -lt 4 \)
1868 REENTRANT_PARSER="%pure-parser"
1870 REENTRANT_PARSER="%define api.pure"
1874 # We didn't find Bison; check for Berkeley YACC, under the
1875 # names byacc and yacc.
1877 AC_CHECK_PROGS(BISON_BYACC, byacc yacc)
1878 if test x"$BISON_BYACC" != x; then
1880 # Make sure this is Berkeley YACC, not AT&T YACC;
1881 # the latter doesn't support reentrant parsers.
1882 # Run it with "-V"; that succeeds and reports the
1883 # version number with Berkeley YACC, but will
1884 # (probably) fail with various vendor flavors
1887 # Hopefully this also eliminates any versions
1888 # of Berkeley YACC that don't support reentrant
1889 # parsers, if there are any.
1891 AC_CACHE_CHECK([for capable yacc], tcpdump_cv_capable_yacc,
1892 if $BISON_BYACC -V >/dev/null 2>&1; then
1893 tcpdump_cv_capable_yacc=yes
1895 tcpdump_cv_capable_yacc=insufficient
1897 if test $tcpdump_cv_capable_yacc = insufficient ; then
1898 AC_MSG_ERROR([$BISON_BYACC is insufficient to compile libpcap.
1899 libpcap requires Bison, a newer version of Berkeley YACC with support
1900 for reentrant parsers, or another YACC compatible with them.])
1904 # OK, we found neither byacc nor yacc.
1906 AC_MSG_ERROR([Neither bison, byacc, nor yacc was found.
1907 libpcap requires Bison, a newer version of Berkeley YACC with support
1908 for reentrant parsers, or another YACC compatible with them.])
1912 # Berkeley YACC doesn't support "%define api.pure", so use
1915 REENTRANT_PARSER="%pure-parser"
1917 AC_SUBST(BISON_BYACC)
1918 AC_SUBST(REENTRANT_PARSER)
1921 # Do various checks for various OSes and versions of those OSes.
1923 # Assume, by default, no support for shared libraries and V7/BSD
1924 # convention for man pages (devices in section 4, file formats in
1925 # section 5, miscellaneous info in section 7, administrative commands
1926 # and daemons in section 8). Individual cases can override this.
1932 MAN_ADMIN_COMMANDS=8
1937 # AIX makes it fun to build shared and static libraries,
1938 # because they're *both* ".a" archive libraries. We
1939 # build the static library for the benefit of the traditional
1940 # scheme of building libpcap and tcpdump in subdirectories of
1941 # the same directory, with tcpdump statically linked with the
1942 # libpcap in question, but we also build a shared library as
1943 # "libpcap.shareda" and install *it*, rather than the static
1944 # library, as "libpcap.a".
1952 # If we're using DLPI, applications will need to
1953 # use /lib/pse.exp if present, as we use the
1956 pseexe="/lib/pse.exp"
1957 AC_MSG_CHECKING(for $pseexe)
1958 if test -f $pseexe ; then
1966 # If we're using BPF, we need "-lodm" and "-lcfg", as
1967 # we use them to load the BPF module.
1976 V_CCOPT="$V_CCOPT -fno-common"
1977 AC_ARG_ENABLE(universal,
1978 AS_HELP_STRING([--disable-universal],[don't build universal on macOS]))
1979 if test "$enable_universal" != "no"; then
1984 # Pre-Tiger. Build only for 32-bit PowerPC; no
1985 # need for any special compiler or linker flags.
1989 darwin8.[[0123]]|darwin8.[[0123]].*)
1991 # Tiger, prior to Intel support. Build
1992 # libraries and executables for 32-bit PowerPC
1993 # and 64-bit PowerPC, with 32-bit PowerPC first.
1994 # (I'm guessing that's what Apple does.)
1996 # (The double brackets are needed because
1997 # autotools/m4 use brackets as a quoting
1998 # character; the double brackets turn into
1999 # single brackets in the generated configure
2002 V_LIB_CCOPT_FAT="-arch ppc -arch ppc64"
2003 V_LIB_LDFLAGS_FAT="-arch ppc -arch ppc64"
2004 V_PROG_CCOPT_FAT="-arch ppc -arch ppc64"
2005 V_PROG_LDFLAGS_FAT="-arch ppc -arch ppc64"
2008 darwin8.[[456]]|darwin8.[[456]].*)
2010 # Tiger, subsequent to Intel support but prior
2011 # to x86-64 support. Build libraries and
2012 # executables for 32-bit PowerPC, 64-bit
2013 # PowerPC, and 32-bit x86, with 32-bit PowerPC
2014 # first. (I'm guessing that's what Apple does.)
2016 # (The double brackets are needed because
2017 # autotools/m4 use brackets as a quoting
2018 # character; the double brackets turn into
2019 # single brackets in the generated configure
2022 V_LIB_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386"
2023 V_LIB_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386"
2024 V_PROG_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386"
2025 V_PROG_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386"
2030 # All other Tiger, so subsequent to x86-64
2031 # support. Build libraries and executables for
2032 # 32-bit PowerPC, 64-bit PowerPC, 32-bit x86,
2033 # and x86-64, with 32-bit PowerPC first. (I'm
2034 # guessing that's what Apple does.)
2036 V_LIB_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
2037 V_LIB_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
2038 V_PROG_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
2039 V_PROG_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
2044 # Leopard. Build libraries for 32-bit PowerPC,
2045 # 64-bit PowerPC, 32-bit x86, and x86-64, with
2046 # 32-bit PowerPC first, and build executables
2047 # for 32-bit x86 and 32-bit PowerPC, with 32-bit
2048 # x86 first. (That's what Apple does.)
2050 V_LIB_CCOPT_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
2051 V_LIB_LDFLAGS_FAT="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
2052 V_PROG_CCOPT_FAT="-arch i386 -arch ppc"
2053 V_PROG_LDFLAGS_FAT="-arch i386 -arch ppc"
2058 # Snow Leopard. Build libraries for x86-64,
2059 # 32-bit x86, and 32-bit PowerPC, with x86-64
2060 # first, and build executables for x86-64 and
2061 # 32-bit x86, with x86-64 first. (That's what
2062 # Apple does, even though Snow Leopard doesn't
2063 # run on PPC, so PPC libpcap runs under Rosetta,
2064 # and Rosetta doesn't support BPF ioctls, so PPC
2065 # programs can't do live captures.)
2067 V_LIB_CCOPT_FAT="-arch x86_64 -arch i386 -arch ppc"
2068 V_LIB_LDFLAGS_FAT="-arch x86_64 -arch i386 -arch ppc"
2069 V_PROG_CCOPT_FAT="-arch x86_64 -arch i386"
2070 V_PROG_LDFLAGS_FAT="-arch x86_64 -arch i386"
2075 # Post-Snow Leopard, pre-Catalina. Build
2076 # libraries for x86-64 and 32-bit x86, with
2077 # x86-64 first, and build executables only for
2078 # x86-64. (That's what Apple does.) This
2079 # requires no special flags for programs.
2081 # We check whether we *can* build for i386 and,
2082 # if not, suggest that the user install the
2083 # /usr/include headers if they want to build
2086 AC_MSG_CHECKING(whether building for 32-bit x86 is supported)
2087 AC_LBL_SAVE_CHECK_STATE
2088 CFLAGS="$CFLAGS -arch i386"
2089 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2094 V_LIB_CCOPT_FAT="-arch x86_64"
2095 V_LIB_LDFLAGS_FAT="-arch x86_64"
2098 # OpenSSL installation on macOS seems
2099 # to install only the libs for 64-bit
2100 # x86 - at least that's what Brew does:
2101 # only configure 32-bit builds if we
2102 # don't have OpenSSL.
2104 if test "$HAVE_OPENSSL" != yes; then
2105 V_LIB_CCOPT_FAT="$V_LIB_CCOPT_FAT -arch i386"
2106 V_LIB_LDFLAGS_FAT="$V_LIB_LDFLAGS_FAT -arch i386"
2111 V_LIB_CCOPT_FAT="-arch x86_64"
2112 V_LIB_LDFLAGS_FAT="-arch x86_64"
2117 # Mojave; you need to install the
2118 # /usr/include headers to get
2119 # 32-bit x86 builds to work.
2121 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])
2126 # Pre-Mojave; the command-line
2127 # tools should be sufficient to
2128 # enable 32-bit x86 builds.
2130 AC_MSG_WARN([Compiling for 32-bit x86 gives an error; try installing the command-line tools])
2134 AC_LBL_RESTORE_CHECK_STATE
2139 # Catalina. Build libraries and executables
2140 # only for x86-64. (That's what Apple does;
2141 # 32-bit x86 binaries are not supported on
2144 V_LIB_CCOPT_FAT="-arch x86_64"
2145 V_LIB_LDFLAGS_FAT="-arch x86_64"
2146 V_PROG_CCOPT_FAT="-arch x86_64"
2147 V_PROG_LDFLAGS_FAT="-arch x86_64"
2152 # Post-Catalina. Build libraries and
2153 # executables for x86-64 and ARM64.
2154 # (That's what Apple does, except they
2155 # build for arm64e, which may include
2156 # some of the pointer-checking extensions.)
2158 # If we're building with libssl, make sure
2159 # we can build fat with it (i.e., that it
2160 # was built fat); if we can't, don't set
2161 # the target architectures, and just
2162 # build for the host we're on.
2164 # Otherwise, just add both of them.
2166 if test "$HAVE_OPENSSL" = yes; then
2167 AC_MSG_CHECKING(whether building fat with libssl is supported)
2168 AC_LBL_SAVE_CHECK_STATE
2169 CFLAGS="$CFLAGS -arch x86_64 -arch arm64"
2170 LDFLAGS="$LDFLAGS $OPENSSL_LIBS"
2171 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2173 #include <openssl/ssl.h>
2181 V_LIB_CCOPT_FAT="-arch x86_64 -arch arm64"
2182 V_LIB_LDFLAGS_FAT="-arch x86_64 -arch arm64"
2183 V_PROG_CCOPT_FAT="-arch x86_64 -arch arm64"
2184 V_PROG_LDFLAGS_FAT="-arch x86_64 -arch arm64"
2188 AC_LBL_RESTORE_CHECK_STATE
2190 V_LIB_CCOPT_FAT="-arch x86_64 -arch arm64"
2191 V_LIB_LDFLAGS_FAT="-arch x86_64 -arch arm64"
2192 V_PROG_CCOPT_FAT="-arch x86_64 -arch arm64"
2193 V_PROG_LDFLAGS_FAT="-arch x86_64 -arch arm64"
2200 hpux9*|hpux10.[01]*)
2201 AC_MSG_ERROR([HP-UX version must be 10.20 or later, not $host_os])
2205 dnl HPUX 10.20 and above is similar to HPUX 9, but
2206 dnl not the same....
2208 dnl XXX - DYEXT should be set to "sl" if this is building
2209 dnl for 32-bit PA-RISC, but should be left as "so" for
2210 dnl 64-bit PA-RISC or, I suspect, IA-64.
2211 AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
2212 if test "`uname -m`" = "ia64"; then
2219 # "-b" builds a shared library; "+h" sets the soname.
2225 # Use System V conventions for man pages.
2231 linux*|freebsd*|netbsd*|openbsd*|dragonfly*|kfreebsd*|gnu*|haiku*|midipix*)
2236 AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
2241 # Make sure errno is thread-safe, in case we're called in
2242 # a multithreaded program. We don't guarantee that two
2243 # threads can use the *same* pcap_t safely, but the
2244 # current version does guarantee that you can use different
2245 # pcap_t's in different threads, and even that pcap_compile()
2246 # is thread-safe (it wasn't thread-safe in some older versions).
2248 V_CCOPT="$V_CCOPT -D_TS_ERRNO"
2250 case "`uname -r`" in
2257 # Use System V conventions for man pages.
2259 MAN_ADMIN_COMMANDS=1m
2266 AC_SUBST(V_LIB_CCOPT_FAT)
2267 AC_SUBST(V_LIB_LDFLAGS_FAT)
2268 AC_SUBST(V_PROG_CCOPT_FAT)
2269 AC_SUBST(V_PROG_LDFLAGS_FAT)
2271 AC_SUBST(MAN_DEVICES)
2272 AC_SUBST(MAN_FILE_FORMATS)
2273 AC_SUBST(MAN_MISC_INFO)
2274 AC_SUBST(MAN_ADMIN_COMMANDS)
2276 AC_ARG_ENABLE(shared,
2277 AS_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@]))
2278 test "x$enable_shared" = "xno" && DYEXT="none"
2281 AC_CHECK_TOOL([AR], [ar])
2286 AC_LBL_DEVEL(V_CCOPT)
2289 # Check to see if the sockaddr struct has the 4.4 BSD sa_len member.
2291 AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,
2293 #include <sys/types.h>
2294 #include <sys/socket.h>
2298 # Check to see if the dl_hp_ppa_info_t struct has the HP-UX 11.00
2299 # dl_module_id_1 member.
2301 # NOTE: any failure means we conclude that it doesn't have that member,
2302 # so if we don't have DLPI, don't have a <sys/dlpi_ext.h> header, or
2303 # have one that doesn't declare a dl_hp_ppa_info_t type, we conclude
2304 # it doesn't have that member (which is OK, as either we won't be
2305 # using code that would use that member, or we wouldn't compile in
2308 AC_CHECK_MEMBERS([dl_hp_ppa_info_t.dl_module_id_1],,,
2310 #include <sys/types.h>
2311 #include <sys/dlpi.h>
2312 #include <sys/dlpi_ext.h>
2316 # Various Linux-specific mechanisms.
2318 AC_ARG_ENABLE([usb],
2319 [AS_HELP_STRING([--enable-usb],[enable Linux usbmon USB capture support @<:@default=yes, if support available@:>@])],
2324 # If somebody requested an XXX-only pcap, that doesn't include
2325 # additional mechanisms.
2327 if test "$xxx_only" != yes; then
2330 dnl check for USB sniffing support
2331 AC_MSG_CHECKING(for Linux usbmon USB sniffing support)
2332 if test "x$enable_usb" != "xno" ; then
2333 AC_DEFINE(PCAP_SUPPORT_LINUX_USBMON, 1, [target host supports Linux usbmon for USB sniffing])
2334 MODULE_C_SRC="$MODULE_C_SRC pcap-usb-linux.c"
2337 # Note: if the directory for special files is *EVER* somewhere
2338 # other than the UN*X standard of /dev (which will break any
2339 # software that looks for /dev/null or /dev/tty, for example,
2340 # so doing that is *REALLY* not a good idea), please provide
2341 # some mechanism to determine that directory at *run time*,
2342 # rather than *configure time*, so that it works when doing
2343 # a cross-build, and that works with *multiple* distributions,
2344 # with our without udev, and with multiple versions of udev,
2345 # with udevinfo or udevadm or any other mechanism to get the
2346 # special files directory.
2348 # Do we have a version of <linux/compiler.h> available?
2349 # If so, we might need it for <linux/usbdevice_fs.h>.
2351 AC_CHECK_HEADERS(linux/compiler.h)
2352 if test "$ac_cv_header_linux_compiler_h" = yes; then
2354 # Yes - include it when testing for <linux/usbdevice_fs.h>.
2356 AC_CHECK_HEADERS(linux/usbdevice_fs.h,,,[#include <linux/compiler.h>])
2358 AC_CHECK_HEADERS(linux/usbdevice_fs.h)
2360 if test "$ac_cv_header_linux_usbdevice_fs_h" = yes; then
2362 # OK, does it define bRequestType? Older versions of the kernel
2363 # define fields with names like "requesttype, "request", and
2364 # "value", rather than "bRequestType", "bRequest", and
2367 AC_CHECK_MEMBERS([struct usbdevfs_ctrltransfer.bRequestType],,,
2370 #ifdef HAVE_LINUX_COMPILER_H
2371 #include <linux/compiler.h>
2373 #include <linux/usbdevice_fs.h>
2381 # Life's too short to deal with trying to get this to compile
2382 # if you don't get the right types defined with
2383 # __KERNEL_STRICT_NAMES getting defined by some other include.
2385 # Check whether the includes Just Work. If not, don't turn on
2386 # netfilter support.
2388 AC_MSG_CHECKING(whether we can compile the netfilter support)
2389 AC_CACHE_VAL(ac_cv_netfilter_can_compile,
2390 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2392 #include <sys/socket.h>
2393 #include <netinet/in.h>
2394 #include <linux/types.h>
2396 #include <linux/netlink.h>
2397 #include <linux/netfilter.h>
2398 #include <linux/netfilter/nfnetlink.h>
2399 #include <linux/netfilter/nfnetlink_log.h>
2400 #include <linux/netfilter/nfnetlink_queue.h>]],
2402 [ac_cv_netfilter_can_compile=yes],
2403 [ac_cv_netfilter_can_compile=no]))
2404 AC_MSG_RESULT($ac_cv_netfilter_can_compile)
2405 if test $ac_cv_netfilter_can_compile = yes ; then
2406 AC_DEFINE(PCAP_SUPPORT_NETFILTER, 1,
2407 [target host supports netfilter sniffing])
2408 MODULE_C_SRC="$MODULE_C_SRC pcap-netfilter-linux.c"
2413 AC_SUBST(PCAP_SUPPORT_LINUX_USBMON)
2414 AC_SUBST(PCAP_SUPPORT_NETFILTER)
2416 AC_ARG_ENABLE([netmap],
2417 [AS_HELP_STRING([--enable-netmap],[enable netmap support @<:@default=yes, if support available@:>@])],
2419 [enable_netmap=yes])
2421 if test "x$enable_netmap" != "xno" ; then
2423 # Check whether net/netmap_user.h is usable if NETMAP_WITH_LIBS is
2424 # defined; it's not usable on DragonFly BSD 4.6 if NETMAP_WITH_LIBS
2425 # is defined, for example, as it includes a nonexistent malloc.h
2428 AC_MSG_CHECKING(whether we can compile the netmap support)
2429 AC_CACHE_VAL(ac_cv_net_netmap_user_can_compile,
2430 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2432 #define NETMAP_WITH_LIBS
2433 #include <net/netmap_user.h>]],
2435 [ac_cv_net_netmap_user_can_compile=yes],
2436 [ac_cv_net_netmap_user_can_compile=no]))
2437 AC_MSG_RESULT($ac_cv_net_netmap_user_can_compile)
2438 if test $ac_cv_net_netmap_user_can_compile = yes ; then
2439 AC_DEFINE(PCAP_SUPPORT_NETMAP, 1,
2440 [target host supports netmap])
2441 MODULE_C_SRC="$MODULE_C_SRC pcap-netmap.c"
2443 AC_SUBST(PCAP_SUPPORT_NETMAP)
2446 # Check for DPDK support.
2448 AS_HELP_STRING([--with-dpdk@<:@=DIR@:>@],[include DPDK support (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
2450 if test "$withval" = no
2452 # User doesn't want DPDK support.
2454 elif test "$withval" = yes
2456 # User wants DPDK support but hasn't specified a directory.
2459 # User wants DPDK support and has specified a directory,
2460 # so use the provided value.
2465 if test "$V_PCAP" = dpdk; then
2466 # User requested DPDK-only libpcap, so we'd better have
2469 elif test "$xxx_only" = yes; then
2470 # User requested something-else-only pcap, so they don't
2471 # want DPDK support.
2475 # Use DPDK API if present, otherwise don't
2481 if test "$want_dpdk" != no; then
2483 # The user didn't explicitly say they don't want DPDK,
2484 # so see if we have it.
2486 # We only try to find it using pkg-config; DPDK is *SO*
2487 # complicated - DPDK 19.02, for example, has about 117(!)
2488 # libraries, and the precise set of libraries required has
2489 # changed over time - so attempting to guess which libraries
2490 # you need, and hardcoding that in an attempt to find the
2491 # libraries without DPDK, rather than relying on DPDK to
2492 # tell you, with a .pc file, what libraries are needed,
2493 # is *EXTREMELY* fragile and has caused some bug reports,
2494 # so we're just not going to do it.
2496 # If that causes a problem, the only thing we will do is
2497 # accept an alternative way of finding the appropriate
2498 # library set for the installed version of DPDK that is
2499 # as robust as pkg-config (i.e., it had better work as well
2500 # as pkg-config with *ALL* versions of DPDK that provide a
2503 # If --with-dpdk={path} was specified, add {path}/pkgconfig
2504 # to PKG_CONFIG_PATH, so we look for the .pc file there,
2507 save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
2508 if test -n "$dpdk_dir"; then
2509 PKG_CONFIG_PATH="$dpdk_dir:$PKG_CONFIG_PATH"
2511 PKG_CHECK_MODULE(DPDK, libdpdk,
2515 PKG_CONFIG_PATH="$save_PKG_CONFIG_PATH"
2520 if test "$found_dpdk" = yes; then
2524 # We call rte_eth_dev_count_avail(), and older versions
2525 # of DPDK didn't have it, so check for it.
2527 AC_LBL_SAVE_CHECK_STATE
2528 CFLAGS="$CFLAGS $DPDK_CFLAGS"
2529 LIBS="$LIBS $DPDK_LIBS"
2530 AC_CHECK_FUNC(rte_eth_dev_count_avail)
2531 AC_LBL_RESTORE_CHECK_STATE
2534 if test "$ac_cv_func_rte_eth_dev_count_avail" = yes; then
2536 # We found a usable DPDK.
2538 # Check whether the rte_ether.h file defines
2539 # struct ether_addr or struct rte_ether_addr.
2541 # ("API compatibility? That's for losers!")
2543 AC_LBL_SAVE_CHECK_STATE
2544 CFLAGS="$CFLAGS $DPDK_CFLAGS"
2545 LIBS="$LIBS $DPDK_LIBS"
2546 AC_CHECK_TYPES(struct rte_ether_addr,,,
2548 #include <rte_ether.h>
2550 AC_LBL_RESTORE_CHECK_STATE
2553 # We can build with DPDK.
2555 V_INCLS="$V_INCLS $DPDK_CFLAGS"
2556 ADDITIONAL_LIBS="$ADDITIONAL_LIBS $DPDK_LIBS"
2557 ADDITIONAL_LIBS_STATIC="$ADDITIONAL_LIBS_STATIC $DPDK_LIBS_STATIC"
2558 REQUIRES_PRIVATE="$REQUIRES_PRIVATE libdpdk"
2559 AC_DEFINE(PCAP_SUPPORT_DPDK, 1, [target host supports DPDK])
2560 if test $V_PCAP != dpdk ; then
2561 MODULE_C_SRC="$MODULE_C_SRC pcap-dpdk.c"
2565 # We didn't find a usable DPDK.
2566 # If we required it (with --with-dpdk or --with-pcap=dpdk),
2567 # fail with an appropriate message telling the user what
2568 # the problem was, otherwise note the problem with a
2571 if test "$found_dpdk" != yes; then
2573 # Not found with pkg-config. Note that we
2574 # require that DPDK must be findable with
2577 if test "$V_PCAP" = dpdk; then
2579 # User requested DPDK-only capture support.
2582 [DPDK support requested with --with-pcap=dpdk, but
2583 we couldn't find DPDK with pkg-config. Make sure that pkg-config is
2584 installed, that DPDK 18.02.2 or later is installed, and that DPDK
2585 provides a .pc file.])
2588 if test "$want_dpdk" = yes; then
2590 # User requested that libpcap include
2591 # DPDK capture support.
2594 [DPDK support requested with --with-dpdk, but we
2595 couldn't find DPDK with pkg-config. Make sure that pkg-config
2596 is installed, that DPDK 18.02.2 or later is installed, and that
2597 DPDK provides .pc file.])
2601 # User didn't indicate whether they wanted DPDK
2602 # or not; just warn why we didn't find it.
2605 [We couldn't find DPDK with pkg-config. If
2606 you want DPDK support, make sure that pkg-config is installed,
2607 that DPDK 18.02.2 or later is installed, and that DPDK provides a
2609 elif test "$ac_cv_func_rte_eth_dev_count_avail" != yes; then
2611 # Found with pkg-config, but we couldn't compile
2612 # a program that calls rte_eth_dev_count(); we
2613 # probably have the developer package installed,
2614 # but don't have a sufficiently recent version
2615 # of DPDK. Note that we need a sufficiently
2616 # recent version of DPDK.
2618 if test "$V_PCAP" = dpdk; then
2620 # User requested DPDK-only capture support.
2623 [DPDK support requested with --with-pcap=dpdk, but we
2624 can't compile libpcap with DPDK. Make sure that DPDK 18.02.2 or later
2628 if test "$want_dpdk" = yes; then
2630 # User requested that libpcap include
2631 # DPDK capture support.
2634 [DPDK support requested with --with-dpdk, but
2635 we can't compile libpcap with DPDK. Make sure that DPDK 18.02.2
2636 or later is DPDK is installed.])
2640 # User didn't indicate whether they wanted DPDK
2641 # or not; just warn why we didn't find it.
2644 [DPDK was found, but we can't compile libpcap with it.
2645 Make sure that DPDK 18.02.2 or later is installed.])
2649 AC_SUBST(PCAP_SUPPORT_DPDK)
2651 AC_ARG_ENABLE([bluetooth],
2652 [AS_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
2654 [enable_bluetooth=ifsupportavailable])
2656 if test "$xxx_only" = yes; then
2657 # User requested something-else-only pcap, so they don't
2658 # want Bluetooth support.
2662 if test "x$enable_bluetooth" != "xno" ; then
2663 dnl check for Bluetooth sniffing support
2666 AC_CHECK_HEADER(bluetooth/bluetooth.h,
2669 # We have bluetooth.h, so we support Bluetooth
2672 AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
2673 MODULE_C_SRC="$MODULE_C_SRC pcap-bt-linux.c"
2674 AC_MSG_NOTICE(Bluetooth sniffing is supported)
2675 ac_lbl_bluetooth_available=yes
2678 # OK, does struct sockaddr_hci have an hci_channel
2681 AC_CHECK_MEMBERS([struct sockaddr_hci.hci_channel],
2684 # Yes; is HCI_CHANNEL_MONITOR defined?
2686 AC_MSG_CHECKING(if HCI_CHANNEL_MONITOR is defined)
2687 AC_CACHE_VAL(ac_cv_lbl_hci_channel_monitor_is_defined,
2688 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
2690 #include <bluetooth/bluetooth.h>
2691 #include <bluetooth/hci.h>
2694 int i = HCI_CHANNEL_MONITOR;
2698 AC_DEFINE(PCAP_SUPPORT_BT_MONITOR, 1,
2699 [target host supports Bluetooth Monitor])
2700 MODULE_C_SRC="$MODULE_C_SRC pcap-bt-monitor-linux.c"
2707 #include <bluetooth/bluetooth.h>
2708 #include <bluetooth/hci.h>
2713 # We don't have bluetooth.h, so we don't support
2714 # Bluetooth sniffing.
2716 if test "x$enable_bluetooth" = "xyes" ; then
2717 AC_MSG_ERROR(Bluetooth sniffing is not supported; install a Bluetooth devel library (libbluetooth-dev|bluez-libs-devel|bluez-dev|libbluetooth-devel|...) to enable it)
2719 AC_MSG_NOTICE(Bluetooth sniffing is not supported; install a Bluetooth devel library (libbluetooth-dev|bluez-libs-devel|bluez-dev|libbluetooth-devel|...) to enable it)
2724 if test "x$enable_bluetooth" = "xyes" ; then
2725 AC_MSG_ERROR(no Bluetooth sniffing support implemented for $host_os)
2727 AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
2731 AC_SUBST(PCAP_SUPPORT_BT)
2734 AC_ARG_ENABLE([dbus],
2735 [AS_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])],
2737 [enable_dbus=ifavailable])
2739 if test "$xxx_only" = yes; then
2740 # User requested something-else-only pcap, so they don't
2741 # want D-Bus support.
2745 if test "x$enable_dbus" != "xno"; then
2746 if test "x$enable_dbus" = "xyes"; then
2751 # We don't support D-Bus sniffing on macOS; see
2753 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
2755 # The user requested it, so fail.
2757 AC_MSG_ERROR([Due to freedesktop.org bug 74029, D-Bus capture support is not available on macOS])
2764 # We don't support D-Bus sniffing on macOS; see
2766 # https://bugs.freedesktop.org/show_bug.cgi?id=74029
2768 # The user didn't explicitly request it, so just
2769 # silently refuse to enable it.
2777 if test "x$enable_dbus" != "xno"; then
2778 PKG_CHECK_MODULE(DBUS, dbus-1,
2780 AC_LBL_SAVE_CHECK_STATE
2781 CFLAGS="$CFLAGS $DBUS_CFLAGS"
2782 LIBS="$LIBS $DBUS_LIBS"
2783 AC_MSG_CHECKING(whether the D-Bus library defines dbus_connection_read_write)
2784 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2785 [[#include <string.h>
2788 #include <sys/time.h>
2790 #include <dbus/dbus.h>]],
2791 [[return dbus_connection_read_write(NULL, 0);]])],
2793 AC_MSG_RESULT([yes])
2794 AC_DEFINE(PCAP_SUPPORT_DBUS, 1, [support D-Bus sniffing])
2795 MODULE_C_SRC="$MODULE_C_SRC pcap-dbus.c"
2796 V_INCLS="$V_INCLS $DBUS_CFLAGS"
2797 ADDITIONAL_LIBS="$ADDITIONAL_LIBS $DBUS_LIBS"
2798 ADDITIONAL_LIBS_STATIC="$ADDITIONAL_LIBS_STATIC $DBUS_LIBS_STATIC"
2799 REQUIRES_PRIVATE="$REQUIRES_PRIVATE dbus-1"
2803 if test "x$enable_dbus" = "xyes"; then
2804 AC_MSG_ERROR([--enable-dbus was given, but the D-Bus library doesn't define dbus_connection_read_write()])
2807 AC_LBL_RESTORE_CHECK_STATE
2810 if test "x$enable_dbus" = "xyes"; then
2811 AC_MSG_ERROR([--enable-dbus was given, but the dbus-1 package is not installed])
2814 AC_SUBST(PCAP_SUPPORT_DBUS)
2817 AC_ARG_ENABLE([rdma],
2818 [AS_HELP_STRING([--enable-rdma],[enable RDMA capture support @<:@default=yes, if support available@:>@])],
2820 [enable_rdma=ifavailable])
2822 if test "$xxx_only" = yes; then
2823 # User requested something-else-only pcap, so they don't
2824 # want RDMA support.
2828 if test "x$enable_rdma" != "xno"; then
2829 PKG_CHECK_MODULE(LIBIBVERBS, libibverbs,
2831 found_libibverbs=yes
2832 LIBIBVERBS_REQUIRES_PRIVATE="libibverbs"
2835 if test "x$found_libibverbs" != "xyes"; then
2836 AC_CHECK_LIB(ibverbs, ibv_get_device_list,
2838 found_libibverbs=yes
2839 LIBIBVERBS_CFLAGS=""
2840 LIBIBVERBS_LIBS="-libverbs"
2841 # XXX - at least on Ubuntu 20.04, there are many more
2842 # libraries needed; is there any platform where
2843 # libibverbs is available but where pkg-config isn't
2844 # available or libibverbs doesn't use it? If not,
2845 # we should only use pkg-config for it.
2846 LIBIBVERBS_LIBS_STATIC="-libverbs"
2847 LIBIBVERBS_LIBS_PRIVATE="-libverbs"
2852 if test "x$found_libibverbs" = "xyes"; then
2853 AC_LBL_SAVE_CHECK_STATE
2854 CFLAGS="$CFLAGS $LIBIBVERBS_CFLAGS"
2855 LIBS="$LIBS $LIBIBVERBS_LIBS"
2856 AC_CHECK_HEADER(infiniband/verbs.h, [
2858 # ibv_create_flow may be defined as a static inline
2859 # function in infiniband/verbs.h, so we can't
2862 # Too bad autoconf has no AC_SYMBOL_EXISTS()
2863 # macro that works like CMake's check_symbol_exists()
2864 # function, to check do a compile check like
2865 # this (they do a clever trick to avoid having
2866 # to know the function's signature).
2868 AC_MSG_CHECKING(whether libibverbs defines ibv_create_flow)
2869 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2871 #include <infiniband/verbs.h>
2874 (void) ibv_create_flow((struct ibv_qp *) NULL,
2875 (struct ibv_flow_attr *) NULL);
2878 AC_MSG_RESULT([yes])
2879 found_usable_libibverbs=yes
2886 AC_LBL_RESTORE_CHECK_STATE
2889 if test "x$found_usable_libibverbs" = "xyes"
2891 AC_DEFINE(PCAP_SUPPORT_RDMASNIFF, 1, [target host supports RDMA sniffing])
2892 MODULE_C_SRC="$MODULE_C_SRC pcap-rdmasniff.c"
2893 CFLAGS="$LIBIBVERBS_CFLAGS $CFLAGS"
2894 ADDITIONAL_LIBS="$LIBIBVERBS_LIBS $ADDITIONAL_LIBS"
2895 ADDITIONAL_LIBS_STATIC="$LIBIBVERBS_LIBS_STATIC $ADDITIONAL_LIBS_STATIC"
2896 LIBS_PRIVATE="$LIBIBVERBS_LIBS_PRIVATE $LIBS_PRIVATE"
2897 REQUIRES_PRIVATE="$REQUIRES_PRIVATE $LIBIBVERBS_REQUIRES_PRIVATE"
2899 AC_SUBST(PCAP_SUPPORT_RDMASNIFF)
2903 # If this is a platform where we need to have the .pc file and
2904 # pcap-config script supply an rpath option to specify the directory
2905 # in which the libpcap shared library is installed, and the install
2906 # prefix /usr (meaning we're not installing a system library), provide
2909 # (We must check $prefix, as $libdir isn't necessarily /usr/lib in this
2910 # case - for example, Linux distributions for 64-bit platforms that
2911 # also provide support for binaries for a 32-bit version of the
2912 # platform may put the 64-bit libraries, the 32-bit libraries, or both
2913 # in directories other than /usr/lib.)
2915 # In AIX, do we have to do this?
2917 # In Darwin-based OSes, the full paths of the shared libraries with
2918 # which the program was linked are stored in the executable, so we don't
2919 # need to provide an rpath option.
2921 # With the HP-UX linker, directories specified with -L are, by default,
2922 # added to the run-time search path, so we don't need to supply them.
2924 # This must *not* depend on the compiler, as, on platforms where there's
2925 # a GCC-compatible compiler and a vendor compiler, we need to work with
2928 if test "$prefix" != "/usr"; then
2931 freebsd*|netbsd*|openbsd*|dragonfly*|linux*|haiku*|midipix*|gnu*)
2933 # Platforms where the "native" C compiler is GCC or
2934 # accepts compatible command-line arguments, and the
2935 # "native" linker is the GNU linker or accepts
2936 # compatible command-line arguments.
2938 RPATH="-Wl,-rpath,\${libdir}"
2943 # Sun/Oracle's linker, the GNU linker, and
2944 # GNU-compatible linkers all support -R.
2946 RPATH="-Wl,-R,\${libdir}"
2953 AC_CONFIG_HEADERS([config.h])
2955 AC_SUBST(V_SHLIB_CCOPT)
2956 AC_SUBST(V_SHLIB_CMD)
2957 AC_SUBST(V_SHLIB_OPT)
2958 AC_SUBST(V_SONAME_OPT)
2961 AC_SUBST(ADDLARCHIVEOBJS)
2962 AC_SUBST(PLATFORM_C_SRC)
2963 AC_SUBST(MODULE_C_SRC)
2964 AC_SUBST(REMOTE_C_SRC)
2965 AC_SUBST(PTHREAD_LIBS)
2966 AC_SUBST(BUILD_RPCAPD)
2967 AC_SUBST(INSTALL_RPCAPD)
2968 AC_SUBST(RPCAPD_LIBS)
2971 # We're done with configuration operations; add ADDITIONAL_LIBS and
2972 # ADDITIONAL_LIBS_STATIC to LIBS and LIBS_STATIC, respectively.
2974 LIBS="$ADDITIONAL_LIBS $LIBS"
2975 LIBS_STATIC="$ADDITIONAL_LIBS_STATIC $LIBS_STATIC"
2977 AC_CONFIG_COMMANDS([.devel],[[if test -f .devel; then
2978 echo timestamp > stamp-h
2979 cat $srcdir/Makefile-devel-adds >> Makefile
2980 make depend || exit 1
2982 AC_CONFIG_FILES([Makefile grammar.y pcap-filter.manmisc pcap-linktype.manmisc
2983 pcap-tstamp.manmisc cbpf-savefile.manfile pcap-savefile.manfile pcap.3pcap
2984 pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap
2985 pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap
2986 pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap
2987 pcap_open_offline.3pcap pcap_set_immediate_mode.3pcap
2988 pcap_set_tstamp_precision.3pcap pcap_set_tstamp_type.3pcap
2989 rpcapd/Makefile rpcapd/rpcapd.manadmin rpcapd/rpcapd-config.manfile
2990 testprogs/Makefile])