|
Boost-Build : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-12-23 10:38:54
"John Maddock" <john_at_[hidden]> writes:
>> > -flags msvc-stlport STLPORT_VERSION <stlport-version> ;
>> > +flags msvc-stlport STLPORT_VERSION_FLAG <stlport-version> : ;
>>
>> Sorry it took me so long to look at this. The change above looks
>> really suspicious to me. STLPORT_VERSION_FLAG isn't used anywhere
>> else in the toolset AFAICT.
>
> The thing is the original version trampled all over STLPORT_VERSION each
> time the toolset was invoked, resetting it to the default value each time.
> I'll be honest I don't actually understand why that line is in there
> -
The idea was for the version to be set "on" the target, so different
targets can be built with different STLPORT_VERSION settings. In
particular toolsets which extend this one should be able to do
something like
{
local STLPORT_VERSION = ... ;
extends-toolset msvc-stlport
}
But it turns out that the line doesn't help, since STLPORT_VERSION
isn't used in the target's build actions.
> except that without it <stlport-version> gets ignored; as long as
> the macro name
Well, variable name. There aren't any macros in Jam. But yeah,
unless you set a variable with the feature using "flags", the feature
is marked "irrelevant" to the toolset and ignored. Another way would
be to use:
gRELEVANT_FEATURES($(gCURRENT_TOOLSET)) += <stlport-version>
but that's in no way superior.
> is something that's unused though it all works. If you have a better
> patch that's fine by me, but please make sure that STLPORT_VERSION is
> actually honored - as it is at present.
On second look your patch seems mostly fine. I'd suggest two changes:
local version ;
version ?= [ get-values <stlport-version> : $(gBUILD_PROPERTIES) ] ;
version ?= $(STLPORT_VERSION) ;
The first use of ?= doesn't make any sense; version is always empty
after you declare it local, so you might as well write:
local version = [ get-values <stlport-version> : $(gBUILD_PROPERTIES) ] ;
version ?= $(STLPORT_VERSION) ;
The other is to change STLPORT_VERSION_FLAG to something like
unused-flag-just-to-make-<stlport-version>-relevant .
-- Dave Abrahams Boost Consulting www.boost-consulting.com
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