]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | Copyright 2006-2007 John Maddock. | |
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at | |
5 | http://www.boost.org/LICENSE_1_0.txt). | |
6 | ] | |
7 | ||
8 | [section:install Building and Installing the Library] | |
9 | ||
10 | When you extract the library from its zip file, you must preserve its internal | |
11 | directory structure (for example by using the -d option when extracting). If you | |
12 | didn't do that when extracting, then you'd better stop reading this, delete the | |
13 | files you just extracted, and try again! | |
14 | ||
15 | This library should not need configuring before use; most popular compilers\/standard | |
16 | libraries\/platforms are already supported "as is". If you do experience configuration | |
17 | problems, or just want to test the configuration with your compiler, then the | |
18 | process is the same as for all of boost; see the | |
19 | [@../../../config/index.html configuration library documentation]. | |
20 | ||
21 | The library will encase all code inside namespace boost. | |
22 | ||
23 | Unlike some other template libraries, this library consists of a mixture of | |
24 | template code (in the headers) and static code and data (in cpp files). | |
25 | Consequently it is necessary to build the library's support code into a | |
26 | library or archive file before you can use it, instructions for specific | |
27 | platforms are as follows: | |
28 | ||
29 | [h4 Building with bjam] | |
30 | ||
31 | This is now the preferred method for building and installing this library, | |
32 | please refer to the | |
33 | [@../../../../more/getting_started.html getting started guide] for more information. | |
34 | ||
35 | [h4 Building With Unicode and ICU Support] | |
36 | ||
37 | Boost.Regex is now capable of performing a configuration check | |
38 | to test whether ICU is already installed in your compiler's | |
39 | search paths. When you build you should see a message like | |
40 | this: | |
41 | ||
42 | Performing configuration checks | |
43 | ||
44 | - has_icu builds : yes | |
45 | ||
46 | Which means that ICU has been found, and support for it will be enabled | |
47 | in the library build. | |
48 | ||
49 | [tip If you don't want the regex library to use ICU then build with the | |
50 | "--disable-icu" command line option.] | |
51 | ||
52 | If instead you see: | |
53 | ||
54 | Performing configuration checks | |
55 | ||
56 | - has_icu builds : no | |
57 | ||
58 | Then ICU was not found and support for it will not be compiled into the library. | |
59 | If you think that it should have been found, then you will need to take a look | |
60 | at the contents of the file ['boost-root/bin.v2/config.log] for the actual error | |
61 | messages obtained when the build carried out the configuration check. You will | |
62 | then need to fix these errors by ensuring your compiler gets invoked with the correct | |
63 | options, for example: | |
64 | ||
65 | [pre bjam include=some-include-path --toolset=toolset-name install] | |
66 | ||
67 | will add "some-include-path" to your compilers header include path, or if ICU | |
68 | has been built with non-standard names for it's binaries, then: | |
69 | ||
70 | [pre bjam -sICU_LINK="linker-options-for-icu" --toolset=toolset-name install] | |
71 | ||
72 | Will use ['"linker-options-for-icu"] when linking the library rather than the default | |
73 | ICU binary names. | |
74 | ||
75 | You might also need to use the options "cxxflags=-option" and "linkflags=-option" to set compiler and linker | |
76 | specific options. | |
77 | ||
78 | [important Configuration results are cached - if you try rebuilding with different compiler | |
79 | options then add an "-a" to the bjam command line to force all targets to be rebuilt.] | |
80 | ||
81 | If ICU is not already in your compiler's path, but instead headers, libraries and binaries | |
82 | are located at ['path-to-icu/include], ['path-to-icu/lib] and ['path-to-icu/bin] respectively | |
83 | then you need to set the environment variable `ICU_PATH` to point to the root directory of your | |
84 | ICU installation: this typically happens if you're building with MSVC. | |
85 | For example if ICU was installed to `c:\download\icu` you | |
86 | might use: | |
87 | ||
88 | [pre bjam -sICU_PATH=c:\download\icu --toolset=toolset-name install] | |
89 | ||
90 | [important ICU is a C++ library just like Boost is, as such your copy of | |
91 | ICU must have been built with the same C++ compiler (and compiler version) | |
92 | that you are using to build Boost. Boost.Regex will not work correctly unless | |
93 | you ensure that this is the case: it is up to you to ensure that the version | |
94 | of ICU you are using is binary compatible with the toolset you use to build Boost.] | |
95 | ||
96 | And finally, if you want to build/test with multiple compiler versions, all with different ICU | |
97 | builds, then the only way to achieve that currently is to modify your user-config.jam so that | |
98 | each toolset has the necessary compiler/linker options set so that ICU is found automatically | |
99 | by the configuration step (providing the ICU binaries use the standard names, all you have to | |
100 | add is the appropriate header-include and linker-search paths). | |
101 | ||
102 | [h4 Building from Source] | |
103 | ||
104 | The Regex library is "just a bunch of source files": nothing special is required to build them. | |
105 | ||
106 | You can either build the files under boost-path/libs/regex/src/*.cpp as a library, or add them | |
107 | directly to your project. This is particularly useful if you need to use specific compiler | |
108 | options not supported by the default Boost build. | |
109 | ||
110 | There are two #defines you should be aware of: | |
111 | ||
112 | * BOOST_HAS_ICU should be defined if you want ICU support compiled in. | |
113 | * BOOST_REGEX_DYN_LINK should be defined if you are building a DLL on Windows. | |
114 | ||
115 | [important The makefiles that were supplied with Boost.Regex are now deprecated and will be removed in the next release.] | |
116 | ||
117 | [endsect] | |
118 |