Hughes, James wrote:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Vladimir Prus Sent: 19 October 2007 09:29 To: boost-users@lists.boost.org Subject: Re: [Boost-users] How well does Boost support cross-compilation?
n.torrey.pines@gmail.com wrote:
I'm dreaming of compiling MinGW, OS X (Intel and PowerPC) and Linux x86 versions of my program in one go, perhaps on Linux. The program uses little other than several Boost libraries. Is this a possible and reliable usage scenario?
This doesn't seem like a particularly original idea, so I'm sure others explored it. Are there any how-to's? I couldn't find any.
Several folks did Linux->{various embedded systems} compile, and it worked. That's good news. The bad news is that Linix->MinGW compile won't 100% work out of box.
You can do cross-compiling by setting up a user-config.jam, where you configure gcc toolset, explicitly specifying a command, which would be like i686-mingw32-g++, or some such. I think the compilation will even work. The problem is that you'll end up with libraries named .a and .so and executables named without any suffix. This is because while Boost.Build has <target-os> feature, the code that determines file extension looks at host os, not target-os. It's not hard to fix, but it need somebody to do that. Patches welcome :-)
- Volodya
As an example, here is the command line I use to compile boost for an ARM processor.
bjam "-sGCC_ROOT_DIRECTORY=<location of cross compiler>" "-sGCC=iwmmxt_le-gcc" "-sGXX=iwmmxt_le-g++" stage
For the record, this is Boost.Build V1 syntax. For V2, you'd put this
to user-config.jam:
using gcc : 4.2_arm :