Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-03-26 01:30:48

David Abrahams wrote:

> > I just received Vladimir's response...apparently I misunderstood
> > this...<library> in Req does NOT imply <link-to> (i.e. <library> in
> > Usage-Req).
> ...but /shouldn't/ it?
> Incidentally, I'm not sure what he means by "some additional
> semantics".

<link-to> ;-)
Current <library> grabs usage requirements and tries to link to the named
target. One might say that current <library> = <uses> + <link-to>, except that
we don't have explicit <link-to> anywhere. I'll give more complete table
of semantics in other post.

> I'm not sure we should be trying to analyze the current behavior too
> closely. I think it's clear that it hasn't been carefully thought
> out in every detail, and there's no specification. We should be
> trying to figure out what *should* be happening and work from there
> to implement it.

Ok, I'll soon post *expected* current behaviour, which can serve as order-0

> >> > # If you wanted to have a statically-linked DLL, you would have to
> >> > # do something like this. This would somehow have to interact with
> >> > # the <link> feature. Note the difference.
> >> > lib a : a.cpp : <uses>b <link-to>b ;
> >>
> >> Which is the statically linked DLL (whatever that is!) in this case?
> >> a or b?
> This was:
> > lib a : a.cpp : <uses>b <link-to>b ;
> >
> >
> > Library "a" is the DLL, "b" is a static library linked into "a". The
> > MSVC linker allows you to create a DLL (a dynamic or "shared" library)
> > by statically linking to other libraries (e.g. "b"). In this case, it
> > would be natural to say
> >
> > lib a : a.cpp b ;
> Yes.
> > which is confusing if you use the same expression to specify a shared
> > lib "a" that depends on a shared lib "b".
> Why? It seems reasonable to me that if b is built shared, all you
> can do is inherit usage requirements from it, and if b is built
> static you must link it in directly.

Yes! I was considering Ali's <link-to> suggestion yesterday evening, and
realize that

lib a : a.cpp b ;

can be handled thus:
0. Usage requirements of 'b' are added to build properties for 'a' (as done
1. If creating shared library, just link b.
2. If creating static library, we can't link to b. The only approximation is
to add <library>b to usage requirements.

I think that's good default behaviour.

- Volodya


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at