Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-31 11:31:27


Vladimir Prus <ghost_at_[hidden]> writes:

> David Abrahams wrote:
>> Ali Azarbayejani <ali_at_[hidden]> writes:
>> > [d] [c] [b] [a] * Normal "shared" linking scheme
>> > [d] [c] [b<a>] - realistic
>> > [d] [c<b>] [a] - realistic
>> > [d] [c<b><a>] - realistic
>> > [d] [c<ba>]
>> > [d<c>] [b] [a] - realistic
>> > [d<c>] [b<a>] - realistic
>> > [d<c><b>] [a] - realistic
>> > [d<cb>] [a]
>> > [d<c><b><a>] * Normal "static" linking scheme
>> > [d<cb><a>]
>> > [d<c><ba>]
>> > [d<cba>]
>> >
>> > The normal "shared" scheme is currently implemented by propagating
>> > <link>shared to all the library targets. The normal "static" scheme
>> > is currently implemented by propagating <link>static.
>> >
>> > The schemes labeled "realistic" involve "shared libs linked to
>> > archives", and are realistic build scenarios that should be supported.
>> > Does anyone have any thoughts on how these schemes are to be expressed
>> > in BBv2?
>
>> I think it may be reasonable to say that a library may specify how it
>> interoperates with the libraries it "uses", which obviously would
>> prevent users from requesting different configurations. So we might
>> have (assuming shared linking is the default):
>>
>>
>> [d] [c] [b] [a] * Normal "shared" linking scheme
>>
>> lib a : $(ASrc) ;
>> lib b : $(BSrc) a ;
>> lib c : $(CSrc) b ;
>
> OK.
>
>> [d] [c] [b<a>] - realistic
>>
>>
>> lib a : $(ASrc) ;
>> lib b : $(BSrc) <static>a ;
>> lib c : $(CSrc) b ;
>
> Ehm... we already support this via
>
> lib b : $(BSrc) a/<link>static ;

So sue me ;-)
That notation is a little verbose, but fine.

>> [d] [c<b>] [a] - realistic
>>
>>
>> lib a : $(ASrc) ;
>> lib b : $(BSrc) <static>b ;
> why "b" here? ------------^
>
>> lib c : $(CSrc) b ;

My mistake. I meant to stick that in the line for c.

> Hmm... one can use
>
> lib c : $(CSrc) b/<link>static ;
>
> but then 'a' will be linked statically as well. You certainly
> can force 'a' to be shared:
>
> lib a : $(ASrc) : <link>shared ;
>
> But I'm not sure if this is ok...
> What is the origin of this use case? Should 'c' specify that it needs
> to link 'b' statically, but all the libs 'a' need dynamically?
> Should 'b' specify that 'a' is always linked dynamically? IOW,
> where this linking scheme should be defined?

Right; that is the question. Should the user have control over this?
The person who specified the exe? The person who specified the
intermediate libraries?

>> [d] [c<b><a>] - realistic
>>
>> lib a : $(ASrc) ;
>> lib b : $(BSrc) a ;
>> lib c : $(CSrc) b : <link-libs>static ;
>
> This can be achieved as shown above:
>
> lib c : $(CSRC) b/<link>static ;

OK.

>> [d<c>] [b] [a] - realistic
>
> The question again is: who specifies that 'b' and 'a'
> should be dynamic?

Yup.

>> [d<c>] [b<a>] - realistic
>>
>> lib a : $(ASrc) ;
>> lib b : $(BSrc) <static>a ;
>> lib c : $(CSrc) : <link>static ;
>
> Same question.

Yup.

>> [d<c><b>] [a] - realistic
>>
>> lib a : $(ASrc) ;
>> lib b : $(BSrc) a : <link>static ;
>> lib c : $(CSrc) b : <link>static ;
>
> Same question. I think that we can support all of the linking
> schemes above already, but the real issue is where to specify
> linking. For example, should main target be able to specify
> only linking for targets that it directly uses and be happy for
> default linking for indirectly linked libraries? Or one should say:
> I'm using library 'c', but I know that 'a' is somehow used too, and
> want static linking of it. Could you please give more background for
> all the realistic examples?

Yup yup yup.

-- 
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