building_boost_locale.txt 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 filetype=cpp.doxygen
  2. //
  3. // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. /*!
  10. \page building_boost_locale Building The library
  11. - \ref building_boost_locale_bb
  12. - \ref bb_building_deps
  13. - \ref bb_building_proc
  14. - \ref bb_build_opts
  15. - \ref bb_build_test
  16. - \ref binary_compatibility
  17. \section building_boost_locale_bb Building Boost.Locale
  18. \subsection bb_building_deps Dependencies
  19. - ICU library 3.6 or above is strongly recommended
  20. - If no ICU library is given, iconv support is required under POSIX platforms.
  21. \subsection bb_platform_opts Platform Notes
  22. - If you use Boost.Locale on Windows with MinGW/GCC < 4.5 you'll be
  23. able to use static version only. Mingw/GCC prior to 4.5 have no
  24. support of dynamic runtime linking.\n
  25. Using Boost.Locale DLL's with MinGW gcc also requires dynamic linking
  26. with the runtime libraries libstdc++ and libgcc. Some gcc builds use
  27. static linking by default so make sure you use correct link options
  28. with your compiler when you build your own programs.
  29. - The AIX's iconv misses important character sets that Boost.Locale requires,
  30. so you need to either use GNU iconv or link with ICU library.
  31. - If iconv library is not found on Darwin/Mac OS X builds make sure there
  32. is no multiple iconv installations and provide -sICONV_PATH build option
  33. to point to correct location of iconv library.
  34. \subsection bb_building_proc Building Process
  35. Now all you need to do is invoke bjam command:
  36. \verbatim
  37. ./bjam --with-locale stage
  38. \endverbatim
  39. Or on Windows
  40. \verbatim
  41. .\bjam --with-locale stage
  42. \endverbatim
  43. If you are using custom ICU build or you are using Microsoft Windows
  44. you need to provide a path to location of ICU library using \c -sICU_PATH option
  45. For example:
  46. - If your icu build is placed at \c /opt/icu46 such that the files are placed like\n
  47. \c /opt/icu46/include/unicode/uversion.h\n
  48. \c /opt/icu46/include/unicode/calendar.h\n
  49. \c ... \n
  50. \c /opt/icu46/lib/libicudata.so \n
  51. \c /opt/icu46/lib/libicui18n.so \n
  52. \c ... \n
  53. then you need to provide an option \c -sICU_PATH=/opt/icu46
  54. \verbatim
  55. ./bjam --with-locale -sICU_PATH=/opt/icu46 stage
  56. \endverbatim
  57. - If your icu build is placed at <tt>c:\\icu46</tt> such that the files are placed like \n
  58. <tt>c:\\icu46\\include\\unicode\\uversion.h</tt> \n
  59. <tt>c:\\icu46\\include\\unicode\\calendar.h</tt> \n
  60. <tt>...</tt> \n
  61. <tt>c:\\icu46\\bin\\icudt.dll</tt> \n
  62. <tt>c:\\icu46\\bin\\icuin.dll</tt> \n
  63. <tt>...</tt> \n
  64. <tt>c:\\icu46\\lib\\icudt.lib</tt> \n
  65. <tt>c:\\icu46\\lib\\icuin.lib</tt> \n
  66. <tt>...</tt> \n
  67. then you need to provide an option \c -sICU_PATH=c:\\icu46
  68. \verbatim
  69. .\bjam --with-locale -sICU_PATH=c:\icu46 stage
  70. \endverbatim
  71. \note Don't forget to put both debug and release versions of ICU libraries in this path
  72. when using Microsoft Visual Studio so Boost.Build will link correctly debug and release
  73. versions of boost_locale library.
  74. \section bb_build_opts Build Options
  75. Boost.Locale supports following options with values \c off or \c on
  76. - \c boost.locale.icu=off disable build of ICU backend even if ICU library exists
  77. - \c boost.locale.iconv=off or \c boost.locale.iconv=on enable or disable use of iconv
  78. library. It is off by default on Windows and Solaris
  79. - \c boost.locale.winapi=off - disable winapi backend, it is on by default on Windows and Cygwin
  80. - \c boost.locale.std=off or \c boost.locale.winapi=on Disable or enable std backends. \c std backend
  81. is disabled by default when using Sun Studio.
  82. - \c boost.locale.posix=on or \c boost.locale.posix=off Enable or disable support of POSIX backend,
  83. it is on by default on Linux and Mac OS X
  84. Also Boost.Locale supports following options
  85. - \c -sICU_PATH=/path/to/location/of/icu - the location of custom ICU library
  86. - \c -sICONV_PATH=/path/to/location/of/iconv - the location of custom iconv library
  87. For example:
  88. - Build the library on Windows with ICU backend only:
  89. \verbatim
  90. .\bjam boost.locale.winapi=off boost.locale.std=off -sICU_PATH=c:\icu46 --with-locale stage
  91. \endverbatim
  92. - Build the library on Linux with std backend only
  93. \verbatim
  94. .\bjam boost.locale.posix=off boost.locale.icu=off --with-locale stage
  95. \endverbatim
  96. \section bb_build_test Running Unit Tests
  97. You can run unit tests by invoking \c bjam with \c libs/locale/test project parameter
  98. \verbatim
  99. ./bjam libs/locale/test
  100. \endverbatim
  101. \section binary_compatibility Binary Compatibility
  102. Boost.Locale is built with binary compatibility in mind. Switching localization back ends on or off,
  103. or using iconv or not, does not affect binary compatibility. So if a dynamic library was built
  104. with all possible backends, other dynamic libraries compiled with, for example, only the \c std, \c posix
  105. or \c winapi backends would still be binary-compatible with it.
  106. However this definitely has an effect on some features. For example, if you
  107. try to use boundary analysis or a calendar facet when the library does not support the icu backend
  108. you would get an exception.
  109. */