diff --git a/v2/doc/src/extending.xml b/v2/doc/src/extending.xml index a02fcb064..3a51007ba 100644 --- a/v2/doc/src/extending.xml +++ b/v2/doc/src/extending.xml @@ -466,6 +466,10 @@ actions inline-file OPTIONS variable, an can be used inside the action body. You'd need to consult online help (--help) to find all the features of the toolset.flags rule. + @@ -474,7 +478,7 @@ actions inline-file designing features. - Most features should have a fixed set of values, which is portable + Most features should have a fixed set of values that is portable (tool neutral) across the class of tools they are designed to work with. The user does not have to adjust the values for a exact tool. For example, <optimization>speed has the same meaning for @@ -486,73 +490,80 @@ actions inline-file Besides such portable features there are special 'raw' features that allow the user to pass any value to the command line parameters for a particular tool, if so desired. For example, the - <cxxflags> feature allows to pass any command line + <cxxflags> feature allows you to pass any command line options to a C++ compiler. The <include> feature - allows to pass any value to the -I and the interpretation - is tool-specific. (There an example of very smart usage of that - feature). Of course one should always strive to use the portable - features but these should still be provided as a backdoor just to make + allows you to pass any string preceded by -I and the interpretation + is tool-specific. (See for an example of very smart usage of that + feature). Of course one should always strive to use portable + features, but these are still be provided as a backdoor just to make sure Boost.Build does not take away any control from the user. - Some of the reasons why portable features are better are: + Using portable features is a good idea because: - Since a portable feature have a fixed set of value, you will - be able to build your project with two different settings of the - feature. Boost.Build will automatically use two different - directories for produced files. If you pass raw compiler options, - Boost.Build assumes you know what you are doing, and would not - care about what options are passed. + When a portable feature is given a fixed set of + values, you can build your project with two different + settings of the feature and Boost.Build will automatically + use two different directories for generated files. + Boost.Build does not try to separate targets built with + different raw options. + - Unlike "raw" features, you don't need to use specific - compiler flags in Jamfile, and it will more likely work on other systems. + Unlike with “raw” features, you don't need to use + specific command-line flags in your Jamfile, and it will be + more likely to work with other tools. Steps for adding a feauture + Adding a feature requires three steps: Declaring a feature. For that, the "feature.feature" - rule is used. You should have to decide on the set of feature attributes: - if feature has several values, and - significally affects build, make it "propagated", so that - whole project is build with the same value by + if a feature has several values and + significally affects the build, make it “propagated,” so that the + whole project is built with the same value by default - if a feature does not have a fixed list of - values, it must be "free". + if a feature does not have a fixed + list of values, it must be “free.” For example, the + include feature is a free + feature. - if feature is used to refer to a path, it must - be "path". + if a feature is used to refer to a + path relative to the Jamfile, it must be a “path” + feature. include is also a path + feature. if feature is used to refer to some target, it - must be "dependency". + must be a “dependency” feature. - Converting the feature value into variable. To use - feature in build action, it must be converted into a variable, - accessible in build action. This is accomplished by - "toolset.flags" rule. + Representing the feature value in a + target-specific variable. Build actions are command + templates modified by Boost.Jam variable expansions. The + toolset.flags rule sets a target-specific + variable to the value of a feature. - - Using the variable. The variable set in step 2 can - be used in build action to form command parameters or + Using the variable. The variable set in step 2 can + be used in a build action to form command parameters or files.