Boost logo

Boost-Build :

Subject: Re: [Boost-build] "os" versus "target-os"
From: Steve Soule (sts11dbxr_at_[hidden])
Date: 2010-04-25 17:47:34


On Saturday 24 April 2010 04:46:27 Steve Soule wrote:
> I've noticed that many of the Jamfiles in Boost make use of the "os"
> property. For example, in libs/asio/example/http/client/Jamfile.v2,
> this property is used to link in the right networking libraries and
> define the appropriate defines depending on the os. I haven't found
> any documentation on the "os" property, but I would guess that it
> contains a tag for the operating system on which the build is taking
> place.
>
> Shouldn't these be using the "target-os" property rather than "os"?
> I would think that when you're cross-compiling, target-os and os
> could be quite different, and you would want to link the appropriate
> libraries for the target operating system, not the build operating
> system.

On 04/24/2010 03:07 AM, Vladimir Prus wrote:
> Yes, in most cases 'target-os' should be used. Please file bugs for
> libraries that use 'os'

On 4/24/2010 8:31 PM, Steve Soule wrote:
> Done. The full list of libraries was:
>
> asio iostreams thread

On 04/25/2010 10:53 AM, Christian Auby wrote:
> Does this mean I don't have to manually link ws2_32 and pthread
> anymore? That would have been excellent. Always wondered about why I
> had to do that but figured that was how it was supposed to be.

On 4/25/2010 9:40 PM, Steve Soule wrote:
> I'm sorry, I wasn't clear. I didn't fix anything; I just submitted a
> bug report as Vladimir asked me to.
>
> If the appropriate maintainers fix the "os versus target-os" bug, it
> will not necessarily remove the need to manually link ws2_32,
> pthread, and other libraries. That's a different bug. Perhaps you
> should submit a bug report about that.

On 04/25/2010 03:05 PM, Christian Auby wrote:
> Yep I meant "when it will be fixed", not right now.
>
> "For example, in libs/asio/example/http/client/Jamfile.v2, this
> property is used to link in the right networking libraries"
>
> If "right networking libaries" doesn't mean the target-os required
> libs, what does it mean?

That's exactly what it means. But that Jamfile is for example code, not
for the asio library itself. In order for the appropriate networking
libraries to be automatically linked in to your application whenever you
used the asio library, I think there would have to be a main Jamfile for
the asio library that specified which libraries were needed.

The asio library is the only one I know of that doesn't automatically
link in the system libraries it needs. But I don't use very many Boost
libraries currently, so there could easily be others I don't know about.

It may be that the designer of the asio library decided not to link in
the system networking libraries automatically because you can use asio
without using the networking components of asio. But then I don't know
why they wouldn't have made the system libraries link in automatically
only if you used the networking components of asio.


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