| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| <title>Boost.Locale: Building The library</title> |
| |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="resize.js"></script> |
| <script type="text/javascript" src="navtree.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(initResizable); |
| </script> |
| |
| |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div! --> |
| |
| |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr style="height: 56px;"> |
| |
| <td id="projectlogo"><img alt="Logo" src="boost-small.png"/></td> |
| |
| |
| <td style="padding-left: 0.5em;"> |
| <div id="projectname">Boost.Locale |
| |
| </div> |
| |
| </td> |
| |
| |
| |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <!-- Generated by Doxygen 1.7.6.1 --> |
| <div id="navrow1" class="tabs"> |
| <ul class="tablist"> |
| <li><a href="index.html"><span>Main Page</span></a></li> |
| <li><a href="modules.html"><span>Modules</span></a></li> |
| <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
| <li><a href="annotated.html"><span>Classes</span></a></li> |
| <li><a href="files.html"><span>Files</span></a></li> |
| <li><a href="examples.html"><span>Examples</span></a></li> |
| </ul> |
| </div> |
| </div> |
| <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| <div id="nav-tree"> |
| <div id="nav-tree-contents"> |
| </div> |
| </div> |
| <div id="splitbar" style="-moz-user-select:none;" |
| class="ui-resizable-handle"> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| initNavTree('building_boost_locale.html',''); |
| </script> |
| <div id="doc-content"> |
| <div class="header"> |
| <div class="headertitle"> |
| <div class="title">Building The library </div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <div class="textblock"><ul> |
| <li><a class="el" href="building_boost_locale.html#building_boost_locale_bb">Building Boost.Locale</a><ul> |
| <li><a class="el" href="building_boost_locale.html#bb_building_deps">Dependencies</a></li> |
| <li><a class="el" href="building_boost_locale.html#bb_building_proc">Building Process</a></li> |
| <li><a class="el" href="building_boost_locale.html#bb_build_opts">Build Options</a></li> |
| <li><a class="el" href="building_boost_locale.html#bb_build_test">Running Unit Tests</a></li> |
| </ul> |
| </li> |
| <li><a class="el" href="building_boost_locale.html#binary_compatibility">Binary Compatibility</a></li> |
| </ul> |
| <h2><a class="anchor" id="building_boost_locale_bb"></a> |
| Building Boost.Locale</h2> |
| <h3><a class="anchor" id="bb_building_deps"></a> |
| Dependencies</h3> |
| <ul> |
| <li>ICU library 3.6 or above is strongly recommended</li> |
| <li>If no ICU library is given, iconv support is required under POSIX platforms.</li> |
| </ul> |
| <h3><a class="anchor" id="bb_platform_opts"></a> |
| Platform Notes</h3> |
| <ul> |
| <li>If you use Boost.Locale on Windows with MinGW/GCC < 4.5 you'll be able to use static version only. Mingw/GCC prior to 4.5 have no support of dynamic runtime linking.<br/> |
| Using Boost.Locale DLL's with MinGW gcc also requires dynamic linking with the runtime libraries libstdc++ and libgcc. Some gcc builds use static linking by default so make sure you use correct link options with your compiler when you build your own programs.</li> |
| <li>The AIX's iconv misses important character sets that Boost.Locale requires, so you need to either use GNU iconv or link with ICU library.</li> |
| <li>If iconv library is not found on Darwin/Mac OS X builds make sure there is no multiple iconv installations and provide -sICONV_PATH build option to point to correct location of iconv library.</li> |
| </ul> |
| <h3><a class="anchor" id="bb_building_proc"></a> |
| Building Process</h3> |
| <p>Now all you need to do is invoke bjam command:</p> |
| <div class="fragment"><pre class="fragment"> |
| ./bjam --with-locale stage |
| </pre></div><p>Or on Windows </p> |
| <div class="fragment"><pre class="fragment"> |
| .\bjam --with-locale stage |
| </pre></div><p>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 <code>-sICU_PATH</code> option</p> |
| <p>For example:</p> |
| <ul> |
| <li>If your icu build is placed at <code>/opt/icu46</code> such that the files are placed like<br/> |
| <code>/opt/icu46/include/unicode/uversion</code>.h<br/> |
| <code>/opt/icu46/include/unicode/calendar</code>.h<br/> |
| <code></code>... <br/> |
| <code>/opt/icu46/lib/libicudata</code>.so <br/> |
| <code>/opt/icu46/lib/libicui18n</code>.so <br/> |
| <code></code>... <br/> |
| then you need to provide an option <code>-sICU_PATH=/opt/icu46</code> <div class="fragment"><pre class="fragment"> |
| ./bjam --with-locale -sICU_PATH=/opt/icu46 stage |
| </pre></div></li> |
| <li>If your icu build is placed at <code>c:\icu46</code> such that the files are placed like <br/> |
| <code>c:\icu46\include\unicode\uversion.h</code> <br/> |
| <code>c:\icu46\include\unicode\calendar.h</code> <br/> |
| <code>...</code> <br/> |
| <code>c:\icu46\bin\icudt.dll</code> <br/> |
| <code>c:\icu46\bin\icuin.dll</code> <br/> |
| <code>...</code> <br/> |
| <code>c:\icu46\lib\icudt.lib</code> <br/> |
| <code>c:\icu46\lib\icuin.lib</code> <br/> |
| <code>...</code> <br/> |
| then you need to provide an option <code>-sICU_PATH=c:\icu46</code> <div class="fragment"><pre class="fragment"> |
| .\bjam --with-locale -sICU_PATH=c:\icu46 stage |
| </pre></div></li> |
| </ul> |
| <dl class="note"><dt><b>Note:</b></dt><dd>Don't forget to put both debug and release versions of ICU libraries in this path when using Microsoft Visual Studio so Boost.Build will link correctly debug and release versions of boost_locale library.</dd></dl> |
| <h2><a class="anchor" id="bb_build_opts"></a> |
| Build Options</h2> |
| <p>Boost.Locale supports following options with values <code>off</code> or <code>on</code> </p> |
| <ul> |
| <li><code>boost.locale.icu=off</code> disable build of ICU backend even if ICU library exists</li> |
| <li><code>boost.locale.iconv=off</code> or <code>boost.locale.iconv=on</code> enable or disable use of iconv library. It is off by default on Windows and Solaris</li> |
| <li><code>boost.locale.winapi=off</code> - disable winapi backend, it is on by default on Windows and Cygwin</li> |
| <li><code>boost.locale.std=off</code> or <code>boost.locale.winapi=on</code> Disable or enable std backends. <code>std</code> backend is disabled by default when using Sun Studio.</li> |
| <li><code>boost.locale.posix=on</code> or <code>boost.locale.posix=off</code> Enable or disable support of POSIX backend, it is on by default on Linux and Mac OS X</li> |
| </ul> |
| <p>Also Boost.Locale supports following options</p> |
| <ul> |
| <li><code>-sICU_PATH=/path/to/location/of/icu</code> - the location of custom ICU library</li> |
| <li><code>-sICONV_PATH=/path/to/location/of/iconv</code> - the location of custom iconv library</li> |
| </ul> |
| <p>For example:</p> |
| <ul> |
| <li>Build the library on Windows with ICU backend only: <div class="fragment"><pre class="fragment"> |
| .\bjam boost.locale.winapi=off boost.locale.std=off -sICU_PATH=c:\icu46 --with-locale stage |
| </pre></div></li> |
| <li>Build the library on Linux with std backend only <div class="fragment"><pre class="fragment"> |
| .\bjam boost.locale.posix=off boost.locale.icu=off --with-locale stage |
| </pre></div></li> |
| </ul> |
| <h2><a class="anchor" id="bb_build_test"></a> |
| Running Unit Tests</h2> |
| <p>You can run unit tests by invoking <code>bjam</code> with <code>libs/locale/test</code> project parameter </p> |
| <div class="fragment"><pre class="fragment"> |
| ./bjam libs/locale/test |
| </pre></div><h2><a class="anchor" id="binary_compatibility"></a> |
| Binary Compatibility</h2> |
| <p>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 <code>std</code>, <code>posix</code> or <code>winapi</code> backends would still be binary-compatible with it.</p> |
| <p>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. </p> |
| </div></div><!-- contents --> |
| </div> |
| <div id="nav-path" class="navpath"> |
| <ul> |
| <li class="navelem"><a class="el" href="index.html">Boost.Locale</a> </li> |
| |
| <li class="footer"> |
| © Copyright 2009-2012 Artyom Beilis, Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License</a>, Version 1.0. |
| </li> |
| </ul> |
| </div> |
| |
| |
| </body> |
| </html> |