2005-06-17 12:40:51 +00:00
|
|
|
#
|
2006-03-31 10:32:02 +00:00
|
|
|
# This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
#
|
2015-06-16 10:49:16 +00:00
|
|
|
# Copyright (C) 2015 Artem Pavlenko
|
2006-03-31 10:32:02 +00:00
|
|
|
#
|
|
|
|
# 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 17:00:30 +00:00
|
|
|
#
|
2005-06-17 12:40:51 +00:00
|
|
|
|
2006-03-31 10:32:02 +00:00
|
|
|
|
2008-01-03 12:16:27 +00:00
|
|
|
import os
|
2011-04-02 03:11:42 +00:00
|
|
|
import sys
|
2010-08-26 01:21:47 +00:00
|
|
|
import glob
|
2011-08-12 20:01:09 +00:00
|
|
|
from copy import copy
|
2010-08-26 01:21:47 +00:00
|
|
|
from subprocess import Popen, PIPE
|
2005-06-14 15:06:59 +00:00
|
|
|
|
2006-01-31 23:09:52 +00:00
|
|
|
Import('env')
|
2005-06-14 15:06:59 +00:00
|
|
|
|
2010-09-18 18:02:15 +00:00
|
|
|
lib_env = env.Clone()
|
|
|
|
|
2010-08-26 01:21:47 +00: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 20:01:09 +00:00
|
|
|
if env['LINKING'] == 'static':
|
|
|
|
lib_env.Append(CXXFLAGS="-fPIC")
|
2009-03-30 20:47:26 +00:00
|
|
|
|
2011-08-12 20:01:09 +00:00
|
|
|
mapnik_lib_link_flag = ''
|
2011-08-29 23:01:33 +00: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 02:49:59 +00:00
|
|
|
libmapnik_defines = copy(lib_env['CPPDEFINES'])
|
2009-04-26 03:33:29 +00:00
|
|
|
|
2011-08-12 20:01:09 +00:00
|
|
|
ABI_VERSION = env['ABI_VERSION']
|
2005-06-14 15:06:59 +00:00
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
enabled_imaging_libraries = []
|
2009-06-30 21:58:05 +00:00
|
|
|
filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
|
|
|
|
regex = 'boost_regex%s' % env['BOOST_APPEND']
|
2011-10-26 02:29:51 +00:00
|
|
|
system = 'boost_system%s' % env['BOOST_APPEND']
|
2008-07-29 18:35:27 +00:00
|
|
|
|
2011-08-11 21:11:11 +00:00
|
|
|
# clear out and re-set libs for this env
|
2014-01-23 08:13:39 +00:00
|
|
|
# note: order matters on linux: see lorder | tsort
|
2014-01-23 08:42:41 +00:00
|
|
|
lib_env['LIBS'] = [filesystem,
|
2014-04-24 21:50:55 +00:00
|
|
|
regex]
|
2013-02-22 23:13:39 +00:00
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
if env['HAS_CAIRO']:
|
|
|
|
lib_env.Append(LIBS=env['CAIRO_ALL_LIBS'])
|
2013-02-22 23:13:39 +00:00
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
# maybe bz2
|
|
|
|
if len(env['EXTRA_FREETYPE_LIBS']):
|
|
|
|
lib_env['LIBS'].extend(copy(env['EXTRA_FREETYPE_LIBS']))
|
|
|
|
|
2013-07-19 16:49:44 +00:00
|
|
|
if '-DHAVE_PNG' in env['CPPDEFINES']:
|
2013-02-22 23:13:39 +00:00
|
|
|
lib_env['LIBS'].append('png')
|
2013-07-19 16:49:44 +00:00
|
|
|
enabled_imaging_libraries.append('png_reader.cpp')
|
2011-10-26 02:29:51 +00:00
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
if '-DMAPNIK_USE_PROJ4' in env['CPPDEFINES']:
|
|
|
|
lib_env['LIBS'].append('proj')
|
|
|
|
|
2013-07-19 16:49:44 +00:00
|
|
|
if '-DHAVE_TIFF' in env['CPPDEFINES']:
|
2013-02-22 23:13:39 +00:00
|
|
|
lib_env['LIBS'].append('tiff')
|
2013-07-19 16:49:44 +00:00
|
|
|
enabled_imaging_libraries.append('tiff_reader.cpp')
|
2013-02-22 23:13:39 +00:00
|
|
|
|
2013-07-19 16:49:44 +00:00
|
|
|
if '-DHAVE_WEBP' in env['CPPDEFINES']:
|
2013-07-19 05:09:17 +00:00
|
|
|
lib_env['LIBS'].append('webp')
|
2013-07-19 16:49:44 +00:00
|
|
|
enabled_imaging_libraries.append('webp_reader.cpp')
|
2013-07-19 05:09:17 +00:00
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
lib_env['LIBS'].append('xml2')
|
|
|
|
|
|
|
|
if '-DBOOST_REGEX_HAS_ICU' in env['CPPDEFINES']:
|
|
|
|
lib_env['LIBS'].append('icui18n')
|
|
|
|
|
|
|
|
lib_env['LIBS'].append(system)
|
|
|
|
|
|
|
|
lib_env['LIBS'].append('harfbuzz')
|
|
|
|
|
2013-07-19 16:49:44 +00:00
|
|
|
if '-DHAVE_JPEG' in env['CPPDEFINES']:
|
2013-07-15 04:19:03 +00:00
|
|
|
lib_env['LIBS'].append('jpeg')
|
2013-07-19 16:49:44 +00:00
|
|
|
enabled_imaging_libraries.append('jpeg_reader.cpp')
|
2013-07-15 04:19:03 +00:00
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
lib_env['LIBS'].append(env['ICU_LIB_NAME'])
|
2009-06-30 21:58:05 +00:00
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
lib_env['LIBS'].append('freetype')
|
2013-06-02 21:56:21 +00:00
|
|
|
|
2011-11-02 22:52:31 +00:00
|
|
|
if env['RUNTIME_LINK'] == 'static':
|
2011-11-02 17:55:18 +00:00
|
|
|
if 'icuuc' in env['ICU_LIB_NAME']:
|
|
|
|
lib_env['LIBS'].append('icudata')
|
2013-06-02 21:56:21 +00:00
|
|
|
|
2014-10-01 04:16:29 +00:00
|
|
|
if env['PLATFORM'] == 'Linux':
|
|
|
|
lib_env['LINKFLAGS'].append('-pthread')
|
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
if env['RUNTIME_LINK'] != 'static':
|
2012-05-25 00:05:51 +00:00
|
|
|
lib_env['LIBS'].insert(0, 'agg')
|
2012-04-08 01:59:47 +00:00
|
|
|
|
2014-01-23 08:13:39 +00:00
|
|
|
lib_env['LIBS'].append('z')
|
|
|
|
|
2015-05-26 20:15:08 +00:00
|
|
|
if env['PLATFORM'] == 'FreeBSD':
|
|
|
|
lib_env['LIBS'].append('pthread')
|
|
|
|
|
2007-03-16 10:11:37 +00:00
|
|
|
if env['PLATFORM'] == 'Darwin':
|
2012-04-23 18:29:50 +00:00
|
|
|
mapnik_libname = env.subst(env['MAPNIK_LIB_NAME'])
|
2009-04-26 03:33:29 +00:00
|
|
|
if env['FULL_LIB_PATH']:
|
2011-08-12 20:01:09 +00:00
|
|
|
lib_path = '%s/%s' % (env['MAPNIK_LIB_BASE'],mapnik_libname)
|
2009-04-26 03:33:29 +00:00
|
|
|
else:
|
2014-01-22 08:10:11 +00:00
|
|
|
lib_path = '@loader_path/'+mapnik_libname
|
2010-09-18 18:02:15 +00:00
|
|
|
mapnik_lib_link_flag += ' -Wl,-install_name,%s' % lib_path
|
2012-03-15 00:26:50 +00:00
|
|
|
_d = {'version':env['MAPNIK_VERSION_STRING'].replace('-pre','')}
|
2010-09-18 18:02:15 +00:00
|
|
|
mapnik_lib_link_flag += ' -current_version %(version)s -compatibility_version %(version)s' % _d
|
2012-04-23 18:29:50 +00:00
|
|
|
else: # unix, non-macos
|
2014-01-21 04:16:08 +00:00
|
|
|
mapnik_libname = env.subst(env['MAPNIK_LIB_NAME'])
|
|
|
|
if env['ENABLE_SONAME']:
|
|
|
|
mapnik_libname = env.subst(env['MAPNIK_LIB_NAME']) + (".%d.%d" % (int(ABI_VERSION[0]),int(ABI_VERSION[1])))
|
2012-04-23 18:29:50 +00:00
|
|
|
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
|
2015-05-11 23:59:00 +00:00
|
|
|
if env['PLATFORM'] != 'FreeBSD':
|
|
|
|
lib_env['LIBS'].append('dl')
|
2014-01-21 04:16:08 +00:00
|
|
|
mapnik_lib_link_flag += ' -Wl,-rpath-link,.'
|
|
|
|
if env['ENABLE_SONAME']:
|
|
|
|
mapnik_lib_link_flag += ' -Wl,-soname,%s' % mapnik_libname
|
|
|
|
if env['FULL_LIB_PATH']:
|
|
|
|
mapnik_lib_link_flag += ' -Wl,-rpath=%s' % env['MAPNIK_LIB_BASE']
|
|
|
|
else:
|
|
|
|
mapnik_lib_link_flag += ' -Wl,-z,origin -Wl,-rpath=\$$ORIGIN'
|
2005-06-14 15:06:59 +00:00
|
|
|
|
|
|
|
source = Split(
|
2005-09-08 13:05:39 +00:00
|
|
|
"""
|
2014-07-25 23:15:18 +00:00
|
|
|
expression_grammar.cpp
|
2013-06-03 02:28:24 +00:00
|
|
|
fs.cpp
|
2013-02-21 03:52:54 +00:00
|
|
|
request.cpp
|
2013-01-28 06:47:32 +00:00
|
|
|
well_known_srs.cpp
|
2013-01-04 17:24:35 +00:00
|
|
|
params.cpp
|
2013-01-04 08:07:57 +00:00
|
|
|
image_filter_types.cpp
|
2012-11-04 12:10:05 +00:00
|
|
|
miniz_png.cpp
|
2010-07-14 04:40:33 +00:00
|
|
|
color.cpp
|
2012-03-01 18:36:13 +00:00
|
|
|
conversions.cpp
|
2015-02-06 21:27:19 +00:00
|
|
|
image_copy.cpp
|
2012-03-19 22:42:30 +00:00
|
|
|
image_compositing.cpp
|
2012-07-06 23:45:58 +00:00
|
|
|
image_scaling.cpp
|
2009-12-16 20:02:06 +00:00
|
|
|
box2d.cpp
|
2011-12-07 02:23:01 +00:00
|
|
|
datasource_cache.cpp
|
2013-05-16 18:33:23 +00:00
|
|
|
datasource_cache_static.cpp
|
2012-04-08 01:59:47 +00:00
|
|
|
debug.cpp
|
2015-04-01 21:18:05 +00:00
|
|
|
geometry_reprojection.cpp
|
2012-07-23 23:15:27 +00:00
|
|
|
expression_node.cpp
|
2009-12-16 20:02:06 +00:00
|
|
|
expression_string.cpp
|
2012-02-12 11:46:07 +00:00
|
|
|
expression.cpp
|
2012-05-27 21:50:09 +00:00
|
|
|
transform_expression.cpp
|
2012-01-18 14:17:39 +00:00
|
|
|
feature_kv_iterator.cpp
|
2013-07-19 19:09:59 +00:00
|
|
|
feature_style_processor.cpp
|
2012-04-08 01:59:47 +00:00
|
|
|
feature_type_style.cpp
|
2014-10-12 23:36:33 +00:00
|
|
|
dasharray_parser.cpp
|
2006-10-04 11:22:18 +00:00
|
|
|
font_engine_freetype.cpp
|
2008-06-29 10:58:48 +00:00
|
|
|
font_set.cpp
|
2014-08-25 14:06:53 +00:00
|
|
|
function_call.cpp
|
2011-01-26 01:18:40 +00:00
|
|
|
gradient.cpp
|
2014-07-25 23:15:18 +00:00
|
|
|
parse_path.cpp
|
2005-06-14 15:06:59 +00:00
|
|
|
image_reader.cpp
|
2015-01-09 21:49:31 +00:00
|
|
|
cairo_io.cpp
|
2015-03-13 15:52:03 +00:00
|
|
|
image.cpp
|
2015-03-13 21:34:49 +00:00
|
|
|
image_view.cpp
|
2015-03-13 22:28:22 +00:00
|
|
|
image_view_any.cpp
|
2015-03-13 15:52:03 +00:00
|
|
|
image_any.cpp
|
2015-05-14 14:35:04 +00:00
|
|
|
image_options.cpp
|
2005-06-14 15:06:59 +00:00
|
|
|
image_util.cpp
|
2015-01-09 00:31:14 +00:00
|
|
|
image_util_jpeg.cpp
|
|
|
|
image_util_png.cpp
|
|
|
|
image_util_tiff.cpp
|
|
|
|
image_util_webp.cpp
|
2005-06-14 15:06:59 +00:00
|
|
|
layer.cpp
|
|
|
|
map.cpp
|
2007-09-25 18:47:12 +00:00
|
|
|
load_map.cpp
|
2011-08-31 02:28:14 +00:00
|
|
|
palette.cpp
|
2014-10-12 23:36:33 +00:00
|
|
|
marker_helpers.cpp
|
|
|
|
transform_expression_grammar.cpp
|
2015-04-06 16:00:03 +00:00
|
|
|
geometry_envelope.cpp
|
2005-06-14 15:06:59 +00:00
|
|
|
plugin.cpp
|
2012-10-01 22:01:12 +00:00
|
|
|
rule.cpp
|
2006-10-03 10:03:31 +00:00
|
|
|
save_map.cpp
|
2006-10-04 11:22:18 +00:00
|
|
|
wkb.cpp
|
2006-10-17 17:26:35 +00:00
|
|
|
projection.cpp
|
|
|
|
proj_transform.cpp
|
2006-10-18 22:44:37 +00:00
|
|
|
scale_denominator.cpp
|
2012-08-16 14:53:38 +00:00
|
|
|
simplify.cpp
|
2014-07-25 23:15:18 +00:00
|
|
|
parse_transform.cpp
|
2006-12-06 20:26:59 +00:00
|
|
|
memory_datasource.cpp
|
2007-09-25 18:47:12 +00:00
|
|
|
symbolizer.cpp
|
2013-11-28 06:50:15 +00:00
|
|
|
symbolizer_keys.cpp
|
2014-07-11 10:53:06 +00:00
|
|
|
symbolizer_enumerations.cpp
|
2008-01-03 11:41:00 +00:00
|
|
|
unicode.cpp
|
2011-05-04 00:20:17 +00:00
|
|
|
raster_colorizer.cpp
|
2011-04-06 13:02:31 +00:00
|
|
|
mapped_memory_cache.cpp
|
2011-04-26 21:44:52 +00:00
|
|
|
marker_cache.cpp
|
2012-08-28 00:58:49 +00:00
|
|
|
svg/svg_parser.cpp
|
|
|
|
svg/svg_path_parser.cpp
|
|
|
|
svg/svg_points_parser.cpp
|
|
|
|
svg/svg_transform_parser.cpp
|
2011-09-16 14:57:40 +00:00
|
|
|
warp.cpp
|
2014-07-25 23:15:18 +00:00
|
|
|
css_color_grammar.cpp
|
2014-11-11 13:29:53 +00:00
|
|
|
vertex_cache.cpp
|
2014-10-02 01:19:26 +00:00
|
|
|
text/font_library.cpp
|
2014-07-28 11:10:34 +00:00
|
|
|
text/text_layout.cpp
|
Improved support for international text
- Implementation by @herm for GSOC 2012 (http://mapnik.org/news/2012/10/06/gsoc2012-status9/)
- C++11 port, improvements, optimizations by @artemp
- Testing and integration with master by @springmeyer
- Thank you to all the support from @behdad along the way
- Thanks for help testing @toton6868, @stephankn, @nirvn, @mfrasca, @simonsonc and many others
Refs: #2073,#2070,#2038,#2037,#1953,#1820,#1819,#1714,#1634,#1547,#1532,#1319,#1208,#1154,#1146
2013-11-22 08:06:32 +00:00
|
|
|
text/text_line.cpp
|
|
|
|
text/itemizer.cpp
|
|
|
|
text/scrptrun.cpp
|
|
|
|
text/face.cpp
|
2014-10-12 20:46:35 +00:00
|
|
|
text/glyph_positions.cpp
|
Improved support for international text
- Implementation by @herm for GSOC 2012 (http://mapnik.org/news/2012/10/06/gsoc2012-status9/)
- C++11 port, improvements, optimizations by @artemp
- Testing and integration with master by @springmeyer
- Thank you to all the support from @behdad along the way
- Thanks for help testing @toton6868, @stephankn, @nirvn, @mfrasca, @simonsonc and many others
Refs: #2073,#2070,#2038,#2037,#1953,#1820,#1819,#1714,#1634,#1547,#1532,#1319,#1208,#1154,#1146
2013-11-22 08:06:32 +00:00
|
|
|
text/placement_finder.cpp
|
2014-07-21 10:19:26 +00:00
|
|
|
text/properties_util.cpp
|
Improved support for international text
- Implementation by @herm for GSOC 2012 (http://mapnik.org/news/2012/10/06/gsoc2012-status9/)
- C++11 port, improvements, optimizations by @artemp
- Testing and integration with master by @springmeyer
- Thank you to all the support from @behdad along the way
- Thanks for help testing @toton6868, @stephankn, @nirvn, @mfrasca, @simonsonc and many others
Refs: #2073,#2070,#2038,#2037,#1953,#1820,#1819,#1714,#1634,#1547,#1532,#1319,#1208,#1154,#1146
2013-11-22 08:06:32 +00:00
|
|
|
text/renderer.cpp
|
|
|
|
text/symbolizer_helpers.cpp
|
|
|
|
text/text_properties.cpp
|
2014-09-11 18:58:26 +00:00
|
|
|
text/font_feature_settings.cpp
|
2013-11-08 04:09:22 +00:00
|
|
|
text/formatting/base.cpp
|
|
|
|
text/formatting/list.cpp
|
|
|
|
text/formatting/text.cpp
|
|
|
|
text/formatting/format.cpp
|
2014-01-30 11:31:47 +00:00
|
|
|
text/formatting/layout.cpp
|
2013-11-08 04:09:22 +00:00
|
|
|
text/formatting/registry.cpp
|
|
|
|
text/placements/registry.cpp
|
|
|
|
text/placements/base.cpp
|
|
|
|
text/placements/dummy.cpp
|
|
|
|
text/placements/list.cpp
|
|
|
|
text/placements/simple.cpp
|
2013-12-19 23:11:35 +00:00
|
|
|
group/group_layout_manager.cpp
|
|
|
|
group/group_rule.cpp
|
2014-01-09 13:42:32 +00:00
|
|
|
group/group_symbolizer_helper.cpp
|
2012-03-05 15:49:54 +00:00
|
|
|
xml_tree.cpp
|
2012-03-08 17:51:23 +00:00
|
|
|
config_error.cpp
|
2012-08-29 17:44:04 +00:00
|
|
|
color_factory.cpp
|
2013-12-05 16:21:55 +00:00
|
|
|
renderer_common.cpp
|
2014-08-05 16:40:15 +00:00
|
|
|
renderer_common/render_pattern.cpp
|
2014-01-10 11:25:47 +00:00
|
|
|
renderer_common/process_group_symbolizer.cpp
|
2015-01-06 11:01:23 +00:00
|
|
|
math.cpp
|
2012-04-08 01:59:47 +00:00
|
|
|
"""
|
2005-06-14 15:06:59 +00:00
|
|
|
)
|
2007-09-25 18:47:12 +00:00
|
|
|
|
2013-05-16 18:33:23 +00:00
|
|
|
if env['PLUGIN_LINKING'] == 'static':
|
2013-05-22 03:18:37 +00:00
|
|
|
hit = False
|
2014-11-11 22:42:53 +00:00
|
|
|
lib_env.AppendUnique(CPPPATH='../plugins/')
|
2013-05-16 18:33:23 +00:00
|
|
|
for plugin in env['REQUESTED_PLUGINS']:
|
|
|
|
details = env['PLUGINS'][plugin]
|
2015-03-05 00:25:15 +00:00
|
|
|
if not details['lib'] or details['lib'] in env['LIBS']:
|
2013-05-16 18:33:23 +00:00
|
|
|
plugin_env = SConscript('../plugins/input/%s/build.py' % plugin)
|
2013-06-02 21:56:21 +00:00
|
|
|
if not plugin_env:
|
|
|
|
print("Notice: no 'plugin_env' variable found for plugin: '%s'" % plugin)
|
|
|
|
else:
|
|
|
|
hit = True
|
|
|
|
DEF = '-DMAPNIK_STATIC_PLUGIN_%s' % plugin.upper()
|
|
|
|
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']:
|
|
|
|
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'])
|
2013-05-16 18:33:23 +00:00
|
|
|
else:
|
|
|
|
print("Notice: dependencies not met for plugin '%s', not building..." % plugin)
|
2013-05-22 03:18:37 +00:00
|
|
|
if hit:
|
|
|
|
lib_env.Append(CPPDEFINES = '-DMAPNIK_STATIC_PLUGINS')
|
2013-06-02 20:30:46 +00:00
|
|
|
libmapnik_defines.append('-DMAPNIK_STATIC_PLUGINS')
|
2013-05-16 18:33:23 +00:00
|
|
|
|
2015-01-28 06:17:30 +00:00
|
|
|
# add these to the compile flags no matter what
|
|
|
|
# to make it safe to try to compile them from Makefile wrapper
|
|
|
|
source += Split("""
|
|
|
|
cairo/process_markers_symbolizer.cpp
|
|
|
|
cairo/process_group_symbolizer.cpp
|
|
|
|
""")
|
|
|
|
|
2011-09-01 21:04:41 +00:00
|
|
|
if env['HAS_CAIRO']:
|
2013-01-11 01:08:58 +00:00
|
|
|
lib_env.AppendUnique(LIBPATH=env['CAIRO_LIBPATHS'])
|
2013-03-14 02:49:59 +00:00
|
|
|
lib_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
|
|
|
|
libmapnik_defines.append('-DHAVE_CAIRO')
|
2013-01-11 01:08:58 +00:00
|
|
|
lib_env.AppendUnique(CPPPATH=copy(env['CAIRO_CPPPATHS']))
|
2015-01-28 06:17:30 +00:00
|
|
|
source += Split("""
|
|
|
|
cairo/cairo_context.cpp
|
|
|
|
cairo/cairo_renderer.cpp
|
|
|
|
cairo/cairo_render_vector.cpp
|
|
|
|
cairo/process_text_symbolizer.cpp
|
|
|
|
cairo/process_line_symbolizer.cpp
|
|
|
|
cairo/process_line_pattern_symbolizer.cpp
|
|
|
|
cairo/process_polygon_symbolizer.cpp
|
|
|
|
cairo/process_polygon_pattern_symbolizer.cpp
|
|
|
|
cairo/process_debug_symbolizer.cpp
|
|
|
|
cairo/process_point_symbolizer.cpp
|
|
|
|
cairo/process_raster_symbolizer.cpp
|
|
|
|
cairo/process_building_symbolizer.cpp
|
|
|
|
""")
|
2012-01-09 01:21:04 +00:00
|
|
|
|
2013-07-19 16:49:44 +00:00
|
|
|
for cpp in enabled_imaging_libraries:
|
|
|
|
source.append(cpp)
|
2013-07-19 05:09:17 +00:00
|
|
|
|
2011-04-26 21:44:52 +00:00
|
|
|
# agg backend
|
|
|
|
source += Split(
|
|
|
|
"""
|
2010-06-24 15:57:25 +00:00
|
|
|
agg/agg_renderer.cpp
|
2014-12-17 05:45:56 +00:00
|
|
|
agg/process_dot_symbolizer.cpp
|
2010-06-24 15:57:25 +00:00
|
|
|
agg/process_building_symbolizer.cpp
|
2010-06-19 20:52:44 +00:00
|
|
|
agg/process_line_symbolizer.cpp
|
2010-06-24 15:57:25 +00:00
|
|
|
agg/process_line_pattern_symbolizer.cpp
|
2010-06-19 21:01:30 +00:00
|
|
|
agg/process_text_symbolizer.cpp
|
2010-06-01 13:31:18 +00:00
|
|
|
agg/process_point_symbolizer.cpp
|
2010-06-19 20:52:44 +00:00
|
|
|
agg/process_polygon_symbolizer.cpp
|
2010-06-20 03:56:03 +00:00
|
|
|
agg/process_polygon_pattern_symbolizer.cpp
|
2010-06-24 15:57:25 +00:00
|
|
|
agg/process_raster_symbolizer.cpp
|
2010-06-01 13:31:18 +00:00
|
|
|
agg/process_shield_symbolizer.cpp
|
|
|
|
agg/process_markers_symbolizer.cpp
|
2013-12-19 23:11:35 +00:00
|
|
|
agg/process_group_symbolizer.cpp
|
2012-07-31 21:11:05 +00:00
|
|
|
agg/process_debug_symbolizer.cpp
|
2012-04-08 01:59:47 +00:00
|
|
|
"""
|
2011-04-26 21:44:52 +00:00
|
|
|
)
|
|
|
|
|
2011-08-12 20:01:09 +00:00
|
|
|
if env['RUNTIME_LINK'] == "static":
|
2011-10-12 03:22:49 +00:00
|
|
|
source += glob.glob('../deps/agg/src/' + '*.cpp')
|
2011-08-12 20:01:09 +00:00
|
|
|
|
2015-01-28 06:18:25 +00:00
|
|
|
# add these to the compile flags no matter what
|
|
|
|
# to make it safe to try to compile them from Makefile wrapper
|
|
|
|
source += Split("""
|
|
|
|
grid/process_markers_symbolizer.cpp
|
|
|
|
grid/process_group_symbolizer.cpp
|
|
|
|
""")
|
|
|
|
|
2011-04-26 21:44:52 +00:00
|
|
|
# grid backend
|
2013-07-24 00:03:00 +00:00
|
|
|
if env['GRID_RENDERER']:
|
2013-07-23 23:37:25 +00:00
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
grid/grid.cpp
|
|
|
|
grid/grid_renderer.cpp
|
|
|
|
grid/process_building_symbolizer.cpp
|
|
|
|
grid/process_line_pattern_symbolizer.cpp
|
|
|
|
grid/process_line_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
|
|
|
|
grid/process_text_symbolizer.cpp
|
|
|
|
""")
|
|
|
|
lib_env.Append(CPPDEFINES = '-DGRID_RENDERER')
|
|
|
|
libmapnik_defines.append('-DGRID_RENDERER')
|
2011-04-26 21:44:52 +00:00
|
|
|
|
2012-08-23 17:10:18 +00:00
|
|
|
# https://github.com/mapnik/mapnik/issues/1438
|
2012-11-01 17:07:29 +00:00
|
|
|
if env['SVG_RENDERER']: # svg backend
|
|
|
|
source += Split(
|
|
|
|
"""
|
2014-09-30 19:50:08 +00:00
|
|
|
svg/output/svg_output_grammars.cpp
|
2012-11-01 17:07:29 +00:00
|
|
|
svg/output/svg_renderer.cpp
|
|
|
|
svg/output/svg_generator.cpp
|
|
|
|
svg/output/svg_output_attributes.cpp
|
|
|
|
svg/output/process_symbolizers.cpp
|
|
|
|
svg/output/process_line_symbolizer.cpp
|
|
|
|
svg/output/process_polygon_symbolizer.cpp
|
|
|
|
""")
|
2013-03-14 02:49:59 +00:00
|
|
|
lib_env.Append(CPPDEFINES = '-DSVG_RENDERER')
|
|
|
|
libmapnik_defines.append('-DSVG_RENDERER')
|
2010-05-27 11:19:09 +00:00
|
|
|
|
2011-10-12 03:22:49 +00:00
|
|
|
if env['XMLPARSER'] == 'libxml2' and env['HAS_LIBXML2']:
|
2007-09-25 18:47:12 +00:00
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
libxml2_loader.cpp
|
|
|
|
""")
|
2014-01-27 20:25:51 +00:00
|
|
|
lib_env.Append(CPPDEFINES = '-DHAVE_LIBXML2')
|
2013-03-14 02:49:59 +00:00
|
|
|
libmapnik_defines.append('-DHAVE_LIBXML2')
|
2012-03-13 08:02:53 +00:00
|
|
|
else:
|
|
|
|
source += Split(
|
|
|
|
"""
|
|
|
|
rapidxml_loader.cpp
|
|
|
|
"""
|
|
|
|
)
|
2007-09-25 18:47:12 +00:00
|
|
|
|
2013-05-16 18:33:23 +00:00
|
|
|
# clone the env one more time to isolate mapnik_lib_link_flag
|
|
|
|
lib_env_final = lib_env.Clone()
|
2013-10-22 20:35:46 +00:00
|
|
|
lib_env_final.Prepend(LINKFLAGS=mapnik_lib_link_flag)
|
2010-07-19 19:48:34 +00:00
|
|
|
|
2011-08-29 21:12:22 +00:00
|
|
|
# cache library values for other builds to use
|
2011-08-12 20:01:09 +00:00
|
|
|
env['LIBMAPNIK_LIBS'] = copy(lib_env['LIBS'])
|
2013-05-16 18:33:23 +00:00
|
|
|
env['LIBMAPNIK_LINKFLAGS'] = copy(lib_env['LINKFLAGS'])
|
2011-08-29 21:12:22 +00:00
|
|
|
env['LIBMAPNIK_CXXFLAGS'] = libmapnik_cxxflags
|
2013-03-14 02:49:59 +00:00
|
|
|
env['LIBMAPNIK_DEFINES'] = libmapnik_defines
|
2010-07-18 20:39:05 +00:00
|
|
|
|
2012-10-02 01:22:12 +00:00
|
|
|
mapnik = None
|
|
|
|
|
2014-01-22 05:34:43 +00:00
|
|
|
if env['PLATFORM'] == 'Darwin' or not env['ENABLE_SONAME']:
|
2012-04-23 18:29:50 +00:00
|
|
|
target_path = env['MAPNIK_LIB_BASE_DEST']
|
|
|
|
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
|
|
|
if env['LINKING'] == 'static':
|
2014-06-09 20:55:56 +00:00
|
|
|
mapnik = lib_env_final.StaticLibrary(env['MAPNIK_NAME'], source)
|
2012-04-23 18:29:50 +00:00
|
|
|
else:
|
2014-06-09 20:55:56 +00:00
|
|
|
mapnik = lib_env_final.SharedLibrary(env['MAPNIK_NAME'], source)
|
2012-04-23 18:29:50 +00: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 12:16:27 +00: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 01:59:47 +00:00
|
|
|
|
2012-04-23 18:29:50 +00:00
|
|
|
soFile = "%s.%d.%d.%d" % (os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])), int(major), int(minor), int(micro))
|
2011-08-12 20:01:09 +00:00
|
|
|
target = os.path.join(env['MAPNIK_LIB_BASE_DEST'], soFile)
|
2012-04-08 01:59:47 +00:00
|
|
|
|
2010-07-18 20:39:05 +00:00
|
|
|
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
2012-04-24 00:38:01 +00:00
|
|
|
if env['LINKING'] == 'static':
|
2014-06-09 20:55:56 +00:00
|
|
|
mapnik = lib_env_final.StaticLibrary(env['MAPNIK_NAME'], source)
|
2012-04-24 00:38:01 +00:00
|
|
|
else:
|
2014-06-09 20:55:56 +00:00
|
|
|
mapnik = lib_env_final.SharedLibrary(env['MAPNIK_NAME'], source)
|
2012-04-24 00:38:01 +00:00
|
|
|
result = env.InstallAs(target=target, source=mapnik)
|
|
|
|
env.Alias(target='install', source=result)
|
|
|
|
if result:
|
|
|
|
env.AddPostAction(result, ldconfig)
|
2010-08-26 01:21:47 +00:00
|
|
|
|
2008-01-03 12:16:27 +00:00
|
|
|
# Install symlinks
|
2012-04-23 18:29:50 +00:00
|
|
|
target1 = os.path.join(env['MAPNIK_LIB_BASE_DEST'], "%s.%d.%d" % \
|
2012-04-23 18:33:59 +00:00
|
|
|
(os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])),int(major), int(minor)))
|
2012-04-23 18:29:50 +00:00
|
|
|
target2 = os.path.join(env['MAPNIK_LIB_BASE_DEST'], os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])))
|
2010-07-18 20:39:05 +00:00
|
|
|
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
2012-04-24 00:38:01 +00: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 20:39:05 +00:00
|
|
|
# delete in reverse order..
|
|
|
|
env['create_uninstall_target'](env, target2)
|
|
|
|
env['create_uninstall_target'](env, target1)
|
2012-08-29 17:44:04 +00:00
|
|
|
env['create_uninstall_target'](env, target)
|
2012-10-02 01:22:12 +00:00
|
|
|
|
2012-12-03 03:15:22 +00: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 17:19:24 +00:00
|
|
|
if not env['RUNTIME_LINK'] == 'static':
|
|
|
|
Depends(mapnik, env.subst('../deps/agg/libagg.a'))
|