1.下载源码
git clone https://github.com/the-tcpdump-group/libpcap.git
git clone https://github.com/the-tcpdump-group/tcpdump.git
2.交叉编译libpcap
- 执行sh autogen.sh 生成configure
- 设置交叉编译链 ./configure --host=arm-linux-gnueabihf
- 设置install环境,将Makefile文件中的prefix变量修改为当前目录的local目录 TODO 这个应该可以设置,但是没找到,回头找一下
- 执行make和make install
3.交叉编译tcpdump
- 执行sh autogen.sh 生成configure
- 链接一下libpcap ln -s ../libpcap/local/ libpcap
- ./configure --host=arm-linux-gnueabihf CFLAGS="-I./libpcap/include/ -L./libpcap/lib/"
- 执行make
参考文章
https://blog.csdn.net/qwqwqw1232/article/details/121253015
标签:git,configure,libpcap,交叉,编译,sh,tcpdump From: https://www.cnblogs.com/sesameboy/p/18171679