finish complete removal of any trace of cairomm/libsigc++ - amends f25d4d9279 and closes #1681

This commit is contained in:
Dane Springmeyer 2013-01-09 12:49:39 -08:00
parent f135bd325e
commit 94ff584190
7 changed files with 48 additions and 64 deletions

View file

@ -63,8 +63,6 @@ Optional dependencies:
* Cairo - Graphics library for PDF, PS, and SVG formats
- pkg-config - Required for building with cairo support
- libsigc++ - C++ support for cairomm
- cairomm - C++ bindings for cairo
- pycairo - Python bindings for cairo
* libpq - PostgreSQL libraries (For PostGIS plugin support)
* libgdal - GDAL/OGR input (For gdal and ogr plugin support)

View file

@ -49,7 +49,7 @@ SCONF_TEMP_DIR = '.sconf_temp'
# auto-search directories for boost libs/headers
BOOST_SEARCH_PREFIXES = ['/usr/local','/opt/local','/sw','/usr',]
BOOST_MIN_VERSION = '1.47'
#CAIROMM_MIN_VERSION = '1.8.0'
#CAIRO_MIN_VERSION = '1.8.0'
DEFAULT_LINK_PRIORITY = ['internal','other','frameworks','user','system']
@ -60,8 +60,6 @@ pretty_dep_names = {
'ogr':'OGR-enabled GDAL C++ Library | configured using gdal-config program | try setting GDAL_CONFIG SCons option | more info: https://github.com/mapnik/mapnik/wiki//OGR',
'geos_c':'GEOS Simple Geometry Specification C Library | configured with GEOS_LIB & GEOS_INCLUDE | more info: https://github.com/mapnik/mapnik/wiki//GEOS',
'cairo':'Cairo C library | configured using pkg-config | try setting PKG_CONFIG_PATH SCons option',
#'cairomm':'Cairomm C++ bindings to Cairo library | configured using pkg-config | try setting PKG_CONFIG_PATH SCons option',
#'cairomm-version':'Cairomm version is too old (so cairo renderer will not be built), you need at least %s' % CAIROMM_MIN_VERSION,
'pycairo':'Python bindings to Cairo library | configured using pkg-config | try setting PKG_CONFIG_PATH SCons option',
'proj':'Proj.4 C Projections library | configure with PROJ_LIBS & PROJ_INCLUDES | more info: http://trac.osgeo.org/proj/',
'pg':'Postgres C Library requiered for PostGIS plugin | configure with pg_config program | more info: https://github.com/mapnik/mapnik/wiki//PostGIS',
@ -330,7 +328,7 @@ opts.AddVariables(
# Variables for optional dependencies
('GEOS_CONFIG', 'The path to the geos-config executable.', 'geos-config'),
# Note: cairo, cairomm, and pycairo all optional but configured automatically through pkg-config
# Note: cairo and and pycairo are optional but configured automatically through pkg-config
# Therefore, we use a single boolean for whether to attempt to build cairo support.
BoolVariable('CAIRO', 'Attempt to build with Cairo rendering support', 'True'),
PathVariable('CAIRO_INCLUDES', 'Search path for cairo include files', '',PathVariable.PathAccept),
@ -425,9 +423,9 @@ pickle_store = [# Scons internal variables
'EXTRA_FREETYPE_LIBS',
'LIBMAPNIK_CPPATHS',
'LIBMAPNIK_CXXFLAGS',
'CAIROMM_LIBPATHS',
'CAIROMM_LINKFLAGS',
'CAIROMM_CPPPATHS',
'CAIRO_LIBPATHS',
'CAIRO_LINKFLAGS',
'CAIRO_CPPPATHS',
'SVG_RENDERER',
'SQLITE_LINKFLAGS',
'BOOST_LIB_VERSION_FROM_HEADER',
@ -954,9 +952,9 @@ if not preconfigured:
env['MISSING_DEPS'] = []
env['SKIPPED_DEPS'] = []
env['HAS_CAIRO'] = False
env['CAIROMM_LIBPATHS'] = []
env['CAIROMM_LINKFLAGS'] = []
env['CAIROMM_CPPPATHS'] = []
env['CAIRO_LIBPATHS'] = []
env['CAIRO_LINKFLAGS'] = []
env['CAIRO_CPPPATHS'] = []
env['HAS_PYCAIRO'] = False
env['HAS_LIBXML2'] = False
env['LIBMAPNIK_LIBS'] = []
@ -1268,29 +1266,25 @@ if not preconfigured:
if env['CAIRO_LIBS'] or env['CAIRO_INCLUDES']:
c_inc = env['CAIRO_INCLUDES']
if env['CAIRO_LIBS']:
env["CAIROMM_LIBPATHS"].append(os.path.realpath(env['CAIRO_LIBS']))
env["CAIRO_LIBPATHS"].append(os.path.realpath(env['CAIRO_LIBS']))
if not env['CAIRO_INCLUDES']:
c_inc = env['CAIRO_LIBS'].replace('lib','',1)
if c_inc:
c_inc = os.path.normpath(os.path.realpath(env['CAIRO_INCLUDES']))
if c_inc.endswith('include'):
c_inc = os.path.dirname(c_inc)
env["CAIROMM_CPPPATHS"].extend(
env["CAIRO_CPPPATHS"].extend(
[
#os.path.join(c_inc,'include/cairomm-1.0'),
#os.path.join(c_inc,'lib/cairomm-1.0/include'),
os.path.join(c_inc,'include/cairo'),
#os.path.join(c_inc,'include/sigc++-2.0'),
#os.path.join(c_inc,'lib/sigc++-2.0/include'),
os.path.join(c_inc,'include/pixman-1'),
#os.path.join(c_inc,'include/freetype2'),
#os.path.join(c_inc,'include/libpng'),
]
)
env["CAIROMM_LINKFLAGS"] = ['cairo']
env["CAIRO_LINKFLAGS"] = ['cairo']
if env['RUNTIME_LINK'] == 'static':
env["CAIROMM_LINKFLAGS"].extend(
['sigc-2.0','pixman-1','expat','fontconfig','iconv']
env["CAIRO_LINKFLAGS"].extend(
['pixman-1','expat','fontconfig','iconv']
)
# todo - run actual checkLib?
env['HAS_CAIRO'] = True
@ -1299,40 +1293,32 @@ if not preconfigured:
env['HAS_CAIRO'] = False
env['SKIPPED_DEPS'].append('pkg-config')
env['SKIPPED_DEPS'].append('cairo')
#env['SKIPPED_DEPS'].append('cairomm')
elif not conf.CheckPKG('cairo'):
env['HAS_CAIRO'] = False
env['SKIPPED_DEPS'].append('cairo')
#elif not conf.CheckPKG('cairomm-1.0'):
# env['HAS_CAIRO'] = False
# env['SKIPPED_DEPS'].append('cairomm')
#elif not conf.CheckPKGVersion('cairomm-1.0',CAIROMM_MIN_VERSION):
# env['HAS_CAIRO'] = False
# env['SKIPPED_DEPS'].append('cairomm-version')
#else:
# print 'Checking for cairo/cairomm lib and include paths... ',
# cmd = 'pkg-config --libs --cflags cairomm-1.0'
# if env['RUNTIME_LINK'] == 'static':
# cmd += ' --static'
# cairo_env = env.Clone()
# try:
# cairo_env.ParseConfig(cmd)
# for lib in cairo_env['LIBS']:
# if not lib in env['LIBS']:
# env["CAIROMM_LINKFLAGS"].append(lib)
# for lpath in cairo_env['LIBPATH']:
# if not lpath in env['LIBPATH']:
# env["CAIROMM_LIBPATHS"].append(lpath)
# for inc in cairo_env['CPPPATH']:
# if not inc in env['CPPPATH']:
# env["CAIROMM_CPPPATHS"].append(inc)
# env['HAS_CAIRO'] = True
# print 'yes'
# except OSError,e:
# color_print(1,'no')
# env['SKIPPED_DEPS'].append('cairo')
# env['SKIPPED_DEPS'].append('cairomm')
# color_print(1,'pkg-config reported: %s' % e)
else:
print 'Checking for cairo lib and include paths... ',
cmd = 'pkg-config --libs --cflags cairo'
if env['RUNTIME_LINK'] == 'static':
cmd += ' --static'
cairo_env = env.Clone()
try:
cairo_env.ParseConfig(cmd)
for lib in cairo_env['LIBS']:
if not lib in env['LIBS']:
env["CAIRO_LINKFLAGS"].append(lib)
for lpath in cairo_env['LIBPATH']:
if not lpath in env['LIBPATH']:
env["CAIRO_LIBPATHS"].append(lpath)
for inc in cairo_env['CPPPATH']:
if not inc in env['CPPPATH']:
env["CAIRO_CPPPATHS"].append(inc)
env['HAS_CAIRO'] = True
print 'yes'
except OSError,e:
color_print(1,'no')
env['SKIPPED_DEPS'].append('cairo')
color_print(1,'pkg-config reported: %s' % e)
else:
color_print(4,'Not building with cairo support, pass CAIRO=True to enable')
@ -1621,8 +1607,8 @@ if not HELP_REQUESTED:
rm_path('LIBPATH')
rm_path('CPPPATH')
rm_path('CXXFLAGS')
rm_path('CAIROMM_LIBPATHS')
rm_path('CAIROMM_CPPPATHS')
rm_path('CAIRO_LIBPATHS')
rm_path('CAIRO_CPPPATHS')
if env['PATH_REPLACE']:
searches,replace = env['PATH_REPLACE'].split(':')
@ -1638,8 +1624,8 @@ if not HELP_REQUESTED:
replace_path('LIBPATH',search,replace)
replace_path('CPPPATH',search,replace)
replace_path('CXXFLAGS',search,replace)
replace_path('CAIROMM_LIBPATHS',search,replace)
replace_path('CAIROMM_CPPPATHS',search,replace)
replace_path('CAIRO_LIBPATHS',search,replace)
replace_path('CAIRO_CPPPATHS',search,replace)
# export env so it is available in build.py files
Export('env')

View file

@ -173,10 +173,10 @@ if 'install' in COMMAND_LINE_TARGETS:
if 'uninstall' not in COMMAND_LINE_TARGETS:
if env['HAS_CAIRO']:
py_env.Append(CPPPATH = env['CAIROMM_CPPPATHS'])
py_env.Append(CPPPATH = env['CAIRO_CPPPATHS'])
py_env.Append(CXXFLAGS = '-DHAVE_CAIRO')
if env['PLATFORM'] == 'Darwin':
py_env.Append(LIBS=env['CAIROMM_LINKFLAGS'])
py_env.Append(LIBS=env['CAIRO_LINKFLAGS'])
if env['HAS_PYCAIRO']:
py_env.ParseConfig('pkg-config --cflags pycairo')

View file

@ -198,11 +198,11 @@ source = Split(
)
if env['HAS_CAIRO']:
lib_env.PrependUnique(LIBPATH=env['CAIROMM_LIBPATHS'])
lib_env.Append(LIBS=env['CAIROMM_LINKFLAGS'])
lib_env.PrependUnique(LIBPATH=env['CAIRO_LIBPATHS'])
lib_env.Append(LIBS=env['CAIRO_LINKFLAGS'])
lib_env.Append(CXXFLAGS = '-DHAVE_CAIRO')
libmapnik_cxxflags.append('-DHAVE_CAIRO')
lib_env.PrependUnique(CPPPATH=copy(env['CAIROMM_CPPPATHS']))
lib_env.PrependUnique(CPPPATH=copy(env['CAIRO_CPPPATHS']))
source.insert(0,'cairo_renderer.cpp')
source.insert(0,'cairo_context.cpp')

View file

@ -51,7 +51,7 @@ other_includes += ' '.join(config_env['LIBMAPNIK_CXXFLAGS'])
other_includes += ' '
if config_env['HAS_CAIRO']:
other_includes += ''.join([' -I%s' % i for i in env['CAIROMM_CPPPATHS'] if not i.startswith('#')])
other_includes += ''.join([' -I%s' % i for i in env['CAIRO_CPPPATHS'] if not i.startswith('#')])
ldflags = config_env['CUSTOM_LDFLAGS'] + ''.join([' -L%s' % i for i in config_env['LIBPATH'] if not i.startswith('#')])

View file

@ -38,7 +38,7 @@ source = Split(
program_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS'])
if env['HAS_CAIRO']:
program_env.PrependUnique(CPPPATH=env['CAIROMM_CPPPATHS'])
program_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS'])
program_env.Append(CXXFLAGS = '-DHAVE_CAIRO')
program_env.PrependUnique(CPPPATH=['#plugins/input/postgis'])

View file

@ -36,7 +36,7 @@ source = Split(
program_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS'])
if env['HAS_CAIRO']:
program_env.PrependUnique(CPPPATH=env['CAIROMM_CPPPATHS'])
program_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS'])
program_env.Append(CXXFLAGS = '-DHAVE_CAIRO')
libraries = copy(env['LIBMAPNIK_LIBS'])