summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-07-08 15:29:09 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-07-08 15:30:30 +0200
commit55277b45317d75fa8d7e2359c02104188247e726 (patch)
tree66db5277b7e7b86811a155caccb76649bc4e114a
parentc9e442aeccd87748d9e87bf357bd8337e699a9b0 (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>
-rwxr-xr-xconfigure24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure b/configure
index 2c9142d..4ebe013 100755
--- a/configure
+++ b/configure
@@ -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."