Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60658 - in trunk: libs/math/build tools/build/v2/build
From: ghost_at_[hidden]
Date: 2010-03-16 18:24:53


Author: vladimir_prus
Date: 2010-03-16 18:24:52 EDT (Tue, 16 Mar 2010)
New Revision: 60658
URL: http://svn.boost.org/trac/boost/changeset/60658

Log:
Somewhat simplify Boost.Math configuration checks
Text files modified:
   trunk/libs/math/build/Jamfile.v2 | 57 ++++++----------------------------
   trunk/tools/build/v2/build/configure.jam | 66 ++++++++++++++++++++++++++++++++++++---
   trunk/tools/build/v2/build/targets.jam | 22 ++++++++++++-
   3 files changed, 91 insertions(+), 54 deletions(-)

Modified: trunk/libs/math/build/Jamfile.v2
==============================================================================
--- trunk/libs/math/build/Jamfile.v2 (original)
+++ trunk/libs/math/build/Jamfile.v2 2010-03-16 18:24:52 EDT (Tue, 16 Mar 2010)
@@ -69,89 +69,52 @@
 import configure ;
 import property ;
 import property-set ;
+import targets ;
 
 obj long_double_check : ../config/has_long_double_support.cpp ;
 explicit long_double_check ;
-
-local .long-double-reported ;
-project = [ project.current ] ;
-
-rule long-double-configure ( properties * )
-{
- local disabled ;
- if [ option.get disable-long-double : : yes ]
- {
- disabled = true ;
- }
- else
- {
- # The presence of long double depends only on toolset.
- local toolset = [ property.select <toolset> : $(properties) ] ;
- local ps = [ property-set.create $(toolset) ] ;
- local ap = [ $(ps).as-path ] ;
-
- if ! [ configure.builds long_double_check : $(project) : $(ps)
- : "long double support" ]
- {
- if ! $(.long-double-reported)
- {
- configure.log-component-configuration math :
- "long long not available, skipping boost_math_tr1l/boost_math_c99l" ;
- .long-double-reported = true ;
- }
- disabled = true ;
- }
- }
- if $(disabled)
- {
- return <build>no ;
- }
-}
-
-long-double-opts = <conditional>@long-double-configure ;
-
+
 # Library targets
 lib boost_math_tr1 : ../src/tr1/$(TR1_SOURCES).cpp pch
     :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
          <include>../src/tr1
    ;
 
 lib boost_math_tr1f : ../src/tr1/$(TR1_SOURCES)f.cpp pch
     :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
          <include>../src/tr1
    ;
 
 lib boost_math_tr1l : ../src/tr1/$(TR1_SOURCES)l.cpp pch
     :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
          <dependency>../config//has_long_double_support
          <include>../src/tr1
- $(long-double-opts)
+ [ check-target-builds long_double_check : : <build>no ]
    ;
 
 lib boost_math_c99 : ../src/tr1/$(C99_SOURCES).cpp pch
     :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
          <include>../src/tr1
    ;
 
 lib boost_math_c99f : ../src/tr1/$(C99_SOURCES)f.cpp pch
     :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
          <include>../src/tr1
    ;
 
 lib boost_math_c99l : ../src/tr1/$(C99_SOURCES)l.cpp pch
     :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
+ <link>shared:<define>BOOST_MATH_TR1_DYN_LINK=1
          <dependency>../config//has_long_double_support
          <include>../src/tr1
- $(long-double-opts)
+ [ check-target-builds long_double_check : : <build>no ]
    ;
 
-
 boost-install boost_math_c99 boost_math_c99f boost_math_c99l boost_math_tr1 boost_math_tr1f boost_math_tr1l ;
 
 

Modified: trunk/tools/build/v2/build/configure.jam
==============================================================================
--- trunk/tools/build/v2/build/configure.jam (original)
+++ trunk/tools/build/v2/build/configure.jam 2010-03-16 18:24:52 EDT (Tue, 16 Mar 2010)
@@ -14,6 +14,7 @@
 import errors ;
 import targets ;
 import sequence ;
+import "class" : new ;
 
 rule log-summary ( )
 {
@@ -48,16 +49,25 @@
     .component-logs.$(component) += $(message) ;
 }
 
+
+
 rule log-check-result ( result )
 {
- .check-results += $(result) ;
+ if ! $(.announced-checks)
+ {
+ ECHO "Performing configuration checks\n" ;
+ .announced-checks = 1 ;
+ }
+
+ ECHO $(result) ;
+ #.check-results += $(result) ;
 }
 
 rule print-component-configuration ( )
 {
     local c = [ sequence.unique $(.components) ] ;
     
- ECHO "Component configuration:\n" ;
+ ECHO "\nComponent configuration:\n" ;
     for c in $(.components)
     {
         local s ;
@@ -102,11 +112,11 @@
 rule builds ( metatarget-reference : project : ps : what )
 {
     local result ;
-
+
     if ! $(.$(what)-tested.$(ps))
- {
+ {
         .$(what)-tested.$(ps) = true ;
-
+
         local targets = [ targets.generate-from-reference
             $(metatarget-reference) : $(project) : $(ps) ] ;
         
@@ -155,3 +165,49 @@
     }
 }
 
+# Frontend rules
+
+class check-target-builds-worker
+{
+ import configure ;
+ import property-set ;
+ import targets ;
+ import property ;
+
+ rule __init__ ( target : true-properties * : false-properties * )
+ {
+ self.target = $(target) ;
+ self.true-properties = $(true-properties) ;
+ self.false-properties = $(false-properties) ;
+ }
+
+ rule check ( properties * )
+ {
+ # FIXME: this should not be hardcoded. Other checks might
+ # want to consider different set of features as relevant.
+ local toolset = [ property.select <toolset> : $(properties) ] ;
+ local ps = [ property-set.create $(toolset) ] ;
+ local t = [ targets.current ] ;
+ local p = [ $(t).project ] ;
+ if [ configure.builds $(self.target) : $(p) : $(ps) : "$(self.target) builds" ]
+ {
+ return $(self.true-properties) ;
+ }
+ else
+ {
+ return $(self.false-properties) ;
+ }
+ }
+}
+
+
+rule check-target-builds ( target : true-properties * : false-properties * )
+{
+ local instance = [ new check-target-builds-worker $(target) : $(true-properties)
+ : $(false-properties) ] ;
+ return <conditional>@$(instance).check ;
+}
+
+IMPORT $(__name__) : check-target-builds : : check-target-builds ;
+
+

Modified: trunk/tools/build/v2/build/targets.jam
==============================================================================
--- trunk/tools/build/v2/build/targets.jam (original)
+++ trunk/tools/build/v2/build/targets.jam 2010-03-16 18:24:52 EDT (Tue, 16 Mar 2010)
@@ -968,7 +968,7 @@
     # might come from project's requirements.
 
     local unconditional = [ feature.expand [ $(requirements).non-conditional ] ] ;
-
+
     local raw = [ $(context).raw ] ;
     raw = [ property.refine $(raw) : $(unconditional) ] ;
 
@@ -997,7 +997,7 @@
     # <conditional> properties. So the list of indirect conditionals does not
     # change.
     local indirect = [ $(requirements).get <conditional> ] ;
- indirect = [ MATCH @(.*) : $(indirect) ] ;
+ indirect = [ MATCH ^@(.*) : $(indirect) ] ;
 
     local ok ;
     while $(count)
@@ -1066,6 +1066,22 @@
         refined ] ;
 }
 
+rule push-target ( target )
+{
+ .targets = $(target) $(.targets) ;
+}
+
+rule pop-target ( )
+{
+ .targets = $(.targets[2-]) ;
+}
+
+# Return the metatarget that is currently being generated.
+rule current ( )
+{
+ return $(.targets[1]) ;
+}
+
 
 # Implements the most standard way of constructing main target alternative from
 # sources. Allows sources to be either file or other main target and handles
@@ -1221,6 +1237,7 @@
             ECHO [ targets.indent ] "Command line free features: " [ $(cf).raw ] ;
             ECHO [ targets.indent ] "Target requirements: " [ $(self.requirements).raw ] ;
         }
+ targets.push-target $(__name__) ;
 
         if ! $(self.generated.$(property-set))
         {
@@ -1361,6 +1378,7 @@
             }
         }
 
+ targets.pop-target ;
         targets.decrease-indent ;
         return $(self.generated.$(property-set)) ;
     }


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