Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Now all you need to do is invoke bjam command:
./bjam --with-locale stage
Or on Windows
.\bjam --with-locale stage
If you are using custom ICU build or you are using Microsoft Windows you need to provide a path to location of ICU library using -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 following options with values off or on
boost.locale.icu=off disable build of ICU backend even if ICU library existsboost.locale.iconv=off or boost.locale.iconv=on enable or disable use of iconv library. It is off by default on Windows and Solarisboost.locale.winapi=off - disable winapi backend, it is on by default on Windows and Cygwinboost.locale.std=off or boost.locale.winapi=on Disable or enable std backends. std backend is disabled by default when using Sun Studio.boost.locale.posix=on or boost.locale.posix=off Enable or disable support of POSIX backend, it is on by default on Linux and Mac OS XAlso Boost.Locale supports following options
-sICU_PATH=/path/to/location/of/icu - the location of custom ICU library-sICONV_PATH=/path/to/location/of/iconv - the location of custom 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 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 with it.
However this definitely has an effect on some features. For example, if you try to use boundary analysis or a calendar facet when the library does not support the icu backend you would get an exception.