diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-07-08 15:29:09 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-07-08 15:30:30 +0200 |
commit | 55277b45317d75fa8d7e2359c02104188247e726 (patch) | |
tree | 66db5277b7e7b86811a155caccb76649bc4e114a /configure | |
parent | c9e442aeccd87748d9e87bf357bd8337e699a9b0 (diff) |
configure: Add check for libpcap
libpcap is used to compile tcpdump-like filters in netsniff-ng, so check
for it in configure.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -272,6 +272,29 @@ EOF fi } +check_libpcap() +{ + echo -n "[*] Checking libpcap ... " + + cat > $TMPDIR/pcaptest.c << EOF +#include <pcap.h> + +void main(void) +{ + struct bpf_program bpf; + int ret = pcap_compile_nopcap(65535, 1, &bpf, "foo.bpf", 1, 0xffffffff); +} +EOF + + $CC -o $TMPDIR/pcaptest $TMPDIR/pcaptest.c -lpcap >> $TMPDIR/config.log 2>&1 + if [ ! -x $TMPDIR/pcaptest ] ; then + echo "[NO]" + MISSING_DEFS=1 + else + echo "[YES]" + fi +} + echo "# This file is autogenerated by the configure script" > Config check_pkg_config @@ -289,6 +312,7 @@ check_ncurses check_libgeoip check_zlib check_urcu +check_libpcap if [ "$MISSING_DEFS" == "1" ] ; then echo "[!] Some libraries or header definitions are missing or too old." |