123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445 |
- # 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
- :
- : <search>$(ICONV_PATH)/lib <link>shared <runtime-link>shared
- :
- : <include>$(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
- : <cxxflags>-shared-libstdc++
- <cxxflags>-shared-libgcc
- <linkflags>-shared-libstdc++
- <linkflags>-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 = <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 ;
- }
- else
- {
- 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 ;
-
-
- }
- 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 <boost.locale.iconv>on in $(properties)
- || ! <boost.locale.iconv> in $(properties:G)
- && ! <target-os>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 += <library>iconv ;
- }
- }
- }
- if $(found-iconv)
- {
- flags-result += <define>BOOST_LOCALE_WITH_ICONV=1 ;
- }
- local found-icu ;
- if ! <boost.locale.icu>off in $(properties)
- {
- 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) ;
- }
- if $(found-icu)
- {
- ICU_SOURCES =
- boundary
- codecvt
- collator
- conversion
- date_time
- formatter
- icu_backend
- numeric
- time_zone
- ;
-
- result += <source>icu/$(ICU_SOURCES).cpp
- <library>../../thread/build//boost_thread
- ;
- }
- }
-
- if ! $(found-iconv) && ! $(found-icu) && ! <target-os>windows in $(properties) && ! <target-os>cygwin in $(properties)
- {
- ECHO "- Boost.Locale needs either iconv or ICU library to be built." ;
- result += <build>no ;
- }
-
- if ! <boost.locale.std> in $(properties:G)
- {
- if <toolset>sun in $(properties)
- {
- properties += <boost.locale.std>off ;
- }
- else
- {
- properties += <boost.locale.std>on ;
- }
- }
-
- if <boost.locale.std>off in $(properties)
- {
- flags-result += <define>BOOST_LOCALE_NO_STD_BACKEND=1 ;
- }
- else
- {
- STD_SOURCES =
- codecvt
- collate
- converter
- numeric
- std_backend
- ;
- result += <source>std/$(STD_SOURCES).cpp ;
- }
-
- if ! <boost.locale.winapi> in $(properties:G)
- {
- if <target-os>windows in $(properties)
- || <target-os>cygwin in $(properties)
- {
- properties += <boost.locale.winapi>on ;
- }
- else
- {
- properties += <boost.locale.winapi>off ;
- }
- }
- if <target-os>windows in $(properties)
- && <toolset>gcc in $(properties)
- && <link>shared in $(properties)
- && [ configure.builds accepts_shared_option : $(properties) : "g++ -shared-* supported" ]
- {
- flags-result += <cxxflags>-shared-libstdc++
- <cxxflags>-shared-libgcc
- <linkflags>-shared-libstdc++
- <linkflags>-shared-libgcc
- ;
- }
-
- if <boost.locale.winapi>off in $(properties)
- {
- flags-result += <define>BOOST_LOCALE_NO_WINAPI_BACKEND=1 ;
- }
- else
- {
- WINAPI_SOURCES =
- collate
- converter
- numeric
- win_backend
- ;
- result += <source>win32/$(WINAPI_SOURCES).cpp ;
- }
-
- if ( ! <boost.locale.winapi>off in $(properties) || ! <boost.locale.std>off in $(properties) )
- && ( <target-os>windows in $(properties) || <target-os>cygwin in $(properties) )
- {
- result += <source>win32/lcid.cpp ;
- }
-
- if ! <boost.locale.posix> in $(properties:G)
- {
- if <target-os>linux in $(properties)
- || <target-os>darwin in $(properties)
- || ( <target-os>freebsd in $(properties) && [ configure.builds has_xlocale : $(properties) : "xlocale supported" ] )
- {
- properties += <boost.locale.posix>on ;
- }
- else
- {
- properties += <boost.locale.posix>off ;
- }
- }
-
- if <boost.locale.posix>off in $(properties)
- {
- flags-result += <define>BOOST_LOCALE_NO_POSIX_BACKEND=1 ;
- }
- else
- {
- POSIX_SOURCES =
- collate
- converter
- numeric
- codecvt
- posix_backend
- ;
- result += <source>posix/$(POSIX_SOURCES).cpp ;
- }
- if <boost.locale.posix>on in $(properties) || <boost.locale.std>on in $(properties) || <boost.locale.winapi>on in $(properties)
- {
- result += <source>util/gregorian.cpp ;
- }
-
- result += <library>../../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 : : : : <conditional>@configure ;
- alias build_flags : : : : <conditional>@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
- <define>BOOST_THREAD_NO_LIB=1
- <link>shared:<define>BOOST_LOCALE_DYN_LINK=1
- <threading>multi
- # Meanwhile remove this
- <conditional>@configure
- ;
- boost-install boost_locale ;
- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
|