Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79808 - trunk/tools/build/v2/contrib
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-31 06:24:07


Author: jurko
Date: 2012-07-31 06:24:05 EDT (Tue, 31 Jul 2012)
New Revision: 79808
URL: http://svn.boost.org/trac/boost/changeset/79808

Log:
Boost Build's contrib/boost.jam module cleanup - minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/contrib/boost.jam | 295 ++++++++++++++++++---------------------
   1 files changed, 137 insertions(+), 158 deletions(-)

Modified: trunk/tools/build/v2/contrib/boost.jam
==============================================================================
--- trunk/tools/build/v2/contrib/boost.jam (original)
+++ trunk/tools/build/v2/contrib/boost.jam 2012-07-31 06:24:05 EDT (Tue, 31 Jul 2012)
@@ -1,65 +1,61 @@
-# $Id$
 # Copyright 2008 Roland Schwarz
 # Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 # Boost library support module.
-#
-# This module allows to use the boost library from boost-build projects.
-# The location of a boost source tree or the path to a pre-built
-# version of the library can be configured from either site-config.jam
-# or user-config.jam. If no location is configured the module looks for
-# a BOOST_ROOT environment variable, which should point to a boost source
-# tree. As a last resort it tries to use pre-built libraries from the standard
-# search path of the compiler.
 #
-# If the location to a source tree is known, the module can be configured
-# from the *-config.jam files:
+# This module allows to use the boost library from boost-build projects. The
+# location of a boost source tree or the path to a pre-built version of the
+# library can be configured from either site-config.jam or user-config.jam. If
+# no location is configured the module looks for a BOOST_ROOT environment
+# variable, which should point to a boost source tree. As a last resort it tries
+# to use pre-built libraries from the standard search path of the compiler.
+#
+# If the location to a source tree is known, the module can be configured from
+# the *-config.jam files:
 #
 # using boost : 1.35 : <root>/path-to-boost-root ;
 #
 # If the location to a pre-built version is known:
 #
-# using boost : 1.34
-# : <include>/usr/local/include/boost_1_34
+# using boost : 1.34
+# : <include>/usr/local/include/boost_1_34
 # <library>/usr/local/lib
 # ;
 #
 # It is legal to configure more than one boost library version in the config
-# files. The version identifier is used to disambiguate between them.
-# The first configured version becomes the default.
+# files. The version identifier is used to disambiguate between them. The first
+# configured version becomes the default.
 #
-# To use a boost library you need to put a 'use' statement into your
-# Jamfile:
+# To use a boost library you need to put a 'use' statement into your Jamfile:
 #
 # import boost ;
 #
 # boost.use-project 1.35 ;
 #
-# If you don't care about a specific version you just can omit the version
+# If you do not care about a specific version you just can omit the version
 # part, in which case the default is picked up:
 #
 # boost.use-project ;
 #
-# The library can be referenced with the project identifier '/boost'. To
+# The library can be referenced with the project identifier '/boost'. To
 # reference the program_options you would specify:
 #
 # exe myexe : mysrc.cpp : <library>/boost//program_options ;
 #
-# Note that the requirements are automatically transformed into suitable
-# tags to find the correct pre-built library.
+# Note that the requirements are automatically transformed into suitable tags to
+# find the correct pre-built library.
 #
 
+import common ;
 import modules ;
-import errors ;
+import numbers ;
 import project ;
-import string ;
-import toolset ;
 import property-set ;
 import regex ;
-import common ;
-import option ;
-import numbers ;
+import string ;
+import toolset ;
 
 .boost.auto_config = [ property-set.create <layout>system ] ;
 
@@ -70,36 +66,35 @@
 
 # Configuration of the boost library to use.
 #
-# This can either be a boost source tree or
-# pre-built libraries. The 'version' parameter must be a valid boost
-# version number, e.g. 1.35, if specifying a pre-built version with
-# versioned layout. It may be a symbolic name, e.g. 'trunk' if specifying
-# a source tree. The options are specified as named parameters (like
-# properties). The following paramters are available:
-#
-# <root>/path-to-boost-root: Specify a source tree.
-#
-# <include>/path-to-include: The include directory to search.
-#
-# <library>/path-to-library: The library directory to search.
-#
-# <layout>system or <layout>versioned.
-#
-# <build-id>my_build_id: The custom build id to use.
+# This can either be a boost source tree or pre-built libraries. The 'version'
+# parameter must be a valid boost version number, e.g. 1.35, if specifying a
+# pre-built version with versioned layout. It may be a symbolic name, e.g.
+# 'trunk' if specifying a source tree. The options are specified as named
+# parameters (like properties). The following paramters are available:
+#
+# <root>/path-to-boost-root : Specify a source tree.
+# <include>/path-to-include : The include directory to search.
+# <library>/path-to-library : The library directory to search.
+# <layout>system or <layout>versioned : Built library layout.
+# <build-id>my_build_id : The custom build id to use.
 #
-rule init
-(
+rule init
+(
     version # Version identifier.
     : options * # Set the option properties.
 )
 {
- if $(.boost.$(version)) {
- errors.user-error
- "Boost " $(version) "already configured." ;
+ if $(.boost.$(version))
+ {
+ import errors ;
+ errors.user-error Boost $(version) already configured. ;
     }
- else {
- if $(.debug-configuration) {
- if ! $(.boost_default) {
+ else
+ {
+ if $(.debug-configuration)
+ {
+ if ! $(.boost_default)
+ {
                 echo notice: configuring default boost library $(version) ;
             }
             echo notice: configuring boost library $(version) ;
@@ -111,81 +106,97 @@
 
 # Use a certain version of the library.
 #
-# The use-project rule causes the module to define a boost project of
-# searchable pre-built boost libraries, or references a source tree
-# of the boost library. If the 'version' parameter is omitted either
-# the configured default (first in config files) is used or an auto
-# configuration will be attempted.
-#
-rule use-project
-(
+# The use-project rule causes the module to define a boost project of searchable
+# pre-built boost libraries, or references a source tree of the boost library.
+# If the 'version' parameter is omitted either the configured default (first in
+# config files) is used or an auto configuration will be attempted.
+#
+rule use-project
+(
     version ? # The version of the library to use.
 )
 {
     project.push-current [ project.current ] ;
     version ?= $(.boost_default) ;
     version ?= auto_config ;
-
- if $(.initialized) {
- if $(.initialized) != $(version) {
- errors.user-error
- "Attempt to use" $(__name__) "with different parameters" ;
+
+ if $(.initialized)
+ {
+ if $(.initialized) != $(version)
+ {
+ import errors ;
+ errors.user-error Attempt to use $(__name__) with different
+ parameters. ;
         }
     }
- else {
- if $(.boost.$(version)) {
+ else
+ {
+ if $(.boost.$(version))
+ {
             local opt = $(.boost.$(version)) ;
             local root = [ $(opt).get <root> ] ;
             local inc = [ $(opt).get <include> ] ;
             local lib = [ $(opt).get <library> ] ;
-
- if $(.debug-configuration) {
+
+ if $(.debug-configuration)
+ {
                 echo notice: using boost library $(version) [ $(opt).raw ] ;
             }
-
+
             .layout = [ $(opt).get <layout> ] ;
             .layout ?= versioned ;
             .build_id = [ $(opt).get <build-id> ] ;
             .version_tag = [ regex.replace $(version) "[*\\/:.\"\' ]" "_" ] ;
             .initialized = $(version) ;
 
- if ( $(root) && $(inc) )
+ if ( $(root) && $(inc) )
                 || ( $(root) && $(lib) )
                 || ( $(lib) && ! $(inc) )
- || ( ! $(lib) && $(inc) ) {
- errors.user-error
- "Ambiguous parameters,"
- "use either <root> or <inlude> with <library>." ;
+ || ( ! $(lib) && $(inc) )
+ {
+ import errors ;
+ errors.user-error Ambiguous parameters, use either <root> or
+ <include> with <library>. ;
             }
- else if ! $(root) && ! $(inc) {
+ else if ! $(root) && ! $(inc)
+ {
                 root = [ modules.peek : BOOST_ROOT ] ;
             }
 
             local prj = [ project.current ] ;
             local mod = [ $(prj).project-module ] ;
 
- if $(root) {
+ if $(root)
+ {
                 modules.call-in $(mod) : use-project boost : $(root) ;
             }
- else {
+ else
+ {
                 project.initialize $(__name__) ;
- # It is possible to overide the setup of the searched
- # libraries per version. The (unlikely) tag 0.0.1 is
- # meant as an example template only.
- switch $(version) {
+ # It is possible to overide the setup of the searched libraries
+ # per version. The (unlikely) 0.0.1 tag is meant as an example
+ # template only.
+ switch $(version)
+ {
                     case 0.0.1 : boost_0_0_1 $(inc) $(lib) ;
- case * : boost_std $(inc) $(lib) ;
+ case * : boost_std $(inc) $(lib) ;
                 }
             }
         }
- else {
- errors.user-error
- "Reference to unconfigured boost version." ;
+ else
+ {
+ import errors ;
+ errors.user-error Reference to unconfigured boost version. ;
         }
     }
     project.pop-current ;
 }
 
+local rule boost_lib_std ( id : shared-lib-define )
+{
+ lib $(name) : : : : <link>shared:<define>$(shared-lib-define) ;
+}
+
 rule boost_std ( inc ? lib ? )
 {
 # The default definitions for pre-built libraries.
@@ -196,70 +207,43 @@
         ;
 
     alias headers ;
- lib date_time : : : :
- <link>shared:<define>BOOST_DATE_TIME_DYN_LINK ;
- lib filesystem : : : :
- <link>shared:<define>BOOST_FILE_SYSTEM_DYN_LINK ;
- lib graph : : : :
- <link>shared:<define>BOOST_GRAPH_DYN_LINK ;
- lib graph_parallel : : : :
- <link>shared:<define>BOOST_GRAPH_DYN_LINK ;
- lib iostreams : : : :
- <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK ;
- lib locale : : : :
- <link>shared:<define>BOOST_LOCALE_DYN_LINK ;
- lib math_tr1 : : : :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK ;
- lib math_tr1f : : : :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK ;
- lib math_tr1l : : : :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK ;
- lib math_c99 : : : :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK ;
- lib math_c99f : : : :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK ;
- lib math_c99l : : : :
- <link>shared:<define>BOOST_MATH_TR1_DYN_LINK ;
- lib mpi : : : :
- <link>shared:<define>BOOST_MPI_DYN_LINK ;
- lib program_options : : : :
- <link>shared:<define>BOOST_PROGRAM_OPTIONS_DYN_LINK ;
- lib python : : : :
- <link>shared:<define>BOOST_PYTHON_DYN_LINK ;
- lib python3 : : : :
- <link>shared:<define>BOOST_PYTHON_DYN_LINK ;
- lib random : : : :
- <link>shared:<define>BOOST_RANDOM_DYN_LINK ;
- lib regex : : : :
- <link>shared:<define>BOOST_REGEX_DYN_LINK ;
- lib serialization : : : :
- <link>shared:<define>BOOST_SERIALIZATION_DYN_LINK ;
- lib wserialization : : : :
- <link>shared:<define>BOOST_SERIALIZATION_DYN_LINK ;
- lib signals : : : :
- <link>shared:<define>BOOST_SIGNALS_DYN_LINK ;
- lib system : : : :
- <link>shared:<define>BOOST_SYSTEM_DYN_LINK ;
- lib unit_test_framework : : : :
- <link>shared:<define>BOOST_TEST_DYN_LINK ;
- lib prg_exec_monitor : : : :
- <link>shared:<define>BOOST_TEST_DYN_LINK ;
- lib test_exec_monitor : : : :
- <link>shared:<define>BOOST_TEST_DYN_LINK ;
- lib thread : : : :
- <link>shared:<define>BOOST_THREAD_DYN_DLL ;
- lib wave : : : :
- <link>shared:<define>BOOST_WAVE_DYN_LINK ;
+ boost_lib_std date_time : BOOST_DATE_TIME_DYN_LINK ;
+ boost_lib_std filesystem : BOOST_FILE_SYSTEM_DYN_LINK ;
+ boost_lib_std graph : BOOST_GRAPH_DYN_LINK ;
+ boost_lib_std graph_parallel : BOOST_GRAPH_DYN_LINK ;
+ boost_lib_std iostreams : BOOST_IOSTREAMS_DYN_LINK ;
+ boost_lib_std locale : BOOST_LOCALE_DYN_LINK ;
+ boost_lib_std math_tr1 : BOOST_MATH_TR1_DYN_LINK ;
+ boost_lib_std math_tr1f : BOOST_MATH_TR1_DYN_LINK ;
+ boost_lib_std math_tr1l : BOOST_MATH_TR1_DYN_LINK ;
+ boost_lib_std math_c99 : BOOST_MATH_TR1_DYN_LINK ;
+ boost_lib_std math_c99f : BOOST_MATH_TR1_DYN_LINK ;
+ boost_lib_std math_c99l : BOOST_MATH_TR1_DYN_LINK ;
+ boost_lib_std mpi : BOOST_MPI_DYN_LINK ;
+ boost_lib_std program_options : BOOST_PROGRAM_OPTIONS_DYN_LINK ;
+ boost_lib_std python : BOOST_PYTHON_DYN_LINK ;
+ boost_lib_std python3 : BOOST_PYTHON_DYN_LINK ;
+ boost_lib_std random : BOOST_RANDOM_DYN_LINK ;
+ boost_lib_std regex : BOOST_REGEX_DYN_LINK ;
+ boost_lib_std serialization : BOOST_SERIALIZATION_DYN_LINK ;
+ boost_lib_std wserialization : BOOST_SERIALIZATION_DYN_LINK ;
+ boost_lib_std signals : BOOST_SIGNALS_DYN_LINK ;
+ boost_lib_std system : BOOST_SYSTEM_DYN_LINK ;
+ boost_lib_std unit_test_framework : BOOST_TEST_DYN_LINK ;
+ boost_lib_std prg_exec_monitor : BOOST_TEST_DYN_LINK ;
+ boost_lib_std test_exec_monitor : BOOST_TEST_DYN_LINK ;
+ boost_lib_std thread : BOOST_THREAD_DYN_DLL ;
+ boost_lib_std wave : BOOST_WAVE_DYN_LINK ;
 }
 
+# Example placeholder for rules defining Boost library project & library targets
+# for a specific Boost library version. Copy under a different name and model
+# after the boost_std rule. Please note that it is also possible to have a per
+# version taging rule in case the tagging algorithm changes between versions.
+#
 rule boost_0_0_1 ( inc ? lib ? )
 {
     echo "You are trying to use an example placeholder for boost libs." ;
- # Copy this template to another place (in the file boost.jam)
- # and define a project and libraries modelled after the
- # boost_std rule. Please note that it is also possible to have
- # a per version taging rule in case they are different between
- # versions.
 }
 
 rule tag_std ( name : type ? : property-set )
@@ -294,7 +278,8 @@
     }
     else
     {
- errors.error "Missing layout" ;
+ import errors ;
+ errors.error Missing layout. ;
     }
 
     return $(result) ;
@@ -302,24 +287,18 @@
 
 rule tag_system ( name : type ? : property-set )
 {
- return [ common.format-name
- <base>
- -$(.build_id)
- : $(name) : $(type) : $(property-set) ] ;
+ return [ common.format-name <base> -$(.build_id) : $(name) : $(type) :
+ $(property-set) ] ;
 }
 
 rule tag_tagged ( name : type ? : property-set )
 {
- return [ common.format-name
- <base> <threading> <runtime>
- -$(.build_id)
- : $(name) : $(type) : $(property-set) ] ;
+ return [ common.format-name <base> <threading> <runtime> -$(.build_id) :
+ $(name) : $(type) : $(property-set) ] ;
 }
 
 rule tag_versioned ( name : type ? : property-set )
 {
- return [ common.format-name
- <base> <toolset> <threading> <runtime> -$(.version_tag)
- -$(.build_id)
- : $(name) : $(type) : $(property-set) ] ;
+ return [ common.format-name <base> <toolset> <threading> <runtime>
+ -$(.version_tag) -$(.build_id) : $(name) : $(type) : $(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