scons: define OPTIONAL_LIBSHEADERS before use

Refs #4075

(cherry picked from commit 0d68464194)
This commit is contained in:
Mickey Rose 2019-09-01 10:25:46 +02:00
parent b541c3595f
commit f6fda91717

View file

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