Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-03-31 09:56:08


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 ;

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

> lib c : $(CSrc) b ;

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?

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

> [d<c>] [b] [a] - realistic

The question again is: who specifies that 'b' and 'a'
should be dynamic?

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

Same question.

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

- Volodya

 


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