Boost logo

Boost-Build :

From: David Deakins (ddeakins_at_[hidden])
Date: 2007-09-19 16:50:12


Vladimir Prus wrote:
>
> I think this is covered in issue #1177 -- the above code is wrong,
> and the issue has a fix. It's on my todo for this week to apply that patch.
>

Related to this item, my patch has actually evolved a little bit from
what I originally posted. Some changes to builtin.jam a few weeks ago
required further mods to stlport.jam. Please use the attached patch in
place of my previous one.

Thanks,
-Dave

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 <link> feature selects between static and shared library
+# The <runtime-link> feature selects between static and shared library
 # The <runtime-debugging>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 <runtime-link> : [ $(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 <runtime-debugging> : $(raw) ] = "on"
             {
@@ -136,6 +154,12 @@
                     case * : name += d ;
                 }
             }
+
+ if [ feature.get-values <runtime-link> : $(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 ] <file>$(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 <name>$(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 <name>$(full-name) ] ] ;
         }
         else
         {
@@ -217,7 +246,7 @@
                 <define>_STLP_DEBUG=1
                 <define>_STLP_DEBUG_UNINITIALIZED=1 ;
         }
- if [ $(rproperties).get <runtime-debugging> ] = "on"
+ if [ $(rproperties).get <runtime-link> ] = "shared"
         {
             usage-requirements +=
                 <define>_STLP_USE_DYNAMIC_LIB=1 ;
@@ -254,7 +283,7 @@
         if $(self.version)
         {
             usage-requirements +=
- <stdlib>stlport-$(self.version) ;
+ <stdlib>stlport <stdlib-stlport:version>$(self.version) ;
         }
         else
         {


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk