From 2aeb0da81337c5b93d880ccb50da2647468a1ca0 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 14 Jan 2013 10:23:14 -0800 Subject: [PATCH 1/2] iwyu - fixes msvc compile --- include/mapnik/image_filter_types.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index 0a7185019..7ad8a4d0a 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -30,6 +30,8 @@ // stl #include #include +#include +#include // for std::back_insert_iterator namespace mapnik { namespace filter { From 7c5693c169d8805b86be69b02056e51c2089557f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 14 Jan 2013 16:07:38 -0800 Subject: [PATCH 2/2] scons: make python includes a list and sensitive to platform specific directories - closes #1691 and fixes mapnik/mapnik-packaging#66 --- SConstruct | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 47ae0eb92..cfc77df43 100644 --- a/SConstruct +++ b/SConstruct @@ -963,6 +963,7 @@ if not preconfigured: env['PLUGINS'] = PLUGINS env['EXTRA_FREETYPE_LIBS'] = [] env['SQLITE_LINKFLAGS'] = [] + env['PYTHON_INCLUDES'] = [] # previously a leading / was expected for LIB_DIR_NAME # now strip it to ensure expected behavior if env['LIB_DIR_NAME'].startswith(os.path.sep): @@ -1350,7 +1351,14 @@ if not preconfigured: py_includes = '''%s -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())"''' % env['PYTHON'] else: py_includes = '''%s -c "from distutils.sysconfig import get_python_inc; print get_python_inc()"''' % env['PYTHON'] - env['PYTHON_INCLUDES'] = call(py_includes) + env['PYTHON_INCLUDES'].append(call(py_includes)) + + # also append platform specific includes + if py3: + py_plat_includes = '''%s -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(plat_specific=True))"''' % env['PYTHON'] + else: + py_plat_includes = '''%s -c "from distutils.sysconfig import get_python_inc; print get_python_inc(plat_specific=True)"''' % env['PYTHON'] + env['PYTHON_INCLUDES'].append(call(py_plat_includes)) # Note: we use the plat_specific argument here to make sure to respect the arch-specific site-packages location if py3: @@ -1361,7 +1369,7 @@ if not preconfigured: else: env['PYTHON_SYS_PREFIX'] = os.popen('''%s -c "import sys; print sys.prefix"''' % env['PYTHON']).read().strip() env['PYTHON_VERSION'] = os.popen('''%s -c "import sys; print sys.version"''' % env['PYTHON']).read()[0:3] - env['PYTHON_INCLUDES'] = env['PYTHON_SYS_PREFIX'] + '/include/python' + env['PYTHON_VERSION'] + env['PYTHON_INCLUDES'] = [env['PYTHON_SYS_PREFIX'] + '/include/python' + env['PYTHON_VERSION']] env['PYTHON_SITE_PACKAGES'] = env['DESTDIR'] + os.path.sep + env['PYTHON_SYS_PREFIX'] + os.path.sep + env['LIBDIR_SCHEMA'] + '/python' + env['PYTHON_VERSION'] + '/site-packages/' # if user-requested custom prefix fall back to manual concatenation for building subdirectories @@ -1527,7 +1535,8 @@ if not preconfigured: # as they are later set in the python build.py # ugly hack needed until we have env specific conf backup = env.Clone().Dictionary() - env.AppendUnique(CPPPATH = os.path.realpath(env['PYTHON_INCLUDES'])) + for pyinc in env['PYTHON_INCLUDES']: + env.AppendUnique(CPPPATH = os.path.realpath(pyinc)) if not conf.CheckHeader(header='Python.h',language='C'): color_print(1,'Could not find required header files for the Python language (version %s)' % env['PYTHON_VERSION'])