Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / locale / doc / html / building_boost_locale.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <title>Boost.Locale: Building The library</title>
7
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <link href="doxygen.css" rel="stylesheet" type="text/css" />
10 <link href="navtree.css" rel="stylesheet" type="text/css"/>
11 <script type="text/javascript" src="jquery.js"></script>
12 <script type="text/javascript" src="resize.js"></script>
13 <script type="text/javascript" src="navtree.js"></script>
14 <script type="text/javascript">
15   $(document).ready(initResizable);
16 </script>
17
18
19 </head>
20 <body>
21 <div id="top"><!-- do not remove this div! -->
22
23
24 <div id="titlearea">
25 <table cellspacing="0" cellpadding="0">
26  <tbody>
27  <tr style="height: 56px;">
28   
29   <td id="projectlogo"><img alt="Logo" src="boost-small.png"/></td>
30   
31   
32   <td style="padding-left: 0.5em;">
33    <div id="projectname">Boost.Locale
34    
35    </div>
36    
37   </td>
38   
39   
40   
41  </tr>
42  </tbody>
43 </table>
44 </div>
45
46 <!-- Generated by Doxygen 1.7.6.1 -->
47   <div id="navrow1" class="tabs">
48     <ul class="tablist">
49       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
50       <li><a href="modules.html"><span>Modules</span></a></li>
51       <li><a href="namespaces.html"><span>Namespaces</span></a></li>
52       <li><a href="annotated.html"><span>Classes</span></a></li>
53       <li><a href="files.html"><span>Files</span></a></li>
54       <li><a href="examples.html"><span>Examples</span></a></li>
55     </ul>
56   </div>
57 </div>
58 <div id="side-nav" class="ui-resizable side-nav-resizable">
59   <div id="nav-tree">
60     <div id="nav-tree-contents">
61     </div>
62   </div>
63   <div id="splitbar" style="-moz-user-select:none;" 
64        class="ui-resizable-handle">
65   </div>
66 </div>
67 <script type="text/javascript">
68   initNavTree('building_boost_locale.html','');
69 </script>
70 <div id="doc-content">
71 <div class="header">
72   <div class="headertitle">
73 <div class="title">Building The library </div>  </div>
74 </div><!--header-->
75 <div class="contents">
76 <div class="textblock"><ul>
77 <li><a class="el" href="building_boost_locale.html#building_boost_locale_bb">Building Boost.Locale</a><ul>
78 <li><a class="el" href="building_boost_locale.html#bb_building_deps">Dependencies</a></li>
79 <li><a class="el" href="building_boost_locale.html#bb_building_proc">Building Process</a></li>
80 <li><a class="el" href="building_boost_locale.html#bb_build_opts">Build Options</a></li>
81 <li><a class="el" href="building_boost_locale.html#bb_build_test">Running Unit Tests</a></li>
82 </ul>
83 </li>
84 <li><a class="el" href="building_boost_locale.html#binary_compatibility">Binary Compatibility</a></li>
85 </ul>
86 <h2><a class="anchor" id="building_boost_locale_bb"></a>
87 Building Boost.Locale</h2>
88 <h3><a class="anchor" id="bb_building_deps"></a>
89 Dependencies</h3>
90 <ul>
91 <li>ICU library 3.6 or above is strongly recommended</li>
92 <li>If no ICU library is given, iconv support is required under POSIX platforms.</li>
93 </ul>
94 <h3><a class="anchor" id="bb_platform_opts"></a>
95 Platform Notes</h3>
96 <ul>
97 <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/>
98  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>
99 <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>
100 <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>
101 </ul>
102 <h3><a class="anchor" id="bb_building_proc"></a>
103 Building Process</h3>
104 <p>Now all you need to do is invoke bjam command:</p>
105 <div class="fragment"><pre class="fragment">
106 ./bjam --with-locale stage
107 </pre></div><p>Or on Windows </p>
108 <div class="fragment"><pre class="fragment">
109 .\bjam --with-locale stage
110 </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>
111 <p>For example:</p>
112 <ul>
113 <li>If your icu build is placed at <code>/opt/icu46</code> such that the files are placed like<br/>
114  <code>/opt/icu46/include/unicode/uversion</code>.h<br/>
115  <code>/opt/icu46/include/unicode/calendar</code>.h<br/>
116  <code></code>... <br/>
117  <code>/opt/icu46/lib/libicudata</code>.so <br/>
118  <code>/opt/icu46/lib/libicui18n</code>.so <br/>
119  <code></code>... <br/>
120  then you need to provide an option <code>-sICU_PATH=/opt/icu46</code> <div class="fragment"><pre class="fragment">
121     ./bjam --with-locale -sICU_PATH=/opt/icu46  stage
122     </pre></div></li>
123 <li>If your icu build is placed at <code>c:\icu46</code> such that the files are placed like <br/>
124  <code>c:\icu46\include\unicode\uversion.h</code> <br/>
125  <code>c:\icu46\include\unicode\calendar.h</code> <br/>
126  <code>...</code> <br/>
127  <code>c:\icu46\bin\icudt.dll</code> <br/>
128  <code>c:\icu46\bin\icuin.dll</code> <br/>
129  <code>...</code> <br/>
130  <code>c:\icu46\lib\icudt.lib</code> <br/>
131  <code>c:\icu46\lib\icuin.lib</code> <br/>
132  <code>...</code> <br/>
133  then you need to provide an option <code>-sICU_PATH=c:\icu46</code> <div class="fragment"><pre class="fragment">
134     .\bjam --with-locale -sICU_PATH=c:\icu46  stage
135     </pre></div></li>
136 </ul>
137 <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>
138 <h2><a class="anchor" id="bb_build_opts"></a>
139 Build Options</h2>
140 <p>Boost.Locale supports following options with values <code>off</code> or <code>on</code> </p>
141 <ul>
142 <li><code>boost.locale.icu=off</code> disable build of ICU backend even if ICU library exists</li>
143 <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>
144 <li><code>boost.locale.winapi=off</code> - disable winapi backend, it is on by default on Windows and Cygwin</li>
145 <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>
146 <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>
147 </ul>
148 <p>Also Boost.Locale supports following options</p>
149 <ul>
150 <li><code>-sICU_PATH=/path/to/location/of/icu</code> - the location of custom ICU library</li>
151 <li><code>-sICONV_PATH=/path/to/location/of/iconv</code> - the location of custom iconv library</li>
152 </ul>
153 <p>For example:</p>
154 <ul>
155 <li>Build the library on Windows with ICU backend only: <div class="fragment"><pre class="fragment">
156     .\bjam boost.locale.winapi=off boost.locale.std=off -sICU_PATH=c:\icu46 --with-locale stage
157     </pre></div></li>
158 <li>Build the library on Linux with std backend only <div class="fragment"><pre class="fragment">
159     .\bjam boost.locale.posix=off boost.locale.icu=off --with-locale stage
160     </pre></div></li>
161 </ul>
162 <h2><a class="anchor" id="bb_build_test"></a>
163 Running Unit Tests</h2>
164 <p>You can run unit tests by invoking <code>bjam</code> with <code>libs/locale/test</code> project parameter </p>
165 <div class="fragment"><pre class="fragment">
166 ./bjam libs/locale/test
167 </pre></div><h2><a class="anchor" id="binary_compatibility"></a>
168 Binary Compatibility</h2>
169 <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>
170 <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>
171 </div></div><!-- contents -->
172 </div>
173   <div id="nav-path" class="navpath">
174     <ul>
175       <li class="navelem"><a class="el" href="index.html">Boost.Locale</a>      </li>
176
177     <li class="footer">
178 &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.
179     </li>
180    </ul>
181  </div>
182
183
184 </body>
185 </html>