diff --git a/src/build/feature.jam b/src/build/feature.jam index 50289b7ad..f2864e7b5 100644 --- a/src/build/feature.jam +++ b/src/build/feature.jam @@ -733,7 +733,10 @@ rule split ( property-set ) # Appends a rule to the list of rules assigned to the given feature or property. # That rules will be used in extending property sets by the 'run-actions' rule. -# The rule should accept single argument -- a property, and return a set of additional +# The rule should accept two arguments: +# - the property which is registered +# - the list of all properties +# and return a set of additional # properties to be added. Property should be specified in the usual way: # value, and feature should be specified as . rule action ( property-or-feature : rule-name ) @@ -771,7 +774,7 @@ rule run-actions ( properties * ) } for local r in $(rules) { - added += [ $(r) $(e) ] ; + added += [ $(r) $(e) : $(properties) ] ; } } return $(properties) $(added) ; @@ -810,22 +813,22 @@ local rule __test__ ( ) subfeature toolset gcc : version : 2.95.2 2.95.3 2.95.4 3.0 3.0.1 3.0.2 : optional ; - rule handle-stlport ( property ) + rule handle-stlport ( property : properties * ) { return /path/to/stlport ; } - rule handle-magic ( property ) + rule handle-magic ( property : properties * ) { return MAGIC=$(property:G=) ; } - rule handle-magic2 ( property ) + rule handle-magic2 ( property : properties * ) { return MAGIC=BIG_MAGIC ; } - rule handle-magic3 ( property ) + rule handle-magic3 ( property : properties * ) { return MAGIC=VERY_BIG_MAGIC ; } diff --git a/stlport.jam b/stlport.jam new file mode 100644 index 000000000..219bbe732 --- /dev/null +++ b/stlport.jam @@ -0,0 +1,77 @@ +# (C) Copyright Gennadiy Rozental 2002. +# (C) Copyright Vladimir Prus 2002. +# Permission to copy, use, +# modify, sell and distribute this software is granted provided this +# copyright notice appears in all copies. This software is provided +# "as is" without express or implied warranty, and with no claim as +# to its suitability for any purpose. + +import feature : feature subfeature ; + +feature.extend stdlib : stlport ; + +# STLport iostreams or native iostreams +subfeature stdlib stlport : iostream : hostios : optional propagated ; + +# STLport extensions +#subfeature stdlib stlport : extensions : on off ; + +# STLport anachronisms +#subfeature stdlib stlport : anachronisms : on off ; + +# STLport debug allocation +#subfeature stdlib stlport : debug-alloc : off on ; + + +rule init ( headers : libraries ? ) +{ + .headers = $(headers) ; + .libraries = $(libraries) ; + + feature.action stlport : adjust-properties ; +} + +rule adjust-properties ( property : properties * ) +{ + local result = $(.headers) ; + + local need-library ; + if hostios in $(properties) + { + result += _STLP_NO_OWN_IOSTREAMS ; + } + else + { + result += $(.libraries) ; + need-library = true ; + } + + # Commented out until I find out why stlport won't link + # with debugging on, using Boost.Build or otherwise. + if $(0) { + + local library ; + if debug in $(properties) + { + result += _STLP_DEBUG ; + library = stlport_gcc_debug pthread ; + } + else + { + library = stlport_gcc ; + } + } + + library = stlport_gcc ; + + + if $(need-library) + { + result += $(library) ; + } + + + return $(result) ; +} + +