Skip to content

Commit 71a0e02

Browse files
committed
merged changes in regex5 branch
[SVN r26692]
1 parent de0ab90 commit 71a0e02

275 files changed

Lines changed: 37091 additions & 26940 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/Jamfile

Lines changed: 138 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,117 @@
11
# copyright John Maddock 2003
22

33
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+
}
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
:

build/Jamfile.v2

Lines changed: 118 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,125 @@
22
project boost/regex
33
: source-location ../src
44
;
5-
SOURCES = c_regex_traits c_regex_traits_common cpp_regex_traits
6-
cregex fileiter posix_api regex regex_debug
7-
regex_synch w32_regex_traits wide_posix_api instances winstances ;
85

6+
#
7+
# ICU configuration:
8+
#
9+
local ICU_PATH = [ modules.peek : ICU_PATH ] ;
10+
rule check-icu-config ( )
11+
{
12+
local ICU_PATH = [ modules.peek : ICU_PATH ] ;
13+
if ! $(gICU_CONFIG_CHECKED)
14+
{
15+
if $(ICU_PATH)
16+
{
17+
dir = $(ICU_PATH) ;
18+
}
19+
20+
if [ GLOB $(dir)/include/unicode : utypes.h ]
21+
{
22+
ECHO Building Boost.Regex with Unicode/ICU support enabled ;
23+
ECHO Using ICU in $(ICU_PATH:J=" ")/include ;
24+
gHAS_ICU = true ;
25+
26+
# try and find ICU libraries, look for NT versions first:
27+
if [ GLOB $(dir)/lib : icuuc.* ]
28+
{
29+
gICU_CORE_LIB = icuuc ;
30+
}
31+
else if [ GLOB $(dir)/lib : libicuuc.* ]
32+
{
33+
gICU_CORE_LIB = icuuc ;
34+
}
35+
else if [ GLOB $(ICU_PATH)/lib : cygicuuc.dll ]
36+
{
37+
gICU_CORE_LIB = cygicuuc.dll ;
38+
}
39+
else
40+
{
41+
ECHO ICU shared common library not found. ;
42+
}
43+
44+
if [ GLOB $(dir)/lib : icuin.* ]
45+
{
46+
gICU_IN_LIB = icuin ;
47+
}
48+
else if [ GLOB $(dir)/lib : libicui18n.* ]
49+
{
50+
gICU_IN_LIB = icuin ;
51+
}
52+
else if [ GLOB $(ICU_PATH)/lib : cygicuin.dll ]
53+
{
54+
gICU_IN_LIB = cygicuin.dll ;
55+
}
56+
else
57+
{
58+
ECHO ICU shared i18n library not found. ;
59+
}
60+
}
61+
else
62+
{
63+
ECHO ****************************************************** ;
64+
ECHO ;
65+
ECHO Building Boost.Regex with Unicode/ICU support disabled. ;
66+
ECHO HINT: define the environment variable ICU_PATH to point to the ;
67+
ECHO root directy of your ICU installation if you have one. ;
68+
ECHO Couldn't find utypes.h in \"$(ICU_PATH:J=" ")/include/unicode\" ;
69+
ECHO ;
70+
ECHO ****************************************************** ;
71+
}
72+
gICU_CONFIG_CHECKED = true ;
73+
}
74+
if $(gHAS_ICU)
75+
{
76+
return true ;
77+
}
78+
}
979

10-
lib boost_regex : $(SOURCES).cpp
80+
if [ check-icu-config ]
81+
{
82+
BOOST_REGEX_ICU_OPTS = "<define>BOOST_HAS_ICU=1" ;
83+
if $(gICU_CORE_LIB)
84+
{
85+
lib icucore : : <name>$(gICU_CORE_LIB) <search>/$(ICU_PATH)/lib ;
86+
ICU_EXTRA_SOURCE = icucore ;
87+
}
88+
if $(gICU_IN_LIB)
89+
{
90+
lib icuin : : <name>$(gICU_IN_LIB) <search>/$(ICU_PATH)/lib ;
91+
ICU_EXTRA_SOURCE += icuin ;
92+
}
93+
if $(ICU_PATH)
94+
{
95+
BOOST_REGEX_ICU_OPTS += "<include>$(ICU_PATH)/include" ;
96+
#BOOST_REGEX_ICU_OPTS += "<library-path>$(ICU_PATH)/lib" ;
97+
}
98+
}
99+
100+
SOURCES =
101+
c_regex_traits.cpp
102+
cpp_regex_traits.cpp
103+
cregex.cpp
104+
fileiter.cpp
105+
icu.cpp
106+
instances.cpp
107+
posix_api.cpp
108+
regex.cpp
109+
regex_debug.cpp
110+
regex_raw_buffer.cpp
111+
regex_traits_defaults.cpp
112+
static_mutex.cpp
113+
w32_regex_traits.cpp
114+
wc_regex_traits.cpp
115+
wide_posix_api.cpp
116+
winstances.cpp
117+
usinstances.cpp ;
118+
119+
120+
lib boost_regex : ../src/$(SOURCES) $(ICU_EXTRA_SOURCE)
11121
:
12-
<variant>debug:<define>BOOST_REGEX_CONFIG_INFO=1
13-
<link>shared:<define>BOOST_REGEX_DYN_LINK=1
122+
#<link>static:<define>BOOST_REGEX_NO_LIB=1
123+
#<link>static:<define>BOOST_REGEX_STATIC_LINK=1
124+
<link>shared:<define>BOOST_REGEX_DYN_LINK=1
125+
$(BOOST_REGEX_ICU_OPTS)
14126
;

0 commit comments

Comments
 (0)