From b6d4e9f4026f69cc717c506f0fcea5a1387a6975 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 15 Aug 2003 18:31:28 +0000 Subject: [PATCH] Fix locale support for metrowerks [SVN r19620] --- boost-base.jam | 21 +++++++++++++++++++++ v1/boost-base.jam | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) 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) ; +}