fix 'prioritize_linking' option + remove depricated has_key usage

This commit is contained in:
Artem Pavlenko 2017-11-23 11:30:35 +01:00
parent 92150e9ca9
commit bfb071233e
2 changed files with 15 additions and 15 deletions

View file

@ -246,7 +246,7 @@ def sort_paths(items,priority):
path_types['other'].append(i) path_types['other'].append(i)
# build up new list based on priority list # build up new list based on priority list
for path in priority: for path in priority:
if path_types.has_key(path): if path in path_types:
dirs = path_types[path] dirs = path_types[path]
new.extend(dirs) new.extend(dirs)
path_types.pop(path) path_types.pop(path)
@ -554,7 +554,7 @@ elif preconfigured:
color_print(4,'Using previous successful configuration...') color_print(4,'Using previous successful configuration...')
color_print(4,'Re-configure by running "python scons/scons.py configure".') color_print(4,'Re-configure by running "python scons/scons.py configure".')
if env.has_key('COLOR_PRINT') and env['COLOR_PRINT'] == False: if 'COLOR_PRINT' in env and env['COLOR_PRINT'] == False:
color_print = regular_print color_print = regular_print
if sys.platform == "win32": if sys.platform == "win32":
@ -564,13 +564,13 @@ color_print(4,'\nWelcome to Mapnik...\n')
#### Custom Configure Checks ### #### Custom Configure Checks ###
def prioritize_paths(context,silent=True): def prioritize_paths(context, silent=True):
env = context.env env = context.env
prefs = env['LINK_PRIORITY'].split(',') prefs = env['LINK_PRIORITY'].split(',')
if not silent: if not silent:
context.Message( 'Sorting lib and inc compiler paths...') context.Message( 'Sorting lib and inc compiler paths...')
env['LIBPATH'] = sort_paths(env['LIBPATH'],prefs) env['LIBPATH'] = sort_paths(env['LIBPATH'], prefs)
env['CPPPATH'] = sort_paths(env['CPPPATH'],prefs) env['CPPPATH'] = sort_paths(env['CPPPATH'], prefs)
if silent: if silent:
context.did_show_result=1 context.did_show_result=1
ret = context.Result( True ) ret = context.Result( True )
@ -1482,7 +1482,7 @@ if not preconfigured:
# if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests # if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests
if env['PRIORITIZE_LINKING']: if env['PRIORITIZE_LINKING']:
pass#conf.prioritize_paths(silent=True) conf.prioritize_paths(silent=True)
# test for C++14 support, which is required # test for C++14 support, which is required
if not env['HOST'] and not conf.supports_cxx14(): if not env['HOST'] and not conf.supports_cxx14():
@ -1540,7 +1540,7 @@ if not preconfigured:
# if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests # if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests
if env['PRIORITIZE_LINKING']: if env['PRIORITIZE_LINKING']:
pass#conf.prioritize_paths(silent=True) conf.prioritize_paths(silent=True)
if not env['HOST']: if not env['HOST']:
# if the user is not setting custom boost configuration # if the user is not setting custom boost configuration
@ -1962,7 +1962,7 @@ if not preconfigured:
# if requested, sort LIBPATH and CPPPATH one last time before saving... # if requested, sort LIBPATH and CPPPATH one last time before saving...
if env['PRIORITIZE_LINKING']: if env['PRIORITIZE_LINKING']:
pass#conf.prioritize_paths(silent=True) conf.prioritize_paths(silent=True)
# finish config stage and pickle results # finish config stage and pickle results
env = conf.Finish() env = conf.Finish()

View file

@ -1,7 +1,7 @@
# #
# This file is part of Mapnik (c++ mapping toolkit) # This file is part of Mapnik (c++ mapping toolkit)
# #
# Copyright (C) 2015 Artem Pavlenko # Copyright (C) 2017 Artem Pavlenko
# #
# Mapnik is free software; you can redistribute it and/or # Mapnik is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public # modify it under the terms of the GNU Lesser General Public
@ -287,17 +287,17 @@ if env['PLUGIN_LINKING'] == 'static':
lib_env.Append(CPPDEFINES = DEF) lib_env.Append(CPPDEFINES = DEF)
if DEF not in libmapnik_defines: if DEF not in libmapnik_defines:
libmapnik_defines.append(DEF) libmapnik_defines.append(DEF)
if plugin_env.has_key('SOURCES') and plugin_env['SOURCES']: if 'SOURCES' in plugin_env and plugin_env['SOURCES']:
source += ['../plugins/input/%s/%s' % (plugin, src) for src in plugin_env['SOURCES']] source += ['../plugins/input/%s/%s' % (plugin, src) for src in plugin_env['SOURCES']]
if plugin_env.has_key('CPPDEFINES') and plugin_env['CPPDEFINES']: if 'CPPDEFINES' in plugin_env and plugin_env['CPPDEFINES']:
lib_env.AppendUnique(CPPDEFINES=plugin_env['CPPDEFINES']) lib_env.AppendUnique(CPPDEFINES=plugin_env['CPPDEFINES'])
if plugin_env.has_key('CXXFLAGS') and plugin_env['CXXFLAGS']: if 'CXXFLAGS' in plugin_env and plugin_env['CXXFLAGS']:
lib_env.AppendUnique(CXXFLAGS=plugin_env['CXXFLAGS']) lib_env.AppendUnique(CXXFLAGS=plugin_env['CXXFLAGS'])
if plugin_env.has_key('LINKFLAGS') and plugin_env['LINKFLAGS']: if 'LINKFLAGS' in plugin_env and plugin_env['LINKFLAGS']:
lib_env.AppendUnique(LINKFLAGS=plugin_env['LINKFLAGS']) lib_env.AppendUnique(LINKFLAGS=plugin_env['LINKFLAGS'])
if plugin_env.has_key('CPPPATH') and plugin_env['CPPPATH']: if 'CPPPATH' in plugin_env and plugin_env['CPPPATH']:
lib_env.AppendUnique(CPPPATH=copy(plugin_env['CPPPATH'])) lib_env.AppendUnique(CPPPATH=copy(plugin_env['CPPPATH']))
if plugin_env.has_key('LIBS') and plugin_env['LIBS']: if 'LIBS' in plugin_env and plugin_env['LIBS']:
lib_env.AppendUnique(LIBS=plugin_env['LIBS']) lib_env.AppendUnique(LIBS=plugin_env['LIBS'])
else: else:
print("Notice: dependencies not met for plugin '%s', not building..." % plugin) print("Notice: dependencies not met for plugin '%s', not building..." % plugin)