forked from dotpcap/packetnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-libpcap.sh
35 lines (26 loc) · 939 Bytes
/
install-libpcap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# the default installation of libpcap does not have remote pcap enabled
# so we need to compile our own
# see https://github.com/the-tcpdump-group/libpcap/issues/795
# Those are the dependencies needed to build libpcap
if [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX, use https://www.macports.org/
port install bison
port install flex
else
# Ubuntu
apt-get install -y build-essential bison flex
fi
# clone into tmp folder
rm -rf /tmp/install-libpcap
# 1.9.1 is the version we tested to work
git clone --depth 1 -b libpcap-1.9.1 https://github.com/the-tcpdump-group/libpcap.git /tmp/install-libpcap
pushd /tmp/install-libpcap
# remote is disabled by default, so we need to enable it
./configure --enable-remote --disable-universal
# install the library
make install
# create the necessary links and cache
# see https://www.mono-project.com/docs/advanced/pinvoke/dllnotfoundexception/
ldconfig
popd