scons: trunk requires at least icu 4.2, so enforce that at configure time - closes #482

This commit is contained in:
Dane Springmeyer 2010-11-30 01:25:54 +00:00
parent 91a0719778
commit 88e1e30d9f
2 changed files with 47 additions and 14 deletions

View file

@ -62,10 +62,10 @@ First, here is a quick list of the required software dependencies:
- system - system
- thread - thread
- filesystem - filesystem
- regex - regex (built against libicu >= 4.2)
- iostreams - iostreams
- python - required only for python bindings (see below) - python - required only for python bindings (see below)
- libicu >= 1.4- International Components for Unicode - libicu >= 4.2 - International Components for Unicode
- libpng - PNG Graphics - libpng - PNG Graphics
- libjpeg - JPEG Graphics - libjpeg - JPEG Graphics
- libtiff - TIFF Graphics - libtiff - TIFF Graphics

View file

@ -735,18 +735,46 @@ int main()
major_version = version / 100000 major_version = version / 100000
return [major_version,minor_version,patch_level] return [major_version,minor_version,patch_level]
conf_tests = { 'prioritize_paths' : prioritize_paths, def icu_at_least_four_two(context):
'CheckPKGConfig' : CheckPKGConfig, ret = context.TryRun("""
'CheckPKG' : CheckPKG,
'FindBoost' : FindBoost, #include <unicode/uversion.h>
'CheckBoost' : CheckBoost, #include <iostream>
'GetBoostLibVersion' : GetBoostLibVersion,
'GetMapnikLibVersion' : GetMapnikLibVersion, int main()
'parse_config' : parse_config, {
'parse_pg_config' : parse_pg_config, std::cout << U_ICU_VERSION_MAJOR_NUM << "." << U_ICU_VERSION_MINOR_NUM << std::endl;
'ogr_enabled': ogr_enabled, return 0;
'get_pkg_lib': get_pkg_lib, }
'rollback_option': rollback_option
""", '.cpp')
# hack to avoid printed output
context.Message('Checking for ICU version >= 4.2... ')
#context.did_show_result=1
result = ret[1].strip()
if not result:
context.Result('error, could not get major and minor version from unicode/uversion.h')
return False
color_print(4,'\nFound icu version... %s' % result)
major, minor = map(int,result.split('.'))
if major >= 4 and minor >= 2:
return True
return False
conf_tests = { 'prioritize_paths' : prioritize_paths,
'CheckPKGConfig' : CheckPKGConfig,
'CheckPKG' : CheckPKG,
'FindBoost' : FindBoost,
'CheckBoost' : CheckBoost,
'GetBoostLibVersion' : GetBoostLibVersion,
'GetMapnikLibVersion' : GetMapnikLibVersion,
'parse_config' : parse_config,
'parse_pg_config' : parse_pg_config,
'ogr_enabled' : ogr_enabled,
'get_pkg_lib' : get_pkg_lib,
'rollback_option' : rollback_option,
'icu_at_least_four_two' : icu_at_least_four_two
} }
@ -903,6 +931,11 @@ if not preconfigured:
color_print(4,'Could not find optional header or shared library for %s' % libinfo[0]) color_print(4,'Could not find optional header or shared library for %s' % libinfo[0])
env['SKIPPED_DEPS'].append(libinfo[0]) env['SKIPPED_DEPS'].append(libinfo[0])
if env['ICU_LIB_NAME'] not in env['MISSING_DEPS']:
if not conf.icu_at_least_four_two():
# expression_string.cpp and map.cpp use fromUTF* function only available in >= ICU 4.2
env['MISSING_DEPS'].append(env['ICU_LIB_NAME'])
if env['THREADING'] == 'multi': if env['THREADING'] == 'multi':
thread_flag = thread_suffix thread_flag = thread_suffix
else: else: