scons: disable cairo support at configure time unless cairo reports freetype support - closes #1842
This commit is contained in:
parent
4775428dc0
commit
5ff69781c8
1 changed files with 28 additions and 0 deletions
28
SConstruct
28
SConstruct
|
@ -799,6 +799,28 @@ int main()
|
|||
context.Result(ret)
|
||||
return ret
|
||||
|
||||
def CheckCairoHasFreetype(context, silent=False):
|
||||
if not silent:
|
||||
context.Message('Checking that Cairo was built with freetype font support ... ')
|
||||
ret = context.TryRun("""
|
||||
|
||||
#include <cairo/features.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifdef CAIRO_HAS_FT_FONT
|
||||
return 0;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
""", '.cpp')[0]
|
||||
if silent:
|
||||
context.did_show_result=1
|
||||
context.Result(ret)
|
||||
return ret
|
||||
|
||||
def GetBoostLibVersion(context):
|
||||
ret = context.TryRun("""
|
||||
|
||||
|
@ -946,6 +968,7 @@ conf_tests = { 'prioritize_paths' : prioritize_paths,
|
|||
'CheckPKGVersion' : CheckPKGVersion,
|
||||
'FindBoost' : FindBoost,
|
||||
'CheckBoost' : CheckBoost,
|
||||
'CheckCairoHasFreetype' : CheckCairoHasFreetype,
|
||||
'GetBoostLibVersion' : GetBoostLibVersion,
|
||||
'GetMapnikLibVersion' : GetMapnikLibVersion,
|
||||
'parse_config' : parse_config,
|
||||
|
@ -1411,6 +1434,11 @@ if not preconfigured:
|
|||
else:
|
||||
color_print(4,'Not building with cairo support, pass CAIRO=True to enable')
|
||||
|
||||
if not env['HOST'] and env['HAS_CAIRO']:
|
||||
if not conf.CheckCairoHasFreetype():
|
||||
env['SKIPPED_DEPS'].append('cairo')
|
||||
env['HAS_CAIRO'] = False
|
||||
|
||||
if 'python' in env['BINDINGS'] or 'python' in env['REQUESTED_PLUGINS']:
|
||||
if not os.access(env['PYTHON'], os.X_OK):
|
||||
color_print(1,"Cannot run python interpreter at '%s', make sure that you have the permissions to execute it." % env['PYTHON'])
|
||||
|
|
Loading…
Reference in a new issue