From 25064a24cf04195346e03ce5e592db9f7d4766ab Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 10 Nov 2006 17:30:49 +0000 Subject: [PATCH] Create unversioned hardlinks [SVN r35986] --- Jamfile.v2 | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 4 deletions(-) diff --git a/Jamfile.v2 b/Jamfile.v2 index 12285fca2f..e77e32fe16 100644 --- a/Jamfile.v2 +++ b/Jamfile.v2 @@ -112,6 +112,9 @@ import path ; import common ; import os ; import regex ; +import errors ; +import "class" : new ; +import common ; constant BOOST_VERSION : 1.35.0 ; @@ -326,20 +329,97 @@ local headers = # Complete install -package.install install - : $(install-requirements) +package.install install-proper + : $(install-requirements) on : : libs/$(libraries)/build : $(headers) ; # Install just library. -install stage +install stage-proper : libs/$(libraries)/build - : $(stage-locate) + : $(stage-locate)/lib on LIB + on ; + +if $(layout-versioned) + && ( [ modules.peek : NT ] || [ modules.peek : UNIX ] ) +{ + 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 m ; + if $(nt) + { + m = [ MATCH "(.*[.]lib)" : [ $(s).name ] ] ; + } + else + { + m = [ MATCH "(.*[.]so[.0-9]+)" "(.*[.]a)" : [ $(s).name ] ] ; + } + if $(m) + { + filtered += $(s) ; + } + } + + # Create hardlinks without version. + for local s in $(filtered) + { + local name = [ $(s).name ] ; + local ea = [ $(s).action ] ; + local ep = [ $(ea).properties ] ; + local a = [ + new non-scanning-action $(s) : common.hard-link : $(ep) ] ; + + local noversion-file ; + if $(nt) + { + noversion-file = [ MATCH "(.*)-[0-9_]+([.]lib)" : $(name) ] ; + } + else + { + noversion-file = + [ MATCH "(.*)-[0-9_]+([.]so)[.0-9]*" : $(name) ] + [ MATCH "(.*)-[0-9_]+([.]a)" : $(name) ] ; + } + + local new-name = + $(noversion-file[1])$(noversion-file[2]) ; + result += [ new file-target $(new-name) exact : [ $(s).type ] : $(project) + : $(a) ] ; + + } + return $(result) ; + } + + generate stage-unversioned : stage-proper : + @make-unversioned-links ; + + generate install-unversioned : install-proper : + @make-unversioned-links ; +} +else +{ + # Create do-nothing aliases + alias stage-unversioned ; + alias install-unversioned ; +} + +alias install : install-proper install-unversioned ; +alias stage : stage-proper stage-unversioned ; + + # Just build the libraries, don't install them anywhere. # This is what happend with just "bjam --v2". alias build_all : libs/$(libraries)/build ;