Boost library build system code cleanup - refactored the make-unversioned-links() rule.

[SVN r78939]
This commit is contained in:
Jurko Gospodnetić 2012-06-14 08:27:57 +00:00
parent 3c6b91c702
commit 6a8c372f92

View file

@ -180,56 +180,31 @@ rule tag ( name : type ? : property-set )
# 'source', striping any version number information from the name.
rule make-unversioned-links ( project name ? : property-set : sources * )
{
local result ;
local filtered ;
local pattern ;
local nt = [ modules.peek : NT ] ;
# Collect the libraries that have the version number in 'filtered'.
for local s in $(sources)
local filter ;
if [ modules.peek : NT ]
{
local m ;
if $(nt)
{
m = [ MATCH "(.*[.]lib)" : [ $(s).name ] ] ;
}
else
{
m = [ MATCH "(.*[.]so[.0-9]+)" "(.*[.]dylib)" "(.*[.]a)" :
[ $(s).name ] ] ;
}
if $(m)
{
filtered += $(s) ;
}
filter = (.*[.]lib) ;
}
else
{
filter =
(.*[.]so)[.0-9]*
(.*[.]dylib)
(.*[.]a) ;
}
# Create links without version.
for local s in $(filtered)
local result ;
for local s in $(sources)
{
local name = [ $(s).name ] ;
local ea = [ $(s).action ] ;
local ep = [ $(ea).properties ] ;
local a = [ new non-scanning-action $(s) : symlink.ln : $(ep) ] ;
local noversion-file ;
if $(nt)
local m = [ MATCH ^(.*)-[0-9_]+$(filter)$ : [ $(s).name ] ] ;
if $(m)
{
noversion-file = [ MATCH "(.*)-[0-9_]+(.*[.]lib)" : $(name) ] ;
local ea = [ $(s).action ] ;
local ep = [ $(ea).properties ] ;
local a = [ new non-scanning-action $(s) : symlink.ln : $(ep) ] ;
result += [ new file-target $(m:J=) exact : [ $(s).type ] :
$(project) : $(a) ] ;
}
else
{
noversion-file =
[ MATCH "(.*)-[0-9_]+(.*[.]so)[.0-9]*" : $(name) ]
[ MATCH "(.*)-[0-9_]+(.*[.]dylib)" : $(name) ]
[ MATCH "(.*)-[0-9_]+(.*[.]a)" : $(name) ]
[ MATCH "(.*)-[0-9_]+(.*[.]dll[.]a)" : $(name) ] ;
}
local new-name =
$(noversion-file[1])$(noversion-file[2]) ;
result += [ new file-target $(new-name) exact : [ $(s).type ] :
$(project) : $(a) ] ;
}
return $(result) ;
}