install.qbk 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. [section:install Building and Installing the Library]
  8. When you extract the library from its zip file, you must preserve its internal
  9. directory structure (for example by using the -d option when extracting). If you
  10. didn't do that when extracting, then you'd better stop reading this, delete the
  11. files you just extracted, and try again!
  12. This library should not need configuring before use; most popular compilers\/standard
  13. libraries\/platforms are already supported "as is". If you do experience configuration
  14. problems, or just want to test the configuration with your compiler, then the
  15. process is the same as for all of boost; see the
  16. [@../../../config/index.html configuration library documentation].
  17. The library will encase all code inside namespace boost.
  18. Unlike some other template libraries, this library consists of a mixture of
  19. template code (in the headers) and static code and data (in cpp files).
  20. Consequently it is necessary to build the library's support code into a
  21. library or archive file before you can use it, instructions for specific
  22. platforms are as follows:
  23. [h4 Building with bjam]
  24. This is now the preferred method for building and installing this library,
  25. please refer to the
  26. [@../../../../more/getting_started.html getting started guide] for more information.
  27. [h4 Building With Unicode and ICU Support]
  28. Boost.Regex is now capable of performing a configuration check
  29. to test whether ICU is already installed in your compiler's
  30. search paths. When you build you should see a message like
  31. this:
  32. Performing configuration checks
  33. - has_icu builds : yes
  34. Which means that ICU has been found, and support for it will be enabled
  35. in the library build.
  36. [tip If you don't want the regex library to use ICU then build with the
  37. "--disable-icu" command line option.]
  38. If instead you see:
  39. Performing configuration checks
  40. - has_icu builds : no
  41. Then ICU was not found and support for it will not be compiled into the library.
  42. If you think that it should have been found, then you will need to take a look
  43. at the contents of the file ['boost-root/bin.v2/config.log] for the actual error
  44. messages obtained when the build carried out the configuration check. You will
  45. then need to fix these errors by ensuring your compiler gets invoked with the correct
  46. options. The main options that you're likely to pass to `b2` are:
  47. [table
  48. [[Option][Description]]
  49. [[include=/some/path][Adds "/some/path" to the list of paths seached for include files, normally equivalent to `-I/some/path` on most compilers.]]
  50. [[library-path=/some/path][Adds "/some/path" to the list of paths searched for external libraries, set this to the location of the ICU binaries if they're in a non-standard location.]]
  51. [[-sICU_ICUUC_NAME=NAME][If `libicuuc` has a non-standard name then this sets the name of the library linked against, defaults to either `icuuc`, `icuucd`, `sicuuc` or `sicuucd` depending on build options.]]
  52. [[-sICU_ICUDT_NAME=NAME][If `libicudata` has a non-standard name then this sets the name of the library linked against, defaults to either `icudt`, `icudata`, `sicudt` or `sicudata` depending on build options and platform.]]
  53. [[-sICU_ICUIN_NAME=NAME][If `libicui18n` has a non-standatd name then this sets the name of the library linked against, defaults to either `icui18n`, `icuin`, `icuind`, sicuin` or `sicuins` depending on build options and platform.]]
  54. [[cxxstd=XX][Sets the C++ standard supported: XX should be either 03, 11, 14, 17 or 2a.]]
  55. [[cxxflags="FLAGS"][Passes "FLAGS" directly to the compiler, an option of last resort!]]
  56. [[linflags="FLAGS"][Passes "FLAGS" directly to the compiler on the link step, an option of last resort!]]
  57. ]
  58. [important Configuration results are cached - if you try rebuilding with different compiler
  59. options then add an "-a" to the bjam command line to force all targets to be rebuilt.]
  60. [important ICU is a C++ library just like Boost is, as such your copy of
  61. ICU must have been built with the same C++ compiler (and compiler version)
  62. that you are using to build Boost. Boost.Regex will not work correctly unless
  63. you ensure that this is the case: it is up to you to ensure that the version
  64. of ICU you are using is binary compatible with the toolset you use to build Boost.]
  65. And finally, if you want to build/test with multiple compiler versions, all with different ICU
  66. builds, then the only way to achieve that currently is to modify your user-config.jam so that
  67. each toolset has the necessary compiler/linker options set so that ICU is found automatically
  68. by the configuration step (providing the ICU binaries use the standard names, all you have to
  69. add is the appropriate header-include and linker-search paths).
  70. [h4 Building from Source]
  71. The Regex library is "just a bunch of source files": nothing special is required to build them.
  72. You can either build the files under boost-path/libs/regex/src/*.cpp as a library, or add them
  73. directly to your project. This is particularly useful if you need to use specific compiler
  74. options not supported by the default Boost build.
  75. There are two #defines you should be aware of:
  76. * BOOST_HAS_ICU should be defined if you want ICU support compiled in.
  77. * BOOST_REGEX_DYN_LINK should be defined if you are building a DLL on Windows.
  78. [endsect]