From 353359d5b007be171a75f41cc393d04bf7ae65c4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 28 Sep 2005 13:27:47 +0000 Subject: [PATCH] Reduce the number of calls to the PWD builtin. [SVN r31139] --- v2/kernel/modules.jam | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v2/kernel/modules.jam b/v2/kernel/modules.jam index 9a4fdc827..0ee2b27eb 100755 --- a/v2/kernel/modules.jam +++ b/v2/kernel/modules.jam @@ -205,6 +205,9 @@ local rule normalize-raw-paths ( paths * ) return $(result) ; } +.cwd = [ PWD ] ; + + # load the indicated module and import rule names into the current # module. Any members of rules-opt will be available without # qualification in the caller's module. Any members of rename-opt will @@ -238,18 +241,17 @@ rule import ( module-names + : rules-opt * : rename-opt * ) # if the importing module isn't already in the BOOST_BUILD_PATH, # prepend it to the path. We don't want to invert the search # order of modules that are already there. - local cwd = [ PWD ] ; - + local caller-location ; if $(caller) { caller-location = [ binding $(caller) ] ; caller-location = $(caller-location:D) ; - caller-location = [ normalize-raw-paths $(caller-location:R=$(cwd)) ] ; + caller-location = [ normalize-raw-paths $(caller-location:R=$(.cwd)) ] ; } local search = [ peek : BOOST_BUILD_PATH ] ; - search = [ normalize-raw-paths $(search:R=$(cwd)) ] ; + search = [ normalize-raw-paths $(search:R=$(.cwd)) ] ; if $(caller-location) && ! $(caller-location) in $(search) {