移植pcap库到ARM开发板
2010-10-23 21:59
281 查看
首先到http://www.tcpdump.org/上下载libpcap-0.9.4源代码 ,解压后进入目录,一下为具体的执行过程:
[root@olive libpcap-0.9.4]# ./configure --host=arm-linux
configure: error: pcap type not determined when cross-compiling; use --with-pcap=...
运行configure说交叉编译时没指定pcap类型,看了README文档,试了指定了几种类型,但configure时均出错!没办法了,只好采取暴力措施了,在configure脚本中注释掉检查交叉编译的部分,具体注释掉一下语句:
#if test -z "$with_pcap" && test "$cross_compiling" = yes; then
# { { echo "$as_me:$LINENO: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&5
#echo "$as_me: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&2;}
# { (exit 1); exit 1; }; }
#fi
.......
# if test $ac_cv_linux_vers = unknown ; then
# { { echo "$as_me:$LINENO: error: cannot determine linux version when cross-compiling" >&5
#echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
# { (exit 1); exit 1; }; }
# fi
再次运行configure命令,这下终于OK!终于生成了Makefile.接下来make:
[root@olive libpcap-0.9.4]#make
居然没生成动态链接库,只有一个libpcap.a静态库.只好再修改它的Makefile.打开Makefile,找到了下面这个目标:
libpcap.so: $(OBJ)
@rm -f $@
ld -shared -o $@.`cat VERSION` $(OBJ)
把链接器ld该成arm-linux-ld,然后make此目标:
[root@olive libpcap-0.9.4]# make libpcap.so
这样便生成了动态库libpcap.so.0.9.4,可样就可以将此拷贝到Liod板的/lib/这个目录下,别忘了在再创建两个符号链接:
libpcap.so.0和libpcap.so.
此时便可以利用pcapTest这个小程序来测试一下了.测试OK,可以捕获网络数据包,终于大功告成!
06.5.19
21:00
[root@olive libpcap-0.9.4]# ./configure --host=arm-linux
configure: error: pcap type not determined when cross-compiling; use --with-pcap=...
运行configure说交叉编译时没指定pcap类型,看了README文档,试了指定了几种类型,但configure时均出错!没办法了,只好采取暴力措施了,在configure脚本中注释掉检查交叉编译的部分,具体注释掉一下语句:
#if test -z "$with_pcap" && test "$cross_compiling" = yes; then
# { { echo "$as_me:$LINENO: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&5
#echo "$as_me: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&2;}
# { (exit 1); exit 1; }; }
#fi
.......
# if test $ac_cv_linux_vers = unknown ; then
# { { echo "$as_me:$LINENO: error: cannot determine linux version when cross-compiling" >&5
#echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
# { (exit 1); exit 1; }; }
# fi
再次运行configure命令,这下终于OK!终于生成了Makefile.接下来make:
[root@olive libpcap-0.9.4]#make
居然没生成动态链接库,只有一个libpcap.a静态库.只好再修改它的Makefile.打开Makefile,找到了下面这个目标:
libpcap.so: $(OBJ)
@rm -f $@
ld -shared -o $@.`cat VERSION` $(OBJ)
把链接器ld该成arm-linux-ld,然后make此目标:
[root@olive libpcap-0.9.4]# make libpcap.so
这样便生成了动态库libpcap.so.0.9.4,可样就可以将此拷贝到Liod板的/lib/这个目录下,别忘了在再创建两个符号链接:
libpcap.so.0和libpcap.so.
此时便可以利用pcapTest这个小程序来测试一下了.测试OK,可以捕获网络数据包,终于大功告成!
06.5.19
21:00
相关文章推荐
- TX2440 ARM开发板Uboot移植(四、对DM9000网卡的支持)
- MPlayer在ARM开发板的移植
- ARM开发板系统移植-----rootfs的制作
- 编译ARM平台的 QtEmbedded 的MySQL插件和移植MySQL到ARM开发板
- 关于Qt移植后环境变量的设置 qt移植到arm中文显示问题解决 实现pc与tiny210 arm开发板 udp通信(续上)
- TX2440 ARM开发板Uboot移植(五、yaffs2文件系统的支持)
- Qt应用程序向ARM开发板移植过程中汉字无法正常显示的解决办法
- 在ARM开发板上移植Linux2.6
- 移植iptables命令到ARM开发板
- loudmouth库在arm开发板linux环境下的移植
- ARM开发板系统移植-----kernel的编译
- 应用程序在ARM开发板上的移植
- TX2440 ARM开发板Uboot移植 (六、实现启动快捷菜单)
- opencv在arm开发板上的移植
- OpenIGTLink 协议在arm开发板上移植
- Apache 2 移植到Arm开发板
- sqlite3移植到ARM开发板
- ARM开发板移植android4.0流程
- ARM开发板系统移植-----u-boot的编译
- MiniGUI 移植到pc和arm开发板全过程详解 及错误解答