11# copyright John Maddock 2003
22
33subproject 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+ }
34+ else if [ GLOB $(dir)$(SLASH)lib : libicuuc.* ]
35+ {
36+ gICU_LIBS += <find-library>icuuc ;
37+ }
38+ else if [ GLOB $(ICU_PATH)/lib : cygicuuc.dll ]
39+ {
40+ gICU_LIBS += <library-file>$(ICU_PATH)/lib/cygicuuc.dll ;
41+ }
42+ else if [ GLOB /usr/local/lib : cygicuuc.dll ]
43+ {
44+ gICU_LIBS += <library-file>/usr/local/lib/cygicuuc.dll ;
45+ }
46+ else
47+ {
48+ ECHO ICU shared common library not found. ;
49+ ECHO HINT: Set the environment variable ICU_LINK to contain ;
50+ ECHO the linker options required to link to ICU. ;
51+ }
52+
53+ if $(ICU_LINK)
54+ {
55+ # gICU_LIBS += <linkflags>$(ICU_LINK) ;
56+ }
57+ else if [ GLOB $(dir)$(SLASH)lib : icuin.* ]
58+ {
59+ gICU_LIBS += <find-library>icuin ;
60+ }
61+ else if [ GLOB $(dir)$(SLASH)lib : libicui18n.* ]
62+ {
63+ gICU_LIBS += <find-library>icui18n ;
64+ }
65+ else if [ GLOB $(ICU_PATH)/lib : cygicuin.dll ]
66+ {
67+ gICU_LIBS += <library-file>$(ICU_PATH)/lib/cygicuin.dll ;
68+ }
69+ else if [ GLOB /usr/local/lib : cygicuin.dll ]
70+ {
71+ gICU_LIBS += <library-file>/usr/local/lib/cygicuin.dll ;
72+ }
73+ else
74+ {
75+ ECHO ICU shared i18n library not found. ;
76+ ECHO HINT: Set the environment variable ICU_LINK to contain ;
77+ ECHO the linker options required to link to ICU. ;
78+ }
79+ }
80+ else
81+ {
82+ ECHO ****************************************************** ;
83+ ECHO ;
84+ ECHO Building Boost.Regex with Unicode/ICU support disabled. ;
85+ ECHO HINT: define the environment variable ICU_PATH to point to the ;
86+ ECHO root directy of your ICU installation if you have one. ;
87+ ECHO Couldn't find utypes.h in $(ICU_PATH:J=" ")$(SLASH)include$(SLASH)unicode ;
88+ ECHO ;
89+ ECHO ****************************************************** ;
90+ }
91+ gICU_CONFIG_CHECKED = true ;
92+ }
93+ if $(gHAS_ICU)
94+ {
95+ return true ;
96+ }
97+ }
98+
99+ if [ check-icu-config ]
100+ {
101+ BOOST_REGEX_ICU_OPTS = "<define>BOOST_HAS_ICU=1" ;
102+ if $(gICU_LIBS)
103+ {
104+ BOOST_REGEX_ICU_OPTS += $(gICU_LIBS) ;
105+ # this one is required for VC++ :
106+ BOOST_REGEX_ICU_TEST_OPTS = "<native-wchar_t>off" ;
107+ }
108+ if $(ICU_PATH)
109+ {
110+ BOOST_REGEX_ICU_OPTS += "<sysinclude>$(ICU_PATH)/include" ;
111+ BOOST_REGEX_ICU_OPTS += "<library-path>$(ICU_PATH)/lib" ;
112+ }
113+ # ECHO "BOOST_REGEX_ICU_OPTS =" $(BOOST_REGEX_ICU_OPTS) ;
114+ }
4115
5116#
6117# this template defines the options common to
@@ -14,6 +125,12 @@ template regex-options
14125 # <native-wchar_t>on
15126 # como requires this:
16127 <como-win32><*><define>BOOST_REGEX_NO_W32=1
128+ $(BOOST_REGEX_ICU_OPTS)
129+ ;
130+ template regex-test-options
131+ : # sources
132+ : # requirements
133+ $(BOOST_REGEX_ICU_TEST_OPTS)
17134 ;
18135
19136#
@@ -37,19 +154,35 @@ template msvc-stlport-tricky
37154 <define>BOOST_ALL_NO_LIB=1
38155 ;
39156
40- SOURCES = c_regex_traits c_regex_traits_common cpp_regex_traits
41- cregex fileiter posix_api regex regex_debug
42- regex_synch w32_regex_traits wide_posix_api instances winstances ;
157+ SOURCES =
158+ c_regex_traits.cpp
159+ cpp_regex_traits.cpp
160+ cregex.cpp
161+ fileiter.cpp
162+ icu.cpp
163+ instances.cpp
164+ posix_api.cpp
165+ regex.cpp
166+ regex_debug.cpp
167+ regex_raw_buffer.cpp
168+ regex_traits_defaults.cpp
169+ static_mutex.cpp
170+ w32_regex_traits.cpp
171+ wc_regex_traits.cpp
172+ wide_posix_api.cpp
173+ winstances.cpp
174+ usinstances.cpp ;
175+
43176
44- lib boost_regex : ../src/$(SOURCES).cpp <template>regex-options
177+ lib boost_regex : ../src/$(SOURCES) <template>regex-options
45178 :
46179 common-variant-tag
47180 :
48181 debug release
49182 ;
50183
51184
52- dll boost_regex : ../src/$(SOURCES).cpp <template>regex-dll-options
185+ dll boost_regex : ../src/$(SOURCES) <template>regex-dll-options
53186 :
54187 common-variant-tag
55188 :
0 commit comments