Chinaunix首页 | 论坛 | 博客
  • 博客访问: 532328
  • 博文数量: 75
  • 博客积分: 2374
  • 博客等级: 大尉
  • 技术积分: 933
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-18 14:27
文章分类

全部博文(75)

文章存档

2014年(1)

2013年(17)

2012年(10)

2011年(15)

2010年(23)

2009年(9)

我的朋友

分类: LINUX

2010-02-05 15:47:19

编译环境:Ubuntu 9.04, arm-linux-gcc V3.4.4
ppp-2.4.5
 
1.
2.4.5之前的版本在配置时不支持选项‘--host=’选项,貌似只支持--prefix=
在编译时使用“make CC=arm-linux-gcc”,当编译到pppd/plugins时,或许是我的交叉编译工具的问题,总会提示语法错误。信息表示是跟头文件little_endian.h有关。使用cc编译则没事。
 
还好实际上只需要pppd跟chat,其他的东西可以不去管。
 
2.编译过程中提示缺少pcap.h等头文件。
这个东东说是涉及libpcap库,跟包过滤有关。如果不想安装这个库的话,可以修改pppd/Makefile.linux文件。
将里面的内容
 

48 # Uncomment the next line to include support for PPP packet filtering.
49 # This requires that the libpcap library and headers be installed
50 # and that the kernel driver support PPP packet filtering.
51 FILTER=y

中的第51行注释掉。改为:# FILTER=y

3.如果使用make install,会出现如下对话:

install -s -c chat /usr/src/ppp-2.4.5/Target/usr/sbin
strip: Unable to recognise the format of the input file `/usr/src/ppp-2.4.5/Target/usr/sbin/chat'
install: 拆解过程非正常中止
make[1]: *** [install] 错误 1
make[1]:正在离开目录 `/usr/src/ppp-2.4.5/chat'

make: *** [install-progs] 错误 2


原因是在Makefile里面install时使用-s命令,默认使用的是PC下的strip命令。不是arm-linux-strip

修改方法:进入对应的文件夹中,修改Makefile。以pppstats为例。

$(INSTALL) -c -s pppstats $(BINDIR)/pppstats

改为

arm-linux-strip pppstats

$(INSTALL) -c pppstats $(BINDIR)/pppstats

注意前面要加TAB键,且不能以空格键代替。

++++++++++++++++++Partition Line+++++++++++++++++++++++++

编译libpcap库

参考

原文摘要如下:

Compile libpcap
$ tar zxvf libpcap-0.9.5.tar.gz
$ cd libpcap-0.9.5/
$ CC=arm-linux-gcc ac_cv_linux_vers=2 ./configure --host=arm-linux --with-pcap=linux
$ make

实际操作时,配置过程中提示需要安装lex跟yacc。这两个安装的是PC版。

然后再

$ ./configure --host=arm-linux --with-pcap=linux ac_cv_linux_vers=2

$ make

附:参考文档

 How to cross compile the PPP to arm-xscale


 

阅读(4276) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~