Boost logo

Boost-Build :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2002-02-10 18:17:17


On 2002-01-31 at 01:40 PM, david.abrahams_at_[hidden] (David Abrahams) wrote:

>
>----- Original Message -----
>From: "Rene Rivera" <grafik666_at_[hidden]>
>
>> But this does bring up the problem of building both static libs and dlls
>with
>> the same basename. As you suggest it does seem like a good idea to rename
>> static libs also to comform to platform practices but we can't do that
>unless
>> we support some way of differentiating them. And the only thing I can
>think of
>> is to allow LIB and DLL targets to have the same basename. So this would
>> become possible:
>>
>> lib foobar : fubar.cpp ;
>> dll foobar : fubar.cpp ;
>>
>> The somewhat easy way to allow this would be to traslate the above always
>to:
>>
>> lib foobar$(SUFLIB) : fubar.cpp ;
>> dll foobar$(SUFDLL) : fubar.cpp ;
>
>I assume you mean that the translation happens internally, and also that you
>would prepend $(PREFIXLIB), $(PREFIXDLL) as appropriate.
>
>> But then would it not also be expected to be able to the same to other
>target
>> types?
>
>Yes.
>
>I was reluctant to do as you suggest because then the user would have to
>know the platform-specific suffix when building particular targets from the
>command-line. Actually, now that I think of it, this is absolutely no
>problem. The user-specifiable targets are all NOTFILE targets anyway.
>
>I'd like:
>
>rule lib ( target : sources + : requirements * : default-build * )
>{
> local real-target = $(PREFIXLIB)$(target:S=$(SUFLIB)) ;
> type-DEPENDS $(target) : $(real-target) ;
> declare-local target $(real-target) : ... ;
>}

OK, I'm done with all the changes to make this happen. It wasn't as easy as we
expected :-( There are some drawbacks, or features depending on your
perspective, of the implementation...

* Multiple targets with the same name are allowed, but only one of each type.

* Because of the name resolution, one must specify the correct type when
depending on another target. For example:

dll test1 : test1.cpp ;
lib test2 : test2.cpp ;
exe test_app1 : test_app.cpp <dll>test1 ;
exe test_app2 : test_app.cpp <lib>test2 ;
exe test_app3 : test_app.cpp <lib>test1 ; # !! WILL FAIL !!

* Also, because of the names, Python use needed to change. Because the PYD
type is a real target type, even if it's mostly a DLL, one needs a different
type specifier when depending on those targets. For now I use "<pyd>" but if
you have a better name that would be great.

Again, I don't know how many people this is going to affect, but it's going to
require changes to any Jamfiles that create or depend on DLLs. I have changes
for regex, threads, and python, which covers all the "external" ones in Boost.

So Dave, unless you some problems with the above I'll go ahead commit the
changes.

-- grafik - Don't Assume Anything
-- rrivera_at_[hidden] - grafik_at_[hidden]
-- 102708583_at_icq - Grafik666_at_AIM - Grafik_at_[hidden]

 


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