scons: only apply HAS_CAIRO & HAS_PYCAIRO flags to cairo related files

This commit is contained in:
Dane Springmeyer 2010-07-14 22:47:34 +00:00
parent 75060190c0
commit d549cfe30a
4 changed files with 16 additions and 10 deletions

View file

@ -781,7 +781,6 @@ if not preconfigured:
env.Append(CXXFLAGS = '-DHAVE_LIBXML2') env.Append(CXXFLAGS = '-DHAVE_LIBXML2')
if env['CAIRO'] and conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('cairomm-1.0'): if env['CAIRO'] and conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('cairomm-1.0'):
env.ParseConfig('pkg-config --libs --cflags cairomm-1.0')
env['HAS_CAIRO'] = True env['HAS_CAIRO'] = True
else: else:
env['SKIPPED_DEPS'].extend(['cairo','cairomm']) env['SKIPPED_DEPS'].extend(['cairo','cairomm'])
@ -931,7 +930,6 @@ if not preconfigured:
env['MISSING_DEPS'].append('boost python') env['MISSING_DEPS'].append('boost python')
if env['CAIRO'] and conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'): if env['CAIRO'] and conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'):
env.ParseConfig('pkg-config --cflags pycairo')
env['HAS_PYCAIRO'] = True env['HAS_PYCAIRO'] = True
else: else:
env['SKIPPED_DEPS'].extend(['pycairo']) env['SKIPPED_DEPS'].extend(['pycairo'])

View file

@ -49,7 +49,8 @@ if env['PLATFORM'] == 'Darwin':
if env['THREADING'] == 'multi': if env['THREADING'] == 'multi':
libraries.append('boost_thread%s' % env['BOOST_APPEND']) libraries.append('boost_thread%s' % env['BOOST_APPEND'])
if env['HAS_CAIRO']: if env['HAS_CAIRO']:
libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')]) libraries.append('cairomm-1.0')
libraries.append('cairo')
##### Python linking on OS X is tricky ### ##### Python linking on OS X is tricky ###
# Confounding problems are: # Confounding problems are:
@ -144,14 +145,18 @@ if env['SVN_REVISION']:
sources.remove('mapnik_python.cpp') sources.remove('mapnik_python.cpp')
env2 = env.Clone() env2 = env.Clone()
env2.Append(CCFLAGS='-DSVN_REVISION=%s' % env['SVN_REVISION']) env2.Append(CCFLAGS='-DSVN_REVISION=%s' % env['SVN_REVISION'])
if env['HAS_CAIRO'] or env['HAS_PYCAIRO']:
if env['HAS_CAIRO']: if env['HAS_CAIRO']:
env2.ParseConfig('pkg-config --libs --cflags cairomm-1.0')
env2.Append(CXXFLAGS = '-DHAVE_CAIRO') env2.Append(CXXFLAGS = '-DHAVE_CAIRO')
if env['HAS_PYCAIRO']: if env['HAS_PYCAIRO']:
env2.ParseConfig('pkg-config --cflags pycairo')
env2.Append(CXXFLAGS = '-DHAVE_PYCAIRO') env2.Append(CXXFLAGS = '-DHAVE_PYCAIRO')
sources.insert(0,env2.SharedObject('mapnik_python.cpp')) sources.insert(0,env2.SharedObject('mapnik_python.cpp'))
if env['HAS_CAIRO'] or env['HAS_PYCAIRO']: if env['HAS_CAIRO'] or env['HAS_PYCAIRO']:
env2 = env.Clone() env2 = env.Clone()
env2.ParseConfig('pkg-config --libs --cflags cairomm-1.0')
fixup = ['mapnik_image.cpp','python_cairo.cpp'] fixup = ['mapnik_image.cpp','python_cairo.cpp']
for cpp in fixup: for cpp in fixup:
if cpp in sources: if cpp in sources:

View file

@ -39,7 +39,8 @@ libraries = [boost_thread,'mapnik2']
if env['HAS_CAIRO'] in env['CXXFLAGS']: if env['HAS_CAIRO'] in env['CXXFLAGS']:
# add cairo and cairomm-1.0 to libs # add cairo and cairomm-1.0 to libs
libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')]) libraries.append('cairomm-1.0')
libraries.append('cairo')
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append(boost_regex) libraries.append(boost_regex)

View file

@ -40,7 +40,8 @@ libraries = ['freetype','ltdl','png','tiff','z','jpeg','proj',env['ICU_LIB_NAME'
if env['HAS_CAIRO']: if env['HAS_CAIRO']:
# add cairo and cairomm-1.0 to libs # add cairo and cairomm-1.0 to libs
libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')]) libraries.append('cairomm-1.0')
libraries.append('cairo')
if env['XMLPARSER'] == 'libxml2': if env['XMLPARSER'] == 'libxml2':
libraries.append('xml2') libraries.append('xml2')
@ -146,9 +147,10 @@ if True : # agg backend
""" """
) )
if 'cairo' in env['LIBS']: if env['HAS_CAIRO']:
env2 = env.Clone() env2 = env.Clone()
env2.Append(CXXFLAGS = '-DHAVE_CAIRO') env2.Append(CXXFLAGS = '-DHAVE_CAIRO')
env2.ParseConfig('pkg-config --libs --cflags cairomm-1.0')
fixup = ['cairo_renderer.cpp','graphics.cpp','image_util.cpp'] fixup = ['cairo_renderer.cpp','graphics.cpp','image_util.cpp']
for cpp in fixup: for cpp in fixup:
if cpp in source: if cpp in source: