From 04d119fc92423063ef14bf34718d3874d1d2b1a7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 16 May 2013 09:59:21 -0700 Subject: [PATCH] further improve cairo freetype support checking - refs #1842 --- SConstruct | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/SConstruct b/SConstruct index 6b66f168f..90baf19fc 100644 --- a/SConstruct +++ b/SConstruct @@ -22,6 +22,7 @@ import sys import re import platform from glob import glob +from copy import copy from subprocess import Popen, PIPE from SCons.SConf import SetCacheMode import pickle @@ -171,6 +172,10 @@ def shortest_name(libs): name = lib return name +def rm_path(item,set,_env): + for i in _env[set]: + if item in i: + _env[set].remove(i) def sort_paths(items,priority): """Sort paths such that compiling and linking will globally prefer custom or local libs @@ -802,9 +807,11 @@ int main() def CheckCairoHasFreetype(context, silent=False): if not silent: context.Message('Checking that Cairo was built with freetype font support ... ') + context.env.AppendUnique(CPPPATH=copy(env['CAIRO_CPPPATHS'])) + ret = context.TryRun(""" -#include +#include int main() { @@ -819,6 +826,9 @@ int main() if silent: context.did_show_result=1 context.Result(ret) + for item in env['CAIRO_CPPPATHS']: + print 'removing %s' % item + rm_path(item,'CPPPATH',context.env) return ret def GetBoostLibVersion(context): @@ -1724,15 +1734,11 @@ if not HELP_REQUESTED: p = env['PATH_REMOVE'] if p in env['ENV']['PATH']: env['ENV']['PATH'].replace(p,'') - def rm_path(set): - for i in env[set]: - if p in i: - env[set].remove(i) - rm_path('LIBPATH') - rm_path('CPPPATH') - rm_path('CXXFLAGS') - rm_path('CAIRO_LIBPATHS') - rm_path('CAIRO_CPPPATHS') + rm_path(p,'LIBPATH',env) + rm_path(p,'CPPPATH',env) + rm_path(p,'CXXFLAGS',env) + rm_path(p,'CAIRO_LIBPATHS',env) + rm_path(p,'CAIRO_CPPPATHS',env) if env['PATH_REPLACE']: searches,replace = env['PATH_REPLACE'].split(':')