From 2610e763df435df5cf3c36e6a4805ab6516ef0bc Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 21 May 2002 16:33:42 +0000 Subject: [PATCH] More reliable extends-toolset [SVN r13996] --- boost-base.jam | 47 +++++++++++++++++++++++++---------------------- v1/boost-base.jam | 47 +++++++++++++++++++++++++---------------------- 2 files changed, 50 insertions(+), 44 deletions(-) diff --git a/boost-base.jam b/boost-base.jam index 8139748ff..aa5d7c543 100644 --- a/boost-base.jam +++ b/boost-base.jam @@ -608,7 +608,7 @@ rule feature-default # The variable will be set "on" the target so it may be used in its build actions. rule flags { - local toolset = $(<[1]) ; + local toolset = $(gCURRENT_TOOLSET) ; local variable = $(<[2]) ; local condition = $(<[3-]) ; @@ -661,23 +661,32 @@ rule flags # properties of the target. rule include-tools { - gCURRENT_TOOLSET = $(<) ; + if ! $(gIN_INCLUDE_TOOLS) + { + gCURRENT_TOOLSET = $(<) ; + gRELEVANT_FEATURES($(<)) = ; # clear relevant feature set + gDEPENDENCY_VARIABLES($(<)) = ; + + # clear any lingering target variables that may have been declared + $(gTARGET_VARIABLES) = ; + gTARGET_VARIABLES = NEEDLIBS ; # start over from the beginning + } - # clear any lingering target variables that may have been declared - $(gTARGET_VARIABLES) = ; - gTARGET_VARIABLES = NEEDLIBS ; # start over from the beginning - gRELEVANT_FEATURES($(<)) = ; # clear relevant feature set - gDEPENDENCY_VARIABLES($(<)) = ; - - SEARCH on $(<)-tools.jam = $(BOOST_BUILD_PATH) ; - include $(<)-tools.jam ; - + { + local gIN_INCLUDE_TOOLS = true ; + SEARCH on $(<)-tools.jam = $(BOOST_BUILD_PATH) ; + include $(<)-tools.jam ; + } + # Always maintain the list of relevant features as unique - gRELEVANT_FEATURES($(<)) = [ - unique $(gRELEVANT_FEATURES($(<))) - $(gALWAYS_RELEVANT) - ] ; + if ! $(gIN_INCLUDE_TOOLS) + { + gRELEVANT_FEATURES($(<)) = [ + unique $(gRELEVANT_FEATURES($(<))) + $(gALWAYS_RELEVANT) + ] ; + } gINCLUDED($(<)-tools.jam) = TRUE ; } @@ -688,13 +697,7 @@ rule include-tools # defined is an extension of the given toolset. rule extends-toolset { - { - local gCURRENT_TOOLSET ; # protect this from being clobbered - include-tools $(<) ; - } - # Add the relevant features from the base toolset - gRELEVANT_FEATURES($(gCURRENT_TOOLSET)) += $(gRELEVANT_FEATURES($(<))) ; - gDEPENDENCY_VARIABLES($(gCURRENT_TOOLSET)) += $(gDEPENDENCY_VARIABLES($(<))) ; + include-tools $(<) ; } # relevant-features toolset diff --git a/v1/boost-base.jam b/v1/boost-base.jam index 8139748ff..aa5d7c543 100644 --- a/v1/boost-base.jam +++ b/v1/boost-base.jam @@ -608,7 +608,7 @@ rule feature-default # The variable will be set "on" the target so it may be used in its build actions. rule flags { - local toolset = $(<[1]) ; + local toolset = $(gCURRENT_TOOLSET) ; local variable = $(<[2]) ; local condition = $(<[3-]) ; @@ -661,23 +661,32 @@ rule flags # properties of the target. rule include-tools { - gCURRENT_TOOLSET = $(<) ; + if ! $(gIN_INCLUDE_TOOLS) + { + gCURRENT_TOOLSET = $(<) ; + gRELEVANT_FEATURES($(<)) = ; # clear relevant feature set + gDEPENDENCY_VARIABLES($(<)) = ; + + # clear any lingering target variables that may have been declared + $(gTARGET_VARIABLES) = ; + gTARGET_VARIABLES = NEEDLIBS ; # start over from the beginning + } - # clear any lingering target variables that may have been declared - $(gTARGET_VARIABLES) = ; - gTARGET_VARIABLES = NEEDLIBS ; # start over from the beginning - gRELEVANT_FEATURES($(<)) = ; # clear relevant feature set - gDEPENDENCY_VARIABLES($(<)) = ; - - SEARCH on $(<)-tools.jam = $(BOOST_BUILD_PATH) ; - include $(<)-tools.jam ; - + { + local gIN_INCLUDE_TOOLS = true ; + SEARCH on $(<)-tools.jam = $(BOOST_BUILD_PATH) ; + include $(<)-tools.jam ; + } + # Always maintain the list of relevant features as unique - gRELEVANT_FEATURES($(<)) = [ - unique $(gRELEVANT_FEATURES($(<))) - $(gALWAYS_RELEVANT) - ] ; + if ! $(gIN_INCLUDE_TOOLS) + { + gRELEVANT_FEATURES($(<)) = [ + unique $(gRELEVANT_FEATURES($(<))) + $(gALWAYS_RELEVANT) + ] ; + } gINCLUDED($(<)-tools.jam) = TRUE ; } @@ -688,13 +697,7 @@ rule include-tools # defined is an extension of the given toolset. rule extends-toolset { - { - local gCURRENT_TOOLSET ; # protect this from being clobbered - include-tools $(<) ; - } - # Add the relevant features from the base toolset - gRELEVANT_FEATURES($(gCURRENT_TOOLSET)) += $(gRELEVANT_FEATURES($(<))) ; - gDEPENDENCY_VARIABLES($(gCURRENT_TOOLSET)) += $(gDEPENDENCY_VARIABLES($(<))) ; + include-tools $(<) ; } # relevant-features toolset