This commit is contained in:
Ubuntu 2013-05-16 16:59:40 +00:00
commit ed1a39224d

View file

@ -22,6 +22,7 @@ import sys
import re import re
import platform import platform
from glob import glob from glob import glob
from copy import copy
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from SCons.SConf import SetCacheMode from SCons.SConf import SetCacheMode
import pickle import pickle
@ -171,6 +172,10 @@ def shortest_name(libs):
name = lib name = lib
return name 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): def sort_paths(items,priority):
"""Sort paths such that compiling and linking will globally prefer custom or local libs """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): def CheckCairoHasFreetype(context, silent=False):
if not silent: if not silent:
context.Message('Checking that Cairo was built with freetype font support ... ') context.Message('Checking that Cairo was built with freetype font support ... ')
context.env.AppendUnique(CPPPATH=copy(env['CAIRO_CPPPATHS']))
ret = context.TryRun(""" ret = context.TryRun("""
#include <cairo/features.h> #include <cairo-features.h>
int main() int main()
{ {
@ -819,6 +826,9 @@ int main()
if silent: if silent:
context.did_show_result=1 context.did_show_result=1
context.Result(ret) context.Result(ret)
for item in env['CAIRO_CPPPATHS']:
print 'removing %s' % item
rm_path(item,'CPPPATH',context.env)
return ret return ret
def GetBoostLibVersion(context): def GetBoostLibVersion(context):
@ -1724,15 +1734,11 @@ if not HELP_REQUESTED:
p = env['PATH_REMOVE'] p = env['PATH_REMOVE']
if p in env['ENV']['PATH']: if p in env['ENV']['PATH']:
env['ENV']['PATH'].replace(p,'') env['ENV']['PATH'].replace(p,'')
def rm_path(set): rm_path(p,'LIBPATH',env)
for i in env[set]: rm_path(p,'CPPPATH',env)
if p in i: rm_path(p,'CXXFLAGS',env)
env[set].remove(i) rm_path(p,'CAIRO_LIBPATHS',env)
rm_path('LIBPATH') rm_path(p,'CAIRO_CPPPATHS',env)
rm_path('CPPPATH')
rm_path('CXXFLAGS')
rm_path('CAIRO_LIBPATHS')
rm_path('CAIRO_CPPPATHS')
if env['PATH_REPLACE']: if env['PATH_REPLACE']:
searches,replace = env['PATH_REPLACE'].split(':') searches,replace = env['PATH_REPLACE'].split(':')