From 99a8d745495815916801003c744b845c2f9e278a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Wed, 12 Jul 2017 17:31:51 +0200 Subject: [PATCH] Use ICU in boost build --- ports/boost/0001-Fix-boost-ICU-support.patch | 166 +++++++++++++++++++ ports/boost/CONTROL | 2 +- ports/boost/desktop/user-config.jam | 28 ++++ ports/boost/portfile.cmake | 6 +- ports/boost/uwp/user-config.jam | 8 + 5 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 ports/boost/0001-Fix-boost-ICU-support.patch diff --git a/ports/boost/0001-Fix-boost-ICU-support.patch b/ports/boost/0001-Fix-boost-ICU-support.patch new file mode 100644 index 0000000000..1952f5a648 --- /dev/null +++ b/ports/boost/0001-Fix-boost-ICU-support.patch @@ -0,0 +1,166 @@ +--- + libs/locale/build/Jamfile.v2 | 63 ++++++-------------------------------- + libs/locale/build/has_icu_test.cpp | 4 --- + libs/regex/build/Jamfile.v2 | 47 +++++++--------------------- + 3 files changed, 20 insertions(+), 94 deletions(-) + +diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2 +index 578e722..5f25917 100644 +--- a/libs/locale/build/Jamfile.v2 ++++ b/libs/locale/build/Jamfile.v2 +@@ -70,62 +70,17 @@ if $(ICU_LINK) + } + 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 ; ++ alias icuuc : /user-config//icuuc ; ++ alias icuin : /user-config//icuin ; ++ alias icudt : /user-config//icudt ; ++ ++ explicit icuuc icuin icudt ; + + ICU_OPTS = $(ICU_PATH)/include +- icuuc/shared/shared +- icudt/shared/shared +- icuin/shared/shared +- $(ICU_PATH)/bin +- shared ; ++ icuuc ++ icuin ++ icudt ++ $(ICU_PATH)/bin ; + + + +diff --git a/libs/locale/build/has_icu_test.cpp b/libs/locale/build/has_icu_test.cpp +index 9419b30..ed9be05 100644 +--- a/libs/locale/build/has_icu_test.cpp ++++ b/libs/locale/build/has_icu_test.cpp +@@ -15,10 +15,6 @@ + #include + #include + +-#if defined(_MSC_VER) && !defined(_DLL) +-#error "Mixing ICU with a static runtime doesn't work" +-#endif +- + int main() + { + icu::Locale loc; +diff --git a/libs/regex/build/Jamfile.v2 b/libs/regex/build/Jamfile.v2 +index 58fd1fb..76ee9f4 100644 +--- a/libs/regex/build/Jamfile.v2 ++++ b/libs/regex/build/Jamfile.v2 +@@ -48,50 +48,25 @@ if ! $(disable-icu) + } + 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 ; +- +- 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 ; +- +- 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 ; ++ ++ alias icuuc : /user-config//icuuc ; ++ alias icuin : /user-config//icuin ; ++ alias icudt : /user-config//icudt ; ++ ++ explicit icuuc icuin icudt ; + + 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 ++ icuuc ++ icudt ++ icuin ++ BOOST_HAS_ICU=1 + ; + } + + } + +-unit-test has_icu : has_icu_test.cpp : $(ICU_OPTS) ; ++exe has_icu : has_icu_test.cpp : $(ICU_OPTS) ; + explicit has_icu ; + + alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ; +-- +2.12.2.windows.2 + diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 8200d54d15..6c77320213 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost Version: 1.65-1 Description: Peer-reviewed portable C++ source libraries -Build-Depends: zlib, bzip2 +Build-Depends: zlib, bzip2, icu [windows] diff --git a/ports/boost/desktop/user-config.jam b/ports/boost/desktop/user-config.jam index 8faba6d72d..212cd06b8c 100644 --- a/ports/boost/desktop/user-config.jam +++ b/ports/boost/desktop/user-config.jam @@ -5,3 +5,31 @@ using msvc : 14.0 : cl.exe : using msvc : 14.1 : cl.exe : echo ; + +project user-config ; +lib advapi32 ; +lib icuuc : : @CURRENT_INSTALLED_DIR@/lib : : + @LIB_RUNTIME_LINK@ + advapi32 ; + +lib icuuc : : @CURRENT_INSTALLED_DIR@/debug/lib + debug + icuucd : : + @LIB_RUNTIME_LINK@ + advapi32 ; + +lib icuin : : @CURRENT_INSTALLED_DIR@/lib : : + @LIB_RUNTIME_LINK@ ; + +lib icuin : : @CURRENT_INSTALLED_DIR@/debug/lib + debug + icuind : : + @LIB_RUNTIME_LINK@ ; + +lib icudt : : @CURRENT_INSTALLED_DIR@/lib : : + @LIB_RUNTIME_LINK@ ; + +lib icudt : : @CURRENT_INSTALLED_DIR@/debug/lib + debug + icudtd : : + @LIB_RUNTIME_LINK@ ; \ No newline at end of file diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 3ed0ed9c56..74db8a5246 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -32,7 +32,8 @@ FILE(READ "${DIFF}" content) STRING(REGEX REPLACE "include/" "" content "${content}") set(DIFF2 ${CURRENT_BUILDTREES_DIR}/src/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed) FILE(WRITE ${DIFF2} "${content}") -vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF2}) +vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF2} + ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-boost-ICU-support.patch) ###################### # Cleanup previous builds @@ -83,6 +84,7 @@ message(STATUS "Bootstrapping done") set(B2_OPTIONS -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" -sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" + -sICU_PATH="${CURRENT_INSTALLED_DIR}" -j$ENV{NUMBER_OF_PROCESSORS} --debug-configuration --hash @@ -92,10 +94,12 @@ set(B2_OPTIONS threading=multi ) +set(LIB_RUNTIME_LINK "shared") if (VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND B2_OPTIONS runtime-link=shared) else() list(APPEND B2_OPTIONS runtime-link=static) + set(LIB_RUNTIME_LINK "static") endif() if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) diff --git a/ports/boost/uwp/user-config.jam b/ports/boost/uwp/user-config.jam index 88e7c5974e..975b1d4125 100644 --- a/ports/boost/uwp/user-config.jam +++ b/ports/boost/uwp/user-config.jam @@ -13,3 +13,11 @@ using msvc : 14.1 : cl.exe : RuntimeObject.lib ole32.lib ; + +project user-config ; + +lib icuuc : : dummy_lib_that_doesnt_exist ; + +lib icuin : : dummy_lib_that_doesnt_exist ; + +lib icudt : : dummy_lib_that_doesnt_exist ; \ No newline at end of file