Boost logo

Boost-Build :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2008-03-25 06:56:54


I am trying to use an obviously seldom used feature of the tagging
machinery.

In my custome tag rule I tried to use something like

        return [ common.format-name
            <base> <toolset> <property:toolset-gcc:flavor> <threading>
<runtime>
            : $(name) : $(type) : $(property-set) ] ;

I concluded from the doc several lines above:

# <property:/property-name/>[joiner]
# :: Direct lookup of the given property-name value in the
# build properties.

it should work so as to look up the value of the property in the current
property set and append it to the tag.

Unfortunately this doe not work as expected. The lookup code does not
try to look up in the properties, but in the format string.

I attach a patch that resolves this issue, and also allows pattern
matching, so that
e.g.
<property:toolset-.*:flavor> would match every toolsets flavor.

Btw.: Why do I need this:

In an attempt to use a cross compiler (my target platfor also is linux,
but different
processor) I attach e.g. the "ppc" flavor to my cross gcc. Now I need to tag
the libs accordingly.

I know I could hard code the whole stuff, but I thought it would be nicer
to use boost-build as much as possible.

In case I do oversee something and there is a more straight forward
method to
achieve the same, I would be very glad to hear about.

Thank you for attention,
Roland

Index: tools/common.jam
===================================================================
--- tools/common.jam (revision 43740)
+++ tools/common.jam (working copy)
@@ -678,12 +678,15 @@
 
                 case <property:*> :
                 local key = [ MATCH <property:(.*)> : $(f:G) ] ;
- local p = [ $(property-set).get [ MATCH <property:(.*)> : $(f:G) ] ] ;
- if $(p)
- {
- result += [ join-tag $(f:G=) : $(p) ] ;
+ local p0 = [ MATCH <($(key))> : [ $(property-set).raw ] ] ;
+ if $(p0) {
+ local p = [ $(property-set).get <$(p0)> ] ;
+ if $(p)
+ {
+ result += [ join-tag $(f:G=) : $(p) ] ;
+ }
                 }
-
+
                 case * :
                 result += $(f:G=) ;
             }


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