2005-06-17 14:40:51 +02:00
|
|
|
#
|
2006-03-31 12:32:02 +02:00
|
|
|
# This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
#
|
|
|
|
# Copyright (C) 2006 Artem Pavlenko, Jean-Francois Doyon
|
|
|
|
#
|
|
|
|
# Mapnik is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
#
|
2013-01-09 18:00:30 +01:00
|
|
|
#
|
2005-06-17 14:40:51 +02:00
|
|
|
|
2006-03-31 12:32:02 +02:00
|
|
|
|
2008-01-03 13:16:27 +01:00
|
|
|
import os
|
2011-04-02 05:11:42 +02:00
|
|
|
import sys
|
2010-08-26 03:21:47 +02:00
|
|
|
import glob
|
2011-08-12 22:01:09 +02:00
|
|
|
from copy import copy
|
2010-08-26 03:21:47 +02:00
|
|
|
from subprocess import Popen, PIPE
|
2005-06-14 17:06:59 +02:00
|
|
|
|
2006-02-01 00:09:52 +01:00
|
|
|
Import('env')
|
2005-06-14 17:06:59 +02:00
|
|
|
|
2010-09-18 20:02:15 +02:00
|
|
|
lib_env = env.Clone()
|
|
|
|
|
2010-08-26 03:21:47 +02:00
|
|
|
def call(cmd, silent=True):
|
|
|
|
stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
|
|
|
|
if not stderr:
|
|
|
|
return stdin.strip()
|
|
|
|
elif not silent:
|
|
|
|
print stderr
|
|
|
|
|
|
|
|
def ldconfig(*args,**kwargs):
|
|
|
|
call('ldconfig')
|
|
|
|
|
2011-08-12 22:01:09 +02:00
|
|
|
if env['LINKING'] == 'static':
|
|
|
|
lib_env.Append(CXXFLAGS="-fPIC")
|
2009-03-30 22:47:26 +02:00
|
|
|
|
2011-08-12 22:01:09 +02:00
|
|
|
mapnik_lib_link_flag = ''
|
2011-08-30 01:01:33 +02:00
|
|
|
|
|
|
|
# note: .data gets the actual list to allow a true copy
|
|
|
|
# and avoids unintended pollution of other environments
|
|
|
|
libmapnik_cxxflags = copy(lib_env['CXXFLAGS'].data)
|
2013-03-14 03:49:59 +01:00
|
|
|
libmapnik_defines = copy(lib_env['CPPDEFINES'])
|
2009-04-26 05:33:29 +02:00
|
|
|
|
2011-08-12 22:01:09 +02:00
|
|
|
ABI_VERSION = env['ABI_VERSION']
|
2005-06-14 17:06:59 +02:00
|
|
|
|
2009-06-30 23:58:05 +02:00
|
|
|
filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
|
|
|
|
regex = 'boost_regex%s' % env['BOOST_APPEND']
|
2011-10-26 04:29:51 +02:00
|
|
|
system = 'boost_system%s' % env['BOOST_APPEND']
|
2008-07-29 20:35:27 +02:00
|
|
|
|
2011-08-11 23:11:11 +02:00
|
|
|
# clear out and re-set libs for this env
|
2013-04-10 04:37:02 +02:00
|
|
|
lib_env['LIBS'] = ['freetype','z',env['ICU_LIB_NAME'],filesystem,system,regex]
|
2013-02-23 00:13:39 +01:00
|
|
|
|
|
|
|
if env['PROJ']:
|
|
|
|
lib_env['LIBS'].append('proj')
|
|
|
|
|
|
|
|
if env['PNG']:
|
|
|
|
lib_env['LIBS'].append('png')
|
2011-10-26 04:29:51 +02:00
|
|
|
|
2012-06-05 00:23:08 +02:00
|
|
|
if env['JPEG']:
|
|
|
|
lib_env['LIBS'].append('jpeg')
|
2009-06-30 23:58:05 +02:00
|
|
|
|
2013-02-23 00:13:39 +01:00
|
|
|
if env['TIFF']:
|
|
|
|
lib_env['LIBS'].append('tiff')
|
|
|
|
|
2011-08-29 23:12:22 +02:00
|
|
|
if len(env['EXTRA_FREETYPE_LIBS']):
|
|
|
|
lib_env['LIBS'].extend(copy(env['EXTRA_FREETYPE_LIBS']))
|
2009-06-30 23:58:05 +02:00
|
|
|
|
2011-10-12 05:22:49 +02:00
|
|
|
# libxml2 should be optional but is currently not
|
|
|
|
# https://github.com/mapnik/mapnik/issues/913
|
|
|
|
lib_env['LIBS'].append('xml2')
|
2009-06-30 23:58:05 +02:00
|
|
|
|
|
|
|
if env['THREADING'] == 'multi':
|
2011-08-11 23:11:11 +02:00
|
|
|
lib_env['LIBS'].append('boost_thread%s' % env['BOOST_APPEND'])
|
2012-04-08 03:59:47 +02:00
|
|
|
|
2011-11-02 23:52:31 +01:00
|
|
|
if env['RUNTIME_LINK'] == 'static':
|
2011-11-02 18:55:18 +01:00
|
|
|
if 'icuuc' in env['ICU_LIB_NAME']:
|
|
|
|
lib_env['LIBS'].append('icudata')
|
2012-03-21 23:34:01 +01:00
|
|
|
lib_env['LIBS'].append('icui18n')
|
2011-11-02 23:52:31 +01:00
|
|
|
else:
|
2012-05-25 02:05:51 +02:00
|
|
|
lib_env['LIBS'].insert(0, 'agg')
|
2012-04-08 03:59:47 +02:00
|
|
|
|
2007-03-16 11:11:37 +01:00
|
|
|
if env['PLATFORM'] == 'Darwin':
|
2012-04-23 20:29:50 +02:00
|
|
|
mapnik_libname = env.subst(env['MAPNIK_LIB_NAME'])
|
2009-04-26 05:33:29 +02:00
|
|
|
if env['FULL_LIB_PATH']:
|
2011-08-12 22:01:09 +02:00
|
|
|
lib_path = '%s/%s' % (env['MAPNIK_LIB_BASE'],mapnik_libname)
|
2009-04-26 05:33:29 +02:00
|
|
|
else:
|
2010-07-18 22:39:05 +02:00
|
|
|
lib_path = mapnik_libname
|
2010-09-18 20:02:15 +02:00
|
|
|
mapnik_lib_link_flag += ' -Wl,-install_name,%s' % lib_path
|
2012-03-15 01:26:50 +01:00
|
|
|
_d = {'version':env['MAPNIK_VERSION_STRING'].replace('-pre','')}
|
2010-09-18 20:02:15 +02:00
|
|
|
mapnik_lib_link_flag += ' -current_version %(version)s -compatibility_version %(version)s' % _d
|
2012-04-23 20:29:50 +02:00
|
|
|
else: # unix, non-macos
|
|
|
|
mapnik_libname = env.subst(env['MAPNIK_LIB_NAME']) + (".%d.%d" % (int(ABI_VERSION[0]),int(ABI_VERSION[1])))
|
|
|
|
if env['PLATFORM'] == 'SunOS':
|
|
|
|
if env['CXX'].startswith('CC'):
|
|
|
|
mapnik_lib_link_flag += ' -R. -h %s' % mapnik_libname
|
|
|
|
else:
|
|
|
|
mapnik_lib_link_flag += ' -Wl,-h,%s' % mapnik_libname
|
|
|
|
else: # Linux and others
|
|
|
|
mapnik_lib_link_flag += ' -Wl,-rpath-link,. -Wl,-soname,%s' % mapnik_libname
|
2005-06-14 17:06:59 +02:00
|
|
|
|
|
|
|
source = Split(
|
2005-09-08 15:05:39 +02:00
|
|
|
"""
|
2013-05-22 04:21:35 +02:00
|
|
|
debug_symbolizer.cpp
|
2013-02-21 04:52:54 +01:00
|
|
|
request.cpp
|
2013-01-28 07:47:32 +01:00
|
|
|
well_known_srs.cpp
|
2013-01-04 18:24:35 +01:00
|
|
|
params.cpp
|
2013-01-04 09:07:57 +01:00
|
|
|
image_filter_types.cpp
|
2012-11-04 13:10:05 +01:00
|
|
|
miniz_png.cpp
|
2010-07-14 06:40:33 +02:00
|
|
|
color.cpp
|
2012-07-25 00:43:32 +02:00
|
|
|
css_color_grammar.cpp
|
2012-03-01 19:36:13 +01:00
|
|
|
conversions.cpp
|
2012-03-19 23:42:30 +01:00
|
|
|
image_compositing.cpp
|
2012-08-23 17:13:22 +02:00
|
|
|
image_filter_grammar.cpp
|
2012-07-07 01:45:58 +02:00
|
|
|
image_scaling.cpp
|
2009-12-16 21:02:06 +01:00
|
|
|
box2d.cpp
|
2012-01-20 00:26:15 +01:00
|
|
|
building_symbolizer.cpp
|
2011-12-07 03:23:01 +01:00
|
|
|
datasource_cache.cpp
|
2013-05-16 20:33:23 +02:00
|
|
|
datasource_cache_static.cpp
|
2012-04-08 03:59:47 +02:00
|
|
|
debug.cpp
|
2011-12-20 17:26:30 +01:00
|
|
|
deepcopy.cpp
|
2012-07-24 01:15:27 +02:00
|
|
|
expression_node.cpp
|
|
|
|
expression_grammar.cpp
|
2009-12-16 21:02:06 +01:00
|
|
|
expression_string.cpp
|
2012-02-12 12:46:07 +01:00
|
|
|
expression.cpp
|
2012-07-24 03:12:10 +02:00
|
|
|
transform_expression_grammar.cpp
|
2012-05-27 23:50:09 +02:00
|
|
|
transform_expression.cpp
|
2012-01-18 15:17:39 +01:00
|
|
|
feature_kv_iterator.cpp
|
2012-04-08 03:59:47 +02:00
|
|
|
feature_type_style.cpp
|
2006-10-04 13:22:18 +02:00
|
|
|
font_engine_freetype.cpp
|
2008-06-29 12:58:48 +02:00
|
|
|
font_set.cpp
|
2012-01-19 18:45:24 +01:00
|
|
|
gamma_method.cpp
|
2011-01-26 02:18:40 +01:00
|
|
|
gradient.cpp
|
2005-06-14 17:06:59 +02:00
|
|
|
graphics.cpp
|
|
|
|
image_reader.cpp
|
|
|
|
image_util.cpp
|
|
|
|
layer.cpp
|
2011-09-10 01:46:39 +02:00
|
|
|
line_symbolizer.cpp
|
2006-10-04 13:22:18 +02:00
|
|
|
line_pattern_symbolizer.cpp
|
2005-06-14 17:06:59 +02:00
|
|
|
map.cpp
|
2007-09-25 20:47:12 +02:00
|
|
|
load_map.cpp
|
2005-06-14 17:06:59 +02:00
|
|
|
memory.cpp
|
2010-06-18 17:39:32 +02:00
|
|
|
parse_path.cpp
|
2012-05-27 23:50:09 +02:00
|
|
|
parse_transform.cpp
|
2011-08-31 04:28:14 +02:00
|
|
|
palette.cpp
|
2012-07-25 00:43:32 +02:00
|
|
|
path_expression_grammar.cpp
|
2006-10-17 16:12:53 +02:00
|
|
|
placement_finder.cpp
|
2005-06-14 17:06:59 +02:00
|
|
|
plugin.cpp
|
2006-02-07 15:41:41 +01:00
|
|
|
point_symbolizer.cpp
|
2006-01-23 14:24:41 +01:00
|
|
|
polygon_pattern_symbolizer.cpp
|
2012-01-12 16:58:10 +01:00
|
|
|
polygon_symbolizer.cpp
|
2012-10-02 00:01:12 +02:00
|
|
|
rule.cpp
|
2006-10-03 12:03:31 +02:00
|
|
|
save_map.cpp
|
2006-10-17 16:12:53 +02:00
|
|
|
shield_symbolizer.cpp
|
2006-10-04 13:22:18 +02:00
|
|
|
text_symbolizer.cpp
|
|
|
|
wkb.cpp
|
2006-10-17 19:26:35 +02:00
|
|
|
projection.cpp
|
|
|
|
proj_transform.cpp
|
2006-10-19 00:44:37 +02:00
|
|
|
distance.cpp
|
|
|
|
scale_denominator.cpp
|
2012-08-16 16:53:38 +02:00
|
|
|
simplify.cpp
|
2006-12-06 21:26:59 +01:00
|
|
|
memory_datasource.cpp
|
2007-09-25 20:47:12 +02:00
|
|
|
stroke.cpp
|
|
|
|
symbolizer.cpp
|
2012-01-29 04:49:02 +01:00
|
|
|
symbolizer_helpers.cpp
|
2008-01-03 12:41:00 +01:00
|
|
|
unicode.cpp
|
2010-06-06 14:10:36 +02:00
|
|
|
markers_symbolizer.cpp
|
2011-05-04 02:20:17 +02:00
|
|
|
raster_colorizer.cpp
|
2012-10-02 00:01:12 +02:00
|
|
|
raster_symbolizer.cpp
|
2011-02-24 16:54:59 +01:00
|
|
|
wkt/wkt_factory.cpp
|
2012-08-16 01:44:23 +02:00
|
|
|
wkt/wkt_generator.cpp
|
2011-04-06 15:02:31 +02:00
|
|
|
mapped_memory_cache.cpp
|
2011-04-26 23:44:52 +02:00
|
|
|
marker_cache.cpp
|
2012-08-28 02:58:49 +02:00
|
|
|
svg/svg_parser.cpp
|
|
|
|
svg/svg_path_parser.cpp
|
|
|
|
svg/svg_points_parser.cpp
|
|
|
|
svg/svg_transform_parser.cpp
|
2011-09-16 16:57:40 +02:00
|
|
|
warp.cpp
|
2012-08-17 12:25:21 +02:00
|
|
|
json/geometry_grammar.cpp
|
2012-08-17 13:47:41 +02:00
|
|
|
json/geometry_parser.cpp
|
2012-07-24 02:03:06 +02:00
|
|
|
json/feature_grammar.cpp
|
2012-02-10 12:56:53 +01:00
|
|
|
json/feature_collection_parser.cpp
|
2012-02-20 11:53:58 +01:00
|
|
|
json/geojson_generator.cpp
|
2012-02-17 15:50:24 +01:00
|
|
|
processed_text.cpp
|
|
|
|
formatting/base.cpp
|
2012-02-15 21:35:54 +01:00
|
|
|
formatting/expression.cpp
|
2012-02-17 15:50:24 +01:00
|
|
|
formatting/list.cpp
|
|
|
|
formatting/text.cpp
|
|
|
|
formatting/format.cpp
|
2012-02-17 19:45:13 +01:00
|
|
|
formatting/registry.cpp
|
2012-02-17 20:03:22 +01:00
|
|
|
text_placements/registry.cpp
|
2012-02-17 20:53:00 +01:00
|
|
|
text_placements/base.cpp
|
|
|
|
text_placements/dummy.cpp
|
|
|
|
text_placements/list.cpp
|
|
|
|
text_placements/simple.cpp
|
|
|
|
text_properties.cpp
|
2012-03-05 16:49:54 +01:00
|
|
|
xml_tree.cpp
|
2012-03-08 18:51:23 +01:00
|
|
|
config_error.cpp
|
2012-08-29 19:44:04 +02:00
|
|
|
color_factory.cpp
|
2012-04-08 03:59:47 +02:00
|
|
|
"""
|
2005-06-14 17:06:59 +02:00
|
|
|
)
|
2007-09-25 20:47:12 +02:00
|
|
|
|
2013-05-16 20:33:23 +02:00
|
|
|
if env['PLUGIN_LINKING'] == 'static':
|
2013-05-22 05:18:37 +02:00
|
|
|
hit = False
|
2013-05-16 20:33:23 +02:00
|
|
|
for plugin in env['REQUESTED_PLUGINS']:
|
|
|
|
details = env['PLUGINS'][plugin]
|
|
|
|
if details['lib'] in env['LIBS'] or not details['lib']:
|
2013-05-22 05:18:37 +02:00
|
|
|
hit = True
|
2013-06-02 22:30:46 +02:00
|
|
|
DEF = '-DMAPNIK_STATIC_PLUGIN_%s' % plugin.upper()
|
|
|
|
lib_env.Append(CPPDEFINES = DEF)
|
|
|
|
if DEF not in libmapnik_defines:
|
|
|
|
libmapnik_defines.append(DEF)
|
2013-05-16 20:33:23 +02:00
|
|
|
plugin_env = SConscript('../plugins/input/%s/build.py' % plugin)
|
|
|
|
if plugin_env.has_key('SOURCES') 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']:
|
|
|
|
lib_env.AppendUnique(CPPDEFINES=plugin_env['CPPDEFINES'])
|
|
|
|
if plugin_env.has_key('CXXFLAGS') and plugin_env['CXXFLAGS']:
|
|
|
|
lib_env.AppendUnique(CXXFLAGS=plugin_env['CXXFLAGS'])
|
|
|
|
if plugin_env.has_key('LINKFLAGS') and plugin_env['LINKFLAGS']:
|
|
|
|
lib_env.AppendUnique(LINKFLAGS=plugin_env['LINKFLAGS'])
|
|
|
|
if plugin_env.has_key('CPPPATH') and plugin_env['CPPPATH']:
|
|
|
|
lib_env.AppendUnique(CPPPATH=copy(plugin_env['CPPPATH']))
|
|
|
|
if plugin_env.has_key('LIBS') and plugin_env['LIBS']:
|
|
|
|
lib_env.AppendUnique(LIBS=plugin_env['LIBS'])
|
|
|
|
else:
|
|
|
|
print("Notice: dependencies not met for plugin '%s', not building..." % plugin)
|
2013-05-22 05:18:37 +02:00
|
|
|
if hit:
|
|
|
|
lib_env.Append(CPPDEFINES = '-DMAPNIK_STATIC_PLUGINS')
|
2013-06-02 22:30:46 +02:00
|
|
|
libmapnik_defines.append('-DMAPNIK_STATIC_PLUGINS')
|
2013-05-16 20:33:23 +02:00
|
|
|
|
2011-09-01 23:04:41 +02:00
|
|
|
if env['HAS_CAIRO']:
|
2013-01-11 02:08:58 +01:00
|
|
|
lib_env.AppendUnique(LIBPATH=env['CAIRO_LIBPATHS'])
|
2013-05-16 20:33:23 +02:00
|
|
|
lib_env.Append(LIBS=env['CAIRO_ALL_LIBS'])
|
2013-03-14 03:49:59 +01:00
|
|
|
lib_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
|
|
|
libmapnik_defines.append('-DHAVE_CAIRO')
|
2013-01-11 02:08:58 +01:00
|
|
|
lib_env.AppendUnique(CPPPATH=copy(env['CAIRO_CPPPATHS']))
|
2011-09-01 23:04:41 +02:00
|
|
|
source.insert(0,'cairo_renderer.cpp')
|
2013-01-09 18:00:30 +01:00
|
|
|
source.insert(0,'cairo_context.cpp')
|
2012-01-09 02:21:04 +01:00
|
|
|
|
2010-06-03 23:24:58 +02:00
|
|
|
if env['JPEG']:
|
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
jpeg_reader.cpp
|
|
|
|
""")
|
2012-04-08 03:59:47 +02:00
|
|
|
|
2013-02-23 01:55:02 +01:00
|
|
|
if env['TIFF']:
|
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
tiff_reader.cpp
|
|
|
|
""")
|
|
|
|
|
|
|
|
if env['PNG']:
|
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
png_reader.cpp
|
|
|
|
""")
|
|
|
|
|
2011-04-26 23:44:52 +02:00
|
|
|
# agg backend
|
|
|
|
source += Split(
|
|
|
|
"""
|
2010-06-24 17:57:25 +02:00
|
|
|
agg/agg_renderer.cpp
|
|
|
|
agg/process_building_symbolizer.cpp
|
2010-06-19 22:52:44 +02:00
|
|
|
agg/process_line_symbolizer.cpp
|
2010-06-24 17:57:25 +02:00
|
|
|
agg/process_line_pattern_symbolizer.cpp
|
2010-06-19 23:01:30 +02:00
|
|
|
agg/process_text_symbolizer.cpp
|
2010-06-01 15:31:18 +02:00
|
|
|
agg/process_point_symbolizer.cpp
|
2010-06-19 22:52:44 +02:00
|
|
|
agg/process_polygon_symbolizer.cpp
|
2010-06-20 05:56:03 +02:00
|
|
|
agg/process_polygon_pattern_symbolizer.cpp
|
2010-06-24 17:57:25 +02:00
|
|
|
agg/process_raster_symbolizer.cpp
|
2010-06-01 15:31:18 +02:00
|
|
|
agg/process_shield_symbolizer.cpp
|
|
|
|
agg/process_markers_symbolizer.cpp
|
2012-07-31 23:11:05 +02:00
|
|
|
agg/process_debug_symbolizer.cpp
|
2012-04-08 03:59:47 +02:00
|
|
|
"""
|
2011-04-26 23:44:52 +02:00
|
|
|
)
|
|
|
|
|
2013-02-19 11:06:59 +01:00
|
|
|
# clipper
|
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
../deps/clipper/src/clipper.cpp
|
|
|
|
""")
|
|
|
|
|
2011-08-12 22:01:09 +02:00
|
|
|
if env['RUNTIME_LINK'] == "static":
|
2011-10-12 05:22:49 +02:00
|
|
|
source += glob.glob('../deps/agg/src/' + '*.cpp')
|
2011-08-12 22:01:09 +02:00
|
|
|
|
2011-04-26 23:44:52 +02:00
|
|
|
# grid backend
|
|
|
|
source += Split(
|
|
|
|
"""
|
2012-06-26 17:44:15 +02:00
|
|
|
grid/grid.cpp
|
2011-04-26 23:44:52 +02:00
|
|
|
grid/grid_renderer.cpp
|
|
|
|
grid/process_building_symbolizer.cpp
|
|
|
|
grid/process_line_pattern_symbolizer.cpp
|
|
|
|
grid/process_line_symbolizer.cpp
|
|
|
|
grid/process_markers_symbolizer.cpp
|
|
|
|
grid/process_point_symbolizer.cpp
|
|
|
|
grid/process_polygon_pattern_symbolizer.cpp
|
|
|
|
grid/process_polygon_symbolizer.cpp
|
|
|
|
grid/process_raster_symbolizer.cpp
|
|
|
|
grid/process_shield_symbolizer.cpp
|
2012-04-08 03:59:47 +02:00
|
|
|
grid/process_text_symbolizer.cpp
|
2011-04-26 23:44:52 +02:00
|
|
|
""")
|
|
|
|
|
2012-08-23 19:10:18 +02:00
|
|
|
# https://github.com/mapnik/mapnik/issues/1438
|
2012-11-01 18:07:29 +01:00
|
|
|
if env['SVG_RENDERER']: # svg backend
|
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
svg/output/svg_renderer.cpp
|
|
|
|
svg/output/svg_generator.cpp
|
|
|
|
svg/output/svg_output_attributes.cpp
|
|
|
|
svg/output/process_symbolizers.cpp
|
|
|
|
svg/output/process_building_symbolizer.cpp
|
|
|
|
svg/output/process_line_pattern_symbolizer.cpp
|
|
|
|
svg/output/process_line_symbolizer.cpp
|
|
|
|
svg/output/process_markers_symbolizer.cpp
|
|
|
|
svg/output/process_point_symbolizer.cpp
|
|
|
|
svg/output/process_polygon_pattern_symbolizer.cpp
|
|
|
|
svg/output/process_polygon_symbolizer.cpp
|
|
|
|
svg/output/process_raster_symbolizer.cpp
|
|
|
|
svg/output/process_shield_symbolizer.cpp
|
|
|
|
svg/output/process_text_symbolizer.cpp
|
|
|
|
""")
|
2013-03-14 03:49:59 +01:00
|
|
|
lib_env.Append(CPPDEFINES = '-DSVG_RENDERER')
|
|
|
|
libmapnik_defines.append('-DSVG_RENDERER')
|
2010-05-27 13:19:09 +02:00
|
|
|
|
2012-12-18 04:13:00 +01:00
|
|
|
|
|
|
|
if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
|
|
|
|
boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1])
|
|
|
|
if boost_version_from_header < 46:
|
|
|
|
# avoid ubuntu issue with boost interprocess:
|
|
|
|
# https://github.com/mapnik/mapnik/issues/1001
|
|
|
|
env4 = lib_env.Clone()
|
|
|
|
env4.Append(CXXFLAGS = '-fpermissive')
|
|
|
|
cpp ='mapped_memory_cache.cpp'
|
|
|
|
source.remove(cpp)
|
|
|
|
if env['LINKING'] == 'static':
|
|
|
|
source.insert(0,env4.StaticObject(cpp))
|
|
|
|
else:
|
|
|
|
source.insert(0,env4.SharedObject(cpp))
|
|
|
|
|
2011-10-12 05:22:49 +02:00
|
|
|
if env['XMLPARSER'] == 'libxml2' and env['HAS_LIBXML2']:
|
2007-09-25 20:47:12 +02:00
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
libxml2_loader.cpp
|
|
|
|
""")
|
2010-09-18 20:02:15 +02:00
|
|
|
env2 = lib_env.Clone()
|
2013-03-14 03:49:59 +01:00
|
|
|
env2.Append(CPPDEFINES = '-DHAVE_LIBXML2')
|
|
|
|
libmapnik_defines.append('-DHAVE_LIBXML2')
|
2012-03-13 09:02:53 +01:00
|
|
|
fixup = ['libxml2_loader.cpp']
|
2010-07-15 02:20:50 +02:00
|
|
|
for cpp in fixup:
|
|
|
|
if cpp in source:
|
|
|
|
source.remove(cpp)
|
2011-08-11 23:11:11 +02:00
|
|
|
if env['LINKING'] == 'static':
|
|
|
|
source.insert(0,env2.StaticObject(cpp))
|
|
|
|
else:
|
|
|
|
source.insert(0,env2.SharedObject(cpp))
|
2012-03-13 09:02:53 +01:00
|
|
|
else:
|
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
rapidxml_loader.cpp
|
|
|
|
"""
|
|
|
|
)
|
2007-09-25 20:47:12 +02:00
|
|
|
|
2012-12-18 04:13:00 +01:00
|
|
|
processor_cpp = 'feature_style_processor.cpp'
|
|
|
|
|
|
|
|
if env['RENDERING_STATS']:
|
|
|
|
env3 = lib_env.Clone()
|
2013-03-14 03:49:59 +01:00
|
|
|
env3.Append(CPPDEFINES='-DRENDERING_STATS')
|
2012-12-18 04:13:00 +01:00
|
|
|
if env['LINKING'] == 'static':
|
|
|
|
source.insert(0,env3.StaticObject(processor_cpp))
|
|
|
|
else:
|
|
|
|
source.insert(0,env3.SharedObject(processor_cpp))
|
|
|
|
else:
|
|
|
|
source.insert(0,processor_cpp);
|
|
|
|
|
2013-05-16 20:33:23 +02:00
|
|
|
# clone the env one more time to isolate mapnik_lib_link_flag
|
|
|
|
lib_env_final = lib_env.Clone()
|
|
|
|
|
2010-09-18 20:02:15 +02:00
|
|
|
if env['CUSTOM_LDFLAGS']:
|
2013-05-16 20:33:23 +02:00
|
|
|
lib_env_final.Prepend(LINKFLAGS='%s %s' % (env['CUSTOM_LDFLAGS'], mapnik_lib_link_flag))
|
2010-09-18 20:02:15 +02:00
|
|
|
else:
|
2013-05-16 20:33:23 +02:00
|
|
|
lib_env_final.Prepend(LINKFLAGS=mapnik_lib_link_flag)
|
2010-07-19 21:48:34 +02:00
|
|
|
|
2011-08-29 23:12:22 +02:00
|
|
|
# cache library values for other builds to use
|
2011-08-12 22:01:09 +02:00
|
|
|
env['LIBMAPNIK_LIBS'] = copy(lib_env['LIBS'])
|
2013-05-16 20:33:23 +02:00
|
|
|
env['LIBMAPNIK_LINKFLAGS'] = copy(lib_env['LINKFLAGS'])
|
2011-08-29 23:12:22 +02:00
|
|
|
env['LIBMAPNIK_CXXFLAGS'] = libmapnik_cxxflags
|
2013-03-14 03:49:59 +01:00
|
|
|
env['LIBMAPNIK_DEFINES'] = libmapnik_defines
|
2010-07-18 22:39:05 +02:00
|
|
|
|
2012-10-02 03:22:12 +02:00
|
|
|
mapnik = None
|
|
|
|
|
2012-04-23 20:29:50 +02:00
|
|
|
if env['PLATFORM'] == 'Darwin':
|
|
|
|
target_path = env['MAPNIK_LIB_BASE_DEST']
|
|
|
|
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
|
|
|
if env['LINKING'] == 'static':
|
2013-05-16 20:33:23 +02:00
|
|
|
mapnik = lib_env_final.StaticLibrary('mapnik', source)
|
2012-04-23 20:29:50 +02:00
|
|
|
else:
|
2013-05-16 20:33:23 +02:00
|
|
|
mapnik = lib_env_final.SharedLibrary('mapnik', source)
|
2012-04-23 20:29:50 +02:00
|
|
|
result = env.Install(target_path, mapnik)
|
|
|
|
env.Alias(target='install', source=result)
|
|
|
|
|
|
|
|
env['create_uninstall_target'](env, os.path.join(target_path,env.subst(env['MAPNIK_LIB_NAME'])))
|
|
|
|
else:
|
2008-01-03 13:16:27 +01:00
|
|
|
# Symlink command, only works if both files are in same directory
|
|
|
|
def symlink(env, target, source):
|
|
|
|
trgt = str(target[0])
|
|
|
|
src = str(source[0])
|
|
|
|
|
|
|
|
if os.path.islink(trgt) or os.path.exists(trgt):
|
|
|
|
os.remove(trgt)
|
|
|
|
os.symlink(os.path.basename(src), trgt)
|
|
|
|
|
|
|
|
major, minor, micro = ABI_VERSION
|
2012-04-08 03:59:47 +02:00
|
|
|
|
2012-04-23 20:29:50 +02:00
|
|
|
soFile = "%s.%d.%d.%d" % (os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])), int(major), int(minor), int(micro))
|
2011-08-12 22:01:09 +02:00
|
|
|
target = os.path.join(env['MAPNIK_LIB_BASE_DEST'], soFile)
|
2012-04-08 03:59:47 +02:00
|
|
|
|
2010-07-18 22:39:05 +02:00
|
|
|
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
2012-04-24 02:38:01 +02:00
|
|
|
if env['LINKING'] == 'static':
|
2013-05-16 20:33:23 +02:00
|
|
|
mapnik = lib_env_final.StaticLibrary('mapnik', source)
|
2012-04-24 02:38:01 +02:00
|
|
|
else:
|
2013-05-16 20:33:23 +02:00
|
|
|
mapnik = lib_env_final.SharedLibrary('mapnik', source)
|
2012-04-24 02:38:01 +02:00
|
|
|
result = env.InstallAs(target=target, source=mapnik)
|
|
|
|
env.Alias(target='install', source=result)
|
|
|
|
if result:
|
|
|
|
env.AddPostAction(result, ldconfig)
|
2010-08-26 03:21:47 +02:00
|
|
|
|
2008-01-03 13:16:27 +01:00
|
|
|
# Install symlinks
|
2012-04-23 20:29:50 +02:00
|
|
|
target1 = os.path.join(env['MAPNIK_LIB_BASE_DEST'], "%s.%d.%d" % \
|
2012-04-23 20:33:59 +02:00
|
|
|
(os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])),int(major), int(minor)))
|
2012-04-23 20:29:50 +02:00
|
|
|
target2 = os.path.join(env['MAPNIK_LIB_BASE_DEST'], os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])))
|
2010-07-18 22:39:05 +02:00
|
|
|
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
2012-04-24 02:38:01 +02:00
|
|
|
link1 = env.Command(target1, target, symlink)
|
|
|
|
env.Alias(target='install', source=link1)
|
|
|
|
link2 = env.Command(target2, target1, symlink)
|
|
|
|
env.Alias(target='install', source=link2)
|
2010-07-18 22:39:05 +02:00
|
|
|
# delete in reverse order..
|
|
|
|
env['create_uninstall_target'](env, target2)
|
|
|
|
env['create_uninstall_target'](env, target1)
|
2012-08-29 19:44:04 +02:00
|
|
|
env['create_uninstall_target'](env, target)
|
2012-10-02 03:22:12 +02:00
|
|
|
|
2012-12-03 04:15:22 +01:00
|
|
|
# to enable local testing
|
|
|
|
lib_major_minor = "%s.%d.%d" % (os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])), int(major), int(minor))
|
|
|
|
local_lib = os.path.basename(env.subst(env['MAPNIK_LIB_NAME']))
|
|
|
|
if os.path.islink(lib_major_minor) or os.path.exists(lib_major_minor):
|
|
|
|
os.remove(lib_major_minor)
|
|
|
|
os.symlink(local_lib,lib_major_minor)
|
|
|
|
Clean(mapnik,lib_major_minor);
|
|
|
|
|
2012-10-10 19:19:24 +02:00
|
|
|
if not env['RUNTIME_LINK'] == 'static':
|
|
|
|
Depends(mapnik, env.subst('../deps/agg/libagg.a'))
|