1# copyright John Maddock 2003
2# Distributed under the Boost Software License, Version 1.0.
3# (See accompanying file LICENSE_1_0.txt or copy at
4# http://www.boost.org/LICENSE_1_0.txt.
5
6import modules ;
7import testing ;
8import errors ;
9
10project : requirements
11   # default to all warnings on:
12   <warnings>all
13   ;
14
15local disable-icu = [ MATCH (--disable-icu) : [ modules.peek : ARGV ] ] ;
16
17rule path_options ( properties * )
18{
19    local result ;
20    if <address-model>64 in $(properties) && <toolset>msvc in $(properties)
21    {
22    	result = <search>$(ICU_PATH)/bin64 <search>$(ICU_PATH)/lib64 ;
23    }
24    else
25    {
26    	result = <search>$(ICU_PATH)/bin <search>$(ICU_PATH)/lib ;
27    }
28    return $(result) ;
29}
30
31#
32# ICU configuration:
33#
34if ! $(disable-icu)
35{
36   if [ modules.peek : ICU_LINK ]
37   {
38       errors.user-error : "The ICU_LINK option is no longer supported by the Boost.Regex build - please refer to the documentation for equivalent options" ;
39   }
40
41   if [ modules.peek : ICU_PATH ]
42   {
43       ICU_PATH =  [ modules.peek : ICU_PATH ] ;
44   }
45   if [ modules.peek : ICU_ICUUC_NAME ]
46   {
47       ICU_ICUUC_NAME =  [ modules.peek : ICU_ICUUC_NAME ] ;
48   }
49   if [ modules.peek : ICU_ICUDT_NAME ]
50   {
51       ICU_ICUDT_NAME =  [ modules.peek : ICU_ICUDT_NAME ] ;
52   }
53   if [ modules.peek : ICU_ICUIN_NAME ]
54   {
55       ICU_ICUIN_NAME =  [ modules.peek : ICU_ICUIN_NAME ] ;
56   }
57
58   if $(ICU_ICUUC_NAME)
59   {
60      lib icuuc : : <name>$(ICU_ICUUC_NAME) ;
61   }
62   else
63   {
64      lib icuuc : :                                                               <runtime-link>shared <conditional>@path_options ;
65      lib icuuc : : <toolset>msvc                     <variant>debug <name>icuucd <runtime-link>shared <conditional>@path_options ;
66      lib icuuc : : <toolset>intel <target-os>windows <variant>debug <name>icuucd <runtime-link>shared <conditional>@path_options ;
67      lib icuuc : :                                                  <name>sicuuc <runtime-link>static <conditional>@path_options ;
68      lib icuuc : : <toolset>msvc                     <variant>debug <name>sicuucd <runtime-link>static <conditional>@path_options ;
69      lib icuuc : : <toolset>intel <target-os>windows <variant>debug <name>sicuucd <runtime-link>static <conditional>@path_options ;
70      lib icuuc : : <name>this_is_an_invalid_library_name ;
71   }
72   if $(ICU_ICUDT_NAME)
73   {
74      lib icudt : : <name>$(ICU_ICUDT_NAME) ;
75   }
76   else
77   {
78      lib icudt : : <name>icudata                                   <runtime-link>shared <conditional>@path_options ;
79      lib icudt : : <name>icudt   <toolset>msvc                     <runtime-link>shared <conditional>@path_options ;
80      lib icudt : : <name>icudt   <toolset>intel <target-os>windows <runtime-link>shared <conditional>@path_options ;
81      lib icudt : : <name>sicudata                                   <runtime-link>static <conditional>@path_options ;
82      lib icudt : : <name>sicudt   <toolset>msvc                     <runtime-link>static <conditional>@path_options ;
83      lib icudt : : <name>sicudt   <toolset>intel <target-os>windows <runtime-link>static <conditional>@path_options ;
84      lib icudt : : <name>this_is_an_invalid_library_name ;
85   }
86   if $(ICU_ICUIN_NAME)
87   {
88      lib icuin : : <name>$(ICU_ICUIN_NAME) ;
89   }
90   else
91   {
92      lib icuin : :                                                    <name>icui18n <runtime-link>shared <conditional>@path_options ;
93      lib icuin : : <toolset>msvc                     <variant>debug   <name>icuind  <runtime-link>shared <conditional>@path_options ;
94      lib icuin : : <toolset>msvc                                      <name>icuin   <runtime-link>shared <conditional>@path_options ;
95      lib icuin : : <toolset>intel <target-os>windows <variant>debug   <name>icuind  <runtime-link>shared <conditional>@path_options ;
96      lib icuin : : <toolset>intel <target-os>windows                  <name>icuin   <runtime-link>shared <conditional>@path_options ;
97      lib icuin : :                                                    <name>sicui18n <runtime-link>static <conditional>@path_options ;
98      lib icuin : : <toolset>msvc                     <variant>debug   <name>sicuind  <runtime-link>static <conditional>@path_options ;
99      lib icuin : : <toolset>msvc                                      <name>sicuin   <runtime-link>static <conditional>@path_options ;
100      lib icuin : : <toolset>intel <target-os>windows <variant>debug   <name>sicuind  <runtime-link>static <conditional>@path_options ;
101      lib icuin : : <toolset>intel <target-os>windows                  <name>sicuin   <runtime-link>static <conditional>@path_options ;
102      lib icuin : : <name>this_is_an_invalid_library_name ;
103   }
104
105   ICU_OPTS =
106      <include>$(ICU_PATH)/include
107      <runtime-link>shared:<library>icuuc/<link>shared
108      <runtime-link>shared:<library>icudt/<link>shared
109      <runtime-link>shared:<library>icuin/<link>shared
110      <runtime-link>static:<library>icuuc
111      <runtime-link>static:<library>icudt
112      <runtime-link>static:<library>icuin
113      <define>BOOST_HAS_ICU=1
114      <runtime-link>static:<define>U_STATIC_IMPLEMENTATION=1
115      ;
116
117}
118
119exe has_icu : has_icu_test.cpp : $(ICU_OPTS) ;
120explicit has_icu ;
121
122obj is_legacy_03 : is_legacy_03.cpp ;
123explicit is_legacy_03 ;
124
125alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ;
126
127SOURCES =
128   posix_api.cpp
129   regex.cpp
130   regex_debug.cpp
131   static_mutex.cpp
132   wide_posix_api.cpp
133;
134
135lib boost_regex : ../src/$(SOURCES) icu_options
136    :
137	     <link>shared:<define>BOOST_REGEX_DYN_LINK=1
138	     <toolset>gcc-cygwin:<link>static
139    ;
140
141boost-install boost_regex ;
142
143