== std::regex

don't link to boost_regex lib
This commit is contained in:
artemp 2013-10-15 09:11:08 +01:00
parent fca7b80942
commit 492db7232f
5 changed files with 4 additions and 86 deletions

View file

@ -87,7 +87,6 @@ pretty_dep_names = {
'freetype-config':'freetype-config program | try setting FREETYPE_CONFIG SCons option',
'osm':'more info: https://github.com/mapnik/mapnik/wiki/OsmPlugin',
'curl':'libcurl is required for the "osm" plugin - more info: https://github.com/mapnik/mapnik/wiki/OsmPlugin',
'boost_regex_icu':'libboost_regex built with optional ICU unicode support is needed for unicode regex support in mapnik.',
'sqlite_rtree':'The SQLite plugin requires libsqlite3 built with RTREE support (-DSQLITE_ENABLE_RTREE=1)',
'pgsql2sqlite_rtree':'The pgsql2sqlite program requires libsqlite3 built with RTREE support (-DSQLITE_ENABLE_RTREE=1)'
}
@ -919,35 +918,6 @@ int main()
color_print(1,'\nFound insufficient icu version... %s' % result)
return False
def boost_regex_has_icu(context):
if env['RUNTIME_LINK'] == 'static':
context.env.AppendUnique(LIBS='icudata')
ret = context.TryRun("""
#include <boost/regex/icu.hpp>
#include <unicode/unistr.h>
int main()
{
U_NAMESPACE_QUALIFIER UnicodeString ustr;
try {
boost::u32regex pattern = boost::make_u32regex(ustr);
}
// an exception is fine, still indicates support is
// likely compiled into regex
catch (...) {
return 0;
}
return 0;
}
""", '.cpp')
context.Message('Checking if boost_regex was built with ICU unicode support... ')
context.Result(ret[0])
if ret[0]:
return True
return False
def sqlite_has_rtree(context, silent=False):
""" check an sqlite3 install has rtree support.
@ -1009,7 +979,6 @@ conf_tests = { 'prioritize_paths' : prioritize_paths,
'get_pkg_lib' : get_pkg_lib,
'rollback_option' : rollback_option,
'icu_at_least_four_two' : icu_at_least_four_two,
'boost_regex_has_icu' : boost_regex_has_icu,
'sqlite_has_rtree' : sqlite_has_rtree,
}
@ -1299,7 +1268,6 @@ if not preconfigured:
BOOST_LIBSHEADERS = [
['system', 'boost/system/system_error.hpp', True],
['filesystem', 'boost/filesystem/operations.hpp', True],
['regex', 'boost/regex.hpp', True],
['program_options', 'boost/program_options.hpp', False]
]
@ -1342,11 +1310,6 @@ if not preconfigured:
# we need libicui18n if using static boost libraries, so it is
# important to try this check with the library linked
env.AppendUnique(LIBS='icui18n')
if conf.boost_regex_has_icu():
# TODO - should avoid having this be globally defined...
env.Append(CPPDEFINES = '-DBOOST_REGEX_HAS_ICU')
else:
env['SKIPPED_DEPS'].append('boost_regex_icu')
for libname, headers, required, lang, define in OPTIONAL_LIBSHEADERS:
if not env['HOST']:

View file

@ -81,25 +81,6 @@ struct binary_node
expr_node left,right;
};
#if defined(BOOST_REGEX_HAS_ICU)
struct regex_match_node
{
regex_match_node (expr_node const& a, mapnik::value_unicode_string const& ustr);
expr_node expr;
std::regex pattern;
};
struct regex_replace_node
{
regex_replace_node (expr_node const& a, mapnik::value_unicode_string const& ustr, mapnik::value_unicode_string const& f);
expr_node expr;
std::regex pattern;
mapnik::value_unicode_string format;
};
#else
struct regex_match_node
{
@ -116,7 +97,6 @@ struct regex_replace_node
std::regex pattern;
std::string format;
};
#endif
struct function_call
{

View file

@ -53,11 +53,10 @@ libmapnik_defines = copy(lib_env['CPPDEFINES'])
ABI_VERSION = env['ABI_VERSION']
filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
regex = 'boost_regex%s' % env['BOOST_APPEND']
system = 'boost_system%s' % env['BOOST_APPEND']
# clear out and re-set libs for this env
lib_env['LIBS'] = ['freetype',env['ICU_LIB_NAME'],filesystem,system,regex]
lib_env['LIBS'] = ['freetype',env['ICU_LIB_NAME'],filesystem,system]
if '-DMAPNIK_USE_PROJ4' in env['CPPDEFINES']:
lib_env['LIBS'].append('proj')
@ -86,12 +85,6 @@ if len(env['EXTRA_FREETYPE_LIBS']):
lib_env['LIBS'].append('xml2')
lib_env['LIBS'].append('z')
#if env['THREADING'] == 'multi':
# lib_env['LIBS'].append('boost_thread%s' % env['BOOST_APPEND'])
if '-DBOOST_REGEX_HAS_ICU' in env['CPPDEFINES']:
lib_env['LIBS'].append('icui18n')
if env['RUNTIME_LINK'] == 'static':
if 'icuuc' in env['ICU_LIB_NAME']:
lib_env['LIBS'].append('icudata')

View file

@ -26,27 +26,13 @@
namespace mapnik
{
#if defined(BOOST_REGEX_HAS_ICU)
regex_match_node::regex_match_node (expr_node const& a, mapnik::value_unicode_string const& ustr)
: expr(a),
pattern(ustr) {}
regex_replace_node::regex_replace_node (expr_node const& a, mapnik::value_unicode_string const& ustr, mapnik::value_unicode_string const& f)
: expr(a),
pattern(ustr),
format(f) {}
#else
regex_match_node::regex_match_node (expr_node const& a, std::string const& str)
: expr(a),
pattern(str) {}
pattern(str, std::regex::extended | std::regex::optimize) {}
regex_replace_node::regex_replace_node (expr_node const& a, std::string const& str, std::string const& f)
: expr(a),
pattern(str),
pattern(str, std::regex::extended | std::regex::optimize),
format(f) {}
#endif
}

View file

@ -4,11 +4,7 @@ from copy import copy
Import ('env')
headers = env['CPPPATH']
filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
system = 'boost_system%s' % env['BOOST_APPEND']
regex = 'boost_regex%s' % env['BOOST_APPEND']
headers = env['CPPPATH']
libraries = copy(env['LIBMAPNIK_LIBS'])
libraries.append('mapnik')