Ticket #1177: stlport.jam.patch

File stlport.jam.patch, 4.5 KB (added by ddeakins@…, 15 years ago)

Patch for stlport.jam

  • stlport.jam

     
    1010# The subfeature value 'hostios' means to use host compiler's iostreams.
    1111#
    1212# The specific version of stlport is selected by features:
    13 # The <link> feature selects between static and shared library
     13# The <runtime-link> feature selects between static and shared library
    1414# The <runtime-debugging>on selects STLPort with debug symbols
    1515# and stl debugging.
    1616# There's no way to use STLPort with debug symbols but without
     
    109109        return [ basic-target.generate $(property-set) ] ;
    110110    }
    111111
     112    rule get-name-with-suffix ( name : property-set )
     113    {
     114        # Add the lib file suffix because some of the compiler jamfiles (e.g. msvc) expect
     115        #   it to be there.  If no suffix is present, when they use :S= they will strip
     116        #   off anything following the last . in the name.
     117        local lib-file.suffix ;
     118        if [ feature.get-values <runtime-link> : [ $(property-set).raw ] ] = "static"
     119        {
     120            lib-file.suffix = [ type.generated-target-suffix STATIC_LIB : $(property-set) ] ;
     121        }
     122        else
     123        {
     124            lib-file.suffix = [ type.generated-target-suffix IMPORT_LIB : $(property-set) ] ;
     125        }
     126
     127        return $(name).$(lib-file.suffix) ;
     128    }
     129
    112130    rule construct ( name : source-targets * : property-set )
    113131    {
    114132        # Deduce the name of stlport library, based on toolset and
     
    124142            # STLport host IO streams no longer supported. So we always
    125143            # need libraries.
    126144           
    127             # name: stlport(stl)?[dg]?.M.R
     145            # name: stlport(stl)?[dg]?(_static)?.M.R
    128146            local name = stlport ;
    129147            if [ feature.get-values <runtime-debugging> : $(raw) ] = "on"
    130148            {
     
    136154                    case * : name += d ;
    137155                }
    138156            }
     157
     158            if [ feature.get-values <runtime-link> : $(raw) ] = "static"
     159            {
     160                name += _static ;
     161            }
     162
    139163            name += .$(self.version.5) ;
    140164            name = $(name:J=) ;
    141165           
     
    156180                    = [ type.generated-target-suffix $(runtime-link:U)_LIB : $(lib-file.props) ] ;
    157181                lib-file.prefix
    158182                    ?= "" "lib" ;
     183               
    159184                lib-file.suffix
    160185                    ?= "" ;
    161186                local lib-file
     
    169194                    = [ targets.main-target-requirements
    170195                        [ $(lib-file.props).raw ] <file>$(lib-file[-1])
    171196                        : $(self.project) ] ;
    172                 return [ generators.construct $(self.project) $(name) : LIB : $(lib-file.requirements) ] ;
     197                return [ generators.construct $(self.project) $(name) : LIB : $(lib-file.requirements) : : LIB ] ;
    173198            }
    174199            else
    175200            {
    176201                #~ Otherwise, it's just a regular usage of the library.
     202                local full-name ;
     203                full-name = [ get-name-with-suffix $(name) : $(property-set) ] ;
    177204                return [ generators.construct
    178                     $(self.project) $(name) : SEARCHED_LIB : $(property-set) ] ;
     205                    $(self.project) $(full-name) : SEARCHED_LIB : [ $(property-set).add-raw <name>$(full-name) ] ] ;
    179206            }
    180207        }
    181208        else if ! $(hostios) && $(toolset) != msvc
     
    191218                name = $(name)_stldebug ;
    192219            }
    193220
     221            local full-name ;
     222            full-name = [ get-name-with-suffix $(name) : $(property-set) ] ;
    194223            return [ generators.construct
    195                 $(self.project) $(name) : SEARCHED_LIB : $(property-set) ] ;
     224                $(self.project) $(full-name) : SEARCHED_LIB : [ $(property-set).add-raw <name>$(full-name) ] ] ;
    196225        }
    197226        else
    198227        {
     
    217246                <define>_STLP_DEBUG=1
    218247                <define>_STLP_DEBUG_UNINITIALIZED=1 ;
    219248        }
    220         if [ $(rproperties).get <runtime-debugging> ] = "on"
     249        if [ $(rproperties).get <runtime-link> ] = "shared"
    221250        {
    222251            usage-requirements +=
    223252                <define>_STLP_USE_DYNAMIC_LIB=1 ;
     
    254283        if $(self.version)
    255284        {
    256285            usage-requirements +=
    257                 <stdlib>stlport-$(self.version) ;
     286                <stdlib>stlport <stdlib-stlport:version>$(self.version) ;
    258287        }
    259288        else
    260289        {