scons: collect pycairo flags at configure time

This commit is contained in:
Dane Springmeyer 2015-02-02 18:59:29 -08:00
parent 8d956f3018
commit f0b0ee3e7e
2 changed files with 11 additions and 1 deletions

View file

@ -450,6 +450,7 @@ pickle_store = [# Scons internal variables
'HAS_CAIRO',
'MAPNIK_HAS_DLFCN',
'HAS_PYCAIRO',
'PYCAIRO_PATHS',
'HAS_LIBXML2',
'PYTHON_IS_64BIT',
'SAMPLE_INPUT_PLUGINS',
@ -1094,6 +1095,7 @@ if not preconfigured:
env['CAIRO_ALL_LIBS'] = []
env['CAIRO_CPPPATHS'] = []
env['HAS_PYCAIRO'] = False
env['PYCAIRO_PATHS'] = []
env['HAS_LIBXML2'] = False
env['LIBMAPNIK_LIBS'] = []
env['LIBMAPNIK_LINKFLAGS'] = []
@ -1660,6 +1662,13 @@ if not preconfigured:
if env['CAIRO']:
if CHECK_PKG_CONFIG and conf.CheckPKG('pycairo'):
env['HAS_PYCAIRO'] = True
temp_env = env.Clone()
temp_env['CPPPATH'] = []
temp_env.ParseConfig('pkg-config --cflags pycairo')
if temp_env['CPPPATH']:
env['PYCAIRO_PATHS'] = copy(temp_env['CPPPATH'])
else:
print temp_env['CPPPATH']
else:
env['SKIPPED_DEPS'].extend(['pycairo'])
else:

View file

@ -45,6 +45,7 @@ target_path = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + en
target_path_deprecated = os.path.normpath(env['PYTHON_INSTALL_LOCATION'] + os.path.sep + 'mapnik2')
py_env = env.Clone()
py_env.Append(CPPPATH = env['PYTHON_INCLUDES'])
py_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
@ -180,8 +181,8 @@ if 'uninstall' not in COMMAND_LINE_TARGETS:
py_env.Append(LIBS=env['CAIRO_ALL_LIBS'])
if env['HAS_PYCAIRO']:
py_env.ParseConfig('pkg-config --cflags pycairo')
py_env.Append(CPPDEFINES = '-DHAVE_PYCAIRO')
py_env.Append(CPPPATH = env['PYCAIRO_PATHS'])
py_env.Append(LINKFLAGS=python_link_flag)
py_env.AppendUnique(LIBS='mapnik-json')