Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-07-30 14:01:05


Author: jurko
Date: 2008-07-30 14:01:04 EDT (Wed, 30 Jul 2008)
New Revision: 47890
URL: http://svn.boost.org/trac/boost/changeset/47890

Log:
Made the Boost Build c++-template-depth feature be optional, thus avoiding a need to have each toolset module define its default value for this feature.

This corrects a 'bug' with each such toolset module redefining the default value for all other toolsets as well, thus potentially breaking builds triggered with multiple initialized toolsets.

This also avoids passing a redundant compiler command-line option when this property is not specified.

Specialized support has been added for gcc & qcc toolsets that want to change their compiler's default template-depth parameter value used when the c++-template-depth property is not explicitly specified. Although it might be better to find out why these defaults 'need to be changed' in the first place (most likely due to some Boost library build issue) we are currently too close to the Boost library 1.36.0 release to risk causing breakage by changes in the build system so this will need to wait for some later time.

Text files modified:
   trunk/tools/build/v2/tools/builtin.jam | 6 +-----
   trunk/tools/build/v2/tools/gcc.jam | 15 +++++++++++++++
   trunk/tools/build/v2/tools/qcc.jam | 19 ++++++++++++++++++-
   3 files changed, 34 insertions(+), 6 deletions(-)

Modified: trunk/tools/build/v2/tools/builtin.jam
==============================================================================
--- trunk/tools/build/v2/tools/builtin.jam (original)
+++ trunk/tools/build/v2/tools/builtin.jam 2008-07-30 14:01:04 EDT (Wed, 30 Jul 2008)
@@ -156,10 +156,6 @@
 # define some of the values here and leave it up to the user to extend this set
 # as he needs using the feature.extend rule.
 #
-# If a specific toolset requires a default value for this feature other than the
-# one defined here it should set the feature's default value using the
-# feature.set-default rule.
-#
 # TODO: This should be upgraded as soon as Boost Build adds support for custom
 # validated feature values or at least features allowing any positive integral
 # value. See related Boost Build related trac ticket #194.
@@ -172,7 +168,7 @@
         # conforming programs.
         17
     :
- incidental propagated ;
+ incidental optional propagated ;
 
 feature.feature source : : free dependency incidental ;
 feature.feature library : : free dependency incidental ;

Modified: trunk/tools/build/v2/tools/gcc.jam
==============================================================================
--- trunk/tools/build/v2/tools/gcc.jam (original)
+++ trunk/tools/build/v2/tools/gcc.jam 2008-07-30 14:01:04 EDT (Wed, 30 Jul 2008)
@@ -367,6 +367,21 @@
         LANG on $(<) = "-x c++" ;
     }
     DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
+
+ # Here we want to raise the template-depth parameter value to something
+ # higher than the default value of 17. Note that we could do this using the
+ # feature.set-default rule but we do not want to set the default value for
+ # all toolsets as well.
+ #
+ # TODO: This 'modified default' has been inherited from some 'older Boost
+ # Build implementation' and has most likely been added to make some Boost
+ # library parts compile correctly. We should see what exactly prompted this
+ # and whether we can get around the problem more locally.
+ local template-depth = [ on $(<) return $(TEMPLATE_DEPTH) ] ;
+ if ! $(template-depth)
+ {
+ TEMPLATE_DEPTH on $(<) = 128 ;
+ }
 }
 
 rule compile.c

Modified: trunk/tools/build/v2/tools/qcc.jam
==============================================================================
--- trunk/tools/build/v2/tools/qcc.jam (original)
+++ trunk/tools/build/v2/tools/qcc.jam 2008-07-30 14:01:04 EDT (Wed, 30 Jul 2008)
@@ -80,9 +80,26 @@
 flags qcc.compile OPTIONS <link>shared : -shared ;
 
 flags qcc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ;
-feature.set-default c++-template-depth : 100 ;
 
 
+rule compile.c++
+{
+ # Here we want to raise the template-depth parameter value to something
+ # higher than the default value of 17. Note that we could do this using the
+ # feature.set-default rule but we do not want to set the default value for
+ # all toolsets as well.
+ #
+ # TODO: This 'modified default' has been inherited from some 'older Boost
+ # Build implementation' and has most likely been added to make some Boost
+ # library parts compile correctly. We should see what exactly prompted this
+ # and whether we can get around the problem more locally.
+ local template-depth = [ on $(1) return $(TEMPLATE_DEPTH) ] ;
+ if ! $(template-depth)
+ {
+ TEMPLATE_DEPTH on $(1) = 100 ;
+ }
+}
+
 actions compile.c++
 {
     "$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"


Boost-Commit 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