Update bbv2 instructions.

Update Jamfile support for ICU.


[SVN r36689]
This commit is contained in:
John Maddock
2007-01-11 17:21:37 +00:00
parent 3c07ee04de
commit f7f4f2fafb
3 changed files with 114 additions and 61 deletions

View File

@ -14,12 +14,21 @@ local ICU_PATH = [ modules.peek : ICU_PATH ] ;
rule check-icu-config ( ) rule check-icu-config ( )
{ {
local ICU_PATH = [ modules.peek : ICU_PATH ] ; local ICU_PATH = [ modules.peek : ICU_PATH ] ;
local HAVE_ICU = [ modules.peek : HAVE_ICU ] ;
local ICU_LINK = [ modules.peek : ICU_LINK ] ;
if ! $(gICU_CONFIG_CHECKED) if ! $(gICU_CONFIG_CHECKED)
{ {
if $(ICU_PATH) if $(HAVE_ICU)
{
gHAS_ICU = true ;
gICU_CORE_LIB = icuuc ;
gICU_IN_LIB = icui18n ;
gICU_CONFIG_CHECKED = true ;
}
else if $(ICU_PATH)
{ {
dir = $(ICU_PATH) ; dir = $(ICU_PATH) ;
}
if [ GLOB $(dir)/include/unicode : utypes.h ] if [ GLOB $(dir)/include/unicode : utypes.h ]
{ {
@ -28,7 +37,15 @@ rule check-icu-config ( )
gHAS_ICU = true ; gHAS_ICU = true ;
# try and find ICU libraries, look for NT versions first: # try and find ICU libraries, look for NT versions first:
if [ GLOB $(dir)/lib : icuuc.* ] if $(ICU_LINK)
{
gICU_LIBS += <linkflags>$(ICU_LINK) ;
}
else if [ GLOB $(dir)/lib64 : icuuc.* ]
{
gICU_CORE_LIB = icuuc ;
}
else if [ GLOB $(dir)/lib : libicuuc.* ]
{ {
gICU_CORE_LIB = icuuc ; gICU_CORE_LIB = icuuc ;
} }
@ -40,15 +57,33 @@ rule check-icu-config ( )
{ {
gICU_CORE_LIB = cygicuuc.dll ; gICU_CORE_LIB = cygicuuc.dll ;
} }
else if [ GLOB $(ICU_PATH)/lib : cygicuuc32.dll ]
{
gICU_CORE_LIB = cygicuuc32.dll ;
}
else else
{ {
ECHO ICU shared common library not found. ; ECHO WARNING: ICU shared common library not found in path. ;
ECHO HINT: If the regex library fails to link then try again ;
ECHO with the environment variable ICU_LINK set to contain ;
ECHO the linker options required to link to ICU. ;
ECHO Defaulting to look for libicuuc ... ;
gICU_CORE_LIB = icuuc ;
} }
if [ GLOB $(dir)/lib : icuin.* ] if $(ICU_LINK)
{
# nothing to do, it's already been done!
# gICU_LIBS += <linkflags>$(ICU_LINK) ;
}
else if [ GLOB $(dir)/lib : icuin.* ]
{ {
gICU_IN_LIB = icuin ; gICU_IN_LIB = icuin ;
} }
else if [ GLOB $(dir)/lib64 : libicui18n.* ]
{
gICU_IN_LIB = icui18n ;
}
else if [ GLOB $(dir)/lib : libicui18n.* ] else if [ GLOB $(dir)/lib : libicui18n.* ]
{ {
gICU_IN_LIB = icui18n ; gICU_IN_LIB = icui18n ;
@ -57,9 +92,18 @@ rule check-icu-config ( )
{ {
gICU_IN_LIB = cygicuin.dll ; gICU_IN_LIB = cygicuin.dll ;
} }
else if [ GLOB $(ICU_PATH)/lib : cygicuin32.dll ]
{
gICU_IN_LIB = cygicuin32.dll ;
}
else else
{ {
ECHO ICU shared i18n library not found. ; ECHO WARNING: ICU shared i18n library not found in path. ;
ECHO HINT: If the regex library fails to link then try again ;
ECHO with the environment variable ICU_LINK set to contain ;
ECHO the linker options required to link to ICU. ;
ECHO Defaulting to look for libicui18n ... ;
gICU_IN_LIB = icui18n ;
} }
} }
else else
@ -69,11 +113,12 @@ rule check-icu-config ( )
ECHO (don't panic: this is a strictly optional feature). ; ECHO (don't panic: this is a strictly optional feature). ;
if $(ICU_PATH) if $(ICU_PATH)
{ {
ECHO Couldn't find utypes.h in $(ICU_PATH:J=" ")$(SLASH)include$(SLASH)unicode ; ECHO Couldn't find utypes.h in $(ICU_PATH:J=" ")/include/unicode ;
} }
} }
gICU_CONFIG_CHECKED = true ; gICU_CONFIG_CHECKED = true ;
} }
}
if $(gHAS_ICU) if $(gHAS_ICU)
{ {
return true ; return true ;
@ -83,10 +128,16 @@ rule check-icu-config ( )
if [ check-icu-config ] if [ check-icu-config ]
{ {
BOOST_REGEX_ICU_OPTS = "<define>BOOST_HAS_ICU=1" ; BOOST_REGEX_ICU_OPTS = "<define>BOOST_HAS_ICU=1" ;
if ($(ICU_PATH) != /usr) && ($(ICU_PATH) != /usr/local)
if $(ICU_PATH)
{ {
if $(ICU_PATH) != "/usr" && $(ICU_PATH) != "/usr/local"
{
ECHO "BAH!" ;
BOOST_REGEX_ICU_OPTS += "<include>$(ICU_PATH)/include" ;
ICU_SEARCH_OPTS = <search>/$(ICU_PATH)/lib ; ICU_SEARCH_OPTS = <search>/$(ICU_PATH)/lib ;
} }
}
if $(gICU_CORE_LIB) if $(gICU_CORE_LIB)
{ {
@ -98,13 +149,6 @@ if [ check-icu-config ]
lib icuin : : <name>$(gICU_IN_LIB) $(ICU_SEARCH_OPTS) ; lib icuin : : <name>$(gICU_IN_LIB) $(ICU_SEARCH_OPTS) ;
ICU_EXTRA_SOURCE += icuin ; ICU_EXTRA_SOURCE += icuin ;
} }
if $(ICU_PATH)
{
if ($(ICU_PATH) != /usr) && ($(ICU_PATH) != /usr/local)
{
BOOST_REGEX_ICU_OPTS += "<include>$(ICU_PATH)/include" ;
}
}
} }
SOURCES = SOURCES =
@ -136,3 +180,4 @@ lib boost_regex : ../src/$(SOURCES) $(ICU_EXTRA_SOURCE)
; ;

View File

@ -49,16 +49,20 @@
support</A> via ICU.&nbsp; There is no need to enable this support if you support</A> via ICU.&nbsp; There is no need to enable this support if you
don't need it, but if you use ICU for your Unicode support already, and want to don't need it, but if you use ICU for your Unicode support already, and want to
work with Unicode-aware regular expressions then read on.</P> work with Unicode-aware regular expressions then read on.</P>
<P>Most of the information you will need is in the <A href="../../../more/getting_started.html">
getting started guide</A>, the only additional step you need to take is to
tell bjam that you want Boost.Regex to use ICU and optionally to tell bjam
where ICU is located.</P>
<P>If you're building on a Unix-like platform, and ICU is already installed in <P>If you're building on a Unix-like platform, and ICU is already installed in
you're compilers search path (with an install&nbsp;prefix of /usr or /usr/local you're compilers search path (with an install&nbsp;prefix of /usr or /usr/local
for example), then set the environment variable HAVE_ICU to enable ICU for example), then set the environment variable HAVE_ICU to enable ICU
support.&nbsp; For example you might build with the command line:</P> support.&nbsp; For example you might build with the command line:</P>
<PRE>bjam -sHAVE_ICU=1 -sTOOLS=<A href="../../../more/getting_started.html#Tools">my-compiler</A></PRE> <PRE>bjam -sHAVE_ICU=1 --toolset=<A href="../../../more/getting_started/windows.html#toolset-name">toolset-name</A> install</PRE>
<P>If ICU is not already in your compilers path then you need to set the <P>If ICU is not already in your compilers path then you need to set the
environment variable ICU_PATH to point to the route directory of your ICU environment variable ICU_PATH to point to the route directory of your ICU
installation, for example if ICU was installed to /usr/local/icu/3.3 you might installation, for example if ICU was installed to /usr/local/icu/3.3 you might
use:</P> use:</P>
<PRE>bjam -sICU_PATH=/usr/local/icu/3.3 -sTOOLS=<A href="../../../more/getting_started.html#Tools" >my-compiler</A></PRE> <PRE>bjam -sICU_PATH=/usr/local/icu/3.3 --toolset=<A href="../../../more/getting_started/windows.html#toolset-name">toolset-name</A> install</PRE>
<P>Note that ICU is a C++ library just like Boost is, as such your copy of ICU <P>Note that ICU is a C++ library just like Boost is, as such your copy of ICU
must have been built with the same C++ compiler (and compiler version) that you must have been built with the same C++ compiler (and compiler version) that you
are using to build Boost.&nbsp; <STRONG>Boost.Regex will not work correctly unless are using to build Boost.&nbsp; <STRONG>Boost.Regex will not work correctly unless

View File

@ -49,16 +49,20 @@
support</A> via ICU.&nbsp; There is no need to enable this support if you support</A> via ICU.&nbsp; There is no need to enable this support if you
don't need it, but if you use ICU for your Unicode support already, and want to don't need it, but if you use ICU for your Unicode support already, and want to
work with Unicode-aware regular expressions then read on.</P> work with Unicode-aware regular expressions then read on.</P>
<P>Most of the information you will need is in the <A href="../../../more/getting_started.html">
getting started guide</A>, the only additional step you need to take is to
tell bjam that you want Boost.Regex to use ICU and optionally to tell bjam
where ICU is located.</P>
<P>If you're building on a Unix-like platform, and ICU is already installed in <P>If you're building on a Unix-like platform, and ICU is already installed in
you're compilers search path (with an install&nbsp;prefix of /usr or /usr/local you're compilers search path (with an install&nbsp;prefix of /usr or /usr/local
for example), then set the environment variable HAVE_ICU to enable ICU for example), then set the environment variable HAVE_ICU to enable ICU
support.&nbsp; For example you might build with the command line:</P> support.&nbsp; For example you might build with the command line:</P>
<PRE>bjam -sHAVE_ICU=1 -sTOOLS=<A href="../../../more/getting_started.html#Tools">my-compiler</A></PRE> <PRE>bjam -sHAVE_ICU=1 --toolset=<A href="../../../more/getting_started/windows.html#toolset-name">toolset-name</A> install</PRE>
<P>If ICU is not already in your compilers path then you need to set the <P>If ICU is not already in your compilers path then you need to set the
environment variable ICU_PATH to point to the route directory of your ICU environment variable ICU_PATH to point to the route directory of your ICU
installation, for example if ICU was installed to /usr/local/icu/3.3 you might installation, for example if ICU was installed to /usr/local/icu/3.3 you might
use:</P> use:</P>
<PRE>bjam -sICU_PATH=/usr/local/icu/3.3 -sTOOLS=<A href="../../../more/getting_started.html#Tools" >my-compiler</A></PRE> <PRE>bjam -sICU_PATH=/usr/local/icu/3.3 --toolset=<A href="../../../more/getting_started/windows.html#toolset-name">toolset-name</A> install</PRE>
<P>Note that ICU is a C++ library just like Boost is, as such your copy of ICU <P>Note that ICU is a C++ library just like Boost is, as such your copy of ICU
must have been built with the same C++ compiler (and compiler version) that you must have been built with the same C++ compiler (and compiler version) that you
are using to build Boost.&nbsp; <STRONG>Boost.Regex will not work correctly unless are using to build Boost.&nbsp; <STRONG>Boost.Regex will not work correctly unless