From ff3c854c573f55c8b36e473695255ce8e22dfe46 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 30 Jan 2003 10:24:55 +0000 Subject: [PATCH] Don't allow a toolset module to set flags for other module. [SVN r17085] --- new/borland.jam | 1 - new/toolset.jam | 9 +++++++++ v2/borland.jam | 1 - v2/build/toolset.jam | 9 +++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/new/borland.jam b/new/borland.jam index 353a51f92..bba76aba7 100644 --- a/new/borland.jam +++ b/new/borland.jam @@ -49,7 +49,6 @@ toolset.flags borland.link FINDLIBS-ST ; toolset.flags borland.link FINDLIBS-SA ; toolset.flags borland.link LIBRARIES ; toolset.flags borland.link LIBRARIES ; -toolset.flags gcc.link-dll LINKPATH ; actions link bind LIBRARIES { diff --git a/new/toolset.jam b/new/toolset.jam index f5f0292e7..e89ffe3d4 100644 --- a/new/toolset.jam +++ b/new/toolset.jam @@ -48,6 +48,8 @@ rule flags ( rule-or-module # If contains dot, should be a rule name. # If does not contain dot, should be a module name. # The flags will be applied for all rules in that # module. + # If module for rule is different from the calling + # module, an error is issued. variable-name # Variable that should be set on target condition * : # Can specify either @@ -69,6 +71,13 @@ rule flags ( rule-or-module # If contains dot, should be a rule name. # unconditionally values * ) { + local module_ = [ MATCH "([^.]*).*" : $(rule-or-module) ] ; + local caller = [ CALLER_MODULE ] ; + if $(module_) != $(caller) + { + errors.error "Module $(caller) attempted to set flags for module $(module_)" ; + } + local match-type ; if $(condition[1]:G=) { diff --git a/v2/borland.jam b/v2/borland.jam index 353a51f92..bba76aba7 100644 --- a/v2/borland.jam +++ b/v2/borland.jam @@ -49,7 +49,6 @@ toolset.flags borland.link FINDLIBS-ST ; toolset.flags borland.link FINDLIBS-SA ; toolset.flags borland.link LIBRARIES ; toolset.flags borland.link LIBRARIES ; -toolset.flags gcc.link-dll LINKPATH ; actions link bind LIBRARIES { diff --git a/v2/build/toolset.jam b/v2/build/toolset.jam index f5f0292e7..e89ffe3d4 100644 --- a/v2/build/toolset.jam +++ b/v2/build/toolset.jam @@ -48,6 +48,8 @@ rule flags ( rule-or-module # If contains dot, should be a rule name. # If does not contain dot, should be a module name. # The flags will be applied for all rules in that # module. + # If module for rule is different from the calling + # module, an error is issued. variable-name # Variable that should be set on target condition * : # Can specify either @@ -69,6 +71,13 @@ rule flags ( rule-or-module # If contains dot, should be a rule name. # unconditionally values * ) { + local module_ = [ MATCH "([^.]*).*" : $(rule-or-module) ] ; + local caller = [ CALLER_MODULE ] ; + if $(module_) != $(caller) + { + errors.error "Module $(caller) attempted to set flags for module $(module_)" ; + } + local match-type ; if $(condition[1]:G=) {