summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-07 08:32:44 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-07 08:34:13 -0500
commitc8641a6de65670b8833992c94c51a586a6434a74 (patch)
treeeb59642cd3296a98ec4c7a73ca319b1c57c2f7ad /tools
parent95a068f5e4b0e5c06fd9824f7f999248e28fee7b (diff)
downloadfork-ledger-c8641a6de65670b8833992c94c51a586a6434a74.tar.gz
fork-ledger-c8641a6de65670b8833992c94c51a586a6434a74.tar.bz2
fork-ledger-c8641a6de65670b8833992c94c51a586a6434a74.zip
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.
Diffstat (limited to 'tools')
-rw-r--r--tools/configure.ac23
1 files changed, 23 insertions, 0 deletions
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 <boost/regex/icu.hpp>
+ 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],