After digging around for a while trying to make it work I was finally given the answer by the esteemed Peter Hartley who had managed to cross-compile boost 1.34 as part of his Just The Linux distribution. His solution seems to work for v1.35.0 too.
The trick that had eluded me until that point was to tell both the user-config.jam file and bjam about the cross compiler.
Something like:
echo "using gcc : : nicearch-linux-g++ ;" > user-config.jamIf, like me, you want to only generate static libraries and support multiple builds in the same tree then you might need a bit more cleverness:
make BJAM_CONFIG="-sGXX=nicearch-linux-g++" install
build=/tmp/nicearch/buildThis should be relatively easy to turn into a buildroot package file but I'm no longer using buildroot to build boost so I didn't need to.
staging=/tmp/nicearch/staging
CXX=nicearch-linux-g++
CC=nicearch-linux-gcc
mkdir -p $build $staging
echo "using gcc : : $CXX ;" > $build/user-config.jam
bjam --toolset=gcc -sGXX=$CXX -sGCC=$CC \
--prefix=$staging --build-dir=$build \
--user-config=$build/user-config.jam --without-python \
variant=release link=static threading=multi
1 comment:
And in fact the second of those still works with Boost 1.39.0, although the first doesn't, as they've moved the default user-config.jam and removed the Makefile.
Post a Comment