Skip to content

Commit

Permalink
scons: support passing multiple paths to PATH_REMOVE option - useful …
Browse files Browse the repository at this point in the history
…to strip - after the fact - paths that might come from pkg-config calls to cairo - closes mapnik#1980
  • Loading branch information
Dane Springmeyer committed Aug 9, 2013
1 parent 29abb9a commit 3a2a8db
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(':')
Expand Down

0 comments on commit 3a2a8db

Please sign in to comment.