1 | # copyright John Maddock 2003 |
---|
2 | |
---|
3 | subproject libs/regex/build ; |
---|
4 | # bring in the rules for testing |
---|
5 | import testing ; |
---|
6 | |
---|
7 | # |
---|
8 | # ICU configuration: |
---|
9 | # |
---|
10 | rule check-icu-config ( ) |
---|
11 | { |
---|
12 | if ! $(gICU_CONFIG_CHECKED) |
---|
13 | { |
---|
14 | if $(ICU_PATH) |
---|
15 | { |
---|
16 | dir += $(ICU_PATH) ; |
---|
17 | } |
---|
18 | |
---|
19 | if [ GLOB $(dir)$(SLASH)include$(SLASH)unicode : utypes.h ] |
---|
20 | { |
---|
21 | ECHO Building Boost.Regex with Unicode/ICU support enabled ; |
---|
22 | ECHO Using ICU in $(ICU_PATH:J=" ")$(SLASH)include ; |
---|
23 | gHAS_ICU = true ; |
---|
24 | |
---|
25 | # try and find ICU libraries, look for NT versions first: |
---|
26 | if $(ICU_LINK) |
---|
27 | { |
---|
28 | gICU_LIBS += <linkflags>$(ICU_LINK) ; |
---|
29 | } |
---|
30 | else if [ GLOB $(dir)$(SLASH)lib : icuuc.* ] |
---|
31 | { |
---|
32 | gICU_LIBS += <find-library>icuuc ; |
---|
33 | if ($(ICU_PATH) != /usr) && ($(ICU_PATH) != /usr/local) |
---|
34 | { |
---|
35 | gICU_LIBS += <library-path>$(ICU_PATH)/lib ; |
---|
36 | } |
---|
37 | } |
---|
38 | else if [ GLOB $(dir)$(SLASH)lib : libicuuc.* ] |
---|
39 | { |
---|
40 | gICU_LIBS += <find-library>icuuc ; |
---|
41 | if ($(ICU_PATH) != /usr) && ($(ICU_PATH) != /usr/local) |
---|
42 | { |
---|
43 | gICU_LIBS += <library-path>$(ICU_PATH)/lib ; |
---|
44 | } |
---|
45 | } |
---|
46 | else if [ GLOB $(ICU_PATH)/lib : cygicuuc.dll ] |
---|
47 | { |
---|
48 | gICU_LIBS += <library-file>$(ICU_PATH)/lib/cygicuuc.dll ; |
---|
49 | } |
---|
50 | else if [ GLOB $(ICU_PATH)/lib : cygicuuc32.dll ] |
---|
51 | { |
---|
52 | gICU_LIBS += <library-file>$(ICU_PATH)/lib/cygicuuc32.dll ; |
---|
53 | } |
---|
54 | else if [ GLOB /usr/local/lib : cygicuuc.dll ] |
---|
55 | { |
---|
56 | gICU_LIBS += <library-file>/usr/local/lib/cygicuuc.dll ; |
---|
57 | } |
---|
58 | else |
---|
59 | { |
---|
60 | ECHO WARNING: ICU shared common library not found in path. ; |
---|
61 | ECHO HINT: If the regex library fails to link then try again ; |
---|
62 | ECHO with the environment variable ICU_LINK set to contain ; |
---|
63 | ECHO the linker options required to link to ICU. ; |
---|
64 | ECHO Defaulting to look for libicuuc ... ; |
---|
65 | gICU_LIBS += <find-library>icuuc ; |
---|
66 | } |
---|
67 | |
---|
68 | if $(ICU_LINK) |
---|
69 | { |
---|
70 | # gICU_LIBS += <linkflags>$(ICU_LINK) ; |
---|
71 | } |
---|
72 | else if [ GLOB $(dir)$(SLASH)lib : icuin.* ] |
---|
73 | { |
---|
74 | gICU_LIBS += <find-library>icuin ; |
---|
75 | if ($(ICU_PATH) != /usr) && ($(ICU_PATH) != /usr/local) |
---|
76 | { |
---|
77 | gICU_LIBS += <library-path>$(ICU_PATH)/lib ; |
---|
78 | } |
---|
79 | } |
---|
80 | else if [ GLOB $(dir)$(SLASH)lib : libicui18n.* ] |
---|
81 | { |
---|
82 | gICU_LIBS += <find-library>icui18n ; |
---|
83 | if ($(ICU_PATH) != /usr) && ($(ICU_PATH) != /usr/local) |
---|
84 | { |
---|
85 | gICU_LIBS += <library-path>$(ICU_PATH)/lib ; |
---|
86 | } |
---|
87 | } |
---|
88 | else if [ GLOB $(ICU_PATH)/lib : cygicuin.dll ] |
---|
89 | { |
---|
90 | gICU_LIBS += <library-file>$(ICU_PATH)/lib/cygicuin.dll ; |
---|
91 | } |
---|
92 | else if [ GLOB $(ICU_PATH)/lib : cygicuin32.dll ] |
---|
93 | { |
---|
94 | gICU_LIBS += <library-file>$(ICU_PATH)/lib/cygicuin32.dll ; |
---|
95 | } |
---|
96 | else if [ GLOB /usr/local/lib : cygicuin.dll ] |
---|
97 | { |
---|
98 | gICU_LIBS += <library-file>/usr/local/lib/cygicuin.dll ; |
---|
99 | } |
---|
100 | else |
---|
101 | { |
---|
102 | ECHO ICU shared i18n library not found. ; |
---|
103 | ECHO HINT: Set the environment variable ICU_LINK to contain ; |
---|
104 | ECHO the linker options required to link to ICU. ; |
---|
105 | |
---|
106 | ECHO WARNING: ICU shared i18n library not found in path. ; |
---|
107 | ECHO HINT: If the regex library fails to link then try again ; |
---|
108 | ECHO with the environment variable ICU_LINK set to contain ; |
---|
109 | ECHO the linker options required to link to ICU. ; |
---|
110 | ECHO Defaulting to look for libicui18n ... ; |
---|
111 | gICU_LIBS += <find-library>icui18n ; |
---|
112 | } |
---|
113 | } |
---|
114 | else |
---|
115 | { |
---|
116 | if $(HAVE_ICU) |
---|
117 | { |
---|
118 | gHAS_ICU = true ; |
---|
119 | gICU_CONFIG_CHECKED = true ; |
---|
120 | if $(ICU_LINK) |
---|
121 | { |
---|
122 | gICU_LIBS += <linkflags>$(ICU_LINK) ; |
---|
123 | } |
---|
124 | else |
---|
125 | { |
---|
126 | gICU_LIBS += <find-library>icui18n ; |
---|
127 | gICU_LIBS += <find-library>icuuc ; |
---|
128 | } |
---|
129 | ECHO Building Boost.Regex with Unicode/ICU support enabled ; |
---|
130 | ECHO ICU must be installed in your compilers search paths for this ; |
---|
131 | ECHO "option to work: define ICU_PATH to point to ICU's true location" ; |
---|
132 | ECHO "if it's installed elsewhere" ; |
---|
133 | } |
---|
134 | else |
---|
135 | { |
---|
136 | ECHO Building Boost.Regex with the optional Unicode/ICU support disabled. ; |
---|
137 | ECHO Please refer to the Boost.Regex documentation for more information ; |
---|
138 | ECHO (and if you don't know what ICU is then you probably don't need it). ; |
---|
139 | if $(ICU_PATH) |
---|
140 | { |
---|
141 | ECHO Couldn't find utypes.h in $(ICU_PATH:J=" ")$(SLASH)include$(SLASH)unicode ; |
---|
142 | } |
---|
143 | } |
---|
144 | } |
---|
145 | gICU_CONFIG_CHECKED = true ; |
---|
146 | } |
---|
147 | if $(gHAS_ICU) |
---|
148 | { |
---|
149 | return true ; |
---|
150 | } |
---|
151 | } |
---|
152 | |
---|
153 | if [ check-icu-config ] |
---|
154 | { |
---|
155 | BOOST_REGEX_ICU_OPTS = "<define>BOOST_HAS_ICU=1" ; |
---|
156 | if $(gICU_LIBS) |
---|
157 | { |
---|
158 | BOOST_REGEX_ICU_OPTS += $(gICU_LIBS) ; |
---|
159 | # this one is required for VC++ : |
---|
160 | BOOST_REGEX_ICU_TEST_OPTS = "<native-wchar_t>off" ; |
---|
161 | } |
---|
162 | if $(ICU_PATH) |
---|
163 | { |
---|
164 | if ($(ICU_PATH) != /usr) && ($(ICU_PATH) != /usr/local) |
---|
165 | { |
---|
166 | BOOST_REGEX_ICU_OPTS += "<sysinclude>$(ICU_PATH)/include" ; |
---|
167 | } |
---|
168 | #BOOST_REGEX_ICU_OPTS += "<library-path>$(ICU_PATH)/lib" ; |
---|
169 | } |
---|
170 | # ECHO "BOOST_REGEX_ICU_OPTS =" $(BOOST_REGEX_ICU_OPTS) ; |
---|
171 | } |
---|
172 | |
---|
173 | # |
---|
174 | # this template defines the options common to |
---|
175 | # all regex builds and tests: |
---|
176 | # |
---|
177 | template regex-options |
---|
178 | : # sources |
---|
179 | : # requirements |
---|
180 | <debug><define>BOOST_REGEX_CONFIG_INFO=1 |
---|
181 | <sysinclude>$(BOOST_ROOT) |
---|
182 | # <native-wchar_t>on |
---|
183 | # como requires this: |
---|
184 | <como-4_3_3-vc7_1><*><define>BOOST_REGEX_NO_W32=1 |
---|
185 | <como-4_3_3-vc7_1><*><define>BOOST_SP_DISABLE_THREADS=1 |
---|
186 | $(BOOST_REGEX_ICU_OPTS) |
---|
187 | ; |
---|
188 | template regex-test-options |
---|
189 | : # sources |
---|
190 | : # requirements |
---|
191 | $(BOOST_REGEX_ICU_TEST_OPTS) |
---|
192 | ; |
---|
193 | |
---|
194 | # |
---|
195 | # this template defines the options common to |
---|
196 | # all regex dll builds and tests: |
---|
197 | # |
---|
198 | template regex-dll-options |
---|
199 | : <template>regex-options # sources |
---|
200 | : # requirements |
---|
201 | <define>BOOST_REGEX_DYN_LINK=1 |
---|
202 | <runtime-link>dynamic |
---|
203 | ; |
---|
204 | |
---|
205 | # |
---|
206 | # this template defines extra settings required to work |
---|
207 | # around STLPort defects when used with msvc 6: |
---|
208 | # |
---|
209 | template msvc-stlport-tricky |
---|
210 | : # sources |
---|
211 | : <msvc-stlport><*><runtime-build>release |
---|
212 | <define>BOOST_ALL_NO_LIB=1 |
---|
213 | ; |
---|
214 | |
---|
215 | SOURCES = |
---|
216 | c_regex_traits.cpp |
---|
217 | cpp_regex_traits.cpp |
---|
218 | cregex.cpp |
---|
219 | fileiter.cpp |
---|
220 | icu.cpp |
---|
221 | instances.cpp |
---|
222 | posix_api.cpp |
---|
223 | regex.cpp |
---|
224 | regex_debug.cpp |
---|
225 | regex_raw_buffer.cpp |
---|
226 | regex_traits_defaults.cpp |
---|
227 | static_mutex.cpp |
---|
228 | w32_regex_traits.cpp |
---|
229 | wc_regex_traits.cpp |
---|
230 | wide_posix_api.cpp |
---|
231 | winstances.cpp |
---|
232 | usinstances.cpp ; |
---|
233 | |
---|
234 | |
---|
235 | lib boost_regex : ../src/$(SOURCES) <template>regex-options |
---|
236 | : |
---|
237 | common-variant-tag |
---|
238 | : |
---|
239 | debug release |
---|
240 | ; |
---|
241 | |
---|
242 | |
---|
243 | dll boost_regex : ../src/$(SOURCES) <template>regex-dll-options |
---|
244 | : |
---|
245 | common-variant-tag |
---|
246 | : |
---|
247 | debug release |
---|
248 | ; |
---|
249 | |
---|
250 | stage stage/lib : <lib>boost_regex <dll>boost_regex |
---|
251 | : |
---|
252 | <locate>$(BOOST_ROOT) |
---|
253 | common-variant-tag |
---|
254 | <target>stage |
---|
255 | <target>all |
---|
256 | : |
---|
257 | debug release |
---|
258 | ; |
---|
259 | |
---|
260 | install regex lib |
---|
261 | : <dll>boost_regex <lib>boost_regex |
---|
262 | ; |
---|
263 | |
---|
264 | |
---|
265 | |
---|
266 | |
---|
267 | |
---|