make libxml2 optional dependency (XMLPARSER=libxml2)

This commit is contained in:
artemp 2015-07-30 13:14:37 +02:00
parent f8fd60dc69
commit ffcacf3509
2 changed files with 14 additions and 13 deletions

View file

@ -1266,18 +1266,19 @@ if not preconfigured:
# libxml2 should be optional but is currently not
# https://github.com/mapnik/mapnik/issues/913
if env.get('XML2_LIBS') or env.get('XML2_INCLUDES'):
REQUIRED_LIBSHEADERS.insert(0,['libxml2','libxml/parser.h',True,'C'])
if env.get('XML2_INCLUDES'):
inc_path = env['XML2_INCLUDES']
env.AppendUnique(CPPPATH = fix_path(inc_path))
if env.get('XML2_LIBS'):
lib_path = env['XML2_LIBS']
env.AppendUnique(LIBPATH = fix_path(lib_path))
elif conf.parse_config('XML2_CONFIG',checks='--cflags'):
env['HAS_LIBXML2'] = True
else:
env['MISSING_DEPS'].append('libxml2')
if env.get('XMLPARSER') and 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'):
inc_path = env['XML2_INCLUDES']
env.AppendUnique(CPPPATH = fix_path(inc_path))
if env.get('XML2_LIBS'):
lib_path = env['XML2_LIBS']
env.AppendUnique(LIBPATH = fix_path(lib_path))
elif conf.parse_config('XML2_CONFIG',checks='--cflags'):
env['HAS_LIBXML2'] = True
else:
env['MISSING_DEPS'].append('libxml2')
if not env['HOST']:
if conf.CheckHasDlfcn():

View file

@ -84,7 +84,7 @@ if '-DHAVE_WEBP' in env['CPPDEFINES']:
lib_env['LIBS'].append('webp')
enabled_imaging_libraries.append('webp_reader.cpp')
lib_env['LIBS'].append('xml2')
if '-DHAVE_LIBXML2' in env['CPPDEFINES'] : lib_env['LIBS'].append('xml2')
if '-DBOOST_REGEX_HAS_ICU' in env['CPPDEFINES']:
lib_env['LIBS'].append('icui18n')