From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/boost/libs/regex/build/Jamfile.v2 | 158 ++++++++++++++++++++++++++++ src/boost/libs/regex/build/has_icu_test.cpp | 52 +++++++++ 2 files changed, 210 insertions(+) create mode 100644 src/boost/libs/regex/build/Jamfile.v2 create mode 100644 src/boost/libs/regex/build/has_icu_test.cpp (limited to 'src/boost/libs/regex/build') diff --git a/src/boost/libs/regex/build/Jamfile.v2 b/src/boost/libs/regex/build/Jamfile.v2 new file mode 100644 index 000000000..f54157283 --- /dev/null +++ b/src/boost/libs/regex/build/Jamfile.v2 @@ -0,0 +1,158 @@ +# copyright John Maddock 2003 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt. + +import modules ; +import testing ; +import errors ; + +project : requirements + # default to all warnings on: + all + ; + +local disable-icu = [ MATCH (--disable-icu) : [ modules.peek : ARGV ] ] ; + +rule path_options ( properties * ) +{ + local result ; + if 64 in $(properties) && msvc in $(properties) + { + result = $(ICU_PATH)/bin64 $(ICU_PATH)/lib64 ; + } + else + { + result = $(ICU_PATH)/bin $(ICU_PATH)/lib ; + } + return $(result) ; +} + +# +# ICU configuration: +# +if ! $(disable-icu) +{ + if [ modules.peek : ICU_LINK ] + { + errors.user-error : "The ICU_LINK option is no longer supported by the Boost.Regex build - please refer to the documentation for equivalent options" ; + } + + if [ modules.peek : ICU_PATH ] + { + ICU_PATH = [ modules.peek : ICU_PATH ] ; + } + if [ modules.peek : ICU_ICUUC_NAME ] + { + ICU_ICUUC_NAME = [ modules.peek : ICU_ICUUC_NAME ] ; + } + if [ modules.peek : ICU_ICUDT_NAME ] + { + ICU_ICUDT_NAME = [ modules.peek : ICU_ICUDT_NAME ] ; + } + if [ modules.peek : ICU_ICUIN_NAME ] + { + ICU_ICUIN_NAME = [ modules.peek : ICU_ICUIN_NAME ] ; + } + + if $(ICU_ICUUC_NAME) + { + lib icuuc : : $(ICU_ICUUC_NAME) ; + } + else + { + lib icuuc : : shared @path_options ; + lib icuuc : : msvc debug icuucd shared @path_options ; + lib icuuc : : intel windows debug icuucd shared @path_options ; + lib icuuc : : sicuuc static @path_options ; + lib icuuc : : msvc debug sicuucd static @path_options ; + lib icuuc : : intel windows debug sicuucd static @path_options ; + lib icuuc : : this_is_an_invalid_library_name ; + } + if $(ICU_ICUDT_NAME) + { + lib icudt : : $(ICU_ICUDT_NAME) ; + } + else + { + lib icudt : : icudata shared @path_options ; + lib icudt : : icudt msvc shared @path_options ; + lib icudt : : icudt intel windows shared @path_options ; + lib icudt : : sicudata static @path_options ; + lib icudt : : sicudt msvc static @path_options ; + lib icudt : : sicudt intel windows static @path_options ; + lib icudt : : this_is_an_invalid_library_name ; + } + if $(ICU_ICUIN_NAME) + { + lib icuin : : $(ICU_ICUIN_NAME) ; + } + else + { + lib icuin : : icui18n shared @path_options ; + lib icuin : : msvc debug icuind shared @path_options ; + lib icuin : : msvc icuin shared @path_options ; + lib icuin : : intel windows debug icuind shared @path_options ; + lib icuin : : intel windows icuin shared @path_options ; + lib icuin : : sicui18n static @path_options ; + lib icuin : : msvc debug sicuind static @path_options ; + lib icuin : : msvc sicuin static @path_options ; + lib icuin : : intel windows debug sicuind static @path_options ; + lib icuin : : intel windows sicuin static @path_options ; + lib icuin : : this_is_an_invalid_library_name ; + } + + ICU_OPTS = + $(ICU_PATH)/include + shared:icuuc/shared + shared:icudt/shared + shared:icuin/shared + static:icuuc + static:icudt + static:icuin + BOOST_HAS_ICU=1 + static:U_STATIC_IMPLEMENTATION=1 + ; + +} + +unit-test has_icu : has_icu_test.cpp : $(ICU_OPTS) ; +explicit has_icu ; + +alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ; + +SOURCES = + c_regex_traits.cpp + cpp_regex_traits.cpp + cregex.cpp + fileiter.cpp + icu.cpp + instances.cpp + posix_api.cpp + regex.cpp + regex_debug.cpp + regex_raw_buffer.cpp + regex_traits_defaults.cpp + static_mutex.cpp + w32_regex_traits.cpp + wc_regex_traits.cpp + wide_posix_api.cpp + winstances.cpp + usinstances.cpp ; + + +lib boost_regex : ../src/$(SOURCES) icu_options + : + shared:BOOST_REGEX_DYN_LINK=1 + gcc-cygwin:static + ; + +boost-install boost_regex ; + + + + + + + + diff --git a/src/boost/libs/regex/build/has_icu_test.cpp b/src/boost/libs/regex/build/has_icu_test.cpp new file mode 100644 index 000000000..31c964e71 --- /dev/null +++ b/src/boost/libs/regex/build/has_icu_test.cpp @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2010 + * John Maddock + * + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) && !defined(_DLL) +//#error "Mixing ICU with a static runtime doesn't work" +#endif + +void print_error(UErrorCode err, const char* func) +{ + std::cerr << "Error from function " << func << " with error: " << ::u_errorName(err) << std::endl; +} + +int main() +{ + // To detect possible binary mismatches between the installed ICU build, and whatever + // C++ std lib's we're using, we need to: + // * Make sure we call ICU C++ API's + // * Make sure we call std lib C++ API's as well (cout). + // * Be sure this program is run, not just built. + UErrorCode err = U_ZERO_ERROR; + UChar32 c = ::u_charFromName(U_UNICODE_CHAR_NAME, "GREEK SMALL LETTER ALPHA", &err); + std::cout << (int)c << std::endl; + if(err > 0) + { + print_error(err, "u_charFromName"); + return err; + } + U_NAMESPACE_QUALIFIER Locale l; + boost::scoped_ptr p_col(U_NAMESPACE_QUALIFIER Collator::createInstance(l, err)); + if(err > 0) + { + print_error(err, "Collator::createInstance"); + return err; + } + return err > 0 ? err : 0; +} -- cgit v1.2.3