Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-05-04 01:14:13


On Wednesday 04 May 2005 07:23, Craig Rodrigues wrote:
> On Tue, May 03, 2005 at 06:33:04PM +0400, Vladimir Prus wrote:
> > But probably we should add 'lib' automatically on Unix if no <tag> is
> > specified?
>
> That would be my preference, and would be less confusing
> to new users than having to use the <tag> feature, since it
> is a very common use-case for libraries on Unix.
>
> So, for the following line:
> lib foobar : $(SRC) ;
>
> On Linux, we would generate libfoobar.so
> On MacOSX, we would generate libfoobar.dylib
> On NT, we would generate foobar.dll
>
> Is it hard to make this the default behavior for Boost Jam?

Piece of cake. Well, almost. I attach a working patch. However, before
committing I'll have to do some cleanup. Say adding a prefix in a rule called
'add-suffix' does not feel right. Also, I'll need to figure out what to do
with tests. Most probably I'll have to modify the test system to add the
"lib" prefix too.

So final solution will take more time.

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2
 --Boundary-00=_1gGeCQL8EUTAoXS Content-Type: text/x-diff;
charset="iso-8859-1";
name="lib_prefix.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="lib_prefix.diff"
Index: virtual-target.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/build/virtual-target.jam,v
retrieving revision 1.102
diff -u -r1.102 virtual-target.jam
--- virtual-target.jam	4 May 2005 06:06:34 -0000	1.102
+++ virtual-target.jam	4 May 2005 06:11:25 -0000
@@ -464,6 +464,12 @@
# to the specified name and returns the result.
rule add-suffix ( specified-name : type ? : property-set )
{
+ if [ type.is-derived $(type) LIB ] && 
+ ! [ $(property-set).get <os> ] in NT 
+ {
+ specified-name = lib$(specified-name) ;
+ }
+ 
suffix = [ type.generated-target-suffix $(type) : $(property-set) ] ;
if $(suffix)
{ 
 --Boundary-00=_1gGeCQL8EUTAoXS-- 

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