From 13630cf4bdca7bd9bd2af7ed109a7bbc510fb7c8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 06:02:22 +0000 Subject: [PATCH] Merge from trunk. [SVN r33653] --- v2/build/generators.jam | 6 +- v2/changes.txt | 94 ++++++++++++++++++++++++++++++- v2/doc/src/advanced.xml | 105 +++++++++++++++++++++++++++++++++++ v2/example/make/Jamroot | 2 +- v2/test/boostbook/a.hpp | 5 ++ v2/test/example_libraries.py | 22 ++++++++ v2/test/example_qt4.py | 26 +++++++++ v2/test/test_all.py | 7 +-- v2/tools/make.jam | 7 ++- v2/tools/sun.jam | 1 - 10 files changed, 262 insertions(+), 13 deletions(-) create mode 100644 v2/test/example_libraries.py create mode 100644 v2/test/example_qt4.py diff --git a/v2/build/generators.jam b/v2/build/generators.jam index 511f78082..7390f945c 100644 --- a/v2/build/generators.jam +++ b/v2/build/generators.jam @@ -271,7 +271,7 @@ class generator : sources + # Source targets. ) { - generators.dout [ indent ] " generator" $(self.id) ; + generators.dout [ indent ] " ** generator" $(self.id) ; generators.dout [ indent ] " multiple:" $(mutliple) ; generators.dout [ indent ] " composing:" $(self.composing) ; @@ -353,7 +353,6 @@ class generator # If this is 1->1 transformation, apply it to all consumed targets in order. if ! $(self.source-types[2]) && ! $(self.composing) { - generators.dout [ indent ] "alt1" ; for local r in $(consumed) { result += [ generated-targets $(r) : $(property-set) : $(project) $(name) ] ; #(targets) ; @@ -361,7 +360,6 @@ class generator } else { - generators.dout [ indent ] "alt2 : consumed is" $(consumed) ; if $(consumed) { result += [ generated-targets $(consumed) : $(property-set) @@ -859,7 +857,7 @@ local rule try-one-generator ( project name ? : generator : ! [ set.intersection $(source-types) : $(viable-source-types) ] { local id = [ $(generator).id ] ; - generators.dout [ indent ] "generator '$(id)' pruned" ; + generators.dout [ indent ] " ** generator '$(id)' pruned" ; #generators.dout [ indent ] "source-types" '$(source-types)' ; #generators.dout [ indent ] "viable-source-types" '$(viable-source-types)' ; } diff --git a/v2/changes.txt b/v2/changes.txt index 1bdf422af..3f7bb7021 100644 --- a/v2/changes.txt +++ b/v2/changes.txt @@ -1,5 +1,97 @@ -Milestone 10 () +Milestone 11 (not yet released) + +Changes in this release: + + - New C++ compilers: IBM xlf, HP aCC, HP CXX, Intel fortran compiler. + - New tools: Qt4 support, MS message compiler and IDL compiler. + - New main targets: 'notfile' and 'cast'. + + - Core changes: + + - Only one file required at top level of a project, named Jamroot. + - Jamfiles can now contain project-specific help messages. + - "Indirect conditional requirements" introduced + (http://tinyurl.com/mn3jp) + - Strip suffix in main target names when computing names of generated + files (URL) + - The 'source-location' project attribute can contain + several directories. + - Usage requirements are propagated not only direct dependents, + but to indirect dependents. + + - Command line option changes (see http://tinyurl.com/zbycz) + - New option --build-dir + - The --clean option cleans only target below the current directory, + not globally. + - New --clean-all option was added. + - New option --debug-building + - Running "bjam some_directory" works even if there's no Jamfile + in the current directory. + + - Toolset improvements: + - Assembling support with gcc, borland and msvc. + - Support amd64/ia64 cross-compiling with msvc. + - Improved, registry-based autodetection for msvc. + - Serialize execution of gcc.link actions + - Precompiled headers supported on MSVC + (Need documentation) + + - New features and + - The 'glob' rule accepts wildcards in directory names. + - The 'stage' rule was renamed to 'install' + (the old name still available for compatibility) + - The feature can accept user-defined function as value + (URL) + - The 'install' rule can install a directory hierarchy preserving relative + paths. + - The 'install' rule no longer allows to change library + name during install. + - The Jamfile referred via 'use-project' may declare project id different + from the one in 'use-project'. + - The 'using' rule now searches the directory of containing Jamfile. + + +The following bugs were fixed: + + - The feature was ignored for static linking + - Fix #include scanning for C files. + - Child projects were sometimes loaded before parent projects. + - Fix project references with absolute paths on Windows. + - The feature was ignored for 'install' targets. + - A generator having the same type in sources and targets was causing hang. + - Use 'icpc' command for Intel, fixing errors with 8.1 and higher. + - Generation of PS files with the FOP tool really produces .PS files. + - No dependency scanning was done for C files. + - The 'constant' and 'path-constant' rules did not accept multi-element + value. + - Don't pass -fcoalesce-templates to gcc on OSX 10.4 + - Fix static lib suffix on OSX. + - Fix rpath setting on Intel/Linux. + - The 'install' rule don't unnecessary scans #includes in installed + headers. + + +Developer visible changes: + + - Ability to customize type's prefix depending on build properties. + - Generator's 'run' method can return usage-requirements. + - Main target rule is automatically declared for each new target type. + - 'Link incompatible' feature attribute was removed + - Generators no longer bypass unhandled sources, they just ignore them. + - If there are several applicable generators, immediately report ambiguity. + Provide a way to explicitly resolve conflicts between generators. + - The 'flags' rule can match absense of feature. + - Great improvement in response files handling + - The 'toolset.flags' rules allows value-less feature to signify + absense of this feature (fix hack-hack). + - Automatically declare main target rule for each declared target type. + - When inheriting types, inherit generators for the base type, as opposed + to using various hacks to invoke base generators when needed. + - Improve diagnostic for "duplicate actual target" and generator ambiguity. + + +Milestone 10 (October 29, 2004) Changes in this release: diff --git a/v2/doc/src/advanced.xml b/v2/doc/src/advanced.xml index 5e3c18a7b..553e85377 100644 --- a/v2/doc/src/advanced.xml +++ b/v2/doc/src/advanced.xml @@ -200,6 +200,51 @@ import module : rule ; + + + Sometimes, you'd need to specify the actual command lines to be used + when creating targets. In jam language, you use named actions to do this. + For example: + +actions create-file-from-another +{ + create-file-from-another $(<) $(>) +} + + This specifies a named action called + create-file-from-another. The text inside braces is the + command to invoke. The $(<) variable will be expanded to list of + generated files, and the $(>) variable will be expanded + to the list of source files. + + + To flexibly adjust command line, you can define a rule with the + same name as the action, and taking three parameters -- targets, sources + and properties. For example: + +rule create-file-from-another ( targets * : sources * : properties * ) +{ + if <variant>debug in $(properties) + { + OPTIONS on $(targets) = --debug ; + } +} +actions create-file-from-another +{ + create-file-from-another $(OPTIONS) $(<) $(>) +} + + In this example, the rule checks if certain build property is specified. + If so, it sets variable OPIONS that's used inside + action. Note that the variable is set "on targets" -- the value will + be only visible inside action, not globally. Were it set globally, + using variable named OPTIONS in two unrelated + actions would be impossible. + + + More details can be found in Jam reference, + +
@@ -1609,6 +1654,66 @@ unit-test helpers_test are not covered here.
+ +
+ + Raw commands: 'make' and 'notfile' + + Sometimes, the builtin target types are not enough, and you + want Boost.Build to just run specific commands. There are two main + target rules that make it possible: make + and notfile. + + + The make rule is used when you want to + create one file from a number of sources using some specific command. + The notfile is used to unconditionally run + a command. + + + + Suppose you want to create file file.out from + file file.in by running command + in2out. Here's how you'd do this in Boost.Build: + +actions in2out +{ + in2out $(<) $(>) +} +make file.out : file.in : @in2out ; + + If you run bjam and file.out + does not exist, Boost.Build will run the in2out + command to create that file. For more details on specifying actions, + see . + + + + + The make rule is useful to express custom + transformation that are used just once or twice in your project. For + transformations that are used often, you are advised to declare + new generator, as described in . + + + + + It could be that you just want to run some command unconditionally, + and that command does not create any specific files. The, you can use + the notfile rule. For example: + +notfile echo_something : @echo ; +actions echo +{ + echo "something" +} + + The only difference from the make rule is + that the name of the target is not considered a name of a file, so + Boost.Build will unconditionally run the action. + + +
diff --git a/v2/example/make/Jamroot b/v2/example/make/Jamroot index 03724f900..3fb84856f 100644 --- a/v2/example/make/Jamroot +++ b/v2/example/make/Jamroot @@ -7,7 +7,7 @@ exe main : main.cpp ; # Create 'main.cpp' from 'main.cpp.pro' using action # 'do-something' defined below. # -make main.cpp : main.cpp.pro : do-something ; +make main.cpp : main.cpp.pro : @do-something ; # In this example, we'll just copy a file. # Need to find out the name of a command to copy a file. diff --git a/v2/test/boostbook/a.hpp b/v2/test/boostbook/a.hpp index 6375c0a82..8d7ac1b24 100644 --- a/v2/test/boostbook/a.hpp +++ b/v2/test/boostbook/a.hpp @@ -1,7 +1,12 @@ +// Seems like Boostbook does like classes outside of namespaces, +// and won't generate anything for them. +namespace boost { + /// A class class A { public: /// A constructor A(); }; +} \ No newline at end of file diff --git a/v2/test/example_libraries.py b/v2/test/example_libraries.py new file mode 100644 index 000000000..21421f685 --- /dev/null +++ b/v2/test/example_libraries.py @@ -0,0 +1,22 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# 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) + +# Test the 'libraries' example. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/libraries") + +t.run_build_system() + +t.expect_addition(["app/bin/$toolset/debug/app", + "util/foo/bin/$toolset/debug/bar.dll"]) + + +t.cleanup() diff --git a/v2/test/example_qt4.py b/v2/test/example_qt4.py new file mode 100644 index 000000000..e10423d1d --- /dev/null +++ b/v2/test/example_qt4.py @@ -0,0 +1,26 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# 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) + +# Test the 'qt4' examples. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/qt/qt4/hello") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/arrow"]) + +t.set_tree("../example/qt/qt4/moccable-cpp") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/main"]) + +t.set_tree("../example/qt/qt4/uic") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/hello"]) + +t.cleanup() diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 298359b05..56d571864 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -140,6 +140,7 @@ tests = [ "rebuilds", "clean", "lib_source_property", "implicit_dependency", + "example_libraries", ] if os.name == 'posix': @@ -155,13 +156,9 @@ if os.name == 'posix': if string.find(get_toolset(), 'gcc') == 0: tests.append("gcc_runtime") -if os.environ.has_key('QTDIR'): - tests.append("railsys") -else: - print 'skipping railsys test since QTDIR environment variable is unset' - if "--extras" in sys.argv: tests.append("boostbook") + tests.append("example_qt4") else: print 'Note: skipping extra tests' diff --git a/v2/tools/make.jam b/v2/tools/make.jam index 0caee31df..bd00ae92e 100644 --- a/v2/tools/make.jam +++ b/v2/tools/make.jam @@ -47,7 +47,12 @@ rule make ( target-name : sources * : generating-rule + : requirements * ) # The '@' sign causes the feature.jam module to qualify rule name # with the module name of current project, if needed. - requirements += @$(generating-rule) ; + local m = [ MATCH ^(@).* : $(generating-rule) ] ; + if ! $(m) + { + generating-rule = @$(generating-rule) ; + } + requirements += $(generating-rule) ; targets.main-target-alternative [ new make-target-class $(target-name) : $(project) diff --git a/v2/tools/sun.jam b/v2/tools/sun.jam index 0c951a35f..e00799d58 100644 --- a/v2/tools/sun.jam +++ b/v2/tools/sun.jam @@ -16,7 +16,6 @@ feature.extend toolset : sun ; toolset.inherit sun : unix ; generators.override sun.prebuilt : builtin.lib-generator ; generators.override sun.searched-lib-generator : searched-lib-generator ; -feature.subfeature toolset sun : version ; feature.extend stdlib : sun-stlport ; feature.compose sun-stlport