Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: make configure.py compatible with python 3 #25580

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,8 @@ def configure_library(lib, output):
if options.__dict__[shared_lib + '_includes']:
output['include_dirs'] += [options.__dict__[shared_lib + '_includes']]
elif pkg_cflags:
output['include_dirs'] += (
filter(None, map(str.strip, pkg_cflags.split('-I'))))
stripped_flags = [flag.strip() for flag in pkg_cflags.split('-I')]
output['include_dirs'] += [flag for flag in stripped_flags if flag]

# libpath needs to be provided ahead libraries
if options.__dict__[shared_lib + '_libpath']:
Expand All @@ -1156,7 +1156,7 @@ def configure_library(lib, output):
output['libraries'] += [pkg_libpath]

default_libs = getattr(options, shared_lib + '_libname')
default_libs = map('-l{0}'.format, default_libs.split(','))
default_libs = ['-l{0}'.format(lib) for lib in default_libs.split(',')]

if default_libs:
output['libraries'] += default_libs
Expand Down Expand Up @@ -1382,7 +1382,8 @@ def write_config(data, name):
# safe to split, cannot contain spaces
o['libraries'] += libs.split()
if cflags:
o['include_dirs'] += filter(None, map(str.strip, cflags.split('-I')))
stripped_flags = [flag.strip() for flag in cflags.split('-I')]
o['include_dirs'] += [flag for flag in stripped_flags if flag]
# use the "system" .gyp
o['variables']['icu_gyp_path'] = 'tools/icu/icu-system.gyp'
return
Expand Down Expand Up @@ -1663,7 +1664,7 @@ def make_bin_override():
if options.prefix:
config['PREFIX'] = options.prefix

config = '\n'.join(map('='.join, config.iteritems())) + '\n'
config = '\n'.join(['='.join(item) for item in config.items()]) + '\n'

# On Windows there's no reason to search for a different python binary.
bin_override = None if sys.platform == 'win32' else make_bin_override()
Expand Down