Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-12-01 04:43:58


Hi Reece,

> I am trying to get stlport up and running using BBv2, but am running
> into some problems. I have downloaded it and built it for vc71, setup with:
>
> using stlport : 4.6 : f:/devel/stlport/462/stlport ;
>
> However, when I run:
>
> bjam release msvc-7.1 stdlib=stlport-4.6
>
> I get...
>
> f:/devel/boost/boost/tools/build/v2/build\targets.jam:464: in
> start-building fro
> m module targets
> error: Recursion in main target references
> error: the following target are being built currently:
> error: ./bin /stlport /stlport

That's a subtle bug. It worked for me with

using stlport : : /usr/include/stlport ;

but now I've tried with

using stlport : 4.6 : /usr/include/stlport ;

and see the same error. In fact, looks like support for having different
versions of stlport is broken.

I've committed the attached patch, and verified that it work both for
no-version configuration and for two initialized stlport versions. Could you
either update from CVS or apply the patch, and try again?

- Volodya
 --Boundary-00=_eJZrB0U1ZflCZYM Content-Type: text/x-diff;
charset="iso-8859-1";
name="stlport.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="stlport.diff"

Index: tools/stlport.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/stlport.jam,v
retrieving revision 1.14
diff -u -r1.14 stlport.jam
--- tools/stlport.jam 22 Nov 2004 07:52:11 -0000 1.14
+++ tools/stlport.jam 1 Dec 2004 09:40:11 -0000
@@ -38,6 +38,7 @@
import "class" : new ;
import targets ;
import property-set ;
+import common ;

# Make this module into a project.
project.initialize $(__name__) ;
@@ -55,8 +56,6 @@
feature.extend stdlib : stlport ;
feature.compose <stdlib>stlport : <library>/stlport//stlport ;

-subfeature stdlib stlport : version : : optional propagated ;
-
# STLport iostreams or native iostreams
subfeature stdlib stlport : iostream : hostios : optional propagated ;

@@ -81,13 +80,33 @@
import feature project type errors generators ;
import set : difference ;

- rule __init__ ( project : headers ? : libraries ? : requirements * )
+ rule __init__ ( project : headers ? : libraries ? : version ? )
{
- basic-target.__init__ stlport : $(project) : : $(requirements) ;
+ basic-target.__init__ stlport : $(project) ;
self.headers = $(headers) ;
self.libraries = $(libraries) ;
+ self.version = $(version) ;
}
-
+
+ rule match ( property-set )
+ {
+ # Override the rule which detects if this basic-target is
+ # suitable for the specified property set.
+ # Basically, just checks that requested version is equal to
+ # self.version. We could have added stlport-$(version) to
+ # requirements, but then stlport-$(version) would show in
+ # the common properties, causing recursive building of ourselfs.
+
+ if [ $(property-set).get <stdlib-stlport:version> ] = $(self.version)
+ {
+ return stlport-$(self.version) ;
+ }
+ else
+ {
+ return no-match ;
+ }
+ }
+
rule generate ( property-set )
{
# Since this target is built with <stdlib>stlport, it will also
@@ -164,25 +183,39 @@
}
}

-rule stlport-target ( headers ? : libraries ? : requirements * )
+rule stlport-target ( headers ? : libraries ? : version ? )
{
local project = [ project.current ] ;

targets.main-target-alternative
[ new stlport-target-class $(project) : $(headers) : $(libraries)
- : [ targets.main-target-requirements $(requirements) : $(project) ]
+ : $(version)
] ;
}

+local .version-subfeature-defined ;
+
# Initialize stlport support.
rule init ( version ? :
headers # Location of header files
libraries ? # Location of libraries
)
{
- feature.extend-subfeature stdlib stlport : version : $(version) ;
-
+ # FIXME: need to use common.check-init-parameters here.
+ # At the moment, that rule always tries to define subfeature
+ # of the 'toolset' feature, while we need to define subfeature
+ # of <stdlib>stlport, so tweaks to check-init-parameters are needed.
+ if $(version)
+ {
+ if ! $(.version-subfeature-defined)
+ {
+ feature.subfeature stdlib stlport : version : : propagated ;
+ .version-subfeature-defined = true ;
+ }
+ feature.extend-subfeature stdlib stlport : version : $(version) ;
+ }
+
# Declare the main target for this STLPort version.
- stlport-target $(headers) : $(libraries) : <stdlib>stlport-$(version) ;
+ stlport-target $(headers) : $(libraries) : $(version) ;
}

 --Boundary-00=_eJZrB0U1ZflCZYM--


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