Make python bindings for cairo work when running with git and not svn

This commit is contained in:
Robert Coup 2011-02-28 21:49:53 +00:00
parent deab48dddc
commit 579f4d7484

View file

@ -153,7 +153,7 @@ py_env.Append(CPPPATH = env['PYTHON_INCLUDES'])
if env['SVN_REVISION']: if env['SVN_REVISION']:
sources.remove('mapnik_python.cpp') sources.remove('mapnik_python.cpp')
env2 = py_env.Clone() env2 = py_env.Clone()
env2.Append(CCFLAGS='-DSVN_REVISION=%s' % env['SVN_REVISION']) env2.Append(CXXFLAGS='-DSVN_REVISION=%s' % env['SVN_REVISION'])
if env['HAS_CAIRO'] or env['HAS_PYCAIRO']: 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.ParseConfig('pkg-config --libs --cflags cairomm-1.0')
@ -164,14 +164,18 @@ if env['SVN_REVISION']:
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']:
# attach libs to _mapnik.so linking environment
py_env.ParseConfig('pkg-config --libs cairomm-1.0')
env2 = py_env.Clone() env2 = py_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']
if not env['SVN_REVISION']:
fixup.append('mapnik_python.cpp')
for cpp in fixup: for cpp in fixup:
if cpp in sources: if cpp in sources:
sources.remove(cpp) sources.remove(cpp)
if env['HAS_CAIRO']: if env['HAS_CAIRO']:
env2.Append(CXXFLAGS = '-DHAVE_CAIRO') env2.Append(CXXFLAGS = '-DHAVE_CAIRO')
env2.ParseConfig('pkg-config --cflags cairomm-1.0')
if env['HAS_PYCAIRO']: if env['HAS_PYCAIRO']:
env2.ParseConfig('pkg-config --cflags pycairo') env2.ParseConfig('pkg-config --cflags pycairo')
env2.Append(CXXFLAGS = '-DHAVE_PYCAIRO') env2.Append(CXXFLAGS = '-DHAVE_PYCAIRO')