Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / regex / doc / html / boost_regex / install.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Building and Installing the Library</title>
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../index.html" title="Boost.Regex 5.1.4">
8 <link rel="up" href="../index.html" title="Boost.Regex 5.1.4">
9 <link rel="prev" href="configuration/tuning.html" title="Algorithm Tuning">
10 <link rel="next" href="intro.html" title="Introduction and Overview">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="configuration/tuning.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="intro.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="boost_regex.install"></a><a class="link" href="install.html" title="Building and Installing the Library">Building and Installing the Library</a>
28 </h2></div></div></div>
29 <p>
30       When you extract the library from its zip file, you must preserve its internal
31       directory structure (for example by using the -d option when extracting). If
32       you didn't do that when extracting, then you'd better stop reading this, delete
33       the files you just extracted, and try again!
34     </p>
35 <p>
36       This library should not need configuring before use; most popular compilers/standard
37       libraries/platforms are already supported "as is". If you do experience
38       configuration problems, or just want to test the configuration with your compiler,
39       then the process is the same as for all of boost; see the <a href="../../../../config/index.html" target="_top">configuration
40       library documentation</a>.
41     </p>
42 <p>
43       The library will encase all code inside namespace boost.
44     </p>
45 <p>
46       Unlike some other template libraries, this library consists of a mixture of
47       template code (in the headers) and static code and data (in cpp files). Consequently
48       it is necessary to build the library's support code into a library or archive
49       file before you can use it, instructions for specific platforms are as follows:
50     </p>
51 <h5>
52 <a name="boost_regex.install.h0"></a>
53       <span class="phrase"><a name="boost_regex.install.building_with_bjam"></a></span><a class="link" href="install.html#boost_regex.install.building_with_bjam">Building
54       with bjam</a>
55     </h5>
56 <p>
57       This is now the preferred method for building and installing this library,
58       please refer to the <a href="../../../../../more/getting_started.html" target="_top">getting
59       started guide</a> for more information.
60     </p>
61 <h5>
62 <a name="boost_regex.install.h1"></a>
63       <span class="phrase"><a name="boost_regex.install.building_with_unicode_and_icu_su"></a></span><a class="link" href="install.html#boost_regex.install.building_with_unicode_and_icu_su">Building
64       With Unicode and ICU Support</a>
65     </h5>
66 <p>
67       Boost.Regex is now capable of performing a configuration check to test whether
68       ICU is already installed in your compiler's search paths. When you build you
69       should see a message like this:
70     </p>
71 <pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span>
72
73     <span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span>           <span class="special">:</span> <span class="identifier">yes</span>
74 </pre>
75 <p>
76       Which means that ICU has been found, and support for it will be enabled in
77       the library build.
78     </p>
79 <div class="tip"><table border="0" summary="Tip">
80 <tr>
81 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td>
82 <th align="left">Tip</th>
83 </tr>
84 <tr><td align="left" valign="top"><p>
85         If you don't want the regex library to use ICU then build with the "--disable-icu"
86         command line option.
87       </p></td></tr>
88 </table></div>
89 <p>
90       If instead you see:
91     </p>
92 <pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span>
93
94     <span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span>           <span class="special">:</span> <span class="identifier">no</span>
95 </pre>
96 <p>
97       Then ICU was not found and support for it will not be compiled into the library.
98       If you think that it should have been found, then you will need to take a look
99       at the contents of the file <span class="emphasis"><em>boost-root/bin.v2/config.log</em></span>
100       for the actual error messages obtained when the build carried out the configuration
101       check. You will then need to fix these errors by ensuring your compiler gets
102       invoked with the correct options. The main options that you're likely to pass
103       to <code class="computeroutput"><span class="identifier">b2</span></code> are:
104     </p>
105 <div class="informaltable"><table class="table">
106 <colgroup>
107 <col>
108 <col>
109 </colgroup>
110 <thead><tr>
111 <th>
112               <p>
113                 Option
114               </p>
115             </th>
116 <th>
117               <p>
118                 Description
119               </p>
120             </th>
121 </tr></thead>
122 <tbody>
123 <tr>
124 <td>
125               <p>
126                 include=/some/path
127               </p>
128             </td>
129 <td>
130               <p>
131                 Adds "/some/path" to the list of paths seached for include
132                 files, normally equivalent to <code class="computeroutput"><span class="special">-</span><span class="identifier">I</span><span class="special">/</span><span class="identifier">some</span><span class="special">/</span><span class="identifier">path</span></code> on most compilers.
133               </p>
134             </td>
135 </tr>
136 <tr>
137 <td>
138               <p>
139                 library-path=/some/path
140               </p>
141             </td>
142 <td>
143               <p>
144                 Adds "/some/path" to the list of paths searched for external
145                 libraries, set this to the location of the ICU binaries if they're
146                 in a non-standard location.
147               </p>
148             </td>
149 </tr>
150 <tr>
151 <td>
152               <p>
153                 -sICU_ICUUC_NAME=NAME
154               </p>
155             </td>
156 <td>
157               <p>
158                 If <code class="computeroutput"><span class="identifier">libicuuc</span></code> has a
159                 non-standard name then this sets the name of the library linked against,
160                 defaults to either <code class="computeroutput"><span class="identifier">icuuc</span></code>,
161                 <code class="computeroutput"><span class="identifier">icuucd</span></code>, <code class="computeroutput"><span class="identifier">sicuuc</span></code> or <code class="computeroutput"><span class="identifier">sicuucd</span></code>
162                 depending on build options.
163               </p>
164             </td>
165 </tr>
166 <tr>
167 <td>
168               <p>
169                 -sICU_ICUDT_NAME=NAME
170               </p>
171             </td>
172 <td>
173               <p>
174                 If <code class="computeroutput"><span class="identifier">libicudata</span></code> has
175                 a non-standard name then this sets the name of the library linked
176                 against, defaults to either <code class="computeroutput"><span class="identifier">icudt</span></code>,
177                 <code class="computeroutput"><span class="identifier">icudata</span></code>, <code class="computeroutput"><span class="identifier">sicudt</span></code> or <code class="computeroutput"><span class="identifier">sicudata</span></code>
178                 depending on build options and platform.
179               </p>
180             </td>
181 </tr>
182 <tr>
183 <td>
184               <p>
185                 -sICU_ICUIN_NAME=NAME
186               </p>
187             </td>
188 <td>
189               <p>
190                 If <code class="computeroutput"><span class="identifier">libicui18n</span></code> has
191                 a non-standatd name then this sets the name of the library linked
192                 against, defaults to either <code class="computeroutput"><span class="identifier">icui18n</span></code>,
193                 <code class="computeroutput"><span class="identifier">icuin</span></code>, <code class="computeroutput"><span class="identifier">icuind</span></code>, sicuin<code class="computeroutput"> <span class="keyword">or</span>
194                 </code>sicuins` depending on build options and platform.
195               </p>
196             </td>
197 </tr>
198 <tr>
199 <td>
200               <p>
201                 cxxstd=XX
202               </p>
203             </td>
204 <td>
205               <p>
206                 Sets the C++ standard supported: XX should be either 03, 11, 14,
207                 17 or 2a.
208               </p>
209             </td>
210 </tr>
211 <tr>
212 <td>
213               <p>
214                 cxxflags="FLAGS"
215               </p>
216             </td>
217 <td>
218               <p>
219                 Passes "FLAGS" directly to the compiler, an option of last
220                 resort!
221               </p>
222             </td>
223 </tr>
224 <tr>
225 <td>
226               <p>
227                 linflags="FLAGS"
228               </p>
229             </td>
230 <td>
231               <p>
232                 Passes "FLAGS" directly to the compiler on the link step,
233                 an option of last resort!
234               </p>
235             </td>
236 </tr>
237 </tbody>
238 </table></div>
239 <div class="important"><table border="0" summary="Important">
240 <tr>
241 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
242 <th align="left">Important</th>
243 </tr>
244 <tr><td align="left" valign="top"><p>
245         Configuration results are cached - if you try rebuilding with different compiler
246         options then add an "-a" to the bjam command line to force all
247         targets to be rebuilt.
248       </p></td></tr>
249 </table></div>
250 <div class="important"><table border="0" summary="Important">
251 <tr>
252 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
253 <th align="left">Important</th>
254 </tr>
255 <tr><td align="left" valign="top"><p>
256         ICU is a C++ library just like Boost is, as such your copy of ICU must have
257         been built with the same C++ compiler (and compiler version) that you are
258         using to build Boost. Boost.Regex will not work correctly unless you ensure
259         that this is the case: it is up to you to ensure that the version of ICU
260         you are using is binary compatible with the toolset you use to build Boost.
261       </p></td></tr>
262 </table></div>
263 <p>
264       And finally, if you want to build/test with multiple compiler versions, all
265       with different ICU builds, then the only way to achieve that currently is to
266       modify your user-config.jam so that each toolset has the necessary compiler/linker
267       options set so that ICU is found automatically by the configuration step (providing
268       the ICU binaries use the standard names, all you have to add is the appropriate
269       header-include and linker-search paths).
270     </p>
271 <h5>
272 <a name="boost_regex.install.h2"></a>
273       <span class="phrase"><a name="boost_regex.install.building_from_source"></a></span><a class="link" href="install.html#boost_regex.install.building_from_source">Building
274       from Source</a>
275     </h5>
276 <p>
277       The Regex library is "just a bunch of source files": nothing special
278       is required to build them.
279     </p>
280 <p>
281       You can either build the files under boost-path/libs/regex/src/*.cpp as a library,
282       or add them directly to your project. This is particularly useful if you need
283       to use specific compiler options not supported by the default Boost build.
284     </p>
285 <p>
286       There are two #defines you should be aware of:
287     </p>
288 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
289 <li class="listitem">
290           BOOST_HAS_ICU should be defined if you want ICU support compiled in.
291         </li>
292 <li class="listitem">
293           BOOST_REGEX_DYN_LINK should be defined if you are building a DLL on Windows.
294         </li>
295 </ul></div>
296 </div>
297 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
298 <td align="left"></td>
299 <td align="right"><div class="copyright-footer">Copyright &#169; 1998-2013 John Maddock<p>
300         Distributed under the Boost Software License, Version 1.0. (See accompanying
301         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
302       </p>
303 </div></td>
304 </tr></table>
305 <hr>
306 <div class="spirit-nav">
307 <a accesskey="p" href="configuration/tuning.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="intro.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
308 </div>
309 </body>
310 </html>