Boost logo

Boost Users :

Subject: [Boost-users] cross compile boost for arm TRY2 (Possibly solved)
From: John Davis (davisjf_at_[hidden])
Date: 2014-10-23 11:30:05


Hello

Here is a more succient attempt at building boost with a cross compiler.
It appears to work. I'm not certain if it works at this point though.
Please take a look and comment. Here is the script:

---------------------------------------------------------------
#!/bin/bash

# edit /opt/xxx/yyy/boost/boost_1_51_0/tools/build/v2/user-config.jam to
add the following line
# using gcc : 4.3arm : arm-linux-gnueabi-g++ : <architecture>arm
<target-os>linux ;

# Later we modify path, make sure our path does not use the cross compiler
at beginning
export
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/java6/bin:/opt/java6/db/bin:/opt/java6/jre/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

# In this stage, we are using the host compiler.

# setup env variable for $BOOST_DIR
# I'm not sure if this is being used, but set it just in case.
export BOOST_ROOT=/opt/xxx/yyy/boost/boost_1_51_0

# this is run from $BOOST_DIR/tools/build/v2 aka
 /opt/xxx/yyy/boost/boost_1_51_0/tools/build/v2
# in this case, I do not think you invoke the cross compiler. I think at
this point, you are building
# code for the host development machine.
./bootstrap.sh --with-toolset=gcc

# setup path so that gcc from cross compiler is first in the path
# also specify cross_compiler env variable in case its used.
#
# this will find the cross compiler for those who dont use the prefix, ie.
gcc
export PATH=/opt/arm/usr/local/arm-linux-gnueabi/bin:$PATH
# this will find the cross compiler for those who use the prefix, ie.
arm-linux-gnueabi-gcc
export PATH=/opt/arm/usr/local/bin:$PATH
# this will set the cross compiler prefix for those who use it
export CROSS_COMPILE=arm-linux-gnueabi-

# build boost.build so that we can build boost or are we building boost at
this point?
#
# WARNING!!!
# Specify an install directory so that it doesn't put the results in
/usr/local/bin.
# Even if you dont specify install as an option to ./b2 it will attempt to
copy files to /usr/bin
# in the following step!
#
# /opt/xxx/boost is where we want results. Our code will this dir in
order to use boost.
# /opt/xxx/yyy/boost/boost_1_51_0 is the top of the boost src. We are
building beneath there.
./b2 --toolset=gcc-4.3arm --prefix=/opt/xxx/boost

# at this point, we have the cross compiler in our path first. We are good
to go for building our code using boost
# with the cross compiler.
--------------------------

-- 
John F. Davis
6 Kandes Court
Durham, NC 27713
919-888-8358
独树一帜


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net