diff --git a/boost-base.jam b/boost-base.jam index 989bbb81c..3eb0293da 100644 --- a/boost-base.jam +++ b/boost-base.jam @@ -2391,3 +2391,24 @@ rule unless ( test ? : no-value * : yes-value * ) rule cond ( test ? : yes-value * : no-value * ) { if $(test) { return $(yes-value) ; } else { return $(no-value) ; } } + +# Stick this rule name in your requirements if you are building code +# which requires locale support. It handles the metrowerks-specific +# case that locale support demands the static version of the runtime +# library. +rule std::locale-support ( toolset variant : subvariant-path properties * ) +{ + if [ MATCH .*(metrowerks|cwpro).* : $(toolset) ] + { + local p = [ MATCH (.*)runtime-link-dynamic(.*) : $(subvariant-path) ] ; + + subvariant-path = $(p[1])runtime-link-static$(p[2]) ; + + properties = + [ difference $(properties) : dynamic ] + static + ; + } + + return $(subvariant-path) $(properties) ; +} diff --git a/v1/boost-base.jam b/v1/boost-base.jam index 989bbb81c..3eb0293da 100644 --- a/v1/boost-base.jam +++ b/v1/boost-base.jam @@ -2391,3 +2391,24 @@ rule unless ( test ? : no-value * : yes-value * ) rule cond ( test ? : yes-value * : no-value * ) { if $(test) { return $(yes-value) ; } else { return $(no-value) ; } } + +# Stick this rule name in your requirements if you are building code +# which requires locale support. It handles the metrowerks-specific +# case that locale support demands the static version of the runtime +# library. +rule std::locale-support ( toolset variant : subvariant-path properties * ) +{ + if [ MATCH .*(metrowerks|cwpro).* : $(toolset) ] + { + local p = [ MATCH (.*)runtime-link-dynamic(.*) : $(subvariant-path) ] ; + + subvariant-path = $(p[1])runtime-link-static$(p[2]) ; + + properties = + [ difference $(properties) : dynamic ] + static + ; + } + + return $(subvariant-path) $(properties) ; +}