|
Boost-Build : |
Subject: [Boost-build] Fwd: Attempting to build boost with a cross compiler
From: John Davis (davisjf_at_[hidden])
Date: 2014-10-23 12:29:21
---------- Forwarded message ----------
From: John Davis <davisjf_at_[hidden]>
Date: Thu, Oct 23, 2014 at 12:18 PM
Subject: Attempting to build boost with a cross compiler
To: boost-build_at_[hidden]
Hello
I sent a similar message to boost-users, before I learned of this
particular list. Perhaps this is more approrpriate forum.
Here is a script I'm trying to use to build boost with a cross compiler for
arm.
Im using this page as a guide:
http://www.boost.org/doc/libs/1_56_0/more/getting_started/unix-variants.html#easy-build-and-install
My script below does not get any errors, but I also don't have any .a or
.so files being generated.
-------------------
#!/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
# hmm. I did not get any .a or .so after that last step. Try to add a
install parameter.
./b2 --toolset=gcc-4.3arm --prefix=/opt/xxx/boost --build-type=complete
# hmm. I did not get any .a or .so after that last step. Try to add a
install parameter.
./b2 --toolset=gcc-4.3arm --prefix=/opt/xxx/boost install
# 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 ç¬æ ä¸å¸ -- John F. Davis 6 Kandes Court Durham, NC 27713 919-888-8358 ç¬æ ä¸å¸
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk