你好,游客 登录 注册 搜索
背景:
阅读新闻

libpcap1.0.0移植到ARM开发板上

[日期:2011-09-21] 来源:Linux社区  作者:shyrubbit1987 [字体:大 中 小]

在移植的过程中,主要参考了这篇文章http://www.linuxidc.com/Linux/2011-09/43426.htm。

1、从http://www.tcpdump.org/官方网址上下载libpcap1.0.0源码压缩包,进行解压。

2、修改confiugre文件,把下面两段注释掉,在6249行和6587行,为什么要这样做,没有深入了解其原因。

#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

3、 执行./configure --host=arm-linux,这样就会使用arm-linux-gcc进行configure,生成Makefile

4、修改Makefile的prefix项为prefix=/usr/local/arm/3.4.1/arm-linux(这个就是你的交叉编译器所在目录,根据自己的情况修改),同时查看CC是否已=arm-linux-gcc。

5、接下来make,make install,完成了libpcap的编译和安装,查看/usr/local/arm/3.4.1/arm-linux/include,是否多出pcap文件夹和pcap.h、pcap-bpf.h、pcap-namedb.h这四个东西。

到此libpcap1.0.0移植成功,接下来就是自己编写相关应用程序进行测试了。

linux
相关资讯       Arm Linux 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款