diff --git a/src/tools/common.jam b/src/tools/common.jam index 5614d3629..f50087867 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -166,7 +166,7 @@ rule get-absolute-tool-path ( command ) # If 'path-last' is specified, path is checked after 'additional-paths'. rule find-tool ( name : additional-paths * : path-last ? ) { - local path = [ sequence.transform path.make : [ modules.peek : PATH Path path ] ] ; + local path = [ path.programs-path ] ; local match = [ path.glob $(path) : $(name) $(name).exe ] ; local additional-match = [ path.glob $(additional-paths) : $(name) $(name).exe ] ; diff --git a/src/util/path.jam b/src/util/path.jam index eae1a64da..d4bfa39d0 100644 --- a/src/util/path.jam +++ b/src/util/path.jam @@ -320,7 +320,21 @@ rule relative-to ( path1 path2 ) return [ join . $(root_1) $(split2) ] ; } - +# Returns the list of paths which are used by the operating system +# for looking up programs +rule programs-path ( ) +{ + local result ; + local raw = [ modules.peek : PATH Path path ] ; + for local p in $(raw) + { + if $(p) + { + result += [ path.make $(p) ] ; + } + } + return $(result) ; +} rule make-NT ( native ) {