Index: stlport.jam =================================================================== --- stlport.jam (revision 39236) +++ stlport.jam (working copy) @@ -10,7 +10,7 @@ # The subfeature value 'hostios' means to use host compiler's iostreams. # # The specific version of stlport is selected by features: -# The feature selects between static and shared library +# The feature selects between static and shared library # The on selects STLPort with debug symbols # and stl debugging. # There's no way to use STLPort with debug symbols but without @@ -109,6 +109,24 @@ return [ basic-target.generate $(property-set) ] ; } + rule get-name-with-suffix ( name : property-set ) + { + # Add the lib file suffix because some of the compiler jamfiles (e.g. msvc) expect + # it to be there. If no suffix is present, when they use :S= they will strip + # off anything following the last . in the name. + local lib-file.suffix ; + if [ feature.get-values : [ $(property-set).raw ] ] = "static" + { + lib-file.suffix = [ type.generated-target-suffix STATIC_LIB : $(property-set) ] ; + } + else + { + lib-file.suffix = [ type.generated-target-suffix IMPORT_LIB : $(property-set) ] ; + } + + return $(name).$(lib-file.suffix) ; + } + rule construct ( name : source-targets * : property-set ) { # Deduce the name of stlport library, based on toolset and @@ -124,7 +142,7 @@ # STLport host IO streams no longer supported. So we always # need libraries. - # name: stlport(stl)?[dg]?.M.R + # name: stlport(stl)?[dg]?(_static)?.M.R local name = stlport ; if [ feature.get-values : $(raw) ] = "on" { @@ -136,6 +154,12 @@ case * : name += d ; } } + + if [ feature.get-values : $(raw) ] = "static" + { + name += _static ; + } + name += .$(self.version.5) ; name = $(name:J=) ; @@ -156,6 +180,7 @@ = [ type.generated-target-suffix $(runtime-link:U)_LIB : $(lib-file.props) ] ; lib-file.prefix ?= "" "lib" ; + lib-file.suffix ?= "" ; local lib-file @@ -169,13 +194,15 @@ = [ targets.main-target-requirements [ $(lib-file.props).raw ] $(lib-file[-1]) : $(self.project) ] ; - return [ generators.construct $(self.project) $(name) : LIB : $(lib-file.requirements) ] ; + return [ generators.construct $(self.project) $(name) : LIB : $(lib-file.requirements) : : LIB ] ; } else { #~ Otherwise, it's just a regular usage of the library. + local full-name ; + full-name = [ get-name-with-suffix $(name) : $(property-set) ] ; return [ generators.construct - $(self.project) $(name) : SEARCHED_LIB : $(property-set) ] ; + $(self.project) $(full-name) : SEARCHED_LIB : [ $(property-set).add-raw $(full-name) ] ] ; } } else if ! $(hostios) && $(toolset) != msvc @@ -191,8 +218,10 @@ name = $(name)_stldebug ; } + local full-name ; + full-name = [ get-name-with-suffix $(name) : $(property-set) ] ; return [ generators.construct - $(self.project) $(name) : SEARCHED_LIB : $(property-set) ] ; + $(self.project) $(full-name) : SEARCHED_LIB : [ $(property-set).add-raw $(full-name) ] ] ; } else { @@ -217,7 +246,7 @@ _STLP_DEBUG=1 _STLP_DEBUG_UNINITIALIZED=1 ; } - if [ $(rproperties).get ] = "on" + if [ $(rproperties).get ] = "shared" { usage-requirements += _STLP_USE_DYNAMIC_LIB=1 ; @@ -254,7 +283,7 @@ if $(self.version) { usage-requirements += - stlport-$(self.version) ; + stlport $(self.version) ; } else {