scons: define OPTIONAL_LIBSHEADERS before use

Fixes #4075
This commit is contained in:
Mickey Rose 2019-09-01 10:25:46 +02:00
parent d5856a2e9d
commit 0d68464194

View file

@ -1392,6 +1392,7 @@ if not preconfigured:
[env['ICU_LIB_NAME'],'unicode/unistr.h',True,'C++'], [env['ICU_LIB_NAME'],'unicode/unistr.h',True,'C++'],
['harfbuzz', 'harfbuzz/hb.h',True,'C++'] ['harfbuzz', 'harfbuzz/hb.h',True,'C++']
] ]
OPTIONAL_LIBSHEADERS = []
if env.get('FREETYPE_LIBS') or env.get('FREETYPE_INCLUDES'): if env.get('FREETYPE_LIBS') or env.get('FREETYPE_INCLUDES'):
REQUIRED_LIBSHEADERS.insert(0,['freetype','ft2build.h',True,'C']) REQUIRED_LIBSHEADERS.insert(0,['freetype','ft2build.h',True,'C'])
@ -1414,9 +1415,7 @@ if not preconfigured:
except OSError as e: except OSError as e:
pass pass
# libxml2 should be optional but is currently not if env['XMLPARSER'] == 'libxml2':
# https://github.com/mapnik/mapnik/issues/913
if env.get('XMLPARSER') and env['XMLPARSER'] == 'libxml2':
if env.get('XML2_LIBS') or env.get('XML2_INCLUDES'): if env.get('XML2_LIBS') or env.get('XML2_INCLUDES'):
OPTIONAL_LIBSHEADERS.insert(0,['libxml2','libxml/parser.h',True,'C']) OPTIONAL_LIBSHEADERS.insert(0,['libxml2','libxml/parser.h',True,'C'])
if env.get('XML2_INCLUDES'): if env.get('XML2_INCLUDES'):
@ -1436,8 +1435,6 @@ if not preconfigured:
else: else:
env['SKIPPED_DEPS'].extend(['dlfcn']) env['SKIPPED_DEPS'].extend(['dlfcn'])
OPTIONAL_LIBSHEADERS = []
if env['JPEG']: if env['JPEG']:
OPTIONAL_LIBSHEADERS.append(['jpeg', ['stdio.h', 'jpeglib.h'], False,'C','-DHAVE_JPEG']) OPTIONAL_LIBSHEADERS.append(['jpeg', ['stdio.h', 'jpeglib.h'], False,'C','-DHAVE_JPEG'])
inc_path = env['%s_INCLUDES' % 'JPEG'] inc_path = env['%s_INCLUDES' % 'JPEG']