fix 'prioritize_linking' option + remove depricated has_key
usage
This commit is contained in:
parent
92150e9ca9
commit
bfb071233e
2 changed files with 15 additions and 15 deletions
16
SConstruct
16
SConstruct
|
@ -246,7 +246,7 @@ def sort_paths(items,priority):
|
|||
path_types['other'].append(i)
|
||||
# build up new list based on priority list
|
||||
for path in priority:
|
||||
if path_types.has_key(path):
|
||||
if path in path_types:
|
||||
dirs = path_types[path]
|
||||
new.extend(dirs)
|
||||
path_types.pop(path)
|
||||
|
@ -554,7 +554,7 @@ elif preconfigured:
|
|||
color_print(4,'Using previous successful configuration...')
|
||||
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
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
@ -564,13 +564,13 @@ color_print(4,'\nWelcome to Mapnik...\n')
|
|||
|
||||
#### Custom Configure Checks ###
|
||||
|
||||
def prioritize_paths(context,silent=True):
|
||||
def prioritize_paths(context, silent=True):
|
||||
env = context.env
|
||||
prefs = env['LINK_PRIORITY'].split(',')
|
||||
if not silent:
|
||||
context.Message( 'Sorting lib and inc compiler paths...')
|
||||
env['LIBPATH'] = sort_paths(env['LIBPATH'],prefs)
|
||||
env['CPPPATH'] = sort_paths(env['CPPPATH'],prefs)
|
||||
env['LIBPATH'] = sort_paths(env['LIBPATH'], prefs)
|
||||
env['CPPPATH'] = sort_paths(env['CPPPATH'], prefs)
|
||||
if silent:
|
||||
context.did_show_result=1
|
||||
ret = context.Result( True )
|
||||
|
@ -1482,7 +1482,7 @@ if not preconfigured:
|
|||
|
||||
# if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests
|
||||
if env['PRIORITIZE_LINKING']:
|
||||
pass#conf.prioritize_paths(silent=True)
|
||||
conf.prioritize_paths(silent=True)
|
||||
|
||||
# test for C++14 support, which is required
|
||||
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 env['PRIORITIZE_LINKING']:
|
||||
pass#conf.prioritize_paths(silent=True)
|
||||
conf.prioritize_paths(silent=True)
|
||||
|
||||
if not env['HOST']:
|
||||
# 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 env['PRIORITIZE_LINKING']:
|
||||
pass#conf.prioritize_paths(silent=True)
|
||||
conf.prioritize_paths(silent=True)
|
||||
|
||||
# finish config stage and pickle results
|
||||
env = conf.Finish()
|
||||
|
|
14
src/build.py
14
src/build.py
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# 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
|
||||
# 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)
|
||||
if DEF not in libmapnik_defines:
|
||||
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']]
|
||||
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'])
|
||||
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'])
|
||||
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'])
|
||||
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']))
|
||||
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'])
|
||||
else:
|
||||
print("Notice: dependencies not met for plugin '%s', not building..." % plugin)
|
||||
|
|
Loading…
Reference in a new issue