Boost logo

Boost-Build :

From: Andrey Melnikov (melnikov_at_[hidden])
Date: 2005-08-03 13:52:55


Vladimir Prus wrote:
> On Tuesday 02 August 2005 22:40, Andrey Melnikov wrote:
>
>
>>3) I think it's a bad idea to specify default values for features in
>>init rule. I think feature.set-default rule should be run instead, or
>>there should be another similar mechanism to do this.
>>
>>I also see similar fragments in old msvc.jam:
>>
>> linker = [ get-values <linker> : $(options) ] ;
>> linker ?= link ;
>>
>>I think Vladimir Prus can help us here because I'm not so fluent in BB
>>internals. Vladimir, is this a recommended practice or it's a legacy code?
>
>
> The story is that it's not a real feature -- it just uses feature-like syntax
> to pass named parameters to the 'init' rule, so you need to apply defaults
> here.

Why it isn't a real feature? What are the differences between real and
not real features?

Personally I don't think that <linker> for msvc is useful. Is it
actually possible to use Intel linker with MSVC just by specifying it in
site-config or user-config? What are the use-cases for this in other
toolsets?

>
> We though that even better syntax will use the '=' sign:
>
> using msvc : : linker=some_linker ;

Well, if now it's

using msvc : : <linker>some_linker ;

then it's fine. I think we should have consistent syntax everywhere. On
bjam command line name=value is fine because it help us to avoid to deal
shell argument escaping. But in Jamfiles I'd like to see this syntax.

AFAIK this <name>value syntax doesn't belong to Jam language and
actually it's a plain Jam literal parsed by Jam code. Am I correct?

Name=value will create confusions with BJam assignment and equality
operators.

But actually we aren't talking about right ways to describe toolset
configuration now. We are reviewing Alexey's patch.

Here's a code snippet from his patch:

+feature.subfeature toolset msvc : version
+ : 8.0 7.1 7.0 6.0
+ : propagated
+ ;
+
+feature.subfeature toolset msvc : platform
+ : win2k3 winxp win2k
+ : propagated
+ ;
+
+feature.subfeature toolset msvc : arch
+ : i386 amd64 ia64
+ : propagated
+ ;
+
+rule init (
+ options *
+ )
+{
+ #
+ # Get unique toolset id: version, platform, arch and sdk.
+ #
+
+ version = [ get-values <version> : $(options) ] ;
+ version ?= 8.0 ;
+
+ platform = [ get-values <platform> : $(options) ] ;
+ platform ?= win2k3 ;
+
+ arch = [ get-values <arch> : $(options) ] ;
+ arch ?= i386 ;
+
+ sdk = [ get-values <sdk> : $(options) ] ;
+ sdk ?= studio ;
+
+ local condition =
+ [ common.check-init-parameters msvc :
+ version $(version) :
+ platform $(platform) :
+ arch $(arch) :
+ sdk $(sdk)
+ ] ;

Is this a good idea to set default values for features this way? Can you
comment on the whole patch?

Andrey

 


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