Skip to content

Commit

Permalink
boost: fix i18n_backend=icu support for version 1.7{1,2,3}.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ledocc committed May 25, 2020
1 parent 83a7e1a commit 37cc2b8
Show file tree
Hide file tree
Showing 10 changed files with 889 additions and 1 deletion.
18 changes: 18 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,33 @@ patches:
1.71.0:
- patch_file: "patches/bcp_namespace_issues_1_71.patch"
base_path: "boost_1_71_0"
- patch_file: "patches/boost_build_configure_relevant.patch"
base_path: "boost_1_71_0"
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch"
base_path: "boost_1_71_0"
- patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch"
base_path: "boost_1_71_0"
- patch_file: "patches/boost_locale_build_with_icu.patch"
base_path: "boost_1_71_0"
- patch_file: "patches/boost_regex_build_with_icu.patch"
base_path: "boost_1_71_0"
- patch_file: "patches/python_base_prefix.patch"
base_path: "boost_1_71_0"
- patch_file: "patches/solaris_pthread_data.patch"
base_path: "boost_1_71_0"
1.72.0:
- patch_file: "patches/bcp_namespace_issues_1_72.patch"
base_path: "boost_1_72_0"
- patch_file: "patches/boost_build_configure_relevant.patch"
base_path: "boost_1_72_0"
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch"
base_path: "boost_1_72_0"
- patch_file: "patches/boost_core_qnx_cxx_provide___cxa_get_globals.patch"
base_path: "boost_1_72_0"
- patch_file: "patches/boost_locale_build_with_icu.patch"
base_path: "boost_1_72_0"
- patch_file: "patches/boost_regex_build_with_icu_1_72.patch"
base_path: "boost_1_72_0"
- patch_file: "patches/python_base_prefix.patch"
base_path: "boost_1_72_0"
- patch_file: "patches/solaris_pthread_data.patch"
Expand All @@ -73,7 +85,13 @@ patches:
- patch_file: "patches/boost_log_filesystem_no_deprecated_1_72.patch"
base_path: "boost_1_72_0"
1.73.0:
- patch_file: "patches/boost_build_configure_relevant.patch"
base_path: "boost_1_73_0"
- patch_file: "patches/boost_build_qcc_fix_debug_build_parameter.patch"
base_path: "boost_1_73_0"
- patch_file: "patches/boost_locale_build_with_icu.patch"
base_path: "boost_1_73_0"
- patch_file: "patches/boost_regex_build_with_icu_1_72.patch"
base_path: "boost_1_73_0"
- patch_file: "patches/python_base_prefix.patch"
base_path: "boost_1_73_0"
4 changes: 3 additions & 1 deletion recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,14 @@ def _build_flags(self):

if self.options.i18n_backend == 'icu':
flags.append("-sICU_PATH={}".format(self.deps_cpp_info["icu"].rootpath))
if not self.options["icu"].shared:
flags.append( "-sICU_LINK_TYPE=static" )
flags.append("boost.locale.iconv=off boost.locale.icu=on")
elif self.options.i18n_backend == 'iconv':
flags.append("boost.locale.iconv=on boost.locale.icu=off")
else:
flags.append("boost.locale.iconv=off boost.locale.icu=off")
flags.append("--disable-icu --disable-iconvv")
flags.append("--disable-icu --disable-iconv")

def add_defines(option, library):
if option:
Expand Down
11 changes: 11 additions & 0 deletions recipes/boost/all/patches/boost_build_configure_relevant.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/tools/build/src/build/configure.jam 2019-08-14 14:03:50.000000000 +0200
+++ b/tools/build/src/build/configure.jam 2019-09-10 14:27:54.377625059 +0200
@@ -41,4 +41,4 @@
# relevant features are also considered relevant.
#
feature.compose <configure> :
- <target-os> <toolset> <address-model> <architecture> <cxxstd> ;
+ <target-os> <toolset> <address-model> <architecture> <cxxstd> <variant> <link> <runtime-link> ;


rule log-summary ( )
290 changes: 290 additions & 0 deletions recipes/boost/all/patches/boost_locale_build_with_icu.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
--- a/libs/locale/build/Jamfile.v2 2019-06-17 07:23:55.206087800 +0200
+++ b/libs/locale/build/Jamfile.v2 2019-06-17 16:05:21.060372400 +0200
@@ -60,142 +60,130 @@
#end xlocale


-ICU_PATH = [ modules.peek : ICU_PATH ] ;
-ICU_LINK = [ modules.peek : ICU_LINK ] ;
+rule path_options ( properties * )
+{
+ local result = <search>$(ICU_PATH)/bin <search>$(ICU_PATH)/lib ;
+ if <address-model>64<toolset>msvc in $(properties)
+ {
+ result = <search>$(ICU_PATH)/bin64 <search>$(ICU_PATH)/lib64 $(result) ;
+ }
+ return $(result) ;
+}

-if $(ICU_LINK)
+rule select_icu_options ( properties * )
{
- ICU_OPTS = <include>$(ICU_PATH)/include <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin <runtime-link>shared ;
- ICU64_OPTS = <include>$(ICU_PATH)/include <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin64 <runtime-link>shared ;
+ if $(ICU_LINK)
+ {
+ return <include>$(ICU_PATH)/include <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin <define>BOOST_HAS_ICU=1 <define>U_STATIC_IMPLEMENTATION=1 ;
+ }
+
+ local result =
+ <include>$(ICU_PATH)/include
+ <define>BOOST_HAS_ICU=1
+ <library>icuuc/<link>$(ICU_LINK_TYPE)
+ <library>icudt/<link>$(ICU_LINK_TYPE)
+ <library>icuin/<link>$(ICU_LINK_TYPE)
+ ;
+
+ if $(ICU_LINK_TYPE) = static
+ {
+ result += <define>U_STATIC_IMPLEMENTATION=1 ;
+
+ if <target-os>linux in $(properties)
+ {
+ result += <library>dl/<link>shared ;
+ }
+ else if <toolset>msvc in $(properties)
+ {
+ result += <library>advapi32 ;
+ }
+ }
+
+ return $(result) ;
}
-else
+
+rule use_icu_if_enable ( properties * )
{
- searched-lib icuuc : : <name>icuuc
- <search>$(ICU_PATH)/lib
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuuc : : <toolset>msvc
- <variant>debug
- <name>icuucd
- <search>$(ICU_PATH)/lib
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuuc : : <name>this_is_an_invalid_library_name ;
-
- searched-lib icudt : : <search>$(ICU_PATH)/lib
- <name>icudata
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icudt : : <search>$(ICU_PATH)/lib
- <name>icudt
- <toolset>msvc
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icudt : : <name>this_is_an_invalid_library_name ;
-
- searched-lib icuin : : <search>$(ICU_PATH)/lib
- <name>icui18n
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuin : : <toolset>msvc
- <variant>debug
- <name>icuind
- <search>$(ICU_PATH)/lib
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuin : : <toolset>msvc
- <variant>release
- <name>icuin
- <search>$(ICU_PATH)/lib
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuin : : <name>this_is_an_invalid_library_name ;
-
- explicit icuuc icudt icuin ;
-
- ICU_OPTS = <include>$(ICU_PATH)/include
- <library>icuuc/<link>shared/<runtime-link>shared
- <library>icudt/<link>shared/<runtime-link>shared
- <library>icuin/<link>shared/<runtime-link>shared
- <dll-path>$(ICU_PATH)/bin
- <runtime-link>shared ;
-
-
-
- searched-lib icuuc_64 : : <name>icuuc
- <search>$(ICU_PATH)/lib64
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuuc_64 : : <toolset>msvc
- <variant>debug
- <name>icuucd
- <search>$(ICU_PATH)/lib64
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuuc_64 : : <name>this_is_an_invalid_library_name ;
-
- searched-lib icudt_64 : : <search>$(ICU_PATH)/lib64
- <name>icudata
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icudt_64 : : <search>$(ICU_PATH)/lib64
- <name>icudt
- <toolset>msvc
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icudt_64 : : <name>this_is_an_invalid_library_name ;
-
- searched-lib icuin_64 : : <search>$(ICU_PATH)/lib64
- <name>icui18n
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuin_64 : : <toolset>msvc
- <variant>debug
- <name>icuind
- <search>$(ICU_PATH)/lib64
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuin_64 : : <toolset>msvc
- <variant>release
- <name>icuin
- <search>$(ICU_PATH)/lib64
- <link>shared
- <runtime-link>shared ;
-
- searched-lib icuin_64 : : <name>this_is_an_invalid_library_name ;
-
- explicit icuuc_64 icudt_64 icuin_64 ;
-
- ICU64_OPTS = <include>$(ICU_PATH)/include
- <library>icuuc_64/<link>shared/<runtime-link>shared
- <library>icudt_64/<link>shared/<runtime-link>shared
- <library>icuin_64/<link>shared/<runtime-link>shared
- <dll-path>$(ICU_PATH)/bin64
- <runtime-link>shared ;
-
-
+ local result ;
+ if [ configure.builds has_icu : $(properties) ]
+ {
+ result = [ select_icu_options $(properties) ] ;
+ }
+ return $(result) ;
}

-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) ;
+#
+# ICU configuration:
+#
+if ! $(disable-icu)
+{
+ if [ modules.peek : ICU_PATH ]
+ {
+ ICU_PATH = [ modules.peek : ICU_PATH ] ;
+ }
+ if [ modules.peek : ICU_LINK_TYPE ]
+ {
+ ICU_LINK_TYPE = [ modules.peek : ICU_LINK_TYPE ] ;
+ if ! $(ICU_LINK_TYPE) in shared static
+ {
+ EXIT "error: Invalid ICU_LINK_TYPE : $(ICU_LINK_TYPE). Valid value are \"shared or static\"" : 1 ;
+ }
+ }
+ else
+ {
+ ICU_LINK_TYPE = shared ;
+ }
+
+ if [ modules.peek : ICU_LINK ]
+ {
+ ICU_LINK = [ modules.peek : ICU_LINK ] ;
+ }
+
+
+ lib icuuc : : <name>icuuc <link>shared <conditional>@path_options ;
+ lib icuuc : : <name>icuucd <toolset>msvc <variant>debug <link>shared <conditional>@path_options ;
+ lib icuuc : : <name>icuucd <toolset>intel <target-os>windows <variant>debug <link>shared <conditional>@path_options ;
+ lib icuuc : : <name>icuuc <link>static <conditional>@path_options ;
+ lib icuuc : : <name>sicuuc <toolset>msvc <link>static <conditional>@path_options ;
+ lib icuuc : : <name>sicuucd <toolset>msvc <variant>debug <link>static <conditional>@path_options ;
+ lib icuuc : : <name>sicuuc <toolset>intel <target-os>windows <link>static <conditional>@path_options ;
+ lib icuuc : : <name>sicuucd <toolset>intel <target-os>windows <variant>debug <link>static <conditional>@path_options ;
+ lib icuuc : : <name>this_is_an_invalid_library_name ;
+
+ lib icudt : : <name>icudata <link>shared <conditional>@path_options ;
+ lib icudt : : <name>icudt <toolset>msvc <link>shared <conditional>@path_options ;
+ lib icudt : : <name>icudtd <toolset>msvc <variant>debug <link>shared <conditional>@path_options ;
+ lib icudt : : <name>icudt <toolset>intel <target-os>windows <link>shared <conditional>@path_options ;
+ lib icudt : : <name>icudtd <toolset>intel <target-os>windows <variant>debug <link>shared <conditional>@path_options ;
+ lib icudt : : <name>icudata <link>static <conditional>@path_options ;
+ lib icudt : : <name>sicudt <toolset>msvc <link>static <conditional>@path_options ;
+ lib icudt : : <name>sicudtd <toolset>msvc <variant>debug <link>static <conditional>@path_options ;
+ lib icudt : : <name>sicudt <toolset>intel <target-os>windows <link>static <conditional>@path_options ;
+ lib icudt : : <name>sicudtd <toolset>intel <target-os>windows <variant>debug <link>static <conditional>@path_options ;
+ lib icudt : : <name>this_is_an_invalid_library_name ;
+
+ lib icuin : : <name>icui18n <link>shared <conditional>@path_options ;
+ lib icuin : : <name>icuin <toolset>msvc <link>shared <conditional>@path_options ;
+ lib icuin : : <name>icuind <toolset>msvc <variant>debug <link>shared <conditional>@path_options ;
+ lib icuin : : <name>icuin <toolset>intel <target-os>windows <link>shared <conditional>@path_options ;
+ lib icuin : : <name>icuind <toolset>intel <target-os>windows <variant>debug <link>shared <conditional>@path_options ;
+ lib icuin : : <name>icui18n <link>static <conditional>@path_options ;
+ lib icuin : : <name>sicuin <toolset>msvc <link>static <conditional>@path_options ;
+ lib icuin : : <name>sicuind <toolset>msvc <variant>debug <link>static <conditional>@path_options ;
+ lib icuin : : <name>sicuin <toolset>intel <target-os>windows <link>static <conditional>@path_options ;
+ lib icuin : : <name>sicuind <toolset>intel <target-os>windows <variant>debug <link>static <conditional>@path_options ;
+ lib icuin : : <name>this_is_an_invalid_library_name ;
+
+ lib dl : : <name>dl <link>shared ;
+ lib dl : : <name>this_is_an_invalid_library_name ;

-explicit has_icu has_icu64 ;
+ lib advapi32 : : <name>advapi32 <toolset>msvc ;
+ lib advapi32 : : <name>this_is_an_invalid_library_name ;
+}
+
+unit-test has_icu : ../build/has_icu_test.cpp : <conditional>@select_icu_options ;
+explicit has_icu ;


# This function is called whenever the 'boost_locale' metatarget
@@ -239,16 +221,8 @@
if [ configure.builds has_icu : $(properties) : "icu" ]
{
found-icu = true ;
- flags-result += <define>BOOST_LOCALE_WITH_ICU=1 $(ICU_OPTS) ;
- }
- else if [ configure.builds has_icu64 : $(properties) : "icu (lib64)" ]
- {
- found-icu = true ;
- flags-result += <define>BOOST_LOCALE_WITH_ICU=1 $(ICU64_OPTS) ;
- }
+ flags-result += <define>BOOST_LOCALE_WITH_ICU=1 [ select_icu_options $(properties) ] ;

- if $(found-icu)
- {
ICU_SOURCES =
boundary
codecvt
--- a/libs/locale/build/has_icu_test.cpp 2019-05-21 10:45:05.709311300 +0200
+++ b/libs/locale/build/has_icu_test.cpp 2019-06-21 16:09:57.742157700 +0200
@@ -16,7 +16,7 @@
#include <unicode/coll.h>

#if defined(_MSC_VER) && !defined(_DLL)
-#error "Mixing ICU with a static runtime doesn't work"
+//#error "Mixing ICU with a static runtime doesn't work"
#endif

int main()
Loading

0 comments on commit 37cc2b8

Please sign in to comment.