本文档描述源代码版本为最新的:libpcap-1.8.1以及tcpdump-4.9.0
编译libpcap-1.8.1
vim configure按如下修改:
make
make install
编译tcpdump
./configure --prefix=/home/default/share/tool/pub --host=arm-hisiv400-linux --target=arm-hisiv400-linux CC=arm-hisiv400-linux-gcc
make
make install
会在/home/default/share/tool/pub/sbin/目录下生成tcpdump工具
编译libpcap-1.8.1
vim configure按如下修改:
5435 #add by lt 20170319
5436 #if test -z "$with_pcap" && test "$cross_compiling" = yes; then
5437 # as_fn_error $? "pcap type not determined when cross-compiling; use --with-pcap=..." "$LINENO" 5
5438 #fi
5439
5440 # Check whether --with-pcap was given.
5441 #if test "${with_pcap+set}" = set; then :
5442 # withval=$with_pcap;
5443 #fi
ubuntu主机安装一些依赖库
sudo apt-get install flex bison
sudo apt-get install libnl-3-200
sudo apt-get install libnl-3-dev
sudo apt-get install libnl-genl-3-dev
make
make install
编译tcpdump
./configure --prefix=/home/default/share/tool/pub --host=arm-hisiv400-linux --target=arm-hisiv400-linux CC=arm-hisiv400-linux-gcc
make
make install
会在/home/default/share/tool/pub/sbin/目录下生成tcpdump工具