diff --git a/v2/tools/stage.jam b/v2/tools/stage.jam index d955f40b3..ddded70ed 100644 --- a/v2/tools/stage.jam +++ b/v2/tools/stage.jam @@ -24,6 +24,9 @@ import path ; feature.feature : off on : incidental ; feature.feature : : free incidental ; feature.feature : : free path ; +# If 'on', version symblinks for shared libraries won't be created +# This feature has effect only on Unix. +feature.feature : on : optional incidental ; feature.feature : : free incidental ; class install-target-class : basic-target @@ -95,6 +98,9 @@ class install-target-class : basic-target local d = [ $(build-property-set).get ] ; ps-raw += $(d:G=) ; + local ns = [ $(build-property-set).get ] ; + ps-raw += $(ns:G=) ; + local d = [ $(build-property-set).get ] ; # Make the path absolute: we'll use it to compute relative # paths and making the path absolute will help. @@ -425,12 +431,28 @@ class installed-shared-lib-generator : generator : [ $(copied).name ] ] ; if $(m) { - result += [ stage.symlink $(m[1]).$(m[2]) : $(project) - : $(copied) : $(property-set) ] ; - result += [ stage.symlink $(m[1]).$(m[2]).$(m[3]) : $(project) - : $(copied) : $(property-set) ] ; + # Symlink without version at all is used to make + # -lsome_library work. + result += [ stage.symlink $(m[1]) : $(project) + : $(copied) : $(property-set) ] ; + + # Symlinks of some libfoo.N and libfoo.N.M are used + # so that library can found at runtime, if libfoo.N.M.X + # has soname of libfoo.N. That happens when the library + # makes some binary compatibility guarantees. If not, + # it's possible to skip those symlinks. + local suppress = + [ $(property-set).get ] ; + + if $(suppress) != "on" + { + result += [ stage.symlink $(m[1]).$(m[2]) : $(project) + : $(copied) : $(property-set) ] ; + result += [ stage.symlink $(m[1]).$(m[2]).$(m[3]) : $(project) + : $(copied) : $(property-set) ] ; + } } - + return $(result) ; } }