summaryrefslogtreecommitdiff
path: root/configure.py
diff options
context:
space:
mode:
authorSteven R. Loomis <srloomis@us.ibm.com>2018-11-08 13:49:40 -0500
committerRefael Ackermann <refack@gmail.com>2018-11-16 23:16:55 -0500
commited1c40e977cc5bb87645bc1dcf62d2e25386a2c0 (patch)
treef93da9dca144179ce0fa27a78849178527f490ca /configure.py
parent07a7bf7272e1c460c0ee84547bdc08d579abed8b (diff)
downloadandroid-node-v8-ed1c40e977cc5bb87645bc1dcf62d2e25386a2c0.tar.gz
android-node-v8-ed1c40e977cc5bb87645bc1dcf62d2e25386a2c0.tar.bz2
android-node-v8-ed1c40e977cc5bb87645bc1dcf62d2e25386a2c0.zip
build: check minimum ICU in configure for system-icu
- check the version number coming out of pkg-config PR-URL: https://github.com/nodejs/node/pull/24255 Fixes: https://github.com/nodejs/node/issues/24253 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/configure.py b/configure.py
index 065e31fd9c..e6e1810d13 100755
--- a/configure.py
+++ b/configure.py
@@ -434,7 +434,7 @@ intl_optgroup.add_option('--with-icu-source',
dest='with_icu_source',
help='Intl mode: optional local path to icu/ dir, or path/URL of '
'the icu4c source archive. '
- 'v%d.x or later recommended.' % icu_versions["minimum_icu"])
+ 'v%d.x or later recommended.' % icu_versions['minimum_icu'])
parser.add_option('--with-ltcg',
action='store_true',
@@ -622,9 +622,13 @@ def b(value):
def pkg_config(pkg):
+ """Run pkg-config on the specified package
+ Returns ("-l flags", "-I flags", "-L flags", "version")
+ otherwise (None, None, None, None)"""
pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
retval = ()
- for flag in ['--libs-only-l', '--cflags-only-I', '--libs-only-L']:
+ for flag in ['--libs-only-l', '--cflags-only-I',
+ '--libs-only-L', '--modversion']:
try:
proc = subprocess.Popen(
shlex.split(pkg_config) + ['--silence-errors', flag, pkg],
@@ -632,7 +636,7 @@ def pkg_config(pkg):
val = proc.communicate()[0].strip()
except OSError as e:
if e.errno != errno.ENOENT: raise e # Unexpected error.
- return (None, None, None) # No pkg-config/pkgconf installed.
+ return (None, None, None, None) # No pkg-config/pkgconf installed.
retval += (val,)
return retval
@@ -1119,7 +1123,7 @@ def configure_library(lib, output):
output['variables']['node_' + shared_lib] = b(getattr(options, shared_lib))
if getattr(options, shared_lib):
- (pkg_libs, pkg_cflags, pkg_libpath) = pkg_config(lib)
+ (pkg_libs, pkg_cflags, pkg_libpath, pkg_modversion) = pkg_config(lib)
if options.__dict__[shared_lib + '_includes']:
output['include_dirs'] += [options.__dict__[shared_lib + '_includes']]
@@ -1354,7 +1358,12 @@ def configure_intl(o):
if pkgicu[0] is None:
error('''Could not load pkg-config data for "icu-i18n".
See above errors or the README.md.''')
- (libs, cflags, libpath) = pkgicu
+ (libs, cflags, libpath, icuversion) = pkgicu
+ icu_ver_major = icuversion.split('.')[0]
+ o['variables']['icu_ver_major'] = icu_ver_major
+ if int(icu_ver_major) < icu_versions['minimum_icu']:
+ error('icu4c v%s is too old, v%d.x or later is required.' %
+ (icuversion, icu_versions['minimum_icu']))
# libpath provides linker path which may contain spaces
if libpath:
o['libraries'] += [libpath]
@@ -1473,9 +1482,9 @@ def configure_intl(o):
icu_ver_major = m.group(1)
if not icu_ver_major:
error('Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h)
- elif int(icu_ver_major) < icu_versions["minimum_icu"]:
- error('icu4c v%d.x is too old, v%d.x or later is required.' % (int(icu_ver_major),
- icu_versions["minimum_icu"]))
+ elif int(icu_ver_major) < icu_versions['minimum_icu']:
+ error('icu4c v%s.x is too old, v%d.x or later is required.' %
+ (icu_ver_major, icu_versions['minimum_icu']))
icu_endianness = sys.byteorder[0];
o['variables']['icu_ver_major'] = icu_ver_major
o['variables']['icu_endianness'] = icu_endianness