From 31f991df08af91c7bb58d23b2aa4c59e83fdb58c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 21 Oct 2003 10:44:06 +0000 Subject: [PATCH] Handle hardcode-dll-paths a little bit differently. * new/targets.jam (basic-target.compute-usage-requirements): Add second parameter 'targets'. * new/builtin.jam (lib-target-class.compute-usage-requirements): Add proper properties when in in properties. (lib-target.adjust-properties): Don't handle . [SVN r20441] --- new/builtin.jam | 51 ++++++++++++++++++++------------- new/targets.jam | 4 +-- test/unused/project-root.jam | 2 +- tools/stlport.jam | 2 +- v2/build/targets.jam | 4 +-- v2/test/unused/project-root.jam | 2 +- v2/tools/builtin.jam | 51 ++++++++++++++++++++------------- v2/tools/stlport.jam | 2 +- 8 files changed, 70 insertions(+), 48 deletions(-) diff --git a/new/builtin.jam b/new/builtin.jam index bb92391eb..bae712c61 100644 --- a/new/builtin.jam +++ b/new/builtin.jam @@ -387,12 +387,14 @@ type.register C : c ; class lib-target-class : basic-target { import generators : construct : generators.construct ; + import type ; + import path ; rule __init__ ( name : project : sources * : requirements * : default-build * : usage-requirements * ) { basic-target.__init__ $(name) : $(project) - : $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ; + : $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ; } rule construct ( source-targets * : property-set ) @@ -418,15 +420,40 @@ class lib-target-class : basic-target : $(property-set) : $(source-targets) : LIB ] ; } - rule compute-usage-requirements ( rproperties ) + rule compute-usage-requirements ( rproperties : created-targets ) { local result = [ basic-target.compute-usage-requirements $(rproperties) ] ; + + # For lib targets with , add the value of as + # usage requirement. local search = [ $(rproperties).get ] ; if $(search) { result = [ $(result).add [ property-set.create $(search:G=) ] ] ; } + + # If is true, add appropricate usage + # requirements. + local raw = [ $(rproperties).raw ] ; + if shared in $(raw) && true in $(raw) + { + local paths ; + local pwd = [ path.pwd ] ; + for local t in $(created-targets) + { + if [ type.is-derived [ $(t).type ] SHARED_LIB ] + { + paths += [ path.root [ $(t).path ] $(pwd) ] ; + } + } + if $(paths) + { + result = [ $(result).add + [ property-set.create $(paths:G=) ] ] ; + } + } + return $(result) ; } @@ -579,13 +606,7 @@ class link-action : action properties2 += $(p) ; } } - - local hardcore-rpath ; - if true in $(properties) - { - hardcore-rpath = true ; - } - + # Add needed properties local pwd = [ path.pwd ] ; local rpaths ; @@ -608,21 +629,11 @@ class link-action : action } } else - { - if $(hardcore-rpath) && - [ type.is-derived [ $(s).type ] SHARED_LIB ] - { - rpaths += [ path.root [ $(s).path ] $(pwd) ] ; - } + { properties2 += $(s) ; } } - if $(hardcore-rpath) - { - rpaths = [ sequence.unique $(rpaths) ] ; - properties2 += $(rpaths) ; - } return $(properties2) ; } diff --git a/new/targets.jam b/new/targets.jam index 00da0c7e0..c68d659a2 100644 --- a/new/targets.jam +++ b/new/targets.jam @@ -947,7 +947,7 @@ class basic-target : abstract-target create-subvariant-dg $(result) : $(property-set) : $(rproperties) ; self.generated.$(property-set) = - [ compute-usage-requirements $(rproperties) ] + [ compute-usage-requirements $(rproperties) : $(result) ] $(result) ; self.name = $(original-name) ; @@ -963,7 +963,7 @@ class basic-target : abstract-target # Given the set of generated targets, and refined build # properties, determines and sets appripriate usage requirements # on those targets. - rule compute-usage-requirements ( rproperties ) + rule compute-usage-requirements ( rproperties : created-targets * ) { xusage-requirements = [ $(self.usage-requirements).evaluate-conditionals $(rproperties) ] ; diff --git a/test/unused/project-root.jam b/test/unused/project-root.jam index 97a47e94a..b3dd5ebc9 100644 --- a/test/unused/project-root.jam +++ b/test/unused/project-root.jam @@ -36,7 +36,7 @@ class test-target-class : basic-target } } - rule compute-usage-requirements ( rproperties ) + rule compute-usage-requirements ( rproperties : targets * ) { return [ property-set.create FOO ] ; } diff --git a/tools/stlport.jam b/tools/stlport.jam index c887e304c..65d1545bb 100644 --- a/tools/stlport.jam +++ b/tools/stlport.jam @@ -129,7 +129,7 @@ class stlport-target-class : basic-target } - rule compute-usage-requirements ( rproperties ) + rule compute-usage-requirements ( rproperties : targets * ) { local usage-requirements ; usage-requirements += diff --git a/v2/build/targets.jam b/v2/build/targets.jam index 00da0c7e0..c68d659a2 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -947,7 +947,7 @@ class basic-target : abstract-target create-subvariant-dg $(result) : $(property-set) : $(rproperties) ; self.generated.$(property-set) = - [ compute-usage-requirements $(rproperties) ] + [ compute-usage-requirements $(rproperties) : $(result) ] $(result) ; self.name = $(original-name) ; @@ -963,7 +963,7 @@ class basic-target : abstract-target # Given the set of generated targets, and refined build # properties, determines and sets appripriate usage requirements # on those targets. - rule compute-usage-requirements ( rproperties ) + rule compute-usage-requirements ( rproperties : created-targets * ) { xusage-requirements = [ $(self.usage-requirements).evaluate-conditionals $(rproperties) ] ; diff --git a/v2/test/unused/project-root.jam b/v2/test/unused/project-root.jam index 97a47e94a..b3dd5ebc9 100644 --- a/v2/test/unused/project-root.jam +++ b/v2/test/unused/project-root.jam @@ -36,7 +36,7 @@ class test-target-class : basic-target } } - rule compute-usage-requirements ( rproperties ) + rule compute-usage-requirements ( rproperties : targets * ) { return [ property-set.create FOO ] ; } diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index bb92391eb..bae712c61 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -387,12 +387,14 @@ type.register C : c ; class lib-target-class : basic-target { import generators : construct : generators.construct ; + import type ; + import path ; rule __init__ ( name : project : sources * : requirements * : default-build * : usage-requirements * ) { basic-target.__init__ $(name) : $(project) - : $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ; + : $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ; } rule construct ( source-targets * : property-set ) @@ -418,15 +420,40 @@ class lib-target-class : basic-target : $(property-set) : $(source-targets) : LIB ] ; } - rule compute-usage-requirements ( rproperties ) + rule compute-usage-requirements ( rproperties : created-targets ) { local result = [ basic-target.compute-usage-requirements $(rproperties) ] ; + + # For lib targets with , add the value of as + # usage requirement. local search = [ $(rproperties).get ] ; if $(search) { result = [ $(result).add [ property-set.create $(search:G=) ] ] ; } + + # If is true, add appropricate usage + # requirements. + local raw = [ $(rproperties).raw ] ; + if shared in $(raw) && true in $(raw) + { + local paths ; + local pwd = [ path.pwd ] ; + for local t in $(created-targets) + { + if [ type.is-derived [ $(t).type ] SHARED_LIB ] + { + paths += [ path.root [ $(t).path ] $(pwd) ] ; + } + } + if $(paths) + { + result = [ $(result).add + [ property-set.create $(paths:G=) ] ] ; + } + } + return $(result) ; } @@ -579,13 +606,7 @@ class link-action : action properties2 += $(p) ; } } - - local hardcore-rpath ; - if true in $(properties) - { - hardcore-rpath = true ; - } - + # Add needed properties local pwd = [ path.pwd ] ; local rpaths ; @@ -608,21 +629,11 @@ class link-action : action } } else - { - if $(hardcore-rpath) && - [ type.is-derived [ $(s).type ] SHARED_LIB ] - { - rpaths += [ path.root [ $(s).path ] $(pwd) ] ; - } + { properties2 += $(s) ; } } - if $(hardcore-rpath) - { - rpaths = [ sequence.unique $(rpaths) ] ; - properties2 += $(rpaths) ; - } return $(properties2) ; } diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index c887e304c..65d1545bb 100644 --- a/v2/tools/stlport.jam +++ b/v2/tools/stlport.jam @@ -129,7 +129,7 @@ class stlport-target-class : basic-target } - rule compute-usage-requirements ( rproperties ) + rule compute-usage-requirements ( rproperties : targets * ) { local usage-requirements ; usage-requirements +=