From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-12-06 09:59:44
David Abrahams wrote:
>>What's important, is that plain <link>all-static will do
>>the same thing both on Linux and Windows.
> OK, I think. We /really/ need a different name for all-static
> though. I don't want to have to explain the difference between
> "static" and "all-static" to users (I've already forgotten the
> meaning), nor why there's no "all-dynamic".
Agree. But don't know a better name still.
>>>>Let's decide if the "static runtime, dynamic external libraries" use
>>>>case is common enough. Everything else will depend on it.
>>>I don't know how common it is. It doesn't need to be easy to specify
>>>this, just possible.
>>It is possible. If the only declaration for zlib is
>> system-lib zlib : <file>.... <link>shared ;
>>then it will cause dynamic linking of zlib in all cases.
> Unacceptable solution, IMO. This is intrusive on the zlib
> definition. Suppose both versions exist for some reason, but I want a
> particular shared library to link only to the dynamic zlib? Also, it's
> dangerous because indirect "include" dependencies could bring in a
> static definition for zlib.
Let me outline two basic usages in addition to global shared/static/all-static.
First is when some target wants specific variation of
dependency. You accomplish that with:
lib a : a.cpp b/<shared>static ;
This can become tedious if there many dependencies, but it's
Second is when you need to *always* link a particular library in a
particular fashion. There are two approaches. First: introduce a specific
feature for each library (that's scary!). Second: specify this
requirement together with library declaration. It's intrusive... but
it's possible to overcome:
source zlib : /path/to/zlib/installation/zlib : <shared>false ;
You'll refer to the *local* declaration of zlib, and need not
change external declration of this target.
Probably a more convenient interface can be introduces, but you
get the point. Your project will specify desired properties for
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