2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00

Create symbolic links the <so-version> is specified.

* tools/stage.jam
  (symlink-lib): New rule.
  (stage-shared-linking-generator.run): Use the above to
  create symlinks.


[SVN r26415]
This commit is contained in:
Vladimir Prus
2004-12-03 11:23:13 +00:00
parent f0fef4524b
commit dc64283452

View File

@@ -283,6 +283,19 @@ rule copy-file ( name ? : project : source : extra-properties )
return $(targets) ;
}
rule symlink-lib ( suffix : project : source : extra-properties )
{
local n = [ $(source).name ] ;
local targets = [
new file-target $(n:D=) : [ $(source).type ] : $(project) ] ;
local a = [ new action $(targets) : $(source) : symlink.ln :
$(extra-properties) ] ;
$(targets).suffix $(suffix) ;
$(targets).action $(a) ;
return $(targets) ;
}
rule relink-file ( project : property-set : source )
{
local action = [ $(source).action ] ;
@@ -359,13 +372,29 @@ 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) ] ;
local so-version = [ $(property-set).get <so-version> ] ;
local existing-suffix = [ $(relinked).suffix ] ;
$(relinked).suffix $(existing-suffix).$(so-version) ;
local so-version = [ $(property-set).get <so-version> ] ;
if $(so-version)
{
local existing-suffix = [ $(relinked).suffix ] ;
$(relinked).suffix $(existing-suffix).$(so-version) ;
relinked += [ stage.symlink-lib $(existing-suffix) : $(project) :
$(relinked[1]) : $(property-set) ] ;
local major = [ MATCH ([0123456789])[.].* : $(so-version) ] ;
relinked += [ stage.symlink-lib $(existing-suffix).$(major)
: $(project) : $(relinked[1]) : $(property-set) ] ;
}
# Break into private member of 'virtual-target' and change
# the name.
modules.poke $(relinked) : self.name : $(name) ;
for r in $(relinked)
{
modules.poke $(r) : self.name : $(name) ;
}
return $(relinked) ;
}
else