From 1ace4d3801daee7205690fc524e58c7f08f25f85 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 6 Jan 2007 12:39:42 +0000 Subject: [PATCH] Merge from HEAD [SVN r36605] --- v2/build/generators.jam | 56 ++--- v2/build/targets.jam | 19 +- v2/changes.txt | 8 +- v2/doc/src/advanced.xml | 37 +--- v2/doc/src/reference.xml | 430 ++++++++++++++++++++++++++++++--------- v2/doc/src/tasks.xml | 277 +------------------------ v2/doc/src/tutorial.xml | 2 +- v2/roll.sh | 2 +- v2/tools/builtin.jam | 2 +- v2/tools/doxygen.jam | 127 ++++++++++-- v2/tools/gcc.jam | 110 ++++++++++ v2/tools/kylix.jam | 21 -- 12 files changed, 629 insertions(+), 462 deletions(-) delete mode 100644 v2/tools/kylix.jam diff --git a/v2/build/generators.jam b/v2/build/generators.jam index d1013e7c3..c9921d744 100644 --- a/v2/build/generators.jam +++ b/v2/build/generators.jam @@ -371,7 +371,37 @@ class generator } } return $(result) ; - } + } + + # 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 + # of source has single dot. Then, we take the part before + # dot. Several dots can be caused by: + # - Using source file like a.host.cpp + # - A type which suffix has a dot. Say, we can + # type 'host_cpp' with extension 'host.cpp'. + # In the first case, we want to take the part till the last + # dot. In the second case -- no sure, but for now take + # the part till the last dot too. + name = [ utility.basename [ $(sources[1]).name ] ] ; + + for local s in $(sources[2]) + { + local n2 = [ utility.basename [ $(s).name ] ] ; + if $(n2) != $(name) + { + error "$(self.id): source targets have different names: cannot determine target name" ; + } + } + + # Names of sources might include directory. We should strip it. + name = $(name:D=) ; + + return $(name) ; + } # Constructs targets that are created after consuming 'sources'. # The result will be the list of virtual-target, which the same length @@ -397,29 +427,7 @@ class generator { if ! $(name) { - # Determine the name of the produced target from the - # names of the sources. The simple case if when a name - # of source has single dot. Then, we take the part before - # dot. Several dots can be caused by: - # - Using source file like a.host.cpp - # - A type which suffix has a dot. Say, we can - # type 'host_cpp' with extension 'host.cpp'. - # In the first case, we want to take the part till the last - # dot. In the second case -- no sure, but for now take - # the part till the last dot too. - name = [ utility.basename [ $(sources[1]).name ] ] ; - - for local s in $(sources[2]) - { - local n2 = [ utility.basename [ $(s).name ] ] ; - if $(n2) != $(name) - { - error "$(self.id): source targets have different names: cannot determine target name" ; - } - } - - # Names of sources might include directory. We should strip it. - name = $(name:D=) ; + name = [ determine-output-name $(sources) ] ; } # Assign an action for each target diff --git a/v2/build/targets.jam b/v2/build/targets.jam index e737a9847..0b1afa080 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -1181,10 +1181,12 @@ class basic-target : abstract-target { if [ modules.peek : .debug-building ] { - ECHO [ targets.indent ] "Building target '$(self.name)'" ; + ECHO ; + local fn = [ full-name ] ; + ECHO [ targets.indent ] "Building target '$(fn)'" ; + targets.increase-indent ; ECHO [ targets.indent ] "Build request: " [ $(property-set).raw ] ; ECHO [ targets.indent ] "Target requirements: " [ $(self.requirements).raw ] ; - targets.increase-indent ; } if ! $(self.generated.$(property-set)) @@ -1194,7 +1196,8 @@ class basic-target : abstract-target if [ modules.peek : .debug-building ] { - ECHO [ targets.indent ] "Common properties are" [ $(rproperties).raw ] ; + ECHO ; + ECHO [ targets.indent ] "Common properties:" [ $(rproperties).raw ] ; } if $(rproperties[1]) != "@error" && [ $(rproperties).get ] != no @@ -1212,6 +1215,7 @@ class basic-target : abstract-target if [ modules.peek : .debug-building ] { + ECHO ; ECHO [ targets.indent ] "Usage requirements for $(self.name) are " $(usage-requirements) ; } @@ -1220,6 +1224,12 @@ class basic-target : abstract-target $(usage-requirements) ] ; usage-requirements = [ property-set.create $(usage-requirements) ] ; + if [ modules.peek : .debug-building ] + { + ECHO [ targets.indent ] + "Build properties: " [ $(rproperties).raw ] ; + } + local extra = [ $(rproperties).get ] ; source-targets += $(extra:G=) ; # We might get duplicate sources, for example if @@ -1272,8 +1282,7 @@ class basic-target : abstract-target ECHO [ targets.indent ] "Already built" ; } } - - + targets.decrease-indent ; return $(self.generated.$(property-set)) ; } diff --git a/v2/changes.txt b/v2/changes.txt index f690f5dc2..94df340c3 100644 --- a/v2/changes.txt +++ b/v2/changes.txt @@ -16,8 +16,12 @@ Changes in this release: - New 'project.extension' rule for declaring standalone projects. - New 'conditional' convenience rule. - - New 'path.glob-tree' rule. + - New 'glob-tree' rule. + - The 'glob' rule accepts patterns to exclude. - Inline targets are now marked explicit automatically. + - Toolsets can now implicitly add requirements to + all targets. + - New 'generate' rule. Documentation changes: @@ -32,7 +36,7 @@ The following bugs were fixed: mkdir commands. - Numerious fixes in Boost autolink support - Numerious fixes in Boost.Python support. - + - Indirect properties not evaluates in usage requirements. Milestone 11 (Jule 20, 2006) diff --git a/v2/doc/src/advanced.xml b/v2/doc/src/advanced.xml index 0f701cfbf..34a95dd7c 100644 --- a/v2/doc/src/advanced.xml +++ b/v2/doc/src/advanced.xml @@ -49,24 +49,16 @@ How to configure Boost.Build - - How to write Jamfiles + + How to write declares targets in Jamfiles How the build process works - Some Basics about the Boost.Jam language. See also the - Boost.Jam - documentation. - + Some Basics about the Boost.Jam language. See + . @@ -77,8 +69,7 @@ This section will describe the basics of the Boost.Jam language—just enough for writing Jamfiles. For more information, - please see the Boost.Jam + please see the Boost.Jam documentation. Boost.Jam has an interpreted, procedural language. @@ -543,7 +534,7 @@ bjam optimization=space entity that can be built, for example an executable file. Declaring a main target is usually done using one of the main target rules described in . The user can also declare + "bbv2.reference.rules"/>. The user can also declare custom main target rules as shown in . @@ -1011,17 +1002,9 @@ project tennis Besides defining projects and main targets, Jamfiles - commonly invoke utility rules such as - constant and - path-constant, which inject a - specified Boost.Jam variable setting into this project's Jamfile - module and those of all its subprojects. See for a complete description - of these utility rules. Jamfiles are regular Boost.Jam source - files and Boost.Build modules, so naturally they can contain any kind of Boost.Jam code, - including rule definitions. - + often invoke various utility rules. For the full list of rules + that can be directly used in Jamfile see + . Each subproject inherits attributes, constants and rules @@ -1095,7 +1078,7 @@ project tennis -
+
Build Request diff --git a/v2/doc/src/reference.xml b/v2/doc/src/reference.xml index 03b4cf22f..5b9c1cf80 100644 --- a/v2/doc/src/reference.xml +++ b/v2/doc/src/reference.xml @@ -153,7 +153,7 @@ boost-build build-system ; An argument containing either slashes or the = symbol specifies a number of build request elements (see ). In its simplest + linkend="bbv2.advanced.build_request"/>). In its simplest form, it's just a set of properties, separated by slashes, which become a single build request element, for example: @@ -234,11 +234,12 @@ target1 debug gcc/runtime-link=dynamic,static
-
- Builtin targets +
+ Builtin rules - This section contains the list of all target types defined - in Boost.Build. + This section contains the list of all rules that + can be used in Jamfile—both rules that define new + targets and auxiliary rules. @@ -283,23 +284,6 @@ target1 debug gcc/runtime-link=dynamic,static file must be compiled with special properties. - - -
- - -
- Utility Rules - - The following table describes utility rules that can be - used in Jamfiles. Detailed information for any of these rules can - be obtained by running: - -bjam --help project.rulename - - - - glob @@ -313,84 +297,348 @@ lib tools : [ glob *.cpp ] ; - lib + project - Creates an library file. See - . + Declares project id and attributes, including + project requirements. See . + + + + use-project + + Assigns a symbolic project ID to a project at + a given path. This rule must be better documented! + + + + + explicit + + The explicit rule takes a single + parameter—a list of target names. The named targets will + be marked explicit, and will be built only if they are explicitly + requested on the command line, or if their dependents are built. + Compare this to ordinary targets, that are built implicitly when + their containing project is built. + + + + constant + + Sets project-wide constant. Takes two + parameters: variable name and a value and makes the specified + variable name accessible in this Jamfile and any child Jamfiles. + For example: + +constant VERSION : 1.34.0 ; + + + + + + path-constant + + Same as constant except that + the value is treated as path relative to Jamfile location. For example, + if bjam is invoked in the current directory, + and Jamfile in helper subdirectory has: + +path-constant DATA : data/a.txt ; + + then the variable DATA will be set to + helper/data/a.txt, and if bjam + is invoked from the helper directory, then + the variable DATA will be set to + data/a.txt. + + + + + build-project + + Cause some other project to be built. This rule + takes a single parameter—a directory name relative to + the containing Jamfile. When the containing Jamfile is built, + the project located at that directory will be built as well. + At the moment, the parameter to this rule should be a directory + name. Project ID or general target references are not allowed. + + + - - - <tgroup cols="2"> - <thead> - <row> - <entry>Rule</entry> - - <entry>Semantics</entry> - </row> - </thead> + </section> + + <section id="bbv2.advanced.builtins.features"> + <title>Builtin features + + + variant + + + + A feature that combines several low-level features, making + it easy to request common build configurations. + - - - project - - - Define this project's symbolic ID or attributes. - - - - use-project - - Make another project known so that it can be referred to by symbolic ID. - - - - build-project - - Cause another project to be built when this one is built. - - - - explicit - - State that a target should be built only by explicit - request. - - - - glob - - Translate a list of shell-style wildcards into a - corresponding list of files. - + Allowed values: debug, release, + profile. + + The value debug expands to + + +<optimization>off <debug-symbols>on <inlining>off <runtime-debugging>on + + + The value release expands to + + +<optimization>speed <debug-symbols>off <inlining>full <runtime-debugging>off + + + The value profile expands to the same as + release, plus: + + +<profiling>on <debug-symbols>on + - - constant - - Injects a variable setting into this project's - Jamfile module and those of all its subprojects. - + User can define his own build variants using the variant rule from the common + module. + + Notee: Runtime + debugging is on in debug builds to suit the expectations of + people used to various IDEs. + + + + + + link + + + + A feature that controls how libraries are built. + + + Allowed values: shared, + static + + + source + + + + The <source>X feature has the same effect on + building a target as putting X in the list of sources. + It's useful when you want to add + the same source to all targets in the project + (you can put <source> in requirements) or to conditionally + include a source (using conditional requirements, see ) + See also the <library> feature. + + + + + library + + + + This feature is almost equivalent to the <source> feature, + except that it takes effect only for linking. When you want to + link all targets in a Jamfile to certain library, the + <library> feature is preferred over + <source>X -- the latter will add the library to + all targets, even those that have nothing to do with libraries. + + + - - path-constant - - Injects a variable set to a path value into - this project's Jamfile module and those of all its subprojects. - If the value is a relative path it will be adjusted for - each subproject so that it refers to the same - directory. - + + dependency + + + + Introduces a dependency on the target named by the + value of this feature (so it will be brought + up-to-date whenever the target being declared is). + The dependency is not used in any other way. For example, in + application with plugins, the plugins are not used when linking + the application, + application might have dependency on its plugins, even though - - -
-
+ , and + adds its usage requirements to the build properties + of the target being declared. + + The primary use case is when you want + the usage requirements (such as #include paths) of some + library to be applied, but don't want to link to it. + + + + + + + + use + + + + Introduces a dependency on the target named by the + value of this feature (so it will be brought + up-to-date whenever the target being declared is), and + adds its usage requirements to the build properties + + of the target being declared. The dependency is not used + in any other way. The primary use case is when you want + the usage requirements (such as #include paths) of some + library to be applied, but don't want to link to it. + + + + + + + dll-path + + + + Specify an additional directory where the system should + look for shared libraries when the executable or shared + library is run. This feature only affects Unix + compilers. Plase see + in for details. + + + + hardcode-dll-paths + + + + Controls automatic generation of dll-path properties. + + + Allowed values: + true, false. This property + is specific to Unix systems. If an executable is built with + <hardcode-dll-paths>true, the generated binary + will contain the list of all the paths to the used shared + libraries. As the result, the executable can be run without + changing system paths to shared libraries or installing the + libraries to system paths. This + + is very convenient during + development. Plase see the FAQ entry for details. + Note that on Mac OSX, the paths are unconditionally hardcoded by + the linker, and it's not possible to disable that behaviour. + + + + + cflags + cxxflags + linkflags + + + + The value of those features is passed without modification to the + corresponding tools. For cflags that's both the C and C++ + compilers, for cxxflags that's the C++ compiler and for + linkflags that's the linker. The features are handy when + you're trying to do something special that cannot be achieved by + higher-level feature in Boost.Build. + + + + + warnings + + + + The <warnings> feature controls the warning level of compilers. It has the following values: + + off - disables all warnings. + on - enables default warning level for the tool. + all - enables all warnings. + + Default value is all. + + + + + warnings-as-errors + + + + The <warnings-as-errors> makes it possible to treat warnings as errors and abort + compilation on a warning. The value on enables this behaviour. The default value is + off. + + + + + build + + + Allowed values: no + + + The build feature is used to conditionally disable build of a target. If <build>no + is in properties when building a target, build of that target is skipped. Combined with conditional requirements this + allows to skip building some target in configurations where the build is known to fail. + + + + + tag + + The tag feature is used to customize + the name of the generated files. The value should have the form: +@rulename where + rulename should be a name of a rule with + the following signature: +rule tag ( name : type ? : property-set ) + The rule will be called for each target with the default name computed + by Boost.Build, the type of the target, and property set. The rule + can either return a string that must be used as the name of the + target, or empty string, in which case the default name will be used. + + + Most typical use of the tag feature is + to encode build properties, or library version in library target names. + You should take care to return non-empty string from the tag rule + only for types you care about — otherwise, you might + end up modifying names of object files, generated header file and + other targets for which changing names does not make sense. + + + + + debug-symbols + + + Allowed values: on, off. + + The debug-symbols feature specifies if + produced object files, executables and libraries should include + debug information. + Typically, the value of this feature is implicitly set by the + variant feature, but it can be explicitly + specified by the user. The most common usage is to build + release variant with debugging information. + + + + + + +
Builtin tools diff --git a/v2/doc/src/tasks.xml b/v2/doc/src/tasks.xml index 9932b35c2..c4d06b0f9 100644 --- a/v2/doc/src/tasks.xml +++ b/v2/doc/src/tasks.xml @@ -43,8 +43,7 @@ exe hello : hello.cpp some_library.lib /some_project//library PATH environment variable should include the path to the libraries. It means you have to either add the paths manually, or place the application and the libraries to the same - directory, for example using the - stage rule. + directory. See . - - - - - link - - - - A feature that controls how libraries are built. - - - Allowed values: shared, - static - - - source - - - - The <source>X feature has the same effect on - building a target as putting X in the list of sources. - It's useful when you want to add - the same source to all targets in the project - (you can put <source> in requirements) or to conditionally - include a source (using conditional requirements, see ) - See also the <library> feature. - - - - - library - - - - This feature is almost equivalent to the <source> feature, - except that it takes effect only for linking. When you want to - link all targets in a Jamfile to certain library, the - <library> feature is preferred over - <source>X -- the latter will add the library to - all targets, even those that have nothing to do with libraries. - - - - - - dependency - - - - Introduces a dependency on the target named by the - value of this feature (so it will be brought - up-to-date whenever the target being declared is). - The dependency is not used in any other way. For example, in - application with plugins, the plugins are not used when linking - the application, - application might have dependency on its plugins, even though - - - , and - adds its usage requirements to the build properties - of the target being declared. - - The primary use case is when you want - the usage requirements (such as #include paths) of some - library to be applied, but don't want to link to it. - - - - - - - - use - - - - Introduces a dependency on the target named by the - value of this feature (so it will be brought - up-to-date whenever the target being declared is), and - adds its usage requirements to the build properties - - of the target being declared. The dependency is not used - in any other way. The primary use case is when you want - the usage requirements (such as #include paths) of some - library to be applied, but don't want to link to it. - - - - - - - dll-path - - - - Specify an additional directory where the system should - look for shared libraries when the executable or shared - library is run. This feature only affects Unix - compilers. Plase see - in for details. - - - - hardcode-dll-paths - - - - Controls automatic generation of dll-path properties. - - - Allowed values: - true, false. This property - is specific to Unix systems. If an executable is built with - <hardcode-dll-paths>true, the generated binary - will contain the list of all the paths to the used shared - libraries. As the result, the executable can be run without - changing system paths to shared libraries or installing the - libraries to system paths. This - - is very convenient during - development. Plase see the FAQ entry for details. - Note that on Mac OSX, the paths are unconditionally hardcoded by - the linker, and it's not possible to disable that behaviour. - - - - - cflags - cxxflags - linkflags - - - - The value of those features is passed without modification to the - corresponding tools. For cflags that's both the C and C++ - compilers, for cxxflags that's the C++ compiler and for - linkflags that's the linker. The features are handy when - you're trying to do something special that cannot be achieved by - higher-level feature in Boost.Build. - - - - - warnings - - - - The <warnings> feature controls the warning level of compilers. It has the following values: - - off - disables all warnings. - on - enables default warning level for the tool. - all - enables all warnings. - - Default value is all. - - - - - warnings-as-errors - - - - The <warnings-as-errors> makes it possible to treat warnings as errors and abort - compilation on a warning. The value on enables this behaviour. The default value is - off. - - - - - build - - - Allowed values: no - - - The build feature is used to conditionally disable build of a target. If <build>no - is in properties when building a target, build of that target is skipped. Combined with conditional requirements this - allows to skip building some target in configurations where the build is known to fail. - - - - - tag - - The tag feature is used to customize - the name of the generated files. The value should have the form: -@rulename where - rulename should be a name of a rule with - the following signature: -rule tag ( name : type ? : property-set ) - The rule will be called for each target with the default name computed - by Boost.Build, the type of the target, and property set. The rule - can either return a string that must be used as the name of the - target, or empty string, in which case the default name will be used. - - - Most typical use of the tag feature is - to encode build properties, or library version in library target names. - You should take care to return non-empty string from the tag rule - only for types you care about — otherwise, you might - end up modifying names of object files, generated header file and - other targets for which changing names does not make sense. - - - - - debug-symbols - - - Allowed values: on, off. - - The debug-symbols feature specifies if - produced object files, executables and libraries should include - debug information. - Typically, the value of this feature is implicitly set by the - variant feature, but it can be explicitly - specified by the user. The most common usage is to build - release variant with debugging information. - - - - - - -
diff --git a/v2/doc/src/tutorial.xml b/v2/doc/src/tutorial.xml index 39b023826..b0dac9e0b 100644 --- a/v2/doc/src/tutorial.xml +++ b/v2/doc/src/tutorial.xml @@ -521,7 +521,7 @@ alias foo : /other_project//bar/<link>static ; exe e1 : e1.cpp foo ; exe e10 : e10.cpp foo ; - The alias + The alias rule is specifically used to rename a reference to a target and possibly change the properties. diff --git a/v2/roll.sh b/v2/roll.sh index 5fa840f0c..73fbf150b 100644 --- a/v2/roll.sh +++ b/v2/roll.sh @@ -25,7 +25,7 @@ echo -e "boost-build kernel ;\n" > boost-build.jam # Build the documentation touch doc/project-root.jam -export BOOST_ROOT=/home/ghost/Work/boost-rc +export BOOST_BUILD_PATH=/home/ghost/Work/boost-rc/tools/build/v2 cd doc /home/ghost/Work/boost-rc/tools/jam/src/bin.linuxx86/bjam --v2 /home/ghost/Work/boost-rc/tools/jam/src/bin.linuxx86/bjam --v2 pdf diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index e86d2e50f..d919482ec 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -222,7 +222,7 @@ feature instruction-set : itanium itanium1 merced itanium2 mckinley # Sparc v7 cypress v8 supersparc sparclite hypersparc sparclite86x - f930 f934 sparclet tsc701 v9 ultrasparc + f930 f934 sparclet tsc701 v9 ultrasparc ultrasparc3 # RS/6000 & PowerPC 401 403 405 405fp 440 440fp 505 601 602 603 603e 604 604e 620 630 740 7400 7450 750 diff --git a/v2/tools/doxygen.jam b/v2/tools/doxygen.jam index 52898d1a8..efb3b5c8a 100644 --- a/v2/tools/doxygen.jam +++ b/v2/tools/doxygen.jam @@ -33,6 +33,8 @@ import project ; import xsltproc ; import make ; import os ; +import toolset : flags ; +import alias ; # Use to specify extra configuration paramters. These get translated # into a doxyfile which configures the building of the docs. @@ -44,17 +46,29 @@ feature.feature prefix : : free ; # Specify the "boost.doxygen.reftitle" XSLT option. feature.feature reftitle : : free ; +# Which processor to use for various translations from Doxygen. +feature.feature doxygen:processor : xsltproc doxproc : implicit ; + +# To generate, or not, index sections. +feature.feature doxygen:doxproc:index : no yes : incidental ; + +# The ID for the resulting BoostBook reference section. +feature.feature doxygen:doxproc:id : : free ; + +# The title for the resulting BoostBook reference section. +feature.feature doxygen:doxproc:title : : free ; + # Doxygen configuration input file. type.register DOXYFILE : doxyfile ; # Doxygen XML multi-file output. -type.register DOXYGEN_XML_MULTIFILE : : XML ; +type.register DOXYGEN_XML_MULTIFILE : xml-dir : XML ; # Doxygen XML coallesed output. type.register DOXYGEN_XML : doxygen : XML ; # Doxygen HTML multifile directory. -type.register DOXYGEN_HTML_MULTIFILE : dir : HTML ; +type.register DOXYGEN_HTML_MULTIFILE : html-dir : HTML ; # Redirection HTML file to HTML multifile directory. type.register DOXYGEN_HTML : : HTML ; @@ -125,13 +139,24 @@ rule init ( name ? ) .doxygen = $(name) ; } .doxygen ?= doxygen ; + + .doxproc = [ modules.binding $(__name__) ] ; + .doxproc = $(.doxproc:D)/doxproc.py ; - generators.register-composing doxygen.headers-to-doxyfile : H HPP CPP : DOXYFILE ; - generators.register-standard doxygen.run : DOXYFILE : DOXYGEN_XML_MULTIFILE ; - generators.register-standard doxygen.xml-to-boostbook : DOXYGEN_XML : BOOSTBOOK ; - generators.register-standard doxygen.collect : DOXYGEN_XML_MULTIFILE : DOXYGEN_XML ; - generators.register-standard doxygen.run : DOXYFILE : DOXYGEN_HTML_MULTIFILE ; - generators.register-standard doxygen.html-redirect : DOXYGEN_HTML_MULTIFILE : DOXYGEN_HTML ; + generators.register-composing doxygen.headers-to-doxyfile + : H HPP CPP : DOXYFILE ; + generators.register-standard doxygen.run + : DOXYFILE : DOXYGEN_XML_MULTIFILE ; + generators.register-standard doxygen.xml-dir-to-boostbook + : DOXYGEN_XML_MULTIFILE : BOOSTBOOK : doxproc ; + generators.register-standard doxygen.xml-to-boostbook + : DOXYGEN_XML : BOOSTBOOK : xsltproc ; + generators.register-standard doxygen.collect + : DOXYGEN_XML_MULTIFILE : DOXYGEN_XML ; + generators.register-standard doxygen.run + : DOXYFILE : DOXYGEN_HTML_MULTIFILE ; + generators.register-standard doxygen.html-redirect + : DOXYGEN_HTML_MULTIFILE : DOXYGEN_HTML ; IMPORT $(__name__) : doxygen : : doxygen ; } @@ -153,18 +178,36 @@ actions doxygen-action "$(NAME:E=doxygen)" $(>) && echo "Stamped" > "$(<)" } +# Runs the Python doxproc XML processor. +actions doxproc +{ + python "$(DOXPROC)" "--xmldir=$(>)" "--output=$(<)" "$(OPTIONS)" "--id=$(ID)" "--title=$(TITLE)" +} + # Generates a doxygen configuration file (doxyfile) given a set of C++ # sources and a property list that may contain # features. rule headers-to-doxyfile ( target : sources * : properties * ) { local text "# Generated by Boost.Build version 2" ; + + local output-dir ; # Translate into command line flags. for local param in [ feature.get-values : $(properties) ] { local namevalue = [ regex.match ([^=]*)=(.*) : $(param) ] ; text += "$(namevalue[1]) = $(namevalue[2])" ; + if $(namevalue[1]) = OUTPUT_DIRECTORY + { + output-dir = "$(namevalue[2])" ; + } + } + + if ! $(output-dir) + { + output-dir = [ on $(target) return $(LOCATE) ] ; + text += "OUTPUT_DIRECTORY = $(output-dir)" ; } local headers = "" ; @@ -248,6 +291,19 @@ rule xml-to-boostbook ( target : source : properties * ) xsltproc.xslt $(target) : $(source) $(d2b-xsl) : $(xslt-properties) ; } +flags doxygen.xml-dir-to-boostbook OPTIONS yes : --enable-index ; +flags doxygen.xml-dir-to-boostbook ID ; +flags doxygen.xml-dir-to-boostbook TITLE ; + +rule xml-dir-to-boostbook ( target : source : properties * ) +{ + DOXPROC on $(target) = $(.doxproc) ; + + LOCATE on $(source:S=) = [ on $(source) return $(LOCATE) ] ; + + doxygen.doxproc $(target) : $(source:S=) ; +} + # Generate the HTML redirect to HTML dir index.html file. rule html-redirect ( target : source : properties * ) { @@ -273,7 +329,7 @@ rule html-redirect ( target : source : properties * ) } # User-level rule to generate BoostBook XML from a set of headers via Doxygen. -rule doxygen ( target : sources * : requirements * : default-build * ) +rule doxygen ( target : sources * : requirements * : default-build * : usage-requirements * ) { local project = [ project.current ] ; @@ -325,24 +381,65 @@ rule doxygen ( target : sources * : requirements * : default-build * ) else { # Build a BoostBook XML file from the sources. - local doxyfile = [ - new typed-target $(target) : $(project) : BOOSTBOOK - : [ targets.main-target-sources $(sources) : $(target) ] + local location-xml = [ feature.get-values : $(requirements) ] ; + requirements = [ property.change $(requirements) : ] ; + local target-xml = $(target:B=$(target:B)-xml) ; + + ## The doxygen configuration file. + targets.main-target-alternative + [ new typed-target $(target-xml:S=.tag) : $(project) : DOXYFILE + : [ targets.main-target-sources $(sources) : $(target-xml:S=.tag) ] : [ targets.main-target-requirements $(requirements) GENERATE_HTML=NO GENERATE_XML=YES + XML_OUTPUT=$(target-xml) : $(project) ] : [ targets.main-target-default-build $(default-build) : $(project) ] ] ; - targets.main-target-alternative $(doxyfile) ; + $(project).mark-target-as-explicit $(target-xml:S=.tag) ; + + ## The Doxygen XML directory of the processed source files. + targets.main-target-alternative + [ new typed-target $(target-xml:S=.dir) : $(project) : DOXYGEN_XML_MULTIFILE + : $(target-xml:S=.tag) + : [ targets.main-target-requirements $(requirements) + : $(project) ] + : [ targets.main-target-default-build $(default-build) : $(project) ] + ] ; + $(project).mark-target-as-explicit $(target-xml:S=.dir) ; + + ## The resulting BoostBook file is generated by the processor tool. The + ## tool can be either the xsltproc plus accompanying XSL scripts. Or it + ## can be the python doxproc script. + targets.main-target-alternative + [ new typed-target $(target-xml) : $(project) : BOOSTBOOK + : $(target-xml:S=.dir) + : [ targets.main-target-requirements $(requirements) + : $(project) ] + : [ targets.main-target-default-build $(default-build) : $(project) ] + ] ; + $(project).mark-target-as-explicit $(target-xml) ; targets.main-target-alternative [ new install-target-class $(target:S=.xml) : $(project) - : [ $(doxyfile).name ] + : $(target-xml) : [ targets.main-target-requirements $(requirements) - . + $(location-xml:E=.) + $(target:S=.xml) : $(project) ] : [ targets.main-target-default-build $(default-build) : $(project) ] ] ; + $(project).mark-target-as-explicit $(target:S=.xml) ; + + targets.main-target-alternative + [ new alias-target-class $(target) : $(project) + : + : [ targets.main-target-requirements $(requirements) + : $(project) ] + : [ targets.main-target-default-build $(default-build) : $(project) ] + : [ targets.main-target-usage-requirements $(usage-requirements) + $(target:S=.xml) + : $(project) ] + ] ; } } diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 1870e6827..8b8d86352 100644 --- a/v2/tools/gcc.jam +++ b/v2/tools/gcc.jam @@ -654,3 +654,113 @@ else if [ modules.peek : UNIX ] } } } + +local rule cpu-flags ( toolset variable : architecture : instruction-set + : values + : default ? ) +{ + if $(default) + { + flags $(toolset) $(variable) + $(architecture)/ + : $(values) ; + } + flags $(toolset) $(variable) + /$(instruction-set) + $(architecture)/$(instruction-set) + : $(values) ; +} + +# Set architecture/instruction-set options. +# +# x86 and compatible +flags gcc OPTIONS x86/32 : -m32 ; +flags gcc OPTIONS x86/64 : -m64 ; +cpu-flags gcc OPTIONS : x86 : i386 : -march=i386 : default ; +cpu-flags gcc OPTIONS : x86 : i486 : -march=i486 ; +cpu-flags gcc OPTIONS : x86 : i586 : -march=i586 ; +cpu-flags gcc OPTIONS : x86 : i686 : -march=i686 ; +cpu-flags gcc OPTIONS : x86 : pentium : -march=pentium ; +cpu-flags gcc OPTIONS : x86 : pentium-mmx : -march=pentium-mmx ; +cpu-flags gcc OPTIONS : x86 : pentiumpro : -march=pentiumpro ; +cpu-flags gcc OPTIONS : x86 : pentium2 : -march=pentium2 ; +cpu-flags gcc OPTIONS : x86 : pentium3 : -march=pentium3 ; +cpu-flags gcc OPTIONS : x86 : pentium3m : -march=pentium3m ; +cpu-flags gcc OPTIONS : x86 : pentium-m : -march=pentium-m ; +cpu-flags gcc OPTIONS : x86 : pentium4 : -march=pentium4 ; +cpu-flags gcc OPTIONS : x86 : pentium4m : -march=pentium4m ; +cpu-flags gcc OPTIONS : x86 : prescott : -march=prescott ; +cpu-flags gcc OPTIONS : x86 : nocona : -march=nocona ; +cpu-flags gcc OPTIONS : x86 : k6 : -march=k6 ; +cpu-flags gcc OPTIONS : x86 : k6-2 : -march=k6-2 ; +cpu-flags gcc OPTIONS : x86 : k6-3 : -march=k6-3 ; +cpu-flags gcc OPTIONS : x86 : athlon : -march=athlon ; +cpu-flags gcc OPTIONS : x86 : athlon-tbird : -march=athlon-tbird ; +cpu-flags gcc OPTIONS : x86 : athlon-4 : -march=athlon-4 ; +cpu-flags gcc OPTIONS : x86 : athlon-xp : -march=athlon-xp ; +cpu-flags gcc OPTIONS : x86 : athlon-mp : -march=athlon-mp ; +## +cpu-flags gcc OPTIONS : x86 : k8 : -march=k8 ; +cpu-flags gcc OPTIONS : x86 : opteron : -march=opteron ; +cpu-flags gcc OPTIONS : x86 : athlon64 : -march=athlon64 ; +cpu-flags gcc OPTIONS : x86 : athlon-fx : -march=athlon-fx ; +cpu-flags gcc OPTIONS : x86 : winchip-c6 : -march=winchip-c6 ; +cpu-flags gcc OPTIONS : x86 : winchip2 : -march=winchip2 ; +cpu-flags gcc OPTIONS : x86 : c3 : -march=c3 ; +cpu-flags gcc OPTIONS : x86 : c3-2 : -march=c3-2 ; +# Sparc +flags gcc OPTIONS sparc/32 : -m32 ; +flags gcc OPTIONS sparc/64 : -m64 ; +cpu-flags gcc OPTIONS : sparc : c3 : -mcpu=c3 : default ; +cpu-flags gcc OPTIONS : sparc : v7 : -mcpu=v7 ; +cpu-flags gcc OPTIONS : sparc : cypress : -mcpu=cypress ; +cpu-flags gcc OPTIONS : sparc : v8 : -mcpu=v8 ; +cpu-flags gcc OPTIONS : sparc : supersparc : -mcpu=supersparc ; +cpu-flags gcc OPTIONS : sparc : sparclite : -mcpu=sparclite ; +cpu-flags gcc OPTIONS : sparc : hypersparc : -mcpu=hypersparc ; +cpu-flags gcc OPTIONS : sparc : sparclite86x : -mcpu=sparclite86x ; +cpu-flags gcc OPTIONS : sparc : f930 : -mcpu=f930 ; +cpu-flags gcc OPTIONS : sparc : f934 : -mcpu=f934 ; +cpu-flags gcc OPTIONS : sparc : sparclet : -mcpu=sparclet ; +cpu-flags gcc OPTIONS : sparc : tsc701 : -mcpu=tsc701 ; +cpu-flags gcc OPTIONS : sparc : v9 : -mcpu=v9 ; +cpu-flags gcc OPTIONS : sparc : ultrasparc : -mcpu=ultrasparc ; +cpu-flags gcc OPTIONS : sparc : ultrasparc3 : -mcpu=ultrasparc3 ; +# RS/6000 & PowerPC +flags gcc OPTIONS power/32 : -m32 ; +flags gcc OPTIONS power/64 : -m64 ; +flags gcc OPTIONS power// : -mcpu=common ; +cpu-flags gcc OPTIONS : power : 403 : -mcpu=403 ; +cpu-flags gcc OPTIONS : power : 505 : -mcpu=505 ; +cpu-flags gcc OPTIONS : power : 601 : -mcpu=601 ; +cpu-flags gcc OPTIONS : power : 602 : -mcpu=602 ; +cpu-flags gcc OPTIONS : power : 603 : -mcpu=603 ; +cpu-flags gcc OPTIONS : power : 603e : -mcpu=603e ; +cpu-flags gcc OPTIONS : power : 604 : -mcpu=604 ; +cpu-flags gcc OPTIONS : power : 604e : -mcpu=604e ; +cpu-flags gcc OPTIONS : power : 620 : -mcpu=620 ; +cpu-flags gcc OPTIONS : power : 630 : -mcpu=630 ; +cpu-flags gcc OPTIONS : power : 740 : -mcpu=740 ; +cpu-flags gcc OPTIONS : power : 7400 : -mcpu=7400 ; +cpu-flags gcc OPTIONS : power : 7450 : -mcpu=7450 ; +cpu-flags gcc OPTIONS : power : 750 : -mcpu=750 ; +cpu-flags gcc OPTIONS : power : 801 : -mcpu=801 ; +cpu-flags gcc OPTIONS : power : 821 : -mcpu=821 ; +cpu-flags gcc OPTIONS : power : 823 : -mcpu=823 ; +cpu-flags gcc OPTIONS : power : 860 : -mcpu=860 ; +cpu-flags gcc OPTIONS : power : 970 : -mcpu=970 ; +cpu-flags gcc OPTIONS : power : 8540 : -mcpu=8540 ; +cpu-flags gcc OPTIONS : power : power : -mcpu=power ; +cpu-flags gcc OPTIONS : power : power2 : -mcpu=power2 ; +cpu-flags gcc OPTIONS : power : power3 : -mcpu=power3 ; +cpu-flags gcc OPTIONS : power : power4 : -mcpu=power4 ; +cpu-flags gcc OPTIONS : power : power5 : -mcpu=power5 ; +cpu-flags gcc OPTIONS : power : powerpc : -mcpu=powerpc ; +cpu-flags gcc OPTIONS : power : powerpc64 : -mcpu=powerpc64 ; +cpu-flags gcc OPTIONS : power : rios : -mcpu=rios ; +cpu-flags gcc OPTIONS : power : rios1 : -mcpu=rios1 ; +cpu-flags gcc OPTIONS : power : rios2 : -mcpu=rios2 ; +cpu-flags gcc OPTIONS : power : rsc : -mcpu=rsc ; +cpu-flags gcc OPTIONS : power : rs64a : -mcpu=rs64 ; +# AIX variant of RS/6000 & PowerPC +flags gcc OPTIONS power/32/aix : -maix32 ; +flags gcc OPTIONS power/64/aix : -maix64 ; +flags gcc AROPTIONS power/64/aix : "-X 64" ; diff --git a/v2/tools/kylix.jam b/v2/tools/kylix.jam deleted file mode 100644 index 342aee089..000000000 --- a/v2/tools/kylix.jam +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2003 Vladimir Prus -# 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) - -# Support for the Borland's Kylix command line compiler - -import toolset ; - -toolset.register kylix ; - -toolset.inherit kylix : borland ; - -COMPILER_NAME = bc++ ; -LINKER_NAME = bc++ ; - -actions link bind LIBRARIES -{ - $(LINKER_NAME) $(OPTIONS) -q -L$(LINKPATH) -e$(<[1]) $(>) $(LIBRARIES) lib$(FINDLIBS-ST).a lib$(FINDLIBS-SA).so -} - -