From 3a2a8dbfdef2d07008abc224bd3fad44078f0639 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 9 Aug 2013 11:31:17 -0400 Subject: [PATCH] scons: support passing multiple paths to PATH_REMOVE option - useful to strip - after the fact - paths that might come from pkg-config calls to cairo - closes #1980 --- SConstruct | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SConstruct b/SConstruct index 19336030e..ef202df1a 100644 --- a/SConstruct +++ b/SConstruct @@ -297,7 +297,7 @@ opts.AddVariables( ('PYTHON_PREFIX','Custom install path "prefix" for python bindings (default of no prefix)',''), ('DESTDIR', 'The root directory to install into. Useful mainly for binary package building', '/'), ('PATH', 'A custom path (or multiple paths divided by ":") to append to the $PATH env to prioritize usage of command line programs (if multiple are present on the system)', ''), - ('PATH_REMOVE', 'A path prefix to exclude from all known command and compile paths', ''), + ('PATH_REMOVE', 'A path prefix to exclude from all known command and compile paths (create multiple excludes separated by :)', ''), ('PATH_REPLACE', 'Two path prefixes (divided with a :) to search/replace from all known command and compile paths', ''), # Boost variables @@ -1815,14 +1815,14 @@ if not HELP_REQUESTED: env['ENV']['PATH'] = os.path.realpath(env['PATH']) + ':' + env['ENV']['PATH'] if env['PATH_REMOVE']: - p = env['PATH_REMOVE'] - if p in env['ENV']['PATH']: - env['ENV']['PATH'].replace(p,'') - 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) + for p in env['PATH_REMOVE'].split(':'): + if p in env['ENV']['PATH']: + env['ENV']['PATH'].replace(p,'') + 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(':')