From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-11-26 09:03:56
Vladimir Prus wrote:
> I has thinking about the way system libraries are
> used. For now, there's inherited from V1 method
> exe a : a.cpp : <find-library>zlib <library-file>helper.a ;
> There are some problems:
> 1. <find-library> is long and non-intuitive.
> 2. It differs from using library targets, for no good
> reason. Moreover, consider that on Windows, a library
> called 'expat' must be built by Boost.Build, so we
> have to write
> exe main : main.cpp : <library>expat
> But on Linux this library is already awailable, so we better
> exe main : main.cpp : <find-library>expat
> This difference is messy.
I don't follow you here. Why do have to build 'expat' with boost build
on windows? Don't they have a Makefile for this that we better use?
> 3. I remember that Markus requested that "find-library" had
> static and dynamic version (i.e "link this system library
> statically"). But
That's what I currently have in my local version of V1.
> is just too long. An further, if 10 applications use zlib,
> do they all have to specify it?
I would say yes. They should specify it.
> So, I propose to
> 1. Kick "find-library". Introduce new "system-lib" target type.
> For example:
> system-lib zlib ;
Why would you need this declaration? To tag on build specifiactions?
> exe a : a.cpp : <library>zlib ;
> It's possible to specify static linking
> system-lib zlib : <shared>false ;
But this implies that all exe targets in a single Jamfile link to the
zlib statically, doesn't it? Not so good, IMO.
Or would it be possible to say, for example:
system-lib zlib-dynamic : <shared>true <real-name>zlib ;
system-lib zlib-static : <shared>false <real-name> zlib ;
And later either
exe a : a.cpp : <library>zlib-dynamic ;
exe b : b.cpp : <library>zlib-static ;
> There will be some implementation gotchas, but they're
> not serious. How does it look from the interface standpoint?
> 2. Kick <library-file> as well. Allow to specify file name as value
> of <library> features.
> exe a : a.cpp : <library>zlib <library>helper.a ;
How do you distinguish between file names and library names? Via
presence of system-lib declaration?
> For me, this looks like a pure enhancement.
> - Volodya
Hmm, as long as you don't loose the flexibility to specify things
individually for each target, I would agree.
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