From 7f8973247990a37fb17b8dc13b2f51a8750e9d52 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 21 Aug 2009 16:55:51 +0000 Subject: [PATCH] Merge: Force shared runtime if using ICU. [SVN r55699] --- build/Jamfile.v2 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 8943a3f9..e6fc51ad 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -221,17 +221,20 @@ if $(gHAS_ICU) { lib icucore : : $(gICU_CORE_LIB) $(ICU_SEARCH_OPTS) shared ; ICU_EXTRA_SOURCE = icucore ; + explicit icucore ; } if $(gICU_IN_LIB) { lib icuin : : $(gICU_IN_LIB) $(ICU_SEARCH_OPTS) shared ; ICU_EXTRA_SOURCE += icuin ; + explicit icuin ; } #Added by Tommy Nordgren libicudata must be linked against on Mac OS X if $(gICU_DATA_LIB) { lib icudata : : $(gICU_DATA_LIB) $(ICU_SEARCH_OPTS) shared ; ICU_EXTRA_SOURCE += icudata ; + explicit icudata ; } #End of addition by Tommy Nordgren } @@ -267,9 +270,36 @@ lib boost_regex : ../src/$(SOURCES) $(ICU_EXTRA_SOURCE) icu_config2 icu_config gcc-mingw:static gcc-cygwin:static $(BOOST_REGEX_ICU_OPTS) + @force-shared-linking ; +shared-linking-warning-emitted = ; + +# The ICU is shipped as shared libraries with dynamic runtime. +# If Boost.Regex is built against static runtime, the combination +# will not work. The below rule forces shared runtime, and +# prints an explanation. +rule force-shared-linking ( properties * ) +{ + if $(gHAS_ICU) + { + if static in $(properties) + { + if ! $(shared-linking-warning-emitted) + { + shared-linking-warning-emitted = 1 ; + ECHO "warning: forcing runtime-link=shared for Boost.Regex" ; + ECHO "warning: this is required when using the ICU library" ; + } + } + return shared ; + } +} + + + alias icu_options : $(ICU_EXTRA_SOURCE) : : : $(BOOST_REGEX_ICU_OPTS) ; +explicit icu_options ; boost-install boost_regex ;