]> The Tcpdump Group git mirrors - tcpdump/commit
Fix the handling of libpcap.
authorGuy Harris <[email protected]>
Thu, 30 Nov 2017 02:18:01 +0000 (18:18 -0800)
committerGuy Harris <[email protected]>
Thu, 30 Nov 2017 02:18:18 +0000 (18:18 -0800)
commitcfc4c750a225e893eeeca78eddb95fdc7125aabf
tree14ad37d2788614dc85b5d5a26effc47e8d242d81
parent415160c0c2d210358a0225be53922728f7cd9651
Fix the handling of libpcap.

We have four possibilities:

  1) local library, with a pcap-config;
  2) local library, without a pcap-config;
  3) installed library, with a pcap-config;
  4) installed library, without a pcap-config.

If we have a local library, i.e. one in ../libpcap{whatever}, we:

    add -I flags to the C compiler flags to point it at whatever
    directories in ../libpcap{whatever};

    add ../libpcap{whatever}/libpcap.a to $LIBS and:

        if it has a pcap-config, we use it, with --additional-libraries,
        to find the additional libraries with which we need to link;

        otherwise, we do the usual OS-dependent hacks to try to figure
        out with what additional flags we need to link;

    and add them to $LIBS after libpcap.a.

If we have an installed library:

    if it has a pcap-config we use it, with --cflags, to find what flags
    to add to the C compiler flags, and use it, with --libs, to see what
    flags to add to $LIBS;

    if it doesn't have a pcap-config, we search for -lpcap and, if that
    succeeds, we assume the headers are under /usr/local/include or
    /usr/include, search for them there, and, if we don't find pcap.h
    there, we look for it in a pcap subdirectory under there, and add
    the appropriate -I flag to the C compiler flags, and then do the
    usual OS-dependent hacks to try to figure out with what additional
    flags we need to link.

While we're at it, we do the libdlpi check only on Solaris, as part of
"the usual OS-dependent hacks".
aclocal.m4
configure
configure.in