Chinaunix首页 | 论坛 | 博客
  • 博客访问: 111069
  • 博文数量: 95
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 12
  • 用 户 组: 普通用户
  • 注册时间: 2013-04-27 08:43
文章分类
文章存档

2013年(95)

我的朋友

分类: LINUX

2013-04-27 09:21:13

原文地址:Zebra的各种编译 作者:xuyuanchao

Zebra的各种编译

Zebralinux环境下很好的一款路由软件,完全仿照Cisco公司的路由器开发。笔者对网络略有研究,目前专攻嵌入式,刚好,做一个小型的嵌入式路由器正好把两者融合在了一起。

       遗憾的是,很多买到的很多开发板都只有一个网口,而作为路由器,一般需要2个(含)以上。笔者正在做一块基于arm9的双网卡开发板,正在设计原理图,还需要一段时间。

       zebra下载地址:   目前的最新版本是zebra-0.95.tar.gz,这是2005年的版本,有四年多没有更新了。

 

1PC上编译

       编译之前,需要了解一些注意事项,首先要安装GCCaclocalautoconfautomake等,有人说,这个还用说吗?有些人在网上提问,其中遇到的问题就有automake没安装造成的。

       另外,由于zebra软件的开发时间离现在很远了,当时的gcc编译器版本还不高,对语法结构、数据类型检查还不是很严格,如果用现在的最新的gcc版本去编译,会出现大量的警告、甚至错误,所以,建议用低版本去编译,如果你有时间,也可以逐一去修改原代码,这是一个漫长的过程。如果做产品,值得这样做。

       笔者前后在fedora core 5red hat linux 9上实验,前者编译时报错,后者编译通过。

fedora core 5下的gcc版本

[root@localhost /]# gcc -v

使用内建: specs

配置为:i386-redhat-linux

配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux

线程模型:posix

gcc 版本 4.1.0 20060304 (Red Hat 4.1.0-3)

 

red hat linux 9下的gcc版本

[root@srv3 sbin]# gcc -v

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux

Thread model: posix

gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

 

具体流程很简单

 

shell> tar xzf zebra-0.92a.tar.gz

  shell> cd zebra-0.92a

  shell> ./configure  --prefix=/routing

  shell> make

shell> make install

 

routing目录下将出现sbinetc 等几个目录,说明编译成功,至于如何使用,请参考网上的其他文档,参考之前最好对网络及路由略有了解。

2ARM上编译

同样,以下的编译也不能在4.0以上的gcc以上版本上编译,报错。

(摘自http://blog.chinaunix.net/u2/65122/showart.php?id=1226474

[root@vm-dev router]# tar xzf zebra-0.94a.tar.gz
[root@vm-dev router]# cd zebra-0.94
[root@vm-dev zebra-0.94]# ./configure --host=arm-linux --prefix=/routing

make

make install
[root@vm-dev zebra-0.94]# 

[root@localhost sbin]# arm-linux-gcc -v

Reading specs from /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/specs

Configured with: ../gcc-3.3.2/configure --target=arm-linux --with-cpu=strongarm1100 --prefix=/usr/local/arm/3.3.2 i686-pc-linux-gnu --with-headers=/work/kernel.h3900/include --enable-threads=pthreads --enable-shared --enable-static --enable-languages=c,c++

Thread model: posix

gcc version 3.3.2

 

3MIPS上编译

[root@localhost sbin]# mipsel-linux-gcc -v

Reading specs from /Cross/target/local/lib/gcc-lib/mipsel-linux/2.96/specs

gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113.2) neon

 

[root@vm-dev router]# tar xzf zebra-0.94a.tar.gz
[root@vm-dev router]# cd zebra-0.94
[root@vm-dev zebra-0.94]#
./configure --host=mipsel-linux   --prefix=/routing

make

make install
[root@vm-dev zebra-0.94]# 

 

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