From 6a8c372f92d8da553b15d1eac9486b817a5d25d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Thu, 14 Jun 2012 08:27:57 +0000 Subject: [PATCH] Boost library build system code cleanup - refactored the make-unversioned-links() rule. [SVN r78939] --- boostcpp.jam | 63 ++++++++++++++++------------------------------------ 1 file changed, 19 insertions(+), 44 deletions(-) diff --git a/boostcpp.jam b/boostcpp.jam index 20be095291..4ad461b4c7 100644 --- a/boostcpp.jam +++ b/boostcpp.jam @@ -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) ; }