Boost logo

Boost-Commit :

From: steven_at_[hidden]
Date: 2008-07-08 00:41:17


Author: steven_watanabe
Date: 2008-07-08 00:41:15 EDT (Tue, 08 Jul 2008)
New Revision: 47209
URL: http://svn.boost.org/trac/boost/changeset/47209

Log:
Merge Jamfile fixes from trunk
Removed:
   branches/release/libs/units/doc/generate_base_units.jam
   branches/release/libs/units/test_headers/generate_header.jam
Text files modified:
   branches/release/libs/units/doc/Jamfile.v2 | 47 ++++++++++++++++++++++++++++++++++++---
   branches/release/libs/units/example/lambda.cpp | 4 ++
   branches/release/libs/units/test/Jamfile.v2 | 2
   branches/release/libs/units/test_headers/Jamfile.v2 | 31 ++++++++++++++++++-------
   4 files changed, 69 insertions(+), 15 deletions(-)

Modified: branches/release/libs/units/doc/Jamfile.v2
==============================================================================
--- branches/release/libs/units/doc/Jamfile.v2 (original)
+++ branches/release/libs/units/doc/Jamfile.v2 2008-07-08 00:41:15 EDT (Tue, 08 Jul 2008)
@@ -11,7 +11,9 @@
 import quickbook ;
 using boostbook ;
 using doxygen ;
-import generate_base_units ;
+import print ;
+import regex ;
+import sequence ;
 
 path-constant here : . ;
 
@@ -32,7 +34,7 @@
                                    \"BOOST_UNITS_TYPEOF(a)=typeof(a)\" \\
                                    \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\
                                    \"BOOST_UNITS_HAS_TYPEOF=1\" \\
- \"BOOST_UNITS_NON_SI_UNIT(namespace_, name_, symbol_, factor, other_unit, id)= \\
+ \"BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string, symbol_, factor, other_unit, id)= \\
                                    namespace boost { namespace units { namespace namespace_ { \\
                                      struct name_ ## _base_unit : boost::units::base_unit<name_ ## _base_unit, other_unit::dimension_type, id> { \\
                                        static const char* name(); \\
@@ -125,10 +127,47 @@
     "Abstract System Reference"
   ;
 
-generated-qbk base_units : [ path.glob-tree $(here)/../../../boost/units/base_units : *.hpp : detail conversions.hpp ] ;
+rule less ( a b ) {
+ if [ path.basename $(a) ] < [ path.basename $(b) ] {
+ return true ;
+ }
+}
+
+rule generate-qbk ( target : sources * : properties * ) {
+ print.output $(target) ;
+ local as-path = [ sequence.transform path.make : $(sources:G=) ] ;
+ local known = ;
+ local duplicated = ;
+ for local file in $(as-path) {
+ local base = [ path.basename $(file) ] ;
+ if $(base) in $(known) {
+ if ! $(base) in $(duplicated) {
+ duplicated += $(base) ;
+ }
+ } else {
+ known += $(base) ;
+ }
+ }
+ for local file in [ sequence.insertion-sort $(as-path) : less ] {
+ local output_filename = [ path.relative-to [ path.make $(here)/../../.. ] $(file) ] ;
+ local base_filename = [ path.basename $(file) ] ;
+ local base_unit = [ regex.replace $(base_filename) "\\.hpp" "" ] ;
+ if $(base_filename) in $(duplicated) {
+ # tack the directory name onto the end
+ local dir-name = [ path.basename [ path.parent $(file) ] ] ;
+ base_unit = "$(base_unit) ($(dir-name))" ;
+ }
+# this looks better, but it won't work until my boostbook patch for
+# annotation.xsl gets applied.
+# print.text "[headerref $(output_filename) $(base_unit)]\\n" : overwrite ;
+ print.text "[headerref $(output_filename)]\\n" : overwrite ;
+ }
+}
+
+make base_units.qbk : [ path.glob-tree $(here)/../../../boost/units/base_units : *.hpp : detail conversions.hpp ] : @generate-qbk ;
 explicit base_units ;
 
-install base_units_install : base_units : <location>. ;
+install base_units_install : base_units.qbk : <location>. ;
 
 xml units
   :

Deleted: branches/release/libs/units/doc/generate_base_units.jam
==============================================================================
--- branches/release/libs/units/doc/generate_base_units.jam 2008-07-08 00:41:15 EDT (Tue, 08 Jul 2008)
+++ (empty file)
@@ -1,56 +0,0 @@
-# generate_base_units.jam
-#
-# Copyright (c) 2008
-# Steven Watanabe
-#
-# Distributed under the Boost Software License, Version 1.0. (See
-# accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt
-
-import quickbook ;
-import type ;
-import generators ;
-import print ;
-import path ;
-import regex ;
-import sequence ;
-
-rule less ( a b ) {
- if [ path.basename $(a) ] < [ path.basename $(b) ] {
- return true ;
- }
-}
-
-rule generate_qbk ( target : sources * : properties * ) {
- print.output $(target) ;
- local as-path = [ sequence.transform path.make : $(sources:G=) ] ;
- local known = ;
- local duplicated = ;
- for local file in $(as-path) {
- local base = [ path.basename $(file) ] ;
- if $(base) in $(known) {
- if ! $(base) in $(duplicated) {
- duplicated += $(base) ;
- }
- } else {
- known += $(base) ;
- }
- }
- for local file in [ sequence.insertion-sort $(as-path) : less ] {
- local output_filename = [ regex.replace $(file) "\\.\\./" "" ] ;
- local base_filename = [ path.basename $(file) ] ;
- local base_unit = [ regex.replace $(base_filename) "\\.hpp" "" ] ;
- if $(base_filename) in $(duplicated) {
- # tack the directory name onto the end
- local dir-name = [ path.basename [ path.parent $(file) ] ] ;
- base_unit = "$(base_unit) ($(dir-name))" ;
- }
-# this looks better, but it won't work until my boostbook patch for
-# annotation.xsl gets applied.
-# print.text "[headerref $(output_filename) $(base_unit)]\\n" : overwrite ;
- print.text "[headerref $(output_filename)]\\n" : overwrite ;
- }
-}
-
-type.register GENERATED_QBK : : QUICKBOOK ;
-generators.register-composing generate_base_units.generate_qbk : HPP : GENERATED_QBK ;

Modified: branches/release/libs/units/example/lambda.cpp
==============================================================================
--- branches/release/libs/units/example/lambda.cpp (original)
+++ branches/release/libs/units/example/lambda.cpp 2008-07-08 00:41:15 EDT (Tue, 08 Jul 2008)
@@ -49,6 +49,8 @@
 
 #include <boost/lambda/bind.hpp>
 
+static const double pi = 3.14159265358979323846;
+
 //[lambda_snippet_1
 
 int main(int argc, char **argv) {
@@ -105,7 +107,7 @@
    boost::function<bu::quantity<si::current> (bu::quantity<si::time>) >
        i = iamp
            * bl::bind(static_cast<bu::dimensionless_quantity<si::system, double>::type (*)(const bu::quantity<si::plane_angle>&)>(bu::sin),
- 2.0 * M_PI * si::radian * f * bl::_1)
+ 2.0 * pi * si::radian * f * bl::_1)
            + i0;
 
    cout << "Oscillating current:" << endl

Modified: branches/release/libs/units/test/Jamfile.v2
==============================================================================
--- branches/release/libs/units/test/Jamfile.v2 (original)
+++ branches/release/libs/units/test/Jamfile.v2 2008-07-08 00:41:15 EDT (Tue, 08 Jul 2008)
@@ -8,7 +8,7 @@
 # http://www.boost.org/LICENSE_1_0.txt
 
 project units_test :
- requirements <include>$(BOOST_ROOT) <include>../../.. <warnings>all <toolset>msvc:<asynch-exceptions>on
+ requirements <include>$(BOOST_ROOT) <include>../../.. <toolset>msvc:<asynch-exceptions>on
 ;
 
 check-conversion-dependencies = [ path.glob-tree ../../../boost/units/systems/base_units : *.hpp ] ;

Modified: branches/release/libs/units/test_headers/Jamfile.v2
==============================================================================
--- branches/release/libs/units/test_headers/Jamfile.v2 (original)
+++ branches/release/libs/units/test_headers/Jamfile.v2 2008-07-08 00:41:15 EDT (Tue, 08 Jul 2008)
@@ -1,6 +1,6 @@
 # Jamfile.v2
 #
-# Copyright (c) 2007
+# Copyright (c) 2007-2008
 # Steven Watanabe
 #
 # Distributed under the Boost Software License, Version 1.0. (See
@@ -11,19 +11,21 @@
 import path ;
 import regex ;
 import print ;
-import generate_header ;
 
 project test_headers :
     requirements <include>$(BOOST_ROOT) <include>../../..
 ;
 
-headers = ;
+headers = [ path.glob-tree ../../../boost/units : *.hpp : detail ] ;
 
 rule setup ( ) {
- for local file in [ path.glob-tree ../../../boost/units : *.hpp : cmath_*_impl*.hpp ] {
+ for local file in $(headers) {
 
- headers += $(file) ;
- result += [ compile test.cpp : <define>BOOST_UNITS_HEADER_NAME=$(file) <dependency>$(file) : [ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ] ;
+ result += [ compile test.cpp :
+ <define>BOOST_UNITS_HEADER_NAME=$(file)
+ <dependency>$(file)
+ :
+ [ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ] ;
 
   }
   return $(result) ;
@@ -31,13 +33,24 @@
 
 tests = [ setup ] ;
 
-generate-include-all-cpp include_all1 : $(headers) ;
-generate-include-all-cpp include_all2 : $(headers) ;
+rule generate-include-all ( target : sources * : properties * ) {
+
+ print.output $(target) ;
+
+ for local file in $(sources) {
+ print.text "#include <$(file:G=)>
+" : overwrite ;
+ }
+
+}
+
+make include_all1.cpp : $(headers) : @generate-include-all ;
+make include_all2.cpp : $(headers) : @generate-include-all ;
 
 import testing ;
 
 test-suite units_headers :
   $(tests)
 # this ought to catch non-inlined functions and other duplicate definitions
- [ link include_all1 include_all2 main.cpp : <include>. : include_all_headers ]
+ [ link include_all1.cpp include_all2.cpp main.cpp : <include>. : include_all_headers ]
   ;

Deleted: branches/release/libs/units/test_headers/generate_header.jam
==============================================================================
--- branches/release/libs/units/test_headers/generate_header.jam 2008-07-08 00:41:15 EDT (Tue, 08 Jul 2008)
+++ (empty file)
@@ -1,28 +0,0 @@
-# generate_header.jam
-#
-# Copyright (c) 2008
-# Steven Watanabe
-#
-# Distributed under the Boost Software License, Version 1.0. (See
-# accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
-
-import type ;
-import generators ;
-import print ;
-import path ;
-
-rule generate_include_all ( target : sources * : properties * ) {
-
- print.output $(target) ;
-
- for local file in $(sources) {
- print.text "#include <$(file:G=)>
-" : overwrite ;
- }
-
-}
-
-type.register GENERATE_INCLUDE_ALL_CPP : : CPP ;
-
-generators.register-composing generate_header.generate_include_all : HPP : GENERATE_INCLUDE_ALL_CPP ;


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