diff --git a/SConstruct b/SConstruct index fcba528b2..b68c55c85 100644 --- a/SConstruct +++ b/SConstruct @@ -781,7 +781,6 @@ if not preconfigured: env.Append(CXXFLAGS = '-DHAVE_LIBXML2') 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 else: env['SKIPPED_DEPS'].extend(['cairo','cairomm']) @@ -931,7 +930,6 @@ if not preconfigured: env['MISSING_DEPS'].append('boost python') if env['CAIRO'] and conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'): - env.ParseConfig('pkg-config --cflags pycairo') env['HAS_PYCAIRO'] = True else: env['SKIPPED_DEPS'].extend(['pycairo']) diff --git a/bindings/python/SConscript b/bindings/python/SConscript index 59a629feb..d6b9f9f07 100644 --- a/bindings/python/SConscript +++ b/bindings/python/SConscript @@ -49,7 +49,8 @@ if env['PLATFORM'] == 'Darwin': if env['THREADING'] == 'multi': libraries.append('boost_thread%s' % env['BOOST_APPEND']) 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 ### # Confounding problems are: @@ -144,14 +145,18 @@ if env['SVN_REVISION']: sources.remove('mapnik_python.cpp') env2 = env.Clone() env2.Append(CCFLAGS='-DSVN_REVISION=%s' % env['SVN_REVISION']) - if env['HAS_CAIRO']: - env2.Append(CXXFLAGS = '-DHAVE_CAIRO') - if env['HAS_PYCAIRO']: - env2.Append(CXXFLAGS = '-DHAVE_PYCAIRO') + if env['HAS_CAIRO'] or env['HAS_PYCAIRO']: + if env['HAS_CAIRO']: + env2.ParseConfig('pkg-config --libs --cflags cairomm-1.0') + env2.Append(CXXFLAGS = '-DHAVE_CAIRO') + if env['HAS_PYCAIRO']: + env2.ParseConfig('pkg-config --cflags pycairo') + env2.Append(CXXFLAGS = '-DHAVE_PYCAIRO') sources.insert(0,env2.SharedObject('mapnik_python.cpp')) if env['HAS_CAIRO'] or env['HAS_PYCAIRO']: env2 = env.Clone() + env2.ParseConfig('pkg-config --libs --cflags cairomm-1.0') fixup = ['mapnik_image.cpp','python_cairo.cpp'] for cpp in fixup: if cpp in sources: diff --git a/demo/c++/SConscript b/demo/c++/SConscript index 476894fbd..ccbdbad19 100644 --- a/demo/c++/SConscript +++ b/demo/c++/SConscript @@ -39,7 +39,8 @@ libraries = [boost_thread,'mapnik2'] if env['HAS_CAIRO'] in env['CXXFLAGS']: # 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': libraries.append(boost_regex) diff --git a/src/SConscript b/src/SConscript index 501430924..d4f3f224e 100644 --- a/src/SConscript +++ b/src/SConscript @@ -40,7 +40,8 @@ libraries = ['freetype','ltdl','png','tiff','z','jpeg','proj',env['ICU_LIB_NAME' if env['HAS_CAIRO']: # 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': libraries.append('xml2') @@ -146,9 +147,10 @@ if True : # agg backend """ ) -if 'cairo' in env['LIBS']: +if env['HAS_CAIRO']: env2 = env.Clone() env2.Append(CXXFLAGS = '-DHAVE_CAIRO') + env2.ParseConfig('pkg-config --libs --cflags cairomm-1.0') fixup = ['cairo_renderer.cpp','graphics.cpp','image_util.cpp'] for cpp in fixup: if cpp in source: