From f0fef4524b08cd6311d71b76539365a5faf3c17a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 3 Dec 2004 11:02:56 +0000 Subject: [PATCH] Don't hardcode '.so' suffix. * tools/stage.jam (stage-shared-linking-generator.run): Don't hardcode 'so' suffix. * build/virtual-target.jam (abstract-file-target.suffix): Compute and return the real suffix that will be used. Previously, it would return something only if the suffix was explicitly set. [SVN r26414] --- src/build/virtual-target.jam | 38 ++++++++++++++++++++---------------- src/tools/stage.jam | 5 +++-- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/build/virtual-target.jam b/src/build/virtual-target.jam index 1c879df8c..520ed5643 100644 --- a/src/build/virtual-target.jam +++ b/src/build/virtual-target.jam @@ -227,6 +227,21 @@ class abstract-file-target : virtual-target { self.suffix = $(suffix) ; } + else if ! $(self.suffix) + { + if $(self.type) + { + local properties ; + if $(self.action) + { + local ps = [ $(self.action).properties ] ; + properties = [ $(ps).raw ] ; + } + self.suffix = [ type.generated-target-suffix $(self.type) : + $(properties) ] ; + } + } + return $(self.suffix) ; } @@ -412,26 +427,15 @@ class abstract-file-target : virtual-target rule actual-basename ( ) { local name = [ path.native $(self.name) ] ; - if $(self.suffix) + local suffix = [ suffix ] ; + if $(suffix) { - name = $(name).$(self.suffix) ; + return $(name).$(suffix) ; } - else if $(self.type) + else { - local properties ; - if $(self.action) - { - local ps = [ $(self.action).properties ] ; - properties = [ $(ps).raw ] ; - } - local suffix = [ type.generated-target-suffix $(self.type) : - $(properties) ] ; - if $(suffix) - { - name = $(name).$(suffix) ; - } - } - return $(name) ; + return $(name) ; + } } diff --git a/src/tools/stage.jam b/src/tools/stage.jam index 908ab59bf..0ba668334 100644 --- a/src/tools/stage.jam +++ b/src/tools/stage.jam @@ -359,9 +359,10 @@ class stage-shared-lib-generator : generator # Need to change the name of the target and relink local relinked = [ stage.relink-file $(project) : $(property-set) : $(source) ] ; - # FIXME: use hardcoded .so. local so-version = [ $(property-set).get ] ; - $(relinked).suffix so.$(so-version) ; + + local existing-suffix = [ $(relinked).suffix ] ; + $(relinked).suffix $(existing-suffix).$(so-version) ; # Break into private member of 'virtual-target' and change # the name. modules.poke $(relinked) : self.name : $(name) ;