Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-10-19 05:21:05


Hughes, James wrote:

>> -----Original Message-----
>> From: boost-users-bounces_at_[hidden]
>> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
>> Vladimir Prus
>> Sent: 19 October 2007 09:29
>> To: boost-users_at_[hidden]
>> Subject: Re: [Boost-users] How well does Boost support
>> cross-compilation?
>>
>> n.torrey.pines_at_[hidden] 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 : <path_to_cross_compiler>/iwmxt_le-g++ ;

- Volodya


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