scons: make second freetype check conditional on freetype-config availability

This commit is contained in:
Dane Springmeyer 2011-10-29 22:34:38 -07:00
parent 820e1865dc
commit 64d98453f8

View file

@ -1069,15 +1069,17 @@ if not preconfigured:
env.AppendUnique(CPPPATH = os.path.realpath(inc_path))
env.AppendUnique(LIBPATH = os.path.realpath(lib_path))
conf.parse_config('FREETYPE_CONFIG')
# check if freetype links to bz2
if env['RUNTIME_LINK'] == 'static':
temp_env = env.Clone()
temp_env['LIBS'] = []
temp_env.ParseConfig('%s --libs' % env['FREETYPE_CONFIG'])
if 'bz2' in temp_env['LIBS']:
env['EXTRA_FREETYPE_LIBS'].append('bz2')
if conf.parse_config('FREETYPE_CONFIG'):
# check if freetype links to bz2
if env['RUNTIME_LINK'] == 'static':
temp_env = env.Clone()
temp_env['LIBS'] = []
try:
temp_env.ParseConfig('%s --libs' % env['FREETYPE_CONFIG'])
if 'bz2' in temp_env['LIBS']:
env['EXTRA_FREETYPE_LIBS'].append('bz2')
except OSError,e:
pass
# libxml2 should be optional but is currently not
# https://github.com/mapnik/mapnik/issues/913