使用mips交叉编译器编译boost

编译方式和arm交叉编译类似,不过我用的交叉编译器版本非常老,是3.40的

boost库,可以使用任意版本,下载地址:http://www.boost.org

编译方法

1.      下载解压boost库到任意位置,如/home/boost_1_48_0/

2.      切换目录至/home/boost_1_48_0,运行bootstrap.sh,此时在当前目录下会生成bjam这个程序,另外产生project-config.jam编译配置文件

3.      修改project-config.jam为以下内容:

# Boost.Build Configuration

# Automatically generated by bootstrap.sh

 

import option ;

import feature ;

 

# Compiler configuration. This definition will be used unless

# you already have defined some toolsets in your user-config.jam

# file.

if ! gcc in [ feature.values <toolset> ]

{

#关键是以下这句的修改

using gcc : mips : mipsel-linux-g++ ;

#编译arm版本则改为 using gcc : arm : arm-none-linux-gnueabi-g++ ;

#另外生成目录或者放置编译结果的目录请自行另作选择

}

 

project : default-build <toolset>gcc ;

 

# Python configuration

using python : 2.7 : /usr ;

 

# List of --with-<library> and --without-<library>

# options. If left empty, all libraries will be built.

# Options specified on the command line completely

# override this variable.

libraries =  ;

 

# These settings are equivivalent to corresponding command-line

# options.

option.set prefix : /usr/mips ;

option.set exec-prefix : /usr/mips ;

option.set libdir : /usr/mips/lib ;

option.set includedir : /usr/mips/include ;

 

# Stop on first error

option.set keep-going : false ;

 

4.      执行命令行:

./bjam stage--with-thread --with-signals --with-system link=static runtime-link=sharedthreading=multi --layout=tagged

此处仅编译3个所需要用到的库,编译多的话,可能会有错误,编译完成后在/home/boost_1_48_0/stage/lib下面能看到生成的库文件

5.      创建目录/usr/mips/usr/mips/include/usr/mips/lib;将/home/boost_1_48_0/boost/这个目录拷贝至/usr/mips/include下,将/home/boost_1_48_0/stage/lib下的库文件拷贝至/usr/mips/lib下。

6.      Boost编译安装完成

 


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值