linux boost 交叉编译,交叉编译 ARM LINUX编译BOOST 1.33交叉编译 ARM LINUX

编译这个需要先编译zlib和bzip2

./configure --prefix=安装目录

然后修改Makefile

因为我的cross编译器在/home/arm/local中

BJAM_CONFIG= -sPYTHON_ROOT=/usr -sPYTHON_VERSION=2.3 -sGCC_ROOT_DIRECTORY=/home/arm/local -sGCC=arm-softfloat-linux-gnu-gcc -sGXX=arm-softfloat-linux-gnu-g++ -sGCC_ROOT_DIRECTORY=/home/arm/local -sGCC_BIN_DIRECTORY=/home/arm/local/bin

PREFIX=/home/arm/local

EPREFIX=/home/arm/local

LIBDIR=/home/arm/local/lib

INCLUDEDIR=/home/arm/local/include

然后修改tools/build/v1/gcc-tools.jam

这个文件里有对上面用到的宏的说明

# compute directories for invoking GCC

#

# The gcc toolset can be user-configured using the following

# variables:

#

# GCC_ROOT_DIRECTORY

#       The directory in which GCC was installed. Defaults to

#       unset. Usually, there is no need to set this variable at

#       all. However, if G++ is not in the path it is usually

#       sufficient to configure this one variable. More fine-grained

#       configuration is available by setting the following:

#

# GCC_BIN_DIRECTORY

#       the directory prefix used to find the gcc executables. Defaults to

#       $(GCC_ROOT_DIRECTORY)/bin/, or "" if GCC_ROOT_DIRECTORY is

#       not set.

#

# GCC_INCLUDE_DIRECTORY

#       the directory in which to find system includes. Defaults to

#       empty.

#

# GCC_STDLIB_DIRECTORY

#       the directory in which to find the standard library

#       objects associated with this build of gcc. Defaults to

#       $(GCC_ROOT_DIRECTORY)/lib.

#

# GXX

#       The name by which g++ is invoked. You can also use this in

#       lieu of setting the property to force options such

#       as "-V3.0.4" into the g++ command line: "-sGXX=g++ -V3.0.4".

#

# GCC

#       Similar to GXX, the name by which gcc is invoked for "C"

#       language targets.

第381行,改了可能会用到

.AR ?= arm-softfloat-linux-gnu-ar ;

# used to manipulate the object files produced by GCC to

# prevent the merging of debug symbols (which happens to be n^2 slow)

if ! ( --no-objcopy in $(ARGV) )

{

flags gcc .OBJCOPY : [ GLOB $(GCC_BIN_DIRECTORY) $(PATH) : objcopy1 ] ;

}

.OBJCOPY ?= arm-softfloat-linux-gnu-objcopy ;

if ! $(on-windows)

等494行 加了到头文件的目录(包括zlib与bzip2的头文件),可能之前的不对,所以自己加了一下

actions gcc-Cc-action

{

$(.SET_EXIT)

"$(.GCC[1]:R=$(GCC_BIN_DIR))" $(.GCC[2-]) -c -Wall -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I$(_)"$(STDHDRS)" -I$(_)"$(SYSHDRS)" -I/home/arm/local/include -o "$()"

"$(.OBJCOPY[1])"$(_)$(OBJCOPY_FLAGS)$(_)"$(}

#### C++ ####

rule C++-action

{

gcc-spawn $(    _ on $(    gcc-C++-action $() ;

}

actions gcc-C++-action

{

$(.SET_EXIT)

"$(.GXX[1]:R=$(GCC_BIN_DIR))" $(.GXX[2-]) -c -Wall -ftemplate-depth-255 -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I$(_)"$(STDHDRS)" -I$(_)"$(SYSHDRS)" -I/home/arm/local/include -o "$()"

"$(.OBJCOPY[1])"$(_)$(OBJCOPY_FLAGS)$(_)"$(}

然后make && make install 就行了

阅读(6293) | 评论(3) | 转发(0) |

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值