From c8641a6de65670b8833992c94c51a586a6434a74 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 7 Nov 2009 08:32:44 -0500 Subject: Added support for Boost.Regex w/ ICU This allows for correct searching of UTF-8 encoded strings, such as lower-case versions of Russian words to find mixed-case words. --- tools/configure.ac | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tools') diff --git a/tools/configure.ac b/tools/configure.ac index 22b4b96a..747d940d 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -193,6 +193,29 @@ else AC_MSG_FAILURE("Could not find boost_regex library (set CPPFLAGS and LDFLAGS?)") fi +AC_CACHE_CHECK( + [if boost_regex w/ICU is available], + [boost_regex_icu_avail_cv_], + [boost_regex_icu_save_libs=$LIBS + LIBS="-licuuc $LIBS" + AC_LANG_PUSH(C++) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + using namespace boost;]], + [[std::string text = "Активы"; + u32regex r = make_u32regex("активы", regex::perl | regex::icase); + return u32regex_search(text, r) ? 0 : 1;]])], + [boost_regex_icu_avail_cv_=true], + [boost_regex_icu_avail_cv_=false]) + AC_LANG_POP + LIBS=$boost_regex_icu_save_libs]) + +if [test x$boost_regex_icu_avail_cv_ = xtrue ]; then + AC_DEFINE([HAVE_BOOST_REGEX_UNICODE], [1], [If the boost_regex library w/ICU is available]) + LIBS="-licuuc $LIBS" +fi + # check for boost_date_time AC_CACHE_CHECK( [if boost_date_time is available], -- cgit v1.2.3