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/locale/build/Jamfile.v2 | 445 +++++++++++++++++++++++++++ src/boost/libs/locale/build/has_iconv.cpp | 14 + src/boost/libs/locale/build/has_icu_test.cpp | 29 ++ src/boost/libs/locale/build/has_xlocale.cpp | 12 + src/boost/libs/locale/build/option.cpp | 10 + 5 files changed, 510 insertions(+) create mode 100644 src/boost/libs/locale/build/Jamfile.v2 create mode 100644 src/boost/libs/locale/build/has_iconv.cpp create mode 100644 src/boost/libs/locale/build/has_icu_test.cpp create mode 100644 src/boost/libs/locale/build/has_xlocale.cpp create mode 100644 src/boost/libs/locale/build/option.cpp (limited to 'src/boost/libs/locale/build') diff --git a/src/boost/libs/locale/build/Jamfile.v2 b/src/boost/libs/locale/build/Jamfile.v2 new file mode 100644 index 000000000..578e722ee --- /dev/null +++ b/src/boost/libs/locale/build/Jamfile.v2 @@ -0,0 +1,445 @@ +# copyright John Maddock 2003, Artyom Beilis 2010 +# 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. + + + +project /boost/locale + : source-location ../src + ; + +import configure ; +import os ; +import toolset ; +import project ; +import feature ; +# Features + +feature.feature boost.locale.iconv : on off : optional propagated ; +feature.feature boost.locale.icu : on off : optional propagated ; +feature.feature boost.locale.posix : on off : optional propagated ; +feature.feature boost.locale.std : on off : optional propagated ; +feature.feature boost.locale.winapi : on off : optional propagated ; + +# Configuration of libraries + +## iconv + +obj has_iconv_libc_obj : ../build/has_iconv.cpp ; +exe has_iconv : has_iconv_libc_obj ; +explicit has_iconv ; + +ICONV_PATH = [ modules.peek : ICONV_PATH ] ; + +lib iconv + : + : $(ICONV_PATH)/lib shared shared + : + : $(ICONV_PATH)/include + ; + +explicit iconv ; + +obj has_iconv_libc_ext : ../build/has_iconv.cpp iconv ; +exe has_external_iconv : has_iconv_libc_ext iconv ; +explicit has_external_iconv ; + +exe accepts_shared_option : ../build/option.cpp + : -shared-libstdc++ + -shared-libgcc + -shared-libstdc++ + -shared-libgcc + ; + +# Xlocale +obj has_xlocale_obj : ../build/has_xlocale.cpp ; +exe has_xlocale : has_xlocale_obj ; +explicit has_xlocale ; + +#end xlocale + + +ICU_PATH = [ modules.peek : ICU_PATH ] ; +ICU_LINK = [ modules.peek : ICU_LINK ] ; + +if $(ICU_LINK) +{ + ICU_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin shared ; + ICU64_OPTS = $(ICU_PATH)/include $(ICU_LINK) $(ICU_PATH)/bin64 shared ; +} +else +{ + searched-lib icuuc : : icuuc + $(ICU_PATH)/lib + shared + shared ; + + searched-lib icuuc : : msvc + debug + icuucd + $(ICU_PATH)/lib + shared + shared ; + + searched-lib icuuc : : this_is_an_invalid_library_name ; + + searched-lib icudt : : $(ICU_PATH)/lib + icudata + shared + shared ; + + searched-lib icudt : : $(ICU_PATH)/lib + icudt + msvc + shared + shared ; + + searched-lib icudt : : this_is_an_invalid_library_name ; + + searched-lib icuin : : $(ICU_PATH)/lib + icui18n + shared + shared ; + + searched-lib icuin : : msvc + debug + icuind + $(ICU_PATH)/lib + shared + shared ; + + searched-lib icuin : : msvc + release + icuin + $(ICU_PATH)/lib + shared + shared ; + + searched-lib icuin : : this_is_an_invalid_library_name ; + + explicit icuuc icudt icuin ; + + ICU_OPTS = $(ICU_PATH)/include + icuuc/shared/shared + icudt/shared/shared + icuin/shared/shared + $(ICU_PATH)/bin + shared ; + + + + searched-lib icuuc_64 : : icuuc + $(ICU_PATH)/lib64 + shared + shared ; + + searched-lib icuuc_64 : : msvc + debug + icuucd + $(ICU_PATH)/lib64 + shared + shared ; + + searched-lib icuuc_64 : : this_is_an_invalid_library_name ; + + searched-lib icudt_64 : : $(ICU_PATH)/lib64 + icudata + shared + shared ; + + searched-lib icudt_64 : : $(ICU_PATH)/lib64 + icudt + msvc + shared + shared ; + + searched-lib icudt_64 : : this_is_an_invalid_library_name ; + + searched-lib icuin_64 : : $(ICU_PATH)/lib64 + icui18n + shared + shared ; + + searched-lib icuin_64 : : msvc + debug + icuind + $(ICU_PATH)/lib64 + shared + shared ; + + searched-lib icuin_64 : : msvc + release + icuin + $(ICU_PATH)/lib64 + shared + shared ; + + searched-lib icuin_64 : : this_is_an_invalid_library_name ; + + explicit icuuc_64 icudt_64 icuin_64 ; + + ICU64_OPTS = $(ICU_PATH)/include + icuuc_64/shared/shared + icudt_64/shared/shared + icuin_64/shared/shared + $(ICU_PATH)/bin64 + shared ; + + +} + +obj has_icu_obj : ../build/has_icu_test.cpp : $(ICU_OPTS) ; +obj has_icu64_obj : ../build/has_icu_test.cpp : $(ICU64_OPTS) ; + +exe has_icu : has_icu_obj : $(ICU_OPTS) ; +exe has_icu64 : has_icu64_obj : $(ICU64_OPTS) ; + +explicit has_icu has_icu64 ; + + +# This function is called whenever the 'boost_locale' metatarget +# below is generated and figures what external components we have, +# what user wants, and what sources have to be compiled in the end. +rule configure-full ( properties * : flags-only ) +{ + + local result ; + local flags-result ; + + local found-iconv ; + + if on in $(properties) + || ! in $(properties:G) + && ! solaris in $(properties) + { + # See if iconv is bundled with standard library. + if [ configure.builds has_iconv : $(properties) : "iconv (libc)" ] + { + found-iconv = true ; + } + else + { + if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ] + { + found-iconv = true ; + result += iconv ; + } + } + } + if $(found-iconv) + { + flags-result += BOOST_LOCALE_WITH_ICONV=1 ; + } + + local found-icu ; + + if ! off in $(properties) + { + if [ configure.builds has_icu : $(properties) : "icu" ] + { + found-icu = true ; + flags-result += BOOST_LOCALE_WITH_ICU=1 $(ICU_OPTS) ; + } + else if [ configure.builds has_icu64 : $(properties) : "icu (lib64)" ] + { + found-icu = true ; + flags-result += BOOST_LOCALE_WITH_ICU=1 $(ICU64_OPTS) ; + } + + if $(found-icu) + { + ICU_SOURCES = + boundary + codecvt + collator + conversion + date_time + formatter + icu_backend + numeric + time_zone + ; + + result += icu/$(ICU_SOURCES).cpp + ../../thread/build//boost_thread + ; + } + + } + + if ! $(found-iconv) && ! $(found-icu) && ! windows in $(properties) && ! cygwin in $(properties) + { + ECHO "- Boost.Locale needs either iconv or ICU library to be built." ; + result += no ; + } + + if ! in $(properties:G) + { + if sun in $(properties) + { + properties += off ; + } + else + { + properties += on ; + } + } + + if off in $(properties) + { + flags-result += BOOST_LOCALE_NO_STD_BACKEND=1 ; + } + else + { + STD_SOURCES = + codecvt + collate + converter + numeric + std_backend + ; + result += std/$(STD_SOURCES).cpp ; + } + + if ! in $(properties:G) + { + if windows in $(properties) + || cygwin in $(properties) + { + properties += on ; + } + else + { + properties += off ; + } + } + if windows in $(properties) + && gcc in $(properties) + && shared in $(properties) + && [ configure.builds accepts_shared_option : $(properties) : "g++ -shared-* supported" ] + { + flags-result += -shared-libstdc++ + -shared-libgcc + -shared-libstdc++ + -shared-libgcc + ; + } + + if off in $(properties) + { + flags-result += BOOST_LOCALE_NO_WINAPI_BACKEND=1 ; + } + else + { + WINAPI_SOURCES = + collate + converter + numeric + win_backend + ; + result += win32/$(WINAPI_SOURCES).cpp ; + } + + if ( ! off in $(properties) || ! off in $(properties) ) + && ( windows in $(properties) || cygwin in $(properties) ) + { + result += win32/lcid.cpp ; + } + + if ! in $(properties:G) + { + if linux in $(properties) + || darwin in $(properties) + || ( freebsd in $(properties) && [ configure.builds has_xlocale : $(properties) : "xlocale supported" ] ) + { + properties += on ; + } + else + { + properties += off ; + } + } + + if off in $(properties) + { + flags-result += BOOST_LOCALE_NO_POSIX_BACKEND=1 ; + } + else + { + POSIX_SOURCES = + collate + converter + numeric + codecvt + posix_backend + ; + result += posix/$(POSIX_SOURCES).cpp ; + } + + if on in $(properties) || on in $(properties) || on in $(properties) + { + result += util/gregorian.cpp ; + } + + result += ../../system/build//boost_system ; + + + if "$(flags-only)" = "flags" + { + return $(flags-result) ; + } + else { + result += $(flags-result) ; + return $(result) ; + } +} + +rule configure ( properties * ) +{ + local result = [ configure-full $(properties) : "all" ] ; + return $(result) ; + +} + +rule configure-flags ( properties * ) +{ + local result ; + result = [ configure-full $(properties) : "flags" ] ; + return $(result) ; + +} + + +alias build_options : : : : @configure ; +alias build_flags : : : : @configure-flags ; + +lib boost_locale + : + encoding/codepage.cpp + shared/date_time.cpp + shared/format.cpp + shared/formatting.cpp + shared/generator.cpp + shared/ids.cpp + shared/localization_backend.cpp + shared/message.cpp + shared/mo_lambda.cpp + util/codecvt_converter.cpp + util/default_locale.cpp + util/info.cpp + util/locale_data.cpp + : + # Don't link explicitly, not required + BOOST_THREAD_NO_LIB=1 + shared:BOOST_LOCALE_DYN_LINK=1 + multi + # Meanwhile remove this + @configure + ; + +boost-install boost_locale ; + + +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 + diff --git a/src/boost/libs/locale/build/has_iconv.cpp b/src/boost/libs/locale/build/has_iconv.cpp new file mode 100644 index 000000000..7b500580f --- /dev/null +++ b/src/boost/libs/locale/build/has_iconv.cpp @@ -0,0 +1,14 @@ +// +// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) +// +// 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) +// +#include + +int main() +{ + iconv_t d = iconv_open(0,0); + (void)(d); +} diff --git a/src/boost/libs/locale/build/has_icu_test.cpp b/src/boost/libs/locale/build/has_icu_test.cpp new file mode 100644 index 000000000..9419b3019 --- /dev/null +++ b/src/boost/libs/locale/build/has_icu_test.cpp @@ -0,0 +1,29 @@ +/* + * + * 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 + +#if defined(_MSC_VER) && !defined(_DLL) +#error "Mixing ICU with a static runtime doesn't work" +#endif + +int main() +{ + icu::Locale loc; + UErrorCode err = U_ZERO_ERROR; + UChar32 c = ::u_charFromName(U_UNICODE_CHAR_NAME, "GREEK SMALL LETTER ALPHA", &err); + return err; +} + diff --git a/src/boost/libs/locale/build/has_xlocale.cpp b/src/boost/libs/locale/build/has_xlocale.cpp new file mode 100644 index 000000000..4d788e2b7 --- /dev/null +++ b/src/boost/libs/locale/build/has_xlocale.cpp @@ -0,0 +1,12 @@ +// +// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) +// +// 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) +// +#include +int main() +{ + newlocale(LC_ALL_MASK,"",0); +} diff --git a/src/boost/libs/locale/build/option.cpp b/src/boost/libs/locale/build/option.cpp new file mode 100644 index 000000000..d321a959d --- /dev/null +++ b/src/boost/libs/locale/build/option.cpp @@ -0,0 +1,10 @@ +// +// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) +// +// 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) +// +int main() +{ +} -- cgit v1.2.3