|
Boost-Commit : |
From: jurko.gospodnetic_at_[hidden]
Date: 2008-01-06 03:16:35
Author: jurko
Date: 2008-01-06 03:16:34 EST (Sun, 06 Jan 2008)
New Revision: 42516
URL: http://svn.boost.org/trac/boost/changeset/42516
Log:
Stylistic changes: typo corrections, comment alignments, output string updates, no functional changes, etc.
Text files modified:
trunk/tools/build/v2/build-system.jam | 4
trunk/tools/build/v2/build/generators.jam | 112 +++++++++++++++++++++++++--------------
trunk/tools/build/v2/doc/src/faq.xml | 2
trunk/tools/build/v2/test/double_loading.py | 39 ++++---------
trunk/tools/build/v2/tools/pch.jam | 52 ++++++++---------
trunk/tools/jam/doc/bjam.qbk | 2
6 files changed, 113 insertions(+), 98 deletions(-)
Modified: trunk/tools/build/v2/build-system.jam
==============================================================================
--- trunk/tools/build/v2/build-system.jam (original)
+++ trunk/tools/build/v2/build-system.jam 2008-01-06 03:16:34 EST (Sun, 06 Jan 2008)
@@ -613,8 +613,8 @@
if ! $(t)
{
- ECHO "notice: could not find main target " $(id) ;
- ECHO "notice: assuming it's a name of file to create " ;
+ ECHO "notice: could not find main target" $(id) ;
+ ECHO "notice: assuming it's a name of file to create." ;
bjam-targets += $(id) ;
}
else
Modified: trunk/tools/build/v2/build/generators.jam
==============================================================================
--- trunk/tools/build/v2/build/generators.jam (original)
+++ trunk/tools/build/v2/build/generators.jam 2008-01-06 03:16:34 EST (Sun, 06 Jan 2008)
@@ -64,6 +64,7 @@
# Outputs a debug message if generators debugging is on. Each element of
# 'message' is checked to see if it's class instance. If so, instead of the
# value, the result of 'str' call is output.
+#
local rule generators.dout ( message * )
{
if $(.debug)
@@ -94,6 +95,7 @@
# Takes a vector of 'virtual-target' instances and makes a normalized
# representation, which is the same for given set of targets,
# regardless of their order.
+#
rule normalize-target-list ( targets )
{
local v = [ $(targets).get ] ;
@@ -118,26 +120,30 @@
EXPORT class_at_generator : indent increase-indent decrease-indent generators.dout ;
rule __init__ (
- id # identifies the generator - should be name of the rule which
- # sets up build actions
- composing ? # whether generator processes each source target in
- # turn, converting it to required types.
- # Ordinary generators pass all sources together to
- # recusrive generators.construct-types call.
-
- : source-types * # types that this generator can handle. If
- # empty, the generator can consume anything.
-
- : target-types-and-names +
- # types the generator will create and, optionally, names for
- # created targets. Each element should have the form
- # type["(" name-pattern ")"]
- # for example, obj(%_x). Name of generated target will be found
- # by replacing % with the name of source, provided explicit name
- # was not specified.
+ id # Identifies the generator - should be name
+ # of the rule which sets up the build
+ # actions.
+
+ composing ? # Whether generator processes each source
+ # target in turn, converting it to required
+ # types. Ordinary generators pass all
+ # sources together to the recursive
+ # generators.construct-types call.
+
+ : source-types * # Types that this generator can handle. If
+ # empty, the generator can consume anything.
+
+ : target-types-and-names + # Types the generator will create and,
+ # optionally, names for created targets.
+ # Each element should have the form
+ # type["(" name-pattern ")"], for example,
+ # obj(%_x). Generated target name will be
+ # found by replacing % with the name of
+ # source, provided an explicit name was not
+ # specified.
- : requirements *
- )
+ : requirements *
+ )
{
self.id = $(id) ;
self.composing = $(composing) ;
@@ -171,6 +177,7 @@
}
# Returns the list of target type the generator accepts.
+ #
rule source-types ( )
{
return $(self.source-types) ;
@@ -179,6 +186,7 @@
# Returns the list of target types that this generator produces.
# It is assumed to be always the same -- i.e. it cannot change depending
# list of sources.
+ #
rule target-types ( )
{
return $(self.target-types) ;
@@ -189,6 +197,7 @@
# generator is to be used. If result has grist-only element,
# that build properties must include some value of that feature.
# XXX: remove this method?
+ #
rule requirements ( )
{
return $(self.requirements) ;
@@ -196,6 +205,7 @@
# Returns a true value if the generator can be run with the specified
# properties.
+ #
rule match-rank ( property-set-to-match )
{
# See if generator's requirements are satisfied by
@@ -232,6 +242,7 @@
# Returns another generator which differers from $(self) in
# - id
# - value to <toolset> feature in properties
+ #
rule clone ( new-id : new-toolset-properties + )
{
return [ new $(__class__) $(new-id) $(self.composing)
@@ -244,9 +255,10 @@
] ;
}
- # Creates another generator that is the same as $(self), except that
- # if 'base' is in target types of $(self), 'type' will in target types
- # of the new generator.
+ # Creates another generator that is the same as $(self), except that if
+ # 'base' is in target types of $(self), 'type' will in target types of the
+ # new generator.
+ #
rule clone-and-change-target-type ( base : type )
{
local target-types ;
@@ -270,11 +282,10 @@
] ;
}
-
- # Tries to invoke this generator on the given sources. Returns a
- # list of generated targets (instances of 'virtual-target').
- # Returning nothing from run indicates that the generator was
- # unable to create the target.
+ # Tries to invoke this generator on the given sources. Returns a list of
+ # generated targets (instances of 'virtual-target'). Returning nothing from
+ # run indicates that the generator was unable to create the target.
+ #
rule run ( project # Project for which the targets are generated
name ? # Determines the name of 'name' attribute for
# all generated targets. See 'generated-targets' method.
@@ -296,18 +307,17 @@
# different names, and it cannot decide which name to give for produced
# target. Therefore, the name must be passed.
#
- # This in effect, means that composing generators are runnable only
- # at top-level of transofrmation graph, or if name is passed explicitly.
- # Thus, we dissallow composing generators in the middle. For example, the
- # transofrmation CPP -> OBJ -> STATIC_LIB -> RSP -> EXE won't be allowed
- # (the OBJ -> STATIC_LIB generator is composing)
+ # This in effect, means that composing generators are runnable only at
+ # the top-level of a transformation graph, or if their name is passed
+ # explicitly. Thus, we dissallow composing generators in the middle. For
+ # example, the transformation CPP -> OBJ -> STATIC_LIB -> RSP -> EXE
+ # won't be allowed (the OBJ -> STATIC_LIB generator is composing)
if ! $(self.composing) || $(name)
{
run-really $(project) $(name) : $(property-set) : $(sources) ;
}
}
-
rule run-really ( project name ? : property-set : sources + )
{
# Targets that this generator will consume directly.
@@ -346,6 +356,7 @@
}
# Constructs the dependency graph to be returned by this generator.
+ #
rule construct-result (
consumed + # Already prepared list of consumable targets
# If generator requires several source files will contain
@@ -377,6 +388,7 @@
}
# Determine the name of the produced target from the names of the sources.
+ #
rule determine-output-name ( sources + )
{
# The simple case if when a name
@@ -425,6 +437,7 @@
# Note that this pattern mechanism has nothing to do with implicit patterns
# in make. It's a way to produce target which name is different for name of
# source.
+ #
rule generated-targets ( sources + : property-set : project name ? )
{
if ! $(name)
@@ -457,6 +470,7 @@
# Attempts to convert 'source' to the types that this generator can
# handle. The intention is to produce the set of targets can should be
# used when generator is run.
+ #
rule convert-to-consumable-types ( project name ? :
property-set : sources +
: only-one ? # Convert 'source' to only one of the source types. If
@@ -502,12 +516,12 @@
local transformed = [ generators.construct-types $(project) $(name)
: $(missing-types) : $(property-set) : $(sources) ] ;
- # Add targets of right type to 'consumed'. Add others to
- # 'bypassed'. The 'generators.construct' rule has done
- # its best to convert everything to the required type.
- # There's no need to rerun it on targets of different types.
+ # Add targets of right type to 'consumed'. Add others to 'bypassed'.
+ # The 'generators.construct' rule has done its best to convert
+ # everything to the required type. There's no need to rerun it on
+ # targets of different types.
- # NOTE: ignoring usage requirements
+ # NOTE: ignoring usage requirements.
for local t in $(transformed[2-])
{
if [ $(t).type ] in $(missing-types)
@@ -547,6 +561,7 @@
}
# Converts several files to consumable types.
+ #
rule convert-multiple-sources-to-consumable-types
( project : property-set : sources * : consumed-var bypassed-var )
{
@@ -591,9 +606,9 @@
}
}
-
# Returns the class to be used to actions. Default implementation
# returns "action".
+ #
rule action-class ( )
{
return "action" ;
@@ -605,6 +620,7 @@
# Registers a new generator instance 'g'.
+#
rule register ( g )
{
.generators += $(g) ;
@@ -647,6 +663,7 @@
# created instance. Rationale: the instance is returned so that it's possible to
# first register a generator and then call the 'run' method on that generator,
# bypassing all generator selection.
+#
rule register-standard ( id : source-types * : target-types + : requirements * )
{
local g = [ new generator $(id) : $(source-types) : $(target-types)
@@ -657,6 +674,7 @@
# Creates new instance of the 'composing-generator' class and registers it.
+#
rule register-composing ( id : source-types * : target-types + : requirements * )
{
local g = [ new generator $(id) true : $(source-types) : $(target-types)
@@ -668,6 +686,7 @@
# Returns all generators which belong to 'toolset', i.e. whose ids are
# '$(toolset).<something>'.
+#
rule generators-for-toolset ( toolset )
{
return $(.generators-for-toolset.$(toolset)) ;
@@ -681,6 +700,7 @@
#
# The overridden generators are discarded immediately after computing the list
# of viable generators, before running any of them.
+#
rule override ( overrider-id : overridee-id )
{
.override.$(overrider-id) += $(overridee-id) ;
@@ -691,12 +711,14 @@
# means no futher attempts to cache generators search should be made.
.caching = ;
+
# Returns a list of source type which can possibly be converted to 'target-type'
# by some chain of generator invocation.
#
# More formally, takes all generators for 'target-type' and returns union of
# source types for those generators and result of calling itself recirsively on
# source types.
+#
local rule viable-source-types-real ( target-type )
{
local generators ;
@@ -752,6 +774,7 @@
# Helper rule, caches the result of 'viable-source-types-real'.
+#
rule viable-source-types ( target-type )
{
local key = .vst.$(target-type) ;
@@ -775,6 +798,7 @@
# Returns the list of source types, which, when passed to 'run' method of
# 'generator', has some change of being eventually used (probably after
# conversion by other generators).
+#
rule viable-source-types-for-generator-real ( generator )
{
local source-types = [ $(generator).source-types ] ;
@@ -805,6 +829,7 @@
# Helper rule, caches the result of 'viable-source-types-for-generator'.
+#
local rule viable-source-types-for-generator ( generator )
{
local key = .vstg.$(generator) ;
@@ -826,6 +851,7 @@
# Returns usage requirements + list of created targets.
+#
local rule try-one-generator-really ( project name ? : generator : target-type
: property-set : sources * )
{
@@ -868,6 +894,7 @@
# Checks if generator invocation can be pruned, because it's guaranteed to fail.
# If so, quickly returns empty list. Otherwise, calls try-one-generator-really.
+#
local rule try-one-generator ( project name ? : generator : target-type
: property-set : sources * )
{
@@ -929,7 +956,8 @@
}
-# Ensures all 'targets' have types. If this is not so, exists with error.
+# Ensures all 'targets' have their type. If this is not so, exists with error.
+#
local rule ensure-type ( targets * )
{
for local t in $(targets)
@@ -952,6 +980,7 @@
#
# Note: this algorithm explicitly ignores generators for base classes if there's
# at least one generator for the requested target-type.
+#
local rule find-viable-generators-aux ( target-type : property-set )
{
# Select generators that can create the required target type.
@@ -1082,6 +1111,7 @@
# Attempts to construct a target by finding viable generators, running them and
# selecting the dependency graph.
+#
local rule construct-really (
project name ? : target-type : property-set : sources * )
{
@@ -1147,6 +1177,7 @@
# Returns a list of targets. When this invocation is first instance of
# 'construct' in stack, returns only targets of requested 'target-type',
# otherwise, returns also unused sources and additionally generated targets.
+#
rule construct ( project name ? : target-type : property-set * : sources * )
{
if (.construct-stack)
@@ -1185,6 +1216,7 @@
# requirements -- that is the first element of result of an instance of the
# property-set class, the existing usage requirements and 'raw-properties' are
# combined.
+#
rule add-usage-requirements ( result * : raw-properties * )
{
if $(result)
Modified: trunk/tools/build/v2/doc/src/faq.xml
==============================================================================
--- trunk/tools/build/v2/doc/src/faq.xml (original)
+++ trunk/tools/build/v2/doc/src/faq.xml 2008-01-06 03:16:34 EST (Sun, 06 Jan 2008)
@@ -264,7 +264,7 @@
<para>(This entry is specific to Unix system.)Before answering the
questions, let's recall a few points about shared libraries. Shared
libraries can be used by several applications, or other libraries,
- without phisycally including the library in the application. This can
+ without physically including the library in the application. This can
greatly decrease the total size of applications. It's also possible to
upgrade a shared library when the application is already
installed. Finally, shared linking can be faster.
Modified: trunk/tools/build/v2/test/double_loading.py
==============================================================================
--- trunk/tools/build/v2/test/double_loading.py (original)
+++ trunk/tools/build/v2/test/double_loading.py 2008-01-06 03:16:34 EST (Sun, 06 Jan 2008)
@@ -10,37 +10,22 @@
t = Tester()
# Regression test for double loading of the same Jamfile.
-t.write("Jamfile", """
-build-project subdir ;
-""")
-
-t.write("project-root.jam", """
-""")
-
-t.write("subdir/Jamfile", """
-ECHO "Loaded subdir" ;
-""")
+t.write("Jamfile.jam", "build-project subdir ;")
+t.write("Jamroot.jam", "" )
+t.write("subdir/Jamfile.jam", 'ECHO "Loaded subdir" ;')
t.run_build_system(subdir="subdir")
-t.fail_test(string.count(t.stdout(), "Loaded subdir") != 1)
+t.expect_output_line("Loaded subdir")
-# Regression test for a more contrived case. The top-level
-# jamfile refers to subdir via use-project, while subdir's
-# Jamfile is being loaded. The motivation why use-project
-# referring to subprojects are usefull can be found at
-# http://article.gmane.org/gmane.comp.lib.boost.build/3906/
-t.write("Jamfile", """
-use-project /subdir : subdir ;
-""")
-
-t.write("project-root.jam", """
-""")
-
-t.write("subdir/Jamfile", """
-project subdir ;
-""")
+
+# Regression test for a more contrived case. The top-level Jamfile refers to
+# subdir via use-project, while subdir's Jamfile is being loaded. The motivation
+# why use-project referring to subprojects is useful can be found at
+# http://article.gmane.org/gmane.comp.lib.boost.build/3906/
+t.write("Jamfile.jam", "use-project /subdir : subdir ;")
+t.write("Jamroot.jam", "" )
+t.write("subdir/Jamfile.jam", "project subdir ;")
t.run_build_system(subdir="subdir");
t.cleanup()
-
Modified: trunk/tools/build/v2/tools/pch.jam
==============================================================================
--- trunk/tools/build/v2/tools/pch.jam (original)
+++ trunk/tools/build/v2/tools/pch.jam 2008-01-06 03:16:34 EST (Sun, 06 Jan 2008)
@@ -34,19 +34,18 @@
type.register C_PCH : : PCH ;
type.register CPP_PCH : : PCH ;
-# control precompiled header (PCH) generation
+# Fontrol precompiled header (PCH) generation.
feature.feature pch :
- on
- off
- : propagated
- ;
+ on
+ off
+ : propagated ;
+
feature.feature pch-header : : free dependency ;
feature.feature pch-file : : free dependency ;
-# Base PCH generator. The 'run' method has the logic to
-# prevent this generator from being run unless it's used
-# in top-level PCH target.
+# Base PCH generator. The 'run' method has the logic to prevent this generator
+# from being run unless it's being used for a top-level PCH target.
class pch-generator : generator
{
import property-set ;
@@ -60,38 +59,37 @@
{
if ! $(name)
{
- # Unless this generator is invoked as the top-most
- # generator for a main target, fail. This allows using
- # 'H' type as input type for this generator, while
- # preventing Boost.Build to try this generator when not
- # explicitly asked for.
+ # Unless this generator is invoked as the top-most generator for a
+ # main target, fail. This allows using 'H' type as input type for
+ # this generator, while preventing Boost.Build to try this generator
+ # when not explicitly asked for.
#
- # One bad example is msvc, where pch generator produces
- # both PCH target and OBJ target, so if there's any
- # header generated (like by bison, or by msidl), we'd
- # try to use pch generator to get OBJ from that H, which
- # is completely wrong. By restricting this generator
+ # One bad example is msvc, where pch generator produces both PCH
+ # target and OBJ target, so if there's any header generated (like by
+ # bison, or by msidl), we'd try to use pch generator to get OBJ from
+ # that H, which is completely wrong. By restricting this generator
# only to pch main target, such problem is solved.
}
else
{
- local r = [ run-pch $(project) $(name)
+ local r = [ run-pch $(project) $(name)
: [ $(property-set).add-raw <define>BOOST_BUILD_PCH_ENABLED ]
: $(sources) ] ;
return [ generators.add-usage-requirements $(r)
: <define>BOOST_BUILD_PCH_ENABLED ] ;
- }
+ }
}
-
+
# This rule must be overridden by the derived classes.
rule run-pch ( project name ? : property-set : sources + )
- {
- }
+ {
+ }
}
-# NOTE: requiremetns are empty,
-# default pch generator can be applied when pch=off
-generators.register [
+
+# NOTE: requirements are empty, default pch generator can be applied when
+# pch=off.
+generators.register [
new dummy-generator pch.default-c-pch-generator : : C_PCH ] ;
-generators.register [
+generators.register [
new dummy-generator pch.default-cpp-pch-generator : : CPP_PCH ] ;
Modified: trunk/tools/jam/doc/bjam.qbk
==============================================================================
--- trunk/tools/jam/doc/bjam.qbk (original)
+++ trunk/tools/jam/doc/bjam.qbk 2008-01-06 03:16:34 EST (Sun, 06 Jan 2008)
@@ -116,7 +116,7 @@
The toolset used to build Boost.Jam is independent of the toolsets used for Boost.Build. Only one version of Boost.Jam is needed to use Boost.Build.
]
-The supported toolsets, and wether they are auto-detected, are:
+The supported toolsets, and whether they are auto-detected, are:
[table Supported Toolsets
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