Boost logo

Boost-Build :

From: Christopher Currie (Christopher_at_[hidden])
Date: 2003-08-04 09:31:51


> When I try to compile examples-v2/hello (milestone 4 and 5) under kylix
> and got errors:

[snip]

> What should I do to make it works?
>
> With best regards, Konstantin M. Litvinenko aka Dark Angel.

I believe you're encountering a problem with toolset inheritance. I
submitted a proposed patch for this problem last week, but the
maintainers have been busy. Try the attached patch and let me know if it
works for you.

Christopher

 --------------020702080504070409090300 Content-Type: text/plain;
name="inheritance.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="inheritance.patch"

Index: new/generators.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/new/generators.jam,v
retrieving revision 1.51
diff -u -r1.51 generators.jam
--- new/generators.jam 3 Jul 2003 07:52:57 -0000 1.51
+++ new/generators.jam 31 Jul 2003 03:44:45 -0000
@@ -118,6 +118,7 @@
import sequence ;
import type ;
import virtual-target ;
+ import property ;

self.id = $(id) ;
self.composing = $(composing) ;
@@ -616,7 +617,21 @@

# Update the set of generators for toolset
local id = [ $(g).id ] ;
- .generators-for-toolset.$(id:S=) += $(g) ;
+
+ # Some generators have multiple periods in their name, so the
+ # normal $(id:S=) won't generate the right toolset name.
+ # e.g. if id = gcc.compile.c++, then
+ # .generators-for-toolset.$(id:S=) will append to
+ # .generators-for-toolset.gcc.compile, which is a separate
+ # value from .generators-for-toolset.gcc. Correcting this
+ # makes generator inheritance work properly.
+ # See also inherit-generators in module toolset
+ local base = $(id) ;
+ while $(base:S)
+ {
+ base = $(base:B) ;
+ }
+ .generators-for-toolset.$(base) += $(g) ;
}

# Creates new instance of the 'generator' class and registers it.
Index: new/toolset.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/new/toolset.jam,v
retrieving revision 1.19
diff -u -r1.19 toolset.jam
--- new/toolset.jam 11 Jun 2003 08:40:44 -0000 1.19
+++ new/toolset.jam 31 Jul 2003 03:44:46 -0000
@@ -10,6 +10,7 @@
import errors : error ;
import property ;
import path ;
+import generators ;

.flag-no = 1 ;

@@ -263,7 +264,22 @@
for local g in $(base-generators)
{
local id = [ $(g).id ] ;
- local new-id = $(id:B=$(toolset)) ;
+
+ # Some generator names have multiple periods in their name, so
+ # $(id:B=$(toolset)) doesn't generate the right new-id name.
+ # e.g. if id = gcc.compile.c++, $(id:B=darwin) = darwin.c++,
+ # which is not what we want. Manually parse the base and suffix
+ # (if there's a better way to do this, I'd love to see it.)
+ # See also register in module generators.
+ local base = $(id) ;
+ local suffix = "" ;
+ while $(base:S)
+ {
+ suffix = $(base:S)$(suffix) ;
+ base = $(base:B) ;
+ }
+ local new-id = $(toolset)$(suffix) ;
+
generators.register [ $(g).clone $(new-id) : $(toolset) ] ;
}
}
@@ -317,4 +333,4 @@
local p = <b>0 <c>1 <d>2 <e>3 <f>4 ;
assert.result <c>1/<d>2/<e>3 : find-property-subset <c>1/<d>2/<e>3 <a>0/<b>0/<c>1 <d>2/<e>5 <a>9 : $(p) ;
assert.result : find-property-subset <a>0/<b>0/<c>9/<d>9/<e>5 <a>9 : $(p) ;
-}
\ No newline at end of file
+}
 --------------020702080504070409090300--


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