Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-20 04:43:06


Vladimir Prus <ghost_at_[hidden]> writes:

> David Abrahams wrote:
>
>> > Did this clarify anything?
>>
>> Yes, thanks. Now, IIUC:
>>
>> a. you are proposing to have both "bubble-up" and "automatic" linking
>
> Yes.
>
>> b. These are really the same thing when linking statically
>>
>> ??
>
> Yes, for user. They are implemented slightly differently, but that's
> implementation detail.
>
>> Why allow both? You wrote:
>>
>> "It was proposed by Ali, IIRC, that putting library in sources of
>> other library does the right thing: use direct linking if the
>> library is build as shared, and use bubble-up if library is linked
>> as static."
>>
>> If that's the "right thing", allowing both seems overly complicated.
>> One simple syntax should achieve what you want. Probably I'm missing
>> something.
>
> No, you're not missing anything. One reason why I'd like to allow bubble-up
> linking is that it's for free.

[read to bottom before replying]

I'm not asking why you want to allow bubble-up. I'm asking why you
want to expose these with a separate syntax. It seems to me that you
should just do what Ali asked for. Asking users to write

lib a : a.cpp : <use>b : : <library>b ;

instead of

lib a : a.cpp b ;

just to get what they usually want in the static linking case seems
perverse to me, and it would be even more convoluted if you want to
link both statically and dynamically; something like:

lib a : a.cpp <link>dynamic:b
: <link>static:<use>b : : <link>static:<library>b ;

Granted, that would prevent the use of the "bubble-up + dynamic"
combination, but you can always fall back on the explicit syntax
above....

Oh, now I finally understand. It's just that the way the document
phrases things is bizarre. I'd just always use "automatic" if I just
want it to do the right thing. That's good.

> It's just combination of <use> requirement,
> which we have, and <library> property in usage requirements,

I never understood the meaning of <use>. I still don't.

> which we have as well. We need <library> property in any case, for
> example so that I can put <library>foo in project requirement.
>
> Now that you've asked, I am not sure bubble-up linking should be in
> docs.

Definitely not. Documenting it as a separate concept in linking.html
on equal footing with "automatic" linking threw me off, for sure.
Especially if the ability to write

lib a : a.cpp : <use>b : : <library>b ;

simply "falls out" of other information you're going to document, it
would be better for people to discover it that way.

I think you *should* document the behavior of lib targets in the
sources of other libraries, and doing it in terms of the line above
is perfectly fine.

IMO it also makes sense for this functionality to be somehow looked up
as a property of the "b" target rather than being special-cased.

> Maybe, someone would like to avoid linking to library sources and pass
> libraries up to dependents. I don't know why this should be needed, though.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
 

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