Boost.Locale
|
Now all you need to do is to invoke bjam:
./bjam --with-locale stage
Or on Windows
.\bjam --with-locale stage
If you are using a custom ICU build or you are using Microsoft Windows, you need to provide a path to the location of the ICU library using the -sICU_PATH
option
For example:
/opt/icu46
such that the files are placed like/opt/icu46/include/unicode/uversion
.h/opt/icu46/include/unicode/calendar
.h
... /opt/icu46/lib/libicudata
.so /opt/icu46/lib/libicui18n
.so
... -sICU_PATH=/opt/icu46
./bjam --with-locale -sICU_PATH=/opt/icu46 stage
c:\icu46
such that the files are placed like c:\icu46\include\unicode\uversion.h
c:\icu46\include\unicode\calendar.h
...
c:\icu46\bin\icudt.dll
c:\icu46\bin\icuin.dll
...
c:\icu46\lib\icudt.lib
c:\icu46\lib\icuin.lib
...
-sICU_PATH=c:\icu46
.\bjam --with-locale -sICU_PATH=c:\icu46 stage
Boost.Locale supports the following options with values off
or on
boost.locale.icu=off
prevents building the ICU backend even if the ICU library existsboost.locale.iconv
enables or disables the iconv backend. It is off by default on Windows and Solarisboost.locale.winapi=off
disables the winapi backend. It is on by default on Windows and Cygwinboost.locale.std
enables or disables the std backend. The std backend is disabled by default when using Sun Studio.boost.locale.posix
enables or disables support of the POSIX backend. It is on by default on Linux and Mac OS XAlso Boost.Locale supports the following options
-sICU_PATH=/path/to/location/of/icu
- the location of the ICU library-sICONV_PATH=/path/to/location/of/iconv
- the location of the iconv libraryFor example:
.\bjam boost.locale.winapi=off boost.locale.std=off -sICU_PATH=c:\icu46 --with-locale stage
.\bjam boost.locale.posix=off boost.locale.icu=off --with-locale stage
You can run unit tests by invoking bjam
with the libs/locale/test
project parameter
./bjam libs/locale/test
Boost.Locale is built with binary compatibility in mind. Switching localization back ends on or off, or using iconv or not, does not affect binary compatibility. So if a dynamic library was built with all possible backends, other dynamic libraries compiled with, for example, only the std
, posix
or winapi
backends would still be binary-compatible.
Using a feature not included in the binary will result in an exception. For example, if you try to use boundary analysis or a calendar facet when the library does not support the ICU backend, you will get an exception.