Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1352763
  • 博文数量: 1334
  • 博客积分: 645
  • 博客等级: 上士
  • 技术积分: 5762
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-25 16:56
文章分类

全部博文(1334)

文章存档

2014年(108)

2013年(1059)

2012年(169)

分类: LINUX

2013-09-13 10:06:43



编译环境: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 --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

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