locale/doc/html/building_boost_locale.html
2015-10-18 17:31:48 +03:00

162 lines
8.7 KiB
HTML

<!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"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Boost.Locale: Building The library</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<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>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related&#160;Pages</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><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){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>
<h1><a class="anchor" id="building_boost_locale_bb"></a>
Building Boost.Locale</h1>
<h2><a class="anchor" id="bb_building_deps"></a>
Dependencies</h2>
<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>
<h2><a class="anchor" id="bb_platform_opts"></a>
Platform Notes</h2>
<ul>
<li>If you use Boost.Locale on Windows with MinGW/GCC &lt; 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>
<h2><a class="anchor" id="bb_building_proc"></a>
Building Process</h2>
<p>Now all you need to do is invoke bjam command:</p>
<pre class="fragment">./bjam --with-locale stage
</pre><p>Or on Windows </p>
<pre class="fragment">.\bjam --with-locale stage
</pre><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> <pre class="fragment"> ./bjam --with-locale -sICU_PATH=/opt/icu46 stage</pre></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> <pre class="fragment"> .\bjam --with-locale -sICU_PATH=c:\icu46 stage</pre></li>
</ul>
<dl class="section note"><dt>Note</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>
<h1><a class="anchor" id="bb_build_opts"></a>
Build Options</h1>
<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: <pre class="fragment"> .\bjam boost.locale.winapi=off boost.locale.std=off -sICU_PATH=c:\icu46 --with-locale stage</pre></li>
<li>Build the library on Linux with std backend only <pre class="fragment"> .\bjam boost.locale.posix=off boost.locale.icu=off --with-locale stage</pre></li>
</ul>
<h1><a class="anchor" id="bb_build_test"></a>
Running Unit Tests</h1>
<p>You can run unit tests by invoking <code>bjam</code> with <code>libs/locale/test</code> project parameter </p>
<pre class="fragment">./bjam libs/locale/test
</pre><h1><a class="anchor" id="binary_compatibility"></a>
Binary Compatibility</h1>
<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><!-- doc-content -->
<li class="footer">
&copy; 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>