|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49353 - in branches/release/tools/build/v2: . build contrib doc doc/src example/customization example/generate example/generator example/gettext example/hello example/libraries example/libraries/app example/libraries/util/foo example/make example/pch example/python_modules example/qt example/qt/qt3/hello example/qt/qt3/moccable-cpp example/qt/qt3/uic example/qt/qt4/hello example/qt/qt4/moccable-cpp example/qt/qt4/uic example/variant example/variant/libs example/versioned kernel test test/boostbook test/dependency-test test/direct-request-test test/generators-test test/generators-test/lib test/prebuilt test/prebuilt/ext test/project-test1 test/project-test1/dir test/project-test1/dir2 test/project-test3 test/project-test3/lib test/project-test3/lib2 test/project-test3/lib2/helper test/project-test3/lib3 test/project-test4 test/project-test4/lib test/project-test4/lib2 test/qt4 test/railsys/libx test/railsys/libx/src test/railsys/program test/railsys/program/liba test/railsys/program/main test/test2 test/unused test/v1-testing test/v1_testing tools tools/types util
From: ghost_at_[hidden]
Date: 2008-10-16 04:42:25
Author: vladimir_prus
Date: 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
New Revision: 49353
URL: http://svn.boost.org/trac/boost/changeset/49353
Log:
Wholesale Boost.Build merge from the trunk
Added:
branches/release/tools/build/v2/contrib/wxFormBuilder.jam
- copied unchanged from r49352, /trunk/tools/build/v2/contrib/wxFormBuilder.jam
branches/release/tools/build/v2/doc/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/doc/jamfile.jam
branches/release/tools/build/v2/example/customization/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/customization/jamfile.jam
branches/release/tools/build/v2/example/customization/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/customization/jamroot.jam
branches/release/tools/build/v2/example/generate/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/generate/jamroot.jam
branches/release/tools/build/v2/example/generator/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/generator/jamroot.jam
branches/release/tools/build/v2/example/gettext/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/gettext/jamfile.jam
branches/release/tools/build/v2/example/gettext/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/gettext/jamroot.jam
branches/release/tools/build/v2/example/hello/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/hello/jamroot.jam
branches/release/tools/build/v2/example/hello/readme.txt
- copied unchanged from r49352, /trunk/tools/build/v2/example/hello/readme.txt
branches/release/tools/build/v2/example/libraries/app/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/libraries/app/jamfile.jam
branches/release/tools/build/v2/example/libraries/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/libraries/jamroot.jam
branches/release/tools/build/v2/example/libraries/util/foo/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/libraries/util/foo/jamfile.jam
branches/release/tools/build/v2/example/make/foo.py
- copied unchanged from r49352, /trunk/tools/build/v2/example/make/foo.py
branches/release/tools/build/v2/example/make/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/make/jamroot.jam
branches/release/tools/build/v2/example/pch/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/pch/jamroot.jam
branches/release/tools/build/v2/example/python_modules/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/python_modules/jamroot.jam
branches/release/tools/build/v2/example/qt/qt3/hello/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/qt/qt3/hello/jamroot.jam
branches/release/tools/build/v2/example/qt/qt3/moccable-cpp/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/qt/qt3/moccable-cpp/jamroot.jam
branches/release/tools/build/v2/example/qt/qt3/uic/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/qt/qt3/uic/jamroot.jam
branches/release/tools/build/v2/example/qt/qt4/hello/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/qt/qt4/hello/jamroot.jam
branches/release/tools/build/v2/example/qt/qt4/moccable-cpp/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/qt/qt4/moccable-cpp/jamroot.jam
branches/release/tools/build/v2/example/qt/qt4/uic/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/qt/qt4/uic/jamroot.jam
branches/release/tools/build/v2/example/variant/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/variant/jamfile.jam
branches/release/tools/build/v2/example/variant/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/variant/jamroot.jam
branches/release/tools/build/v2/example/variant/libs/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/variant/libs/jamfile.jam
branches/release/tools/build/v2/example/versioned/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/example/versioned/jamroot.jam
branches/release/tools/build/v2/test/boostbook/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/boostbook/jamroot.jam
branches/release/tools/build/v2/test/dependency-test/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/dependency-test/jamfile.jam
branches/release/tools/build/v2/test/dependency-test/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/dependency-test/jamroot.jam
branches/release/tools/build/v2/test/direct-request-test/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/direct-request-test/jamfile.jam
branches/release/tools/build/v2/test/direct-request-test/jamfile2.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/direct-request-test/jamfile2.jam
branches/release/tools/build/v2/test/direct-request-test/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/direct-request-test/jamroot.jam
branches/release/tools/build/v2/test/generator_selection.py
- copied unchanged from r49352, /trunk/tools/build/v2/test/generator_selection.py
branches/release/tools/build/v2/test/generators-test/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/generators-test/jamfile.jam
branches/release/tools/build/v2/test/generators-test/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/generators-test/jamroot.jam
branches/release/tools/build/v2/test/generators-test/lib/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/generators-test/lib/jamfile.jam
branches/release/tools/build/v2/test/inherited_dependency.py
- copied unchanged from r49352, /trunk/tools/build/v2/test/inherited_dependency.py
branches/release/tools/build/v2/test/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/jamfile.jam
branches/release/tools/build/v2/test/ordered_include.py
- copied unchanged from r49352, /trunk/tools/build/v2/test/ordered_include.py
branches/release/tools/build/v2/test/prebuilt/ext/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/prebuilt/ext/jamfile.jam
branches/release/tools/build/v2/test/prebuilt/ext/jamfile2.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/prebuilt/ext/jamfile2.jam
branches/release/tools/build/v2/test/prebuilt/ext/jamfile3.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/prebuilt/ext/jamfile3.jam
branches/release/tools/build/v2/test/prebuilt/ext/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/prebuilt/ext/jamroot.jam
branches/release/tools/build/v2/test/prebuilt/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/prebuilt/jamfile.jam
branches/release/tools/build/v2/test/prebuilt/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/prebuilt/jamroot.jam
branches/release/tools/build/v2/test/project-test1/dir/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test1/dir/jamfile.jam
branches/release/tools/build/v2/test/project-test1/dir2/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test1/dir2/jamfile.jam
branches/release/tools/build/v2/test/project-test1/dir2/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test1/dir2/jamroot.jam
branches/release/tools/build/v2/test/project-test1/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test1/jamfile.jam
branches/release/tools/build/v2/test/project-test1/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test1/jamroot.jam
branches/release/tools/build/v2/test/project-test3/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test3/jamfile.jam
branches/release/tools/build/v2/test/project-test3/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test3/jamroot.jam
branches/release/tools/build/v2/test/project-test3/lib/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test3/lib/jamfile.jam
branches/release/tools/build/v2/test/project-test3/lib2/helper/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test3/lib2/helper/jamfile.jam
branches/release/tools/build/v2/test/project-test3/lib2/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test3/lib2/jamfile.jam
branches/release/tools/build/v2/test/project-test3/lib3/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test3/lib3/jamfile.jam
branches/release/tools/build/v2/test/project-test3/lib3/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test3/lib3/jamroot.jam
branches/release/tools/build/v2/test/project-test4/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/jamfile.jam
branches/release/tools/build/v2/test/project-test4/jamfile3.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/jamfile3.jam
branches/release/tools/build/v2/test/project-test4/jamfile4.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/jamfile4.jam
branches/release/tools/build/v2/test/project-test4/jamfile5.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/jamfile5.jam
branches/release/tools/build/v2/test/project-test4/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/jamroot.jam
branches/release/tools/build/v2/test/project-test4/lib/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/lib/jamfile.jam
branches/release/tools/build/v2/test/project-test4/lib/jamfile1.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/lib/jamfile1.jam
branches/release/tools/build/v2/test/project-test4/lib/jamfile2.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/lib/jamfile2.jam
branches/release/tools/build/v2/test/project-test4/lib/jamfile3.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/lib/jamfile3.jam
branches/release/tools/build/v2/test/project-test4/lib2/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/lib2/jamfile.jam
branches/release/tools/build/v2/test/project-test4/lib2/jamfile2.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/project-test4/lib2/jamfile2.jam
branches/release/tools/build/v2/test/qt4/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/qt4/jamroot.jam
branches/release/tools/build/v2/test/railsys/libx/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/railsys/libx/jamroot.jam
branches/release/tools/build/v2/test/railsys/libx/src/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/railsys/libx/src/jamfile.jam
branches/release/tools/build/v2/test/railsys/program/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/railsys/program/jamfile.jam
branches/release/tools/build/v2/test/railsys/program/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/railsys/program/jamroot.jam
branches/release/tools/build/v2/test/railsys/program/liba/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/railsys/program/liba/jamfile.jam
branches/release/tools/build/v2/test/railsys/program/main/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/railsys/program/main/jamfile.jam
branches/release/tools/build/v2/test/test2/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/test2/jamfile.jam
branches/release/tools/build/v2/test/test_result_dumping.py
- copied unchanged from r49352, /trunk/tools/build/v2/test/test_result_dumping.py
branches/release/tools/build/v2/test/testing_support.py
- copied unchanged from r49352, /trunk/tools/build/v2/test/testing_support.py
branches/release/tools/build/v2/test/unused/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/unused/jamfile.jam
branches/release/tools/build/v2/test/unused/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/unused/jamroot.jam
branches/release/tools/build/v2/test/v1-testing/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/v1-testing/jamfile.jam
branches/release/tools/build/v2/test/v1_testing/jamfile.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/v1_testing/jamfile.jam
branches/release/tools/build/v2/test/v1_testing/jamroot.jam
- copied unchanged from r49352, /trunk/tools/build/v2/test/v1_testing/jamroot.jam
branches/release/tools/build/v2/tools/message.jam
- copied unchanged from r49352, /trunk/tools/build/v2/tools/message.jam
Removed:
branches/release/tools/build/v2/doc/Jamfile.v2
branches/release/tools/build/v2/example/customization/Jamfile
branches/release/tools/build/v2/example/customization/project-root.jam
branches/release/tools/build/v2/example/generate/Jamroot
branches/release/tools/build/v2/example/generator/Jamroot
branches/release/tools/build/v2/example/gettext/Jamfile
branches/release/tools/build/v2/example/gettext/project-root.jam
branches/release/tools/build/v2/example/hello/Jamroot
branches/release/tools/build/v2/example/libraries/Jamroot
branches/release/tools/build/v2/example/libraries/app/Jamfile
branches/release/tools/build/v2/example/libraries/util/foo/Jamfile
branches/release/tools/build/v2/example/make/Jamroot
branches/release/tools/build/v2/example/pch/Jamroot
branches/release/tools/build/v2/example/python_modules/Jamroot
branches/release/tools/build/v2/example/qt/qt3/hello/Jamroot
branches/release/tools/build/v2/example/qt/qt3/moccable-cpp/Jamroot
branches/release/tools/build/v2/example/qt/qt3/uic/Jamroot
branches/release/tools/build/v2/example/qt/qt4/hello/Jamroot
branches/release/tools/build/v2/example/qt/qt4/moccable-cpp/Jamroot
branches/release/tools/build/v2/example/qt/qt4/uic/Jamroot
branches/release/tools/build/v2/example/variant/Jamfile
branches/release/tools/build/v2/example/variant/libs/Jamfile
branches/release/tools/build/v2/example/variant/project-root.jam
branches/release/tools/build/v2/example/versioned/project-root.jam
branches/release/tools/build/v2/generators_prototype.py
branches/release/tools/build/v2/test/Jamfile
branches/release/tools/build/v2/test/boostbook/Jamroot
branches/release/tools/build/v2/test/dependency-test/Jamfile
branches/release/tools/build/v2/test/dependency-test/project-root.jam
branches/release/tools/build/v2/test/direct-request-test/Jamfile
branches/release/tools/build/v2/test/direct-request-test/Jamfile2
branches/release/tools/build/v2/test/direct-request-test/project-root.jam
branches/release/tools/build/v2/test/generators-test/Jamfile
branches/release/tools/build/v2/test/generators-test/lib/Jamfile
branches/release/tools/build/v2/test/generators-test/project-root.jam
branches/release/tools/build/v2/test/prebuilt/Jamfile
branches/release/tools/build/v2/test/prebuilt/ext/Jamfile
branches/release/tools/build/v2/test/prebuilt/ext/Jamfile2
branches/release/tools/build/v2/test/prebuilt/ext/Jamfile3
branches/release/tools/build/v2/test/prebuilt/ext/project-root.jam
branches/release/tools/build/v2/test/prebuilt/project-root.jam
branches/release/tools/build/v2/test/project-test1/Jamfile
branches/release/tools/build/v2/test/project-test1/dir/Jamfile
branches/release/tools/build/v2/test/project-test1/dir2/Jamfile
branches/release/tools/build/v2/test/project-test1/dir2/project-root.jam
branches/release/tools/build/v2/test/project-test1/project-root.jam
branches/release/tools/build/v2/test/project-test3/Jamfile
branches/release/tools/build/v2/test/project-test3/lib/Jamfile
branches/release/tools/build/v2/test/project-test3/lib2/Jamfile
branches/release/tools/build/v2/test/project-test3/lib2/helper/Jamfile
branches/release/tools/build/v2/test/project-test3/lib3/Jamfile
branches/release/tools/build/v2/test/project-test3/lib3/project-root.jam
branches/release/tools/build/v2/test/project-test3/project-root.jam
branches/release/tools/build/v2/test/project-test4/Jamfile
branches/release/tools/build/v2/test/project-test4/Jamfile3
branches/release/tools/build/v2/test/project-test4/Jamfile4
branches/release/tools/build/v2/test/project-test4/Jamfile5
branches/release/tools/build/v2/test/project-test4/lib/Jamfile
branches/release/tools/build/v2/test/project-test4/lib/Jamfile1
branches/release/tools/build/v2/test/project-test4/lib/Jamfile2
branches/release/tools/build/v2/test/project-test4/lib/Jamfile3
branches/release/tools/build/v2/test/project-test4/lib2/Jamfile
branches/release/tools/build/v2/test/project-test4/lib2/Jamfile2
branches/release/tools/build/v2/test/project-test4/project-root.jam
branches/release/tools/build/v2/test/qt4/Jamroot
branches/release/tools/build/v2/test/railsys/libx/project-root.jam
branches/release/tools/build/v2/test/railsys/libx/src/Jamfile
branches/release/tools/build/v2/test/railsys/program/Jamfile
branches/release/tools/build/v2/test/railsys/program/liba/Jamfile
branches/release/tools/build/v2/test/railsys/program/main/Jamfile
branches/release/tools/build/v2/test/railsys/program/project-root.jam
branches/release/tools/build/v2/test/test2/Jamfile
branches/release/tools/build/v2/test/unused/Jamfile
branches/release/tools/build/v2/test/unused/project-root.jam
branches/release/tools/build/v2/test/v1-testing/Jamfile
branches/release/tools/build/v2/test/v1_testing/Jamfile
branches/release/tools/build/v2/test/v1_testing/project-root.jam
Text files modified:
branches/release/tools/build/v2/build-system.jam | 46
branches/release/tools/build/v2/build/alias.jam | 18
branches/release/tools/build/v2/build/build-request.jam | 47 +
branches/release/tools/build/v2/build/feature.jam | 12
branches/release/tools/build/v2/build/generators.jam | 493 ++++++++-----
branches/release/tools/build/v2/build/project.jam | 126 +-
branches/release/tools/build/v2/build/property-set.jam | 12
branches/release/tools/build/v2/build/property.jam | 49 +
branches/release/tools/build/v2/build/targets.jam | 120 +-
branches/release/tools/build/v2/build/toolset.jam | 46
branches/release/tools/build/v2/build/type.jam | 112 +-
branches/release/tools/build/v2/build/virtual-target.jam | 123 +-
branches/release/tools/build/v2/doc/src/advanced.xml | 435 ++++++-----
branches/release/tools/build/v2/doc/src/faq.xml | 528 ++++++++------
branches/release/tools/build/v2/doc/src/reference.xml | 85 +
branches/release/tools/build/v2/doc/src/tasks.xml | 939 +++++++++++++-------------
branches/release/tools/build/v2/example/customization/readme.txt | 10
branches/release/tools/build/v2/example/customization/usage.verbatim | 5
branches/release/tools/build/v2/example/generate/REAME.txt | 18
branches/release/tools/build/v2/example/generator/README.txt | 7
branches/release/tools/build/v2/example/gettext/readme.txt | 13
branches/release/tools/build/v2/example/make/main_cpp.pro | 3
branches/release/tools/build/v2/example/make/readme.txt | 10
branches/release/tools/build/v2/example/python_modules/readme.txt | 15
branches/release/tools/build/v2/example/qt/README.txt | 15
branches/release/tools/build/v2/example/variant/readme.txt | 16
branches/release/tools/build/v2/index.html | 2
branches/release/tools/build/v2/kernel/modules.jam | 2
branches/release/tools/build/v2/nightly.sh | 2
branches/release/tools/build/v2/roll.sh | 6
branches/release/tools/build/v2/test/BoostBuild.py | 67
branches/release/tools/build/v2/test/abs_workdir.py | 10
branches/release/tools/build/v2/test/absolute_sources.py | 64
branches/release/tools/build/v2/test/alias.py | 21
branches/release/tools/build/v2/test/alternatives.py | 79 +-
branches/release/tools/build/v2/test/bad_dirname.py | 19
branches/release/tools/build/v2/test/boostbook.py | 12
branches/release/tools/build/v2/test/build_dir.py | 90 +-
branches/release/tools/build/v2/test/build_file.py | 42
branches/release/tools/build/v2/test/build_no.py | 27
branches/release/tools/build/v2/test/c_file.py | 22
branches/release/tools/build/v2/test/chain.py | 40
branches/release/tools/build/v2/test/clean.py | 50
branches/release/tools/build/v2/test/composite.py | 18
branches/release/tools/build/v2/test/conditionals.py | 8
branches/release/tools/build/v2/test/conditionals2.py | 8
branches/release/tools/build/v2/test/conditionals3.py | 8
branches/release/tools/build/v2/test/conditionals_multiple.py | 7
branches/release/tools/build/v2/test/configuration.py | 5
branches/release/tools/build/v2/test/core_d12.py | 15
branches/release/tools/build/v2/test/core_delete_module.py | 12
branches/release/tools/build/v2/test/core_dependencies.py | 73 +-
branches/release/tools/build/v2/test/core_import_module.py | 29
branches/release/tools/build/v2/test/core_modifiers.py | 27
branches/release/tools/build/v2/test/core_varnames.py | 9
branches/release/tools/build/v2/test/custom_generator.py | 28
branches/release/tools/build/v2/test/default_build.py | 64
branches/release/tools/build/v2/test/default_features.py | 34
branches/release/tools/build/v2/test/default_toolset.py | 6
branches/release/tools/build/v2/test/dependency_property.py | 27
branches/release/tools/build/v2/test/dependency_test.py | 53
branches/release/tools/build/v2/test/direct_request_test.py | 44
branches/release/tools/build/v2/test/disambiguation.py | 33
branches/release/tools/build/v2/test/dll_path.py | 91 +-
branches/release/tools/build/v2/test/double_loading.py | 19
branches/release/tools/build/v2/test/duplicate.py | 37
branches/release/tools/build/v2/test/example_customization.py | 18
branches/release/tools/build/v2/test/example_gettext.py | 17
branches/release/tools/build/v2/test/example_libraries.py | 17
branches/release/tools/build/v2/test/example_make.py | 20
branches/release/tools/build/v2/test/example_qt4.py | 6
branches/release/tools/build/v2/test/expansion.py | 65 -
branches/release/tools/build/v2/test/explicit.py | 38
branches/release/tools/build/v2/test/file_name_handling.py | 5
branches/release/tools/build/v2/test/free_features_request.py | 29
branches/release/tools/build/v2/test/gcc_runtime.py | 24
branches/release/tools/build/v2/test/generators_test.py | 35
branches/release/tools/build/v2/test/implicit_dependency.py | 30
branches/release/tools/build/v2/test/indirect_conditional.py | 34
branches/release/tools/build/v2/test/inherit_toolset.py | 67 -
branches/release/tools/build/v2/test/inline.py | 42
branches/release/tools/build/v2/test/lib_source_property.py | 32
branches/release/tools/build/v2/test/library_chain.py | 103 +-
branches/release/tools/build/v2/test/library_order.py | 80 -
branches/release/tools/build/v2/test/library_property.py | 42
branches/release/tools/build/v2/test/load_dir.py | 29
branches/release/tools/build/v2/test/load_order.py | 55
branches/release/tools/build/v2/test/loop.py | 25
branches/release/tools/build/v2/test/m1-01.py | 28
branches/release/tools/build/v2/test/m1-02.py | 44
branches/release/tools/build/v2/test/m1-03.py | 20
branches/release/tools/build/v2/test/make_rule.py | 48
branches/release/tools/build/v2/test/module_actions.py | 2
branches/release/tools/build/v2/test/ndebug.py | 39
branches/release/tools/build/v2/test/no_type.py | 15
branches/release/tools/build/v2/test/notfile.py | 30
branches/release/tools/build/v2/test/ordered_properties.py | 36
branches/release/tools/build/v2/test/out_of_tree.py | 43
branches/release/tools/build/v2/test/path_features.py | 40
branches/release/tools/build/v2/test/pch.py | 63 -
branches/release/tools/build/v2/test/prebuilt.py | 40
branches/release/tools/build/v2/test/print.py | 13
branches/release/tools/build/v2/test/project_dependencies.py | 44
branches/release/tools/build/v2/test/project_glob.py | 123 +--
branches/release/tools/build/v2/test/project_root_constants.py | 34
branches/release/tools/build/v2/test/project_root_rule.py | 38
branches/release/tools/build/v2/test/project_test1.py | 17
branches/release/tools/build/v2/test/project_test3.py | 39
branches/release/tools/build/v2/test/project_test4.py | 31
branches/release/tools/build/v2/test/property_expansion.py | 19
branches/release/tools/build/v2/test/qt4.py | 17
branches/release/tools/build/v2/test/railsys.py | 10
branches/release/tools/build/v2/test/rebuilds.py | 8
branches/release/tools/build/v2/test/regression.py | 66 -
branches/release/tools/build/v2/test/relative_sources.py | 19
branches/release/tools/build/v2/test/remove_requirement.py | 90 -
branches/release/tools/build/v2/test/resolution.py | 33
branches/release/tools/build/v2/test/searched_lib.py | 109 +-
branches/release/tools/build/v2/test/skipping.py | 46
branches/release/tools/build/v2/test/sort_rule.py | 6
branches/release/tools/build/v2/test/source_locations.py | 37
branches/release/tools/build/v2/test/stage.py | 155 ++--
branches/release/tools/build/v2/test/standalone.py | 34
branches/release/tools/build/v2/test/startup_v1.py | 84 -
branches/release/tools/build/v2/test/startup_v2.py | 28
branches/release/tools/build/v2/test/suffix.py | 37
branches/release/tools/build/v2/test/svn_tree.py | 14
branches/release/tools/build/v2/test/symlink.py | 41
branches/release/tools/build/v2/test/tag.py | 24
branches/release/tools/build/v2/test/template.py | 49
branches/release/tools/build/v2/test/test1.py | 5
branches/release/tools/build/v2/test/test2.py | 23
branches/release/tools/build/v2/test/test_all.py | 172 ++--
branches/release/tools/build/v2/test/test_system.html | 19
branches/release/tools/build/v2/test/testing_primitives.py | 19
branches/release/tools/build/v2/test/timedata.py | 121 +++
branches/release/tools/build/v2/test/tree.py | 18
branches/release/tools/build/v2/test/unit_test.py | 17
branches/release/tools/build/v2/test/unit_tests.py | 5
branches/release/tools/build/v2/test/unused.py | 19
branches/release/tools/build/v2/test/use_requirements.py | 272 ++----
branches/release/tools/build/v2/test/using.py | 36
branches/release/tools/build/v2/test/v1_testing.py | 30
branches/release/tools/build/v2/test/wrapper.py | 38
branches/release/tools/build/v2/test/wrong_project.py | 31
branches/release/tools/build/v2/tools/acc.jam | 17
branches/release/tools/build/v2/tools/boostbook-config.jam | 8
branches/release/tools/build/v2/tools/builtin.jam | 117 ++-
branches/release/tools/build/v2/tools/cast.jam | 64
branches/release/tools/build/v2/tools/common.jam | 106 +-
branches/release/tools/build/v2/tools/cw.jam | 5
branches/release/tools/build/v2/tools/darwin.jam | 6
branches/release/tools/build/v2/tools/gcc.jam | 465 +++++++-----
branches/release/tools/build/v2/tools/generate.jam | 36
branches/release/tools/build/v2/tools/hp_cxx.jam | 15
branches/release/tools/build/v2/tools/intel-win.jam | 109 +-
branches/release/tools/build/v2/tools/make.jam | 29
branches/release/tools/build/v2/tools/msvc.jam | 1399 +++++++++++++++++++++------------------
branches/release/tools/build/v2/tools/package.jam | 121 +-
branches/release/tools/build/v2/tools/python.jam | 9
branches/release/tools/build/v2/tools/qcc.jam | 238 +++---
branches/release/tools/build/v2/tools/stage.jam | 14
branches/release/tools/build/v2/tools/testing.jam | 293 ++++---
branches/release/tools/build/v2/tools/types/exe.jam | 8
branches/release/tools/build/v2/tools/types/lib.jam | 24
branches/release/tools/build/v2/tools/types/obj.jam | 8
branches/release/tools/build/v2/tools/vacpp.jam | 2
branches/release/tools/build/v2/util/doc.jam | 8
branches/release/tools/build/v2/util/numbers.jam | 69 -
branches/release/tools/build/v2/util/option.jam | 42
branches/release/tools/build/v2/util/path.jam | 63
branches/release/tools/build/v2/util/regex.jam | 133 ++-
branches/release/tools/build/v2/util/sequence.jam | 4
branches/release/tools/build/v2/util/utility.jam | 222 ++++--
174 files changed, 5928 insertions(+), 5570 deletions(-)
Modified: branches/release/tools/build/v2/build-system.jam
==============================================================================
--- branches/release/tools/build/v2/build-system.jam (original)
+++ branches/release/tools/build/v2/build-system.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,7 +5,7 @@
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# This file is part of Boost Build version 2. You can think of it as forming the
-# the main() routine. It is invoked by the bootstrapping code in bootstrap.jam.
+# main() routine. It is invoked by the bootstrapping code in bootstrap.jam.
import build-request ;
import builtin ;
@@ -22,6 +22,7 @@
import sequence ;
import targets ;
import toolset ;
+import utility ;
import version ;
import virtual-target ;
@@ -90,8 +91,8 @@
# Returns the location of the build system. The primary use case is building
-# Boost where it's sometimes needed to get the location of other components
-# (e.g. BoostBook files) and it's convenient to use locations relative to the
+# Boost where it is sometimes needed to get the location of other components
+# (e.g. BoostBook files) and it is convenient to use locations relative to the
# Boost Build path.
#
rule location ( )
@@ -138,7 +139,7 @@
local targets-to-clean ;
for local t in $(.results-of-main-targets)
{
- # Don't include roots or sources.
+ # Do not include roots or sources.
targets-to-clean += [ virtual-target.traverse $(t) ] ;
}
targets-to-clean = [ sequence.unique $(targets-to-clean) ] ;
@@ -169,8 +170,8 @@
# Given a target id, try to find and return the corresponding target. This is
-# only invoked when there's no Jamfile in ".". This code somewhat duplicates
-# code in project-target.find but we can't reuse that code without a
+# only invoked when there is no Jamfile in ".". This code somewhat duplicates
+# code in project-target.find but we can not reuse that code without a
# project-targets instance.
#
local rule find-target ( target-id )
@@ -305,7 +306,7 @@
if $(uq)
{
test-config = $(uq) ;
- }
+ }
if $(test-config)
{
local where =
@@ -350,6 +351,9 @@
local user-config = [ MATCH ^--user-config=(.*)$ : $(.argv) ] ;
user-config = $(user-config[-1]) ;
user-config ?= [ os.environ BOOST_BUILD_USER_CONFIG ] ;
+ # Special handling for the case when the OS does not strip the quotes
+ # around the file name, as is the case when using Cygwin bash.
+ user-config = [ utility.unquote $(user-config) ] ;
local explicitly-requested = $(user-config) ;
user-config ?= user-config.jam ;
@@ -366,7 +370,8 @@
if $(.debug-config)
{
- ECHO "notice: Loading explicitly specified user configuration file:" ;
+ ECHO "notice: Loading explicitly specified user"
+ "configuration file:" ;
ECHO " $(user-config)" ;
}
@@ -407,14 +412,14 @@
if $(.debug-config)
{
- ECHO "notice: [cmdline-cfg] Detected command-line request for"
+ ECHO notice: [cmdline-cfg] Detected command-line request for
$(toolset-version): "toolset=" $(toolset) "version="
$(version) ;
}
- # If the toolset isn't known, configure it now.
+ # If the toolset is not known, configure it now.
local known ;
- if $(toolset) in [ feature.values <toolset> ]
+ if $(toolset) in [ feature.values <toolset> ]
{
known = true ;
}
@@ -423,6 +428,14 @@
{
known = ;
}
+ # TODO: we should do 'using $(toolset)' in case no version has been
+ # specified and there are no versions defined for the given toolset to
+ # allow the toolset to configure its default version. For this we need
+ # to know how to detect whether a given toolset has any versions
+ # defined. An alternative would be to do this whenever version is not
+ # specified but that would require that toolsets correctly handle the
+ # case when their default version is configured multiple times which
+ # should be checked for all existing toolsets first.
if ! $(known)
{
@@ -443,13 +456,14 @@
}
# Make sure we get an appropriate property into the build request in
- # case toolset was specified using the "--toolset=..." command-line
+ # case toolset has been specified using the "--toolset=..." command-line
# option form.
if ! $(t) in $(.argv) && ! $(t) in $(feature-toolsets)
{
if $(.debug-config)
{
- ECHO notice: [cmdline-cfg] adding toolset=$(t) "to build request." ;
+ ECHO notice: [cmdline-cfg] adding toolset=$(t) to the build
+ request. ;
}
extra-properties += toolset=$(t) ;
}
@@ -546,7 +560,7 @@
ECHO "warning: No toolsets are configured." ;
ECHO "warning: Configuring default toolset" \"$(default-toolset)\". ;
ECHO "warning: If the default is wrong, your build may not work correctly." ;
- ECHO "warning: Use the \"--toolset=xxxxx\" option to override our guess." ;
+ ECHO "warning: Use the \"toolset=xxxxx\" option to override our guess." ;
ECHO "warning: For more configuration options, please consult" ;
ECHO "warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html" ;
@@ -615,7 +629,7 @@
local virtual-targets ;
local actual-targets ;
-
+
# Process each target specified on the command-line and convert it into
# internal Boost Build target objects. Detect special clean target. If no
# main Boost Build targets were explictly requested use the current project
@@ -641,7 +655,7 @@
if ! $(t)
{
ECHO "notice: could not find main target" $(id) ;
- ECHO "notice: assuming it's a name of file to create." ;
+ ECHO "notice: assuming it is a name of file to create." ;
explicitly-requested-files += $(id) ;
}
else
Modified: branches/release/tools/build/v2/build/alias.jam
==============================================================================
--- branches/release/tools/build/v2/build/alias.jam (original)
+++ branches/release/tools/build/v2/build/alias.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -33,8 +33,8 @@
rule __init__ ( name : project : sources * : requirements *
: default-build * : usage-requirements * )
{
- basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements)
- : $(default-build) : $(usage-requirements) ;
+ basic-target.__init__ $(name) : $(project) : $(sources) :
+ $(requirements) : $(default-build) : $(usage-requirements) ;
}
rule construct ( name : source-targets * : property-set )
@@ -45,16 +45,16 @@
rule compute-usage-requirements ( subvariant )
{
local base = [ basic-target.compute-usage-requirements $(subvariant) ] ;
- # Add source's usage requirement. If we don't do this, "alias" does not
- # look like a 100% alias.
return [ $(base).add [ $(subvariant).sources-usage-requirements ] ] ;
}
}
-# Declares the 'alias' target. It will build sources, and return them unaltered.
+# Declares the 'alias' target. It will process its sources virtual-targets by
+# returning them unaltered as its own constructed virtual-targets.
#
-rule alias ( name : sources * : requirements * : default-build * : usage-requirements * )
+rule alias ( name : sources * : requirements * : default-build * :
+ usage-requirements * )
{
local project = [ project.current ] ;
@@ -62,8 +62,10 @@
[ new alias-target-class $(name) : $(project)
: [ targets.main-target-sources $(sources) : $(name) : no-renaming ]
: [ targets.main-target-requirements $(requirements) : $(project) ]
- : [ targets.main-target-default-build $(default-build) : $(project) ]
- : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ]
+ : [ targets.main-target-default-build $(default-build) : $(project)
+ ]
+ : [ targets.main-target-usage-requirements $(usage-requirements) :
+ $(project) ]
] ;
}
Modified: branches/release/tools/build/v2/build/build-request.jam
==============================================================================
--- branches/release/tools/build/v2/build/build-request.jam (original)
+++ branches/release/tools/build/v2/build/build-request.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -13,6 +13,7 @@
# Transform property-set by applying f to each component property.
+#
local rule apply-to-property-set ( f property-set )
{
local properties = [ feature.split $(property-set) ] ;
@@ -20,9 +21,10 @@
}
-# Expand the given build request by combining all property-sets which don't
+# Expand the given build request by combining all property-sets which do not
# specify conflicting non-free features. Expects all the project files to
# already be loaded.
+#
rule expand-no-defaults ( property-sets * )
{
# First make all features and subfeatures explicit.
@@ -38,6 +40,7 @@
# Implementation of x-product, below. Expects all the project files to already
# be loaded.
+#
local rule x-product-aux ( property-sets + )
{
local result ;
@@ -49,7 +52,7 @@
{
local x-product-seen ;
{
- # Don't mix in any conflicting features.
+ # Do not mix in any conflicting features.
local x-product-used = $(x-product-used) $(f) ;
if $(property-sets[2])
@@ -61,8 +64,8 @@
result ?= $(property-sets[1]) ;
}
- # If we didn't encounter a conflicting feature lower down, don't recurse
- # again.
+ # If we did not encounter a conflicting feature lower down, do not
+ # recurse again.
if ! [ set.intersection $(f) : $(x-product-seen) ]
{
property-sets = ;
@@ -76,7 +79,7 @@
result += [ x-product-aux $(property-sets[2-]) : $(feature-space) ] ;
}
- # Note that we've seen these features so that higher levels will recurse
+ # Note that we have seen these features so that higher levels will recurse
# again without them set.
x-product-seen += $(f) $(seen) ;
return $(result) ;
@@ -86,6 +89,7 @@
# Return the cross-product of all elements of property-sets, less any that would
# contain conflicting values for single-valued features. Expects all the project
# files to already be loaded.
+#
local rule x-product ( property-sets * )
{
if $(property-sets).non-empty
@@ -101,6 +105,7 @@
# Returns true if either 'v' or the part of 'v' before the first '-' symbol is
# an implicit value. Expects all the project files to already be loaded.
+#
local rule looks-like-implicit-value ( v )
{
if [ feature.is-implicit-value $(v) ]
@@ -123,6 +128,7 @@
# "vector" means container.jam's "vector"). First is the set of targets
# specified in the command line, and second is the set of requested build
# properties. Expects all the project files to already be loaded.
+#
rule from-command-line ( command-line * )
{
local targets ;
@@ -144,8 +150,8 @@
if [ MATCH "(.*=.*)" : $(e) ]
|| [ looks-like-implicit-value $(e:D=) : $(feature-space) ]
{
- properties += [ convert-command-line-element $(e)
- : $(feature-space) ] ;
+ properties += [ convert-command-line-element $(e) :
+ $(feature-space) ] ;
}
else
{
@@ -165,25 +171,42 @@
# Converts one element of command line build request specification into internal
# form. Expects all the project files to already be loaded.
+#
local rule convert-command-line-element ( e )
{
local result ;
local parts = [ regex.split $(e) "/" ] ;
- for local p in $(parts)
+ while $(parts)
{
+ local p = $(parts[1]) ;
local m = [ MATCH "([^=]*)=(.*)" : $(p) ] ;
local lresult ;
+ local feature ;
+ local values ;
if $(m)
{
- local feature = $(m[1]) ;
- local values = [ regex.split $(m[2]) "," ] ;
+ feature = $(m[1]) ;
+ values = [ regex.split $(m[2]) "," ] ;
lresult = <$(feature)>$(values) ;
}
else
{
lresult = [ regex.split $(p) "," ] ;
}
-
+
+ if $(feature) && free in [ feature.attributes $(feature) ]
+ {
+ # If we have free feature, then the value is everything
+ # until the end of the command line token. Slashes in
+ # the following string are not taked to mean separation
+ # of properties. Commas are also not interpreted specially.
+ values = $(values:J=,) ;
+ values = $(values) $(parts[2-]) ;
+ values = $(values:J=/) ;
+ lresult = <$(feature)>$(values) ;
+ parts = ;
+ }
+
if ! [ MATCH (.*-.*) : $(p) ]
{
# property.validate cannot handle subfeatures, so we avoid the check
@@ -202,6 +225,8 @@
{
result = $(result)/$(lresult) ;
}
+
+ parts = $(parts[2-]) ;
}
return $(result) ;
Modified: branches/release/tools/build/v2/build/feature.jam
==============================================================================
--- branches/release/tools/build/v2/build/feature.jam (original)
+++ branches/release/tools/build/v2/build/feature.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -357,7 +357,8 @@
local subvalue = $(subvalues[1]) ; # Pop the head off of subvalues.
subvalues = $(subvalues[2-]) ;
- local subfeature = [ find-implied-subfeature $(feature) $(subvalue) : $(value) ] ;
+ local subfeature = [ find-implied-subfeature $(feature) $(subvalue) :
+ $(value) ] ;
# If no subfeature was found reconstitute the value string and use that.
if ! $(subfeature)
@@ -433,8 +434,8 @@
}
if ! $($(feature).values)
{
- # This is the first value specified for this feature,
- # take it as default value
+ # This is the first value specified for this feature so make it be the
+ # default.
$(feature).default = $(values[1]) ;
}
$(feature).values += $(values) ;
@@ -584,7 +585,7 @@
}
else
{
- # If no subfeature was specified, we didn't expect to see a
+ # If no subfeature was specified, we do not expect to see a
# value-string.
if $(value-string)
{
@@ -771,7 +772,8 @@
{
# The feature has the form <topfeature-topvalue:subfeature>, e.g.
# <toolset-msvc:version>.
- local feature-value = [ split-top-feature $(specific-subfeature[1]) ] ;
+ local feature-value = [ split-top-feature $(specific-subfeature[1])
+ ] ;
if <$(feature-value[1])>$(feature-value[2]) = $(parent-property)
{
return true ;
Modified: branches/release/tools/build/v2/build/generators.jam
==============================================================================
--- branches/release/tools/build/v2/build/generators.jam (original)
+++ branches/release/tools/build/v2/build/generators.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -36,12 +36,19 @@
# that as early as possible. Specifically, this is done after invoking each
# generator. TODO: An example is needed to document the rationale for trying
# extra target conversion at that point.
+#
+# In order for the system to be able to use a specific generator instance 'when
+# needed', the instance needs to be registered with the system using
+# generators.register() or one of its related rules. Unregistered generators may
+# only be run explicitly and will not be considered by Boost.Build when when
+# converting between given target types.
import "class" : new ;
import errors ;
import property-set ;
import sequence ;
import set ;
+import type ;
import utility ;
import virtual-target ;
@@ -52,8 +59,76 @@
}
+# Updated cached viable source target type information as needed after a new
+# target type gets defined. This is needed because if a target type is a viable
+# source target type for some generator then all of the target type's derived
+# target types should automatically be considered as viable source target types
+# for the same generator as well. Does nothing if a non-derived target type is
+# passed to it.
+#
+rule update-cached-information-with-a-new-type ( type )
+{
+ local base-type = [ type.base $(type) ] ;
+ if $(base-type)
+ {
+ for local g in $(.vstg-cached-generators)
+ {
+ if $(base-type) in $(.vstg.$(g))
+ {
+ .vstg.$(g) += $(type) ;
+ }
+ }
+
+ for local t in $(.vst-cached-types)
+ {
+ if $(base-type) in $(.vst.$(t))
+ {
+ .vst.$(t) += $(type) ;
+ }
+ }
+ }
+}
+
+
+# Clears cached viable source target type information except for target types
+# and generators with all source types listed as viable. Should be called when
+# something invalidates those cached values by possibly causing some new source
+# types to become viable.
+#
+local rule invalidate-extendable-viable-source-target-type-cache ( )
+{
+ local generators-with-cached-source-types = $(.vstg-cached-generators) ;
+ .vstg-cached-generators = ;
+ for local g in $(generators-with-cached-source-types)
+ {
+ if $(.vstg.$(g)) = *
+ {
+ .vstg-cached-generators += $(g) ;
+ }
+ else
+ {
+ .vstg.$(g) = ;
+ }
+ }
+
+ local types-with-cached-source-types = $(.vst-cached-types) ;
+ .vst-cached-types = ;
+ for local t in $(types-with-cached-source-types)
+ {
+ if $(.vst.$(t)) = *
+ {
+ .vst-cached-types += $(t) ;
+ }
+ else
+ {
+ .vst.$(t) = ;
+ }
+ }
+}
+
+
# 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
+# 'message' is checked to see if it is a class instance. If so, instead of the
# value, the result of 'str' call is output.
#
local rule generators.dout ( message * )
@@ -83,18 +158,8 @@
}
-# 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.
+# Models a generator.
#
-rule normalize-target-list ( targets )
-{
- local v = [ $(targets).get ] ;
- $(targets).set $(v[1]) [ sequence.insertion-sort $(v[2-]) : utility.less ] ;
-}
-
-
-# Creates a generator
class generator
{
import generators : indent increase-indent decrease-indent generators.dout ;
@@ -108,7 +173,8 @@
import "class" : new ;
import property ;
- EXPORT class_at_generator : indent increase-indent decrease-indent generators.dout ;
+ EXPORT class_at_generator : indent increase-indent decrease-indent
+ generators.dout ;
rule __init__ (
id # Identifies the generator - should be name
@@ -146,9 +212,9 @@
{
# Create three parallel lists: one with the list of target types,
# and two other with prefixes and postfixes to be added to target
- # name. We use parallel lists for prefix and postfix (as opposed
- # to mapping), because given target type might occur several times,
- # for example "H H(%_symbols)".
+ # name. We use parallel lists for prefix and postfix (as opposed to
+ # mapping), because given target type might occur several times, for
+ # example "H H(%_symbols)".
local m = [ MATCH ([^\\(]*)(\\((.*)%(.*)\\))? : $(e) ] ;
self.target-types += $(m[1]) ;
self.name-prefix += $(m[3]:E="") ;
@@ -160,7 +226,7 @@
sequence.transform type.validate : $(self.target-types) ;
}
- ############## End of constructor #################
+ ################# End of constructor #################
rule id ( )
{
@@ -175,8 +241,8 @@
}
# 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.
+ # assumed to be always the same -- i.e. it can not change depending on some
+ # provided list of sources.
#
rule target-types ( )
{
@@ -187,6 +253,7 @@
# set must be present in build properties if this 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 ( )
@@ -199,7 +266,7 @@
#
rule match-rank ( property-set-to-match )
{
- # See if generator's requirements are satisfied by 'properties'. Treat a
+ # See if generator requirements are satisfied by 'properties'. Treat a
# feature name in requirements (i.e. grist-only element), as matching
# any value of the feature.
local all-requirements = [ requirements ] ;
@@ -218,8 +285,8 @@
}
local properties-to-match = [ $(property-set-to-match).raw ] ;
- if $(property-requirements) in $(properties-to-match)
- && $(feature-requirements) in $(properties-to-match:G)
+ if $(property-requirements) in $(properties-to-match) &&
+ $(feature-requirements) in $(properties-to-match:G)
{
return true ;
}
@@ -235,14 +302,12 @@
#
rule clone ( new-id : new-toolset-properties + )
{
- return [ new $(__class__) $(new-id) $(self.composing)
- : $(self.source-types)
- : $(self.target-types-and-names)
- # Note: this does not remove any subfeatures of <toolset>
- # which might cause problems
- : [ property.change $(self.requirements) : <toolset> ]
- $(new-toolset-properties)
- ] ;
+ return [ new $(__class__) $(new-id) $(self.composing) :
+ $(self.source-types) : $(self.target-types-and-names) :
+ # Note: this does not remove any subfeatures of <toolset> which
+ # might cause problems.
+ [ property.change $(self.requirements) : <toolset> ]
+ $(new-toolset-properties) ] ;
}
# Creates another generator that is the same as $(self), except that if
@@ -265,23 +330,24 @@
}
}
- return [ new $(__class__) $(self.id) $(self.composing)
- : $(self.source-types)
- : $(target-types)
- : $(self.requirements)
- ] ;
+ return [ new $(__class__) $(self.id) $(self.composing) :
+ $(self.source-types) : $(target-types) : $(self.requirements) ] ;
}
# 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.
+ # generated targets (instances of 'virtual-target') and optionally a set of
+ # properties to be added to the usage-requirements for all the generated
+ # targets. 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.
- : property-set # Desired properties for generated targets.
- : sources + # Source targets.
- )
+ rule run
+ (
+ project # Project for which the targets are generated.
+ name ? # Used when determining the 'name' attribute for all
+ # generated targets. See the 'generated-targets' method.
+ : property-set # Desired properties for generated targets.
+ : sources + # Source targets.
+ )
{
generators.dout [ indent ] " ** generator" $(self.id) ;
generators.dout [ indent ] " composing:" $(self.composing) ;
@@ -291,7 +357,7 @@
errors.error "Unsupported source/source-type combination" ;
}
- # We don't run composing generators if no name is specified. The reason
+ # We do not run composing generators if no name is specified. The reason
# is that composing generator combines several targets, which can have
# different names, and it cannot decide which name to give for produced
# target. Therefore, the name must be passed.
@@ -300,7 +366,7 @@
# 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)
+ # will not be allowed as the OBJ -> STATIC_LIB generator is composing.
if ! $(self.composing) || $(name)
{
run-really $(project) $(name) : $(property-set) : $(sources) ;
@@ -311,7 +377,7 @@
{
# Targets that this generator will consume directly.
local consumed = ;
- # Targets that can't be consumed and will be returned as-is.
+ # Targets that can not be consumed and will be returned as-is.
local bypassed = ;
if $(self.composing)
@@ -328,8 +394,8 @@
local result ;
if $(consumed)
{
- result = [ construct-result $(consumed) : $(project) $(name)
- : $(property-set) ] ;
+ result = [ construct-result $(consumed) : $(project) $(name) :
+ $(property-set) ] ;
}
if $(result)
@@ -346,14 +412,20 @@
# 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
- # exactly len $(self.source-types) targets with matching
- # types. Otherwise, might contain several targets with the
- # type of $(self.source-types[1]).
+ rule construct-result
+ (
+ consumed + # Already prepared list of consumable targets.
+ # Composing generators may receive multiple sources
+ # all of which will have types matching those in
+ # $(self.source-types). Non-composing generators with
+ # multiple $(self.source-types) will receive exactly
+ # len $(self.source-types) sources with types matching
+ # those in $(self.source-types). And non-composing
+ # generators with only a single source type may
+ # receive multiple sources with all of them of the
+ # type listed in $(self.source-types).
: project name ?
- : property-set # Properties to be used for all actions create here.
+ : property-set # Properties to be used for all actions created here.
)
{
local result ;
@@ -363,16 +435,14 @@
{
for local r in $(consumed)
{
- result += [ generated-targets $(r) : $(property-set) : $(project) $(name) ] ; #(targets) ;
+ result += [ generated-targets $(r) : $(property-set) :
+ $(project) $(name) ] ;
}
}
- else
+ else if $(consumed)
{
- if $(consumed)
- {
- result += [ generated-targets $(consumed) : $(property-set)
- : $(project) $(name) ] ;
- }
+ result += [ generated-targets $(consumed) : $(property-set) :
+ $(project) $(name) ] ;
}
return $(result) ;
}
@@ -383,11 +453,11 @@
{
# 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
+ # - using source file like a.host.cpp, or
+ # - a type whose suffix has a dot. Say, we can type 'host_cpp' with
# extension 'host.cpp'.
# In the first case, we want to take the part up to the last dot. In the
- # second case -- no sure, but for now take the part up to the last dot
+ # second case -- not sure, but for now take the part up to the last dot
# too.
name = [ utility.basename [ $(sources[1]).name ] ] ;
@@ -410,11 +480,11 @@
# will be the list of virtual-target, which has the same length as the
# 'target-types' attribute and with corresponding types.
#
- # When 'name' is empty, all source targets must have the same value of the
- # 'name' attribute, which will be used instead of the 'name' argument.
+ # When 'name' is empty, all source targets must have the same 'name'
+ # attribute value, which will be used instead of the 'name' argument.
#
- # The value of 'name' attribute for each generated target will be equal to
- # the 'name' parameter if there's no name pattern for this type. Otherwise,
+ # The 'name' attribute value for each generated target will be equal to
+ # the 'name' parameter if there is no name pattern for this type. Otherwise,
# the '%' symbol in the name pattern will be replaced with the 'name'
# parameter to obtain the 'name' attribute.
#
@@ -424,8 +494,8 @@
# determines the basename of a file.
#
# Note that this pattern mechanism has nothing to do with implicit patterns
- # in make. It is a way to produce target which name is different for name of
- # source.
+ # in make. It is a way to produce a target whose name is different than the
+ # name of its source.
#
rule generated-targets ( sources + : property-set : project name ? )
{
@@ -434,7 +504,7 @@
name = [ determine-output-name $(sources) ] ;
}
- # Assign an action for each target
+ # Assign an action for each target.
local action = [ action-class ] ;
local a = [ class.new $(action) $(sources) : $(self.id) :
$(property-set) ] ;
@@ -456,30 +526,33 @@
return [ sequence.transform virtual-target.register : $(targets) ] ;
}
- # 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
- # there's more that one possibility, report an error.
- : consumed-var # Name of the variable which recieves all targets which
- # can be consumed.
- bypassed-var # Name of the variable which recieves all targets which
- # cannot be consumed
+ # Attempts to convert 'sources' to targets of types that this generator can
+ # handle. The intention is to produce the set of targets that can be used
+ # when the 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
+ # there is more that one possibility, report an error.
+ : consumed-var # Name of the variable which receives all targets which
+ # can be consumed.
+ bypassed-var # Name of the variable which receives all targets which
+ # can not be consumed.
)
{
- # We're likely to be passed 'consumed' and 'bypassed' var names. Use "_"
- # to avoid name conflicts.
+ # We are likely to be passed 'consumed' and 'bypassed' var names. Use
+ # '_' to avoid name conflicts.
local _consumed ;
local _bypassed ;
local missing-types ;
if $(sources[2])
{
- # Don't know how to handle several sources yet. Just try to pass the
- # request to other generator
+ # Do not know how to handle several sources yet. Just try to pass
+ # the request to other generator.
missing-types = $(self.source-types) ;
}
else
@@ -502,11 +575,11 @@
if $(missing-types)
{
local transformed = [ generators.construct-types $(project) $(name)
- : $(missing-types) : $(property-set) : $(sources) ] ;
+ : $(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
+ # everything to the required type. There is no need to rerun it on
# targets of different types.
# NOTE: ignoring usage requirements.
@@ -533,12 +606,12 @@
# from Y, X_2 will be added to 'bypassed'. Likewise, when creating X_2
# from Y, X_1 will be added to 'bypassed', but they are also in
# 'consumed'. We have to remove them from bypassed, so that generators
- # up the call stack don't try to convert them.
+ # up the call stack do not try to convert them.
# In this particular case, X_1 instance in 'consumed' and X_1 instance
# in 'bypassed' will be the same: because they have the same source and
- # action name, and 'virtual-target.register' won't allow two different
- # instances. Therefore, it's OK to use 'set.difference'.
+ # action name, and 'virtual-target.register' will not allow two
+ # different instances. Therefore, it is OK to use 'set.difference'.
_bypassed = [ set.difference $(_bypassed) : $(_consumed) ] ;
@@ -546,10 +619,11 @@
$(bypassed-var) += $(_bypassed) ;
}
- # Converts several files to consumable types.
+ # Converts several files to consumable types. Called for composing
+ # generators only.
#
- rule convert-multiple-sources-to-consumable-types
- ( project : property-set : sources * : consumed-var bypassed-var )
+ rule convert-multiple-sources-to-consumable-types ( project : property-set :
+ sources * : consumed-var bypassed-var )
{
# We process each source one-by-one, trying to convert it to a usable
# type.
@@ -558,8 +632,8 @@
local _c ;
local _b ;
# TODO: need to check for failure on each source.
- convert-to-consumable-types $(project) : $(property-set)
- : $(source) : true : _c _b ;
+ convert-to-consumable-types $(project) : $(property-set) : $(source)
+ : true : _c _b ;
if ! $(_c)
{
generators.dout [ indent ] " failed to convert " $(source) ;
@@ -579,15 +653,15 @@
for local st in $(source-types)
{
- # The 'source' if of right type already)
- if $(real-source-type) = $(st) ||
- [ type.is-derived $(real-source-type) $(st) ]
+ # The 'source' if of the right type already.
+ if $(real-source-type) = $(st) || [ type.is-derived
+ $(real-source-type) $(st) ]
{
$(consumed-var) += $(source) ;
}
else
{
- $(missing-types-var) += $(st) ;
+ $(missing-types-var) += $(st) ;
}
}
}
@@ -602,33 +676,28 @@
}
-.generators = ;
-
-
# Registers a new generator instance 'g'.
#
rule register ( g )
{
- .generators += $(g) ;
-
# A generator can produce several targets of the same type. We want unique
- # occurence of that generator in .generators.$(t) in that case, otherwise,
- # it will be tried twice and we'll get false ambiguity.
+ # occurrence of that generator in .generators.$(t) in that case, otherwise,
+ # it will be tried twice and we will get a false ambiguity.
for local t in [ sequence.unique [ $(g).target-types ] ]
{
.generators.$(t) += $(g) ;
}
- # Update the set of generators for toolset
+ # Update the set of generators for toolset.
# TODO: should we check that generator with this id is not already
# registered. For example, the fop.jam module intentionally declared two
# generators with the same id, so such check will break it.
local id = [ $(g).id ] ;
- # Some generators have multiple periods in their name, so the normal
- # $(id:S=) won't generate the right toolset name. E.g. if id =
- # = gcc.compile.c++, then .generators-for-toolset.$(id:S=) will append to
+ # Some generators have multiple periods in their name, so a simple $(id:S=)
+ # will not generate the right toolset name. E.g. if id = gcc.compile.c++,
+ # then .generators-for-toolset.$(id:S=) will append to
# .generators-for-toolset.gcc.compile, which is a separate value from
# .generators-for-toolset.gcc. Correcting this makes generator inheritance
# work properly. See also inherit-generators in the toolset module.
@@ -638,35 +707,60 @@
base = $(base:B) ;
}
.generators-for-toolset.$(base) += $(g) ;
+
+
+ # After adding a new generator that can construct new target types, we need
+ # to clear the related cached viable source target type information for
+ # constructing a specific target type or using a specific generator. Cached
+ # viable source target type lists affected by this are those containing any
+ # of the target types constructed by the new generator or any of their base
+ # target types.
+ #
+ # A more advanced alternative to clearing that cached viable source target
+ # type information would be to expand it with additional source types or
+ # even better - mark it as needing to be expanded on next use.
+ #
+ # Also see the http://thread.gmane.org/gmane.comp.lib.boost.build/19077
+ # mailing list thread for an even more advanced idea of how we could convert
+ # Boost Build's Jamfile processing, target selection and generator selection
+ # into separate steps which would prevent these caches from ever being
+ # invalidated.
+ #
+ # For now we just clear all the cached viable source target type information
+ # that does not simply state 'all types' and may implement a more detailed
+ # algorithm later on if it becomes needed.
+
+ invalidate-extendable-viable-source-target-type-cache ;
}
-# Creates new instance of the 'generator' class and registers it. Returns the
-# 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.
+# Creates a new non-composing 'generator' class instance and registers it.
+# Returns the created instance. Rationale: the instance is returned so that it
+# is possible to first register a generator and then call its 'run' method,
+# bypassing the whole generator selection process.
#
rule register-standard ( id : source-types * : target-types + : requirements * )
{
- local g = [ new generator $(id) : $(source-types) : $(target-types)
- : $(requirements) ] ;
+ local g = [ new generator $(id) : $(source-types) : $(target-types) :
+ $(requirements) ] ;
register $(g) ;
return $(g) ;
}
-# Creates new instance of the 'composing-generator' class and registers it.
+# Creates a new composing 'generator' class instance and registers it.
#
-rule register-composing ( id : source-types * : target-types + : requirements * )
+rule register-composing ( id : source-types * : target-types + : requirements *
+ )
{
- local g = [ new generator $(id) true : $(source-types) : $(target-types)
- : $(requirements) ] ;
+ local g = [ new generator $(id) true : $(source-types) : $(target-types) :
+ $(requirements) ] ;
register $(g) ;
return $(g) ;
}
-# Returns all generators which belong to 'toolset', i.e. whose ids are
+# Returns all generators belonging to the given 'toolset', i.e. whose ids are
# '$(toolset).<something>'.
#
rule generators-for-toolset ( toolset )
@@ -677,11 +771,11 @@
# Make generator 'overrider-id' be preferred to 'overridee-id'. If, when
# searching for generators that could produce a target of a certain type, both
-# those generators are amoung viable generators, the overridden generator is
+# those generators are among viable generators, the overridden generator is
# immediately discarded.
#
# The overridden generators are discarded immediately after computing the list
-# of viable generators, before running any of them.
+# of viable generators but before running any of them.
#
rule override ( overrider-id : overridee-id )
{
@@ -689,30 +783,34 @@
}
-# Set if results of the current generators search are going to be cached. This
-# 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
+# More formally, takes all generators for 'target-type' and returns a union of
+# source types for those generators and result of calling itself recursively on
# source types.
#
+# Returns '*' in case any type should be considered a viable source type for the
+# given type.
+#
local rule viable-source-types-real ( target-type )
{
- local generators ;
+ local result ;
- local t = [ type.all-bases $(target-type) ] ;
+ # 't0' is the initial list of target types we need to process to get a list
+ # of their viable source target types. New target types will not be added to
+ # this list.
+ local t0 = [ type.all-bases $(target-type) ] ;
+
+ # 't' is the list of target types which have not yet been processed to get a
+ # list of their viable source target types. This list will get expanded as
+ # we locate more target types to process.
+ local t = $(t0) ;
- local result ;
- # 't' is the list of types which have not yet been processed.
while $(t)
{
- # Find all generators for current type. Unlike 'find-viable-generators'
- # we don't care about property-set.
+ # Find all generators for the current type. Unlike
+ # 'find-viable-generators' we do not care about the property-set.
local generators = $(.generators.$(t[1])) ;
t = $(t[2-]) ;
@@ -723,11 +821,11 @@
if ! [ $(g).source-types ]
{
- # Empty source types -- everything can be accepted
+ # Empty source types -- everything can be accepted.
result = * ;
# This will terminate this loop.
generators = ;
- # This will terminate outer loop.
+ # This will terminate the outer loop.
t = ;
}
@@ -735,14 +833,25 @@
{
if ! $(source-type) in $(result)
{
- # If generator accepts 'source-type' it
- # will happily accept any type derived from it
- local all = [ type.all-derived $(source-type) ] ;
- for local n in $(all)
+ # If a generator accepts a 'source-type' it will also
+ # happily accept any type derived from it.
+ for local n in [ type.all-derived $(source-type) ]
{
if ! $(n) in $(result)
{
- t += $(n) ;
+ # Here there is no point in adding target types to
+ # the list of types to process in case they are or
+ # have already been on that list. We optimize this
+ # check by realizing that we only need to avoid the
+ # original target type's base types. Other target
+ # types that are or have been on the list of target
+ # types to process have been added to the 'result'
+ # list as well and have thus already been eliminated
+ # by the previous if.
+ if ! $(n) in $(t0)
+ {
+ t += $(n) ;
+ }
result += $(n) ;
}
}
@@ -751,7 +860,7 @@
}
}
- return [ sequence.unique $(result) ] ;
+ return $(result) ;
}
@@ -762,6 +871,7 @@
local key = .vst.$(target-type) ;
if ! $($(key))
{
+ .vst-cached-types += $(target-type) ;
local v = [ viable-source-types-real $(target-type) ] ;
if ! $(v)
{
@@ -781,15 +891,18 @@
# 'generator', has some change of being eventually used (probably after
# conversion by other generators).
#
+# Returns '*' in case any type should be considered a viable source type for the
+# given generator.
+#
rule viable-source-types-for-generator-real ( generator )
{
local source-types = [ $(generator).source-types ] ;
if ! $(source-types)
{
- # If generator does not specify any source types, it might be special
+ # If generator does not specify any source types, it might be a special
# generator like builtin.lib-generator which just relays to other
# generators. Return '*' to indicate that any source type is possibly
- # OK, since we don't know for sure.
+ # OK, since we do not know for sure.
return * ;
}
else
@@ -797,15 +910,18 @@
local result ;
for local s in $(source-types)
{
- result += [ type.all-derived $(s) ]
- [ generators.viable-source-types $(s) ] ;
- }
- result = [ sequence.unique $(result) ] ;
- if * in $(result)
- {
- result = * ;
+ local viable-sources = [ generators.viable-source-types $(s) ] ;
+ if $(viable-sources) = *
+ {
+ result = * ;
+ source-types = ; # Terminate the loop.
+ }
+ else
+ {
+ result += [ type.all-derived $(s) ] $(viable-sources) ;
+ }
}
- return $(result) ;
+ return [ sequence.unique $(result) ] ;
}
}
@@ -817,6 +933,7 @@
local key = .vstg.$(generator) ;
if ! $($(key))
{
+ .vstg-cached-generators += $(generator) ;
local v = [ viable-source-types-for-generator-real $(generator) ] ;
if ! $(v)
{
@@ -874,8 +991,9 @@
}
-# 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.
+# Checks if generator invocation can be pruned, because it is guaranteed to
+# fail. If so, quickly returns an empty list. Otherwise, calls
+# try-one-generator-really.
#
local rule try-one-generator ( project name ? : generator : target-type
: property-set : sources * )
@@ -885,21 +1003,21 @@
{
source-types += [ $(s).type ] ;
}
- local viable-source-types =
- [ viable-source-types-for-generator $(generator) ] ;
+ local viable-source-types = [ viable-source-types-for-generator $(generator)
+ ] ;
if $(source-types) && $(viable-source-types) != * &&
- ! [ set.intersection $(source-types) : $(viable-source-types) ]
+ ! [ set.intersection $(source-types) : $(viable-source-types) ]
{
local id = [ $(generator).id ] ;
generators.dout [ indent ] " ** generator '$(id)' pruned" ;
#generators.dout [ indent ] "source-types" '$(source-types)' ;
#generators.dout [ indent ] "viable-source-types" '$(viable-source-types)' ;
}
- else {
- return [ try-one-generator-really $(project) $(name)
- : $(generator)
- : $(target-type) : $(property-set) : $(sources) ] ;
+ else
+ {
+ return [ try-one-generator-really $(project) $(name) : $(generator) :
+ $(target-type) : $(property-set) : $(sources) ] ;
}
}
@@ -913,7 +1031,7 @@
for local t in $(target-types)
{
local r = [ construct $(project) $(name) : $(t) : $(property-set) :
- $(sources) ] ;
+ $(sources) ] ;
if $(r)
{
usage-requirements = [ $(usage-requirements).add $(r[1]) ] ;
@@ -955,13 +1073,13 @@
# Returns generators which can be used to construct target of specified type
# with specified properties. Uses the following algorithm:
# - iterates over requested target-type and all its bases (in the order returned
-# by type.all-bases.
+# by type.all-bases).
# - for each type find all generators that generate that type and whose
# requirements are satisfied by properties.
# - if the set of generators is not empty, returns that set.
#
-# Note: this algorithm explicitly ignores generators for base classes if there's
-# at least one generator for the requested target-type.
+# Note: this algorithm explicitly ignores generators for base classes if there
+# is at least one generator for the requested target-type.
#
local rule find-viable-generators-aux ( target-type : property-set )
{
@@ -988,11 +1106,11 @@
if $(t[1]) != $(target-type)
{
- # We're here, when no generators for target-type are found, but
- # there are some generators for a base type. We'll try to use
- # them, but they will produce targets of base type, not of
- # 'target-type'. So, we clone the generators and modify the list
- # of target types.
+ # We are here because there were no generators found for
+ # target-type but there are some generators for its base type.
+ # We will try to use them, but they will produce targets of
+ # base type, not of 'target-type'. So, we clone the generators
+ # and modify the list of target types.
local generators2 ;
for local g in $(generators)
{
@@ -1001,8 +1119,8 @@
# should work. That list is only used when inheriting a
# toolset, which should have been done before running
# generators.
- generators2 += [
- $(g).clone-and-change-target-type $(t[1]) : $(target-type) ] ;
+ generators2 += [ $(g).clone-and-change-target-type $(t[1]) :
+ $(target-type) ] ;
generators.register $(generators2[-1]) ;
}
generators = $(generators2) ;
@@ -1059,7 +1177,7 @@
# Generators which override 'all'.
local all-overrides ;
- # Generators which are overriden
+ # Generators which are overriden.
local overriden-ids ;
for local g in $(viable-generators)
{
@@ -1094,10 +1212,11 @@
# 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 * )
+local rule construct-really ( project name ? : target-type : property-set :
+ sources * )
{
- viable-generators = [ find-viable-generators $(target-type) : $(property-set) ] ;
+ viable-generators = [ find-viable-generators $(target-type) :
+ $(property-set) ] ;
generators.dout [ indent ] "*** " [ sequence.length $(viable-generators) ]
" viable generators" ;
@@ -1109,8 +1228,8 @@
# This variable will be restored on exit from this scope.
local .active-generators = $(g) $(.active-generators) ;
- local r = [ try-one-generator $(project) $(name) : $(g) : $(target-type) :
- $(property-set) : $(sources) ] ;
+ local r = [ try-one-generator $(project) $(name) : $(g) : $(target-type)
+ : $(property-set) : $(sources) ] ;
if $(r)
{
@@ -1152,8 +1271,8 @@
# Attempts to create a target of 'target-type' with 'properties' from 'sources'.
-# The 'sources' are treated as a collection of *possible* ingridients -- i.e. it
-# is not required to consume them all.
+# The 'sources' are treated as a collection of *possible* ingridients, i.e.
+# there is no obligation to consume them all.
#
# Returns a list of targets. When this invocation is first instance of
# 'construct' in stack, returns only targets of requested 'target-type',
@@ -1181,8 +1300,8 @@
generators.dout [ indent ] " properties:" [ $(property-set).raw ] ;
}
- local result = [ construct-really $(project) $(name)
- : $(target-type) : $(property-set) : $(sources) ] ;
+ local result = [ construct-really $(project) $(name) : $(target-type) :
+ $(property-set) : $(sources) ] ;
decrease-indent ;
Modified: branches/release/tools/build/v2/build/project.jam
==============================================================================
--- branches/release/tools/build/v2/build/project.jam (original)
+++ branches/release/tools/build/v2/build/project.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -103,14 +103,13 @@
#
rule load-parent ( location )
{
- local found = [ path.glob-in-parents $(location) :
- $(JAMROOT) $(JAMFILE) ] ;
+ local found = [ path.glob-in-parents $(location) : $(JAMROOT) $(JAMFILE) ] ;
if ! $(found)
{
- ECHO "error: Could not find parent for project at '$(location)'" ;
- ECHO "error: Did not find Jamfile.jam or Jamroot.jam in any parent directory." ;
- EXIT ;
+ ECHO error: Could not find parent for project at '$(location)' ;
+ EXIT error: Did not find Jamfile.jam or Jamroot.jam in any parent
+ directory. ;
}
return [ load $(found[1]:D) ] ;
@@ -153,8 +152,8 @@
if ! $(project-module)
{
- local location = [ path.root
- [ path.make $(name) ] $(current-location) ] ;
+ local location = [ path.root [ path.make $(name) ] $(current-location) ]
+ ;
# If no project is registered for the given location, try to load it.
# First see if we have a Jamfile. If not, then see if we might have a
@@ -220,8 +219,8 @@
{
if ! $(.parent-jamfile.$(dir))
{
- .parent-jamfile.$(dir) =
- [ path.glob-in-parents $(dir) : $(JAMFILE) ] ;
+ .parent-jamfile.$(dir) = [ path.glob-in-parents $(dir) : $(JAMFILE)
+ ] ;
}
jamfile-glob = $(.parent-jamfile.$(dir)) ;
}
@@ -237,7 +236,7 @@
local jamfile-to-load = $(jamfile-glob) ;
# Multiple Jamfiles found in the same place. Warn about this and ensure we
- # use only one of them. As a temporary convenience measure, if there's
+ # use only one of them. As a temporary convenience measure, if there is
# Jamfile.v2 among found files, suppress the warning and use it.
#
if $(jamfile-to-load[2-])
@@ -262,11 +261,10 @@
#
if ! $(no-errors) && ! $(jamfile-to-load)
{
- errors.error
- "Unable to load Jamfile." :
- "Could not find a Jamfile in directory '$(dir)'". :
- "Attempted to find it with pattern '"$(JAMFILE:J=" ")"'." :
- "Please consult the documentation at 'http://www.boost.org'." ;
+ errors.error Unable to load Jamfile.
+ : Could not find a Jamfile in directory '$(dir)'.
+ : Attempted to find it with pattern '"$(JAMFILE:J=" ")"'.
+ : Please consult the documentation at 'http://www.boost.org'. ;
}
return $(jamfile-to-load) ;
@@ -319,13 +317,12 @@
# Now do some checks.
if $(.current-project) != $(saved-project)
{
- errors.error "The value of the .current-project variable"
- : "has magically changed after loading a Jamfile."
- : "This means some of the targets might be defined in the wrong project."
- : "after loading" $(jamfile-module)
- : "expected value" $(saved-project)
- : "actual value" $(.current-project)
- ;
+ errors.error "The value of the .current-project variable has magically"
+ : "changed after loading a Jamfile. This means some of the targets"
+ : "might be defined in the wrong project."
+ : "after loading" $(jamfile-module)
+ : "expected value" $(saved-project)
+ : "actual value" $(.current-project) ;
}
if $(.global-build-dir)
@@ -578,10 +575,8 @@
if $(result[1]) = "@error"
{
- errors.error
- "Requirements for project at '$(self.location)'"
- "conflict with parent's." :
- "Explanation: " $(result[2-]) ;
+ errors.error Requirements for project at '$(self.location)'
+ conflict with parent's. : Explanation: $(result[2-]) ;
}
else
{
@@ -601,7 +596,8 @@
local non-free = [ property.remove free : $(unconditional) ] ;
if $(non-free)
{
- errors.error "usage-requirements" $(specification) "have non-free properties" $(non-free) ;
+ errors.error usage-requirements $(specification) have non-free
+ properties $(non-free) ;
}
local t = [ property.translate-paths $(specification)
: $(self.location) ] ;
@@ -624,8 +620,8 @@
self.source-location = ;
for local src-path in $(specification)
{
- self.source-location += [ path.root
- [ path.make $(src-path) ] $(self.location) ] ;
+ self.source-location += [ path.root [ path.make $(src-path) ]
+ $(self.location) ] ;
}
}
else if $(attribute) = "build-dir"
@@ -633,11 +629,17 @@
self.build-dir = [ path.root
[ path.make $(specification) ] $(self.location) ] ;
}
- else if ! $(attribute) in "id" "default-build" "location"
- "source-location" "parent" "projects-to-build" "project-root"
+ else if $(attribute) = "id"
{
- errors.error "Invalid project attribute '$(attribute)' specified"
- "for project at '$(self.location)'" ;
+ id = [ path.root $(specification) / ] ;
+ project.register-id $(id) : $(self.project-module) ;
+ self.id = $(id) ;
+ }
+ else if ! $(attribute) in "default-build" "location" "parent"
+ "projects-to-build" "project-root" "source-location"
+ {
+ errors.error Invalid project attribute '$(attribute)' specified for
+ project at '$(self.location)' ;
}
else
{
@@ -738,11 +740,11 @@
{
# The project at 'location' either has no id or that id is not equal to
# the 'id' parameter.
- if $($(id).jamfile-module)
- && $($(id).jamfile-module) != $(project-module)
+ if $($(id).jamfile-module) && ( $($(id).jamfile-module) !=
+ $(project-module) )
{
- errors.user-error
- "Attempt to redeclare already existing project id '$(id)'" ;
+ errors.user-error Attempt to redeclare already existing project id
+ '$(id)' ;
}
$(id).jamfile-module = $(project-module) ;
}
@@ -777,12 +779,13 @@
# Create the project data, and bring in the project rules into the
# module.
- project.initialize $(__name__) :
- [ path.join [ project.attribute $(root-project) location ] ext $(1:L) ] ;
+ project.initialize $(__name__) : [ path.join [ project.attribute
+ $(root-project) location ] ext $(1:L) ] ;
# Create the project itself, i.e. the attributes. All extensions are
# created in the "/ext" project space.
- project /ext/$(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
+ project /ext/$(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) :
+ $(9) ;
local attributes = [ project.attributes $(__name__) ] ;
# Inherit from the root project of whomever is defining us.
@@ -797,12 +800,12 @@
local location = [ $(project).get source-location ] ;
local result ;
- local paths = [ path.$(rule-name) $(location)
- : [ sequence.transform path.make : $(wildcards) ]
- : [ sequence.transform path.make : $(excludes) ] ] ;
+ local paths = [ path.$(rule-name) $(location) :
+ [ sequence.transform path.make : $(wildcards) ] :
+ [ sequence.transform path.make : $(excludes) ] ] ;
if $(wildcards:D) || $(rule-name) != glob
{
- # The paths we've found are relative to the current directory, but the
+ # The paths we have found are relative to the current directory, but the
# names specified in the sources list are assumed to be relative to the
# source directory of the corresponding project. So, just make the names
# absolute.
@@ -873,8 +876,6 @@
local attributes = [ project.attributes $(__name__) ] ;
if $(id)
{
- id = [ path.root $(id) / ] ;
- project.register-id $(id) : $(__name__) ;
$(attributes).set id : $(id) ;
}
@@ -902,19 +903,22 @@
local location = [ $(attributes).get location ] ;
# Project with an empty location is a 'standalone' project such as
# user-config or qt. It has no build dir. If we try to set build dir
- # for user-config, we'll then try to inherit it, with either weird
- # or wrong consequences.
+ # for user-config, we shall then try to inherit it, with either
+ # weird or wrong consequences.
if $(location) && $(location) = [ $(attributes).get project-root ]
{
+ # Re-read the project id, since it might have been changed in
+ # the project's attributes.
+ id = [ $(attributes).get id ] ;
# This is Jamroot.
if $(id)
{
- if $(explicit-build-dir)
- && [ path.is-rooted $(explicit-build-dir) ]
+ if $(explicit-build-dir) &&
+ [ path.is-rooted $(explicit-build-dir) ]
{
- errors.user-error "Absolute directory specified via 'build-dir' project attribute"
- : "Don't know how to combine that with the --build-dir option."
- ;
+ errors.user-error Absolute directory specified via
+ 'build-dir' project attribute : Do not know how to
+ combine that with the --build-dir option. ;
}
# Strip the leading slash from id.
local rid = [ MATCH /(.*) : $(id) ] ;
@@ -926,11 +930,12 @@
}
else
{
- # Not Jamroot
+ # Not Jamroot.
if $(explicit-build-dir)
{
- errors.user-error "When --build-dir is specified, the 'build-dir' project"
- : "attribute is allowed only for top-level 'project' invocations" ;
+ errors.user-error When --build-dir is specified, the
+ 'build-dir' project : attribute is allowed only for
+ top-level 'project' invocations ;
}
}
}
@@ -943,7 +948,7 @@
rule constant (
name # Variable name of the constant.
: value + # Value of the constant.
- )
+ )
{
import project ;
local p = [ project.target $(__name__) ] ;
@@ -1005,10 +1010,11 @@
if $(wildcards:D) || $(excludes:D)
{
- errors.user-error "The patterns to 'glob-tree' may not include directory" ;
+ errors.user-error The patterns to 'glob-tree' may not include
+ directory ;
}
- return [ project.glob-internal [ project.current ]
- : $(wildcards) : $(excludes) : glob-tree ] ;
+ return [ project.glob-internal [ project.current ] : $(wildcards) :
+ $(excludes) : glob-tree ] ;
}
# Calculates conditional requirements for multiple requirements at once.
Modified: branches/release/tools/build/v2/build/property-set.jam
==============================================================================
--- branches/release/tools/build/v2/build/property-set.jam (original)
+++ branches/release/tools/build/v2/build/property-set.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,6 +5,8 @@
import "class" : new ;
import feature ;
+import path ;
+import project ;
import property ;
import sequence ;
import set ;
@@ -250,8 +252,8 @@
{
if ! $(self.target-path)
{
- # The <location> feature can be used to explicitly
- # change the location of generated targetsv
+ # The <location> feature can be used to explicitly change the
+ # location of generated targets.
local l = [ get <location> ] ;
if $(l)
{
@@ -260,7 +262,7 @@
else
{
local p = [ as-path ] ;
- # Really, an ugly hack. Boost regression test system requires
+ # A real ugly hack. Boost regression test system requires
# specific target paths, and it seems that changing it to handle
# other directory layout is really hard. For that reason, we
# teach V2 to do the things regression system requires. The
@@ -382,6 +384,10 @@
: $(location) ] ;
specification = [ property.translate-indirect $(specification)
: $(jamfile-module) ] ;
+ local project-id = [ project.attribute $(jamfile-module) id ] ;
+ project-id ?= [ path.root $(location) [ path.pwd ] ] ;
+ specification = [ property.translate-dependencies
+ $(specification) : $(project-id) : $(location) ] ;
specification =
[ property.expand-subfeatures-in-conditions $(specification) ] ;
specification = [ property.make $(specification) ] ;
Modified: branches/release/tools/build/v2/build/property.jam
==============================================================================
--- branches/release/tools/build/v2/build/property.jam (original)
+++ branches/release/tools/build/v2/build/property.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -469,7 +469,8 @@
# Assumes that all feature values that start with '@' are names of rules, used
# in 'context-module'. Such rules can be either local to the module or global.
# Converts such values into 'indirect-rule' format (see indirect.jam), so they
-# can be called from other modules.
+# can be called from other modules. Does nothing for such values that are
+# already in the 'indirect-rule' format.
#
rule translate-indirect ( specification * : context-module )
{
@@ -482,7 +483,7 @@
local v ;
if [ MATCH "^([^%]*)%([^%]+)$" : $(m) ]
{
- # Rule is already in indirect format.
+ # Rule is already in the 'indirect-rule' format.
v = $(m) ;
}
else
@@ -512,6 +513,50 @@
}
+# Binds all dependency properties in a list relative to the given project.
+# Targets with absolute paths will be left unchanged and targets which have a
+# project specified will have the path to the project interpreted relative to
+# the specified location.
+#
+rule translate-dependencies ( specification * : project-id : location )
+{
+ local result ;
+ for local p in $(specification)
+ {
+ local split = [ split-conditional $(p) ] ;
+ local condition = "" ;
+ if $(split)
+ {
+ condition = $(split[1]): ;
+ p = $(split[2]) ;
+ }
+ if dependency in [ feature.attributes $(p:G) ]
+ {
+ local split-target = [ regex.match (.*)//(.*) : $(p:G=) ] ;
+ if $(split-target)
+ {
+ local rooted = [ path.root [ path.make $(split-target[1]) ]
+ [ path.root $(location) [ path.pwd ] ] ] ;
+ result += $(condition)$(p:G)$(rooted)//$(split-target[2]) ;
+ }
+ else if [ path.is-rooted $(p:G=) ]
+ {
+ result += $(condition)$(p) ;
+ }
+ else
+ {
+ result += $(condition)$(p:G)$(project-id)//$(p:G=) ;
+ }
+ }
+ else
+ {
+ result += $(condition)$(p) ;
+ }
+ }
+ return $(result) ;
+}
+
+
# Class maintaining a property set -> string mapping.
#
class property-map
Modified: branches/release/tools/build/v2/build/targets.jam
==============================================================================
--- branches/release/tools/build/v2/build/targets.jam (original)
+++ branches/release/tools/build/v2/build/targets.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -13,8 +13,8 @@
# each Jamfile, and can be obtained by the 'target' rule in the Jamfile's module
# (see project.jam).
#
-# Project targets keep a list of 'main-target' instances. A main target is
-# what the user explicitly defines in a Jamfile. It is possible to have several
+# Project targets keep a list of 'main-target' instances. A main target is what
+# the user explicitly defines in a Jamfile. It is possible to have several
# definitions for a main target, for example to have different lists of sources
# for different platforms. So, main targets keep a list of alternatives.
#
@@ -89,8 +89,8 @@
import "class" ;
import errors ;
- rule __init__ ( name # name of the target in Jamfile
- : project-target # the project target to which this one belongs
+ rule __init__ ( name # Name of the target in Jamfile.
+ : project-target # The project target to which this one belongs.
)
{
# Note: it might seem that we don't need either name or project at all.
@@ -115,7 +115,7 @@
return $(self.project) ;
}
- # Return the location where the target was declared
+ # Return the location where the target was declared.
rule location ( )
{
return $(self.location) ;
@@ -232,10 +232,8 @@
self.build-dir = [ get build-dir ] ;
if ! $(self.build-dir)
{
- self.build-dir = [ path.join
- [ $(self.project).get location ]
- bin
- ] ;
+ self.build-dir = [ path.join [ $(self.project).get location ]
+ bin ] ;
}
}
return $(self.build-dir) ;
@@ -300,8 +298,8 @@
#
rule mark-target-as-explicit ( target-name )
{
- # Record the name of the target, not instance, since this
- # rule is called before main target instaces are created.
+ # Record the name of the target, not instance, since this rule is called
+ # before main target instances are created.
self.explicit-targets += $(target-name) ;
}
@@ -311,13 +309,13 @@
{
if $(self.built-main-targets)
{
- errors.error "add-alternative called when main targets are already created."
- : "in project" [ full-name ] ;
+ errors.error add-alternative called when main targets are already
+ created. : in project [ full-name ] ;
}
self.alternatives += $(target-instance) ;
}
- # Returns a 'main-target' class instance corresponding to the 'name'.
+ # Returns a 'main-target' class instance corresponding to 'name'.
#
rule main-target ( name )
{
@@ -325,11 +323,10 @@
{
build-main-targets ;
}
-
return $(self.main-target.$(name)) ;
}
- # Tells if a main target with the specified name exists.
+ # Returns whether a main target with the specified name exists.
#
rule has-main-target ( name )
{
@@ -344,13 +341,12 @@
}
}
- # Find and return the target with the specified id, treated relative to
- # self.
+ # Worker function for the find rule not implementing any caching and simply
+ # returning nothing in case the target can not be found.
#
rule find-really ( id )
{
local result ;
- local project = $(self.project) ;
local current-location = [ get location ] ;
local split = [ MATCH (.*)//(.*) : $(id) ] ;
@@ -360,8 +356,8 @@
local extra-error-message ;
if $(project-part)
{
- # There's explicit project part in id. Looks up the project and
- # passes the request to it.
+ # There is an explicitly specified project part in id. Looks up the
+ # project and passes the request to it.
local pm = [ project.find $(project-part) : $(current-location) ] ;
if $(pm)
{
@@ -370,37 +366,44 @@
}
else
{
- extra-error-message = "error: could not find project '$(project-part)'" ;
+ # TODO: This extra error message will not get displayed most
+ # likely due to some buggy refactoring. Refactor the code so the
+ # message gets diplayed again.
+ extra-error-message = error: could not find project
+ '$(project-part)' ;
}
}
else
{
# Interpret target-name as name of main target. Need to do this
- # before checking for file. Consider this:
+ # before checking for file. Consider the following scenario with a
+ # toolset not modifying its executable's names, e.g. gcc on
+ # Unix-like platforms:
#
# exe test : test.cpp ;
# install s : test : <location>. ;
#
- # After first build we'll have target 'test' in Jamfile and file
- # 'test' on the disk. We need target to override the file.
+ # After the first build we would have a target named 'test' in the
+ # Jamfile and a file named 'test' on the disk. We need the target to
+ # override the file.
result = [ main-target $(id) ] ;
-
+
+ # Interpret id as an existing file reference.
if ! $(result)
{
- result = [ new file-reference [ path.make $(id) ] : $(project) ] ;
-
+ result = [ new file-reference [ path.make $(id) ] :
+ $(self.project) ] ;
if ! [ $(result).exists ]
{
- # File actually does not exist. Reset 'target' so that an
- # error is issued.
result = ;
}
}
- # Interpret id as project-id
+ # Interpret id as project-id.
if ! $(result)
{
- local project-module = [ project.find $(id) : $(current-location) ] ;
+ local project-module = [ project.find $(id) :
+ $(current-location) ] ;
if $(project-module)
{
result = [ project.target $(project-module) ] ;
@@ -411,6 +414,11 @@
return $(result) ;
}
+ # Find and return the target with the specified id, treated relative to
+ # self. Id may specify either a target or a file name with the target taking
+ # priority. May report an error or return nothing if the target is not found
+ # depending on the 'no-error' parameter.
+ #
rule find ( id : no-error ? )
{
local v = $(.id.$(id)) ;
@@ -490,7 +498,7 @@
self.constants += $(name) ;
}
self.constant.$(name) = $(value) ;
- # Inject the constant in the scope of project-root module.
+ # Inject the constant in the scope of the Jamroot module.
modules.poke $(self.project-module) : $(name) : $(value) ;
}
@@ -771,7 +779,7 @@
}
-# Abstract target which refers to a source file. This is an artificial entity
+# Abstract target refering to a source file. This is an artificial entity
# allowing sources to a target to be represented using a list of abstract target
# instances.
#
@@ -788,11 +796,8 @@
rule generate ( properties )
{
- location ;
- return [ property-set.empty ]
- [ virtual-target.from-file $(self.name)
- : $(self.file-location)
- : $(self.project) ] ;
+ return [ property-set.empty ] [ virtual-target.from-file $(self.name) :
+ [ location ] : $(self.project) ] ;
}
# Returns true if the referred file really exists.
@@ -909,7 +914,7 @@
# Given a 'context' -- a set of already present properties, and 'requirements',
# decide which extra properties should be applied to 'context'. For conditional
-# requirements, this means evaluating condition. For indirect conditional
+# requirements, this means evaluating the condition. For indirect conditional
# requirements, this means calling a rule. Ordinary requirements are always
# applied.
#
@@ -945,7 +950,7 @@
local conditionals = [ $(requirements).conditional ] ;
# The 'count' variable has one element for each conditional feature and for
- # each occurence of '<indirect-conditional>' feature. It is used as a loop
+ # each occurrence of '<indirect-conditional>' feature. It is used as a loop
# counter: for each iteration of the loop before we remove one element and
# the property set should stabilize before we are done. It is assumed that
# #conditionals iterations should be enough for properties to propagate
@@ -959,9 +964,10 @@
local current = $(raw) ;
# It is assumed that ordinary conditional requirements can not add
- # <indirect-conditional> properties, and that rules referred to by
- # <indirect-conditional> properties can not add new <indirect-conditional>
- # properties. So the list of indirect conditionals does not change.
+ # <conditional> properties (a.k.a. indirect conditional properties), and
+ # that rules referred to by <conditional> properties can not add new
+ # <conditional> properties. So the list of indirect conditionals does not
+ # change.
local indirect = [ $(requirements).get <conditional> ] ;
indirect = [ MATCH @(.*) : $(indirect) ] ;
@@ -980,7 +986,7 @@
if $(e) = $(added-requirements)
{
- # If we got the same result, we've found final properties.
+ # If we got the same result, we have found the final properties.
count = ;
ok = true ;
}
@@ -1009,7 +1015,7 @@
}
else
{
- errors.error "Invalid value of the 'what' parameter" ;
+ errors.error "Invalid value of the 'what' parameter." ;
}
}
@@ -1074,7 +1080,8 @@
if $(sources:G)
{
- errors.user-error "properties found in the 'sources' parameter for" [ full-name ] ;
+ errors.user-error properties found in the 'sources' parameter for
+ [ full-name ] ;
}
}
@@ -1198,7 +1205,8 @@
ECHO [ targets.indent ] "Common properties: " [ $(rproperties).raw ] ;
}
- if $(rproperties[1]) != "@error" && [ $(rproperties).get <build> ] != no
+ if ( $(rproperties[1]) != "@error" ) && ( [ $(rproperties).get
+ <build> ] != no )
{
local source-targets ;
local properties = [ $(rproperties).non-dependency ] ;
@@ -1401,11 +1409,11 @@
{
import generators ;
- rule __init__ ( name : project : type : sources * : requirements *
- : default-build * : usage-requirements * )
+ rule __init__ ( name : project : type : sources * : requirements * :
+ default-build * : usage-requirements * )
{
- basic-target.__init__ $(name) : $(project) : $(sources)
- : $(requirements) : $(default-build) : $(usage-requirements) ;
+ basic-target.__init__ $(name) : $(project) : $(sources) :
+ $(requirements) : $(default-build) : $(usage-requirements) ;
self.type = $(type) ;
}
@@ -1508,10 +1516,10 @@
{
local project-usage-requirements = [ $(project).get usage-requirements ] ;
- # We don't use 'refine-from-user-input' because:
- # - I'm not sure if removing of parent's usage requirements makes sense
- # - refining of usage requirements is not needed, since usage requirements
- # are always free.
+ # We do not use 'refine-from-user-input' because:
+ # - I am not sure if removing parent's usage requirements makes sense
+ # - refining usage requirements is not needed, since usage requirements are
+ # always free.
local usage-requirements = [ property-set.create-from-user-input
$(specification)
: [ $(project).project-module ] [ $(project).get location ] ] ;
Modified: branches/release/tools/build/v2/build/toolset.jam
==============================================================================
--- branches/release/tools/build/v2/build/toolset.jam (original)
+++ branches/release/tools/build/v2/build/toolset.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -21,8 +21,8 @@
.ignore-requirements = ;
-# This is used only for testing, to make sure we don't get random extra elements
-# in paths.
+# This is used only for testing, to make sure we do not get random extra
+# elements in paths.
if --ignore-toolset-requirements in [ modules.peek : ARGV ]
{
.ignore-requirements = 1 ;
@@ -56,7 +56,7 @@
# Specifies if the 'flags' rule should check that the invoking module is the
-# same as the module we're setting the flag for. 'v' can be either 'checked' or
+# same as the module we are setting the flag for. 'v' can be either 'checked' or
# 'unchecked'. Subsequent call to 'pop-checking-for-flags-module' will restore
# the setting that was in effect before calling this rule.
#
@@ -101,7 +101,7 @@
# <architecture>ia64/<address-model>
#
# Where both features are optional. Without this syntax
- # we'd be forced to define "default" values.
+ # we would be forced to define "default" values.
values * : # The value to add to variable. If <feature> is specified,
# then the value of 'feature' will be added.
@@ -138,7 +138,7 @@
if $(condition) && ! $(condition:G=) && ! $(hack-hack)
{
# We have condition in the form '<feature>', that is, without value.
- # That's a previous syntax:
+ # That is an older syntax:
# flags gcc.link RPATH <dll-path> ;
# for compatibility, convert it to
# flags gcc.link RPATH : <dll-path> ;
@@ -162,10 +162,10 @@
{
.$(rule-or-module).flags += $(.flag-no) ;
- # Store all flags for a module
+ # Store all flags for a module.
local module_ = [ MATCH "([^.]*).*" : $(rule-or-module) ] ;
.module-flags.$(module_) += $(.flag-no) ;
- # Store flag-no -> rule-or-module mapping
+ # Store flag-no -> rule-or-module mapping.
.rule-or-module.$(.flag-no) = $(rule-or-module) ;
.$(rule-or-module).variable.$(.flag-no) += $(variable-name) ;
@@ -177,7 +177,7 @@
# Returns the first element of 'property-sets' which is a subset of
-# 'properties', or an empty list if no such element exists.
+# 'properties' or an empty list if no such element exists.
#
rule find-property-subset ( property-sets * : properties * )
{
@@ -225,6 +225,9 @@
}
+# Returns a value to be added to some flag for some target based on the flag's
+# value definition and the given target's property set.
+#
rule handle-flag-value ( value * : properties * )
{
local result ;
@@ -245,8 +248,8 @@
local values ;
# Treat features with && in the value specially -- each
# &&-separated element is considered a separate value. This is
- # needed to handle searched libraries, which must be in a
- # specific order.
+ # needed to handle searched libraries or include paths, which
+ # may need to be in a specific order.
if ! [ MATCH (&&) : $(p:G=) ]
{
values = $(p:G=) ;
@@ -383,11 +386,11 @@
if ! $(id) in $(generators-to-ignore)
{
# Some generator names have multiple periods in their name, so
- # $(id:B=$(toolset)) doesn't generate the right new-id name. E.g. if
- # id = gcc.compile.c++, $(id:B=darwin) = darwin.c++, which is not
- # what we want. Manually parse the base and suffix (if there's a
- # better way to do this, I'd love to see it). See also register in
- # module generators.
+ # $(id:B=$(toolset)) does not generate the right new-id name. E.g.
+ # if id = gcc.compile.c++ then $(id:B=darwin) = darwin.c++, which is
+ # not what we want. Manually parse the base and suffix. If there is
+ # a better way to do this, I would love to see it. See also the
+ # register() rule in the generators module.
local base = $(id) ;
local suffix = "" ;
while $(base:S)
@@ -405,14 +408,14 @@
# Brings all flag definitions from the 'base' toolset into the 'toolset'
# toolset. Flag definitions whose conditions make use of properties in
-# 'prohibited-properties' are ignored. Don't confuse property and feature, for
+# 'prohibited-properties' are ignored. Do not confuse property and feature, for
# example <debug-symbols>on and <debug-symbols>off, so blocking one of them does
# not block the other one.
#
# The flag conditions are not altered at all, so if a condition includes a name,
-# or version of a base toolset, it won't ever match the inheriting toolset. When
-# such flag settings must be inherited, define a rule in base toolset module and
-# call it as needed.
+# or version of a base toolset, it will not ever match the inheriting toolset.
+# When such flag settings must be inherited, define a rule in base toolset
+# module and call it as needed.
#
rule inherit-flags ( toolset : base : prohibited-properties * )
{
@@ -447,7 +450,7 @@
rule inherit-rules ( toolset : base )
{
- # It appears that "action" creates a local rule...
+ # It appears that "action" creates a local rule.
local base-generators = [ generators.generators-for-toolset $(base) ] ;
local rules ;
for local g in $(base-generators)
@@ -456,8 +459,7 @@
rules += $(id) ;
}
IMPORT $(base) : $(rules) : $(toolset) : $(rules) ;
- # Import the rules to the global scope
- IMPORT $(toolset) : $(rules) : : $(toolset).$(rules) ;
+ IMPORT $(base) : $(rules) : : $(toolset).$(rules) ;
}
Modified: branches/release/tools/build/v2/build/type.jam
==============================================================================
--- branches/release/tools/build/v2/build/type.jam (original)
+++ branches/release/tools/build/v2/build/type.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -14,7 +14,8 @@
import property ;
import scanner ;
-# The follwing import would create a circular dependency:
+
+# The following import would create a circular dependency:
# project -> project-root -> builtin -> type -> targets -> project
# import targets ;
@@ -48,15 +49,15 @@
else
{
.types += $(type) ;
- .bases.$(type) = $(base-type) ;
+ .base.$(type) = $(base-type) ;
.derived.$(base-type) += $(type) ;
if $(suffixes)-is-not-empty
{
# Specify mapping from suffixes to type.
register-suffixes $(suffixes) : $(type) ;
- # Generated targets of 'type' will use the first of 'suffixes'. This
- # may be overriden.
+ # By default generated targets of 'type' will use the first of
+ #'suffixes'. This may be overriden.
set-generated-target-suffix $(type) : : $(suffixes[1]) ;
}
@@ -68,14 +69,18 @@
feature.compose <base-target-type>$(type) : <base-target-type>$(base-type) ;
# We used to declare the main target rule only when a 'main' parameter
- # was specified. However, it's hard to decide that a type will *never*
- # need a main target rule and so from time to time we needed to make yet
- # another type 'main'. So now a main target rule is defined for each
- # type.
+ # has been specified. However, it is hard to decide that a type will
+ # *never* need a main target rule and so from time to time we needed to
+ # make yet another type 'main'. So now a main target rule is defined for
+ # each type.
main-rule-name = [ type-to-rule-name $(type) ] ;
.main-target-type.$(main-rule-name) = $(type) ;
-
IMPORT $(__name__) : main-target-rule : : $(main-rule-name) ;
+
+ # Adding a new derived type affects generator selection so we need to
+ # make the generator selection module update any of its cached
+ # information related to a new derived type being defined.
+ generators.update-cached-information-with-a-new-type $(type) ;
}
}
@@ -114,8 +119,8 @@
}
else if $(.type.$(s)) != type
{
- errors.error Attempting to specify multiple types for suffix \"$(s)\"
- : "Old type $(.type.$(s)), New type $(type)" ;
+ errors.error Attempting to specify multiple types for suffix
+ \"$(s)\" : "Old type $(.type.$(s)), New type $(type)" ;
}
}
}
@@ -136,7 +141,7 @@
#
rule validate ( type )
{
- if ! $(type) in $(.types)
+ if ! [ registered $(type) ]
{
errors.error "Unknown target type $(type)" ;
}
@@ -147,10 +152,7 @@
#
rule set-scanner ( type : scanner )
{
- if ! $(type) in $(.types)
- {
- error "Type" $(type) "is not declared" ;
- }
+ validate $(type) ;
.scanner.$(type) = $(scanner) ;
}
@@ -166,6 +168,15 @@
}
+# Returns a base type for the given type or nothing in case the given type is
+# not derived.
+#
+rule base ( type )
+{
+ return $(.base.$(type)) ;
+}
+
+
# Returns the given type and all of its base types in order of their distance
# from type.
#
@@ -174,13 +185,16 @@
local result = $(type) ;
while $(type)
{
- type = $(.bases.$(type)) ;
+ type = [ base $(type) ] ;
result += $(type) ;
}
return $(result) ;
}
+# Returns the given type and all of its derived types in order of their distance
+# from type.
+#
rule all-derived ( type )
{
local result = $(type) ;
@@ -192,7 +206,8 @@
}
-# Returns true if 'type' has 'base' as its direct or indirect base.
+# Returns true if 'type' is equal to 'base' or has 'base' as its direct or
+# indirect base.
#
rule is-derived ( type base )
{
@@ -202,19 +217,15 @@
}
}
-
# Returns true if 'type' is either derived from or is equal to 'base'.
#
+# TODO: It might be that is-derived and is-subtype were meant to be different
+# rules - one returning true for type = base and one not, but as currently
+# implemented they are actually the same. Clean this up.
+#
rule is-subtype ( type base )
{
- if $(type) = $(base)
- {
- return true ;
- }
- else
- {
- return [ is-derived $(type) $(base) ] ;
- }
+ return [ is-derived $(type) $(base) ] ;
}
@@ -329,7 +340,7 @@
{
found = true ;
}
- type = $(.bases.$(type)) ;
+ type = $(.base.$(type)) ;
}
if $(result) = ""
{
@@ -345,8 +356,8 @@
local v = $($(key)) ;
if ! $(v)
{
- v = [ generated-target-ps-real $(ps) : $(type)
- : [ $(property-set).raw ] ] ;
+ v = [ generated-target-ps-real $(ps) : $(type) : [ $(property-set).raw ]
+ ] ;
if ! $(v)
{
v = none ;
@@ -361,9 +372,9 @@
}
-# Returns file type given it's name. If there are several dots in filename,
-# tries each suffix. E.g. for name of "file.so.1.2" suffixes "2", "1", and "so"
-# will be tried.
+# Returns file type given its name. If there are several dots in filename, tries
+# each suffix. E.g. for name of "file.so.1.2" suffixes "2", "1", and "so" will
+# be tried.
#
rule type ( filename )
{
@@ -379,23 +390,32 @@
# Rule used to construct all main targets. Note that this rule gets imported
-# into the global namespace under different alias names and exactly what type of
-# target it is supposed to construct is read from the name of the alias rule
-# actually used to invoke it.
+# into the global namespace under different alias names and the exact target
+# type to construct is selected based on the alias used to actually invoke this
+# rule.
#
-rule main-target-rule ( name : sources * : requirements * : default-build *
- : usage-requirements * )
+rule main-target-rule ( name : sources * : requirements * : default-build * :
+ usage-requirements * )
{
- # First discover the required target type, which is equal to the rule name
- # used to invoke us.
+ # First discover the required target type based on the exact alias used to
+ # invoke this rule.
local bt = [ BACKTRACE 1 ] ;
local rulename = $(bt[4]) ;
+ local target-type = [ type-from-rule-name $(rulename) ] ;
- local project = [ project.current ] ;
-
- # This is a circular module dependency so it must be imported here.
+ # This is a circular module dependency and so must be imported here.
import targets ;
- return [ targets.create-typed-target $(.main-target-type.$(rulename))
- : $(project) : $(name) : $(sources) : $(requirements)
- : $(default-build) : $(usage-requirements) ] ;
+
+ return [ targets.create-typed-target $(target-type) : [ project.current ] :
+ $(name) : $(sources) : $(requirements) : $(default-build) :
+ $(usage-requirements) ] ;
+}
+
+
+rule __test__ ( )
+{
+ import assert ;
+
+ # TODO: Add tests for all the is-derived, is-base & related type relation
+ # checking rules.
}
Modified: branches/release/tools/build/v2/build/virtual-target.jam
==============================================================================
--- branches/release/tools/build/v2/build/virtual-target.jam (original)
+++ branches/release/tools/build/v2/build/virtual-target.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,7 +6,7 @@
# Implements virtual targets, which correspond to actual files created during a
# build, but are not yet targets in Jam sense. They are needed, for example,
-# when searching for possible transformation sequences, when it's not yet known
+# when searching for possible transformation sequences, when it is not yet known
# whether a particular target should be created at all.
import "class" : new ;
@@ -17,6 +17,7 @@
import type ;
import utility ;
+
# +--------------------------+
# | virtual-target |
# +==========================+
@@ -88,18 +89,24 @@
# Name of this target.
#
- rule name ( ) { return $(self.name) ; }
+ rule name ( )
+ {
+ return $(self.name) ;
+ }
# Project of this target.
#
- rule project ( ) { return $(self.project) ; }
+ rule project ( )
+ {
+ return $(self.project) ;
+ }
# Adds additional 'virtual-target' instances this one depends on.
#
rule depends ( d + )
{
- self.dependencies = [ sequence.merge $(self.dependencies)
- : [ sequence.insertion-sort $(d) ] ] ;
+ self.dependencies = [ sequence.merge $(self.dependencies) :
+ [ sequence.insertion-sort $(d) ] ] ;
}
rule dependencies ( )
@@ -185,7 +192,8 @@
{
# In fact, we just need to merge virtual-target with
# abstract-file-target as the latter is the only class derived from the
- # former. But that's for later.
+ # former. But that has been left for later.
+
errors.error "method should be defined in derived classes" ;
}
}
@@ -197,8 +205,9 @@
# May be a source file (when no action is specified) or a derived file
# (otherwise).
#
-# The target's grist is concatenation of its project's location, properties of
-# action (for derived files) and, optionally, value identifying the main target.
+# The target's grist is a concatenation of its project's location, action
+# properties (for derived targets) and, optionally, value identifying the main
+# target.
#
class abstract-file-target : virtual-target
{
@@ -236,7 +245,10 @@
}
}
- rule type ( ) { return $(self.type) ; }
+ rule type ( )
+ {
+ return $(self.type) ;
+ }
# Sets the path. When generating target name, it will override any path
# computation from properties.
@@ -291,11 +303,11 @@
}
# Return a human-readable representation of this target. If this target has
- # an action, that's:
+ # an action, that is:
#
# { <action-name>-<self.name>.<self.type> <action-sources>... }
#
- # otherwise, it's:
+ # otherwise, it is:
#
# { <self.name>.<self.type> }
#
@@ -358,7 +370,7 @@
rule grist ( )
{
# Depending on target, there may be different approaches to generating
- # unique prefixes. We'll generate prefixes in the form
+ # unique prefixes. We generate prefixes in the form:
# <one letter approach code> <the actual prefix>
local path = [ path ] ;
if $(path)
@@ -441,7 +453,7 @@
}
}
- # If there's no tag or the tag rule returned nothing.
+ # If there is no tag or the tag rule returned nothing.
if ! $(tag) || ! $(self.name)
{
self.name = [ virtual-target.add-prefix-and-suffix $(specified-name)
@@ -460,7 +472,7 @@
if $(self.action)
{
- # For non-derived target, we don't care if there are several
+ # For non-derived target, we do not care if there are several
# virtual targets that refer to the same name. One case when
# this is unavoidable is when the file name is main.cpp and two
# targets have types CPP (for compiling) and MOCCABLE_CPP (for
@@ -531,23 +543,23 @@
import errors ;
rule __init__ (
- name exact ?
- : type ? # Optional type for this target
+ name exact ?
+ : type ? # Optional type for this target.
: project
: action ?
: path ?
)
{
- abstract-file-target.__init__ $(name) $(exact) : $(type) : $(project)
- : $(action) ;
+ abstract-file-target.__init__ $(name) $(exact) : $(type) : $(project) :
+ $(action) ;
self.path = $(path) ;
}
rule clone-with-different-type ( new-type )
{
- return [ new file-target $(self.name) exact : $(new-type)
- : $(self.project) : $(self.action) : $(self.path) ] ;
+ return [ new file-target $(self.name) exact : $(new-type) :
+ $(self.project) : $(self.action) : $(self.path) ] ;
}
rule actualize-location ( target )
@@ -581,14 +593,14 @@
# target has no directory name and uses a special <e> grist.
#
# First, that means that "bjam hello.o" will build all known hello.o
- # targets. Second, the <e> grist makes sure this target won't be
+ # targets. Second, the <e> grist makes sure this target will not be
# confused with other targets, for example, if we have subdir 'test'
# with target 'test' in it that includes a 'test.o' file, then the
# target for directory will be just 'test' the target for test.o
# will be <ptest/bin/gcc/debug>test.o and the target we create below
# will be <e>test.o
DEPENDS $(target:G=e) : $(target) ;
- # Allow bjam <path-to-file>/<file> to work. This won't catch all
+ # Allow bjam <path-to-file>/<file> to work. This will not catch all
# possible ways to refer to the path (relative/absolute, extra ".",
# various "..", but should help in obvious cases.
DEPENDS $(target:G=e:R=$(path)) : $(target) ;
@@ -608,13 +620,13 @@
if $(self.action)
{
local p = [ $(self.action).properties ] ;
- local path = [ $(p).target-path ] ;
+ local path,relative-to-build-dir = [ $(p).target-path ] ;
+ local path = $(path,relative-to-build-dir[1]) ;
+ local relative-to-build-dir = $(path,relative-to-build-dir[2]) ;
- if $(path[2]) = true
+ if $(relative-to-build-dir)
{
- # Indicates that the path is relative to the build dir.
- path = [ path.join [ $(self.project).build-dir ]
- $(path[1]) ] ;
+ path = [ path.join [ $(self.project).build-dir ] $(path) ] ;
}
self.path = [ path.native $(path) ] ;
@@ -727,7 +739,8 @@
actualize-sources [ sources ] : $(properties) ;
- DEPENDS $(actual-targets) : $(self.actual-sources) $(self.dependency-only-sources) ;
+ DEPENDS $(actual-targets) : $(self.actual-sources)
+ $(self.dependency-only-sources) ;
# Action name can include additional argument to rule, which should
# not be passed to 'set-target-variables'
@@ -794,8 +807,8 @@
#
# For bjam to find the dependency the generated target must be
# actualized (i.e. have its Jam target constructed). In the above case,
- # if we're building just hello ("bjam hello"), 'a.h' won't be actualized
- # unless we do it here.
+ # if we are building just hello ("bjam hello"), 'a.h' will not be
+ # actualized unless we do it here.
local implicit = [ $(self.properties).get <implicit-dependency> ] ;
for local i in $(implicit)
{
@@ -816,7 +829,7 @@
# Action class which does nothing --- it produces the targets with specific
-# properties out of nowhere. It's needed to distinguish virtual targets with
+# properties out of nowhere. It is needed to distinguish virtual targets with
# different properties that are known to exist and have no actions which create
# them.
#
@@ -866,16 +879,21 @@
# Creates a virtual target with an appropriate name and type from 'file'. If a
# target with that name in that project already exists, returns that already
# created target.
+#
# FIXME: a more correct way would be to compute the path to the file, based on
# name and source location for the project, and use that path to determine if
-# the target was already created.
+# the target has already been created. This logic should be shared with how we
+# usually find targets identified by a specific target id. It should also be
+# updated to work correctly when the file is specified using both relative and
+# absolute paths.
+#
# TODO: passing a project with all virtual targets is starting to be annoying.
#
rule from-file ( file : file-loc : project )
{
import type ; # Had to do this here to break a circular dependency.
- # Check if we've created a target corresponding to this file.
+ # Check whether we already created a target corresponding to this file.
local path = [ path.root [ path.root $(file) $(file-loc) ] [ path.pwd ] ] ;
if $(.files.$(path))
@@ -888,11 +906,8 @@
local type = [ type.type $(file) ] ;
local result ;
- result = [ new file-target $(file)
- : $(type)
- : $(project)
- : #action
- : $(file-loc) ] ;
+ result = [ new file-target $(file) : $(type) : $(project) : :
+ $(file-loc) ] ;
.files.$(path) = $(result) ;
return $(result) ;
@@ -900,7 +915,7 @@
}
-# Registers a new virtual target. Checks if there's already a registered target
+# Registers a new virtual target. Checks if there is already a registered target
# with the same name, type, project and subvariant properties as well as the
# same sources and equal action. If such target is found it is returned and a
# new 'target' is not registered. Otherwise, 'target' is registered and
@@ -926,15 +941,15 @@
else
{
if $(a1) && $(a2) &&
- [ $(a1).action-name ] = [ $(a2).action-name ] &&
- [ $(a1).sources ] = [ $(a2).sources ]
+ ( [ $(a1).action-name ] = [ $(a2).action-name ] ) &&
+ ( [ $(a1).sources ] = [ $(a2).sources ] )
{
local ps1 = [ $(a1).properties ] ;
local ps2 = [ $(a2).properties ] ;
- local p1 = [ $(ps1).base ] [ $(ps1).free ]
- [ set.difference [ $(ps1).dependency ] : [ $(ps1).incidental ] ] ;
- local p2 = [ $(ps2).base ] [ $(ps2).free ]
- [ set.difference [ $(ps2).dependency ] : [ $(ps2).incidental ] ] ;
+ local p1 = [ $(ps1).base ] [ $(ps1).free ] [ set.difference
+ [ $(ps1).dependency ] : [ $(ps1).incidental ] ] ;
+ local p2 = [ $(ps2).base ] [ $(ps2).free ] [ set.difference
+ [ $(ps2).dependency ] : [ $(ps2).incidental ] ] ;
if $(p1) = $(p2)
{
result = $(t) ;
@@ -957,10 +972,10 @@
}
-# Each target returned by 'register' is added to a .recent-targets list,
+# Each target returned by 'register' is added to the .recent-targets list,
# returned by this function. This allows us to find all virtual targets created
-# when building a given main target, even those constructed only as intermediate
-# targets.
+# when building a specific main target, even those constructed only as
+# intermediate targets.
#
rule recent-targets ( )
{
@@ -1040,9 +1055,9 @@
# Traverses the dependency graph of 'target' and return all targets that will be
# created before this one is created. If the root of some dependency graph is
-# found during traversal, it's either included or not, depending on the value of
-# 'include-roots'. In either case traversal stops at root targets, i.e. sources
-# of root targets are not traversed.
+# found during traversal, it is either included or not, depending on the
+# 'include-roots' value. In either case traversal stops at root targets, i.e.
+# root target sources are not traversed.
#
rule traverse ( target : include-roots ? : include-sources ? )
{
@@ -1097,9 +1112,9 @@
for local target in [ $(action).targets ]
{
local n = [ $(target).name ] ;
- # Don't modify produced targets names.
- local cloned-target = [ class.new file-target $(n) exact
- : [ $(target).type ] : $(new-project) : $(cloned-action) ] ;
+ # Do not modify produced target names.
+ local cloned-target = [ class.new file-target $(n) exact :
+ [ $(target).type ] : $(new-project) : $(cloned-action) ] ;
local d = [ $(target).dependencies ] ;
if $(d)
{
Deleted: branches/release/tools/build/v2/doc/Jamfile.v2
==============================================================================
--- branches/release/tools/build/v2/doc/Jamfile.v2 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,29 +0,0 @@
-# Copyright 2004,2006 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)
-
-import quickbook
- ;
-
-project tools/build/v2/doc
- ;
-
-boostbook userman : src/standalone.xml
- : <xsl:param>toc.section.depth=1
- <xsl:param>doc.standalone=true
- <xsl:param>nav.layout=none
- <implicit-dependency>jam_docs
- <dependency>jam_docs
- ;
-
-xml jam_docs : ../../../jam/doc/bjam.qbk ;
-
-if ! $(BOOST_ROOT)
-{
- BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
-}
-
-# Copy stylesheet and images from 'official' docs location
-stage html : $(BOOST_ROOT)/doc/html/boostbook.css ;
-stage html/images
- : [ path.glob $(BOOST_ROOT)/doc/html/images : *.png ] ;
Modified: branches/release/tools/build/v2/doc/src/advanced.xml
==============================================================================
--- branches/release/tools/build/v2/doc/src/advanced.xml (original)
+++ branches/release/tools/build/v2/doc/src/advanced.xml 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,60 +5,78 @@
<chapter id="bbv2.advanced">
<title>Overview</title>
- <para>This section will provide the information necessary to create your own
- projects using Boost.Build. The information provided here is relatively
- high-level, and <xref linkend="bbv2.reference"/> as well as the on-line help
- system must be used to obtain low-level documentation (see <xref linkend=
- "bbv2.reference.init.options.help"/>).</para>
-
- <para>Boost.Build actually consists of two parts - Boost.Jam, a build engine
- with its own interpreted language, and Boost.Build itself, implemented in
- Boost.Jam's language. The chain of events when you type
- <command>bjam</command> on the command line is:
+ <para>
+ This section will provide the information necessary to create your own
+ projects using Boost.Build. The information provided here is relatively
+ high-level, and <xref linkend="bbv2.reference"/> as well as the on-line
+ help system must be used to obtain low-level documentation (see <xref
+ linkend="bbv2.reference.init.options.help"/>).
+ </para>
+
+ <para>
+ Boost.Build actually consists of two parts - Boost.Jam, a build engine
+ with its own interpreted language, and Boost.Build itself, implemented in
+ Boost.Jam's language. The chain of events when you type
+ <command>bjam</command> on the command line is as follows:
<orderedlist>
<listitem>
- <para>Boost.Jam tries to find Boost.Build and loads the top-level
- module. The exact process is described in <xref
- linkend="bbv2.reference.init"/></para>
+ <para>
+ Boost.Jam tries to find Boost.Build and loads the top-level module.
+ The exact process is described in <xref linkend=
+ "bbv2.reference.init"/>
+ </para>
</listitem>
<listitem>
- <para>The top-level module loads user-defined configuration files,
- <filename>user-config.jam</filename> and
- <filename>site-config.jam</filename>, which define available toolsets.
+ <para>
+ The top-level module loads user-defined configuration files,
+ <filename>user-config.jam</filename> and <filename>site-config.jam
+ </filename>, which define available toolsets.
</para>
</listitem>
<listitem>
- <para>The Jamfile in the current directory is read. That in turn
- might cause reading of further Jamfiles. As a result, a tree of
- projects is created, with targets inside projects.</para>
+ <para>
+ The Jamfile in the current directory is read. That in turn might
+ cause reading of further Jamfiles. As a result, a tree of projects
+ is created, with targets inside projects.
+ </para>
</listitem>
<listitem>
- <para>Finally, using the build request specified on the command line,
- Boost.Build decides which targets should be built, and how. That
- information is passed back to Boost.Jam, which takes care of
- actually running commands.</para>
+ <para>
+ Finally, using the build request specified on the command line,
+ Boost.Build decides which targets should be built and how. That
+ information is passed back to Boost.Jam, which takes care of
+ actually running the scheduled build action commands.
+ </para>
</listitem>
</orderedlist>
</para>
- <para>So, to be able to successfully use Boost.Build, you need to know only
- four things:
+ <para>
+ So, to be able to successfully use Boost.Build, you need to know only four
+ things:
<itemizedlist>
<listitem>
- <para><link linkend="bbv2.advanced.configuration">
- How to configure Boost.Build</link></para>
+ <para>
+ <link linkend="bbv2.advanced.configuration">How to configure
+ Boost.Build</link>
+ </para>
</listitem>
<listitem>
- <para><link linkend="bbv2.advanced.targets">
- How to write declares targets in Jamfiles</link></para>
+ <para>
+ <link linkend="bbv2.advanced.targets">How to declare targets in
+ Jamfiles</link>
+ </para>
</listitem>
<listitem>
- <para><link linkend="bbv2.advanced.build_process">
- How the build process works</link></para>
+ <para>
+ <link linkend="bbv2.advanced.build_process">How the build process
+ works</link>
+ </para>
</listitem>
<listitem>
- <para>Some Basics about the Boost.Jam language. See
- <xref linkend="bbv2.advanced.jam_language"/>.
+ <para>
+ Some Basics about the Boost.Jam language. See <xref linkend=
+ "bbv2.advanced.jam_language"/>.
</para>
</listitem>
</itemizedlist>
@@ -67,153 +85,187 @@
<section id="bbv2.advanced.jam_language">
<title>Boost.Jam Language</title>
- <para>This section will describe the basics of the Boost.Jam
- language—just enough for writing Jamfiles. For more information,
- please see the <link linkend="bbv2.jam">Boost.Jam</link> documentation.
- </para>
-
- <para><link linkend="bbv2.jam">Boost.Jam</link> has an interpreted,
- procedural language. On the lowest level, a <link linkend="bbv2.jam">
- Boost.Jam</link> program consists of variables and
- <indexterm><primary>rule</primary></indexterm>
- <firstterm>rules</firstterm> (the Jam term for function). They are grouped
- in modules—there's one global module and a number of named modules.
- Besides that, a <link linkend="bbv2.jam">Boost.Jam</link> program contains
- classes and class instances.</para>
-
- <para>Syntantically, a <link linkend="bbv2.jam">Boost.Jam</link> program
- consists of two kind of elements—keywords (which have a special
- meaning to <link linkend="bbv2.jam">Boost.Jam</link>) and literals.
-
- Consider this code:
- <programlisting>
-a = b ;</programlisting>
- which assigns the value <literal>b</literal> to the variable
- <literal>a</literal>. Here, <literal>=</literal> and <literal>;</literal>
- are keywords, while <literal>a</literal> and <literal>b</literal> are
- literals.
- <warning>
- <para>All syntax elements, even keywords, must be separated by spaces.
- For example, omitting the space character before <literal>;</literal>
- will lead to a syntax error.
- </para>
- </warning>
- If you want to use a literal value that is the same as some keyword, the
- value can be quoted:
- <programlisting>
-a = "=" ;</programlisting>
+ <para>
+ This section will describe the basics of the Boost.Jam language—
+ just enough for writing Jamfiles. For more information, please see the
+ <link linkend="bbv2.jam">Boost.Jam</link> documentation.
+ </para>
+
+ <para>
+ <link linkend="bbv2.jam">Boost.Jam</link> has an interpreted, procedural
+ language. On the lowest level, a <link linkend="bbv2.jam">Boost.Jam
+ </link> program consists of variables and <indexterm><primary>rule
+ </primary></indexterm> <firstterm>rules</firstterm> (Jam term for
+ function). They are grouped into modules—there is one global
+ module and a number of named modules. Besides that, a <link linkend=
+ "bbv2.jam">Boost.Jam</link> program contains classes and class
+ instances.
+ </para>
+
+ <para>
+ Syntantically, a <link linkend="bbv2.jam">Boost.Jam</link> program
+ consists of two kind of elements—keywords (which have a special
+ meaning to <link linkend="bbv2.jam">Boost.Jam</link>) and literals.
+ Consider this code:
+<programlisting>
+a = b ;
+</programlisting>
+ which assigns the value <literal>b</literal> to the variable <literal>a
+ </literal>. Here, <literal>=</literal> and <literal>;</literal> are
+ keywords, while <literal>a</literal> and <literal>b</literal> are
+ literals.
+ <warning>
+ <para>
+ All syntax elements, even keywords, must be separated by spaces. For
+ example, omitting the space character before <literal>;</literal>
+ will lead to a syntax error.
+ </para>
+ </warning>
+ If you want to use a literal value that is the same as some keyword, the
+ value can be quoted:
+<programlisting>
+a = "=" ;
+</programlisting>
</para>
- <para>All variables in <link linkend="bbv2.jam">Boost.Jam</link> have the
- same type—list of strings. To define a variable one assigns a value
- to it, like in the previous example. An undefined variable is the same as
- a variable with an empty value. Variables can be accessed using the
- <code>$(<replaceable>variable</replaceable>)</code> syntax. For example:
- <programlisting>
-a = $(b) $(c) ;</programlisting>
+ <para>
+ All variables in <link linkend="bbv2.jam">Boost.Jam</link> have the same
+ type—list of strings. To define a variable one assigns a value to
+ it, like in the previous example. An undefined variable is the same as a
+ variable with an empty value. Variables can be accessed using the
+ <code>$(<replaceable>variable</replaceable>)</code> syntax. For example:
+<programlisting>
+a = $(b) $(c) ;
+</programlisting>
</para>
<para>
- Rules are defined by specifying the rule name, the parameter names,
- and the allowed size of the list value for each parameter.
- <programlisting>
+ Rules are defined by specifying the rule name, the parameter names, and
+ the allowed value list size for each parameter.
+<programlisting>
rule <replaceable>example</replaceable>
- (
- <replaceable>parameter1</replaceable> :
- <replaceable>parameter2 ?</replaceable> :
- <replaceable>parameter3 +</replaceable> :
- <replaceable>parameter4 *</replaceable>
- )
- {
- // body
- }</programlisting>
+ (
+ <replaceable>parameter1</replaceable> :
+ <replaceable>parameter2 ?</replaceable> :
+ <replaceable>parameter3 +</replaceable> :
+ <replaceable>parameter4 *</replaceable>
+ )
+ {
+ # rule body
+ }
+ </programlisting>
When this rule is called, the list passed as the first argument must
have exactly one value. The list passed as the second argument can
either have one value of be empty. The two remaining arguments can be
arbitrarily long, but the third argument may not be empty.
</para>
- <para>The overview of <link linkend="bbv2.jam">Boost.Jam</link> language
- statements is given below:
- <programlisting>
+ <para>
+ The overview of <link linkend="bbv2.jam">Boost.Jam</link> language
+ statements is given below:
+<programlisting>
helper 1 : 2 : 3 ;
-x = [ helper 1 : 2 : 3 ] ;</programlisting>
- This code calls the named rule with the specified arguments. When the
- result of the call must be used inside some expression, you need to add
- brackets around the call, like shown on the second line.
- <programlisting>
-if cond { statements } [ else { statements } ]</programlisting>
- This is a regular if-statement. The condition is composed of:
- <itemizedlist>
- <listitem><para>Literals (true if at least one string is not empty)</para></listitem>
- <listitem><para>Comparisons: <code>a
- <replaceable>operator</replaceable> b</code> where
- <replaceable>operator</replaceable> is one of <code>=</code>,
- <code>!=</code>, <code><</code>, <code>></code>,
- <code><=</code>, <code>>=</code>. The comparison is done
- pairwise between each string in the left and the right arguments.
- </para>
- </listitem>
- <listitem><para>Logical operations: <code>! a</code>, <code>a &&
- b</code>, <code>a || b</code></para></listitem>
- <listitem><para>Grouping: <code>( cond )</code></para></listitem>
- </itemizedlist>
- <programlisting>
-for var in list { statements }</programlisting>
- Executes statements for each element in list, setting the variable
- <varname>var</varname> to the element value.
- <programlisting>
-while cond { statements }</programlisting>
- Repeatedly execute statements while cond remains true upon entry.
- <programlisting>
+x = [ helper 1 : 2 : 3 ] ;
+</programlisting>
+ This code calls the named rule with the specified arguments. When the
+ result of the call must be used inside some expression, you need to add
+ brackets around the call, like shown on the second line.
+<programlisting>
+if cond { statements } [ else { statements } ]
+</programlisting>
+ This is a regular if-statement. The condition is composed of:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Literals (true if at least one string is not empty)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Comparisons: <code>a <replaceable>operator</replaceable> b</code>
+ where <replaceable>operator</replaceable> is one of
+ <code>=</code>, <code>!=</code>, <code><</code>,
+ <code>></code>, <code><=</code> or <code>>=</code>. The
+ comparison is done pairwise between each string in the left and
+ the right arguments.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Logical operations: <code>! a</code>, <code>a && b</code>,
+ <code>a || b</code>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Grouping: <code>( cond )</code>
+ </para>
+ </listitem>
+ </itemizedlist>
+<programlisting>
+for var in list { statements }
+</programlisting>
+ Executes statements for each element in list, setting the variable
+ <varname>var</varname> to the element value.
+<programlisting>
+while cond { statements }
+</programlisting>
+ Repeatedly execute statements while cond remains true upon entry.
+<programlisting>
return values ;
- </programlisting>This statement should be used only inside a
- rule and assigns <code>values</code> to the return value of the
- rule.
- <warning><para>
- The <code>return</code> statement does not exit the rule. For example:
- <programlisting>
+</programlisting>
+ This statement should be used only inside a rule and assigns
+ <code>values</code> to the return value of the rule.
+ <warning>
+ <para>
+ The <code>return</code> statement does not exit the rule. For
+ example:
+<programlisting>
rule test ( )
{
- if 1 = 1 {
+ if 1 = 1
+ {
return "reasonable" ;
}
return "strange" ;
-}</programlisting> will return <literal>strange</literal>, not
-<literal>reasonable</literal>.
- </para></warning>
-
- <programlisting>
+}
+</programlisting>
+ will return <literal>strange</literal>, not
+ <literal>reasonable</literal>.
+ </para>
+ </warning>
+<programlisting>
import <replaceable>module</replaceable> ;
-import <replaceable>module</replaceable> : <replaceable>rule</replaceable> ;</programlisting>
- The first form imports the specified bjam module. All rules from
- that module are made available using the qualified name:
- <code><replaceable>module</replaceable>.<replaceable>rule</replaceable></code>.
- The second form imports the specified rules only, and they can be called
- using unqualified names.
+import <replaceable>module</replaceable> : <replaceable>rule</replaceable> ;
+</programlisting>
+ The first form imports the specified bjam module. All rules from that
+ module are made available using the qualified name: <code><replaceable>
+ module</replaceable>.<replaceable>rule</replaceable></code>. The second
+ form imports the specified rules only, and they can be called using
+ unqualified names.
</para>
<para id="bbv2.advanced.jam_language.actions">
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:
+ when creating targets. In jam language, you use named actions to do
+ this. For example:
<programlisting>
actions create-file-from-another
{
create-file-from-another $(<) $(>)
}
</programlisting>
- This specifies a named action called
- <literal>create-file-from-another</literal>. The text inside braces is
- the command to invoke. The <literal>$(<)</literal> variable will be
- expanded to a list of generated files, and the
- <literal>$(>)</literal> variable will be expanded to a list of
- source files.
+ This specifies a named action called <literal>
+ create-file-from-another</literal>. The text inside braces is the
+ command to invoke. The <literal>$(<)</literal> variable will be
+ expanded to a list of generated files, and the <literal>$(>)
+ </literal> variable will be expanded to a list of source files.
</para>
- <para>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:
+ <para>
+ To flexibly adjust the command line, you can define a rule with the same
+ name as the action and taking three parameters -- targets, sources and
+ properties. For example:
<programlisting>
rule create-file-from-another ( targets * : sources * : properties * )
{
@@ -227,18 +279,18 @@
create-file-from-another $(OPTIONS) $(<) $(>)
}
</programlisting>
- In this example, the rule checks if certain build property is specified.
- If so, it sets variable <varname>OPIONS</varname> that is then used inside
- the action. Note that the variables set "on a target" will be visible only
- inside actions building that target, not globally. Were they set globally,
- using variable named <varname>OPTIONS</varname> in two unrelated actions
- would be impossible.
+ In this example, the rule checks if certain build property is specified.
+ If so, it sets variable <varname>OPIONS</varname> that is then used
+ inside the action. Note that the variables set "on a target" will be
+ visible only inside actions building that target, not globally. Were
+ they set globally, using variable named <varname>OPTIONS</varname> in
+ two unrelated actions would be impossible.
</para>
- <para>More details can be found in Jam reference,
- <xref linkend="jam.language.rules"/>
+ <para>
+ More details can be found in Jam reference, <xref
+ linkend="jam.language.rules"/>.
</para>
-
</section>
<section id="bbv2.advanced.configuration">
@@ -265,7 +317,7 @@
default settings. For example, it will use the <command>gcc</command>
executable found in the <envar>PATH</envar>, or look in some known
installation locations. In most cases, this strategy works automatically.
- In case you have several versions of a compiler, it's installed in some
+ In case you have several versions of a compiler, it is installed in some
unusual location, or you need to tweak its configuration, you'll need to
pass additional parameters to the <functionname>using</functionname> rule.
The parameters to <functionname>using</functionname> can be different for
@@ -310,39 +362,39 @@
using msvc : 7.1 ;
using gcc ;
</programlisting>
-If the compiler can be found in the <envar>PATH</envar> but only by a
-nonstandard name, you can just supply that name:
+ If the compiler can be found in the <envar>PATH</envar> but only by a
+ nonstandard name, you can just supply that name:
<programlisting>
using gcc : : g++-3.2 ;
</programlisting>
-Otherwise, it might be necessary to supply the complete path to the
-compiler executable:
+ Otherwise, it might be necessary to supply the complete path to the
+ compiler executable:
<programlisting>
using msvc : : "Z:/Programs/Microsoft Visual Studio/vc98/bin/cl" ;
</programlisting>
-Some Boost.Build toolsets will use that path to take additional
-actions required before invoking the compiler, such as calling
-vendor-supplied scripts to set up its required environment variables.
-When compiler executables for C and C++ are different, path to the C++
-compiler executable must be specified. The “invocation command”
-can be any command allowed by the operating system. For example:
+ Some Boost.Build toolsets will use that path to take additional actions
+ required before invoking the compiler, such as calling vendor-supplied
+ scripts to set up its required environment variables. When compiler
+ executables for C and C++ are different, path to the C++ compiler
+ executable must be specified. The “invocation command” can
+ be any command allowed by the operating system. For example:
<programlisting>
using msvc : : echo Compiling && foo/bar/baz/cl ;
</programlisting>
-will work.
+ will work.
</para>
- <para>To configure several versions of a toolset, simply invoke
- the <functionname>using</functionname> rule multiple times:
+ <para>
+ To configure several versions of a toolset, simply invoke the
+ <functionname>using</functionname> rule multiple times:
<programlisting>
using gcc : 3.3 ;
using gcc : 3.4 : g++-3.4 ;
using gcc : 3.2 : g++-3.2 ;
</programlisting>
- Note that in the first call to
- <functionname>using</functionname>, the compiler found in the
- <envar>PATH</envar> will be used, and there's no need to
- explicitly specify the command.
+ Note that in the first call to <functionname>using</functionname>, the
+ compiler found in the <envar>PATH</envar> will be used, and there is no
+ need to explicitly specify the command.
</para>
<para>As shown above, both the <parameter
@@ -664,34 +716,31 @@
<para>
<!-- use "project-id" here? -->
- The list of sources can also refer to other main targets.
- Targets in the same project can be referred to by name, while
- targets in other projects must be qualified with a directory or a
- symbolic project name. The directory/project name is separated from
- the target name by a double forward slash. There's no special syntax to
- distinguish the directory name from the project name—the part before
- the double slash is first looked up as project name, and then as directory
- name. For example:
+ The list of sources can also refer to other main targets. Targets in
+ the same project can be referred to by name, while targets in other
+ projects must be qualified with a directory or a symbolic project
+ name. The directory/project name is separated from the target name by
+ a double forward slash. There is no special syntax to distinguish the
+ directory name from the project name—the part before the double
+ slash is first looked up as project name, and then as directory name.
+ For example:
</para>
-
<programlisting>
lib helper : helper.cpp ;
exe a : a.cpp helper ;
-# Since all project ids start with slash, ".." is directory name.
+# Since all project ids start with slash, ".." is a directory name.
exe b : b.cpp ..//utils ;
exe c : c.cpp /boost/program_options//program_options ;
</programlisting>
<para>
- The first exe uses the library defined in the same
- project. The second one uses some target (most likely library)
- defined by Jamfile one level higher. Finally, the third target
- uses some <ulink url="http://boost.org">C++ Boost</ulink>
- library, referring to it by absolute symbolic name. More
- information about target references can be found in <xref
- linkend="bbv2.tutorial.libs"/> and <xref
+ The first exe uses the library defined in the same project. The second
+ one uses some target (most likely a library) defined by a Jamfile one
+ level higher. Finally, the third target uses a <ulink url=
+ "http://boost.org">C++ Boost</ulink> library, referring to it using
+ its absolute symbolic name. More information about target references
+ can be found in <xref linkend="bbv2.tutorial.libs"/> and <xref
linkend="bbv2.reference.ids"/>.
</para>
-
</section>
<section id="bbv2.advanced.targets.requirements">
Modified: branches/release/tools/build/v2/doc/src/faq.xml
==============================================================================
--- branches/release/tools/build/v2/doc/src/faq.xml (original)
+++ branches/release/tools/build/v2/doc/src/faq.xml 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -2,191 +2,232 @@
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
- <chapter id="bbv2.faq">
- <title>Frequently Asked Questions</title>
+<chapter id="bbv2.faq">
+ <title>Frequently Asked Questions</title>
- <section>
- <title>
- How do I get the current value of feature in Jamfile?
- </title>
+ <section>
+ <title>
+ How do I get the current value of feature in Jamfile?
+ </title>
- <para>
- This is not possible, since Jamfile does not have "current" value of any
- feature, be it toolset, build variant or anything else. For a single invocation of
- <filename>bjam</filename>, any given main target can be built with several property sets.
- For example, user can request two build variants on the command line. Or one library
- is built as shared when used from one application, and as static when used from another.
- Obviously, Jamfile is read only once, so generally, there's no single value of a feature
- you can access in Jamfile.
- </para>
+ <para>
+ This is not possible, since Jamfile does not have "current" value of any
+ feature, be it toolset, build variant or anything else. For a single
+ invocation of <filename>bjam</filename>, any given main target can be
+ built with several property sets. For example, user can request two build
+ variants on the command line. Or one library is built as shared when used
+ from one application, and as static when used from another. Each Jamfile
+ is read only once so generally there is no single value of a feature you
+ can access in Jamfile.
+ </para>
+
+ <para>
+ A feature has a specific value only when building a target, and there are
+ two ways you can use that value:
+ </para>
- <para>A feature has a specific value only when building a target, and there are two ways how you
- can use that value:</para>
- <itemizedlist>
- <listitem><simpara>Use conditional requirements or indirect conditional requirements. See
- <xref linkend="bbv2.advanced.targets.requirements.conditional"/>.</simpara>
- </listitem>
- <listitem>Define a custom generator and a custom main target type. The custom generator can do arbitrary processing
- or properties. See the <xref linkend="bbv2.extender">extender manual</xref>.
- </listitem>
- </itemizedlist>
-
- </section>
-
- <section>
- <title>
- I'm getting "Duplicate name of actual target" error. What
- does it mean?
- </title>
-
- <para>
- The most likely case is that you're trying to
- compile the same file twice, with almost the same,
- but differing properties. For example:
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ Use conditional requirements or indirect conditional requirements. See
+ <xref linkend="bbv2.advanced.targets.requirements.conditional"/>.
+ </simpara>
+ </listitem>
+ <listitem>
+ Define a custom generator and a custom main target type. The custom
+ generator can do arbitrary processing or properties. See the <xref
+ linkend="bbv2.extender">extender manual</xref>.
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>
+ I am getting a "Duplicate name of actual target" error. What does that
+ mean?
+ </title>
+ <para>
+ The most likely case is that you are trying to compile the same file
+ twice, with almost the same, but differing properties. For example:
<programlisting>
exe a : a.cpp : <include>/usr/local/include ;
exe b : a.cpp ;
-</programlisting>
-
+</programlisting>
</para>
<para>
- The above snippet requires two different compilations
- of 'a.cpp', which differ only in 'include' property.
- Since the 'include' property is free, Boost.Build
- can't generate two objects files into different directories.
- On the other hand, it's dangerous to compile the file only
- once -- maybe you really want to compile with different
- includes.
+ The above snippet requires two different compilations of
+ <code>a.cpp</code>, which differ only in their <literal>include</literal>
+ property. Since the <literal>include</literal> feature is declared as
+ <literal>free</literal> Boost.Build does not create a separate build
+ directory for each of its values and those two builds would both produce
+ object files generated in the same build directory. Ignoring this and
+ compiling the file only once would be dangerous as different includes
+ could potentially cause completely different code to be compiled.
</para>
<para>
- To solve this issue, you need to decide if file should
- be compiled once or twice.</para>
+ To solve this issue, you need to decide if the file should be compiled
+ once or twice.
+ </para>
<orderedlist>
- <listitem>
- <para>Two compile file only once, make sure that properties
- are the same:
-
+ <listitem>
+ <para>
+ To compile the file only once, make sure that properties are the same
+ for both target requests:
<programlisting>
exe a : a.cpp : <include>/usr/local/include ;
exe b : a.cpp : <include>/usr/local/include ;
-</programlisting></para></listitem>
-
- <listitem><para>
- If changing the properties is not desirable, for example
- if 'a' and 'b' target have other sources which need
- specific properties, separate 'a.cpp' into it's own target:
-
+</programlisting>
+ or:
<programlisting>
-obj a_obj : a.cpp : <include>/usr/local/include ;
-exe a : a_obj ;
-</programlisting></para></listitem>
-
- <listitem><para>
- To compile file twice, you can make the object file local
- to the main target:
-
+alias a-with-include : a.cpp : <include>/usr/local/include ;
+exe a : a-with-include ;
+exe b : a-with-include ;
+</programlisting>
+ or if you want the <literal>includes</literal> property not to affect
+ how any other sources added for the built <code>a</code> and
+ <code>b</code> executables would be compiled:
+<programlisting>
+obj a-obj : a.cpp : <include>/usr/local/include ;
+exe a : a-obj ;
+exe b : a-obj ;
+</programlisting>
+ </para>
+ <para>
+ Note that in both of these cases the <literal>include</literal>
+ property will be applied only for building these object files and not
+ any other sources that might be added for targets <code>a</code> and
+ <code>b</code>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To compile the file twice, you can tell Boost.Build to compile it to
+ two separate object files like so:
+<programlisting>
+ obj a_obj : a.cpp : <include>/usr/local/include ;
+ obj b_obj : a.cpp ;
+ exe a : a_obj ;
+ exe b : b_obj ;
+</programlisting>
+ or you can make the object file targets local to the main target:
<programlisting>
- exe a : [ obj a_obj : a.cpp ] : <include>/usr/local/include ;
+ exe a : [ obj a_obj : a.cpp : <include>/usr/local/include ] ;
exe b : [ obj a_obj : a.cpp ] ;
-</programlisting></para></listitem>
-
- </orderedlist>
-
- <para>
- A good question is why Boost.Build can't use some of the above
- approaches automatically. The problem is that such magic would
- require additional implementation complexities and would only
- help in half of the cases, while in other half we'd be silently
- doing the wrong thing. It's simpler and safe to ask user to
- clarify his intention in such cases.
- </para>
+</programlisting>
+ which will cause Boost.Build to actually change the generated object
+ file names a bit for you and thus avoid any conflicts.
+ </para>
+ <para>
+ Note that in both of these cases the <literal>include</literal>
+ property will be applied only for building these object files and not
+ any other sources that might be added for targets <code>a</code> and
+ <code>b</code>.
+ </para>
+ </listitem>
+ </orderedlist>
- </section>
+ <para>
+ A good question is why Boost.Build can not use some of the above
+ approaches automatically. The problem is that such magic would only help
+ in half of the cases, while in the other half it would be silently doing
+ the wrong thing. It is simpler and safer to ask the user to clarify his
+ intention in such cases.
+ </para>
+ </section>
- <section id="bbv2.faq.envar">
- <title>
+ <section id="bbv2.faq.envar">
+ <title>
Accessing environment variables
- </title>
+ </title>
- <para>
+ <para>
Many users would like to use environment variables in Jamfiles, for
- example, to control location of external libraries. In many cases you
- better declare those external libraries in the site-config.jam file, as
- documented in the <link linkend="bbv2.recipies.site-config">recipes
- section</link>. However, if the users already have the environment variables set
- up, it's not convenient to ask them to set up site-config.jam files as
- well, and using environment variables might be reasonable.
+ example, to control the location of external libraries. In many cases it
+ is better to declare those external libraries in the site-config.jam file,
+ as documented in the <link linkend="bbv2.recipies.site-config">recipes
+ section</link>. However, if the users already have the environment
+ variables set up, it may not be convenient for them to set up their
+ site-config.jam files as well and using the environment variables might be
+ reasonable.
</para>
- <para>In Boost.Build V2, each Jamfile is a separate namespace, and the
- variables defined in environment is imported into the global
- namespace. Therefore, to access environment variable from Jamfile, you'd
- need the following code:
+ <para>
+ Boost.Jam automatically imports all environment variables into its
+ built-in .ENVIRON module so user can read them from there directly or by
+ using the helper os.environ rule. For example:
+<programlisting>
+import os ;
+local unga-unga = [ os.environ UNGA_UNGA ] ;
+ECHO $(unga-unga) ;
+</programlisting>
+ or a bit more realistic:
<programlisting>
import os ;
local SOME_LIBRARY_PATH = [ os.environ SOME_LIBRARY_PATH ] ;
exe a : a.cpp : <include>$(SOME_LIBRARY_PATH) ;
</programlisting>
</para>
-</section>
+ </section>
- <section>
- <title>
- How to control properties order?
- </title>
+ <section>
+ <title>
+ How to control properties order?
+ </title>
- <para>For internal reasons, Boost.Build sorts all the properties
- alphabetically. This means that if you write:
+ <para>
+ For internal reasons, Boost.Build sorts all the properties alphabetically.
+ This means that if you write:
<programlisting>
exe a : a.cpp : <include>b <include>a ;
</programlisting>
- then the command line with first mention the "a" include directory, and
- then "b", even though they are specified in the opposite order. In most
- cases, the user doesn't care. But sometimes the order of includes, or
- other properties, is important. For example, if one uses both the C++
- Boost library and the "boost-sandbox" (libraries in development), then
- include path for boost-sandbox must come first, because some headers may
- override ones in C++ Boost. For such cases, a special syntax is
- provided:
-<programlisting>
-exe a : a.cpp : <include>a&&b ;
+ then the command line with first mention the <code>a</code> include
+ directory, and then <code>b</code>, even though they are specified in the
+ opposite order. In most cases, the user does not care. But sometimes the
+ order of includes, or other properties, is important. For such cases, a
+ special syntax is provided:
+<programlisting>
+exe a : a.cpp : <include>a&&b ;
</programlisting>
</para>
- <para>The <code>&&</code> symbols separate values of an
- property, and specify that the order of the values should be preserved. You
- are advised to use this feature only when the order of properties really
- matters, and not as a convenient shortcut. Using it everywhere might
- negatively affect performance.
+ <para>
+ The <code>&&</code> symbols separate property values and specify
+ that their order should be preserved. You are advised to use this feature
+ only when the order of properties really matters and not as a convenient
+ shortcut. Using it everywhere might negatively affect performance.
</para>
-
</section>
<section>
<title>
- How to control the library order on Unix?
+ How to control the library linking order on Unix?
</title>
- <para>On the Unix-like operating systems, the order in which static
- libraries are specified when invoking the linker is important, because by
- default, the linker uses one pass though the libraries list. Passing the
- libraries in the incorrect order will lead to a link error. Further, this
- behaviour is often used to make one library override symbols from
- another. So, sometimes it's necessary to force specific order of
- libraries.
- </para>
-
- <para>Boost.Build tries to automatically compute the right order. The
- primary rule is that if library a "uses" library b, then library a will
- appear on the command line before library b. Library a is considered to
- use b is b is present either in the sources of a or in its
- requirements. To explicitly specify the use relationship one can use the
- <use> feature. For example, both of the following lines will cause
- a to appear before b on the command line:
+ <para>
+ On Unix-like operating systems, the order in which static libraries are
+ specified when invoking the linker is important, because by default, the
+ linker uses one pass though the libraries list. Passing the libraries in
+ the incorrect order will lead to a link error. Further, this behaviour is
+ often used to make one library override symbols from another. So,
+ sometimes it is necessary to force specific library linking order.
+ </para>
+
+ <para>
+ Boost.Build tries to automatically compute the right order. The primary
+ rule is that if library <code>a</code> "uses" library <code>b</code>, then
+ library <code>a</code> will appear on the command line before library
+ <code>b</code>. Library <code>a</code> is considered to use <code>b</code>
+ if <code>b</code> is present either in the <code>a</code> library's
+ sources or its usage is listed in its requirements. To explicitly specify
+ the <literal>use</literal> relationship one can use the
+ <literal><use></literal> feature. For example, both of the following
+ lines will cause <code>a</code> to appear before <code>b</code> on the
+ command line:
<programlisting>
lib a : a.cpp b ;
lib a : a.cpp : <use>b ;
@@ -194,21 +235,22 @@
</para>
<para>
- The same approach works for searched libraries, too:
+ The same approach works for searched libraries as well:
<programlisting>
lib z ;
lib png : : <use>z ;
exe viewer : viewer png z ;
</programlisting>
</para>
-
</section>
<section id="bbv2.faq.external">
- <title>Can I get output of external program as a variable in a Jamfile?
+ <title>
+ Can I get capture external program output using a Boost.Jam variable?
</title>
- <para>The <code>SHELL</code> builtin can be used for the purpose:
+ <para>
+ The <literal>SHELL</literal> builtin rule may be used for this purpose:
<programlisting>
local gtk_includes = [ SHELL "gtk-config --cflags" ] ;
</programlisting>
@@ -216,7 +258,8 @@
</section>
<section>
- <title>How to get the project root (a.k.a. Jamroot.jam) location?
+ <title>
+ How to get the project root (a.k.a. Jamroot) location?
</title>
<para>
@@ -230,18 +273,20 @@
</section>
<section>
- <title>How to change compilation flags for one file?
+ <title>
+ How to change compilation flags for one file?
</title>
- <para>If one file must be compiled with special options, you need to
- explicitly declare an <code>obj</code> target for that file and then use
- that target in your <code>exe</code> or <code>lib</code> target:
+ <para>
+ If one file must be compiled with special options, you need to explicitly
+ declare an <code>obj</code> target for that file and then use that target
+ in your <code>exe</code> or <code>lib</code> target:
<programlisting>
exe a : a.cpp b ;
obj b : b.cpp : <optimization>off ;
</programlisting>
Of course you can use other properties, for example to specify specific
- compiler options:
+ C/C++ compiler options:
<programlisting>
exe a : a.cpp b ;
obj b : b.cpp : <cflags>-g ;
@@ -252,149 +297,162 @@
exe a : a.cpp b ;
obj b : b.cpp : <variant>release:<optimization>off ;
</programlisting>
-
</para>
</section>
<section id="bbv2.faq.dll-path">
- <title>Why are the <code>dll-path</code> and
- <code>hardcode-dll-paths</code> properties useful?
+ <title>
+ Why are the <literal>dll-path</literal> and <literal>hardcode-dll-paths
+ </literal> properties useful?
</title>
+ <note>
+ <para>
+ This entry is specific to Unix systems.
+ </para>
+ </note>
+ <para>
+ Before answering the questions, let us recall a few points about shared
+ libraries. Shared libraries can be used by several applications, or other
+ libraries, without physically including the library in the application
+ which can greatly decrease the total application size. It is also possible
+ to upgrade a shared library when the application is already installed.
+ </para>
+
+ <para>
+ However, in order for application depending on shared libraries to be
+ started the OS may need to find the shared library when the application is
+ started. The dynamic linker will search in a system-defined list of paths,
+ load the library and resolve the symbols. Which means that you should
+ either change the system-defined list, given by the <envar>LD_LIBRARY_PATH
+ </envar> environment variable, or install the libraries to a system
+ location. This can be inconvenient when developing, since the libraries
+ are not yet ready to be installed, and cluttering system paths may be
+ undesirable. Luckily, on Unix there is another way.
+ </para>
- <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 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.
- </para>
-
- <para>However, the shared library must be found when the application is
- started. The dynamic linker will search in a system-defined list of
- paths, load the library and resolve the symbols. Which means that you
- should either change the system-defined list, given by the
- <envar>LD_LIBRARY_PATH</envar> environment variable, or install the
- libraries to a system location. This can be inconvenient when
- developing, since the libraries are not yet ready to be installed, and
- cluttering system paths is undesirable. Luckily, on Unix there's another
- way.
- </para>
-
- <para>An executable can include a list of additional library paths, which
- will be searched before system paths. This is excellent for development,
- because the build system knows the paths to all libraries and can include
- them in executables. That's done when the <code>hardcode-dll-paths</code>
- feature has the <literal>true</literal> value, which is the
- default. When the executables should be installed, the story is
- different.
+ <para>
+ An executable can include a list of additional library paths, which will
+ be searched before system paths. This is excellent for development because
+ the build system knows the paths to all libraries and can include them in
+ the executables. That is done when the <literal>hardcode-dll-paths
+ </literal> feature has the <literal>true</literal> value, which is the
+ default. When the executables should be installed, the story is different.
</para>
<para>
- Obviously, installed executable should not hardcode paths to your
- development tree. (The <code>stage</code> rule explicitly disables the
- <code>hardcode-dll-paths</code> feature for that reason.) However, you
- can use the <code>dll-path</code> feature to add explicit paths
+ Obviously, installed executable should not contain hardcoded paths to your
+ development tree. <!-- Make the following parenthised sentence a footer
+ note --> (The <literal>install</literal> rule explicitly disables the
+ <literal>hardcode-dll-paths</literal> feature for that reason.) However,
+ you can use the <literal>dll-path</literal> feature to add explicit paths
manually. For example:
<programlisting>
-stage installed : application : <dll-path>/usr/lib/snake
- <location>/usr/bin ;
+install installed : application : <dll-path>/usr/lib/snake
+ <location>/usr/bin ;
</programlisting>
- will allow the application to find libraries placed to
- <filename>/usr/lib/snake</filename>.
+ will allow the application to find libraries placed in the <filename>
+ /usr/lib/snake</filename> directory.
</para>
- <para>If you install libraries to a nonstandard location and add an
- explicit path, you get more control over libraries which will be used. A
- library of the same name in a system location will not be inadvertently
- used. If you install libraries to a system location and do not add any
- paths, the system administrator will have more control. Each library can
- be individually upgraded, and all applications will use the new library.
- </para>
-
- <para>Which approach is best depends on your situation. If the libraries
- are relatively standalone and can be used by third party applications,
- they should be installed in the system location. If you have lots of
- libraries which can be used only by your application, it makes sense to
- install it to a nonstandard directory and add an explicit path, like the
- example above shows. Please also note that guidelines for different
- systems differ in this respect. The Debian guidelines prohibit any
- additional search paths, and Solaris guidelines suggest that they should
+ <para>
+ If you install libraries to a nonstandard location and add an explicit
+ path, you get more control over libraries which will be used. A library of
+ the same name in a system location will not be inadvertently used. If you
+ install libraries to a system location and do not add any paths, the
+ system administrator will have more control. Each library can be
+ individually upgraded, and all applications will use the new library.
+ </para>
+
+ <para>
+ Which approach is best depends on your situation. If the libraries are
+ relatively standalone and can be used by third party applications, they
+ should be installed in the system location. If you have lots of libraries
+ which can be used only by your application, it makes sense to install them
+ to a nonstandard directory and add an explicit path, like the example
+ above shows. Please also note that guidelines for different systems differ
+ in this respect. For example, the Debian GNU guidelines prohibit any
+ additional search paths while Solaris guidelines suggest that they should
always be used.
</para>
-
</section>
<section id="bbv2.recipies.site-config">
<title>Targets in site-config.jam</title>
- <para>It is desirable to declare standard libraries available on a
- given system. Putting target declaration in Jamfile is not really
- good, since locations of the libraries can vary. The solution is
- to declare the targets in site-config.jam:</para>
+ <para>
+ It is desirable to declare standard libraries available on a given system.
+ Putting target declaration in a specific project's Jamfile is not really
+ good, since locations of the libraries can vary between different
+ development machines and then such declarations would need to be
+ duplicated in different projects. The solution is to declare the targets
+ in Boost.Build's <filename>site-config.jam</filename> configuration file:
<programlisting>
project site-config ;
lib zlib : : <name>z ;
</programlisting>
+ </para>
- <para>Recall that both <filename>site-config.jam</filename> and
- <filename>user-config.jam</filename> are projects, and everything
- you can do in a Jamfile you can do in those files. So, you declare
- a project id and a target. Now, one can write:
+ <para>
+ Recall that both <filename>site-config.jam</filename> and
+ <filename>user-config.jam</filename> are projects, and everything you can
+ do in a Jamfile you can do in those files as well. So, you declare a
+ project id and a target. Now, one can write:
<programlisting>
exe hello : hello.cpp /site-config//zlib ;
</programlisting>
- in any Jamfile.</para>
-
+ in any Jamfile.
+ </para>
</section>
<section id="bbv2.faq.header-only-libraries">
<title>Header-only libraries</title>
- <para>In modern C++, libraries often consist of just header files, without
- any source files to compile. To use such libraries, you need to add proper
- includes and, maybe, defines, to your project. But with large number of
- external libraries it becomes problematic to remember which libraries are
- header only, and which are "real" ones. However, with Boost.Build a
- header-only library can be declared as Boost.Build target and all
- dependents can use such library without remebering if it's header-only or not.
+ <para>
+ In modern C++, libraries often consist of just header files, without any
+ source files to compile. To use such libraries, you need to add proper
+ includes and possibly defines to your project. But with a large number of
+ external libraries it becomes problematic to remember which libraries are
+ header only, and which ones you have to link to. However, with Boost.Build
+ a header-only library can be declared as Boost.Build target and all
+ dependents can use such library without having to remeber whether it is a
+ header-only library or not.
</para>
- <para>Header-only libraries are declared using the <code>alias</code> rule,
- that specifies only usage requirements, for example:
+ <para>
+ Header-only libraries may be declared using the <code>alias</code> rule,
+ specifying their include path as a part of its usage requirements, for
+ example:
<programlisting>
-alias mylib
+alias my-lib
: # no sources
: # no build requirements
: # no default build
- : <include>whatever
- ;
+ : <include>whatever ;
</programlisting>
- The includes specified in usage requirements of <code>mylib</code> are
- automatically added to build properties of all dependents. The dependents
- need not care if <code>mylib</code> is header-only or not, and it's possible
- to later make <code>mylib</code> into a regular compiled library.
+ The includes specified in usage requirements of <code>my-lib</code> are
+ automatically added to all of its dependants' build properties. The
+ dependants need not care if <code>my-lib</code> is a header-only or not,
+ and it is possible to later make <code>my-lib</code> into a regular
+ compiled library without having to that its dependants' declarations.
</para>
<para>
- If you already have proper usage requirements declared for project where
- header-only library is defined, you don't need to duplicate them for
+ If you already have proper usage requirements declared for a project where
+ a header-only library is defined, you do not need to duplicate them for
the <code>alias</code> target:
<programlisting>
project my : usage-requirements <include>whatever ;
alias mylib ;
-</programlisting>
+</programlisting>
</para>
-
</section>
+</chapter>
-
- </chapter>
<!--
Local Variables:
mode: nxml
- sgml-indent-data: t
+ sgml-indent-data: t
sgml-parent-document: ("userman.xml" "chapter")
sgml-set-face: t
End:
--->
\ No newline at end of file
+-->
Modified: branches/release/tools/build/v2/doc/src/reference.xml
==============================================================================
--- branches/release/tools/build/v2/doc/src/reference.xml (original)
+++ branches/release/tools/build/v2/doc/src/reference.xml 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -420,41 +420,55 @@
<listitem>
<para>
- A feature that combines several low-level features, making
- it easy to request common build configurations.
+ A feature combining several low-level features, making it easy to
+ request common build configurations.
</para>
- <para><emphasis role="bold">Allowed values:</emphasis> <literal>debug</literal>, <literal>release</literal>,
- <literal>profile</literal>.</para>
+ <para>
+ <emphasis role="bold">Allowed values:</emphasis>
+ <literal>debug</literal>, <literal>release</literal>,
+ <literal>profile</literal>.
+ </para>
- <para>The value <literal>debug</literal> expands to</para>
+ <para>
+ The value <literal>debug</literal> expands to
+ </para>
<programlisting>
<optimization>off <debug-symbols>on <inlining>off <runtime-debugging>on
</programlisting>
- <para>The value <literal>release</literal> expands to</para>
+ <para>
+ The value <literal>release</literal> expands to
+ </para>
<programlisting>
<optimization>speed <debug-symbols>off <inlining>full <runtime-debugging>off
</programlisting>
- <para>The value <literal>profile</literal> expands to the same as
- <literal>release</literal>, plus:</para>
+ <para>
+ The value <literal>profile</literal> expands to the same as
+ <literal>release</literal>, plus:
+ </para>
<programlisting>
<profiling>on <debug-symbols>on
</programlisting>
- <para>User can define his own build variants using the <code>variant</code> rule from the <code>common</code>
- module.</para>
+ <para>
+ Users can define their own build variants using the
+ <code>variant</code> rule from the <code>common</code> module.
+ </para>
- <para><emphasis role="bold">Notee:</emphasis> Runtime
- debugging is on in debug builds to suit the expectations of
- people used to various IDEs.
- <!-- Define "runtime debugging." Why will those people expect it to be on in debug builds? -->
+ <para>
+ <emphasis role="bold">Note:</emphasis> Runtime debugging is on in
+ debug builds to suit the expectations of people used to various
+ IDEs.
+ <!-- Define "runtime debugging". Why will those people expect it to
+ be on in debug builds? -->
</para>
- </listitem></varlistentry>
+ </listitem>
+ </varlistentry>
<varlistentry id="bbv2.advanced.builtins.features.link">
<term><literal>link</literal></term>
@@ -465,10 +479,11 @@
<literal>static</literal></para>
<simpara>
- A feature that controls how libraries are built.
+ A feature controling how libraries are built.
</simpara>
- </listitem></varlistentry>
+ </listitem>
+ </varlistentry>
<varlistentry id="bbv2.advanced.builtins.features.runtime-link">
<indexterm><primary>runtime linking</primary></indexterm>
@@ -720,7 +735,10 @@
<varlistentry><term><literal>instruction-set</literal></term>
<indexterm><primary>instruction-set</primary></indexterm>
<listitem>
- <para>Allowed values for this feature depend on used toolset.</para>
+ <para>
+ <emphasis role="bold">Allowed values:</emphasis> depend on the used
+ toolset.
+ </para>
<para>The <literal>instruction-set</literal> specifies for which
specific instruction set the code should be generated. The
@@ -751,6 +769,31 @@
</listitem>
</varlistentry>
+ <varlistentry><term><literal>c++-template-depth</literal></term>
+ <listitem>
+ <para>
+ <emphasis role="bold">Allowed values:</emphasis> Any positive
+ integer.
+ </para>
+
+ <para>
+ This feature allows configuring a C++ compiler with the maximal
+ template instantiation depth parameter. Specific toolsets may or may
+ not provide support for this feature depending on whether their
+ compilers provide a corresponding command-line option.
+ </para>
+
+ <para>
+ <emphasis role="bold">Note:</emphasis> Due to some internal details
+ in the current Boost Build implementation it is not possible to have
+ features whose valid values are all positive integer. As a
+ workaround a large set of allowed values has been defined for this
+ feature and, if a different one is needed, user can easily add it by
+ calling the feature.extend rule.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</section>
@@ -970,9 +1013,9 @@
</varlistentry>
<varlistentry>
- <term><literal>setup-amd64></literal></term>
- <term><literal>setup-i386></literal></term>
- <term><literal>setup-ia64></literal></term>
+ <term><literal>setup-amd64</literal></term>
+ <term><literal>setup-i386</literal></term>
+ <term><literal>setup-ia64</literal></term>
<listitem><para>The filename of the target platform specific
environment setup script to run before invoking any of the tools
Modified: branches/release/tools/build/v2/doc/src/tasks.xml
==============================================================================
--- branches/release/tools/build/v2/doc/src/tasks.xml (original)
+++ branches/release/tools/build/v2/doc/src/tasks.xml 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -9,328 +9,339 @@
<chapter id="bbv2.tasks">
<title>Common tasks</title>
- <para>This section describes main targets types that Boost.Build supports
- out-of-the-box. Unless otherwise noted, all mentioned main target rules have
- the common signature, described in <xref linkend="bbv2.advanced.targets"/>.
+ <para>
+ This section describes main targets types that Boost.Build supports
+ out-of-the-box. Unless otherwise noted, all mentioned main target rules have
+ the common signature, described in <xref linkend="bbv2.advanced.targets"/>.
</para>
<section id="bbv2.tasks.programs">
<title>Programs</title>
- <indexterm><primary>exe</primary></indexterm>
- <para>Programs are created using the <code>exe</code> rule, which follows
- the <link linkend="bbv2.main-target-rule-syntax">common syntax</link>.
- For example:
+ <indexterm><primary>exe</primary></indexterm>
+ <para>
+ Programs are created using the <code>exe</code> rule, which follows the
+ <link linkend="bbv2.main-target-rule-syntax">common syntax</link>. For
+ example:
<programlisting>
exe hello : hello.cpp some_library.lib /some_project//library
: <threading>multi
;
</programlisting>
- This will create an executable file from the sources -- in this case,
- one C++ file, one library file present in the same directory, and
- another library that is created by Boost.Build. Generally, sources
- can include C and C++ files, object files and libraries. Boost.Build
- will automatically try to convert targets of other types.
- </para>
+ This will create an executable file from the sources -- in this case, one
+ C++ file, one library file present in the same directory, and another
+ library that is created by Boost.Build. Generally, sources can include C
+ and C++ files, object files and libraries. Boost.Build will automatically
+ try to convert targets of other types.
+ </para>
- <tip>
- <para>
- On Windows, if an application uses dynamic libraries, and both
- the application and the libraries are built by Boost.Build, its not
- possible to immediately run the application, because the
- <literal>PATH</literal> 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. See <xref linkend="bbv2.tasks.installing"/>.
- </para>
- <!-- We should be emphasizing the use of the built-in testing rules
- rather than continually discussing these quirks of running programs
- with dynamic libraries. -->
- </tip>
- </section>
-
- <section id="bbv2.tasks.libraries">
- <title>Libraries</title>
-
- <para>Libraries are created using the <code>lib</code> rule, which
- follows the <link linkend="bbv2.main-target-rule-syntax">common
- syntax</link>. For example:
+ <tip>
+ <para>
+ On Windows, if an application uses shared libraries, and both the
+ application and the libraries are built using Boost.Build, it is not
+ possible to immediately run the application, because the <literal>PATH
+ </literal> environment variable should include the path to the
+ libraries. It means you have to either add the paths manually, or have
+ the build place the application and the libraries into the same
+ directory. See <xref linkend="bbv2.tasks.installing"/>.
+ </para>
+ <!-- We should be emphasizing the use of the built-in testing rules
+ rather than continually discussing these quirks of running programs
+ with shared libraries. -->
+ </tip>
+ </section>
+
+ <section id="bbv2.tasks.libraries">
+ <title>Libraries</title>
+
+ <para>
+ Library targets are created using the <code>lib</code> rule, which
+ follows the <link linkend="bbv2.main-target-rule-syntax">common syntax
+ </link>. For example:
<programlisting>
-lib helpers : helpers.cpp : <include>boost : : <include>. ;
+lib helpers : helpers.cpp ;
</programlisting>
- </para>
- <!-- Add one sentence that says what the above does. -->
- <para>
- In the most common case, the <code>lib</code> creates a library from the
- specified sources. Depending on the value of <link> feature the
- library will be either static or shared. There are two other cases.
- First is when the library is installed somewhere in compiler's search
- paths, and should be searched by the compiler (typically, using the
- <option>-l</option> option). The second case is where the library is
- available as a prebuilt file and the full path is known.
- <!-- But the first case is also prebuilt. This is confusingly phrased. -->
- </para>
+ This will define a library target named <code>helpers</code> built from
+ the <code>helpers.cpp</code> source file.
+ </para>
+ <para>
+ Depending on the given <link> feature value the library will be
+ either static or shared.
+ </para>
+ <para>
+ Library targets may be used to represent:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <code>Built libraries</code> that get built from specified sources,
+ as is the one in the example above. <!-- add link -->
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>Prebuilt libraries</code> which already exist on the system
+ and are just supposed to be used by the build system. Such
+ libraries may be searched for by the tools using them (typically
+ linkers referencing the library using the <option>-l</option>
+ option) or their path may be known in advance by the build system.
+ <!-- We need examples for this. -->
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
- <para>
- The syntax for these case is given below:
+ <para>
+ The syntax for these case is given below:
<programlisting>
lib z : : <name>z <search>/home/ghost ;
lib compress : : <file>/opt/libs/compress.a ;
</programlisting>
- The <code>name</code> property specifies the name that should be
- passed to the <option>-l</option> option, and the <code>file</code>
- property specifies the file location. The <varname>search</varname> feature
- specifies paths in which to search for the library. That feature can
- be specified several times, or it can be omitted, in which case only
- default compiler paths will be searched.
- </para>
+ The <code>name</code> property specifies the name that should be passed to
+ the <option>-l</option> option, and the <code>file</code> property
+ specifies the file location. The <varname>search</varname> feature
+ specifies paths in which to search for the library. That feature can be
+ specified several times or it can be omitted, in which case only the
+ default compiler paths will be searched.
+ </para>
- <para>The difference between using the <varname>file</varname> feature as
- opposed to the <varname>name</varname> feature together with the
- <varname>search</varname> feature is that <varname>file</varname> is more
- precise. A specific file will be used. On the other hand, the
- <varname>search</varname> feature only adds a library path, and the
- <varname>name</varname> feature gives the basic name of the library. The
- search rules are specific to the linker. For example, given these
- definition:
+ <para>
+ The difference between using the <varname>file</varname> feature as
+ opposed to the <varname>name</varname> feature together with the <varname>
+ search</varname> feature is that <varname>file</varname> is more precise.
+ A specific file will be used as opposed to the <varname>search</varname>
+ feature only adding a library path, or the <varname>name</varname> feature
+ giving only the basic name of the library. The search rules are specific
+ to the linker used. For example, given these definition:
<programlisting>
lib a : : <variant>release <file>/pool/release/a.so ;
lib a : : <variant>debug <file>/pool/debug/a.so ;
lib b : : <variant>release <file>/pool/release/b.so ;
lib b : : <variant>debug <file>/pool/debug/b.so ;
</programlisting>
- It's possible to use release version of <code>a</code> and debug
- version of <code>b</code>. Had we used the <varname>name</varname> and
- <varname>search</varname> features, the linker would always pick either
- release or debug versions.
- <!-- explain -->
- </para>
+ It is possible to use a release version of <code>a</code> and debug
+ version of <code>b</code>. Had we used the <varname>name</varname> and
+ <varname>search</varname> features, the linker would have always picked
+ either the release or the debug versions.
+ <!-- explain -->
+ </para>
- <para>
- For convenience, the following syntax is allowed:
+ <para>
+ For convenience, the following syntax is allowed:
<programlisting>
lib z ;
lib gui db aux ;
</programlisting>
- and is does exactly the same as:
+ which has exactly the same effect as:
<programlisting>
lib z : : <name>z ;
lib gui : : <name>gui ;
lib db : : <name>db ;
lib aux : : <name>aux ;
</programlisting>
- </para>
+ </para>
- <para>
- When a library uses another library you should put that other library in
- the list of sources. This will do the right thing in all cases. For
- portability, you should specify library dependencies even for searched
- and prebuilt libraries, othewise, static linking on Unix will not work.
- For example:
+ <para>
+ When a library references another library you should put that other
+ library in its list of sources. This will do the right thing in all cases.
+ <!--Add a link to the notes below. --> For portability, you should specify
+ library dependencies even for searched and prebuilt libraries, othewise,
+ static linking on Unix will not work. For example:
<programlisting>
lib z ;
lib png : z : <name>png ;
</programlisting>
- </para>
-
- <note>
- <para>
- When a library (say, <code>a</code>), that has another library, (say,
- <code>b</code>)
- <!-- how can a library "have" a library? -->
- is linked dynamically, the <code>b</code>
- library will be incorporated
- <!-- Incorporated? Be precise. -->
- in <code>a</code>. (If <code>b</code>
- is dynamic library as well, then <code>a</code> will only refer to it,
- and not include any extra code.)
- <!-- Don't parenthesize a whole sentence. -->
- When the <code>a</code>
- library is linked statically, Boost.Build will assure that all
- executables that link to <code>a</code> will also link to
- <code>b</code>.
- </para>
- </note>
+ </para>
+ <note>
<para>
- One feature of Boost.Build that is very important for libraries is usage
- requirements.
- <!-- Rephrase that. But then, it's much too late for an
- introduction of usage requirements - you've already
- discussed them many times. -->
- For example, if you write:
-<programlisting>
-lib helpers : helpers.cpp : : : <include>. ;
-</programlisting>
- then the compiler include path for all targets that use
- <code>helpers</code> will contain the directory
- <!-- The rest of this sentence is unintelligible -->
- where the target is defined.path to "helpers.cpp". The user
- only needs to add <code>helpers</code> to the list of sources,
- and needn't consider the requirements its use imposes on a
- dependent target. This feature greatly simplifies Jamfiles.
- <!-- You can't say âallows toââyou need a noun. This error is
- repeated throughout. -->
+ When a library has a shared library defined as its source, or a static
+ library has another static library defined as its source then any target
+ linking to the first library with automatically link to its source
+ library as well.
</para>
-
- <note>
- <para>If you don't want shared libraries to include all libraries
- that are specified in sources (especially statically linked ones),
- you'd need to use the following:
+ <para>
+ On the other hand, when a shared library has a static library defined as
+ its source then the first library will be built so that it completely
+ includes the second one.
+ </para>
+ <para>
+ If you do not want shared libraries to include all libraries specified
+ in its sources (especially statically linked ones), you would need to
+ use the following:
<programlisting>
lib b : a.cpp ;
lib a : a.cpp : <use>b : : <library>b ;
</programlisting>
- This specifies that <code>a</code> uses <code>b</code>, and causes
- all executables that link to <code>a</code> also link to
- <code>b</code>. In this case, even for shared linking, the
- <code>a</code> library won't even refer to <code>b</code>.
- </para>
- </note>
-
- </section>
+ This specifies that library <code>a</code> uses library <code>b</code>,
+ and causes all executables that link to <code>a</code> also link to
+ <code>b</code>. In this case, even for shared linking, the
+ <code>a</code> library will not even refer to <code>b</code>.
+ </para>
+ </note>
- <section id="bbv2.tasks.alias">
- <title>Alias</title>
+ <para>
+ One Boost.Build feature that is often very useful for defining library
+ targets are usage requirements. <!-- Rephrase that. But then, it is much
+ too late for an introduction of usage requirements - you have already
+ discussed them many times. Also, add references to the sections describing
+ requirements and usage-requirements here. --> For example, imagine that
+ you want you build a <code>helpers</code> library and its interface is
+ described in its <code>helpers.hpp</code> header file located in the same
+ directory as the <code>helpers.cpp</code> source file. Then you could add
+ the following to the Jamfile located in that same directory:
+<programlisting>
+lib helpers : helpers.cpp : : : <include>. ;
+</programlisting>
+ which would automatically add the directory where the target has been
+ defined (and where the library's header file is located) to the compiler's
+ include path for all targets using the <code>helpers</code> library. This
+ feature greatly simplifies Jamfiles.
+ </para>
+ </section>
- <para>
- The <functionname>alias</functionname> rule gives an alternative name to
- a group of targets. For example, to give the name
- <filename>core</filename> to a group of three other targets with the
- following code:
- <programlisting>
-alias core : im reader writer ;</programlisting>
- Using <filename>core</filename> on the command line, or in the source
- list of any other target is the same as explicitly using
- <filename>im</filename>, <filename>reader</filename>, and
- <filename>writer</filename>, but it is just more convenient.
- </para>
+ <section id="bbv2.tasks.alias">
+ <title>Alias</title>
+ <para>
+ The <functionname>alias</functionname> rule gives an alternative name to a
+ group of targets. For example, to give the name <filename>core</filename>
+ to a group of three other targets with the following code:
+<programlisting>
+alias core : im reader writer ;
+</programlisting>
+ Using <filename>core</filename> on the command line, or in the source list
+ of any other target is the same as explicitly using <filename>im
+ </filename>, <filename>reader</filename>, and <filename>writer</filename>.
+ </para>
- <para>
- Another use of the <code>alias</code> rule is to change build
- properties. For example, if you always want static linking for a
- specific C++ Boost library, you can write the following:
+ <para>
+ Another use of the <code>alias</code> rule is to change build properties.
+ For example, if you want to use link statically to the Boost Threads
+ library, you can write the following:
<programlisting>
alias threads : /boost/thread//boost_thread : <link>static ;
</programlisting>
- and use only the <code>threads</code> alias in your Jamfiles.
- </para>
+ and use only the <code>threads</code> alias in your Jamfiles.
+ </para>
- <para>
- You can also specify usage requirements for the
- <code>alias</code> target. If you write the following:
+ <para>
+ You can also specify usage requirements for the <code>alias</code> target.
+ If you write the following:
<programlisting>
alias header_only_library : : : : <include>/usr/include/header_only_library ;
</programlisting>
- then using <code>header_only_library</code> in sources will only add an
- include path. Also note that when an alias has sources, their usage
- requirements are propagated as well. For example:
+ then using <code>header_only_library</code> in sources will only add an
+ include path. Also note that when an alias has sources, their usage
+ requirements are propagated as well. For example:
<programlisting>
lib library1 : library1.cpp : : : <include>/library/include1 ;
lib library2 : library2.cpp : : : <include>/library/include2 ;
alias static_libraries : library1 library2 : <link>static ;
exe main : main.cpp static_libraries ;
</programlisting>
- will compile <filename>main.cpp</filename> with additional includes
- required for using the specified static libraries.
- </para>
-
- </section>
+ will compile <filename>main.cpp</filename> with additional includes
+ required for using the specified static libraries.
+ </para>
+ </section>
- <section id="bbv2.tasks.installing">
- <title>Installing</title>
+ <section id="bbv2.tasks.installing">
+ <title>Installing</title>
- <para>This section describes various ways to install built target
- and arbitrary files.</para>
+ <para>
+ This section describes various ways to install built target and arbitrary
+ files.
+ </para>
- <bridgehead>Basic install</bridgehead>
+ <bridgehead>Basic install</bridgehead>
- <para>For installing a built target you should use the
- <code>install</code> rule, which follows the <link
- linkend="bbv2.main-target-rule-syntax">common syntax</link>. For
- example:
+ <para>
+ For installing a built target you should use the <code>install</code>
+ rule, which follows the <link linkend="bbv2.main-target-rule-syntax">
+ common syntax</link>. For example:
<programlisting>
install dist : hello helpers ;
</programlisting>
- will cause the targets <code>hello</code> and <code>helpers</code> to
- be moved to the <filename>dist</filename> directory, relative to
- Jamfile's directory. The directory can
- be changed with the <code>location</code> property:
+ will cause the targets <code>hello</code> and <code>helpers</code> to be
+ moved to the <filename>dist</filename> directory, relative to the
+ Jamfile's directory. The directory can be changed using the
+ <code>location</code> property:
<programlisting>
install dist : hello helpers : <location>/usr/bin ;
</programlisting>
- While you can achieve the same effect by changing the target name to
- <filename>/usr/bin</filename>, using the <code>location</code>
- property is better, because it allows you to use a mnemonic target
- name.
- </para>
+ While you can achieve the same effect by changing the target name to
+ <filename>/usr/bin</filename>, using the <code>location</code> property is
+ better as it allows you to use a mnemonic target name.
+ </para>
- <para>The <code>location</code> property is especially handy when the location
- is not fixed, but depends on build variant or environment variables:
+ <para>
+ The <code>location</code> property is especially handy when the location
+ is not fixed, but depends on the build variant or environment variables:
<programlisting>
-install dist : hello helpers : <variant>release:<location>dist/release
- <variant>debug:<location>dist/debug ;
+install dist : hello helpers :
+ <variant>release:<location>dist/release
+ <variant>debug:<location>dist/debug ;
install dist2 : hello helpers : <location>$(DIST) ;
</programlisting>
- See also <link linkend="bbv2.reference.variants.propcond">conditional
- properties</link> and <link linkend="bbv2.faq.envar">environment variables</link>
- </para>
+ See also <link linkend="bbv2.reference.variants.propcond">conditional
+ properties</link> and <link linkend="bbv2.faq.envar">environment
+ variables</link>
+ </para>
- <bridgehead>Installing with all dependencies</bridgehead>
+ <bridgehead>Installing with all dependencies</bridgehead>
- <para>
- Specifying the names of all libraries to install can be boring. The
- <code>install</code> allows you to specify only the top-level executable
- targets to install, and automatically install all dependencies:
+ <para>
+ Specifying the names of all libraries to install can be boring. The
+ <code>install</code> allows you to specify only the top-level executable
+ targets to install, and automatically install all dependencies:
<programlisting>
install dist : hello
: <install-dependencies>on <install-type>EXE
<install-type>LIB
;
</programlisting>
- will find all targets that <code>hello</code> depends on, and install
- all of those which are either executables or libraries. More
- specifically, for each target, other targets that were specified as
- sources or as dependency properties, will be recursively found. One
- exception is that targets referred with the <link
- linkend="bbv2.builtin.features.use"><code>use</code></link> feature
- are not considered, because that feature is typically used to refer to
- header-only libraries.
- If the set of target types is specified, only targets of that type
- will be installed, otherwise, all found target will be installed.
- </para>
+ will find all targets that <code>hello</code> depends on, and install all
+ of those which are either executables or libraries. More specifically, for
+ each target, other targets that were specified as sources or as dependency
+ properties, will be recursively found. One exception is that targets
+ referred with the <link linkend="bbv2.builtin.features.use">
+ <code>use</code></link> feature are not considered, as that feature is
+ typically used to refer to header-only libraries. If the set of target
+ types is specified, only targets of that type will be installed,
+ otherwise, all found target will be installed.
+ </para>
- <bridgehead>Preserving Directory Hierarchy</bridgehead>
+ <bridgehead>Preserving Directory Hierarchy</bridgehead>
- <indexterm><primary>install-source-root</primary></indexterm>
- <para>By default, the <code>install</code> rules will stip paths from
- it's sources. So, if sources include <filename>a/b/c.hpp</filename>,
- the <filename>a/b</filename> part will be ignored. To make the
- <code>install</code> rule preserve the directory hierarchy you need
- to use the <code>install-source-root</code> feature to specify the
- root of the hierarchy you are installing. Relative paths from that
- root will be preserved. For example, if you write:
+ <indexterm><primary>install-source-root</primary></indexterm>
+ <para>
+ By default, the <code>install</code> rule will strip paths from its
+ sources. So, if sources include <filename>a/b/c.hpp</filename>, the
+ <filename>a/b</filename> part will be ignored. To make the
+ <code>install</code> rule preserve the directory hierarchy you need to
+ use the <literal><install-source-root></literal> feature to specify
+ the root of the hierarchy you are installing. Relative paths from that
+ root will be preserved. For example, if you write:
<programlisting>
install headers
: a/b/c.h
: <location>/tmp <install-source-root>a
;
</programlisting>
-
the a file named <filename>/tmp/b/c.h</filename> will be created.
- </para>
+ </para>
+
+ <para>
+ The <link linkend="bbv2.reference.glob-tree">glob-tree</link> rule can be
+ used to find all files below a given directory, making it easy to install
+ an entire directory tree.
+ </para>
- <para>The <link linkend="bbv2.reference.glob-tree">glob-tree</link> rule
- can be used to find all files below a given directory, making
- it easy to install entire directory tree.</para>
-
- <bridgehead>Installing into Several Directories</bridgehead>
-
- <para>The <link linkend="bbv2.tasks.alias"><code>alias</code></link>
- rule can be used when targets must be installed into several
- directories:
+ <bridgehead>Installing into Several Directories</bridgehead>
+
+ <para>
+ The <link linkend="bbv2.tasks.alias"><code>alias</code></link> rule can be
+ used when targets need to be installed into several directories:
<programlisting>
alias install : install-bin install-lib ;
install install-bin : applications : /usr/bin ;
@@ -340,178 +351,180 @@
<para>
Because the <code>install</code> rule just copies targets, most free
- features <footnote><para>see the definition of "free" in
- <xref linkend="bbv2.reference.features.attributes"/>.</para></footnote>
- have no effect when used in requirements of the <code>install</code> rule.
- The only two which matter are <link
- linkend="bbv2.builtin.features.dependency"><varname>dependency</varname>
- </link> and, on Unix, <link linkend="bbv2.reference.features.dll-path">
- <varname>dll-path</varname></link>.
+ features <footnote><para>see the definition of "free" in <xref
+ linkend="bbv2.reference.features.attributes"/>.</para></footnote> have no
+ effect when used in requirements of the <code>install</code> rule. The
+ only two that matter are <link linkend="bbv2.builtin.features.dependency">
+ <varname>dependency</varname></link> and, on Unix, <link
+ linkend="bbv2.reference.features.dll-path"><varname>dll-path</varname>
+ </link>.
</para>
<note>
<para>
- (Unix specific). On Unix, executables built with Boost.Build typically
- contain the list of paths to all used dynamic libraries. For installing,
+ (Unix specific) On Unix, executables built using Boost.Build typically
+ contain the list of paths to all used shared libraries. For installing,
this is not desired, so Boost.Build relinks the executable with an empty
list of paths. You can also specify additional paths for installed
- executables with the <varname>dll-path</varname> feature.
+ executables using the <varname>dll-path</varname> feature.
</para>
</note>
+ </section>
- </section>
-
- <section id="bbv2.builtins.testing">
+ <section id="bbv2.builtins.testing">
+ <title>Testing</title>
- <title>Testing</title>
-
- <para>
- Boost.Build has convenient support for running unit tests. The simplest
- way is the <code>unit-test</code> rule, which follows the <link
- linkend="bbv2.main-target-rule-syntax">common syntax</link>. For
- example:
+ <para>
+ Boost.Build has convenient support for running unit tests. The simplest
+ way is the <code>unit-test</code> rule, which follows the <link
+ linkend="bbv2.main-target-rule-syntax">common syntax</link>. For example:
<programlisting>
unit-test helpers_test : helpers_test.cpp helpers ;
</programlisting>
- </para>
+ </para>
- <para>The <functionname>unit-test</functionname> rule behaves like the
- <functionname>exe</functionname> rule, but after the executable is created it is
- run. If the executable returns an error code, the build system will also
- return an error and will try running the executable on the next
- invocation until it runs successfully. This behaviour ensures that you
- can't miss a unit test failure.
- </para>
+ <para>
+ The <functionname>unit-test</functionname> rule behaves like the
+ <functionname>exe</functionname> rule, but after the executable is created
+ it is also run. If the executable returns an error code, the build system
+ will also return an error and will try running the executable on the next
+ invocation until it runs successfully. This behaviour ensures that you can
+ not miss a unit test failure.
+ </para>
- <para>By default, the executable is run directly. Sometimes, it's
- desirable to run the executable using some helper command. You should use the
- <literal>testing.launcher</literal> property to specify the name of the
- helper command. For example, if you write:
- </para>
+ <para>
+ By default, the executable is run directly. Sometimes, it is desirable to
+ run the executable using some helper command. You should use the <literal>
+ testing.launcher</literal> property to specify the name of the helper
+ command. For example, if you write:
<programlisting>
unit-test helpers_test
: helpers_test.cpp helpers
: <emphasis role="bold"><testing.launcher>valgrind</emphasis>
;
</programlisting>
- <para>The command used to run the executable will be:</para>
+ The command used to run the executable will be:
<screen>
<emphasis role="bold">valgrind</emphasis> bin/$toolset/debug/helpers_test
</screen>
+ </para>
- <para>There are few specialized testing rules, listed below:
- <programlisting>
+ <para>
+ There are few specialized testing rules, listed below:
+<programlisting>
rule compile ( sources : requirements * : target-name ? )
rule compile-fail ( sources : requirements * : target-name ? )
rule link ( sources + : requirements * : target-name ? )
rule link-fail ( sources + : requirements * : target-name ? )
- </programlisting>
- They are are given a list of sources and requirements.
- If the target name is not provided, the name of the first
- source file is used instead. The <literal>compile*</literal>
- tests try to compile the passed source. The <literal>link*</literal>
- rules try to compile and link an application from all the passed sources.
- The <literal>compile</literal> and <literal>link</literal> rules expect
- that compilation/linking succeeds. The <literal>compile-fail</literal>
- and <literal>link-fail</literal> rules, on the opposite, expect that
+</programlisting>
+ They are given a list of sources and requirements. If the target name is
+ not provided, the name of the first source file is used instead. The
+ <literal>compile*</literal> tests try to compile the passed source. The
+ <literal>link*</literal> rules try to compile and link an application from
+ all the passed sources. The <literal>compile</literal> and <literal>link
+ </literal> rules expect that compilation/linking succeeds. The <literal>
+ compile-fail</literal> and <literal>link-fail</literal> rules expect that
the compilation/linking fails.
- </para>
+ </para>
- <para>There are two specialized rules for running applications, which
- are more powerful than the <code>unit-test</code> rule. The
- <code>run</code> rule has the following signature:
- <programlisting>
+ <para>
+ There are two specialized rules for running applications, which are more
+ powerful than the <code>unit-test</code> rule. The <code>run</code> rule
+ has the following signature:
+<programlisting>
rule run ( sources + : args * : input-files * : requirements * : target-name ?
: default-build * )
- </programlisting>
- The rule builds application from the provided sources and runs it,
- passing <varname>args</varname> and <varname>input-files</varname>
- as command-line arguments. The <varname>args</varname> parameter
- is passed verbatim and the values of the <varname>input-files</varname>
- parameter are treated as paths relative to containing Jamfile, and are
- adjusted if <command>bjam</command> is invoked from a different
- directory. The <code>run-fail</code> rule is identical to the
- <code>run</code> rule, except that it expects that the run fails.
- </para>
+</programlisting>
+ The rule builds application from the provided sources and runs it, passing
+ <varname>args</varname> and <varname>input-files</varname> as command-line
+ arguments. The <varname>args</varname> parameter is passed verbatim and
+ the values of the <varname>input-files</varname> parameter are treated as
+ paths relative to containing Jamfile, and are adjusted if <command>bjam
+ </command> is invoked from a different directory. The
+ <code>run-fail</code> rule is identical to the <code>run</code> rule,
+ except that it expects that the run fails.
+ </para>
- <para>All rules described in this section, if executed successfully,
- create a special manifest file to indicate that the test passed.
- For the <code>unit-test</code> rule the files is named
- <filename><replaceable>target-name</replaceable>.passed</filename> and
- for the other rules it is called
- <filename><replaceable>target-name</replaceable>.test</filename>.
- The <code>run*</code> rules also capture all output from the program,
- and store it in a file named
- <filename><replaceable>target-name</replaceable>.output</filename>.</para>
-
- <para>The <code>run</code> and the <code>run-fail</code> rules, if
- the test passes, automatically delete the linked executable, to
- save space. This behaviour can be suppressed by passing the
- <literal>--preserve-test-targets</literal> command line option.</para>
-
- <para>It is possible to print the list of all test targets (except for
- <code>unit-test</code>) declared in your project, by passing
- the <literal>--dump-tests</literal> command-line option. The output
- will consist of lines of the form:
- <screen>
-boost-test(<replaceable>test-type</replaceable>) <replaceable>path</replaceable> : <replaceable>sources</replaceable>
- </screen>
- </para>
+ <para>
+ All rules described in this section, if executed successfully, create a
+ special manifest file to indicate that the test passed. For the
+ <code>unit-test</code> rule the files is named <filename><replaceable>
+ target-name</replaceable>.passed</filename> and for the other rules it is
+ called <filename><replaceable>target-name</replaceable>.test</filename>.
+ The <code>run*</code> rules also capture all output from the program, and
+ store it in a file named <filename><replaceable>
+ target-name</replaceable>.output</filename>.
+ </para>
- <para>It is possible to process the list of tests, the output of
- bjam during command run, and the presense/absense of the
- <filename>*.test</filename> files created when test passes into
- human-readable status table of tests. Such processing utilities
- are not included in Boost.Build.</para>
+ <para>
+ The <code>run</code> and the <code>run-fail</code> rules, if the test
+ passes, automatically delete the linked executable, to save space. This
+ behaviour can be suppressed by passing the <literal>
+ --preserve-test-targets</literal> command line option.
+ </para>
- </section>
+ <para>
+ It is possible to print the list of all test targets (except for
+ <code>unit-test</code>) declared in your project, by passing the <literal>
+ --dump-tests</literal> command-line option. The output will consist of
+ lines of the form:
+<screen>
+boost-test(<replaceable>test-type</replaceable>) <replaceable>path</replaceable> : <replaceable>sources</replaceable>
+</screen>
+ </para>
- <section id="bbv2.builtins.raw">
+ <para>
+ It is possible to process the list of tests, the output of bjam during
+ command run, and the presense/absense of the <filename>*.test</filename>
+ files created when test passes into human-readable status table of tests.
+ Such processing utilities are not included in Boost.Build.
+ </para>
+ </section>
- <title>Custom commands</title>
+ <section id="bbv2.builtins.raw">
+ <title>Custom commands</title>
- <para>
- When you use most of main target rules, Boost.Build automatically
- figures what commands to run and it what order. As soon as you want to
- use new file types, or support new tools, one approach is to extend
- Boost.Build to smoothly support them, as documented in
- <xref linkend="bbv2.extender"/>. However, if there's a single place
- where the new tool is used, it might be easier to just explicitly
- specify the commands to run.
- </para>
+ <para>
+ When you use most of main target rules, Boost.Build automatically figures
+ what commands to run and it what order. As soon as you want to use new
+ file types or support new tools, one approach is to extend Boost.Build to
+ smoothly support them, as documented in <xref linkend="bbv2.extender"/>.
+ However, if there is only a single place where the new tool is used, it
+ might be easier to just explicitly specify the commands to run.
+ </para>
- <para>
- <!-- This paragraph requires links to where the terms 'virtual target'
- & 'target' are defined. -->
- Three main target rules can be used for that. The <functionname>make
- </functionname> rule allows you to construct a single file from any
- number of source file, by running a command you specify. The
- <functionname>notfile</functionname> rule allows you to run an arbitrary
- command, without creating any files. And finaly, the <functionname>
- generate</functionname> rule allows you to describe transformation using
- Boost.Build's virtual targets. This is higher-level than file names that
- the <functionname>make</functionname> rule operates with and allows you
- to create more than one target, create differently named targets
- depending on properties or use more than one tool.
- </para>
+ <para>
+ <!-- This paragraph requires links to where the terms 'virtual target' &
+ 'target' are defined. -->
+ Three main target rules can be used for that. The <functionname>make
+ </functionname> rule allows you to construct a single file from any number
+ of source file, by running a command you specify. The <functionname>
+ notfile</functionname> rule allows you to run an arbitrary command,
+ without creating any files. And finaly, the <functionname>generate
+ </functionname> rule allows you to describe transformation using
+ Boost.Build's virtual targets. This is higher-level than file names that
+ the <functionname>make</functionname> rule operates with and allows you to
+ create more than one target, create differently named targets depending on
+ properties or use more than one tool.
+ </para>
- <para>
- The <functionname>make</functionname> rule is used when you want to
- create one file from a number of sources using some specific command.
- The <functionname>notfile</functionname> is used to unconditionally run
- a command.
- </para>
+ <para>
+ The <functionname>make</functionname> rule is used when you want to create
+ one file from a number of sources using some specific command. The
+ <functionname>notfile</functionname> is used to unconditionally run a
+ command.
+ </para>
- <!-- We need to specify somewhere that the user can get rules like make,
- notfile & generate defined in his Jamfiles by importing an appropriate
- Boost.Build module. Also, each of those rules should get a separate
- documentation page explicitly listing which module needs to be imported
- for them to become accessible. -->
+ <!-- We need to specify somewhere that the user can get rules like make,
+ notfile & generate defined in his Jamfiles by importing an appropriate
+ Boost.Build module. Also, each of those rules should get a separate
+ documentation page explicitly listing which module needs to be imported for
+ them to become accessible. -->
- <para>
- Suppose you want to create file <filename>file.out</filename> from file
- <filename>file.in</filename> by running command
- <command>in2out</command>. Here is how you would do this in Boost.Build:
+ <para>
+ Suppose you want to create file <filename>file.out</filename> from file
+ <filename>file.in</filename> by running command <command>
+ in2out</command>. Here is how you would do this in Boost.Build:
<programlisting>
make file.out : file.in : @in2out ;
actions in2out
@@ -519,16 +532,16 @@
in2out $(<) $(>)
}
</programlisting>
- If you run <command>bjam</command> and <filename>file.out</filename>
- does not exist, Boost.Build will run the <command>in2out</command>
- command to create that file. For more details on specifying actions, see
- <xref linkend="bbv2.advanced.jam_language.actions"/>.
- </para>
+ If you run <command>bjam</command> and <filename>file.out</filename> does
+ not exist, Boost.Build will run the <command>in2out</command> command to
+ create that file. For more details on specifying actions, see <xref
+ linkend="bbv2.advanced.jam_language.actions"/>.
+ </para>
- <para>
- It could be that you just want to run some command unconditionally, and
- that command does not create any specific files. For that you can use
- the <functionname>notfile</functionname> rule. For example:
+ <para>
+ It could be that you just want to run some command unconditionally, and
+ that command does not create any specific files. For that you can use the
+ <functionname>notfile</functionname> rule. For example:
<programlisting>
notfile echo_something : @echo ;
actions echo
@@ -536,56 +549,56 @@
echo "something"
}
</programlisting>
- The only difference from the <functionname>make</functionname> rule is
- that the name of the target is not considered a name of a file, so
- Boost.Build will unconditionally run the action.
- </para>
+ The only difference from the <functionname>make</functionname> rule is
+ that the name of the target is not considered a name of a file, so
+ Boost.Build will unconditionally run the action.
+ </para>
- <para>
- <!-- This paragraph requires links to where terms like 'virtual target',
- 'target', 'project-target' & 'property-set' are defined. -->
- The <functionname>generate</functionname> rule is used when you want to
- express transformations using Boost.Build's virtual targets, as opposed
- to just filenames. The <functionname>generate</functionname> rule has
- the standard main target rule signature, but you are required to specify
- the <literal>generating-rule</literal> property. The value of the
- property should be in the form
- <literal>@<replaceable>rule-name</replaceable></literal>, the named rule
- should have the following signature:
+ <para>
+ <!-- This paragraph requires links to where terms like 'virtual target',
+ 'target', 'project-target' & 'property-set' are defined. -->
+ The <functionname>generate</functionname> rule is used when you want to
+ express transformations using Boost.Build's virtual targets, as opposed to
+ just filenames. The <functionname>generate</functionname> rule has the
+ standard main target rule signature, but you are required to specify the
+ <literal>generating-rule</literal> property. The value of the property
+ should be in the form <literal>
+ @<replaceable>rule-name</replaceable></literal>, the named rule should
+ have the following signature:
<programlisting>
rule generating-rule ( project name : property-set : sources * )
</programlisting>
- and will be called with an instance of the <code>project-target</code>
- class, the name of the main target, an instance of the
- <code>property-set</code> class containing build properties, and the
- list of instances of the <code>virtual-target</code> class corresponding
- to sources. The rule must return a list of <code>virtual-target</code>
- instances. The interface of the <code>virtual-target</code> class can be
- learned by looking at the <filename>build/virtual-target.jam</filename>
- file. The <filename>generate</filename> example contained in the
- Boost.Build distribution illustrates how the <literal>generate</literal>
- rule can be used.
- </para>
-
- </section>
+ and will be called with an instance of the <code>project-target</code>
+ class, the name of the main target, an instance of the
+ <code>property-set</code> class containing build properties, and the list
+ of instances of the <code>virtual-target</code> class corresponding to
+ sources. The rule must return a list of <code>virtual-target</code>
+ instances. The interface of the <code>virtual-target</code> class can be
+ learned by looking at the <filename>build/virtual-target.jam</filename>
+ file. The <filename>generate</filename> example contained in the
+ Boost.Build distribution illustrates how the <literal>generate</literal>
+ rule can be used.
+ </para>
+ </section>
- <section id="bbv2.reference.precompiled_headers">
- <title>Precompiled Headers</title>
+ <section id="bbv2.reference.precompiled_headers">
+ <title>Precompiled Headers</title>
- <para>
- Precompiled headers is a mechanism to speed up compilation by creating a
- partially processed version of some header files, and then using that
- version during compilations rather then repeatedly parsing the original
- headers. Boost.Build supports precompiled headers with gcc and msvc
- toolsets.
- </para>
+ <para>
+ Precompiled headers is a mechanism to speed up compilation by creating a
+ partially processed version of some header files, and then using that
+ version during compilations rather then repeatedly parsing the original
+ headers. Boost.Build supports precompiled headers with gcc and msvc
+ toolsets.
+ </para>
- <para>
- To use precompiled headers, follow the following steps:
- </para>
+ <para>
+ To use precompiled headers, follow the following steps:
+ </para>
- <orderedlist>
- <listitem><para>
+ <orderedlist>
+ <listitem>
+ <para>
Create a header that includes headers used by your project that you
want precompiled. It is better to include only headers that are
sufficiently stable — like headers from the compiler and
@@ -593,9 +606,11 @@
BOOST_BUILD_PCH_ENABLED</code>, so that the potentially expensive
inclusion of headers is not done when PCH is not enabled. Include the
new header at the top of your source files.
- </para></listitem>
+ </para>
+ </listitem>
- <listitem><para>
+ <listitem>
+ <para>
Declare a new Boost.Build target for the precompiled header and add
that precompiled header to the sources of the target whose compilation
you want to speed up:
@@ -606,91 +621,99 @@
You can use the <functionname>c-pch</functionname> rule if you want to
use the precompiled header in C programs.
</para></listitem>
- </orderedlist>
+ </orderedlist>
- <para>
- The <filename>pch</filename> example in Boost.Build distribution can be
- used as reference.
- </para>
+ <para>
+ The <filename>pch</filename> example in Boost.Build distribution can be
+ used as reference.
+ </para>
- <para>
- Please note the following:
- </para>
+ <para>
+ Please note the following:
+ </para>
- <itemizedlist>
- <listitem><para>
+ <itemizedlist>
+ <listitem>
+ <para>
The inclusion of the precompiled header must be the first thing in a
source file, before any code or preprocessor directives.
- </para></listitem>
+ </para>
+ </listitem>
- <listitem><para>
+ <listitem>
+ <para>
The build properties used to compile the source files and the
precompiled header must be the same. Consider using project
requirements to assure this.
- </para></listitem>
+ </para>
+ </listitem>
- <listitem><para>
+ <listitem>
+ <para>
Precompiled headers must be used purely as a way to improve
compilation time, not to save the number of <code>#include</code>
statements. If a source file needs to include some header, explicitly
include it in the source file, even if the same header is included
from the precompiled header. This makes sure that your project will
build even if precompiled headers are not supported.
- </para></listitem>
+ </para>
+ </listitem>
- <listitem><para>
+ <listitem>
+ <para>
On the gcc compiler, the name of the header being precompiled must be
equal to the name of the <code>cpp-pch</code> target. This is a gcc
requirement.
- </para></listitem>
+ </para>
+ </listitem>
- <listitem><para>
+ <listitem>
+ <para>
Prior to version 4.2, the gcc compiler did not allow anonymous
namespaces in precompiled headers, which limits their utility. See the
- <ulink url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29085">bug
+ <ulink url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29085"> bug
report</ulink> for details.
- </para></listitem>
- </itemizedlist>
- </section>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
- <section id="bbv2.reference.generated_headers">
- <title>Generated headers</title>
+ <section id="bbv2.reference.generated_headers">
+ <title>Generated headers</title>
- <para>Usually, Boost.Build handles implicit dependendies completely
- automatically. For example, for C++ files, all <literal>#include</literal>
- statements are found and handled. The only aspect where user help
- might be needed is implicit dependency on generated files.</para>
-
- <para>By default, Boost.Build handles such dependencies within one
- main target. For example, assume that main target "app" has two
- sources, "app.cpp" and "parser.y". The latter source is converted
- into "parser.c" and "parser.h". Then, if "app.cpp" includes
- "parser.h", Boost.Build will detect this dependency. Moreover,
- since "parser.h" will be generated into a build directory, the
- path to that directory will automatically added to include
- path.</para>
-
- <para>Making this mechanism work across main target boundaries is
- possible, but imposes certain overhead. For that reason, if
- there's implicit dependency on files from other main targets, the
- <literal><implicit-dependency></literal> [ link ] feature must
- be used, for example:</para>
+ <para>
+ Usually, Boost.Build handles implicit dependendies completely
+ automatically. For example, for C++ files, all <literal>#include</literal>
+ statements are found and handled. The only aspect where user help might be
+ needed is implicit dependency on generated files.
+ </para>
+
+ <para>
+ By default, Boost.Build handles such dependencies within one main target.
+ For example, assume that main target "app" has two sources, "app.cpp" and
+ "parser.y". The latter source is converted into "parser.c" and "parser.h".
+ Then, if "app.cpp" includes "parser.h", Boost.Build will detect this
+ dependency. Moreover, since "parser.h" will be generated into a build
+ directory, the path to that directory will automatically added to include
+ path.
+ </para>
+ <para>
+ Making this mechanism work across main target boundaries is possible, but
+ imposes certain overhead. For that reason, if there is implicit dependency
+ on files from other main targets, the <literal><implicit-dependency>
+ </literal> [ link ] feature must be used, for example:
<programlisting>
lib parser : parser.y ;
exe app : app.cpp : <implicit-dependency>parser ;
</programlisting>
-
- <para>
- The above example tells the build system that when scanning
- all sources of "app" for implicit-dependencies, it should consider
- targets from "parser" as potential dependencies.
- </para>
-</section>
-
+ The above example tells the build system that when scanning all sources of
+ "app" for implicit-dependencies, it should consider targets from "parser"
+ as potential dependencies.
+ </para>
+ </section>
</chapter>
-
<!--
Local Variables:
mode: xml
Deleted: branches/release/tools/build/v2/example/customization/Jamfile
==============================================================================
--- branches/release/tools/build/v2/example/customization/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,7 +0,0 @@
-# Copyright 2003, 2004 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)
-
-
-exe codegen : codegen.cpp class.verbatim usage.verbatim
- t1.verbatim ;
Deleted: branches/release/tools/build/v2/example/customization/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/example/customization/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,6 +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)
-
-
-import verbatim ;
Modified: branches/release/tools/build/v2/example/customization/readme.txt
==============================================================================
--- branches/release/tools/build/v2/example/customization/readme.txt (original)
+++ branches/release/tools/build/v2/example/customization/readme.txt 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -3,9 +3,9 @@
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
-This example show how to add a new target type and a new tool
-support to Boost.Build. Please refer to extender manual for
-complete description of this example.
+This example show how to add a new target type and a new tool support to
+Boost.Build. Please refer to extender manual for a complete description of this
+example.
-Note that this example requires Python. If cygwin Python on Windows is
-to be used, please go to "verbatim.jam" and follow instructions there.
+Note that this example requires Python. If cygwin Python on Windows is to be
+used, please go to "verbatim.jam" and follow instructions there.
Modified: branches/release/tools/build/v2/example/customization/usage.verbatim
==============================================================================
--- branches/release/tools/build/v2/example/customization/usage.verbatim (original)
+++ branches/release/tools/build/v2/example/customization/usage.verbatim 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,6 +1,5 @@
usage
Usage: codegen class_name
-This program takes a template of C++ code and replaces of
-occurences of %class_name% with the passed 'class_name'
-parameter.
\ No newline at end of file
+This program takes a template of C++ code and replaces of all occurrences of
+%class_name% with the passed 'class_name' parameter.
\ No newline at end of file
Deleted: branches/release/tools/build/v2/example/generate/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/generate/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,35 +0,0 @@
-# Copyright 2007 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)
-
-import common ;
-import "class" : new ;
-
-rule generate-example ( project name : property-set : sources * )
-{
- local result ;
- for local s in $(sources)
- {
- #local ea = [ $(s).action ] ;
- #local ep = [ $(ea).properties ] ;
-
- # Create a new action, that takes the source target
- # and runs 'common.copy' comamnd on it.
- local a = [
- new non-scanning-action $(s) : common.copy : $(property-set) ] ;
-
- local source-name = [ $(s).name ] ;
-
- # Create the target to represent the result of the action.
- # The target has the name that was specified in Jamfile
- # and passed here via the 'name' parameter,
- # and the same type and project as the source.
- result += [ new file-target $(name)
- : [ $(s).type ]
- : $(project)
- : $(a) ] ;
- }
- return $(result) ;
-}
-
-generate a2 : a.cpp : <generating-rule>@generate-example ;
Modified: branches/release/tools/build/v2/example/generate/REAME.txt
==============================================================================
--- branches/release/tools/build/v2/example/generate/REAME.txt (original)
+++ branches/release/tools/build/v2/example/generate/REAME.txt 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,15 +1,11 @@
+# Copyright 2007 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)
-This example shows the 'generate' rule, that
-allows you to construct target using any arbitrary
-set of transformation and commands.
+This example shows the 'generate' rule, that allows you to construct target
+using any arbitrary set of transformation and commands.
-The rule is similar to 'make' and 'notfile', but
-unlike those, you can operate in terms of
-Boost.Build 'virtual targets', which is more
-flexible.
+The rule is similar to 'make' and 'notfile', but unlike those, you can operate
+in terms of Boost.Build 'virtual targets', which is more flexible.
Please consult the docs for more explanations.
-
-# Copyright 2007 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)
Deleted: branches/release/tools/build/v2/example/generator/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/generator/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-# Copyright 2006 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)
-
-import soap ;
-exe foo : foo.gci : <server>on ;
Modified: branches/release/tools/build/v2/example/generator/README.txt
==============================================================================
--- branches/release/tools/build/v2/example/generator/README.txt (original)
+++ branches/release/tools/build/v2/example/generator/README.txt 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,7 +1,6 @@
-
-This example shows how to declare a new generator class. It's necessary
-when generator's logic is more complex that just running a single tool.
-
# Copyright 2006 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)
+
+This example shows how to declare a new generator class. It is necessary when
+generator's logic is more complex that just running a single tool.
Deleted: branches/release/tools/build/v2/example/gettext/Jamfile
==============================================================================
--- branches/release/tools/build/v2/example/gettext/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,26 +0,0 @@
-# Copyright 2003, 2006 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)
-
-
-# Declare a main target.
-exe main : main.cpp ;
-
-# Declare an action for updating translations
-# After changing main.cpp, invocation of
-#
-# bjam update-russian
-#
-# will update translations in russian.po
-gettext.update update-russian : russian.po main ;
-
-# Compiled message catalog.
-gettext.catalog russian : russian.po ;
-
-# A stage rule which installs message catalog to the
-# location gettext expects.
-stage messages-russian : russian
- : <location>messages/ru_RU.KOI8-R/LC_MESSAGES
- <name>main.mo
- ;
-
Deleted: branches/release/tools/build/v2/example/gettext/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/example/gettext/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,6 +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)
-
-
-using gettext ;
Modified: branches/release/tools/build/v2/example/gettext/readme.txt
==============================================================================
--- branches/release/tools/build/v2/example/gettext/readme.txt (original)
+++ branches/release/tools/build/v2/example/gettext/readme.txt 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,14 +1,14 @@
-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)
+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)
-This example shows how it's possible to used GNU gettext utilities with
+This example shows how it is possible to use GNU gettext utilities with
Boost.Build.
A simple translation file is compiled and installed as message catalog for
-russian. The main application explicitly switches to russian locale and
-output the translation of "hello".
+russian. The main application explicitly switches to russian locale and outputs
+the translation of "hello".
To test:
@@ -22,4 +22,3 @@
- edit "russian.po"
- run bjam
- run "main"
-
Deleted: branches/release/tools/build/v2/example/hello/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/hello/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,2 +0,0 @@
-
-exe hello : hello.cpp ;
Deleted: branches/release/tools/build/v2/example/libraries/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/libraries/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-
-use-project /library-example/foo : util/foo ;
-
-build-project app ;
Deleted: branches/release/tools/build/v2/example/libraries/app/Jamfile
==============================================================================
--- branches/release/tools/build/v2/example/libraries/app/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2002, 2003, 2005 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)
-
-
-# Declare a executable file, which uses a library. Note that
-# includes that for library will be automatically used
-# when compiling 'app.cpp'
-exe app : app.cpp /library-example/foo//bar ;
Deleted: branches/release/tools/build/v2/example/libraries/util/foo/Jamfile
==============================================================================
--- branches/release/tools/build/v2/example/libraries/util/foo/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2005 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)
-
-
-project
- : usage-requirements <include>include ;
-
-lib bar : bar.cpp ;
Deleted: branches/release/tools/build/v2/example/make/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/make/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,23 +0,0 @@
-
-import notfile ;
-import common ;
-
-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 ;
-
-# In this example, we'll just copy a file.
-# Need to find out the name of a command to copy a file.
-CP = [ common.copy-command ] ;
-
-# The action itself.
-# The 'CP' variable is defined below
-# $(>) is source
-# $(<) is target
-actions do-something
-{
- $(CP) $(>) $(<)
-}
Modified: branches/release/tools/build/v2/example/make/main_cpp.pro
==============================================================================
--- branches/release/tools/build/v2/example/make/main_cpp.pro (original)
+++ branches/release/tools/build/v2/example/make/main_cpp.pro 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,2 +1 @@
-
-int main() { return 0; }
+int main() {}
Modified: branches/release/tools/build/v2/example/make/readme.txt
==============================================================================
--- branches/release/tools/build/v2/example/make/readme.txt (original)
+++ branches/release/tools/build/v2/example/make/readme.txt 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,7 +1,7 @@
-Copyright 2002, 2005 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)
+Copyright 2002, 2005 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)
-Example of using custom command to create one file from
-another, using the builtin 'make' rule.
+Example of using custom command to create one file from another, using the
+built-in 'make' rule.
Deleted: branches/release/tools/build/v2/example/pch/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/pch/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,29 +0,0 @@
-# Copyright 2006 Ilya Sokolov
-#
-# 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)
-
-# pch ##########################################################################
-
-import pch ;
-
-cpp-pch pch
- : # sources
- include/pch.hpp
- : # requirements
- <include>include
- ;
-explicit pch ;
-
-# exe ##########################################################################
-
-exe hello_world
- : # sources
- pch
- source/hello_world.cpp
- : # requirements
- <include>include
- : # default build
- : # usage requirements
- ;
Deleted: branches/release/tools/build/v2/example/python_modules/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/python_modules/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,8 +0,0 @@
-# Copyright 2006 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)
-
-import python_helpers ;
-
-ECHO "test1:" [ python_helpers.test1 ] ;
-ECHO "test2:" [ python_helpers.test2 1234 : 5678 ] ;
Modified: branches/release/tools/build/v2/example/python_modules/readme.txt
==============================================================================
--- branches/release/tools/build/v2/example/python_modules/readme.txt (original)
+++ branches/release/tools/build/v2/example/python_modules/readme.txt 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,6 +1,6 @@
-Copyright 2006 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)
+Copyright 2006 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)
This example shows how you can use Python modules from Boost.Build.
@@ -8,8 +8,9 @@
In order to do this, you need to build bjam with Python support, by running:
./build.sh --with-python=/usr
-
-in jam directory. (Replace /usr with the root of your Python installation.)
-The integration between Python and bjam is very basic now, but enough to
-be useful.
+in the jam/src directory (replace /usr with the root of your Python
+installation).
+
+The integration between Python and bjam is very basic now, but enough to be
+useful.
Modified: branches/release/tools/build/v2/example/qt/README.txt
==============================================================================
--- branches/release/tools/build/v2/example/qt/README.txt (original)
+++ branches/release/tools/build/v2/example/qt/README.txt 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -7,15 +7,14 @@
(http://www.trolltech.com/products/qt/index.html).
The current examples are:
-1. Basic setup -- application with several sources and moccable header.
-2. Using of .ui source file.
-3. Running .cpp files via the moc tool.
+ 1. Basic setup -- application with several sources and moccable header.
+ 2. Using of .ui source file.
+ 3. Running .cpp files via the moc tool.
-For convenience, there are examples both for 3.* and 4.* version of Qt,
-they are mostly identical and differ only in source code.
+For convenience, there are examples both for 3.* and 4.* version of Qt, they are
+mostly identical and differ only in source code.
All examples assumes that you just installed Boost.Build and that QTDIR
environment variables is set (typical values can be /usr/share/qt3 and
-/usr/share/qt4). After adding "using qt ..." to your user-config.jam, you'd
-have to removing "using qt ; " statements from Jamroot file of examples.
-
+/usr/share/qt4). After adding "using qt ..." to your user-config.jam, you would
+have to remove "using qt ; " statements from example Jamroot files.
Deleted: branches/release/tools/build/v2/example/qt/qt3/hello/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/qt/qt3/hello/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright Vladimir Prus 2004.
-# 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)
-
-using qt ;
-
-project
- # built MT version, unless asked otherwise.
- : default-build <threading>multi
- ;
-
-exe canvas : main.cpp canvas.cpp canvas.h : <library>/qt//qt ;
\ No newline at end of file
Deleted: branches/release/tools/build/v2/example/qt/qt3/moccable-cpp/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/qt/qt3/moccable-cpp/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,11 +0,0 @@
-
-using qt ;
-import cast ;
-
-project
- : default-build <threading>multi
- ;
-
-exe main : main.cpp [ cast _ moccable-cpp : main.cpp ]
- /qt//qt
- ;
Deleted: branches/release/tools/build/v2/example/qt/qt3/uic/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/qt/qt3/uic/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,15 +0,0 @@
-# Copyright Felix E. Klee, 2003
-# 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)
-
-# Tell that QT should be used. QTDIR will give installation
-# prefix.
-using qt ;
-
-project
- : default-build <threading>multi
- ;
-
-exe hello : main.cpp hello_world_widget.ui : <library>/qt//qt ;
-
Deleted: branches/release/tools/build/v2/example/qt/qt4/hello/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/qt/qt4/hello/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,14 +0,0 @@
-
-import qt4 ;
-
-if ! [ qt4.initialized ]
-{
- ECHO "Warning: Qt4 not initialized in user-config.jam" ;
- ECHO "Assuming /space/p2/ghost/build/Qt4 as location." ;
- ECHO "This is very likely won't work for you. " ;
- using qt4 : /space/p2/ghost/build/Qt4 ;
-}
-
-project : requirements <threading>multi ;
-
-exe arrow : main.cpp arrow.cpp arrow.h /qt//QtGui ;
\ No newline at end of file
Deleted: branches/release/tools/build/v2/example/qt/qt4/moccable-cpp/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/qt/qt4/moccable-cpp/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,18 +0,0 @@
-
-import qt4 ;
-if ! [ qt4.initialized ]
-{
- ECHO "Warning: Qt4 not initialized in user-config.jam" ;
- ECHO "Assuming /space/p2/ghost/build/Qt4 as location." ;
- ECHO "This is very likely won't work for you. " ;
- using qt4 : /space/p2/ghost/build/Qt4 ;
-}
-
-import cast ;
-exe main : main.cpp
- [ cast _ moccable-cpp : main.cpp ]
- /qt//QtGui
- : <threading>multi
- ;
-
-
Deleted: branches/release/tools/build/v2/example/qt/qt4/uic/Jamroot
==============================================================================
--- branches/release/tools/build/v2/example/qt/qt4/uic/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,18 +0,0 @@
-# Copyright Felix E. Klee, 2003
-# 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)
-
-import qt4 ;
-if ! [ qt4.initialized ]
-{
- ECHO "Warning: Qt4 not initialized in user-config.jam" ;
- ECHO "Assuming /space/p2/ghost/build/Qt4 as location." ;
- ECHO "This is very likely won't work for you. " ;
- using qt4 : /space/p2/ghost/build/Qt4 ;
-}
-
-project : requirements <threading>multi
- ;
-
-exe hello : main.cpp hello_world_widget.ui : <library>/qt//QtGui ;
Deleted: branches/release/tools/build/v2/example/variant/Jamfile
==============================================================================
--- branches/release/tools/build/v2/example/variant/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2004 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)
-
-
-# By default, build the project with two variants
-# we've defined in project-root.jam
-project
- : default-build crazy super_release
- ;
-
-exe a : a.cpp libs//l ;
-
Deleted: branches/release/tools/build/v2/example/variant/libs/Jamfile
==============================================================================
--- branches/release/tools/build/v2/example/variant/libs/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-# Copyright 2004 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)
-
-
-lib l : l.cpp ;
Deleted: branches/release/tools/build/v2/example/variant/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/example/variant/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,14 +0,0 @@
-# Copyright 2004 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)
-
-
-# Define a build variant which is just combination
-# of four properties.
-variant crazy : <optimization>speed <inlining>off
- <debug-symbols>on <profiling>on ;
-
-# Define a built variant inherited from 'release'.
-# It defines one new property and get all properties
-# from parent variant.
-variant super_release : release : <define>USE_ASM ;
Modified: branches/release/tools/build/v2/example/variant/readme.txt
==============================================================================
--- branches/release/tools/build/v2/example/variant/readme.txt (original)
+++ branches/release/tools/build/v2/example/variant/readme.txt 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,11 +1,11 @@
-Copyright 2004 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)
+Copyright 2004 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)
-This example shows how user can create his own build variants.
-Two variants are defined: "crazy", which is just random combination
-of properties, and "super-release", which is inherited from "release",
-and differs by a single define.
+This example shows how user can create his own build variants. Two variants are
+defined: "crazy", which is just a random combination of properties, and
+"super-release", which is inherited from "release", and differs by a single
+define.
-See the project-root.jam for the definitions.
+See the jamroot.jam for the definitions.
Deleted: branches/release/tools/build/v2/example/versioned/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/example/versioned/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,8 +0,0 @@
-# Copyright 2003 Rene Rivera
-# 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)
-
-
-import gcc ;
-import toolset ;
-import modifiers ;
Deleted: branches/release/tools/build/v2/generators_prototype.py
==============================================================================
--- branches/release/tools/build/v2/generators_prototype.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,731 +0,0 @@
-# Copyright 2003 Dave Abrahams
-# 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)
-
-# Importing by a different name keeps PyChecker happy
-from __future__ import generators as generators_
-import sys
-
-
-class Generator(object):
- """Representation of a transformation from source to target types.
-
- sources and targets may be either strings or sequences of
- strings.
-
- >>> print Generator(('obj*', 'lib*'), 'exe')
- exe <- obj*,lib*
-
- >>> assert Generator('c','o').unary
- """
-
- def __init__(self, sources, targets):
- """
- >>> g = Generator(['obj*', 'z', 'cpp'], ['lib','dll'])
- >>> g.signature
- [('cpp', 1, 1), ('obj', 0, '*'), ('z', 1, 1)]
- >>> g = Generator('cpp', 'obj')
- >>> g.signature
- [('cpp', 1, 1)]
- """
- self.sources = _sequence_of_strings(sources)
- self.targets =_sequence_of_strings(targets)
- self.targets_ = _string_multiset(targets)
-
- signature = {}
- stars = {}
- for s in self.sources:
- if s.endswith('*'):
- stars[s[:-1]] = 1
- signature.setdefault(s[:-1],0)
- else:
- signature[s] = signature.get(s,0) + 1
-
- self.signature = []
- for t, n in signature.items():
- if t in stars:
- self.signature.append((t, n, '*'))
- else:
- self.signature.append((t, n, n))
-
- self.signature.sort() # makes doctests nicer
-
- # Remember whether the signature is strictly unary
- self.unary = not stars and len(self.sources) == 1
-
- def match(self, group):
- """If group satisfies an element of the signature, returns an
- amended signature that consists of all other elements.
- Otherwise, returns None.
- >>> g = Generator(['obj*', 'z', 'cpp', 'z'], ['lib','dll'])
- >>> g.match(TargetTypeGroup('obj',12))
- [('cpp', 1, 1), ('z', 2, 2)]
- >>> g.match(TargetTypeGroup('cpp',12)) # None
-
- >>> g.match(TargetTypeGroup('cpp',1))
- [('obj', 0, '*'), ('z', 2, 2)]
-
- >>> g.match(TargetTypeGroup('z',2))
- [('cpp', 1, 1), ('obj', 0, '*')]
-
- >>> Generator('cpp','obj').match(TargetTypeGroup('cpp',1))
- []
-
- >>> Generator('cpp','obj').match(TargetTypeGroup('cpp',12))
- []
- """
- if self in group.generators:
- return None
-
- for i in range(len(self.signature)):
- e = self.signature[i]
- if e[0] == group.target_type:
- if self.unary:
- return []
- if e[1] > group.size or e[2] < group.size:
- return None
- else:
- return self.signature[:i] + self.signature[i+1:]
- return None
-
- def __str__(self):
- """Make a nice human-readable representation
- >>> g = Generator(['obj*', 'z', 'cpp'], ['lib','dll'])
- >>> print g
- lib,dll <- obj*,z,cpp
- """
- return ','.join(self.targets) + ' <- ' + ','.join(self.sources)
-
- def __type_list_rep(self, type_list):
- if len(type_list) == 1:
- return repr(type_list[0])
- else:
- return repr(type_list)
-
- def __repr__(self):
- return (
- self.__module__ + '.' + type(self).__name__ + '(' +
- self.__type_list_rep(self.sources)
- + ', ' + self.__type_list_rep(self.targets) + ')'
- )
-
-def _dict_tuple(d):
- l = d.items()
- l.sort()
- return tuple(l)
-
-def _sorted(list):
- list.sort()
- return list
-
-class GeneratorSet(object):
- def __init__(self):
- self.all_generators = {}
- self.generators_by_type = {}
-
- def __iadd__(self, generator):
- """Add a generator to the set
-
- >>> s = GeneratorSet()
- >>> s += Generator('foo', 'bar')
- >>> s += Generator('foo', 'baz')
- >>> s += Generator(['foo','bar'], 'baz')
- >>> s += Generator('bar', ['baz', 'mumble'])
- >>> s += Generator('bar*', ['bing'])
- >>> print s
- {
- bar:
- baz <- foo,bar
- baz,mumble <- bar
- bing <- bar*
- foo:
- bar <- foo
- baz <- foo
- baz <- foo,bar
- }
-
- """
- if not generator in self.all_generators:
- self.all_generators[generator] = 1
- for t in generator.sources:
- if t.endswith('*'):
- t = t[:-1]
- l = self[t]
- l.append(generator)
- return self
-
- def __isub__(self, generator):
- for t in generator.sources:
- if t.endswith('*'):
- t = t[:-1]
- self[t].remove(generator)
- return self
-
- def __getitem__(self, t):
- """Given a target type, return a list of all the generators
- which can consume that target type.
- """
- return self.generators_by_type.setdefault(t,[])
-
- def __str__(self):
- # import pprint
- # return pprint.pformat(self.generators_by_type)
-
- s = []
-
- for k,v in _sorted(self.generators_by_type.items()):
- s += [ ' ' + k + ':\n ' + '\n '.join([ str(x) for x in v ]) ]
-
- return '{\n' + '\n'.join(s) + '\n}'
-
-def _dicts_intersect(d1, d2):
- """True iff d1 and d2 have a key in common
-
- >>> assert _dicts_intersect({1:0, 2:0}, {2:0})
- >>> assert _dicts_intersect({2:0}, {1:0, 2:0})
- >>> assert not _dicts_intersect({1:0, 3:0}, {2:0})
- >>> assert not _dicts_intersect({2:0}, {1:0, 3:0})
- """
- if len(d2) < len(d1):
- tmp = d1
- d1 = d2
- d2 = tmp
- for k in d1.iterkeys():
- if k in d2:
- return True
- return False
-
-class TargetTypeGroup(object):
- instances = 0
-
- def __init__(
- self
- , target_type
- , size # how many of that type are in the group.
- , parents = ()
- , generator = None):
- """
- >>> g1 = TargetTypeGroup('x', 1)
- >>> assert not g1.extra_targets
- >>> assert g1.consumed_sources == { g1:1 }
- >>> g2 = TargetTypeGroup('x', 1)
-
- >>> g3 = TargetTypeGroup('x', 1, [g1,g2])
- >>> assert g1 in g3.consumed_sources
- >>> assert g2 in g3.consumed_sources
- >>> assert not g3 in g3.consumed_sources
- """
- self.target_type = target_type
- self.size = size
- self.parents = parents
- self.generator = generator
- self.siblings = None
- self.id = TargetTypeGroup.instances
- self.ambiguous = reduce(lambda x,y: x or y.ambiguous and 1,
- parents, None)
-
- self.generators = { generator : 1 } # it doesn't hurt to store None here
- ignored = [ self.generators.update(p.generators) for p in parents ]
-
- self.__constituents = None
- self.__extra_targets = None
-
- TargetTypeGroup.instances += 1
-
- if generator:
- self.moves = { (id(generator),id(parents)) : 1 }
- else:
- self.moves = {}
-
- if not parents:
- self.consumed_sources = {self:1}
- self.__extra_targets = ()
- else:
- ignored = [ self.moves.update(p.moves) for p in parents ]
-
- if len(parents) == 1:
- self.consumed_sources = parents[0].consumed_sources
- else:
- self.consumed_sources = {}
- for c in parents:
- self.consumed_sources.update(c.consumed_sources)
-
- # constituents property - the set of all target groups consumed in
- # creating this group
- def __get_constituents(self):
- if self.__constituents is None:
- self.__constituents = {self:1}
- for c in self.parents:
- self.__constituents.update(c.constituents)
- return self.__constituents
-
- constituents = property(__get_constituents)
-
- cost = property(lambda self: len(self.moves))
-
- # extra targets property - in general, every target group sits at
- # the root of a DAG. The extra targets are the ones produced by
- # generators that run in this DAG but which are not part of the
- # DAG, i.e. are not constituents. In the example below, X and Y
- # are extra targets of A.
- #
- # A X B,C <- D
- # / \ / C,Y <- E
- # B C Y A,X <- B,C
- # \ / \ /
- # Sources: D E
- #
- # We use the extra targets to determine the equivalence of two
- # search States
- def __get_extra_targets(self):
- if self.__extra_targets is None:
-
- if len(self.parents) == 1 and not self.siblings:
- self.__extra_targets = self.parents[0].extra_targets
- else:
- # all siblings are created incidentally
- if self.siblings:
- t = tuple([s for s in self.siblings if s != self])
- else:
- t = ()
-
- # Any groups created incidentally as part of generating my
- # parents are also incidental to my generation
- for c in self.parents:
- for i in c.extra_targets:
- if i not in self.constituents:
- t += (i,)
-
- self.__extra_targets = _sort_tuple(t)
- return self.__extra_targets
-
- extra_targets = property(__get_extra_targets)
-
- def set_siblings(self, sibs):
- assert self.__extra_targets is None, \
- "can't set siblings after extra targets already computed."
-
- assert self.parents, "original source nodes don't have siblings"
- self.siblings = sibs
-
- def __repr__(self):
- return '%s.%s(#%s$%s)' % (self.size,self.target_type,self.id,self.cost)
-
- def is_compatible_with(self, other):
- """True iff self and other can be used to trigger a generator.
-
- >>> g1 = TargetTypeGroup('x', 1)
- >>> g2 = TargetTypeGroup('x', 1)
- >>> assert g1.is_compatible_with(g2)
-
- >>> g3 = TargetTypeGroup('x', 1, [g1])
- >>> g4 = TargetTypeGroup('x', 1, [g2])
- >>> assert g3.is_compatible_with(g4)
- >>> assert g3.is_compatible_with(g2)
- >>> assert not g3.is_compatible_with(g1)
- >>> assert not g2.is_compatible_with(g4)
-
- >>> g5 = TargetTypeGroup('x', 1, [g3])
- >>> assert not g5.is_compatible_with(g1)
- """
- return not _dicts_intersect(
- self.constituents, other.constituents)
-
- def all_compatible(self, others):
- """True iff self is_compatible with every element of other
- """
- for o in others:
- if not self.is_compatible_with(o):
- return False
- return True
-
- def atoms(self):
- """If this group was formed by combining other groups without
- a generator, return a set of its nearest parent groups which
- were not formed that way. Otherwise, return a set
- containing only this group.
-
- >>> g1 = TargetTypeGroup('x',1)
- >>> g2 = TargetTypeGroup('x',1)
- >>> a = TargetTypeGroup('x',2, [g1,g2]).atoms()
- >>> assert g1 in a and g2 in a and len(a) == 2
- """
- if self.generator or not self.parents:
- return (self,)
- x = ()
- for p in self.parents:
- x += p.atoms()
- return x
-
-
- def consumes(self, others):
- """True iff not self is_compatible with every element of other
- """
- for o in others:
- if self.is_compatible_with(o):
- return False
- return True
-
-def _string_multiset(s):
- x = {}
- for t in _sequence_of_strings(s):
- x[t] = x.get(t,0) + 1
- return x
-
-
-def parent_sets(chosen, signature, all_groups, generator):
- """Given an already-chosen tuple of TargetTypeGroups and a signature
- of the groups left to choose, generates all mutually-compatible
- combinations of groups starting with chosen
-
- >>> TargetTypeGroup.instances = 0
- >>> groups = {
- ... 'x': [ TargetTypeGroup('x', 1) ],
- ... 'y': [ TargetTypeGroup('y', 1), TargetTypeGroup('y',2) ],
- ... 'z': [ TargetTypeGroup('z', 1) ]
- ... }
- >>> signature = (('y',0,'*'),('z',1,'1'))
- >>> chosen = (groups['x'][0],)
- >>> [ x for x in parent_sets(chosen, signature, groups, Generator('x',('y*', 'z'))) ]
- [(1.x(#0$0), 1.z(#3$0)), (1.x(#0$0), 1.y(#1$0), 1.z(#3$0)), (1.x(#0$0), 2.y(#2$0), 1.z(#3$0))]
- """
- if len(signature) == 0:
- # The entire signature was satisfied; we can just yield the
- # one result
- yield chosen
- else:
- # find all ways to satisfy the next element of the signature
- # which are compatible with the already-chosen groups. If
- # there are no ways, we will fall off the end here and the
- # ultimate result will be empty.
- t, min, max = signature[0]
-
- if min == 0:
- for s in parent_sets(chosen, signature[1:], all_groups, generator):
- yield s
-
- for g in all_groups[t]:
-
- # can only use a generator once in any path
- if generator in g.generators:
- continue
-
- if (g.size >= min and g.size <= max and
- g.all_compatible(chosen)):
-
- for s in parent_sets(
- chosen + (g,), signature[1:], all_groups, generator
- ):
- yield s
-
-debug = None
-
-def _sort_tuple(t):
- """copies the given sequence into a new tuple in sorted order"""
- l = list(t)
- l.sort()
- return tuple(l)
-
-def _sequence_of_strings(s_or_l):
- """if the argument is a string, wraps a tuple around it.
- Otherwise, returns the argument untouched
- """
- if isinstance(s_or_l, type('')):
- return (s_or_l,)
- else:
- return s_or_l
-
-def _examine_edge(states, queue, g):
- """Handle a possible new state in the search.
- """
- g_state = State(g)
- v = states.setdefault(g_state, g_state)
-
- if v.group is g:
- queue.append(g_state)
- return False
-
- if v.group.cost > g.cost:
- if debug:
- print 'reducing cost of state(%s) via %s' % (v.group,g)
- v.group.ambiguous = None
- v.group = g
-
- elif v.group.cost < g.cost:
- if debug:
- print 'discarding %s due to lower cost state(%s)' % (g, v.group)
-
- elif not (g.generator or v.group.generator) \
- and _sort_tuple(g.atoms()) == _sort_tuple(v.group.atoms()):
- # These are two different ways of combining the same groups of
- # a given type to produce a larger group, without using a generator
- if debug:
- print 'discarding %s as a redundant formulation of %s' % (g,v.group)
- else:
- if debug:
- print '%s is an ambiguous path due to %s' % (v.group, g)
- # Remember the group which caused the ambiguity
- v.group.ambiguous = g
-
- return True
-
-class State(object):
- """A wrapper around a TargetTypeGroup which makes it hashable on
- the part of its data which determines its ability to contribute to
- producing the goal target type.
- """
- def __init__(self, group):
- self.group = group
-
- def __hash__(self):
- g = self.group
- x = g.consumed_sources.keys()
- x.sort()
- return hash((g.target_type, g.size, _sort_tuple(g.extra_targets), tuple(x)))
-
- def __eq__(self, other):
- return (
- self.group.target_type == other.group.target_type
- and self.group.size == other.group.size
- and self.group.extra_targets == other.group.extra_targets
- and self.group.consumed_sources == other.group.consumed_sources)
-
-queue_moves = 0
-
-def optimal_graphs(target_type, source_groups, generators):
- """A 'simple generator' that produces the sequence of least-cost
- solutions for producing the
- target type from a subset of the source_groups, using the given
- generators.
- """
- # An index from target type to lists of groups with that type.
- all_groups = {}
-
- # Prime the priority Queue
- q = [ State(g) for g in source_groups ]
-
- # Keep a record of all known states in the search
- states = dict([ (s,s) for s in q ])
-
- solution_cost = None
- while q:
- # remove a group from the queue
- g = q[0].group
- del q[0]
-
- global queue_moves
- queue_moves += 1
-
- global debug
- if debug:
- print '-------'
- print graph(g)
-
- if g.target_type == target_type: # and g.consumes(source_groups):
- solution_cost = g.cost
- yield g
-
- if g.consumes(source_groups): # Nothing left to find
- return
-
- # combine with all like groups which are compatible
- for g2 in all_groups.get(g.target_type,()):
-
- if g2.is_compatible_with(g):
-
- _examine_edge(
- states, q,
- TargetTypeGroup(g.target_type, g2.size + g.size, (g,g2)))
-
- # expand with all generators which can be triggered as a
- # result of adding this group
- for generator in generators[g.target_type]:
-
- match = generator.match(g)
- if match is None:
- continue
-
- if debug:
- print generator,' matched with ', match
-
- # for all sets of parents which match the generator and
- # include g
- for s in parent_sets((g,), match, all_groups, generator):
-
- # Create the products of running this generator with
- # the given parent set
- siblings = ()
- for t,n in generator.targets_.items():
- # Unary generators run as many times as necessary
- # to consume the group
- if (generator.unary):
- n *= g.size
-
- siblings += (TargetTypeGroup(t, n, s, generator),)
-
- # Make sure groups know about their siblings
- if len(siblings) > 1:
- for product in siblings:
- product.set_siblings(siblings)
-
- if debug:
- print siblings, '<-', list(s)
-
- # Add new search states to the queue
- for sib in siblings:
- _examine_edge(states, q, sib)
-
- # Add to the set of all groups so that we can combine it with
- # others in future iterations
- l = all_groups.get(g.target_type)
- if l is None:
- l = all_groups.setdefault(g.target_type,[])
- l.append(g)
-
- # Sort the queue; in 'real life' use a priority queue
- q.sort(lambda v1,v2: v1.group.cost - v2.group.cost)
-
-
-def graph(group, indent = 0, visited = None):
-
- """Produce a string representation of the search graph
- that produced the given group.
- """
- if (visited is None):
- visited = {}
- s = indent * ' '
- s += repr(group)
- if group in visited:
- s += '...\n'
- else:
- visited[group] = True
- s += '[%s]' % group.generator
-
- if group.ambiguous:
- s += ' *ambiguous* '
- if type(group.ambiguous) is not type(1):
- s += 'due to %s' % group.ambiguous
- if group.siblings:
- s += ' siblings ' + str([sib for sib in group.siblings if
- sib != group])
- s += '\n' + '\n'.join(
- [graph(g,indent+1,visited) for g in group.parents])
- return s
-
-def ambiguities(group):
- """Returns a list of groups that caused ambiguities with this one
- or its constituents.
- """
- result = []
- for g in group.parents:
- result.extend(ambiguities(g))
- if group.ambiguous and type(group.ambiguous) is not type(1):
- result.append(group.ambiguous)
- return result
-
-def search(generators, targets, sources):
- import sys
- global queue_moves
-
- TargetTypeGroup.instances = 0
- queue_moves = 0
-
- # Remember what we started with
- source_groups = tuple([
- TargetTypeGroup(i[0],i[1])
- for i in _string_multiset(sources).items() ])
-
- solutions = {}
- max_consumed = 0
-
- for g in optimal_graphs(targets, source_groups, generators):
-
- if len(g.consumed_sources) > max_consumed:
- max_consumed = len(g.consumed_sources)
-
- g2 = solutions.setdefault(len(g.consumed_sources), g)
- if g2 is not g:
- if g2.cost == g.cost:
- g2.ambiguous = g
-
- if max_consumed:
- g = solutions[max_consumed]
-
- print 80 * '='
- print graph(g)
-
- if g.ambiguous:
- print 40 * '-'
- print 'ambiguities:'
- for a in ambiguities(g):
- print graph(a)
- print
-
- print queue_moves, 'queue_moves'
- print 80 * '='
- sys.stdout.flush()
-
- print queue_moves, 'queue moves'
- print '\n\n*****\n\n'
-
-
-def test():
- """Runs Volodya's example, but doesn't get the result he'd like.
- """
- # EST_EXE <- OBJ*
- # OBJ <- CPP
- # {CPP,STATIC_DATA} <- NM_ASM
- # {CPP,CPP} <- ECPP (only first CPP must be further converted into NM_ASM)
- # NM_ASM <- CPP
- # {CPP,STATIC_DATA} <- STATIC_DATA*
- # STATIC_DATA <- NM_ASM
- # NM_OBJ <- NM_ASM
- # NM_EXE <- NM_OBJ*
- generators = GeneratorSet()
- generators += Generator('OBJ*', 'EST_EXE')
- generators += Generator('CPP', 'OBJ')
- generators += Generator('NM_ASM', ('CPP', 'STATIC_DATA'))
- generators += Generator('ECPP', ('CPP','CPP'))
- generators += Generator('CPP', 'NM_ASM')
- generators += Generator('STATIC_DATA*', ('CPP', 'STATIC_DATA'))
- generators += Generator('NM_ASM', 'NM_OBJ')
- generators += Generator('NM_OBJ*', 'NM_EXE')
-
- search(generators, 'EST_EXE', ('CPP', 'NM_ASM', 'ECPP'))
- # Try the same search with a source type that can't be consumed.
- # This will exhaust all transformations before stopping.
- search(generators, 'EST_EXE', ('CPP', 'NM_ASM', 'ECPP', 'FOO'))
- search(generators, 'NM_EXE', ('CPP'))
-
-def run(args = None):
- import doctest
- import sys
-
- if args is not None:
- sys.argv = args
-
- error = doctest.testmod(sys.modules.get(__name__))
-
- if not error[0]:
- global debug
- if '--debug' in sys.argv:
- debug = 1
- test()
-
- return error
-
-if __name__ == '__main__':
- import sys
- sys.exit(run()[0])
-
-
-
-
-
-
-
-
-
-
-
-
Modified: branches/release/tools/build/v2/index.html
==============================================================================
--- branches/release/tools/build/v2/index.html (original)
+++ branches/release/tools/build/v2/index.html 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -67,7 +67,7 @@
<input type="submit" value="Search">
</form> -->
</ul>
- <li>Bug tracker
+ <li>Bug tracker
<!-- <li>Rate Boost.Build: Freshmeat -->
</ul>
</p>
Modified: branches/release/tools/build/v2/kernel/modules.jam
==============================================================================
--- branches/release/tools/build/v2/kernel/modules.jam (original)
+++ branches/release/tools/build/v2/kernel/modules.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -242,11 +242,13 @@
{
if ( $(rules-opt) = * || ! $(rules-opt) ) && $(rename-opt)
{
+ import errors ;
errors.error "Rule aliasing is only available for explicit imports." ;
}
if $(module-names[2]) && ( $(rules-opt) || $(rename-opt) )
{
+ import errors ;
errors.error "When loading multiple modules, no specific rules or"
"renaming is allowed" ;
}
Modified: branches/release/tools/build/v2/nightly.sh
==============================================================================
--- branches/release/tools/build/v2/nightly.sh (original)
+++ branches/release/tools/build/v2/nightly.sh 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -25,5 +25,5 @@
./roll.sh > ../roll-log 2>&1
cd ..
echo "Uploading packages"
-scp boost-build.zip boost-build.tar.bz2 vladimir_prus_at_[hidden]:/home/groups/b/bo/boost/htdocs/boost-build2 > scp-log
+scp boost-build.zip boost-build.tar.bz2 vladimir_prus,boost_at_[hidden]:/home/groups/b/bo/boost/htdocs/boost-build2 > scp-log
echo "Nightly build successful"
Modified: branches/release/tools/build/v2/roll.sh
==============================================================================
--- branches/release/tools/build/v2/roll.sh (original)
+++ branches/release/tools/build/v2/roll.sh 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -26,7 +26,7 @@
find . -maxdepth 1 -type f | egrep -v "boost-build.jam|timestamp.txt|roll.sh|bootstrap.jam|build-system.jam|boost_build.png|index.html|hacking.txt|site-config.jam|user-config.jam" | xargs rm -f
# Build the documentation
-touch doc/project-root.jam
+touch doc/jamroot.jam
export BOOST_BUILD_PATH=`pwd`
cd doc
/home/ghost/Work/Boost/boost-svn/tools/jam/src/bin.linuxx86/bjam --v2
@@ -65,5 +65,5 @@
EOF`
echo $x
perl -pi -e "s|</body>|$x</body>|" `find doc -name '*.html'`
-scp -r doc example boost_build.png *.html hacking.txt vladimir_prus_at_[hidden]:/home/groups/b/bo/boost/htdocs/boost-build2
-scp ../userman.pdf vladimir_prus_at_[hidden]:/home/groups/b/bo/boost/htdocs/boost-build2/doc
+scp -r doc example boost_build.png *.html hacking.txt vladimir_prus,boost_at_[hidden]:/home/groups/b/bo/boost/htdocs/boost-build2
+scp ../userman.pdf vladimir_prus,boost_at_[hidden]:/home/groups/b/bo/boost/htdocs/boost-build2/doc
Modified: branches/release/tools/build/v2/test/BoostBuild.py
==============================================================================
--- branches/release/tools/build/v2/test/BoostBuild.py (original)
+++ branches/release/tools/build/v2/test/BoostBuild.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -67,7 +67,7 @@
# Detect the host OS.
windows = False
-if os.environ.get('OS','').lower().startswith('windows') or \
+if os.environ.get('OS', '').lower().startswith('windows') or \
os.__dict__.has_key('uname') and \
os.uname()[0].lower().startswith('cygwin'):
windows = True
@@ -88,13 +88,13 @@
suffixes['.lib'] = '.a' # static libs have '.a' suffix with mingw...
suffixes['.obj'] = '.o'
suffixes['.implib'] = '.lib'
- if os.__dict__.has_key('uname') and os.uname()[0] == 'Darwin':
+ if os.__dict__.has_key('uname') and (os.uname()[0] == 'Darwin'):
suffixes['.dll'] = '.dylib'
def re_remove(sequence, regex):
me = re.compile(regex)
- result = filter( lambda x: me.match(x), sequence )
+ result = filter(lambda x: me.match(x), sequence)
if 0 == len(result):
raise ValueError()
for r in result:
@@ -102,7 +102,7 @@
def glob_remove(sequence, pattern):
- result = fnmatch.filter(sequence,pattern)
+ result = fnmatch.filter(sequence, pattern)
if 0 == len(result):
raise ValueError()
for r in result:
@@ -206,7 +206,7 @@
jam_build_dir = ""
if os.name == 'nt':
jam_build_dir = "bin.ntx86"
- elif os.name == 'posix' and os.__dict__.has_key('uname'):
+ elif (os.name == 'posix') and os.__dict__.has_key('uname'):
if os.uname()[0].lower().startswith('cygwin'):
jam_build_dir = "bin.cygwinx86"
if 'TMP' in os.environ and os.environ['TMP'].find('~') != -1:
@@ -238,7 +238,7 @@
else:
raise "Don't know directory where Jam is built for this system: " + os.name
- # Find where jam_src is located. Try for the debug version if it's
+ # Find where jam_src is located. Try for the debug version if it is
# lying around.
dirs = [os.path.join('../../../jam/src', jam_build_dir + '.debug'),
os.path.join('../../../jam/src', jam_build_dir),
@@ -445,7 +445,7 @@
finally:
self.last_build_time_finish = time.time()
- if status != None and _failed(self, status):
+ if (status != None) and _failed(self, status):
expect = ''
if status != 0:
expect = " (expected %d)" % status
@@ -456,7 +456,7 @@
annotation("reason", "error returned by bjam")
self.fail_test(1)
- if not stdout is None and not match(self.stdout(), stdout):
+ if not (stdout is None) and not match(self.stdout(), stdout):
annotation("failure", "Unexpected stdout")
annotation("Expected STDOUT", stdout)
annotation("Actual STDOUT", self.stdout())
@@ -470,7 +470,7 @@
intel_workaround = re.compile("^xi(link|lib): executing.*\n", re.M)
actual_stderr = re.sub(intel_workaround, "", self.stderr())
- if not stderr is None and not match(actual_stderr, stderr):
+ if not (stderr is None) and not match(actual_stderr, stderr):
annotation("failure", "Unexpected stderr")
annotation("Expected STDERR", stderr)
annotation("Actual STDERR", self.stderr())
@@ -480,7 +480,7 @@
if not expected_duration is None:
actual_duration = self.last_build_time_finish - self.last_build_time_start
- if ( actual_duration > expected_duration ):
+ if (actual_duration > expected_duration):
print "Test run lasted %f seconds while it was expected to " \
"finish in under %f seconds." % (actual_duration,
expected_duration)
@@ -493,9 +493,9 @@
def glob_file(self, name):
result = None
- if hasattr(self,'difference'):
+ if hasattr(self, 'difference'):
for f in self.difference.added_files+self.difference.modified_files+self.difference.touched_files:
- if fnmatch.fnmatch(f,name):
+ if fnmatch.fnmatch(f, name):
result = self.native_file_name(f)
break
if not result:
@@ -510,7 +510,7 @@
name = string.replace(name, "$toolset", self.toolset+"*")
name = self.glob_file(name)
openMode = "r"
- if ( binary ):
+ if binary:
openMode += "b"
else:
openMode += "U"
@@ -564,7 +564,7 @@
def expect_addition(self, names):
for name in self.adjust_names(names):
try:
- glob_remove(self.unexpected_difference.added_files,name)
+ glob_remove(self.unexpected_difference.added_files, name)
except:
print "File %s not added as expected" % name
self.fail_test(1)
@@ -575,7 +575,7 @@
def expect_removal(self, names):
for name in self.adjust_names(names):
try:
- glob_remove(self.unexpected_difference.removed_files,name)
+ glob_remove(self.unexpected_difference.removed_files, name)
except:
print "File %s not removed as expected" % name
self.fail_test(1)
@@ -586,13 +586,14 @@
def expect_modification(self, names):
for name in self.adjust_names(names):
try:
- glob_remove(self.unexpected_difference.modified_files,name)
+ glob_remove(self.unexpected_difference.modified_files, name)
except:
print "File %s not modified as expected" % name
self.fail_test(1)
def ignore_modification(self, wildcard):
- self.ignore_elements(self.unexpected_difference.modified_files, wildcard)
+ self.ignore_elements(self.unexpected_difference.modified_files, \
+ wildcard)
def expect_touch(self, names):
d = self.unexpected_difference
@@ -607,7 +608,7 @@
while filesets:
try:
- glob_remove(filesets[-1],name)
+ glob_remove(filesets[-1], name)
break
except ValueError:
filesets.pop()
@@ -646,7 +647,7 @@
self.fail_test(1)
def expect_nothing_more(self):
- # Not totally sure about this change, but I don't see a good
+ # Not totally sure about this change, but I do not see a good
# alternative.
if windows:
self.ignore('*.ilk') # MSVC incremental linking files.
@@ -676,12 +677,12 @@
break
if expected_to_exist and not found:
- annotation( "failure",
+ annotation("failure",
"Did not find expected line:\n%s\nin output:\n%s" %
(expected, content))
self.fail_test(1)
if not expected_to_exist and found:
- annotation( "failure",
+ annotation("failure",
"Found an unexpected line:\n%s\nin output:\n%s" %
(expected, content))
self.fail_test(1)
@@ -712,22 +713,22 @@
matched = False
if exact:
- matched = fnmatch.fnmatch(actual,content)
+ matched = fnmatch.fnmatch(actual, content)
else:
def sorted_(x):
x.sort()
return x
- actual_ = map(lambda x: sorted_(x.split()),actual.splitlines())
- content_ = map(lambda x: sorted_(x.split()),content.splitlines())
+ actual_ = map(lambda x: sorted_(x.split()), actual.splitlines())
+ content_ = map(lambda x: sorted_(x.split()), content.splitlines())
if len(actual_) == len(content_):
matched = map(
- lambda x,y: map(lambda n,p: fnmatch.fnmatch(n,p),x,y),
- actual_, content_ )
+ lambda x, y: map(lambda n, p: fnmatch.fnmatch(n, p), x, y),
+ actual_, content_)
matched = reduce(
- lambda x,y: x and reduce(
- lambda a,b: a and b,
- y ),
- matched )
+ lambda x, y: x and reduce(
+ lambda a, b: a and b,
+ y),
+ matched)
if not matched:
print "Expected:\n"
@@ -744,7 +745,7 @@
open(a, "w").write(actual)
print "DIFFERENCE"
if os.system("diff -u " + e + " " + a):
- print "Unable to compute difference: diff -u %s %s" % (e,a)
+ print "Unable to compute difference: diff -u %s %s" % (e, a)
os.unlink(e)
os.unlink(a)
else:
@@ -793,7 +794,7 @@
tail = "lib" + tail
result = os.path.join(head, tail)
# If we want to use this name in a Jamfile, we better convert \ to /, as
- # otherwise we'd have to quote \.
+ # otherwise we would have to quote \.
result = string.replace(result, "\\", "/")
return result
@@ -873,7 +874,7 @@
return str(self.l)
def __repr__(self):
- return ( self.__module__ + '.List('
+ return (self.__module__ + '.List('
+ repr(string.join(self.l, ' '))
+ ')')
Deleted: branches/release/tools/build/v2/test/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,11 +0,0 @@
-# Copyright 2001 Dave Abrahams
-# 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)
-
-
-# establish a project root right here in the test directory, so that we can test
-# things independently of the boost jambase, etc.
-project-root ;
-
-include check-test-tools.jam ;
-include check-jam-patches.jam ;
Modified: branches/release/tools/build/v2/test/abs_workdir.py
==============================================================================
--- branches/release/tools/build/v2/test/abs_workdir.py (original)
+++ branches/release/tools/build/v2/test/abs_workdir.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,6 +1,6 @@
# Niklaus Giger, 2005-03-15
-# Testing whether we may run a test in a absolute directories
-# There are no tests for temporary directories as this is implictly tested in a lot of other cases
+# Testing whether we may run a test in absolute directories. There are no tests
+# for temporary directories as this is implictly tested in a lot of other cases.
import BoostBuild
import os
@@ -9,10 +9,10 @@
t = BoostBuild.Tester(arguments="pwd", executable="jam", workdir=os.getcwd(),
pass_toolset=0)
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
actions print_pwd { pwd ; }
print_pwd pwd ;
-Always pwd ;
+ALWAYS pwd ;
""")
t.run_build_system(status=0)
@@ -30,5 +30,5 @@
t.run_build_system(status=1, subdir="/must/fail/with/absolute/path",
stderr=None)
-t.cleanup
+t.cleanup()
Modified: branches/release/tools/build/v2/test/absolute_sources.py
==============================================================================
--- branches/release/tools/build/v2/test/absolute_sources.py (original)
+++ branches/release/tools/build/v2/test/absolute_sources.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,72 +1,76 @@
#!/usr/bin/python
-# Copyright 2003, 2004 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)
+# Copyright 2003, 2004 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)
# Test that sources with absolute names are handled OK.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", """
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
path-constant TOP : . ;
""")
-t.write("Jamfile", """
+
+t.write("jamfile.jam", """
local pwd = [ PWD ] ;
ECHO $(pwd) XXXXX ;
exe hello : $(pwd)/hello.cpp $(TOP)/empty.cpp ;
""")
-t.write("hello.cpp", "int main() { return 0; }\n")
+
+t.write("hello.cpp", "int main() {}\n")
+
t.write("empty.cpp", "\n")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
-# Test a contrived case. There, absolute name is used in
-# standalone project (not Jamfile). Moreover, the target with
-# absolute name is returned by 'alias' and used from other project.
-t.write("a.cpp", """
-int main()
-{
- return 0;
-}
-
+# Test a contrived case. There, absolute name is used in a standalone project
+# (not Jamfile). Moreover, the target with an absolute name is returned by
+# 'alias' and used from another project.
+t.write("a.cpp", """
+int main() {}
""")
-t.write("Jamfile", """
-exe a : /standalone//a ;
+t.write("jamfile.jam", """
+exe a : /standalone//a ;
""")
-t.write("project-root.jam", """
-import standalone ;
+t.write("jamroot.jam", """
+import standalone ;
""")
-t.write("standalone.jam", """
+t.write("standalone.jam", """
import project ;
project.initialize $(__name__) ;
project standalone ;
local pwd = [ PWD ] ;
-
alias a : $(pwd)/a.cpp ;
-
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
-# Test absolute path in target ids
+# Test absolute path in target ids.
t.rm(".")
-t.write("d1/project-root.jam", "")
-t.write("d1/Jamfile", """
+
+t.write("d1/jamroot.jam", "")
+
+t.write("d1/jamfile.jam", """
exe a : a.cpp ;
""")
+
t.write("d1/a.cpp", """
-int main() { return 0; }
+int main() {}
""")
-t.write("d2/project-root.jam", "")
-t.write("d2/Jamfile", """
+
+t.write("d2/jamroot.jam", "")
+
+t.write("d2/jamfile.jam", """
local pwd = [ PWD ] ;
alias x : $(pwd)/../d1//a ;
""")
Modified: branches/release/tools/build/v2/test/alias.py
==============================================================================
--- branches/release/tools/build/v2/test/alias.py (original)
+++ branches/release/tools/build/v2/test/alias.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,7 +5,7 @@
# 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)
-from BoostBuild import Tester, List
+import BoostBuild
################################################################################
@@ -19,7 +19,7 @@
"""Basic alias rule test.
"""
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe a : a.cpp ;
exe b : b.cpp ;
exe c : c.cpp ;
@@ -31,7 +31,7 @@
exe hello : hello.cpp src ;
""")
- t.write("a.cpp", "int main() { return 0; }\n")
+ t.write("a.cpp", "int main() {}\n")
t.copy("a.cpp", "b.cpp")
t.copy("a.cpp", "c.cpp")
t.copy("a.cpp", "hello.cpp")
@@ -39,19 +39,20 @@
# Check that targets to which "bin1" refers are updated, and only those.
t.run_build_system("bin1")
- t.expect_addition(List("bin/$toolset/debug/") * "a.exe a.obj")
+ t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "a.exe a.obj")
t.expect_nothing_more()
# Try again with "bin2"
t.run_build_system("bin2")
- t.expect_addition(List("bin/$toolset/debug/") * "b.exe b.obj")
+ t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "b.exe b.obj")
t.expect_nothing_more()
# Try building everything, making sure 'hello' target is created.
t.run_build_system()
- t.expect_addition(List("bin/$toolset/debug/") * "hello.exe hello.obj")
+ t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * \
+ "hello.exe hello.obj")
t.expect_addition("bin/$toolset/debug/s.obj")
- t.expect_addition(List("bin/$toolset/debug/") * "c.exe c.obj")
+ t.expect_addition(BoostBuild.List("bin/$toolset/debug/") * "c.exe c.obj")
t.expect_nothing_more()
@@ -68,7 +69,7 @@
anywhere in the source.
"""
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
lib l : l.cpp : : : <define>WANT_MAIN ;
alias la : l ;
exe main : main.cpp la ;
@@ -84,7 +85,7 @@
t.write("main.cpp", """
#ifdef WANT_MAIN
-int main() { return 0; }
+int main() {}
#endif
""")
@@ -98,7 +99,7 @@
#
################################################################################
-t = Tester()
+t = BoostBuild.Tester()
test_alias_rule(t)
test_alias_source_usage_requirements(t)
Modified: branches/release/tools/build/v2/test/alternatives.py
==============================================================================
--- branches/release/tools/build/v2/test/alternatives.py (original)
+++ branches/release/tools/build/v2/test/alternatives.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,42 +1,44 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2003, 2006 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2003, 2006 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)
# Test main target alternatives.
-from BoostBuild import Tester
-from string import find
-t = Tester()
+import BoostBuild
+import string
+t = BoostBuild.Tester()
# Test that basic alternatives selection works.
-t.write("project-root.jam", " ")
-t.write("Jamfile", """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
exe a : a_empty.cpp ;
exe a : a.cpp : <variant>release ;
""")
+
t.write("a_empty.cpp", "")
-t.write("a.cpp", "int main() { return 0; }\n")
+
+t.write("a.cpp", "int main() {}\n")
t.run_build_system("release")
+
t.expect_addition("bin/$toolset/release/a.exe")
-# Test that alternative selection works for ordinary
-# properties, in particular user-defined.
-t.write("project-root.jam", " ")
-t.write("Jamfile", """
+# Test that alternative selection works for ordinary properties, in particular
+# user-defined.
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
import feature ;
feature.feature X : off on : propagated ;
-
exe a : b.cpp ;
exe a : a.cpp : <X>on ;
""")
-t.write("b.cpp", "int main() { return 0; }\n")
+t.write("b.cpp", "int main() {}\n")
t.rm("bin")
@@ -48,11 +50,8 @@
t.rm("bin")
-# Test that everything works ok even with default
-# build.
-
-t.write("Jamfile", """
-
+# Test that everything works ok even with default build.
+t.write("jamfile.jam", """
exe a : a_empty.cpp : <variant>release ;
exe a : a.cpp : <variant>debug ;
""")
@@ -60,12 +59,10 @@
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
-# Test that only properties which are in build request
-# matters when selection alternative. IOW, alternative
-# with <variant>release is better than one with
+# Test that only properties which are in build request matter for alternative
+# selection. IOW, alternative with <variant>release is better than one with
# <variant>debug when building release version.
-t.write("Jamfile", """
-
+t.write("jamfile.jam", """
exe a : a_empty.cpp : <variant>debug ;
exe a : a.cpp : <variant>release ;
""")
@@ -73,10 +70,9 @@
t.run_build_system("release")
t.expect_addition("bin/$toolset/release/a.exe")
-# Test that free properties do not matter. We really don't
-# want <cxxflags> property in build request to affect
-# alternative selection.
-t.write("Jamfile", """
+# Test that free properties do not matter. We really do not want <cxxflags>
+# property in build request to affect alternative selection.
+t.write("jamfile.jam", """
exe a : a_empty.cpp : <variant>debug <define>FOO <include>BAR ;
exe a : a.cpp : <variant>release ;
""")
@@ -85,28 +81,26 @@
t.run_build_system("release define=FOO")
t.expect_addition("bin/$toolset/release/a.exe")
-# Test that abibuity is reported correctly
-t.write("Jamfile", """
+# Test that ambiguity is reported correctly.
+t.write("jamfile.jam", """
exe a : a_empty.cpp ;
exe a : a.cpp ;
""")
t.run_build_system("--no-error-backtrace", status=None)
-t.fail_test(find(t.stdout(), "No best alternative") == -1)
+t.fail_test(string.find(t.stdout(), "No best alternative") == -1)
-# Another ambiguity test: two matches properties in one alternative are
-# neither better nor worse than a single one in another alternative.
-t.write("Jamfile", """
+# Another ambiguity test: two matches properties in one alternative are neither
+# better nor worse than a single one in another alternative.
+t.write("jamfile.jam", """
exe a : a_empty.cpp : <optimization>off <profiling>off ;
exe a : a.cpp : <debug-symbols>on ;
""")
t.run_build_system("--no-error-backtrace", status=None)
-t.fail_test(find(t.stdout(), "No best alternative") == -1)
-
-
+t.fail_test(string.find(t.stdout(), "No best alternative") == -1)
-# Test that we can have alternative without sources
-t.write("Jamfile", """
+# Test that we can have alternative without sources.
+t.write("jamfile.jam", """
alias specific-sources ;
import feature ;
feature.extend os : MAGIC ;
@@ -116,5 +110,4 @@
t.rm("bin")
t.run_build_system()
-
-t.cleanup()
+t.cleanup()
Modified: branches/release/tools/build/v2/test/bad_dirname.py
==============================================================================
--- branches/release/tools/build/v2/test/bad_dirname.py (original)
+++ branches/release/tools/build/v2/test/bad_dirname.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,23 +1,22 @@
#!/usr/bin/python
-# 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)
+# 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)
-# Regression test: when directory of project root contained regex metacharacters,
-# Boost.Build failed to work. Bug reported by Michael Stevens
+# Regression test: when directory of project root contained regex
+# metacharacters, Boost.Build failed to work. Bug reported by Michael Stevens.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("bad[abc]dirname/Jamfile", """
+t.write("bad[abc]dirname/jamfile.jam", """
""")
-t.write("bad[abc]dirname/project-root.jam", """
+t.write("bad[abc]dirname/jamroot.jam", """
""")
t.run_build_system(subdir="bad[abc]dirname")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/boostbook.py
==============================================================================
--- branches/release/tools/build/v2/test/boostbook.py (original)
+++ branches/release/tools/build/v2/test/boostbook.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,16 +1,16 @@
#!/usr/bin/python
-# Copyright 2004, 2006 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)
+# Copyright 2004, 2006 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)
-from BoostBuild import Tester, List
+import BoostBuild
import string
-# Create a temporary working directory
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("boostbook")
+
# For some reason, the messages are sent to stderr.
t.run_build_system()
t.fail_test(string.find(t.stdout(), """Writing boost/A.html for refentry(boost.A)
Deleted: branches/release/tools/build/v2/test/boostbook/Jamroot
==============================================================================
--- branches/release/tools/build/v2/test/boostbook/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,3 +0,0 @@
-
-boostbook docs : docs.xml autodoc ;
-doxygen autodoc : [ glob *.hpp ] ;
Modified: branches/release/tools/build/v2/test/build_dir.py
==============================================================================
--- branches/release/tools/build/v2/test/build_dir.py (original)
+++ branches/release/tools/build/v2/test/build_dir.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,55 +1,52 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2005 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2005 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)
-# Test that we can change build directory using
-# the 'build-dir' project attribute.
+# Test that we can change build directory using the 'build-dir' project
+# attribute.
-from BoostBuild import Tester
+import BoostBuild
import string
import os
-t = Tester()
+t = BoostBuild.Tester()
-# Test that top-level project can affect build dir
-t.write("project-root.jam", "import gcc ; ")
-t.write("Jamfile", """
-project
- : build-dir build
- ;
-
+# Test that top-level project can affect build dir.
+t.write("jamroot.jam", "import gcc ;")
+t.write("jamfile.jam", """
+project : build-dir build ;
exe a : a.cpp ;
-build-project src ;
+build-project src ;
""")
-t.write("a.cpp", "int main() { return 0; }\n")
-t.write("src/Jamfile", "exe b : b.cpp ; ")
-t.write("src/b.cpp", "int main() { return 0; }\n")
+t.write("a.cpp", "int main() {}\n")
+
+t.write("src/jamfile.jam", "exe b : b.cpp ; ")
+
+t.write("src/b.cpp", "int main() {}\n")
t.run_build_system()
t.expect_addition(["build/$toolset/debug/a.exe",
"build/src/$toolset/debug/b.exe"])
-
-# Test that building from child projects work
+
+# Test that building from child projects work.
t.run_build_system(subdir='src')
-t.expect_nothing_more()
-
-# Test that project can override build dir
-t.write("Jamfile", """
+t.expect_nothing_more()
+
+# Test that project can override build dir.
+t.write("jamfile.jam", """
exe a : a.cpp ;
build-project src ;
-""")
+""")
-t.write("src/Jamfile", """
-project
- : build-dir build
- ;
-exe b : b.cpp ;
+t.write("src/jamfile.jam", """
+project : build-dir build ;
+exe b : b.cpp ;
""")
t.run_build_system()
@@ -58,46 +55,44 @@
# Now test the '--build-dir' option.
t.rm(".")
-t.write("Jamroot", "")
+t.write("jamroot.jam", "")
# Test that we get an error when no project id is specified.
t.run_build_system("--build-dir=foo")
t.fail_test(string.find(t.stdout(),
"warning: the --build-dir option will be ignored") == -1)
-t.write("Jamroot", """
+t.write("jamroot.jam", """
project foo ;
exe a : a.cpp ;
build-project sub ;
""")
-t.write("a.cpp", "int main() { return 0; }\n")
-t.write("sub/Jamfile", "exe b : b.cpp ;\n")
-t.write("sub/b.cpp", "int main() { return 0; }\n")
+t.write("a.cpp", "int main() {}\n")
+t.write("sub/jamfile.jam", "exe b : b.cpp ;\n")
+t.write("sub/b.cpp", "int main() {}\n")
t.run_build_system("--build-dir=build")
t.expect_addition(["build/foo/$toolset/debug/a.exe",
"build/foo/sub/$toolset/debug/b.exe"])
-t.write("Jamroot", """
+t.write("jamroot.jam", """
project foo : build-dir bin.v2 ;
exe a : a.cpp ;
build-project sub ;
""")
t.run_build_system("--build-dir=build")
-t.expect_addition(["build/foo/bin.v2/$toolset/debug/a.exe",
+t.expect_addition(["build/foo/bin.v2/$toolset/debug/a.exe",
"build/foo/bin.v2/sub/$toolset/debug/b.exe"])
-# Try building in subdir. We expect that the entire build
-# tree with be in 'sub/build'. Today, I'm not sure if
-# this is what the user expects, but let it be.
+# Try building in subdir. We expect that the entire build tree with be in
+# 'sub/build'. Today, I am not sure if this is what the user expects, but let it
+# be.
t.rm('build')
t.run_build_system("--build-dir=build", subdir="sub")
t.expect_addition(["sub/build/foo/bin.v2/sub/$toolset/debug/b.exe"])
-
-
-t.write("Jamroot", """
+t.write("jamroot.jam", """
project foo : build-dir %s ;
exe a : a.cpp ;
build-project sub ;
@@ -105,9 +100,6 @@
t.run_build_system("--build-dir=build", status=1)
t.fail_test(string.find(t.stdout(),
- "Absolute directory specified via 'build-dir' project attribute") == -1)
-
-
-
+ "Absolute directory specified via 'build-dir' project attribute") == -1)
-t.cleanup()
+t.cleanup()
Modified: branches/release/tools/build/v2/test/build_file.py
==============================================================================
--- branches/release/tools/build/v2/test/build_file.py (original)
+++ branches/release/tools/build/v2/test/build_file.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -22,18 +22,18 @@
def test_building_file_from_specific_project():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
build-project sub ;
""")
- t.write("hello.cpp", "int main() { return 0; }")
- t.write("sub/Jamfile.jam", """
+ t.write("hello.cpp", "int main() {}")
+ t.write("sub/jamfile.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
exe sub : hello.cpp ;
""")
- t.write("sub/hello.cpp", "int main() { return 0; }")
+ t.write("sub/hello.cpp", "int main() {}")
t.run_build_system("sub " + t.adjust_suffix("hello.obj"))
t.expect_output_line("*depends on itself*", False)
@@ -53,14 +53,14 @@
def test_building_file_from_specific_target():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello1 : hello1.cpp ;
exe hello2 : hello2.cpp ;
exe hello3 : hello3.cpp ;
""")
- t.write("hello1.cpp", "int main() { return 0; }")
- t.write("hello2.cpp", "int main() { return 0; }")
- t.write("hello3.cpp", "int main() { return 0; }")
+ t.write("hello1.cpp", "int main() {}")
+ t.write("hello2.cpp", "int main() {}")
+ t.write("hello3.cpp", "int main() {}")
t.run_build_system("hello1 " + t.adjust_suffix("hello1.obj"))
t.expect_addition("bin/$toolset/debug/hello1.obj")
@@ -79,17 +79,17 @@
def test_building_missing_file_from_specific_target():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello1 : hello1.cpp ;
exe hello2 : hello2.cpp ;
exe hello3 : hello3.cpp ;
""")
- t.write("hello1.cpp", "int main() { return 0; }")
- t.write("hello2.cpp", "int main() { return 0; }")
- t.write("hello3.cpp", "int main() { return 0; }")
+ t.write("hello1.cpp", "int main() {}")
+ t.write("hello2.cpp", "int main() {}")
+ t.write("hello3.cpp", "int main() {}")
t.run_build_system("hello1 " + t.adjust_suffix("hello2.obj"), status=1)
- t.expect_output_line("don't know how to make*hello2.obj")
+ t.expect_output_line("don't know how to make*" + t.adjust_suffix("hello2.obj"))
t.expect_nothing_more()
t.cleanup()
@@ -105,14 +105,14 @@
def test_building_multiple_files_with_different_names():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello1 : hello1.cpp ;
exe hello2 : hello2.cpp ;
exe hello3 : hello3.cpp ;
""")
- t.write("hello1.cpp", "int main() { return 0; }")
- t.write("hello2.cpp", "int main() { return 0; }")
- t.write("hello3.cpp", "int main() { return 0; }")
+ t.write("hello1.cpp", "int main() {}")
+ t.write("hello2.cpp", "int main() {}")
+ t.write("hello3.cpp", "int main() {}")
t.run_build_system(
t.adjust_suffix("hello1.obj") + " " +
@@ -134,18 +134,18 @@
def test_building_multiple_files_with_the_same_name():
t = BoostBuild.Tester()
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
build-project sub ;
""")
- t.write("hello.cpp", "int main() { return 0; }")
- t.write("sub/Jamfile.jam", """
+ t.write("hello.cpp", "int main() {}")
+ t.write("sub/jamfile.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
exe sub : hello.cpp ;
""")
- t.write("sub/hello.cpp", "int main() { return 0; }")
+ t.write("sub/hello.cpp", "int main() {}")
t.run_build_system(t.adjust_suffix("hello.obj"))
t.expect_output_line("*depends on itself*", False)
Modified: branches/release/tools/build/v2/test/build_no.py
==============================================================================
--- branches/release/tools/build/v2/test/build_no.py (original)
+++ branches/release/tools/build/v2/test/build_no.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,28 +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)
+# 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)
-# Tests that <build>no property prevents a target from being built.
-from BoostBuild import Tester, List
-import string
+# Tests that <build>no property prevents a target from being built.
+import BoostBuild
-# Create a temporary working directory
-t = Tester()
+t = BoostBuild.Tester()
-# Create the needed files
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe hello : hello.cpp : <variant>debug:<build>no ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() {}
""")
t.run_build_system()
@@ -31,5 +25,4 @@
t.run_build_system("release")
t.expect_addition("bin/$toolset/release/hello.exe")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/c_file.py
==============================================================================
--- branches/release/tools/build/v2/test/c_file.py (original)
+++ branches/release/tools/build/v2/test/c_file.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,26 +1,27 @@
#!/usr/bin/python
-# 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)
+# 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)
-# Test that C files are compiled by C compiler
-from BoostBuild import Tester, List
+# Test that C files are compiled by a C compiler.
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "")
-t.write("Jamfile", """
-project ;
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
+project ;
exe hello : hello.cpp a.c ;
""")
+
t.write("hello.cpp", """
extern "C" int foo();
int main() { return foo(); }
""")
+
t.write("a.c", """
-// This won't compile unless in C mode
+// This will not compile unless in C mode.
int foo()
{
int new = 0;
@@ -28,6 +29,7 @@
return new;
}
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
Modified: branches/release/tools/build/v2/test/chain.py
==============================================================================
--- branches/release/tools/build/v2/test/chain.py (original)
+++ branches/release/tools/build/v2/test/chain.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,38 +5,33 @@
# 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)
-# This tests that
-# 1) the 'make' correctly assigns types to produced targets
-# 2) than if 'make' create targets of type CPP, they are
-# correctly used (there was a bug with it).
-
-from BoostBuild import Tester
-t = Tester()
-
-# In order to correctly link this app, 'b.cpp', created by 'make'
-# rule, should be compiled.
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", r'''
-rule create ( dst : src * : properties * )
-{
- # hack to echo a space under NT
- setup on $(dst) = "set x=int main(){ return 0; }" ;
-}
+# This tests that :
+# 1) the 'make' correctly assigns types to produced targets
+# 2) if 'make' creates targets of type CPP, they are correctly used.
+
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+# In order to correctly link this app, 'b.cpp', created by a 'make' rule, should
+# be compiled.
+t.write("jamroot.jam", "import gcc ;")
+
+t.write("jamfile.jam", r'''
import modules ;
if [ modules.peek : NT ]
{
actions create
{
- $(setup)
- echo %x% > $(<)
+ echo int main() {} > $(<)
}
}
else
{
actions create
{
- echo "int main(){ return 0; }" > $(<)
+ echo "int main() {}" > $(<)
}
}
@@ -44,13 +39,14 @@
exe a : l dummy.cpp ;
-# needs to be static lib for Windows - main cannot appear in DLL
+# Needs to be static lib for Windows - main() cannot appear in DLL.
static-lib l : a.cpp b.cpp ;
make b.cpp : : create ;
-
''')
+
t.write("a.cpp", "")
+
t.write("dummy.cpp", "// msvc needs at least one object file\n")
t.run_build_system()
Modified: branches/release/tools/build/v2/test/clean.py
==============================================================================
--- branches/release/tools/build/v2/test/clean.py (original)
+++ branches/release/tools/build/v2/test/clean.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,21 +5,19 @@
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("a.cpp", """
+t.write("a.cpp", """
int main() {}
-
""")
-t.write("Jamroot", """
-exe a : a.cpp sub1//sub1 sub2//sub2 sub3//sub3 ;
+t.write("jamroot.jam", """
+exe a : a.cpp sub1//sub1 sub2//sub2 sub3//sub3 ;
""")
-t.write("sub1/Jamfile", """
+t.write("sub1/jamfile.jam", """
lib sub1 : sub1.cpp sub1_2 ../sub2//sub2 ;
lib sub1_2 : sub1_2.cpp ;
""")
@@ -29,7 +27,6 @@
__declspec(dllexport)
#endif
void sub1() {}
-
""")
t.write("sub1/sub1_2.cpp", """
@@ -37,12 +34,10 @@
__declspec(dllexport)
#endif
void sub1() {}
-
""")
-
-t.write("sub2/Jamfile", """
-lib sub2 : sub2.cpp ;
+t.write("sub2/jamfile.jam", """
+lib sub2 : sub2.cpp ;
""")
t.write("sub2/sub2.cpp", """
@@ -50,11 +45,10 @@
__declspec(dllexport)
#endif
void sub2() {}
-
""")
-t.write("sub3/Jamroot", """
-lib sub3 : sub3.cpp ;
+t.write("sub3/jamroot.jam", """
+lib sub3 : sub3.cpp ;
""")
t.write("sub3/sub3.cpp", """
@@ -62,11 +56,9 @@
__declspec(dllexport)
#endif
void sub3() {}
-
""")
-
-# The 'clean' should not remove files under separate Jamroot.
+# The 'clean' should not remove files under separate jamroot.jam.
t.run_build_system()
t.run_build_system("--clean")
t.expect_removal("bin/$toolset/debug/a.obj")
@@ -77,15 +69,14 @@
# The 'clean-all' removes everything it can reach.
t.run_build_system()
-t.run_build_system("--clean")
+t.run_build_system("--clean-all")
t.expect_removal("bin/$toolset/debug/a.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1.obj")
t.expect_removal("sub1/bin/$toolset/debug/sub1_2.obj")
t.expect_removal("sub2/bin/$toolset/debug/sub2.obj")
t.expect_nothing("sub3/bin/$toolset/debug/sub3.obj")
-# The 'clean' together with project target removes
-# only under that probject
+# The 'clean' together with project target removes only under that project.
t.run_build_system()
t.run_build_system("sub1 --clean")
t.expect_nothing("bin/$toolset/debug/a.obj")
@@ -94,7 +85,7 @@
t.expect_nothing("sub2/bin/$toolset/debug/sub2.obj")
t.expect_nothing("sub3/bin/$toolset/debug/sub3.obj")
-# And clean-all removes everything.
+# And 'clean-all' removes everything.
t.run_build_system()
t.run_build_system("sub1 --clean-all")
t.expect_nothing("bin/$toolset/debug/a.obj")
@@ -103,9 +94,8 @@
t.expect_removal("sub2/bin/$toolset/debug/sub2.obj")
t.expect_nothing("sub3/bin/$toolset/debug/sub3.obj")
-# If main target is explicitly named, we should not remove
-# files from other targets.
-
+# If main target is explicitly named, we should not remove files from other
+# targets.
t.run_build_system()
t.run_build_system("sub1//sub1 --clean")
t.expect_removal("sub1/bin/$toolset/debug/sub1.obj")
@@ -113,18 +103,14 @@
t.expect_nothing("sub2/bin/$toolset/debug/sub2.obj")
t.expect_nothing("sub3/bin/$toolset/debug/sub3.obj")
-
-# Regression test: sources of the 'cast' rule were mistakenly
-# deleted.
+# Regression test: sources of the 'cast' rule were mistakenly deleted.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
import cast ;
cast a cpp : a.h ;
""")
t.write("a.h", "")
-
t.run_build_system("--clean")
t.expect_nothing("a.h")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/composite.py
==============================================================================
--- branches/release/tools/build/v2/test/composite.py (original)
+++ branches/release/tools/build/v2/test/composite.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,26 +4,22 @@
# 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)
-# Test that composite properties are handled correctly.
-from BoostBuild import Tester, List
+# Test that composite properties are handled correctly.
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
exe hello : hello.cpp : <variant>release ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() {}
""")
t.run_build_system()
t.expect_addition("bin/$toolset/release/hello.exe")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/conditionals.py
==============================================================================
--- branches/release/tools/build/v2/test/conditionals.py (original)
+++ branches/release/tools/build/v2/test/conditionals.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -15,18 +15,18 @@
# define.
t.write("a.cpp", """
#ifdef STATIC
-int main() { return 0; }
+int main() {}
#endif
""")
# Test conditionals in target requirements.
-t.write("Jamroot.jam", "exe a : a.cpp : <link>static:<define>STATIC ;")
+t.write("jamroot.jam", "exe a : a.cpp : <link>static:<define>STATIC ;")
t.run_build_system("link=static")
t.expect_addition("bin/$toolset/debug/link-static/a.exe")
t.rm("bin")
# Test conditionals in project requirements.
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
project : requirements <link>static:<define>STATIC ;
exe a : a.cpp ;
""")
@@ -36,7 +36,7 @@
# Regression test for a bug found by Ali Azarbayejani. Conditionals inside usage
# requirement were not being evaluated.
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
lib l : l.cpp : : : <link>static:<define>STATIC ;
exe a : a.cpp l ;
""")
Modified: branches/release/tools/build/v2/test/conditionals2.py
==============================================================================
--- branches/release/tools/build/v2/test/conditionals2.py (original)
+++ branches/release/tools/build/v2/test/conditionals2.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,9 +4,9 @@
# 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)
-# Regression test: it was possible that due to evaluation of conditional
-# requirements, two different values of non-free features were present in
-# property set.
+# Regression test: it was possible that due to evaluation of conditional
+# requirements, two different values of non-free features were present in a
+# property set.
import BoostBuild
@@ -14,7 +14,7 @@
t.write("a.cpp", "")
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
import feature ;
import common ;
Modified: branches/release/tools/build/v2/test/conditionals3.py
==============================================================================
--- branches/release/tools/build/v2/test/conditionals3.py (original)
+++ branches/release/tools/build/v2/test/conditionals3.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,23 +4,23 @@
# 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)
-# Test that conditional properties work, even if property is free, and value
-# includes a colon.
+# Test that conditional properties work, even if property is free, and value
+# includes a colon.
import BoostBuild
t = BoostBuild.Tester()
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
exe hello : hello.cpp : <variant>debug:<define>CLASS=Foo::Bar ;
""")
+
t.write("hello.cpp", """
namespace Foo { class Bar { } ; }
int main()
{
CLASS c;
c; // Disables the unused variable warning.
- return 0;
}
""")
Modified: branches/release/tools/build/v2/test/conditionals_multiple.py
==============================================================================
--- branches/release/tools/build/v2/test/conditionals_multiple.py (original)
+++ branches/release/tools/build/v2/test/conditionals_multiple.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -21,7 +21,8 @@
"""Basic tests for properties conditioned on multiple other properties.
"""
- t = BoostBuild.Tester("--ignore-regular-config toolset=testToolset", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("--ignore-regular-config toolset=testToolset",
+ pass_toolset=False, use_test_config=False)
t.write("testToolset.jam", """
import feature ;
@@ -29,7 +30,7 @@
rule init ( ) { }
""")
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import feature ;
import notfile ;
import toolset ;
@@ -134,7 +135,7 @@
rule init ( version ? ) { }
""" % {"toolset": toolset})
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import feature ;
import notfile ;
import toolset ;
Modified: branches/release/tools/build/v2/test/configuration.py
==============================================================================
--- branches/release/tools/build/v2/test/configuration.py (original)
+++ branches/release/tools/build/v2/test/configuration.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -23,7 +23,8 @@
path handling is tested.
"""
- t = BoostBuild.Tester("--debug-configuration", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("--debug-configuration", pass_toolset=False,
+ use_test_config=False)
implicitConfigLoadMessage = "notice: Loading user-config configuration file: *"
explicitConfigLoadMessage = "notice: Loading explicitly specified user configuration file:"
@@ -46,7 +47,7 @@
feature.extend toolset : %s ;
rule init ( ) { }
""" % toolsetName )
- t.write("Jamroot.jam", "using %s ;" % toolsetName)
+ t.write("jamroot.jam", "using %s ;" % toolsetName)
t.run_build_system()
t.expect_output_line(explicitConfigLoadMessage, False)
Modified: branches/release/tools/build/v2/test/core_d12.py
==============================================================================
--- branches/release/tools/build/v2/test/core_d12.py (original)
+++ branches/release/tools/build/v2/test/core_d12.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,8 +1,8 @@
#!/usr/bin/python
-# Copyright 2002, 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)
+# Copyright 2002, 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)
# This tests correct handling of "-d1" and "-d2" options.
@@ -11,14 +11,9 @@
t = BoostBuild.Tester(pass_toolset=0)
t.write("file.jam", """
-actions a {
-}
-
-actions quietly b {
-}
-
+actions a { }
+actions quietly b { }
ALWAYS all ;
-
a all ;
b all ;
""")
Modified: branches/release/tools/build/v2/test/core_delete_module.py
==============================================================================
--- branches/release/tools/build/v2/test/core_delete_module.py (original)
+++ branches/release/tools/build/v2/test/core_delete_module.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,8 +1,8 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# 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)
+# Copyright 2003 Dave Abrahams
+# 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)
# This tests the facilities for deleting modules.
@@ -28,12 +28,12 @@
{
EXIT DELETE_MODULE failed to kill foo's variables ;
}
-
+
rule bar { }
var = x y ;
-
+
DELETE_MODULE foo ;
-
+
if $(var)
{
EXIT internal DELETE_MODULE failed to kill foo's variables ;
Modified: branches/release/tools/build/v2/test/core_dependencies.py
==============================================================================
--- branches/release/tools/build/v2/test/core_dependencies.py (original)
+++ branches/release/tools/build/v2/test/core_dependencies.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,11 +4,12 @@
# 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)
-# This tests correct handling of dependencies, specifically, on
-# generated sources, and from generated sources.
+# This tests correct handling of dependencies, specifically, on generated
+# sources, and from generated sources.
import BoostBuild
-from string import find
+
+import string
t = BoostBuild.Tester(pass_toolset=0)
@@ -37,20 +38,22 @@
HDRSCAN on b foo.h bar.h = \"#include <(.*)>\" ;
"""
-# This creates 'a' which depends on 'b', which is generated.
-# The generated 'b' contains '#include <foo.h>' and no rules for
-# foo.h are given. The system should error out on the first invocation.
+# This creates 'a' which depends on 'b', which is generated. The generated 'b'
+# contains '#include <foo.h>' and no rules for foo.h are given. The system
+# should error out on the first invocation.
t.run_build_system("-f-", stdin=code)
-t.fail_test(find(t.stdout(), "...skipped a for lack of foo.h...") == -1)
+t.fail_test(string.find(t.stdout(), "...skipped a for lack of foo.h...") == -1)
t.rm('b')
-# Now test that if target 'c' also depends on 'b', then it won't be built, as well.
-t.run_build_system("-f-", stdin=code + " copy c : b ; DEPENDS c : b ; DEPENDS all : c ; ")
-t.fail_test(find(t.stdout(), "...skipped c for lack of foo.h...") == -1)
+# Now test that if target 'c' also depends on 'b', then it will not be built, as
+# well.
+t.run_build_system("-f-", stdin=code + " copy c : b ; DEPENDS c : b ; DEPENDS all : c ; ")
+t.fail_test(string.find(t.stdout(), "...skipped c for lack of foo.h...") == -1)
-# Now add a rule for creating foo.h
t.rm('b')
+
+# Now add a rule for creating foo.h.
code += """
actions create-foo
{
@@ -60,36 +63,35 @@
"""
t.run_build_system("-f-", stdin=code)
-# Run two times, adding explicit dependency from all to foo.h at
-# the beginning and at the end, to make sure that foo.h is generated before
-# 'a' in all cases.
-
-def mk_right_order_func(s1, s2):
- def right_order(s):
- n1 = find(s, s1)
- n2 = find(s, s2)
- return n1 != -1 and n2 != -1 and n1 < n2
- return right_order
+# Run two times, adding explicit dependency from all to foo.h at the beginning
+# and at the end, to make sure that foo.h is generated before 'a' in all cases.
+
+def mk_correct_order_func(s1, s2):
+ def correct_order(s):
+ n1 = string.find(s, s1)
+ n2 = string.find(s, s2)
+ return ( n1 != -1 ) and ( n2 != -1 ) and ( n1 < n2 )
+ return correct_order
-right_order = mk_right_order_func("create-foo", "copy a")
+correct_order = mk_correct_order_func("create-foo", "copy a")
t.rm(["a", "b", "foo.h"])
t.run_build_system("-d+2 -f-", stdin=code + " DEPENDS all : foo.h ;")
-t.fail_test(not right_order(t.stdout()))
+t.fail_test(not correct_order(t.stdout()))
t.rm(["a", "b", "foo.h"])
t.run_build_system("-d+2 -f-", stdin=" DEPENDS all : foo.h ; " + code)
-t.fail_test(not right_order(t.stdout()))
+t.fail_test(not correct_order(t.stdout()))
-# Now foo.h exists. Test include from b -> foo.h -> bar.h -> biz.h
-# b and foo.h already have updating actions.
+# Now foo.h exists. Test include from b -> foo.h -> bar.h -> biz.h. b and foo.h
+# already have updating actions.
t.rm(["a", "b"])
t.write("foo.h", "#include <bar.h>")
t.write("bar.h", "#include <biz.h>")
t.run_build_system("-d+2 -f-", stdin=code)
-t.fail_test(find(t.stdout(), "...skipped a for lack of biz.h...") == -1)
+t.fail_test(string.find(t.stdout(), "...skipped a for lack of biz.h...") == -1)
-# Add an action for biz.h
+# Add an action for biz.h.
code += """
actions create-biz
{
@@ -97,15 +99,15 @@
}
create-biz biz.h ;
"""
+
t.rm(["b"])
-right_order = mk_right_order_func("create-biz", "copy a")
+correct_order = mk_correct_order_func("create-biz", "copy a")
t.run_build_system("-d+2 -f-", stdin=code + " DEPENDS all : biz.h ;")
-t.fail_test(not right_order(t.stdout()))
+t.fail_test(not correct_order(t.stdout()))
t.rm(["a", "biz.h"])
t.run_build_system("-d+2 -f-", stdin=" DEPENDS all : biz.h ; " + code)
-t.fail_test(not right_order(t.stdout()))
-
+t.fail_test(not correct_order(t.stdout()))
t.write("a", "")
@@ -147,10 +149,9 @@
INCLUDES $(1) : d ;
}
"""
-right_order = mk_right_order_func("create-d", "copy main")
-t.run_build_system("-d2 -f-", stdin=code)
-t.fail_test(not right_order(t.stdout()))
-
+correct_order = mk_correct_order_func("create-d", "copy main")
+t.run_build_system("-d2 -f-", stdin=code)
+t.fail_test(not correct_order(t.stdout()))
t.cleanup()
Modified: branches/release/tools/build/v2/test/core_import_module.py
==============================================================================
--- branches/release/tools/build/v2/test/core_import_module.py (original)
+++ branches/release/tools/build/v2/test/core_import_module.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,24 +1,23 @@
#!/usr/bin/python
-# 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)
+# 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)
-from BoostBuild import Tester, List
+import BoostBuild
-
-t = Tester(pass_toolset=0)
-
-# Test that
+t = BoostBuild.Tester(pass_toolset=0)
t.write("code", """
-module a {
+module a
+{
rule r1 ( )
{
ECHO R1 ;
}
}
-module a2 {
+module a2
+{
rule r2 ( )
{
ECHO R2 ;
@@ -26,9 +25,9 @@
}
IMPORT a2 : r2 : : a2.r2 ;
-module b {
+module b
+{
IMPORT_MODULE a : b ;
-
rule test
{
# Call rule visible via IMPORT_MODULE
@@ -41,19 +40,19 @@
IMPORT b : test : : test ;
test ;
-module c {
+module c
+{
rule test
{
ECHO CTEST ;
}
-}
+}
IMPORT_MODULE c : ;
c.test ;
actions do-nothing { }
do-nothing all ;
-
""")
t.run_build_system("-fcode", stdout="""R1
Modified: branches/release/tools/build/v2/test/core_modifiers.py
==============================================================================
--- branches/release/tools/build/v2/test/core_modifiers.py (original)
+++ branches/release/tools/build/v2/test/core_modifiers.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,18 +1,17 @@
#!/usr/bin/python
-# 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)
+# 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)
# This tests the "existing" and "updated" modifiers on actions.
import BoostBuild
-from string import strip, replace
+import string
t = BoostBuild.Tester(pass_toolset=0)
code = """
-
DEPENDS all : a ;
ALWAYS a ;
NOTFILE a ;
@@ -36,25 +35,17 @@
t.write("a-1", "")
t.run_build_system("-ffile.jam")
-t.fail_test(strip(t.read("list")) != "a-1")
+t.fail_test(string.strip(t.read("list")) != "a-1")
t.rm(["a-3", "list"])
-code = replace(code, "existing", "updated")
+code = string.replace(code, "existing", "updated")
t.write("file.jam", code)
t.run_build_system("-ffile.jam")
-t.fail_test(strip(t.read("list")) != "a-3")
+t.fail_test(string.strip(t.read("list")) != "a-3")
-code = replace(code, "updated", "existing updated")
+code = string.replace(code, "updated", "existing updated")
t.write("file.jam", code)
t.run_build_system("-ffile.jam")
-t.fail_test(strip(t.read("list")) != "a-1 a-3")
-
-
-
-
-
-
-
-
+t.fail_test(string.strip(t.read("list")) != "a-1 a-3")
t.cleanup()
Modified: branches/release/tools/build/v2/test/core_varnames.py
==============================================================================
--- branches/release/tools/build/v2/test/core_varnames.py (original)
+++ branches/release/tools/build/v2/test/core_varnames.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,10 +1,10 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# 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)
+# Copyright 2003 Dave Abrahams
+# 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)
-# This tests the core rule for enumerating the variable names in a module
+# This tests the core rule for enumerating the variable names in a module.
import BoostBuild
@@ -34,4 +34,5 @@
""")
t.run_build_system("-ffile.jam", status=0)
+
t.cleanup()
Modified: branches/release/tools/build/v2/test/custom_generator.py
==============================================================================
--- branches/release/tools/build/v2/test/custom_generator.py (original)
+++ branches/release/tools/build/v2/test/custom_generator.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,19 +4,17 @@
# 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)
+# Attempt to declare a generator for creating OBJ from RC files. That generator
+# should be considered together with standard CPP->OBJ generators and
+# successfully create the target. Since we do not have a RC compiler everywhere,
+# we fake the action. The resulting OBJ will be unusable, but it must be
+# created.
-from BoostBuild import Tester, List
+import BoostBuild
+t = BoostBuild.Tester()
-t = Tester()
-
-# Attempt to declare a generator for creating OBJ from RC files.
-# That generator should be considered together with standard
-# CPP->OBJ generators and successfully create the target.
-# Since we don't have RC compiler everywhere, we fake the action.
-# The resulting OBJ will be unusable, but it must be created.
-
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
import rcc ;
""")
@@ -25,8 +23,8 @@
import generators ;
import print ;
-# Use 'RCC' to avoid conflicts with definitions in
-# the standard rc.jam and msvc.jam
+# Use 'RCC' to avoid conflicts with definitions in the standard rc.jam and
+# msvc.jam
type.register RCC : rcc ;
rule resource-compile ( targets * : sources * : properties * )
@@ -36,10 +34,9 @@
}
generators.register-standard rcc.resource-compile : RCC : OBJ ;
-
""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
obj r : r.rcc ;
""")
@@ -50,6 +47,3 @@
t.expect_content("bin/$toolset/debug/r.obj", "rc-object")
t.cleanup()
-
-
-
Modified: branches/release/tools/build/v2/test/default_build.py
==============================================================================
--- branches/release/tools/build/v2/test/default_build.py (original)
+++ branches/release/tools/build/v2/test/default_build.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,38 +1,38 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 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)
# Test that default build clause actually has any effect.
-from BoostBuild import Tester, List
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", "exe a : a.cpp : : debug release ;")
-t.write("a.cpp", "int main() { return 0; }\n")
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "import gcc ;")
+t.write("jamfile.jam", "exe a : a.cpp : : debug release ;")
+t.write("a.cpp", "int main() {}\n")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
t.expect_addition("bin/$toolset/release/a.exe")
-# Check that explictly-specified build variant supresses
-# default-build
+# Check that explictly-specified build variant supresses default-build.
t.rm("bin")
t.run_build_system("release")
-t.expect_addition(List("bin/$toolset/release/") * "a.exe a.obj")
+t.expect_addition(BoostBuild.List("bin/$toolset/release/") * "a.exe a.obj")
t.expect_nothing_more()
-# Now check that we can specify explicit build request and
-# default-build will be combined with it
+# Now check that we can specify explicit build request and default-build will be
+# combined with it.
t.run_build_system("optimization=space")
t.expect_addition("bin/$toolset/debug/optimization-space/a.exe")
t.expect_addition("bin/$toolset/release/optimization-space/a.exe")
# Test that default-build must be identical in all alternatives. Error case.
-t.write("Jamfile", """
+t.write("jamfile.jam", """
exe a : a.cpp : : debug ;
exe a : b.cpp : : ;
""")
@@ -44,40 +44,40 @@
"""
t.run_build_system("-n --no-error-backtrace", status=1, stdout=expected)
-# Test that default-build must be identical in all alternatives. No Error case, empty default build.
-t.write("Jamfile", """
+# Test that default-build must be identical in all alternatives. No Error case,
+# empty default build.
+t.write("jamfile.jam", """
exe a : a.cpp : <variant>debug ;
exe a : b.cpp : <variant>release ;
""")
t.run_build_system("-n --no-error-backtrace", status=0)
-# Now try a harder example: default build which contains <define>
-# should cause <define> to be present when "b" is compiled.
-# This happens only of "build-project b" is placed first.
-t.write("Jamfile", """
- project
- : default-build <define>FOO
- ;
-
- build-project a ;
- build-project b ;
+# Now try a harder example: default build which contains <define> should cause
+# <define> to be present when "b" is compiled. This happens only if
+# "build-project b" is placed first.
+t.write("jamfile.jam", """
+project : default-build <define>FOO ;
+build-project a ;
+build-project b ;
""")
-t.write("a/Jamfile", """
- exe a : a.cpp ../b//b ;
+t.write("a/jamfile.jam", """
+exe a : a.cpp ../b//b ;
""")
+
t.write("a/a.cpp", """
#ifdef _WIN32
__declspec(dllimport)
#endif
void foo();
-int main() { foo(); return 0; }
+int main() { foo(); }
""")
-t.write("b/Jamfile", """
- lib b : b.cpp ;
+t.write("b/jamfile.jam", """
+lib b : b.cpp ;
""")
+
t.write("b/b.cpp", """
#ifdef FOO
#ifdef _WIN32
Modified: branches/release/tools/build/v2/test/default_features.py
==============================================================================
--- branches/release/tools/build/v2/test/default_features.py (original)
+++ branches/release/tools/build/v2/test/default_features.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,44 +1,39 @@
#!/usr/bin/python
-# 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)
+# 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)
-# Test that features with default values are always present
-# in build properties of any target.
+# Test that features with default values are always present in build properties
+# of any target.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
# Declare *non-propagated* feature foo.
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
import feature : feature ;
-
feature foo : on off ;
""")
-# Note that '<foo>on' won't be propagated
-# to 'd/l'.
-t.write("Jamfile", """
+# Note that '<foo>on' will not be propagated to 'd/l'.
+t.write("jamfile.jam", """
exe hello : hello.cpp d//l ;
""")
+
t.write("hello.cpp", """
#ifdef _WIN32
__declspec(dllimport)
#endif
void foo();
-int main()
-{
- foo();
- return 1;
-}
-
+int main() { foo(); }
""")
-t.write("d/Jamfile", """
+t.write("d/jamfile.jam", """
lib l : l.cpp : <foo>on:<define>FOO ;
""")
+
t.write("d/l.cpp", """
#ifdef _WIN32
__declspec(dllexport)
@@ -46,7 +41,6 @@
#ifdef FOO
void foo() {}
#endif
-
""")
t.run_build_system()
Modified: branches/release/tools/build/v2/test/default_toolset.py
==============================================================================
--- branches/release/tools/build/v2/test/default_toolset.py (original)
+++ branches/release/tools/build/v2/test/default_toolset.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -58,7 +58,7 @@
'toolset_version_unused': toolset_version_unused})
# Main Boost Build project script.
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import build-system ;
import errors ;
import feature ;
@@ -121,7 +121,7 @@
t = BoostBuild.Tester("--user-config= --ignore-site-config",
pass_toolset=False, use_test_config=False)
- t.write("Jamroot.jam", "modules.poke os : .name : %s ;" % os)
+ t.write("jamroot.jam", "modules.poke os : .name : %s ;" % os)
# We need to tell the test system to ignore stderr output as attempting to
# load missing toolsets might cause random failures with which we are not
@@ -159,7 +159,7 @@
""" % {'toolset_name': toolset_name})
# Main Boost Build project script.
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import build-system ;
import errors ;
import feature ;
Deleted: branches/release/tools/build/v2/test/dependency-test/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/dependency-test/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,25 +0,0 @@
-# Copyright 2002, 2003, 2005 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)
-
-
-project test
- : requirements <include>src1
- ;
-
-exe a
- : x.foo a.cpp a_c.c
- ;
-
-exe b
- : b.cpp
- ;
-
-# Because of <define>, c.cpp will be compiled to different
-# directory than everything for main target "a". Therefore
-# without <implicit-dependency>, it won't find "x.h", which is part
-# of "a"'s dependency graph.
-exe c
- : c.cpp
- : <define>FOO <implicit-dependency>a
- ;
Deleted: branches/release/tools/build/v2/test/dependency-test/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/dependency-test/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,7 +0,0 @@
-# Copyright 2002 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)
-
-
-import gcc ;
-import foo ;
Modified: branches/release/tools/build/v2/test/dependency_property.py
==============================================================================
--- branches/release/tools/build/v2/test/dependency_property.py (original)
+++ branches/release/tools/build/v2/test/dependency_property.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,30 +4,25 @@
# 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)
-# Regression test: virtual targets with different dependency properties
-# were considered different by 'virtual-target.register', but the code
-# which determined target paths ignored dependency properties --- so both
-# targets used to be placed to the same location.
+# Regression test: virtual targets with different dependency properties were
+# considered different by 'virtual-target.register', but the code which
+# determined target paths ignored dependency properties --- so both targets used
+# to be placed to the same location.
-from BoostBuild import Tester, List
-from string import find
+import BoostBuild
+import string
-t = Tester()
+t = BoostBuild.Tester()
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamroot.jam", """
lib foo : foo.cpp ;
exe hello : hello.cpp ;
exe hello2 : hello.cpp : <library>foo ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
-""")
+t.write("hello.cpp", "int main() {}\n")
+
t.write("foo.cpp", """
#ifdef _WIN32
__declspec(dllexport)
@@ -36,6 +31,6 @@
""")
t.run_build_system("--no-error-backtrace", status=1)
-t.fail_test(find(t.stdout(), "Duplicate name of actual target") == -1)
+t.fail_test(string.find(t.stdout(), "Duplicate name of actual target") == -1)
t.cleanup()
Modified: branches/release/tools/build/v2/test/dependency_test.py
==============================================================================
--- branches/release/tools/build/v2/test/dependency_test.py (original)
+++ branches/release/tools/build/v2/test/dependency_test.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,19 +5,20 @@
# 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("dependency-test")
+
t.run_build_system()
-# Check that main target 'c' was able to find 'x.h' from
-# 'a's dependency graph
+
+# Check that main target 'c' was able to find 'x.h' from 'a's dependency graph.
t.expect_addition("bin/$toolset/debug/c.exe")
# Check handling of first level includes.
-# Both 'a' and 'b' include "a.h" and should be updated
+# Both 'a' and 'b' include "a.h" and should be updated.
t.touch("a.h")
t.run_build_system()
@@ -26,14 +27,13 @@
t.expect_touch("bin/$toolset/debug/a_c.obj")
t.expect_touch("bin/$toolset/debug/b.exe")
t.expect_touch("bin/$toolset/debug/b.obj")
-# Now, <dependency> does not add dependency.
-# It sound weird, but is intentional. Need
-# to rename <dependency> eventually.
+# Now, <dependency> does not add a dependency. It sound weird, but is
+# intentional. Need to rename <dependency> eventually.
#t.expect_touch("bin/$toolset/debug/main-target-c/c.exe")
t.ignore("*.tds")
t.expect_nothing_more()
-# Only 'a' include <a.h> and should be updated
+# Only 'a' include <a.h> and should be updated.
t.touch("src1/a.h")
t.run_build_system()
@@ -43,7 +43,7 @@
t.ignore("*.tds")
t.expect_nothing_more()
-# "src/a.h" includes "b.h" (in the same dir)
+# "src/a.h" includes "b.h" (in the same dir).
t.touch("src1/b.h")
t.run_build_system()
t.expect_touch("bin/$toolset/debug/a.exe")
@@ -52,8 +52,8 @@
t.ignore("*.tds")
t.expect_nothing_more()
-# included by "src/b.h". We had a bug: file included via "",
-# like "b.h" is in this case was not scanned at all.
+# Included by "src/b.h". We had a bug: file included via "", like "b.h" is in
+# this case was not scanned at all.
t.touch("src1/c.h")
t.run_build_system()
t.expect_touch("bin/$toolset/debug/a.exe")
@@ -62,41 +62,38 @@
t.run_build_system()
t.expect_nothing_more()
-# Test dependency on generated header.
-# TODO: we have also to check that generated header is found correctly
-# if it is different for different subvariants. Lacking any toolset
-# support, this check will be implemented later.
+# Test dependency on a generated header.
+#
+# TODO: we have also to check that generated header is found correctly if it is
+# different for different subvariants. Lacking any toolset support, this check
+# will be implemented later.
t.touch("x.foo")
t.run_build_system()
t.expect_touch("bin/$toolset/debug/a.obj")
t.expect_touch("bin/$toolset/debug/a_c.obj")
-# Check that generated headers are scanned for dependencies as well
+# Check that generated headers are scanned for dependencies as well.
t.touch("src1/z.h")
t.run_build_system()
t.expect_touch("bin/$toolset/debug/a.obj")
t.expect_touch("bin/$toolset/debug/a_c.obj")
-# Regression test: on windows, <includes> with absolute paths
-# were not considered when scanning dependencies.
-
+# Regression test: on Windows, <includes> with absolute paths were not
+# considered when scanning dependencies.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
path-constant TOP : . ;
-exe app : main.cpp
- : <include>$(TOP)/include
- ;
+exe app : main.cpp : <include>$(TOP)/include ;
""");
t.write("main.cpp", """
#include <dir/header.h>
-
-int main() { return 0; }
-
+int main() {}
""")
t.write("include/dir/header.h", "")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.obj")
@@ -104,6 +101,4 @@
t.run_build_system()
t.expect_touch("bin/$toolset/debug/main.obj")
-
-
t.cleanup()
Deleted: branches/release/tools/build/v2/test/direct-request-test/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/direct-request-test/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2002 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)
-
-
-# This will link correctly only if symbol MACROS is defined when compiling
-# b.cpp. However, this is only possible if that symbol is requested
-# on command line and b.cpp is compiled with directly requested
-# properties.
-
-exe a : a.cpp b ;
-
-lib b : b.cpp ;
Deleted: branches/release/tools/build/v2/test/direct-request-test/Jamfile2
==============================================================================
--- branches/release/tools/build/v2/test/direct-request-test/Jamfile2 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-
-# This will link correctly only if symbol MACROS is not defined when
-# compiling b.cpp. This tests if direct build request
-# 'release <define>MACROS' to 'b' does not add 'MACROS' when 'b'
-# is compiled with 'debug' -- the version needed by 'a'.
-
-exe a : a.cpp b : <variant>debug ;
-
-lib b : b.cpp ;
\ No newline at end of file
Deleted: branches/release/tools/build/v2/test/direct-request-test/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/direct-request-test/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-# Copyright 2002 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)
-
-
-import gcc ;
Modified: branches/release/tools/build/v2/test/direct_request_test.py
==============================================================================
--- branches/release/tools/build/v2/test/direct_request_test.py (original)
+++ branches/release/tools/build/v2/test/direct_request_test.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,46 +1,40 @@
#!/usr/bin/python
-from BoostBuild import Tester, List
-import os
-from string import strip
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-# First check some startup
+
+# First check some startup.
t.set_tree("direct-request-test")
t.run_build_system(extra_args="define=MACROS")
-
t.expect_addition("bin/$toolset/debug/"
- * (List("a.obj b.obj b.dll a.exe")))
+ * (BoostBuild.List("a.obj b.obj b.dll a.exe")))
+
-# When building debug version, the 'define' still applies
+# When building a debug version, the 'define' still applies.
t.rm("bin")
t.run_build_system(extra_args="debug define=MACROS")
t.expect_addition("bin/$toolset/debug/"
- * (List("a.obj b.obj b.dll a.exe")))
+ * (BoostBuild.List("a.obj b.obj b.dll a.exe")))
-# When building release version, the 'define' should not
-# apply: we'll have direct build request 'release <define>MACROS'
-# and real build properties 'debug'.
-t.copy("Jamfile2", "Jamfile")
+
+# When building release version, the 'define' should not apply: we will have
+# direct build request 'release <define>MACROS' and a real build property
+# 'debug'.
+t.copy("jamfile2.jam", "jamfile.jam")
t.copy("b_inverse.cpp", "b.cpp")
t.rm("bin")
t.run_build_system(extra_args="release define=MACROS")
-# Regression test: direct build request was not working
-# when there's more than one level of 'build-project'
-
+# Regression test: direct build request was not working when there was more than
+# one level of 'build-project'.
t.rm(".")
-t.write('project-root.jam', '')
-t.write('Jamfile', 'build-project a ;')
-t.write('a/Jamfile', 'build-project b ;')
-t.write('a/b/Jamfile', '')
-
+t.write('jamroot.jam', '')
+t.write('jamfile.jam', 'build-project a ;')
+t.write('a/jamfile.jam', 'build-project b ;')
+t.write('a/b/jamfile.jam', '')
t.run_build_system("release")
-
-
-
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/disambiguation.py
==============================================================================
--- branches/release/tools/build/v2/test/disambiguation.py (original)
+++ branches/release/tools/build/v2/test/disambiguation.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,30 +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 that it's possible to add a suffix to a main target name to
-# disambiguate that main target from another, and that this does not
-# affect the names of the generated targets.
-from BoostBuild import Tester, List
+# 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)
-# Create a temporary working directory
-t = Tester()
+# Test that it is possible to add a suffix to a main target name to disambiguate
+# that main target from another, and that this does not affect the names of the
+# generated targets.
-# Create the needed files
-t.write("Jamroot", """
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
exe hello.exe : hello.obj ;
obj hello.obj : hello.cpp : <variant>debug ;
obj hello.obj2 : hello.cpp : <variant>release ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() {}
""")
t.run_build_system()
@@ -33,5 +29,4 @@
t.expect_addition("bin/$toolset/debug/hello.obj")
t.expect_addition("bin/$toolset/release/hello.obj")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/dll_path.py
==============================================================================
--- branches/release/tools/build/v2/test/dll_path.py (original)
+++ branches/release/tools/build/v2/test/dll_path.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,41 +1,38 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
-# distribute this software is granted provided this copyright notice appears in
-# all copies. This software is provided "as is" without express or implied
-# warranty, and with no claim as to its suitability for any purpose.
-
-# Test that the <dll-path> property is correctly set when using
-# <hardcode-dll-paths>true.
-from BoostBuild import Tester, List
-from string import find
-
-
-t = Tester()
-
-# The point of this test is to have exe "main" which uses library "b",
-# which uses library "a". When "main" is built with <hardcode-dll-paths>true,
-# paths to both libraries should be present as values of <dll-path> feature.
-# We create a special target type which reports <dll-path> values on its sources
-# and compare the list of found values with out expectations.
+# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
+# distribute this software is granted provided this copyright notice appears in
+# all copies. This software is provided "as is" without express or implied
+# warranty, and with no claim as to its suitability for any purpose.
-t.write("Jamfile", """
+# Test that the <dll-path> property is correctly set when using
+# <hardcode-dll-paths>true.
+
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+# The point of this test is to have exe "main" which uses library "b", which
+# uses library "a". When "main" is built with <hardcode-dll-paths>true, paths to
+# both libraries should be present as values of <dll-path> feature. We create a
+# special target type which reports <dll-path> values on its sources and compare
+# the list of found values with out expectations.
+
+t.write("jamfile.jam", """
exe main : main.cpp b//b ;
explicit main ;
-
-path-list mp : main ;
+path-list mp : main ;
""")
-t.write("main.cpp", """
-int main() { return 0; }
-
+t.write("main.cpp", """
+int main() {}
""")
-t.write("project-root.jam", """
-using dll-paths ;
+t.write("jamroot.jam", """
+using dll-paths ;
""")
-t.write("dll-paths.jam", """
+t.write("dll-paths.jam", """
import type ;
import generators ;
import feature ;
@@ -43,18 +40,18 @@
import print ;
import "class" : new ;
-rule init ( )
-{
+rule init ( )
+{
type.register PATH_LIST : pathlist ;
-
- class dll-paths-list-generator : generator
+
+ class dll-paths-list-generator : generator
{
rule __init__ ( )
{
generator.__init__ dll-paths.list : EXE : PATH_LIST ;
}
-
- rule generated-targets ( sources + : property-set : project name ? )
+
+ rule generated-targets ( sources + : property-set : project name ? )
{
local dll-paths ;
for local s in $(sources)
@@ -64,15 +61,15 @@
{
local p = [ $(a).properties ] ;
dll-paths += [ $(p).get <dll-path> ] ;
- }
+ }
}
- return [ generator.generated-targets $(sources)
- : [ $(property-set).add-raw $(dll-paths:G=<dll-path>) ] : $(project) $(name) ] ;
-
+ return [ generator.generated-targets $(sources) :
+ [ $(property-set).add-raw $(dll-paths:G=<dll-path>) ] :
+ $(project) $(name) ] ;
+
}
}
generators.register [ new dll-paths-list-generator ] ;
-
}
rule list ( target : sources * : properties * )
@@ -82,35 +79,30 @@
print.output $(target) ;
print.text $(paths) ;
}
-
""")
-t.write("a/a.cpp", """
+t.write("a/a.cpp", """
void
#if defined(_WIN32)
__declspec(dllexport)
#endif
foo() {}
-
-
""")
-t.write("a/Jamfile", """
-lib a : a.cpp ;
+t.write("a/jamfile.jam", """
+lib a : a.cpp ;
""")
-t.write("b/b.cpp", """
+t.write("b/b.cpp", """
void
#if defined(_WIN32)
__declspec(dllexport)
#endif
bar() {}
-
-
""")
-t.write("b/Jamfile", """
-lib b : b.cpp ../a//a ;
+t.write("b/jamfile.jam", """
+lib b : b.cpp ../a//a ;
""")
t.run_build_system("hardcode-dll-paths=true")
@@ -124,4 +116,3 @@
t.expect_content_line("bin/$toolset/debug/mp.pathlist", "*" + es2);
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/double_loading.py
==============================================================================
--- branches/release/tools/build/v2/test/double_loading.py (original)
+++ branches/release/tools/build/v2/test/double_loading.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,15 +4,14 @@
# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-# Regression test for double loading of the same Jamfile.
-t.write("Jamfile.jam", "build-project subdir ;")
-t.write("Jamroot.jam", "" )
-t.write("subdir/Jamfile.jam", 'ECHO "Loaded subdir" ;')
+# Regression test for double loading of the same Jamfile.
+t.write("jamroot.jam", "" )
+t.write("jamfile.jam", "build-project subdir ;")
+t.write("subdir/jamfile.jam", 'ECHO "Loaded subdir" ;')
t.run_build_system(subdir="subdir")
t.expect_output_line("Loaded subdir")
@@ -22,9 +21,9 @@
# 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.write("jamroot.jam", "" )
+t.write("jamfile.jam", "use-project /subdir : subdir ;")
+t.write("subdir/jamfile.jam", "project subdir ;")
t.run_build_system(subdir="subdir");
Modified: branches/release/tools/build/v2/test/duplicate.py
==============================================================================
--- branches/release/tools/build/v2/test/duplicate.py (original)
+++ branches/release/tools/build/v2/test/duplicate.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,40 +4,35 @@
# 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)
-# This test tries to stage the same file to the same location by *two*
-# different stage rules, in two different projects. This is not exactly
-# good thing to do, but still, V2 should handle this. We had two bugs:
-# - since the file is referred from two projects, we created to different
-# virtual targets
-# - we also failed to figure out that the two target corresponding to the
-# copied files (created in two projects) are actually equivivalent.
+# This test tries to stage the same file to the same location by *two* different
+# stage rules, in two different projects. This is not exactly good thing to do,
+# but still, V2 should handle this. We had two bugs:
+# - since the file is referred from two projects, we created to different
+# virtual targets
+# - we also failed to figure out that the two target corresponding to the copied
+# files (created in two projects) are actually equivalent.
-from BoostBuild import Tester, List
+import BoostBuild
+t = BoostBuild.Tester()
-t = Tester()
-
-t.write("a.cpp", """
+t.write("a.cpp", """
""")
-t.write("Jamfile", """
+t.write("jamroot.jam", """
build-project a ;
-build-project b ;
-""")
-
-t.write("project-root.jam", """
+build-project b ;
""")
-t.write("a/Jamfile", """
-stage bin : ../a.cpp : <location>../dist ;
+t.write("a/jamfile.jam", """
+stage bin : ../a.cpp : <location>../dist ;
""")
-t.write("b/Jamfile", """
-stage bin : ../a.cpp : <location>../dist ;
+t.write("b/jamfile.jam", """
+stage bin : ../a.cpp : <location>../dist ;
""")
t.run_build_system()
t.expect_addition("dist/a.cpp")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/example_customization.py
==============================================================================
--- branches/release/tools/build/v2/test/example_customization.py (original)
+++ branches/release/tools/build/v2/test/example_customization.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,15 +1,15 @@
#!/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)
+# 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
+# Test the 'customization' example.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree("../example/customization")
@@ -17,7 +17,5 @@
t.expect_addition(["bin/$toolset/debug/codegen.exe",
"bin/$toolset/debug/usage.cpp"])
-
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/example_gettext.py
==============================================================================
--- branches/release/tools/build/v2/test/example_gettext.py (original)
+++ branches/release/tools/build/v2/test/example_gettext.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,17 +1,17 @@
#!/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)
+# 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
+# Test the 'gettext' example.
+
+import BoostBuild
import os
import string
-# Create a temporary working directory
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("../example/gettext")
@@ -20,7 +20,6 @@
t.expect_addition(["bin/$toolset/debug/main.exe",
"bin/$toolset/debug/russian.mo"])
-
file = t.adjust_names(["bin/$toolset/debug/main.exe"])[0]
input_fd = os.popen(file)
Modified: branches/release/tools/build/v2/test/example_libraries.py
==============================================================================
--- branches/release/tools/build/v2/test/example_libraries.py (original)
+++ branches/release/tools/build/v2/test/example_libraries.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,15 +1,15 @@
#!/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)
+# 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
+# Test the 'libraries' example.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree("../example/libraries")
@@ -18,5 +18,4 @@
t.expect_addition(["app/bin/$toolset/debug/app.exe",
"util/foo/bin/$toolset/debug/bar.dll"])
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/example_make.py
==============================================================================
--- branches/release/tools/build/v2/test/example_make.py (original)
+++ branches/release/tools/build/v2/test/example_make.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,20 +1,20 @@
#!/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)
+# 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
+# Test the 'make' example.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree("../example/make")
t.run_build_system()
-t.expect_addition(["bin/$toolset/debug/main.exe"])
-
+t.expect_addition(["bin/$toolset/debug/main.cpp"])
+
t.cleanup()
Modified: branches/release/tools/build/v2/test/example_qt4.py
==============================================================================
--- branches/release/tools/build/v2/test/example_qt4.py (original)
+++ branches/release/tools/build/v2/test/example_qt4.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,10 +6,10 @@
# http://www.boost.org/LICENSE_1_0.txt)
# Test the 'qt4' examples.
-from BoostBuild import Tester, List
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree("../example/qt/qt4/hello")
t.run_build_system()
Modified: branches/release/tools/build/v2/test/expansion.py
==============================================================================
--- branches/release/tools/build/v2/test/expansion.py (original)
+++ branches/release/tools/build/v2/test/expansion.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,88 +4,77 @@
# 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)
-# This file is template for Boost.Build tests. It creates a simple
-# project that builds one exe from one source, and checks that the exe
-# is really created.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("a.cpp", """
+t.write("a.cpp", """
#ifdef CF_IS_OFF
-int main() { return 0; }
+int main() {}
#endif
-
""")
-t.write("b.cpp", """
+t.write("b.cpp", """
#ifdef CF_1
-int main() { return 0; }
+int main() {}
#endif
-
""")
t.write("c.cpp", """
#ifdef FOO
-int main() { return 0; }
+int main() {}
#endif
-
""")
-
-t.write("Jamfile", """
-# See if default value of composite feature 'cf'
-# will be expanded to <define>CF_IS_OFF
+t.write("jamfile.jam", """
+# See if default value of composite feature 'cf' will be expanded to
+# <define>CF_IS_OFF.
exe a : a.cpp ;
# See if subfeature in requirements in expanded.
exe b : b.cpp : <cf>on-1 ;
# See if conditional requirements are recursively expanded.
-exe c : c.cpp : <toolset>$toolset:<variant>release <variant>release:<define>FOO ;
+exe c : c.cpp : <toolset>$toolset:<variant>release <variant>release:<define>FOO
+ ;
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
import feature ;
-
feature.feature cf : off on : composite incidental ;
-
feature.compose <cf>off : <define>CF_IS_OFF ;
-
feature.subfeature cf on : version : 1 2 : composite optional incidental ;
-
feature.compose <cf-on:version>1 : <define>CF_1 ;
-
""")
-t.expand_toolset("Jamfile")
+t.expand_toolset("jamfile.jam")
t.run_build_system()
t.expect_addition(["bin/$toolset/debug/a.exe",
"bin/$toolset/debug/b.exe",
- "bin/$toolset/release/c.exe",
- ])
+ "bin/$toolset/release/c.exe"])
t.rm("bin")
-# Test for issue BB60
+
+# Test for issue BB60.
+
t.write("test.cpp", """
#include "header.h"
-int main() { return 0; }
+int main() {}
""")
-t.write("Jamfile", """
-project
- : requirements <toolset>$toolset:<include>foo
- ;
+
+t.write("jamfile.jam", """
+project : requirements <toolset>$toolset:<include>foo ;
exe test : test.cpp : <toolset>$toolset ;
""")
-t.expand_toolset("Jamfile")
-t.write("foo/header.h", """
-""")
-t.write("project-root.jam", "")
+
+t.expand_toolset("jamfile.jam")
+t.write("foo/header.h", "\n")
+t.write("jamroot.jam", "")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/test.exe")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/explicit.py
==============================================================================
--- branches/release/tools/build/v2/test/explicit.py (original)
+++ branches/release/tools/build/v2/test/explicit.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,32 +4,26 @@
# 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)
-# This file is template for Boost.Build tests. It creates a simple
-# project that builds one exe from one source, and checks that the exe
-# is really created.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
exe hello : hello.cpp ;
exe hello2 : hello.cpp ;
-
explicit hello2 ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("hello.cpp", """
+int main() {}
""")
t.run_build_system()
t.ignore("*.tds")
-t.expect_addition(List("bin/$toolset/debug/hello") * [".exe", ".obj"])
+t.expect_addition(BoostBuild.List("bin/$toolset/debug/hello") * \
+ [".exe", ".obj"])
t.expect_nothing_more()
t.run_build_system("hello2")
@@ -38,21 +32,21 @@
t.rm(".")
-# Test that 'explicit' used in a helper rule applies to the current project,
-# and not to the Jamfile where the helper rule is defined.
-t.write("Jamroot", """
+# Test that 'explicit' used in a helper rule applies to the current project, and
+# not to the Jamfile where the helper rule is defined.
+t.write("jamroot.jam", """
rule myinstall ( name : target )
{
install $(name)-bin : $(target) ;
explicit $(name)-bin ;
alias $(name) : $(name)-bin ;
-}
+}
""")
-t.write("sub/a.cpp", """
+t.write("sub/a.cpp", """
""")
-t.write("sub/Jamfile", """
+t.write("sub/jamfile.jam", """
myinstall dist : a.cpp ;
""")
@@ -61,14 +55,12 @@
t.rm("sub/dist-bin")
-t.write("sub/Jamfile", """
+t.write("sub/jamfile.jam", """
myinstall dist : a.cpp ;
explicit dist ;
-
""")
t.run_build_system(subdir="sub")
t.expect_nothing_more()
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/file_name_handling.py
==============================================================================
--- branches/release/tools/build/v2/test/file_name_handling.py (original)
+++ branches/release/tools/build/v2/test/file_name_handling.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -33,10 +33,9 @@
# prepare_file()
# --------------
#
-#
################################################################################
-def prepare_file(tester, target_name, age_in_seconds = 0):
+def prepare_file(tester, target_name, age_in_seconds=0):
"""Prepares a new file with the given name, optionally setting its last
access and modification timestamps to the given number of seconds in the
history.
@@ -70,7 +69,7 @@
t.write("testScript.jam", """
actions create-file
{
- echo Modified file content ($(1:E="")).> "$(1:E="")"
+ echo "Modified file content ($(1:E=""))."> "$(1:E="")"
}
DEPENDS all : standaloneTarget.txt ;
Modified: branches/release/tools/build/v2/test/free_features_request.py
==============================================================================
--- branches/release/tools/build/v2/test/free_features_request.py (original)
+++ branches/release/tools/build/v2/test/free_features_request.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,29 +1,26 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2007.
-# 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)
+# Copyright (C) Vladimir Prus 2007.
+# 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)
-# Tests that a free feature specified on the command
-# line applies to all targets ever built.
-from BoostBuild import Tester, List
+# Tests that a free feature specified on the command line applies to all targets
+# ever built.
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe hello : hello.cpp foo ;
lib foo : foo.cpp ;
""")
+
t.write("hello.cpp", """
extern void foo();
#ifdef FOO
-int main()
-{
- foo();
- return 0;
-}
+int main() { foo(); }
#endif
""")
@@ -36,8 +33,8 @@
#endif
""")
-# If FOO is not defined when compiling the 'foo'
-# target, we'll get a link error at this point.
+# If FOO is not defined when compiling the 'foo' target, we will get a link
+# error at this point.
t.run_build_system("hello define=FOO")
t.expect_addition("bin/$toolset/debug/hello.exe")
Modified: branches/release/tools/build/v2/test/gcc_runtime.py
==============================================================================
--- branches/release/tools/build/v2/test/gcc_runtime.py (original)
+++ branches/release/tools/build/v2/test/gcc_runtime.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,28 +4,28 @@
# 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)
-# Tests that on gcc, we correctly report problem when static runtime
-# is requested when building DLL.
-from BoostBuild import Tester, List
+# Tests that on gcc, we correctly report problem when static runtime is
+# requested for building a shared library.
+
+import BoostBuild
import string
-t = Tester()
+t = BoostBuild.Tester()
+
+# Create the needed files.
+t.write("jamroot.jam", "")
-# Create the needed files
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
lib hello : hello.cpp ;
""")
+
t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+int main() { }
""")
t.run_build_system("runtime-link=static", status=1)
t.fail_test(string.find(t.stdout(),
- "On gcc, DLL can't be build with '<runtime-link>static'") == -1)
+ "On gcc, DLL can't be build with '<runtime-link>static'") == -1)
t.run_build_system("link=static runtime-link=static")
t.expect_addition("bin/$toolset/debug/link-static/runtime-link-static/hello.lib")
Deleted: branches/release/tools/build/v2/test/generators-test/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/generators-test/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,19 +0,0 @@
-# Copyright 2002, 2003, 2005 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)
-
-
-project
- # This is needed to supress gcc warning on flex output, which otherwise
- # results in test failure
- : requirements <define>YY_NO_UNPUT
- ;
-
-exe a : a.cpp b.cxx obj_1 obj_2 c.tui d.wd x.l y.x_pro lib//auxilliary ;
-# This should not cause second compilation of a.cpp
-exe f : a.cpp b.cxx obj_1 obj_2 lib//auxilliary ;
-
-obj obj_1 : z.cpp : <define>SELECT=1 ;
-obj obj_2 : z.cpp : <define>SELECT=2 ;
-
-nm-exe e : e.cpp ;
Deleted: branches/release/tools/build/v2/test/generators-test/lib/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/generators-test/lib/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2002 Dave Abrahams
-# Copyright 2002 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)
-
-
-static-lib auxilliary : c.cpp ;
-
-lib auxilliary2 : c.cpp ;
Deleted: branches/release/tools/build/v2/test/generators-test/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/generators-test/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,95 +0,0 @@
-# Copyright 2002, 2003, 2004, 2005 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)
-
-
-import "class" : new ;
-
-import lex ;
-import qt ;
-import extra ;
-
-import type ;
-
-type.register tUI : tui ;
-type.register tUIC_H ;
-type.set-generated-target-suffix tUIC_H : : h ;
-
-type.register X1 : x1 ;
-type.register X2 : x2 ;
-type.register X_PRO : x_pro ;
-
-import generators ;
-
-generators.register-standard qt.uic : tUI tUIC_H : CPP ;
-generators.register-standard qt.uic-h : tUI : tUIC_H ;
-
-# That's an interesting example. Currently, X_PRO will be processed
-# twice.
-generators.register-standard extra.x : X1 X2 : CPP ;
-generators.register-standard extra.x_pro : X_PRO : X1 X2 ;
-
-# The point of this setup of to implement this functionality
-# "When main target type is EST_EXE, build OBJ from CPP-MARKED, not
-# for anything else (like CPP)
-# Unfortunately, this does not really works.
-
-#if $(no-var) {
-import nm ;
-
-type.register CPP_MARKED : marked_cpp : CPP ;
-type.register POSITIONS : positions ;
-type.register NM.TARGET.CPP : target_cpp : CPP ;
-type.register NM_EXE : : EXE ;
-
-generators.register-standard nm.target-source : CPP_MARKED : NM.TARGET.CPP ;
-generators.register-standard nm.cpp-mark : CPP : CPP_MARKED POSITIONS ;
-
-class nm::target::cpp-obj-generator : generator
-{
- rule __init__ ( )
- {
- generator.__init__ nm.target-obj : NM.TARGET.CPP : OBJ ;
- }
-
- rule requirements ( )
- {
- return <main-target-type>NM_EXE ;
- }
-
- # Consider: it it OK to ignore all other generated targets except for the first?
- rule run ( project name ? : properties * : source : multiple ? )
- {
- if [ $(source).type ] = CPP {
- local converted = [ generators.construct $(project) : NM.TARGET.CPP : $(properties) : $(source) ] ;
- if $(converted[1])
- {
- local result = [ generators.construct $(project) : OBJ : $(properties) : $(converted[2]) ] ;
- return $(result) ;
- }
- else
- {
- return ;
- }
- }
- else
- {
- return ;
- }
- }
-}
-
-generators.register [ new nm::target::cpp-obj-generator ] ;
-
-generators.override nm.target-obj : all ;
-
-#}
-
-
-
-
-
-
-
-
-
Modified: branches/release/tools/build/v2/test/generators_test.py
==============================================================================
--- branches/release/tools/build/v2/test/generators_test.py (original)
+++ branches/release/tools/build/v2/test/generators_test.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,41 +1,30 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2005 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2005 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)
-from BoostBuild import Tester, List
-import os
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("generators-test")
-t.run_build_system()
-t.expect_addition(
- "bin/$toolset/debug/"
- * (
- List(
- "a.obj b.obj c.h c.cpp c.obj d_parser.whl d_lexer.dlp d_parser.cpp d_lexer.cpp "
- + "d_parser.lr0 d_parser.h d_parser_symbols.h x.c x.obj y.x1 y.x2 "
- + "y.cpp y.obj e.marked_cpp e.positions e.target_cpp e.obj "))
- )
-ok = 0
+t.run_build_system()
+t.expect_addition( "bin/$toolset/debug/" * BoostBuild.List( "a.obj b.obj c.h "
+ + "c.cpp c.obj d_parser.whl d_lexer.dlp d_parser.cpp d_lexer.cpp "
+ + "d_parser.lr0 d_parser.h d_parser_symbols.h x.c x.obj y.x1 y.x2 y.cpp "
+ + "y.obj e.marked_cpp e.positions e.target_cpp e.obj"))
t.expect_addition("bin/$toolset/debug/a.exe")
-
t.expect_addition(["lib/bin/$toolset/debug/c.obj",
- "lib/bin/$toolset/debug/auxilliary.lib",
- ])
-
+ "lib/bin/$toolset/debug/auxilliary.lib"])
t.run_build_system(subdir='lib')
-
t.expect_addition(["lib/bin/$toolset/debug/auxilliary2.dll"])
t.run_build_system(subdir='lib', extra_args="link=static")
-
t.expect_addition(["lib/bin/$toolset/debug/link-static/auxilliary2.lib"])
t.cleanup()
Modified: branches/release/tools/build/v2/test/implicit_dependency.py
==============================================================================
--- branches/release/tools/build/v2/test/implicit_dependency.py (original)
+++ branches/release/tools/build/v2/test/implicit_dependency.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,20 +1,18 @@
#!/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)
+# 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 <implicit-dependency> is respected even if the
-# target referred-to is not build itself, but only referred
-# to by <implicit-dependency>.
+# Test the <implicit-dependency> is respected even if the target referred to is
+# not built itself, but only referred to by <implicit-dependency>.
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
make a.h : : gen-header ;
explicit a.h ;
@@ -37,20 +35,14 @@
}
""")
-t.write("hello.cpp", """
+t.write("hello.cpp", """
#include "a.h"
-
-int main()
-{
- return i;
-}
+int main() { return i; }
""")
-
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/indirect_conditional.py
==============================================================================
--- branches/release/tools/build/v2/test/indirect_conditional.py (original)
+++ branches/release/tools/build/v2/test/indirect_conditional.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,16 +1,15 @@
#!/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)
+# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe a1 : a1.cpp : <conditional>@a1-rule ;
rule a1-rule ( properties * )
@@ -21,7 +20,8 @@
}
}
-exe a2 : a2.cpp : <conditional>@$(__name__).a2-rule <variant>debug:<optimization>speed ;
+exe a2 : a2.cpp : <conditional>@$(__name__).a2-rule
+ <variant>debug:<optimization>speed ;
rule a2-rule ( properties * )
{
@@ -31,7 +31,8 @@
}
}
-exe a3 : a3.cpp : <conditional>@$(__name__).a3-rule-1 <conditional>@$(__name__).a3-rule-2 ;
+exe a3 : a3.cpp : <conditional>@$(__name__).a3-rule-1
+ <conditional>@$(__name__).a3-rule-2 ;
rule a3-rule-1 ( properties * )
{
@@ -48,32 +49,26 @@
return <optimization>speed ;
}
}
-
""")
-t.write("a1.cpp", """
+t.write("a1.cpp", """
#ifdef OK
int main() {}
#endif
-
""")
-t.write("a2.cpp", """
+t.write("a2.cpp", """
#ifdef OK
int main() {}
#endif
-
""")
-t.write("a3.cpp", """
+t.write("a3.cpp", """
#ifdef OK
int main() {}
#endif
-
""")
-
-
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a1.exe")
@@ -81,4 +76,3 @@
t.expect_addition("bin/$toolset/debug/optimization-speed/a3.exe")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/inherit_toolset.py
==============================================================================
--- branches/release/tools/build/v2/test/inherit_toolset.py (original)
+++ branches/release/tools/build/v2/test/inherit_toolset.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,76 +1,59 @@
#!/usr/bin/python
-# 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)
+# 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)
-from BoostBuild import Tester, List
-from string import find
+import BoostBuild
+import string
-t = Tester(pass_toolset=0)
+t = BoostBuild.Tester(pass_toolset=0)
-t.write("a.cpp", """
+t.write("a.cpp", """
""")
-t.write("yfc1.jam", """
-import feature : extend ;
-import generators : register-standard ;
+t.write("yfc1.jam", """
+import feature ;
+import generators ;
feature.extend toolset : yfc1 ;
-
-rule init ( )
-{
-}
+rule init ( ) { }
generators.register-standard yfc1.compile : CPP : OBJ : <toolset>yfc1 ;
generators.register-standard yfc1.link : OBJ : EXE : <toolset>yfc1 ;
-actions compile
-{
- yfc1-compile
-}
-
-actions link
-{
- yfc1-link
-}
+actions compile { yfc1-compile }
+actions link { yfc1-link }
""")
-t.write("yfc2.jam", """
-import feature : extend ;
-import toolset : inherit ;
+t.write("yfc2.jam", """
+import feature ;
+import toolset ;
feature.extend toolset : yfc2 ;
toolset.inherit yfc2 : yfc1 ;
+rule init ( ) { }
-rule init ( )
-{
-}
-
-actions link
-{
- yfc2-link
-}
+actions link { yfc2-link }
""")
-t.write("Jamfile", """
-exe a : a.cpp ;
+t.write("jamfile.jam", """
+exe a : a.cpp ;
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
using yfc1 ;
""")
t.run_build_system("-n -d2 yfc1")
-t.fail_test(find(t.stdout(), "yfc1-link") == -1)
+t.fail_test(string.find(t.stdout(), "yfc1-link") == -1)
-# Make sure we don't have to explicit 'use' yfc1.
-t.write("project-root.jam", """
+# Make sure we do not have to explicitly 'use' yfc1.
+t.write("jamroot.jam", """
using yfc2 ;
""")
t.run_build_system("-n -d2 yfc2")
-t.fail_test(find(t.stdout(), "yfc2-link") == -1)
+t.fail_test(string.find(t.stdout(), "yfc2-link") == -1)
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/inline.py
==============================================================================
--- branches/release/tools/build/v2/test/inline.py (original)
+++ branches/release/tools/build/v2/test/inline.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,31 +1,25 @@
#!/usr/bin/python
-# Copyright 2003, 2006 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)
+# Copyright 2003, 2006 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
project : requirements <link>static ;
-exe a : a.cpp [ lib helper : helper.cpp ] ;
+exe a : a.cpp [ lib helper : helper.cpp ] ;
""")
t.write("a.cpp", """
extern void helper();
-int main()
-{
- return 0;
-}
-
+int main() {}
""")
t.write("helper.cpp", """
-void helper()
-{
-}
+void helper() {}
""")
t.run_build_system()
@@ -37,13 +31,13 @@
t.rm("bin")
-# Now check that inline targets with the same name but
-# present in different places are not confused between
-# each other, and with top-level targets.
-t.write("Jamroot", """
+
+# Now check that inline targets with the same name but present in different
+# places are not confused between each other, and with top-level targets.
+t.write("jamroot.jam", """
project : requirements <link>static ;
exe a : a.cpp [ lib helper : helper.cpp ] ;
-exe a2 : a.cpp [ lib helper : helper.cpp ] ;
+exe a2 : a.cpp [ lib helper : helper.cpp ] ;
""")
t.run_build_system()
@@ -51,9 +45,10 @@
t.expect_addition("bin/$toolset/debug/link-static/a__helper.lib")
t.expect_addition("bin/$toolset/debug/link-static/a2__helper.lib")
-# Check that the 'alias' target does not change name of
-# inline targets, and that inline targets are explicit.
-t.write("Jamroot", """
+
+# Check that the 'alias' target does not change the name of inline targets, and
+# that inline targets are explicit.
+t.write("jamroot.jam", """
project : requirements <link>static ;
alias a : [ lib helper : helper.cpp ] ;
explicit a ;
@@ -67,4 +62,3 @@
t.expect_addition("bin/$toolset/debug/link-static/helper.lib")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/lib_source_property.py
==============================================================================
--- branches/release/tools/build/v2/test/lib_source_property.py (original)
+++ branches/release/tools/build/v2/test/lib_source_property.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,28 +1,27 @@
#!/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)
-
-# Regression test: if a library had no explicit sources, but
-# only <source> properties, it was built as it it were searched
-# library, and the specified sources were not compiled.
-from BoostBuild import Tester, List
+# 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)
-# Create a temporary working directory
-t = Tester()
+# Regression test: if a library had no explicit sources, but only <source>
+# properties, it was built as if it were a searched library, and the specified
+# sources were not compiled.
-# Create the needed files
-t.write("Jamroot", """
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
lib a : : <source>a.cpp ;
""")
+
t.write("a.cpp", """
#ifdef _WIN32
__declspec(dllexport)
#endif
void foo() {}
-
""")
t.run_build_system()
@@ -30,8 +29,9 @@
t.rm("bin")
-# Now try with <conditional>
-t.write("Jamroot", """
+
+# Now try with <conditional>.
+t.write("jamroot.jam", """
rule test ( properties * )
{
return <source>a.cpp ;
Modified: branches/release/tools/build/v2/test/library_chain.py
==============================================================================
--- branches/release/tools/build/v2/test/library_chain.py (original)
+++ branches/release/tools/build/v2/test/library_chain.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,34 +1,31 @@
#!/usr/bin/python
-# Copyright 2003, 2004, 2005, 2006 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)
-
-# Test that a chain of libraries work ok, not matter if we use static or
-# shared linking.
-from BoostBuild import Tester, List, get_toolset
+# Copyright 2003, 2004, 2005, 2006 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)
+
+# Test that a chain of libraries works ok, no matter if we use static or shared
+# linking.
+
+import BoostBuild
import string
import os
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamfile", """
-# Stage the binary, so that it will be relinked
-# without hardcode-dll-paths. That will chech that
-# we pass correct -rpath-link, even if not passing
-# -rpath.
+t.write("jamfile.jam", """
+# Stage the binary, so that it will be relinked without hardcode-dll-paths. That
+# will chech that we pass correct -rpath-link, even if not passing -rpath.
stage dist : main ;
-exe main : main.cpp b ;
+exe main : main.cpp b ;
""")
-t.write("main.cpp", """
+t.write("main.cpp", """
void foo();
-
-int main() { foo(); return 0; }
-
+int main() { foo(); }
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
""")
t.write("a/a.cpp", """
@@ -41,26 +38,24 @@
#if defined(_WIN32)
__declspec(dllexport)
#endif
-geek() {}
+geek() {}
""")
-t.write("a/Jamfile", """
-lib a : a.cpp ;
+t.write("a/jamfile.jam", """
+lib a : a.cpp ;
""")
-t.write("b/b.cpp", """
+t.write("b/b.cpp", """
void geek();
-
-void
+void
#if defined(_WIN32)
__declspec(dllexport)
#endif
foo() { geek(); }
-
""")
-t.write("b/Jamfile", """
-lib b : b.cpp ../a//a ;
+t.write("b/jamfile.jam", """
+lib b : b.cpp ../a//a ;
""")
t.run_build_system(stderr=None)
@@ -71,84 +66,92 @@
t.expect_addition("bin/$toolset/debug/link-static/main.exe")
t.rm(["bin", "a/bin", "b/bin"])
-# Check that <library> works for static linking.
-t.write("b/Jamfile", """
-lib b : b.cpp : <library>../a//a ;
+# Check that <library> works for static linking.
+t.write("b/jamfile.jam", """
+lib b : b.cpp : <library>../a//a ;
""")
+
t.run_build_system("link=static")
t.expect_addition("bin/$toolset/debug/link-static/main.exe")
t.rm(["bin", "a/bin", "b/bin"])
-t.write("b/Jamfile", """
-lib b : b.cpp ../a//a/<link>shared : <link>static ;
+
+t.write("b/jamfile.jam", """
+lib b : b.cpp ../a//a/<link>shared : <link>static ;
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.exe")
+
t.rm(["bin", "a/bin", "b/bin"])
-# Test that putting library in sources of a searched library
-# works.
-t.write("Jamfile", """
+
+# Test that putting a library in sources of a searched library works.
+t.write("jamfile.jam", """
exe main : main.cpp png ;
lib png : z : <name>png ;
lib z : : <name>zzz ;
""")
+
t.run_build_system("-a -d+2", status=None, stderr=None)
-# Try to find the "zzz" string either in response file
-# (for Windows compilers), or in standard output.
+# Try to find the "zzz" string either in response file (for Windows compilers),
+# or in the standard output.
rsp = t.adjust_names("bin/$toolset/debug/main.exe.rsp")[0]
-if os.path.exists(rsp) and string.find(open(rsp).read(), "zzz") != -1:
+if os.path.exists(rsp) and ( string.find(open(rsp).read(), "zzz") != -1 ):
pass
elif string.find(t.stdout(), "zzz") != -1:
pass
else:
t.fail_test(1)
-#
-# Test main -> libb -> liba chain
-# in the case where liba is a file, not a Boost.Build target.
-#
+# Test main -> libb -> liba chain in the case where liba is a file and not a
+# Boost.Build target.
t.rm(".")
-t.write("Jamroot", "")
-t.write("a/Jamfile", """
+
+t.write("jamroot.jam", "")
+
+t.write("a/jamfile.jam", """
lib a : a.cpp ;
install dist : a ;
""")
+
t.write("a/a.cpp", """
#if defined(_WIN32)
__declspec(dllexport)
#endif
void a() {}
""")
+
t.run_build_system(subdir="a")
t.expect_addition("a/dist/a.dll")
-if (os.name == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc':
+if ( ( os.name == 'nt' ) or os.uname()[0].lower().startswith('cygwin') ) and \
+ ( BoostBuild.get_toolset() != 'gcc' ):
# This is windows import library -- we know the exact name.
file = "a/dist/a.lib"
else:
file = t.adjust_names(["a/dist/a.dll"])[0]
-t.write("b/Jamfile", """
+t.write("b/jamfile.jam", """
lib b : b.cpp ../%s ;
""" % file)
+
t.write("b/b.cpp", """
#if defined(_WIN32)
__declspec(dllimport)
#endif
void a();
-
#if defined(_WIN32)
__declspec(dllexport)
#endif
void b() { a(); }
""")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe main : main.cpp b//b ;
""")
+
t.write("main.cpp", """
#if defined(_WIN32)
__declspec(dllimport)
@@ -160,6 +163,4 @@
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.exe")
-
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/library_order.py
==============================================================================
--- branches/release/tools/build/v2/test/library_order.py (original)
+++ branches/release/tools/build/v2/test/library_order.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,81 +1,61 @@
#!/usr/bin/python
-# Copyright 2004 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)
+# Copyright 2004 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)
-from BoostBuild import Tester, List
+# Test that on compilers sensitive to library order on linker's command line, we
+# generate the correct order.
+
+import BoostBuild
import string
-# Test that on compilers which are sensitive to library order on
-# linker's command line, we generate the right order.
-t = Tester()
+t = BoostBuild.Tester()
-t.write("a.cpp", """
+t.write("a.cpp", """
void b();
-
-void a()
-{
- b();
-}
-
+void a() { b(); }
""")
-t.write("b.cpp", """
+t.write("b.cpp", """
void c();
-
-void b()
-{
- c();
-}
+void b() { c(); }
""")
-t.write("c.cpp", """
+t.write("c.cpp", """
void d();
-
-void c()
-{
- d();
-}
-
+void c() { d(); }
""")
-t.write("d.cpp", """
+t.write("d.cpp", """
void d() {}
-
""")
-# The order of libraries in 'main' is crafted so that
-# we get error unless we do something about the order ourselfs.
-t.write("Jamfile", """
+# The order of libraries in 'main' is crafted so that we get error unless we do
+# something about the order ourselves.
+t.write("jamfile.jam", """
exe main : main.cpp libd libc libb liba ;
lib libd : d.cpp ;
lib libc : c.cpp : <link>static <use>libd ;
lib libb : b.cpp : <use>libc ;
lib liba : a.cpp : <use>libb ;
-
""")
-t.write("main.cpp", """
+t.write("main.cpp", """
void a();
-
-int main()
-{
- a();
- return 0;
-}
-
+int main() { a(); }
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.exe")
-# Test the order between searched libraries
-t.write("Jamfile", """
+
+# Test the order between searched libraries.
+t.write("jamfile.jam", """
exe main : main.cpp png z ;
lib png : z : <name>png ;
lib z : : <name>zzz ;
@@ -84,7 +64,7 @@
t.run_build_system("-a -n -d+2")
t.fail_test(string.find(t.stdout(), "png") > string.find(t.stdout(), "zzz"))
-t.write("Jamfile", """
+t.write("jamfile.jam", """
exe main : main.cpp png z ;
lib png : : <name>png ;
lib z : png : <name>zzz ;
@@ -93,12 +73,13 @@
t.run_build_system("-a -n -d+2")
t.fail_test(string.find(t.stdout(), "png") < string.find(t.stdout(), "zzz"))
-# Test the order between prebuilt libraries
+# Test the order between prebuilt libraries.
t.write("first.a", "")
+
t.write("second.a", "")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
exe main : main.cpp first second ;
lib first : second : <file>first.a ;
lib second : : <file>second.a ;
@@ -107,7 +88,7 @@
t.run_build_system("-a -n -d+2")
t.fail_test(string.find(t.stdout(), "first") > string.find(t.stdout(), "second"))
-t.write("Jamfile", """
+t.write("jamfile.jam", """
exe main : main.cpp first second ;
lib first : : <file>first.a ;
lib second : first : <file>second.a ;
@@ -116,7 +97,4 @@
t.run_build_system("-a -n -d+2")
t.fail_test(string.find(t.stdout(), "first") < string.find(t.stdout(), "second"))
-
-
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/library_property.py
==============================================================================
--- branches/release/tools/build/v2/test/library_property.py (original)
+++ branches/release/tools/build/v2/test/library_property.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,28 +1,26 @@
#!/usr/bin/python
-# Copyright 2004 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)
+# Copyright 2004 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)
-# Test that the <library> property has no effect on "obj" targets.
-# Previously, it affected all targets, so
+# Test that the <library> property has no effect on "obj" targets. Previously,
+# it affected all targets, so
#
-# project : requirements <library>foo ;
-# exe a : a.cpp helper ;
-# obj helper : helper.cpp : <optimization>off ;
+# project : requirements <library>foo ;
+# exe a : a.cpp helper ;
+# obj helper : helper.cpp : <optimization>off ;
#
-# caused 'foo' to be built with and without optimization.
-from BoostBuild import Tester, List
+# caused 'foo' to be built with and without optimization.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
-t.write("Jamfile", """
-project
- : requirements <library>lib//x
- ;
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
+project : requirements <library>lib//x ;
exe a : a.cpp foo ;
-obj foo : foo.cpp : <variant>release ;
+obj foo : foo.cpp : <variant>release ;
""")
t.write("a.cpp", """
@@ -35,9 +33,6 @@
void aux() { gee(); }
""")
-t.write("project-root.jam", """
-""")
-
t.write("lib/x.cpp", """
void
#if defined(_WIN32)
@@ -46,17 +41,16 @@
gee() {}
""")
-t.write("lib/Jamfile", """
+t.write("lib/jamfile.jam", """
lib x : x.cpp ;
""")
-t.write("lib/project-root.jam", """
+t.write("lib/jamroot.jam", """
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
t.expect_nothing("lib/bin/$toolset/release/x.obj")
-t.cleanup()
-
+t.cleanup()
Modified: branches/release/tools/build/v2/test/load_dir.py
==============================================================================
--- branches/release/tools/build/v2/test/load_dir.py (original)
+++ branches/release/tools/build/v2/test/load_dir.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,9 +1,8 @@
#!/usr/bin/python
"""
-Traverses a directory and output the code that would
-create the same directory structure during testing.
-Assumes that the instance of Tester is called 't'.
+Traverses a directory and output the code that would create the same directory
+structure during testing. Assumes that the instance of Tester is called 't'.
"""
import sys
@@ -14,6 +13,7 @@
def usage():
print "usage: load_dir.py directory"
+
def remove_first_component(path):
result = [path]
while 1:
@@ -22,8 +22,7 @@
break
result[:1] = list(s)
return apply(os.path.join, result[1:])
-
-
+
def create_file(arg, dirname, fnames):
for n in fnames:
@@ -35,17 +34,17 @@
print l,
print '\n""")\n'
-header = """#!/usr/bin/python
+
+header = """#!/usr/bin/python
# Copyright (C) FILL SOMETHING HERE 2005.
# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
"""
footer = """
@@ -56,7 +55,8 @@
t.cleanup()
"""
-
+
+
def main():
if len(sys.argv) != 2:
usage()
@@ -69,16 +69,13 @@
if not os.path.isdir(path):
print "Path '%s' is not a directory" % (path,)
-
+
print header
-
+
os.path.walk(path, create_file, None)
print footer
+
if __name__ == '__main__':
main()
-
-
-
-
Modified: branches/release/tools/build/v2/test/load_order.py
==============================================================================
--- branches/release/tools/build/v2/test/load_order.py (original)
+++ branches/release/tools/build/v2/test/load_order.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,71 +5,60 @@
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-# Test that we load parent projects before loading children.
-from BoostBuild import Tester, List
-from string import find
+# Test that we load parent projects before loading children.
-t = Tester()
+import BoostBuild
+import string
-t.write("Jamfile", """
-use-project /child : child ;
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
+use-project /child : child ;
ECHO "Setting parent requirements" ;
-project
- : requirements <define>PASS_THE_TEST
- ;
-
-alias x : child//main ;
+project : requirements <define>PASS_THE_TEST ;
+alias x : child//main ;
""")
-t.write("project-root.jam", """
-""")
-
-t.write("child/Jamfile", """
+t.write("child/jamfile.jam", """
ECHO "Setting child requirements" ;
project /child ;
-
-exe main : main.cpp ;
+exe main : main.cpp ;
""")
-t.write("child/main.cpp", """
+t.write("child/main.cpp", """
#if defined(PASS_THE_TEST)
-int main() { return 0; }
+int main() {}
#endif
-
""")
t.run_build_system()
-
t.expect_addition("child/bin/$toolset/debug/main.exe")
-t.fail_test(find(t.stdout(), "Setting child requirements") <
- find(t.stdout(), "Setting parent requirements"))
+t.fail_test(string.find(t.stdout(), "Setting child requirements") <
+ string.find(t.stdout(), "Setting parent requirements"))
-# Regression test: parent requirements were ignored in some cases
+# Regression test: parent requirements were ignored in some cases.
t.rm(".")
-t.write("Jamroot", """
-build-project src ;
+t.write("jamroot.jam", """
+build-project src ;
""")
-t.write("src/Jamfile", """
-project : requirements <define>EVERYTHING_OK ;
+t.write("src/jamfile.jam", """
+project : requirements <define>EVERYTHING_OK ;
""")
-t.write("src/app/Jamfile", """
-exe test : test.cpp ;
+t.write("src/app/jamfile.jam", """
+exe test : test.cpp ;
""")
-t.write("src/app/test.cpp", """
+t.write("src/app/test.cpp", """
#ifdef EVERYTHING_OK
int main() {}
#endif
-
""")
t.run_build_system(subdir="src/app")
t.expect_addition("src/app/bin/$toolset/debug/test.exe")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/loop.py
==============================================================================
--- branches/release/tools/build/v2/test/loop.py (original)
+++ branches/release/tools/build/v2/test/loop.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,27 +1,26 @@
#!/usr/bin/python
-# 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)
+# 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)
-from BoostBuild import Tester, List
-from string import find
+import BoostBuild
+import string
-t = Tester()
-
-
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
lib main : main.cpp l ;
-lib l : l.cpp main ;
+lib l : l.cpp main ;
""")
t.write("main.cpp", "")
+
t.write("l.cpp", "")
t.run_build_system("--no-error-backtrace", status=1)
-t.fail_test(find(t.stdout(), "error: Recursion in main target references") == -1)
-t.fail_test(find(t.stdout(), "./main ./l ./main") == -1)
+t.fail_test(string.find(t.stdout(),
+ "error: Recursion in main target references") == -1)
+t.fail_test(string.find(t.stdout(), "./main ./l ./main") == -1)
t.cleanup()
Modified: branches/release/tools/build/v2/test/m1-01.py
==============================================================================
--- branches/release/tools/build/v2/test/m1-01.py (original)
+++ branches/release/tools/build/v2/test/m1-01.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,19 +1,18 @@
#!/usr/bin/python
-# Copyright 2002 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)
+# Copyright 2002 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)
# Test the very basic 'make' functionality.
-from BoostBuild import Tester, List
-
-t = Tester()
-t.set_tree("test1")
+import BoostBuild
+t = BoostBuild.Tester()
-# Check that we can build something
+t.set_tree("test1")
+# Check that we can build something.
t.run_build_system("-sTOOLSET=yfc")
t.expect_addition("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
@@ -33,18 +32,16 @@
a.cpp
""")
-# Check that we have vanilla target names available
-
+# Check that we have vanilla target names available.
t.touch("a.cpp")
t.run_build_system("-sTOOLSET a.obj")
t.expect_touch("bin/a.obj/yfc/debug/runtime-link-dynamic/a.obj")
t.expect_no_modification("bin/a/yfc/debug/runtime-link-dynamic/a")
-# Check that if build request cannot be completely matches, a warning is
-# issued and subvariant with link-compatible properties is used
-
-t.write("Jamfile", t.read("Jamfile2"))
+# Check that if a build request cannot be completely matches, a warning is
+# issued and a subvariant with link-compatible properties is used.
+t.write("jamfile.jam", t.read("jamfile2.jam"))
stdout="""Warning: cannot exactly satisfy request for ./a with properties
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
Using
@@ -54,7 +51,7 @@
t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
# Check that conflicting link-incompatible requirements prevent building.
-t.write("Jamfile", t.read("Jamfile3"))
+t.write("jamfile.jam", t.read("jamfile3.jam"))
stdout="""Warning: cannot satisfy request for ./a with properties
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
Nothing will be built.
@@ -62,4 +59,3 @@
t.run_build_system("-sTOOLSET=yfc", stdout=stdout, status=1)
t.pass_test()
-
Modified: branches/release/tools/build/v2/test/m1-02.py
==============================================================================
--- branches/release/tools/build/v2/test/m1-02.py (original)
+++ branches/release/tools/build/v2/test/m1-02.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,12 +4,13 @@
# 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)
-# Tests that 'make' accepts target from other directories and that
-# build request for those targets can be overriden.
+# Tests that 'make' accepts targets from other directories and that build
+# requests for those targets can be overriden.
-from BoostBuild import Tester, List
+import BoostBuild
+
+t = BoostBuild.Tester()
-t = Tester()
t.set_tree("test1")
t.run_build_system("-sTOOLSET=yfc")
@@ -31,7 +32,6 @@
b.cpp
""")
-
t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
@@ -41,8 +41,7 @@
b.cpp
""")
-# Check that we have vanilla target names available in subdirs
-
+# Check that we have vanilla target names available in subdirs.
t.touch("auxillary/b.cpp")
t.run_build_system("-sTOOLSET b.obj", subdir="auxillary")
t.expect_touch("auxillary/bin/b.obj/yfc/debug/runtime-link-dynamic/optimization-space/b.obj")
@@ -50,9 +49,8 @@
t.expect_no_modification("bin/a/yfc/debug/runtime-link-dynamic/a")
-# Check that we cannot request link-incompatible property for source target
-
-t.write('Jamfile', t.read('Jamfile2'))
+# Check that we can not request link-incompatible property for source target.
+t.write('jamfile.jam', t.read('jamfile2.jam'))
stdout="""Error: subvariant of target ./a with properties
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
requests link-incompatible property
@@ -61,14 +59,15 @@
"""
t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
-# Check that if we request link-compatible property then requirement for
-# the source target will override it, with warning. This is similar to
-# the way build requests are satisfied (see the first test)
-# CONSIDER: should be print the main target which requests this one
-# (and modifies requiremenets)?
-t.write('Jamfile3', t.read('Jamfile3'))
-t.write('auxillary/Jamfile3', t.read('auxillary/Jamfile3'))
+# Check that if we request link-compatible property then requirement for the
+# source target will override it, with a warning. This is similar to the way
+# build requests are satisfied (see the first test).
+#
+# CONSIDER: should be print the main target which requests this one (and
+# modifies requirements)?
+t.write('jamfile.jam', t.read('jamfile3.jam'))
+t.write('auxillary/jamfile.jam', t.read('auxillary/jamfile3.jam'))
stdout="""Warning: cannot exactly satisfy request for auxillary/b.obj with properties
<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
Using
@@ -78,15 +77,14 @@
t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
-# Check for link-incompatible properties
-
-t.write('Jamfile4', t.read('Jamfile4'))
-t.write('auxillary/Jamfile4', t.read('auxillary/Jamfile4'))
+# Check for link-incompatible properties.
+t.write('jamfile.jam', t.read('jamfile4.jam'))
+t.write('auxillary/jamfile.jam', t.read('auxillary/jamfile4.jam'))
stdout="""Warning: cannot satisfy request for auxillary/b.obj with properties
<optimization>space <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
Nothing will be built.
-""")
+"""
+t.run_build_system("-sTOOLSET=yfc", stdout=stdout)
t.pass_test()
-
Modified: branches/release/tools/build/v2/test/m1-03.py
==============================================================================
--- branches/release/tools/build/v2/test/m1-03.py (original)
+++ branches/release/tools/build/v2/test/m1-03.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,16 +1,16 @@
#!/usr/bin/python
-# Copyright 2002 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)
+# Copyright 2002 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)
-# Tests that we can use objects from other projects
-# (i.e. with other project root)
-# Test also that we can refer to those target using project-id.
+# Tests that we can use objects from other projects, i.e. with other project
+# root. Test also that we can refer to those target using project-id.
-from BoostBuild import Tester, List
+import BoostBuild
+
+t = BoostBuild.Tester()
-t = Tester()
t.set_tree("test1")
t.run_build_system("-sTOOLSET=yfc", subdir="p1")
@@ -39,7 +39,6 @@
a.cpp
""")
-
t.fail(t.read("bin/a/yfc/debug/runtime-link-dynamic/a") !=\
"""
<optimization>off <rtti>on <runtime-link>dynamic <toolset>yfc <variant>debug
@@ -55,7 +54,4 @@
# TODO: need to write test cases for referring to targets using project-id.
-
-
t.pass_test()
-
Modified: branches/release/tools/build/v2/test/make_rule.py
==============================================================================
--- branches/release/tools/build/v2/test/make_rule.py (original)
+++ branches/release/tools/build/v2/test/make_rule.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,19 +1,18 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2003, 2006 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2003, 2006 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)
-# Test the 'make' rule
+# Test the 'make' rule.
-from BoostBuild import Tester
-from string import find
+import BoostBuild
+import string
-t = Tester(pass_toolset=1)
-
-t.write("Jamroot", """
+t = BoostBuild.Tester(pass_toolset=1)
+t.write("jamroot.jam", """
import feature ;
feature.feature test_feature : : free ;
@@ -30,32 +29,29 @@
t.run_build_system()
t.expect_addition("bin/$toolset/debug/foo.bar")
-t.fail_test(find(t.read("bin/$toolset/debug/foo.bar"), "12345678") == -1)
+t.fail_test(string.find(t.read("bin/$toolset/debug/foo.bar"), "12345678") == -1)
+
-# Regression test. Make sure that if main target requested two times,
-# and build request differ only in incidental properties, the main target
-# if created only once. The bug was discovered by Kirill Lapshin.
-
-t.write("Jamroot", """
-# Make sure that incidental property does not
-# cause second creation of 'hello1.cpp'.
+# Regression test. Make sure that if a main target is requested two times, and
+# build requests differ only in incidental properties, the main target is
+# created only once. The bug was discovered by Kirill Lapshin.
+t.write("jamroot.jam", """
+# Make sure that incidental property does not cause second creation of
+# 'hello1.cpp'.
exe a : dir//hello1.cpp ;
-exe b : dir//hello1.cpp/<hardcode-dll-paths>true ;
+exe b : dir//hello1.cpp/<hardcode-dll-paths>true ;
""")
-t.write("dir/Jamfile", """
+t.write("dir/jamfile.jam", """
import common ;
make hello1.cpp : hello.cpp : common.copy ;
-
""")
t.write("dir/hello.cpp", """
-int main()
-{
- return 1;
-}
+int main() {}
""")
-# Show only names of the actions.
+
+# Show only action names.
t.run_build_system("-d1 -n")
t.fail_test(t.stdout().count("copy") != 1)
Modified: branches/release/tools/build/v2/test/module_actions.py
==============================================================================
--- branches/release/tools/build/v2/test/module_actions.py (original)
+++ branches/release/tools/build/v2/test/module_actions.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -46,7 +46,7 @@
# Accomodate for that fact.
if os.name != 'nt':
expected_output = re.sub(spaces_re, " ", expected_output)
- expected_output = re.sub(trailing_spaces_re, "\n", expected_output)
+ expected_output = re.sub(trailing_spaces_re, "\n", expected_output)
t.run_build_system(stdout=expected_output)
t.expect_nothing_more()
Modified: branches/release/tools/build/v2/test/ndebug.py
==============================================================================
--- branches/release/tools/build/v2/test/ndebug.py (original)
+++ branches/release/tools/build/v2/test/ndebug.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,35 +1,30 @@
#!/usr/bin/python
-# 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)
+# 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)
-# Test that building with optimization brings NDEBUG define, and, more
-# importantly, that dependency targets are built with NDEBUG as well,
-# even if they are not directly requested.
+# Test that building with optimization brings NDEBUG define, and, more
+# importantly, that dependency targets are built with NDEBUG as well, even if
+# they are not directly requested.
+import BoostBuild
-from BoostBuild import Tester, List
+t = BoostBuild.Tester()
-
-t = Tester()
-
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamroot.jam", """
exe hello : hello.cpp lib//lib1 ;
""")
+
t.write("hello.cpp", """
#ifdef NDEBUG
void foo();
-int main()
-{
- foo();
- return 0;
-}
+int main() { foo(); }
#endif
""")
-t.write("lib/Jamfile", """
-lib lib1 : lib1.cpp ;
+
+t.write("lib/jamfile.jam", """
+lib lib1 : lib1.cpp ;
""")
t.write("lib/lib1.cpp", """
#ifdef NDEBUG
@@ -37,10 +32,8 @@
#endif
""")
-# 'release' builds should get NDEBUG define
-# use static linking to avoid messing with
-# imports/exports on windows.
+# 'release' builds should get the NDEBUG define. We use static linking to avoid
+# messing with imports/exports on windows.
t.run_build_system("link=static release")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/no_type.py
==============================================================================
--- branches/release/tools/build/v2/test/no_type.py (original)
+++ branches/release/tools/build/v2/test/no_type.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,17 +4,18 @@
# 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)
-# Test that we cannot specify targets of unknown type as sources.
-# This is based on the fact that Unix 'ar' will happily consume
-# just about anything.
+# Test that we cannot specify targets of unknown type as sources. This is based
+# on the fact that Unix 'ar' will happily consume just about anything.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", """
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
+import gcc ;
static-lib a : a.foo ;
""")
+
t.write("a.foo", "")
t.run_build_system(status=1)
Modified: branches/release/tools/build/v2/test/notfile.py
==============================================================================
--- branches/release/tools/build/v2/test/notfile.py (original)
+++ branches/release/tools/build/v2/test/notfile.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,22 +1,20 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2005.
-# 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)
+# Copyright (C) Vladimir Prus 2005.
+# 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)
-# Basic tests for the 'notfile' rule.
+# Basic tests for the 'notfile' rule.
-from BoostBuild import Tester, List
+import BoostBuild
import string
import os
-import fnmatch
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+t.write("jamroot.jam", """
import notfile ;
-
notfile say : "echo hi" ;
exe hello : hello.cpp ;
@@ -26,19 +24,11 @@
{
valgrind $(>)
}
-
""")
t.write("hello.cpp", """
-
#include <iostream>
-
-int main()
-{
- std::cout << "Hello!\\n";
- return 1;
-}
-
+int main() { std::cout << "Hello!\\n"; }
""")
@@ -51,6 +41,4 @@
c = "valgrind " + name
t.expect_output_line(c)
-
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/ordered_properties.py
==============================================================================
--- branches/release/tools/build/v2/test/ordered_properties.py (original)
+++ branches/release/tools/build/v2/test/ordered_properties.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,42 +1,30 @@
#!/usr/bin/python
-# Copyright 2004 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)
-
-# This file is template for Boost.Build tests. It creates a simple
-# project that builds one exe from one source, and checks that the exe
-# is really created.
-from BoostBuild import Tester, List
+# Copyright 2004 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)
# This checks that Boost.Build does not reorder <include> properties
# lexicographically.
-t = Tester()
-t.write("a.cpp", """
-#include <a.h>
-
-int main()
-{
- foo();
- return 0;
-}
+import BoostBuild
-""")
+t = BoostBuild.Tester()
-t.write("Jamfile", """
-exe a : a.cpp : <include>d2 <include>d1 ;
+t.write("a.cpp", """
+#include <a.h>
+int main() { foo(); }
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
+exe a : a.cpp : <include>d2 <include>d1 ;
""")
-t.write("d1/a.h", """
+t.write("d1/a.h", """
""")
-t.write("d2/a.h", """
+t.write("d2/a.h", """
inline void foo() {}
-
""")
t.run_build_system()
Modified: branches/release/tools/build/v2/test/out_of_tree.py
==============================================================================
--- branches/release/tools/build/v2/test/out_of_tree.py (original)
+++ branches/release/tools/build/v2/test/out_of_tree.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,41 +1,34 @@
#!/usr/bin/python
-# Copyright (C) FILL SOMETHING HERE 2005.
-# 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)
-
-# Tests that we can build a project when the current directory is outside of
-# that project tree, that is:
-# bjam some_dir
-# works.
-from BoostBuild import Tester, List
+# Copyright (C) FILL SOMETHING HERE 2005.
+# 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)
-# Create a temporary working directory
-t = Tester()
+# Tests that we can build a project when the current directory is outside of
+# that project tree, that is 'bjam some_dir' works.
-# Create the needed files
-t.write("p1/Jamroot", """
+import BoostBuild
+
+# Create a temporary working directory.
+t = BoostBuild.Tester()
+
+# Create the needed files.
+t.write("p1/jamroot.jam", """
exe hello : hello.cpp ;
""")
-t.write("p1/hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("p1/hello.cpp", """
+int main() {}
""")
-t.write("p2/Jamroot", """
+t.write("p2/jamroot.jam", """
exe hello2 : hello.cpp ;
exe hello3 : hello.cpp ;
""")
-t.write("p2/hello.cpp", """
-int main()
-{
- return 0;
-}
+t.write("p2/hello.cpp", """
+int main() {}
""")
t.run_build_system("p1 p2//hello3")
Modified: branches/release/tools/build/v2/test/path_features.py
==============================================================================
--- branches/release/tools/build/v2/test/path_features.py (original)
+++ branches/release/tools/build/v2/test/path_features.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,11 +5,12 @@
# 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)
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", "lib a : a.cpp : <include>. ;")
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "import gcc ;")
+t.write("jamfile.jam", "lib a : a.cpp : <include>. ;")
t.write("a.cpp", """
#include <a.h>
void
@@ -20,21 +21,23 @@
""")
t.write("a.h", "//empty file\n")
-t.write("d/Jamfile", "exe b : b.cpp ..//a ; ")
+t.write("d/jamfile.jam", "exe b : b.cpp ..//a ; ")
t.write("d/b.cpp", """
- void foo();
- int main() { foo(); }
+void foo();
+int main() { foo(); }
""")
t.run_build_system(subdir="d")
-# Now test the path features with condition work as well
-t.write("Jamfile", "lib a : a.cpp : <variant>debug:<include>. ;")
+# Now test the path features with condition work as well.
+t.write("jamfile.jam", "lib a : a.cpp : <variant>debug:<include>. ;")
t.rm("bin")
t.run_build_system(subdir="d")
-# Test path features with condtion in usage requirements
-t.write("Jamfile", "lib a : a.cpp : <include>. : : <variant>debug:<include>. ;")
+# Test path features with condition in usage requirements.
+t.write("jamfile.jam", """
+lib a : a.cpp : <include>. : : <variant>debug:<include>. ;
+""")
t.write("d/b.cpp", """
#include <a.h>
void foo();
@@ -43,11 +46,11 @@
t.rm("d/bin")
t.run_build_system(subdir="d")
-# Test that absolute paths inside requirements are ok. The problem
-# appear only when building targets in subprojects.
-t.write("project-root.jam", "")
-t.write("Jamfile", "build-project x ; ")
-t.write("x/Jamfile", """
+# Test that absolute paths inside requirements are ok. The problems appeared
+# only when building targets in subprojects.
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", "build-project x ; ")
+t.write("x/jamfile.jam", """
local pwd = [ PWD ] ;
project : requirements <include>$(pwd)/x/include ;
exe m : m.cpp : <include>$(pwd)/x/include2 ;
@@ -55,7 +58,6 @@
t.write("x/m.cpp", """
#include <h1.hpp>
#include <h2.hpp>
-
int main() {}
""")
t.write("x/include/h1.hpp", "\n")
@@ -66,8 +68,8 @@
# Test that "&&" in path features is handled correctly.
t.rm("bin")
-t.write("Jamfile", "build-project sub ;")
-t.write("sub/Jamfile", """
+t.write("jamfile.jam", "build-project sub ;")
+t.write("sub/jamfile.jam", """
exe a : a.cpp : <include>../h1&&../h2 ;
""")
t.write("sub/a.cpp", """
Modified: branches/release/tools/build/v2/test/pch.py
==============================================================================
--- branches/release/tools/build/v2/test/pch.py (original)
+++ branches/release/tools/build/v2/test/pch.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,63 +1,49 @@
#!/usr/bin/python
-# Copyright 2006 Vladimir Prus.
-# 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)
-
-from BoostBuild import Tester, List
-import string
-import os
+# Copyright 2006 Vladimir Prus.
+# 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)
-t = Tester()
+import BoostBuild
-t.write("Jamroot", """
-import pch ;
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
+import pch ;
cpp-pch pch : pch.hpp : <toolset>msvc:<source>pch.cpp <include>. ;
-
-exe hello : hello.cpp pch : <include>. ;
+exe hello : hello.cpp pch : <include>. ;
""")
-t.write("pch.hpp.bad", """
-THIS WON'T COMPILE
+t.write("pch.hpp.bad", """
+THIS WILL NOT COMPILE
""")
-# Note that pch.hpp is written after pch.hpp.bad, so its timestamp won't
-# be less than timestamp of pch.hpp.bad.
-t.write("pch.hpp", """
-class TestClass {
+# Note that pch.hpp is written after pch.hpp.bad, so its timestamp will not be
+# less than timestamp of pch.hpp.bad.
+t.write("pch.hpp", """
+class TestClass
+{
public:
- TestClass(int, int) {}
+ TestClass( int, int ) {}
};
-
""")
-
-
-t.write("pch.cpp", """ #include <pch.hpp>
-
+t.write("pch.cpp", """#include <pch.hpp>
""")
-t.write("hello.cpp", """ #include <pch.hpp>
-
-int main()
-{
- TestClass c(1, 2);
- return 0;
-}
-
+t.write("hello.cpp", """#include <pch.hpp>
+int main() { TestClass c(1, 2); }
""")
t.run_build_system()
-
t.expect_addition("bin/$toolset/debug/hello.exe")
-# Now make the header unusable, without changing timestamp.
-# If everything is OK, Boost.Build won't recreate PCH, and
-# compiler will happily use pre-compiled header, not noticing
-# that the real header is bad.
+
+# Now make the header unusable, without changing timestamp. If everything is OK,
+# Boost.Build will not recreate PCH, and compiler will happily use pre-compiled
+# header, not noticing that the real header is bad.
t.copy_preserving_timestamp("pch.hpp.bad", "pch.hpp")
@@ -67,4 +53,3 @@
t.expect_addition("bin/$toolset/debug/hello.obj")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/prebuilt.py
==============================================================================
--- branches/release/tools/build/v2/test/prebuilt.py (original)
+++ branches/release/tools/build/v2/test/prebuilt.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,38 +6,38 @@
# Test that we can use already built sources
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
t.set_tree('prebuilt')
-t.expand_toolset("ext/project-root.jam")
-t.expand_toolset("project-root.jam")
-# First, build the external project
-t.run_build_system("debug release", subdir="ext")
+t.expand_toolset("ext/jamroot.jam")
+t.expand_toolset("jamroot.jam")
-# Then pretend that we don't have the sources for the external project,
-# and can only use compiled binaries
-t.copy("ext/Jamfile2", "ext/Jamfile")
-t.expand_toolset("ext/Jamfile")
-
-# Now check that we can build the main project, and that
-# correct prebuilt file is picked, depending of variant.
-# This also checks that correct includes for prebuilt
-# libraries are used.
+# First, build the external project.
+t.run_build_system("debug release", subdir="ext")
+# Then pretend that we do not have the sources for the external project, and can
+# only use compiled binaries.
+t.copy("ext/jamfile2.jam", "ext/jamfile.jam")
+t.expand_toolset("ext/jamfile.jam")
+
+# Now check that we can build the main project, and that correct prebuilt file
+# is picked, depending of variant. This also checks that correct includes for
+# prebuilt libraries are used.
t.run_build_system("debug release")
t.expect_addition("bin/$toolset/debug/hello.exe")
t.expect_addition("bin/$toolset/release/hello.exe")
t.rm("bin")
-# Now test that prebuilt file specified by absolute name
-# works too.
-t.copy("ext/Jamfile3", "ext/Jamfile")
-t.expand_toolset("ext/Jamfile")
+
+
+# Now test that prebuilt file specified by absolute name works too.
+t.copy("ext/jamfile3.jam", "ext/jamfile.jam")
+t.expand_toolset("ext/jamfile.jam")
t.run_build_system("debug release")
t.expect_addition("bin/$toolset/debug/hello.exe")
t.expect_addition("bin/$toolset/release/hello.exe")
-
t.cleanup()
Deleted: branches/release/tools/build/v2/test/prebuilt/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/prebuilt/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2002, 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)
-
-
-project test
- : requirements <variant>release:<define>RELEASE
- ;
-
-use-project /ext : ext ;
-
-exe hello : hello.cpp /ext//a ;
-
Deleted: branches/release/tools/build/v2/test/prebuilt/ext/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/prebuilt/ext/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2002 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)
-
-
-project ext
- : requirements <variant>release:<define>RELEASE
- ;
-
-lib a : a.cpp ;
-
-install dist : a : <variant>release:<location>release
- <variant>debug:<location>debug ;
Deleted: branches/release/tools/build/v2/test/prebuilt/ext/Jamfile2
==============================================================================
--- branches/release/tools/build/v2/test/prebuilt/ext/Jamfile2 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,39 +0,0 @@
-
-import modules ;
-
-local dll-suffix = so ;
-local prefix = "" ;
-if [ modules.peek : OS ] in CYGWIN NT
-{
- if $toolset = gcc
- {
- dll-suffix = dll ;
- }
- else
- {
- dll-suffix = lib ;
- }
-}
-else
-{
- prefix = "lib" ;
-}
-if $toolset = darwin
-{
- dll-suffix = dylib ;
-}
-
-project ext ;
-
-lib a :
- : <file>debug/$(prefix)a.$(dll-suffix) <variant>debug
- :
- : <include>debug
- ;
-
-lib a :
- : <file>release/$(prefix)a.$(dll-suffix) <variant>release
- :
- : <include>release
- ;
-
Deleted: branches/release/tools/build/v2/test/prebuilt/ext/Jamfile3
==============================================================================
--- branches/release/tools/build/v2/test/prebuilt/ext/Jamfile3 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,46 +0,0 @@
-
-# This Jamfile is the same as Jamfile2, except that
-# it tries to access prebuilt targets using absolute
-# paths. It used to be broken on Windows.
-
-import modules ;
-
-local dll-suffix = so ;
-local prefix = "" ;
-if [ modules.peek : OS ] in CYGWIN NT
-{
- if $toolset = gcc
- {
- dll-suffix = dll ;
- }
- else
- {
- dll-suffix = lib ;
- }
-}
-else
-{
- prefix = "lib" ;
-}
-if $toolset = darwin
-{
- dll-suffix = dylib ;
-}
-
-project ext ;
-
-# Assumed bjam was invoked from the project root
-local pwd = [ PWD ] ;
-
-lib a :
- : <file>$(pwd)/ext/debug/$(prefix)a.$(dll-suffix) <variant>debug
- :
- : <include>debug
- ;
-
-lib a :
- : <file>$(pwd)/ext/release/$(prefix)a.$(dll-suffix) <variant>release
- :
- : <include>release
- ;
-
Deleted: branches/release/tools/build/v2/test/prebuilt/ext/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/prebuilt/ext/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-# Copyright 2002, 2004 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)
-
-
Deleted: branches/release/tools/build/v2/test/prebuilt/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/prebuilt/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-# Copyright 2002, 2004 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)
-
Modified: branches/release/tools/build/v2/test/print.py
==============================================================================
--- branches/release/tools/build/v2/test/print.py (original)
+++ branches/release/tools/build/v2/test/print.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,12 +5,13 @@
# 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", """
+t.write("jamroot.jam", "import gcc ;")
+
+t.write("jamfile.jam", """
import print ;
print.output foo ;
print.text \\\"Something\\\" ;
@@ -21,7 +22,7 @@
t.run_build_system()
t.expect_content("foo", """\"Something\"""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
import print ;
print.output foo ;
print.text \\\n\\\"Somethingelse\\\" ;
@@ -33,7 +34,7 @@
t.expect_content("foo", """\"Something\"
\"Somethingelse\"""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
import print ;
print.output foo ;
print.text \\\"Different\\\" : true ;
Deleted: branches/release/tools/build/v2/test/project-test1/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test1/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,10 +0,0 @@
-# Copyright 2002 Dave Abrahams
-# Copyright 2002 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)
-
-project /boost-build-test-project-1
- : requirements <threading>multi <include>/home/ghost/local/include ;
-
-build-project dir2 ;
-build-project dir ;
Deleted: branches/release/tools/build/v2/test/project-test1/dir/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test1/dir/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,10 +0,0 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2002 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)
-
-
-project /boost-build-test-project-1/dir
- : source-location src
- : default-build release
- ;
Deleted: branches/release/tools/build/v2/test/project-test1/dir2/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test1/dir2/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2004 Rene Rivera
-# Copyright 2002, 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)
-
-
-project /cool-library
- : requirements <include>/home/ghost/build/boost-cvs
- ;
Deleted: branches/release/tools/build/v2/test/project-test1/dir2/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/project-test1/dir2/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-# Copyright 2002 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)
-
Deleted: branches/release/tools/build/v2/test/project-test1/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/project-test1/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-# Copyright 2002 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)
-
-
-import builtin ;
Deleted: branches/release/tools/build/v2/test/project-test3/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test3/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright 2002, 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)
-
-
-use-project /lib2 : lib2 ;
-use-project /lib3 : lib3 ;
-
-make a.exe : a.obj lib//b.obj /lib2//c.obj lib2//d.obj lib2/helper//e.obj /lib3//f.obj : yfc-link ;
-make a.obj : a.cpp : yfc-compile ;
-
-build-project lib2 ;
-build-project lib ;
Deleted: branches/release/tools/build/v2/test/project-test3/lib/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test3/lib/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2002, 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)
-
-
-use-project /lib2 : ../lib2 ;
-
-make b.obj : b.cpp : yfc-compile ;
-make m.exe : b.obj /lib2//c.obj : yfc-link ;
Deleted: branches/release/tools/build/v2/test/project-test3/lib2/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test3/lib2/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,11 +0,0 @@
-# Copyright 2002, 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)
-
-
-project lib2 ;
-use-project /lib2/helper : helper ;
-
-make c.obj : c.cpp : yfc-compile ;
-make d.obj : d.cpp : yfc-compile ;
-make l.exe : c.obj ..//a.obj : yfc-link ;
Deleted: branches/release/tools/build/v2/test/project-test3/lib2/helper/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test3/lib2/helper/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-# Copyright 2002 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)
-
-
-project lib2/helper ;
-
-make e.obj : e.cpp : yfc-compile ;
-
Deleted: branches/release/tools/build/v2/test/project-test3/lib3/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test3/lib3/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,37 +0,0 @@
-# Copyright 2003, 2005 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)
-
-# This project-root.jam also serves the role of Jamfile
-project lib3 ;
-
-use-project /lib2/helper : ../lib2/helper ;
-
-import property ;
-
-rule properties-as-path ( properties * )
-{
- local r ;
- for local p in $(properties)
- {
- if $(p:G) != <action>
- {
- r += $(p) ;
- }
- }
- return [ property.as-path
- [ property.remove incidental : $(r) ] ] ;
-}
-
-rule mfc-compile ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions mfc-compile
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-make f.obj : f.cpp /lib2/helper//e.obj : mfc-compile ;
Deleted: branches/release/tools/build/v2/test/project-test3/lib3/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/project-test3/lib3/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-# Copyright 2002 Rene Rivera
-# Copyright 2002, 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)
-
Deleted: branches/release/tools/build/v2/test/project-test3/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/project-test3/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,46 +0,0 @@
-# Copyright 2002-2005 Vladimir Prus.
-# 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)
-
-import gcc ;
-import property ;
-
-rule properties-as-path ( properties * )
-{
- local r ;
- for local p in $(properties)
- {
- if $(p:G) != <action>
- {
- r += $(p) ;
- }
- }
- return [ property.as-path
- [ property.remove incidental : $(r) ] ] ;
-}
-
-rule yfc-compile ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions yfc-compile
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-rule yfc-link ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions yfc-link
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-
-IMPORT $(__name__) : yfc-compile yfc-link : : yfc-compile yfc-link ;
Deleted: branches/release/tools/build/v2/test/project-test4/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,11 +0,0 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 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)
-
-
-project test : requirements <include>everything <threading>single ;
-
-make a.exe : a.obj lib//b.obj/<optimization>speed : yfc-link ;
-make b.exe : a.obj : yfc-link : <define>MACROS ;
-make a.obj : a.cpp : yfc-compile ;
Deleted: branches/release/tools/build/v2/test/project-test4/Jamfile3
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/Jamfile3 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-
-make a.exe : a.obj lib//b.obj/<optimization>on a_gcc.obj : yfc-link : <toolset>gcc ;
-make a.exe : a.obj lib//b.obj/<optimization>on : yfc-link : <threading>multi ;
-make a.obj : a.cpp : yfc-compile ;
-make a_gcc.obj : a_gcc.cpp : yfc-compile ;
Deleted: branches/release/tools/build/v2/test/project-test4/Jamfile4
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/Jamfile4 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-
-project test : requirements <include>everything <threading>single ;
-
-build-project lib2 ;
Deleted: branches/release/tools/build/v2/test/project-test4/Jamfile5
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/Jamfile5 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-
-project test : requirements <include>everything <threading>single ;
-
-make a.exe : a.obj lib//b.obj/<variant>release : yfc-link ;
-make b.exe : a.obj : yfc-link : <define>MACROS ;
-make a.obj : a.cpp : yfc-compile ;
Deleted: branches/release/tools/build/v2/test/project-test4/lib/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/lib/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,6 +0,0 @@
-# Copyright 2002 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)
-
-
-make b.obj : b.cpp : yfc-compile ;
Deleted: branches/release/tools/build/v2/test/project-test4/lib/Jamfile1
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/lib/Jamfile1 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,2 +0,0 @@
-
-make b.obj : b.cpp : yfc-compile ;
Deleted: branches/release/tools/build/v2/test/project-test4/lib/Jamfile2
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/lib/Jamfile2 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-
-project lib : requirements <threading>multi ;
-
-make b.obj : b.cpp : yfc-compile ;
Deleted: branches/release/tools/build/v2/test/project-test4/lib/Jamfile3
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/lib/Jamfile3 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,2 +0,0 @@
-
-make b.obj : b.cpp : yfc-compile : <rtti>off ;
Deleted: branches/release/tools/build/v2/test/project-test4/lib2/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/lib2/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,8 +0,0 @@
-# Copyright 2002 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)
-
-
-project
- : requirements <rtti>off
- ;
Deleted: branches/release/tools/build/v2/test/project-test4/lib2/Jamfile2
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/lib2/Jamfile2 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,4 +0,0 @@
-
-project mylib
- : requirements <rtti>off
- ;
Deleted: branches/release/tools/build/v2/test/project-test4/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/project-test4/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,47 +0,0 @@
-# Copyright 2002, 2003, 2005 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)
-
-
-import gcc ;
-import property ;
-
-rule properties-as-path ( properties * )
-{
- local r ;
- for local p in $(properties)
- {
- if $(p:G) != <action>
- {
- r += $(p) ;
- }
- }
- return [ property.as-path
- [ property.remove incidental : $(r) ] ] ;
-}
-
-
-rule yfc-compile ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions yfc-compile
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-rule yfc-link ( target : sources * : property-set * )
-{
- PROPERTIES on $(target) = [ properties-as-path $(property-set) ] ;
-}
-
-actions yfc-link
-{
- echo $(PROPERTIES) > $(<)
- echo $(>) >> $(<)
-}
-
-
-IMPORT $(__name__) : yfc-compile yfc-link : : yfc-compile yfc-link ;
Modified: branches/release/tools/build/v2/test/project_dependencies.py
==============================================================================
--- branches/release/tools/build/v2/test/project_dependencies.py (original)
+++ branches/release/tools/build/v2/test/project_dependencies.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,51 +1,51 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2004 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)
-# Test that we can specify a dependency property
-# in project requirements, and that it won't
-# cause every main target in the project to
-# be generated in it's own subdirectory.
+# Test that we can specify a dependency property in project requirements, and
+# that it will not cause every main target in the project to be generated in its
+# own subdirectory.
-# The whole test is somewhat moot now.
+# The whole test is somewhat moot now.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "build-project src ;")
+
+t.write("lib/jamfile.jam", "lib lib1 : lib1.cpp ;")
-t.write("Jamroot", "build-project src ;")
-t.write("lib/Jamfile", "lib lib1 : lib1.cpp ;")
t.write("lib/lib1.cpp", """
#ifdef _WIN32
__declspec(dllexport)
#endif
void foo() {}\n
""")
-t.write("src/Jamfile", """
-project
- : requirements <library>../lib//lib1
- ;
-
+
+t.write("src/jamfile.jam", """
+project : requirements <library>../lib//lib1 ;
exe a : a.cpp ;
-exe b : b.cpp ;
+exe b : b.cpp ;
""")
+
t.write("src/a.cpp", """
#ifdef _WIN32
__declspec(dllimport)
#endif
void foo();
-int main() { foo(); return 0; }
+int main() { foo(); }
""")
+
t.copy("src/a.cpp", "src/b.cpp")
t.run_build_system()
-# Test that there's no "main-target-a" part.
+# Test that there is no "main-target-a" part.
# t.expect_addition("src/bin/$toolset/debug/a.exe")
# t.expect_addition("src/bin/$toolset/debug/b.exe")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/project_glob.py
==============================================================================
--- branches/release/tools/build/v2/test/project_glob.py (original)
+++ branches/release/tools/build/v2/test/project_glob.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,48 +5,41 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-# Test the 'glob' rule in Jamfile context.
-from BoostBuild import Tester, List
-import os
-import string
+# Test the 'glob' rule in Jamfile context.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", """
-""")
+# Create a temporary working directory.
+t = BoostBuild.Tester()
-t.write("Jamfile", """
+t.write("jamroot.jam", """
""")
-t.write("d1/a.cpp", """
-int main() { return 0; }
-
+t.write("d1/a.cpp", """
+int main() {}
""")
-t.write("d1/Jamfile", """
-exe a : [ glob *.cpp ] ../d2/d//l ;
+t.write("d1/jamfile.jam", """
+exe a : [ glob *.cpp ] ../d2/d//l ;
""")
-t.write("d2/d/l.cpp", """
+t.write("d2/d/l.cpp", """
#if defined(_WIN32)
__declspec(dllexport)
void force_import_lib_creation() {}
#endif
""")
-t.write("d2/d/Jamfile", """
-lib l : [ glob *.cpp ] ;
+t.write("d2/d/jamfile.jam", """
+lib l : [ glob *.cpp ] ;
""")
-t.write("d3/d/Jamfile", """
+t.write("d3/d/jamfile.jam", """
exe a : [ glob ../*.cpp ] ;
""")
+
t.write("d3/a.cpp", """
-int main()
-{
- return 0;
-}
+int main() {}
""")
t.run_build_system(subdir="d1")
@@ -56,49 +49,46 @@
t.expect_addition("d3/d/bin/$toolset/debug/a.exe")
t.rm("d2/d/bin")
+
t.run_build_system(subdir="d2/d")
t.expect_addition("d2/d/bin/$toolset/debug/l.dll")
-# Test that when 'source-location' is explicitly-specified
-# glob works relatively to source location
-t.rm("d1")
-t.write("d1/src/a.cpp", """
-int main() { return 0; }
+# Test that when 'source-location' is explicitly-specified glob works relatively
+# to the source location.
+t.rm("d1")
+t.write("d1/src/a.cpp", """
+int main() {}
""")
-t.write("d1/Jamfile", """
+t.write("d1/jamfile.jam", """
project : source-location src ;
-exe a : [ glob *.cpp ] ../d2/d//l ;
+exe a : [ glob *.cpp ] ../d2/d//l ;
""")
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")
-# Test that wildcards can include directories. Also
-# test exclusion patterns.
+# Test that wildcards can include directories. Also test exclusion patterns.
t.rm("d1")
t.write("d1/src/foo/a.cpp", """
void bar();
-int main() { bar(); return 0; }
-
+int main() { bar(); }
""")
t.write("d1/src/bar/b.cpp", """
void bar() {}
-
""")
t.write("d1/src/bar/bad.cpp", """
very bad non-compilable file
""")
-
-t.write("d1/Jamfile", """
+t.write("d1/jamfile.jam", """
project : source-location src ;
-exe a : [ glob foo/*.cpp bar/*.cpp : bar/bad* ] ../d2/d//l ;
+exe a : [ glob foo/*.cpp bar/*.cpp : bar/bad* ] ../d2/d//l ;
""")
t.run_build_system(subdir="d1")
@@ -107,18 +97,20 @@
# Test that 'glob-tree' works.
t.rm("d1/bin/$toolset/debug/a.exe")
-t.write("d1/Jamfile", """
+
+t.write("d1/jamfile.jam", """
project : source-location src ;
-exe a : [ glob-tree *.cpp : bad* ] ../d2/d//l ;
+exe a : [ glob-tree *.cpp : bad* ] ../d2/d//l ;
""")
+
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")
-# Test that directory names in patterns for
-# 'glob-tree' are rejected.
-t.write("d1/Jamfile", """
+
+# Test that directory names in patterns for 'glob-tree' are rejected.
+t.write("d1/jamfile.jam", """
project : source-location src ;
-exe a : [ glob-tree foo/*.cpp bar/*.cpp : bad* ] ../d2/d//l ;
+exe a : [ glob-tree foo/*.cpp bar/*.cpp : bad* ] ../d2/d//l ;
""")
t.run_build_system(subdir="d1", status=1)
@@ -127,51 +119,40 @@
t.rm("d1/src/bar/bad.cpp")
-# Test that 'glob' works with absolute names
+# Test that 'glob' works with absolute names.
t.rm("d1/bin")
-# Note that to get current dir, we use bjam's PWD,
-# not Python's os.getcwd, because the former will
-# always return long path. The latter might return
-# short path, and that will confuse path.glob.
-t.write("d1/Jamfile", """
+# Note that to get current dir, we use bjam's PWD, not Python's os.getcwd(),
+# because the former will always return long path while the latter might return
+# a short path, and that will confuse path.glob.
+t.write("d1/jamfile.jam", """
project : source-location src ;
-local pwd = [ PWD ] ; # Always absolute
-exe a : [ glob $(pwd)/src/foo/*.cpp $(pwd)/src/bar/*.cpp ] ../d2/d//l ;
+local pwd = [ PWD ] ; # Always absolute
+exe a : [ glob $(pwd)/src/foo/*.cpp $(pwd)/src/bar/*.cpp ] ../d2/d//l ;
""")
t.run_build_system(subdir="d1")
t.expect_addition("d1/bin/$toolset/debug/a.exe")
-# Regression test: glob excludes used to be broken
-# when building from a subdirectory.
+
+# Regression test: glob excludes used to be broken when building from a
+# subdirectory.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
build-project p ;
""")
-t.write("p/p.c", """
-int main()
-{
- return 0;
-}
-
-
+t.write("p/p.c", """
+int main() {}
""")
-t.write("p/p_x.c", """
-int main()
-{
- return 0;
-}
-
+t.write("p/p_x.c", """
+int main() {}
""")
-t.write("p/Jamfile", """
-exe p :
- [ glob *.c : p_x.c ]
- ;
+t.write("p/jamfile.jam", """
+exe p : [ glob *.c : p_x.c ] ;
""")
t.run_build_system(subdir="p")
Modified: branches/release/tools/build/v2/test/project_root_constants.py
==============================================================================
--- branches/release/tools/build/v2/test/project_root_constants.py (original)
+++ branches/release/tools/build/v2/test/project_root_constants.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,26 +4,25 @@
# 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)
-from BoostBuild import Tester, List
-from string import find
+import BoostBuild
+import string
-# Create a temporary working directory
-t = Tester()
+# Create a temporary working directory.
+t = BoostBuild.Tester()
-# Create the needed files
-t.write("project-root.jam", """
+# Create the needed files.
+t.write("jamroot.jam", """
constant FOO : foobar gee ;
ECHO $(FOO) ;
""")
-t.write("Jamfile", """
-""")
t.run_build_system()
-t.fail_test(find(t.stdout(), "foobar gee") == -1)
+t.fail_test(string.find(t.stdout(), "foobar gee") == -1)
# Regression test: when absolute paths were passed to path-constant rule,
-# Boost.Build failed to recognize path as absolute and prepended current dir.
-t.write("project-root.jam", """
+# Boost.Build failed to recognize path as absolute and prepended the current
+# dir.
+t.write("jamroot.jam", """
import path ;
local here = [ path.native [ path.pwd ] ] ;
path-constant HERE : $(here) ;
@@ -34,25 +33,24 @@
EXIT ;
}
""")
-t.write("Jamfile", "")
+t.write("jamfile.jam", "")
t.run_build_system()
-t.write("Jamfile", """
-# This tests that rule 'hello' will be imported
-# to children unlocalized, and will still access
-# variables in this Jamfile
+t.write("jamfile.jam", """
+# This tests that rule 'hello' will be imported to children unlocalized, and
+# will still access variables in this Jamfile.
x = 10 ;
constant FOO : foo ;
rule hello ( ) { ECHO "Hello $(x)" ; }
""")
-t.write("d/Jamfile", """
+t.write("d/jamfile.jam", """
ECHO "d: $(FOO)" ;
constant BAR : bar ;
""")
-t.write("d/d2/Jamfile", """
+t.write("d/d2/jamfile.jam", """
ECHO "d2: $(FOO)" ;
ECHO "d2: $(BAR)" ;
hello ;
Modified: branches/release/tools/build/v2/test/project_root_rule.py
==============================================================================
--- branches/release/tools/build/v2/test/project_root_rule.py (original)
+++ branches/release/tools/build/v2/test/project_root_rule.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,34 +1,29 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2005.
-# 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)
-
-# Tests that we can declare a rule in Jamroot that will be
-# can be called in child Jamfile to declare a target. Specifically
-# test for use of 'glob' in that rule.
-#
+# Copyright (C) Vladimir Prus 2005.
+# 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)
-from BoostBuild import Tester, List
-import string
+# Tests that we can declare a rule in Jamroot that will be can be called in
+# child Jamfile to declare a target. Specifically test for use of 'glob' in that
+# rule.
-t = Tester()
+import BoostBuild
+
+t = BoostBuild.Tester()
-t.write("Jamroot", """
-project : requirements <link>static ;
-rule my-lib ( name )
-{
- lib $(name) : [ glob *.cpp ] ;
-}
+t.write("jamroot.jam", """
+project : requirements <link>static ;
+rule my-lib ( name ) { lib $(name) : [ glob *.cpp ] ; }
""")
-t.write("sub/a.cpp", """
+t.write("sub/a.cpp", """
""")
-t.write("sub/Jamfile", """
-my-lib foo ;
+t.write("sub/jamfile.jam", """
+my-lib foo ;
""")
@@ -37,4 +32,3 @@
t.expect_addition("sub/bin/$toolset/debug/link-static/foo.lib")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/project_test1.py
==============================================================================
--- branches/release/tools/build/v2/test/project_test1.py (original)
+++ branches/release/tools/build/v2/test/project_test1.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,16 +5,15 @@
# 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)
-from BoostBuild import Tester
+import BoostBuild
import os
-t = Tester("--build-system=project-test1", boost_build_path='', pass_toolset=0)
-
-# This test does no modifications, so run in in the invocation dir
+t = BoostBuild.Tester("--build-system=project-test1", boost_build_path='',
+ pass_toolset=0)
+# This test does no modifications, so run in in the invocation dir.
os.chdir(t.original_workdir)
-
expected_output1="""Project Roots:
"""
@@ -59,16 +58,16 @@
"""
-# Test that correct project structure is created when jam is invoked
-# outside of the source tree.
+# Test that correct project structure is created when jam is invoked outside of
+# the source tree.
expected = (expected_output1 + expected_output2 + expected_output3) % \
{"root-dir": "project-test1",
"root-dir-prefix": "project-test1/" }
t.run_build_system(stdout=expected)
-# Test that correct project structure is created when jam is invoked
-# at the top of the source tree.
+# Test that correct project structure is created when jam is invoked at the top
+# of the source tree.
expected = (expected_output1 + expected_output3 + expected_output2) % \
{"root-dir": ".",
"root-dir-prefix": "" }
Modified: branches/release/tools/build/v2/test/project_test3.py
==============================================================================
--- branches/release/tools/build/v2/test/project_test3.py (original)
+++ branches/release/tools/build/v2/test/project_test3.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,23 +1,21 @@
#!/usr/bin/python
-# Copyright 2002, 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004, 2006 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)
+# Copyright 2002, 2003 Dave Abrahams
+# Copyright 2002, 2003, 2004, 2006 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)
-from BoostBuild import Tester, List
+import BoostBuild
import os
-from string import strip
-t = Tester(translate_suffixes=0)
+t = BoostBuild.Tester(translate_suffixes=0)
-# First check some startup
+# First check some startup.
t.set_tree("project-test3")
-os.remove("project-root.jam")
+os.remove("jamroot.jam")
t.run_build_system(status=1, stdout=
"""error: Could not find parent for project at '.'
error: Did not find Jamfile.jam or Jamroot.jam in any parent directory.
-
""")
t.set_tree("project-test3")
@@ -79,7 +77,6 @@
"""$toolset/debug
lib3/f.cpp lib2/helper/bin/$toolset/debug/e.obj
""")
-
t.touch("a.cpp")
t.run_build_system()
@@ -87,11 +84,10 @@
"bin/$toolset/debug/a.exe",
"lib2/bin/$toolset/debug/l.exe"])
-
t.run_build_system(extra_args="release optimization=off,speed")
-t.expect_addition(["bin/$toolset/release/a.exe",
- "bin/$toolset/release/a.obj",
- "bin/$toolset/release/optimization-off/a.exe",
+t.expect_addition(["bin/$toolset/release/a.exe",
+ "bin/$toolset/release/a.obj",
+ "bin/$toolset/release/optimization-off/a.exe",
"bin/$toolset/release/optimization-off/a.obj"])
t.run_build_system(extra_args='--clean-all')
@@ -102,10 +98,9 @@
"lib2/bin/$toolset/debug/c.obj",
"lib2/bin/$toolset/debug/d.obj",
"lib2/bin/$toolset/debug/l.exe",
- "lib3/bin/$toolset/debug/f.obj",
- ])
+ "lib3/bin/$toolset/debug/f.obj"])
-# Now test target ids in command line
+# Now test target ids in command line.
t.set_tree("project-test3")
t.run_build_system("lib//b.obj")
t.expect_addition("lib/bin/$toolset/debug/b.obj")
@@ -119,22 +114,20 @@
t.expect_addition("lib/bin/$toolset/debug/b.obj")
t.expect_nothing_more()
-
t.run_build_system("release lib2/helper//e.obj /lib3//f.obj")
t.expect_addition("lib2/helper/bin/$toolset/release/e.obj")
t.expect_addition("lib3/bin/$toolset/release/f.obj")
t.expect_nothing_more()
-# Test project ids in command line work as well
+# Test project ids in command line work as well.
t.set_tree("project-test3")
t.run_build_system("/lib2")
-t.expect_addition("lib2/bin/$toolset/debug/" * List("c.obj d.obj l.exe"))
+t.expect_addition("lib2/bin/$toolset/debug/" * BoostBuild.List("c.obj d.obj l.exe"))
t.expect_addition("bin/$toolset/debug/a.obj")
t.expect_nothing_more()
-
t.run_build_system("lib")
-t.expect_addition("lib/bin/$toolset/debug/" * List("b.obj m.exe"))
+t.expect_addition("lib/bin/$toolset/debug/" * BoostBuild.List("b.obj m.exe"))
t.expect_nothing_more()
t.cleanup()
Modified: branches/release/tools/build/v2/test/project_test4.py
==============================================================================
--- branches/release/tools/build/v2/test/project_test4.py (original)
+++ branches/release/tools/build/v2/test/project_test4.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,15 +1,13 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004 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)
-
-from BoostBuild import Tester
-import os
-from string import strip, find
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2004 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)
-t = Tester(translate_suffixes=0)
+import BoostBuild
+
+t = BoostBuild.Tester(translate_suffixes=0)
t.set_tree("project-test4")
@@ -40,20 +38,20 @@
"bin/$toolset/debug/a.obj\n"
)
-
-t.copy("lib/Jamfile3", "lib/Jamfile")
+t.copy("lib/jamfile3.jam", "lib/jamfile.jam")
# Link-compatibility check for rtti is disabled...
#t.run_build_system(status=None)
-#t.fail_test(find(t.stdout(),
+#import string
+#t.fail_test(string.find(t.stdout(),
#"""warning: targets produced from b.obj are link incompatible
#warning: with main target a.exe""") !=-0)
-# Test that if we specified composite property in target reference,
-# everything works OK.
+# Test that if we specified composite property in target reference, everything
+# works OK.
-t.copy("lib/Jamfile1", "lib/Jamfile")
-t.copy("Jamfile5", "Jamfile")
+t.copy("lib/jamfile1.jam", "lib/jamfile.jam")
+t.copy("jamfile5.jam", "jamfile.jam")
t.run_build_system()
@@ -64,5 +62,4 @@
"bin/$toolset/debug/a.obj lib/bin/$toolset/release/b.obj\n"
)
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/property_expansion.py
==============================================================================
--- branches/release/tools/build/v2/test/property_expansion.py (original)
+++ branches/release/tools/build/v2/test/property_expansion.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,31 +4,26 @@
# 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)
-from BoostBuild import Tester, List
+# Test that free property inside.
-# Test that free property inside
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "")
-t.write("Jamfile", """
-project ;
+t = BoostBuild.Tester()
+t.write("jamroot.jam", """
+project ;
variant debug-AA : debug : <define>AA ;
-
alias all : hello ;
exe hello : hello.cpp ;
explicit hello ;
""")
+
t.write("hello.cpp", """
#ifdef AA
-int main()
-{
- return 0;
-}
+int main() {}
#endif
""")
t.run_build_system("debug-AA")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/qt4.py
==============================================================================
--- branches/release/tools/build/v2/test/qt4.py (original)
+++ branches/release/tools/build/v2/test/qt4.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,18 +1,19 @@
#!/usr/bin/python
-# (c) Copyright Juergen Hunold 2008
-# Use, modification, and distribution are subject to 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)
+# (c) Copyright Juergen Hunold 2008
+# Use, modification, and distribution are subject to 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)
+import BoostBuild
import os
-from BoostBuild import Tester
-
-# Run test in real directory in order to find Boost.Test via Boost Top-Level Jamroot
+# Run test in real directory in order to find Boost.Test via Boost Top-Level
+# Jamroot.
qt4_dir = os.getcwd() + "/qt4"
-t = Tester(workdir=qt4_dir)
+t = BoostBuild.Tester(workdir=qt4_dir)
t.run_build_system()
+
t.cleanup()
Deleted: branches/release/tools/build/v2/test/qt4/Jamroot
==============================================================================
--- branches/release/tools/build/v2/test/qt4/Jamroot 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,56 +0,0 @@
-# (c) Copyright Juergen Hunold 2008
-# Use, modification, and distribution are subject to 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)
-
-import qt4 ;
-import testing ;
-import cast ;
-
-
-
-if [ qt4.initialized ]
-{
- use-project /boost : ../../../../.. ;
-
- project qttest
- : requirements
- <library>/boost/test//boost_unit_test_framework
- ;
-
- alias qt-tests :
- # Check for explicit libraries, <use>/qt should not link any lib
- [ link-fail qtcorefail.cpp : <use>/qt ]
-
- [ run qtcore.cpp /qt//QtCore ]
- [ run qtsql.cpp /qt//QtSql ]
- [ run qtxml.cpp /qt//QtXml ]
- [ run qtnetwork.cpp /qt//QtNetwork ]
- [ run qtscript.cpp /qt//QtScript ]
- [ run qtxmlpatterns.cpp /qt//QtXmlPatterns ]
-
- # ToDo: runable example code
- [ link qtsvg.cpp /qt//QtSvg ]
- [ link qtgui.cpp /qt//QtGui ]
-
- # Multimedia toolkits.
- [ link qtwebkit.cpp /qt//QtWebKit ]
- [ link phonon.cpp /qt//phonon ]
-
- # Help systems.
- [ link qthelp.cpp /qt//QtHelp ]
- [ link qtassistant.cpp /qt//QtAssistantClient ]
-
- # Check working and disabled Qt3Support
- [ link qt3support.cpp /qt//Qt3Support : <qt3support>on ]
- [ compile-fail qt3support.cpp /qt//Qt3Support : <qt3support>off ]
-
- # Testing using QtTest. Simple sample
- # ToDo: better support for "automoc" aka '#include "qttest.moc"'
- [ run qttest.cpp [ cast _ moccable-cpp : qttest.cpp ] /qt//QtTest ]
-
- : # requirements
- : # default-build
- : # usage-requirements
- ;
-}
Modified: branches/release/tools/build/v2/test/railsys.py
==============================================================================
--- branches/release/tools/build/v2/test/railsys.py (original)
+++ branches/release/tools/build/v2/test/railsys.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,12 +1,12 @@
#!/usr/bin/python
-# 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)
+# 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("railsys")
t.run_build_system("--v2", subdir="program")
Deleted: branches/release/tools/build/v2/test/railsys/libx/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/railsys/libx/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,13 +0,0 @@
-# Copyright (c) 2002 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-# Tell that Qt3 should be used. QTDIR will give installation prefix.
-using qt3 ;
-
-
Deleted: branches/release/tools/build/v2/test/railsys/libx/src/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/railsys/libx/src/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,19 +0,0 @@
-# Copyright (c) 2003 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-#
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-project libx
- : requirements
- <include>../include
- : usage-requirements
- <include>../include
- ;
-
-
-lib libx : test_libx.cpp ;
Deleted: branches/release/tools/build/v2/test/railsys/program/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/railsys/program/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,45 +0,0 @@
-# ================================================================
-#
-# Railsys
-# --------------
-#
-# Copyright (c) 2002 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-#
-# 02/21/02! Jürgen Hunold
-#
-# $Id$
-#
-# ================================================================
-
-local BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
-
-use-project /libx : ../libx/src ;
-
-project program
- : requirements
- <include>$(BOOST_ROOT)
- <threading>multi
- <library>/qt3//qt
- <hardcode-dll-paths>true
- <stdlib>stlport
- <use>/libx
- <library>/libx//libx
-
- : usage-requirements
- <include>$(BOOST_ROOT)
- :
- default-build release
- <threading>multi
- <library>/qt3//qt
- <hardcode-dll-paths>true
- ;
-
-build-project main ;
-
Deleted: branches/release/tools/build/v2/test/railsys/program/liba/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/railsys/program/liba/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,14 +0,0 @@
-# Copyright (c) 2003 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-project liba ;
-
-lib liba : test ../include/test_a.h ;
-
-obj test : test_a.cpp : <optimization>off ;
Deleted: branches/release/tools/build/v2/test/railsys/program/main/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/railsys/program/main/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,12 +0,0 @@
-# Copyright (c) 2002 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-project main ;
-
-exe test_a : main.cpp ../liba//liba /libx ;
Deleted: branches/release/tools/build/v2/test/railsys/program/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/railsys/program/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,14 +0,0 @@
-# Copyright (c) 2002 Institute of Transport,
-# Railway Construction and Operation,
-# University of Hanover, Germany
-# Copyright (c) 2006 Jürgen Hunold
-#
-# 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)
-
-# Tell that Qt3 should be used. QTDIR will give installation prefix.
-using qt3 ;
-
-# Not that good, but sufficient for testing
-using stlport : : /path/to/stlport ;
Modified: branches/release/tools/build/v2/test/rebuilds.py
==============================================================================
--- branches/release/tools/build/v2/test/rebuilds.py (original)
+++ branches/release/tools/build/v2/test/rebuilds.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,10 +1,8 @@
#!/usr/bin/python
-# Copyright 2005 Dave Abrahams
-# 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)
-
-# This tests the typechecking facilities.
+# Copyright 2005 Dave Abrahams
+# 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)
import BoostBuild
Modified: branches/release/tools/build/v2/test/regression.py
==============================================================================
--- branches/release/tools/build/v2/test/regression.py (original)
+++ branches/release/tools/build/v2/test/regression.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,52 +5,45 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-# Test for the regression testing framework.
-from BoostBuild import Tester, List
+# Test for the regression testing framework.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
-t.write("c.cpp", "")
+# Create a temporary working directory.
+t = BoostBuild.Tester()
-t.write("r.cpp", """
+t.write("c.cpp", "\n")
+t.write("r.cpp", """
void helper();
#include <iostream>
-int main(int ac, char* av[])
+int main( int ac, char * av[] )
{
helper();
-
- for (int i = 1; i < ac; ++i)
- std::cout << av[i] << '\\n';
- return 0;
-}
+ for ( int i = 1; i < ac; ++i )
+ std::cout << av[ i ] << '\\n';
+}
""")
-t.write("c-f.cpp", """
-int
+t.write("c-f.cpp", """
+int
""")
-t.write("r-f.cpp", """
-int main()
-{
- return 1;
-}
+t.write("r-f.cpp", """
+int main() { return 1; }
""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
import testing ;
-
compile c.cpp ;
compile-fail c-f.cpp ;
run r.cpp libs//helper : foo bar ;
run-fail r-f.cpp ;
-
""")
-t.write("libs/Jamfile", """
+t.write("libs/jamfile.jam", """
lib helper : helper.cpp ;
""")
@@ -60,10 +53,9 @@
__declspec(dllexport)
#endif
helper() {}
-
""")
-t.write("project-root.jam", "")
+t.write("jamroot.jam", "")
# First test that when outcomes are expected, all .test files are created.
t.run_build_system("hardcode-dll-paths=false", stderr=None, status=None)
@@ -74,28 +66,26 @@
# Make sure args are handled.
t.expect_content("bin/r.test/$toolset/debug/r.output",
- "foo\nbar\n*\nEXIT STATUS: 0*\n",True)
+ "foo\nbar\n*\nEXIT STATUS: 0*\n", True)
# Test that input file is handled as well.
t.write("r.cpp", """
#include <iostream>
#include <fstream>
-int main(int ac, char* av[])
+int main( int ac, char * av[] )
{
- for (int i = 1; i < ac; ++i) {
- std::ifstream ifs(av[i]);
+ for ( int i = 1; i < ac; ++i )
+ {
+ std::ifstream ifs( av[ i ] );
std::cout << ifs.rdbuf();
}
-
- return 0;
-}
+}
""")
t.write("dir/input.txt", "test input")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
import testing ;
-
compile c.cpp ;
obj c-obj : c.cpp ;
compile-fail c-f.cpp ;
@@ -112,9 +102,9 @@
t.expect_addition('bin/$toolset/debug/execution.time')
t.expect_addition('bin/$toolset/debug/compilation.time')
-# Make sure test failures are detected. Reverse expectation and see
-# if .test files are created or not.
-t.write("Jamfile", """
+# Make sure test failures are detected. Reverse expectation and see if .test
+# files are created or not.
+t.write("jamfile.jam", """
import testing ;
compile-fail c.cpp ;
@@ -123,7 +113,7 @@
run r-f.cpp ;
""")
-t.touch(List("c.cpp c-f.cpp r.cpp r-f.cpp"))
+t.touch(BoostBuild.List("c.cpp c-f.cpp r.cpp r-f.cpp"))
t.run_build_system("hardcode-dll-paths=false", stderr=None, status=1)
t.expect_removal("bin/c.test/$toolset/debug/c.test")
Modified: branches/release/tools/build/v2/test/relative_sources.py
==============================================================================
--- branches/release/tools/build/v2/test/relative_sources.py (original)
+++ branches/release/tools/build/v2/test/relative_sources.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,18 +1,19 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2006 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2006 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)
# Test that we can specify sources using relative names.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", "exe a : src/a.cpp ;")
-t.write("src/a.cpp", "int main() { return 0; }\n")
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "import gcc ;")
+t.write("jamfile.jam", "exe a : src/a.cpp ;")
+t.write("src/a.cpp", "int main() {}\n")
t.run_build_system()
Modified: branches/release/tools/build/v2/test/remove_requirement.py
==============================================================================
--- branches/release/tools/build/v2/test/remove_requirement.py (original)
+++ branches/release/tools/build/v2/test/remove_requirement.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,76 +1,58 @@
#!/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)
+# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
project : requirements <threading>multi <variant>debug:<link>static ;
build-project sub ;
build-project sub2 ;
build-project sub3 ;
-build-project sub4 ;
+build-project sub4 ;
""")
-t.write("sub/Jamfile", """
-exe hello : hello.cpp : -<threading>multi ;
+t.write("sub/jamfile.jam", """
+exe hello : hello.cpp : -<threading>multi ;
""")
-t.write("sub/hello.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("sub/hello.cpp", """
+int main() {}
""")
-t.write("sub2/Jamfile", """
+t.write("sub2/jamfile.jam", """
project : requirements -<threading>multi ;
-exe hello : hello.cpp ;
+exe hello : hello.cpp ;
""")
-t.write("sub2/hello.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("sub2/hello.cpp", """
+int main() {}
""")
-t.write("sub3/hello.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("sub3/hello.cpp", """
+int main() {}
""")
-t.write("sub3/Jamfile", """
-exe hello : hello.cpp : -<variant>debug:<link>static ;
+t.write("sub3/jamfile.jam", """
+exe hello : hello.cpp : -<variant>debug:<link>static ;
""")
-t.write("sub4/hello.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("sub4/hello.cpp", """
+int main() {}
""")
-t.write("sub4/Jamfile", """
+t.write("sub4/jamfile.jam", """
project : requirements -<variant>debug:<link>static ;
-exe hello : hello.cpp ;
+exe hello : hello.cpp ;
""")
-
-
t.run_build_system()
t.expect_addition("sub/bin/$toolset/debug/link-static/hello.exe")
@@ -81,29 +63,22 @@
t.rm(".")
# Now test that path requirements can be removed as well.
-t.write("Jamroot", """
+t.write("jamroot.jam", """
build-project sub ;
-
""")
-t.write("sub/Jamfile", """
+t.write("sub/jamfile.jam", """
project : requirements <include>broken ;
-
-exe hello : hello.cpp : -<include>broken ;
+exe hello : hello.cpp : -<include>broken ;
""")
-t.write("sub/hello.cpp", """
+t.write("sub/hello.cpp", """
#include "math.h"
-
-int main()
-{
- return 0;
-}
-
+int main() {}
""")
-t.write("sub/broken/math.h", """
-Broken
+t.write("sub/broken/math.h", """
+Broken
""")
@@ -112,4 +87,3 @@
t.expect_addition("sub/bin/$toolset/debug/hello.exe")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/resolution.py
==============================================================================
--- branches/release/tools/build/v2/test/resolution.py (original)
+++ branches/release/tools/build/v2/test/resolution.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,28 +1,27 @@
#!/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)
+# 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)
-# Tests for the target id resolution process.
-from BoostBuild import Tester, List
+# Tests for the target id resolution process.
-# Create a temporary working directory
-t = Tester()
+import BoostBuild
+
+# Create a temporary working directory.
+t = BoostBuild.Tester()
# Create the needed files
-t.write("Jamroot", """
+t.write("jamroot.jam", """
exe hello : hello.cpp ;
-# This should use the 'hello' target, even if there's
-# 'hello' file in current dir.
+# This should use the 'hello' target, even if there is a 'hello' file in the
+# current dir.
install s : hello : <location>. ;
""")
+
t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+int main() {}
""")
t.run_build_system()
@@ -31,8 +30,8 @@
t.touch("hello.cpp")
t.run_build_system("s")
-# If 'hello' in the 's' target resolved to file in
-# current dir, nothing will be rebuilt.
+# If 'hello' in the 's' target resolved to file in the current dir, nothing will
+# be rebuilt.
t.expect_touch("bin/$toolset/debug/hello.obj")
t.cleanup()
Modified: branches/release/tools/build/v2/test/searched_lib.py
==============================================================================
--- branches/release/tools/build/v2/test/searched_lib.py (original)
+++ branches/release/tools/build/v2/test/searched_lib.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -8,14 +8,16 @@
# Test usage of searched-libs: one which are found via -l
# switch to the linker/compiler.
-from BoostBuild import Tester, get_toolset
-import string
+import BoostBuild
import os
-t = Tester()
+import string
+
+t = BoostBuild.Tester()
+
# To start with, we have to prepare a library to link with.
-t.write("lib/project-root.jam", "")
-t.write("lib/Jamfile", "lib test_lib : test_lib.cpp ;")
+t.write("lib/jamroot.jam", "")
+t.write("lib/jamfile.jam", "lib test_lib : test_lib.cpp ;")
t.write("lib/test_lib.cpp", """
#ifdef _WIN32
__declspec(dllexport)
@@ -26,9 +28,11 @@
t.run_build_system(subdir="lib")
t.expect_addition("lib/bin/$toolset/debug/test_lib.dll")
+
# Auto adjusting of suffixes does not work, since we need to
# change dll to lib.
-if (os.name == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc':
+if ( ( os.name == "nt" ) or os.uname()[0].lower().startswith("cygwin") ) and \
+ ( BoostBuild.get_toolset() != "gcc" ):
t.copy("lib/bin/$toolset/debug/test_lib.implib", "lib/test_lib.implib")
t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll")
else:
@@ -36,9 +40,9 @@
# Test that the simplest usage of searched library works.
-t.write('project-root.jam', '')
-t.write('Jamfile', """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
import path ;
import project ;
@@ -49,26 +53,28 @@
lib helper : helper.cpp test_lib ;
lib test_lib : : <name>test_lib <search>lib ;
""")
+
t.write("main.cpp", """
void helper();
-int main() { helper(); return 0; }
+int main() { helper(); }
""")
+
t.write("helper.cpp", """
void foo();
-
void
#if defined(_WIN32)
__declspec(dllexport)
#endif
helper() { foo(); }
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.exe")
t.rm("bin/$toolset/debug/main.exe")
-# Test that 'unit-test' will correctly add runtime paths
-# to searched libraries.
-t.write('Jamfile', """
+
+# Test that 'unit-test' will correctly add runtime paths to searched libraries.
+t.write("jamfile.jam", """
import path ;
import project ;
@@ -83,44 +89,43 @@
lib helper : helper.cpp test_lib ;
lib test_lib : : <name>test_lib <search>lib ;
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/main.passed")
t.rm("bin/$toolset/debug/main.exe")
-# Now try using searched lib from static lib. Request shared version
-# of searched lib, since we don't have static one handy.
-t.write('Jamfile', """
+# Now try using searched lib from static lib. Request shared version of searched
+# lib, since we do not have a static one handy.
+t.write("jamfile.jam", """
exe main : main.cpp helper ;
lib helper : helper.cpp test_lib/<link>shared : <link>static ;
lib test_lib : : <name>test_lib <search>lib ;
""")
+
t.run_build_system(stderr=None)
t.expect_addition("bin/$toolset/debug/main.exe")
t.expect_addition("bin/$toolset/debug/link-static/helper.lib")
t.rm("bin/$toolset/debug/main.exe")
-# A regression test: <library>property referring to
-# searched-lib was mishandled. As the result, we were
-# putting target name to the command line!
+# A regression test: <library>property referring to searched-lib was being
+# mishandled. As the result, we were putting target name to the command line!
# Note that
# g++ ...... <.>z
-# works nicely in some cases, sending output from compiler
-# to file 'z'.
-# This problem shows up when searched libs are in usage
-# requirements.
-
-t.write('Jamfile', 'exe main : main.cpp d/d2//a ;')
-t.write('main.cpp',"""
+# works nicely in some cases, sending output from compiler to file 'z'. This
+# problem shows up when searched libs are in usage requirements.
+t.write("jamfile.jam", "exe main : main.cpp d/d2//a ;")
+t.write("main.cpp", """
void foo();
-int main() { foo(); return 0; }
-
+int main() { foo(); }
""")
-t.write('d/d2/Jamfile', """
+
+t.write("d/d2/jamfile.jam", """
lib test_lib : : <name>test_lib <search>../../lib ;
lib a : a.cpp : : : <library>test_lib ;
""")
-t.write('d/d2/a.cpp', """
+
+t.write("d/d2/a.cpp", """
#ifdef _WIN32
__declspec(dllexport) int force_library_creation_for_a;
#endif
@@ -128,39 +133,36 @@
t.run_build_system()
-# A regression test. Searched targets were not associated
-# with any properties. For that reason, if the same searched
-# lib is generated with two different properties, we had an
-# error saying they are actualized to the same Jam target name.
-t.write("project-root.jam", "")
+# A regression test. Searched targets were not associated with any properties.
+# For that reason, if the same searched lib is generated with two different
+# properties, we had an error saying they are actualized to the same Jam target
+# name.
+t.write("jamroot.jam", "")
t.write("a.cpp", "")
-# The 'l' library will be built in two variants:
-# 'debug' (directly requested) and 'release' (requested
-# from 'a').
-t.write("Jamfile", """
+# The 'l' library will be built in two variants: 'debug' (directly requested)
+# and 'release' (requested from 'a').
+t.write("jamfile.jam", """
exe a : a.cpp l/<variant>release ;
-
lib l : : <name>l_d <variant>debug ;
lib l : : <name>l_r <variant>release ;
""")
t.run_build_system("-n")
-# A regression test. Two virtual target with the same properties
-# were created for 'l' target, which caused and error to be reported
-# when actualizing targets. The final error is correct, but we should
-# not create two duplicated targets. Thanks to Andre Hentz
-# for finding this bug.
-t.write("project-root.jam", "")
+
+# A regression test. Two virtual target with the same properties were created
+# for 'l' target, which caused and error to be reported when actualizing
+# targets. The final error is correct, but we should not create two duplicated
+# targets. Thanks to Andre Hentz for finding this bug.
+t.write("jamroot.jam", "")
t.write("a.cpp", "")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
project a : requirements <runtime-link>static ;
-
static-lib a : a.cpp l ;
lib l : : <name>l_f ;
""")
@@ -168,19 +170,22 @@
t.run_build_system("-n")
-# Make sure that plain "lib foobar ; " works.
-t.write("Jamfile", """
+# Make sure plain "lib foobar ; " works.
+t.write("jamfile.jam", """
exe a : a.cpp foobar ;
lib foobar ;
""")
+
t.run_build_system("-n -d2")
t.fail_test(string.find(t.stdout(), "foobar") == -1)
-# Make sure that plain "lib foo bar ; " works.
-t.write("Jamfile", """
+
+# Make sure plain "lib foo bar ; " works.
+t.write("jamfile.jam", """
exe a : a.cpp foo bar ;
lib foo bar ;
""")
+
t.run_build_system("-n -d2")
t.fail_test(string.find(t.stdout(), "foo") == -1)
t.fail_test(string.find(t.stdout(), "bar") == -1)
Modified: branches/release/tools/build/v2/test/skipping.py
==============================================================================
--- branches/release/tools/build/v2/test/skipping.py (original)
+++ branches/release/tools/build/v2/test/skipping.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,40 +1,36 @@
#!/usr/bin/python
-# 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)
-
-# Test that V2 does not fail gracelessy when any target is skipped.
-from BoostBuild import Tester, List
-
-# Create a temporary working directory
-t = Tester()
-t.write("a.cpp", """
-int main() {}
-""")
+# 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)
-t.write("b.cpp", """
-int main() {}
-""")
+# Test that V2 does not fail gracelessy when any target is skipped.
+
+import BoostBuild
-t.write("c.cpp", """
-int main() {}
+# Create a temporary working directory.
+t = BoostBuild.Tester()
+
+t.write("a.cpp", """
+int main() {}
""")
-t.write("Jamfile", """
-import feature : feature ;
+t.write("b.cpp", """
+int main() {}
+""")
-feature foo : 1 2 : link-incompatible ;
+t.write("c.cpp", """
+int main() {}
+""")
+t.write("jamroot.jam", """
+import feature ;
+feature.feature foo : 1 2 : link-incompatible ;
exe a : a.cpp : <foo>1 ;
exe b : b.cpp : <foo>2 ;
-exe c : c.cpp ;
-""")
-
-t.write("project-root.jam", """
+exe c : c.cpp ;
""")
t.run_build_system("foo=1")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/sort_rule.py
==============================================================================
--- branches/release/tools/build/v2/test/sort_rule.py (original)
+++ branches/release/tools/build/v2/test/sort_rule.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -20,7 +20,8 @@
def testSORTCorrectness():
"""Testing that Boost Jam's SORT builtin rule actually sorts correctly.
"""
- t = BoostBuild.Tester("-f test.jam -d1", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("-f test.jam -d1", pass_toolset=False,
+ use_test_config=False)
t.write("test.jam", """
NOCARE all ;
@@ -57,7 +58,8 @@
"""Regression test making sure Boost Jam's SORT builtin rule does not get
quadratic behaviour again in this use case.
"""
- t = BoostBuild.Tester("-f test.jam -d1", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("-f test.jam -d1", pass_toolset=False,
+ use_test_config=False)
f = open(t.workpath("test.jam"), "w")
print >> f, "data = "
Modified: branches/release/tools/build/v2/test/source_locations.py
==============================================================================
--- branches/release/tools/build/v2/test/source_locations.py (original)
+++ branches/release/tools/build/v2/test/source_locations.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -7,45 +7,34 @@
# Test that projects with multiple source-location directories are handled OK.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("Jamroot", """
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", """
path-constant SRC1 : "./src1" ;
path-constant SRC2 : "./src2" ;
path-constant SRC3 : "./src3" ;
path-constant BUILD : "build" ;
-project
- : requirements
- <include>$(SRC1)/include
- <threading>multi
- : build-dir $(BUILD)
- ;
+project : requirements <include>$(SRC1)/include <threading>multi
+ : build-dir $(BUILD) ;
build-project project1 ;
-
""")
-t.write("project1/Jamfile", """
-project project1
- : source-location $(SRC1)
- $(SRC2)
- $(SRC3)
- ;
-
-SRCS = s1.cpp
- s2.cpp
- testfoo.cpp
- ;
+
+t.write("project1/jamfile.jam", """
+project project1 : source-location $(SRC1) $(SRC2) $(SRC3) ;
+SRCS = s1.cpp s2.cpp testfoo.cpp ;
exe test : $(SRCS) ;
""")
-t.write("src1/s1.cpp", "int main() { return 0; }\n")
+t.write("src1/s1.cpp", "int main() {}\n")
t.write("src2/s2.cpp", "void hello() {}\n")
t.write("src3/testfoo.cpp", "void testfoo() {}\n")
-# This file should not be picked up, because "src2" is before
-# "src3" in the list of source directories.
+# This file should not be picked up, because "src2" is before "src3" in the list
+# of source directories.
t.write("src3/s2.cpp", "void hello() {}\n")
t.run_build_system()
Modified: branches/release/tools/build/v2/test/stage.py
==============================================================================
--- branches/release/tools/build/v2/test/stage.py (original)
+++ branches/release/tools/build/v2/test/stage.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,20 +1,19 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004, 2005, 2006 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2004, 2005, 2006 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)
-# Test staging
+# Test staging.
-from BoostBuild import Tester
-t = Tester()
+import BoostBuild
-t.write("project-root.jam", "import gcc ;")
+t = BoostBuild.Tester()
-t.write(
- "Jamfile",
-"""
+t.write("jamroot.jam", "import gcc ;")
+
+t.write("jamfile.jam", """
lib a : a.cpp ;
stage dist : a a.h auxilliary/1 ;
""")
@@ -36,25 +35,21 @@
t.expect_addition(["dist/a.dll", "dist/a.h", "dist/1"])
-# Regression test: the following was causing the "duplicate target name"
-# error.
-t.write(
- "Jamfile",
-"""
+# Regression test: the following was causing the "duplicate target name" error.
+t.write("jamfile.jam", """
project : requirements <hardcode-dll-paths>true ;
lib a : a.cpp ;
stage dist : a a.h auxilliary/1 ;
alias dist-alias : dist ;
""")
+
t.run_build_system()
-# Test the <location> property
-t.write("Jamfile", """
+# Test the <location> property.
+t.write("jamfile.jam", """
lib a : a.cpp ;
-stage dist : a
- : <variant>debug:<location>ds <variant>release:<location>rs
- ;
+stage dist : a : <variant>debug:<location>ds <variant>release:<location>rs ;
""")
t.run_build_system()
@@ -63,62 +58,60 @@
t.run_build_system("release")
t.expect_addition("rs/a.dll")
-# Test the <location> property in subprojects.
-# Thanks to Kirill Lapshin for bug report.
-t.write("project-root.jam", """
+# Test the <location> property in subprojects. Thanks to Kirill Lapshin for the
+# bug report.
+
+t.write("jamroot.jam", """
path-constant DIST : dist ;
""")
-t.write("Jamfile", "build-project d ;")
+t.write("jamfile.jam", "build-project d ;")
-t.write(
- "d/Jamfile",
-"""
+t.write("d/jamfile.jam", """
exe a : a.cpp ;
stage dist : a : <location>$(DIST) ;
""")
-t.write("d/a.cpp", "int main() { return 0;}\n")
+t.write("d/a.cpp", "int main() {}\n")
t.run_build_system()
t.expect_addition("dist/a.exe")
t.rm("dist")
-# Workaround a BIG BUG: the response file is not deleted,
-# even if application *is* deleted. We'll try to use the
-# same response file when building from subdir, with very
-# bad results.
+
+# Workaround a BIG BUG: the response file is not deleted, even if application
+# *is* deleted. We will try to use the same response file when building from
+# subdir, with very bad results.
t.rm("d/bin")
t.run_build_system(subdir="d")
t.expect_addition("dist/a.exe")
# Check that 'stage' does not incorrectly reset target suffixes.
-t.write("a.cpp", """
-int main() {}
+t.write("a.cpp", """
+int main() {}
""")
-t.write("project-root.jam", """
+t.write("jamroot.jam", """
import type ;
type.register MYEXE : : EXE ;
-type.set-generated-target-suffix MYEXE : <optimization>off : myexe ;
+type.set-generated-target-suffix MYEXE : <optimization>off : myexe ;
""")
-# Since <optimization>off is in properties when 'a' is built, and staged,
-# it's suffix should be "myexe".
-t.write("Jamfile", """
+# Since <optimization>off is in properties when 'a' is built, and staged, its
+# suffix should be "myexe".
+t.write("jamfile.jam", """
stage dist : a ;
-myexe a : a.cpp ;
+myexe a : a.cpp ;
""")
t.run_build_system()
t.expect_addition("dist/a.myexe")
# Test 'stage's ability to traverse dependencies.
-t.write("a.cpp", """
-int main() { return 0; }
-
+t.write("a.cpp", """
+int main() {}
""")
t.write("l.cpp", """
@@ -126,43 +119,45 @@
#if defined(_WIN32)
__declspec(dllexport)
#endif
-foo() { }
-
+foo() {}
""")
-t.write("Jamfile", """
+t.write("jamfile.jam", """
lib l : l.cpp ;
exe a : a.cpp l ;
-stage dist : a : <install-dependencies>on <install-type>EXE <install-type>LIB ;
+stage dist : a : <install-dependencies>on <install-type>EXE <install-type>LIB ;
""")
-t.write("project-root.jam", "")
+t.write("jamroot.jam", "")
t.rm("dist")
+
t.run_build_system()
t.expect_addition("dist/a.exe")
t.expect_addition("dist/l.dll")
-# Check that <use> properties are ignored the traversing
-# target for staging.
+# Check that <use> properties are ignored the traversing target for staging.
t.copy("l.cpp", "l2.cpp")
+
t.copy("l.cpp", "l3.cpp")
-t.write("Jamfile", """
+
+t.write("jamfile.jam", """
lib l2 : l2.cpp ;
lib l3 : l3.cpp ;
lib l : l.cpp : <use>l2 <dependency>l3 ;
exe a : a.cpp l ;
-stage dist : a : <install-dependencies>on <install-type>EXE <install-type>LIB ;
+stage dist : a : <install-dependencies>on <install-type>EXE <install-type>LIB ;
""")
t.rm("dist")
+
t.run_build_system()
t.expect_addition("dist/l3.dll")
t.expect_nothing("dist/l2.dll")
# Check if <dependency> on 'stage' works.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
stage a1 : a1.txt : <location>dist ;
stage a2 : a2.txt : <location>dist <dependency>a1 ;
""")
@@ -171,77 +166,93 @@
t.run_build_system("a2")
t.expect_addition(["dist/a1.txt", "dist/a2.txt"])
-# Regression test: check if <location>. works
+# Regression test: check that <location>. works.
t.rm(".")
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
stage a1 : d/a1.txt : <location>. ;
""")
+
t.write("d/a1.txt", "")
+
t.run_build_system()
t.expect_addition("a1.txt")
-# Test that relative paths of sources can be preserved
+# Test that relative paths of sources can be preserved.
t.rm(".")
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
install dist : a/b/c.h : <install-source-root>. ;
""")
+
t.write("a/b/c.h", "")
+
t.run_build_system()
t.expect_addition("dist/a/b/c.h")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
install dist : a/b/c.h : <install-source-root>a ;
""")
+
t.write("a/b/c.h", "")
+
t.run_build_system()
t.expect_addition("dist/b/c.h")
t.rm(".")
-t.write("build/Jamroot", """
-install dist : ../a/b/c.h
- : <location>../dist <install-source-root>../a ;
+t.write("build/jamroot.jam", """
+install dist : ../a/b/c.h : <location>../dist <install-source-root>../a ;
""")
+
t.write("a/b/c.h", "")
+
t.run_build_system(subdir="build")
t.expect_addition("dist/b/c.h")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
install dist2 : a/b/c.h : <install-source-root>a ;
""")
+
t.write("a/b/c.h", "")
-t.write("sub/Jamfile", """
+
+t.write("sub/jamfile.jam", """
alias h : ..//dist2 ;
""")
+
t.run_build_system(subdir="sub")
t.expect_addition("dist2/b/c.h")
-# Test that when installing .cpp files, we don't scan
-# include dependencies.
+# Test that when installing .cpp files, we do not scan include dependencies.
t.rm(".")
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
install dist : a.cpp ;
""")
+
t.write("a.cpp", """
#include "a.h"
""")
+
t.write("a.h", "")
+
t.run_build_system()
t.expect_addition("dist/a.cpp")
t.touch("a.h")
+
t.run_build_system()
t.expect_nothing("dist/a.cpp")
-# Test that <name> property works, when there's just
-# one file in sources.
+# Test that <name> property works, when there is just one file in sources.
t.rm(".")
-t.write("Jamroot", """
+
+t.write("jamroot.jam", """
install dist : a.cpp : <name>b.cpp ;
""")
+
t.write("a.cpp", "test file")
-t.run_build_system()
+t.run_build_system()
t.expect_addition("dist/b.cpp")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/standalone.py
==============================================================================
--- branches/release/tools/build/v2/test/standalone.py (original)
+++ branches/release/tools/build/v2/test/standalone.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,29 +1,26 @@
#!/usr/bin/python
-# 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)
+# 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-# Regression tests: standalone project were not able to refer to targets
-# declared in themselfs!
-t.write("a.cpp", """
-int main()
-{
- return 0;
-}
+# Regression tests: standalone project were not able to refer to targets
+# declared in themselves.
+t.write("a.cpp", """
+int main() {}
""")
-t.write("project-root.jam", """
-import standalone ;
+t.write("jamroot.jam", """
+import standalone ;
""")
-t.write("standalone.jam", """
+t.write("standalone.jam", """
import project ;
project.initialize $(__name__) ;
@@ -33,14 +30,13 @@
alias x : $(pwd)/../a.cpp ;
alias runtime : x ;
-
""")
-t.write("sub/Jamfile", """
-stage bin : /standalone//runtime ;
+t.write("sub/jamfile.jam", """
+stage bin : /standalone//runtime ;
""")
t.run_build_system(subdir="sub")
t.expect_addition("sub/bin/a.cpp")
-t.cleanup()
+t.cleanup()
Modified: branches/release/tools/build/v2/test/startup_v1.py
==============================================================================
--- branches/release/tools/build/v2/test/startup_v1.py (original)
+++ branches/release/tools/build/v2/test/startup_v1.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,27 +1,23 @@
#!/usr/bin/python
-# Copyright 2002 Dave Abrahams
-# Copyright 2003, 2004, 2005 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)
+# Copyright 2002 Dave Abrahams
+# Copyright 2003, 2004, 2005 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)
-from BoostBuild import Tester
+import BoostBuild
import os
import re
-def expect_substring(actual,expected):
+def expect_substring(actual, expected):
return actual.find(expected) != -1
-def match_re(actual,expected):
- return re.match(expected,actual,re.DOTALL) != None
+def match_re(actual, expected):
+ return re.match(expected, actual, re.DOTALL) != None
-# Test the v1 startup behavior
-t = Tester(
- executable='bjam'
- , match=match_re
- , boost_build_path=''
- , pass_toolset=0
- )
+# Test the v1 startup behavior.
+t = BoostBuild.Tester(executable='bjam', match=match_re, boost_build_path='',
+ pass_toolset=0)
t.set_tree('startup')
@@ -29,71 +25,57 @@
# t.run_build_system(
# status=1, stdout="You didn't set BOOST_ROOT", match = expect_substring)
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost\.Build: could not find "boost-build\.jam".'''
- )
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost\.Build: could not find ''' +
+ r'''"boost-build\.jam".''')
os.chdir('no-bootstrap1')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+ r'''.*attempted to load the build system by invoking'''
+ r'''.*'boost-build ;'.*'''
- + r'''but we were unable to find "bootstrap\.jam"'''
- )
+ + r'''but we were unable to find "bootstrap\.jam"''')
# Descend to a subdirectory which /doesn't/ contain a boost-build.jam
# file, and try again to test the crawl-up behavior.
os.chdir('subdir')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+ r'''.*attempted to load the build system by invoking'''
+ r'''.*'boost-build ;'.*'''
- + r'''but we were unable to find "bootstrap\.jam"'''
- )
+ + r'''but we were unable to find "bootstrap\.jam"''')
os.chdir('../../no-bootstrap2')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost\.Build: could not find build system\.'''
+ r'''.*attempted to load the build system by invoking'''
+ r'''.*'boost-build \. ;'.*'''
- + r'''but we were unable to find "bootstrap\.jam"'''
- )
+ + r'''but we were unable to find "bootstrap\.jam"''')
os.chdir('../no-bootstrap3')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=.', status=1
- , stdout=r'''Unable to load Boost.Build
+t.run_build_system(extra_args='-sBOOST_ROOT=.', status=1,
+ stdout=r'''Unable to load Boost.Build
.*boost-build.jam" was found.*
-However, it failed to call the "boost-build" rule'''
- )
+However, it failed to call the "boost-build" rule''')
# test bootstrapping based on BOOST_BUILD_PATH
os.chdir('../bootstrap-env')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=../boost-root -sBOOST_BUILD_PATH=../boost-root/build'
- , stdout = 'build system bootstrapped'
- )
+t.run_build_system(extra_args='-sBOOST_ROOT=../boost-root ' +
+ '-sBOOST_BUILD_PATH=../boost-root/build',
+ stdout='build system bootstrapped')
# test bootstrapping based on an explicit path in boost-build.jam
os.chdir('../bootstrap-explicit')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=../boost-root'
- , stdout = 'build system bootstrapped'
- )
+t.run_build_system(extra_args='-sBOOST_ROOT=../boost-root',
+ stdout='build system bootstrapped')
# test bootstrapping based on BOOST_ROOT
os.chdir('../bootstrap-implicit')
-t.run_build_system(
- extra_args = '-sBOOST_ROOT=../boost-root'
- , stdout = 'build system bootstrapped'
- )
+t.run_build_system(extra_args='-sBOOST_ROOT=../boost-root',
+ stdout='build system bootstrapped')
t.cleanup()
Modified: branches/release/tools/build/v2/test/startup_v2.py
==============================================================================
--- branches/release/tools/build/v2/test/startup_v2.py (original)
+++ branches/release/tools/build/v2/test/startup_v2.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,23 +1,20 @@
#!/usr/bin/python
-# Copyright 2002 Dave Abrahams
-# Copyright 2003, 2004 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)
+# Copyright 2002 Dave Abrahams
+# Copyright 2003, 2004 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)
-from BoostBuild import Tester
+import BoostBuild
import os
import re
+
def match_re(actual,expected):
return re.match(expected,actual,re.DOTALL) != None
-# Test the v1 startup behavior
-t = Tester(
- match= match_re
- , boost_build_path=''
- , pass_toolset=0
- )
+# Test the v1 startup behavior.
+t = BoostBuild.Tester(match=match_re, boost_build_path='', pass_toolset=0)
t.set_tree('startup')
@@ -35,8 +32,8 @@
+ r'''but we were unable to find "bootstrap\.jam"'''
)
-# Descend to a subdirectory which /doesn't/ contain a boost-build.jam
-# file, and try again to test the crawl-up behavior.
+# Descend to a subdirectory which /doesn't/ contain a boost-build.jam file, and
+# try again to test the crawl-up behavior.
os.chdir('subdir')
t.run_build_system(
@@ -66,18 +63,17 @@
However, it failed to call the "boost-build" rule'''
)
-# test bootstrapping based on BOOST_BUILD_PATH
+# Test bootstrapping based on BOOST_BUILD_PATH.
os.chdir('../bootstrap-env')
t.run_build_system(
extra_args = '-sBOOST_BUILD_PATH=../boost-root/build'
, stdout = 'build system bootstrapped'
)
-# test bootstrapping based on an explicit path in boost-build.jam
+# Test bootstrapping based on an explicit path in boost-build.jam.
os.chdir('../bootstrap-explicit')
t.run_build_system(
stdout = 'build system bootstrapped'
)
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/suffix.py
==============================================================================
--- branches/release/tools/build/v2/test/suffix.py (original)
+++ branches/release/tools/build/v2/test/suffix.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,33 +1,32 @@
#!/usr/bin/python
-# Copyright 2003, 2004 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)
+# Copyright 2003, 2004 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)
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
-# Regression test: when staging V2 used to change suffixes on targets
-# corresponding to real files.
-t.write("Jamfile", """
+# Regression test: when staging V2 used to change suffixes on targets
+# corresponding to real files.
+t.write("jamfile.jam", """
import type : register ;
register A : a1 a2 a3 ;
-
-stage a : a.a3 ;
+stage a : a.a3 ;
""")
-t.write("project-root.jam", "")
+t.write("jamroot.jam", "")
t.write("a.a3", "")
t.run_build_system()
t.expect_addition("a/a.a3");
-# Regression test: we should be able to specify empty suffix for
-# derived target type, even if base type has non-empty suffix.
+# Regression test: we should be able to specify empty suffix for derived target
+# type, even if base type has non-empty suffix.
t.write("a.cpp", "")
-t.write("suffixes.jam", """
+t.write("suffixes.jam", """
import type ;
import generators ;
import common ;
@@ -46,19 +45,17 @@
{
$(TOUCH) $(<)
}
-
""")
-t.write("project-root.jam", """
-import suffixes ;
+t.write("jamroot.jam", """
+import suffixes ;
""")
-t.write("Jamfile", """
-second a : a.cpp ;
+t.write("jamfile.jam", """
+second a : a.cpp ;
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/svn_tree.py
==============================================================================
--- branches/release/tools/build/v2/test/svn_tree.py (original)
+++ branches/release/tools/build/v2/test/svn_tree.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -16,8 +16,8 @@
#
######################################################################
-# This file was modified by Vladimir Prus to store modification times in
-# tree nodes.
+# This file was modified by Vladimir Prus to store modification times in tree
+# nodes.
import re
import string
@@ -26,7 +26,6 @@
import stat
-
#========================================================================
# ===> Overview of our Datastructures <===
@@ -498,7 +497,7 @@
def dump_tree(n,indent=""):
"Print out a nice representation of the tree's structure."
- # Code partially stolen from Dave Beazley
+ # Code partially stolen from Dave Beazley.
if n.children is None:
tmp_children = []
else:
@@ -509,12 +508,11 @@
else:
print "%s%s" % (indent, n.name)
- indent = indent.replace("-"," ")
- indent = indent.replace("+"," ")
+ indent = indent.replace("-", " ")
+ indent = indent.replace("+", " ")
for i in range(len(tmp_children)):
c = tmp_children[i]
- if i == len(tmp_children
- )-1:
+ if i == len(tmp_children) - 1:
dump_tree(c,indent + " +-- ")
else:
dump_tree(c,indent + " |-- ")
Modified: branches/release/tools/build/v2/test/symlink.py
==============================================================================
--- branches/release/tools/build/v2/test/symlink.py (original)
+++ branches/release/tools/build/v2/test/symlink.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,36 +1,41 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# 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)
+# Copyright 2003 Dave Abrahams
+# 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)
-# Test the 'symlink' rule
+# Test the 'symlink' rule.
-from BoostBuild import Tester, List
import os
-t = Tester()
+import BoostBuild
+
if os.name != 'posix':
- print "The symlink tests can be run on posix only"
+ print "The symlink tests can be run on posix only."
+ import sys
sys.exit(1)
-t.write("project-root.jam", "import gcc ;")
-t.write("Jamfile", """
+
+t = BoostBuild.Tester()
+
+t.write("jamroot.jam", "import gcc ;")
+
+t.write("jamfile.jam", """
exe hello : hello.cpp ;
-symlink hello_release : hello/<variant>release ;
+symlink hello_release : hello/<variant>release ;
symlink hello_debug : hello/<variant>debug ;
-symlink links/hello_release : hello/<variant>release ;
+symlink links/hello_release : hello/<variant>release ;
""")
+
t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
+int main() {}
""")
t.run_build_system()
-t.expect_addition(List('hello_debug.exe hello_release.exe links/hello_release.exe'))
-
+t.expect_addition([
+ 'hello_debug.exe',
+ 'hello_release.exe',
+ 'links/hello_release.exe'])
t.cleanup()
Modified: branches/release/tools/build/v2/test/tag.py
==============================================================================
--- branches/release/tools/build/v2/test/tag.py (original)
+++ branches/release/tools/build/v2/test/tag.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (C) Pedro Ferreira 2003. Permission to copy, use, modify, sell and
-# distribute this software is granted provided this copyright notice appears in
-# all copies. This software is provided "as is" without express or implied
-# warranty, and with no claim as to its suitability for any purpose.
+# Copyright (C) Pedro Ferreira 2003. Permission to copy, use, modify, sell and
+# distribute this software is granted provided this copyright notice appears in
+# all copies. This software is provided "as is" without express or implied
+# warranty, and with no claim as to its suitability for any purpose.
import BoostBuild
@@ -20,21 +20,21 @@
a dot in their name.
"""
- t.write("version-1.32.0/Jamroot.jam", """
+ t.write("version-1.32.0/jamroot.jam", """
project test : requirements <tag>@$(__name__).tag ;
rule tag ( name : type ? : property-set )
{
# Do nothing, just make sure the rule is invoked OK.
- ECHO "The tag rule was invoked" ;
+ ECHO "The tag rule has been invoked." ;
}
exe a : a.cpp ;
""")
- t.write("version-1.32.0/a.cpp", "int main() { return 0; }\n")
+ t.write("version-1.32.0/a.cpp", "int main() {}\n")
t.run_build_system(subdir="version-1.32.0")
t.expect_addition("version-1.32.0/bin/$toolset/debug/a.exe")
- t.expect_output_line("The tag rule was invoked")
+ t.expect_output_line("The tag rule has been invoked.")
################################################################################
@@ -48,7 +48,7 @@
"""Basic tag property test.
"""
- t.write("Jamroot.jam", """
+ t.write("jamroot.jam", """
import virtual-target ;
rule tag ( name : type ? : property-set )
@@ -78,11 +78,7 @@
""")
t.write("a.cpp", """
-int main()
-{
- return 0;
-}
-
+int main() {}
#ifdef _MSC_VER
__declspec (dllexport) void x () {}
#endif
Modified: branches/release/tools/build/v2/test/template.py
==============================================================================
--- branches/release/tools/build/v2/test/template.py (original)
+++ branches/release/tools/build/v2/test/template.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,41 +1,42 @@
#!/usr/bin/python
-# Copyright (C) FILL SOMETHING HERE 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)
-
-# This file is template for Boost.Build tests. It creates a simple
-# project that builds one exe from one source, and checks that the exe
-# is really created.
-from BoostBuild import Tester, List
+# Copyright (C) FILL SOMETHING HERE 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)
-# Create a temporary working directory
-t = Tester()
+# This file is template for Boost.Build tests. It creates a simple project that
+# builds one exe from one source, and checks that the exe is really created.
-# Create the needed files
-t.write("Jamroot", """
+import BoostBuild
+
+
+# Create a temporary working directory.
+t = BoostBuild.Tester()
+
+# Create the needed files.
+t.write("jamroot.jam", """
exe hello : hello.cpp ;
""")
-t.write("hello.cpp", """
-int main()
-{
- return 0;
-}
-""")
+t.write("hello.cpp", """
+int main() {}
+"""
+# Run the build.
t.run_build_system()
-# First, create a list of three pathnames
-file_list = List("bin/$toolset/debug/") * List("hello.exe hello.obj")
-# Second, assert that those files were added as result of the last build system invocation.
+# First, create a list of three pathnames.
+file_list = BoostBuild.List("bin/$toolset/debug/") * \
+ BoostBuild.List("hello.exe hello.obj")
+# Second, assert that those files were added as result of the last build system
+# invocation.
t.expect_addition(file_list)
-# Invoke the build system once again
+# Invoke the build system once again.
t.run_build_system("clean")
# Check if the files added previously were removed.
t.expect_removal(file_list)
-# Remove temporary directories
+# Remove temporary directories.
t.cleanup()
Modified: branches/release/tools/build/v2/test/test1.py
==============================================================================
--- branches/release/tools/build/v2/test/test1.py (original)
+++ branches/release/tools/build/v2/test/test1.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -8,8 +8,9 @@
t = BoostBuild.Tester()
-t.write("test.jam","""
-actions unbuilt { } unbuilt all ;
+t.write("test.jam", """
+actions unbuilt { }
+unbuilt all ;
ECHO "Hi" ;
""")
Modified: branches/release/tools/build/v2/test/test2.py
==============================================================================
--- branches/release/tools/build/v2/test/test2.py (original)
+++ branches/release/tools/build/v2/test/test2.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,24 +1,25 @@
#!/usr/bin/python
-# Copyright 2002, 2003 Dave Abrahams
-# Copyright 2002, 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)
+# Copyright 2002, 2003 Dave Abrahams
+# Copyright 2002, 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)
-from BoostBuild import Tester, List
-from time import sleep
+import BoostBuild
-t = Tester()
+t = BoostBuild.Tester()
t.set_tree("test2")
-t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
-file_list = 'bin/foo/$toolset/debug/runtime-link-dynamic/' * List("foo foo.o")
+file_list = 'bin/foo/$toolset/debug/runtime-link-dynamic/' * \
+ BoostBuild.List("foo foo.o")
+
+t.run_build_system("-sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
t.expect_addition(file_list)
-t.write("foo.cpp", "int main(int, char**) { return 0; }\n")
+t.write("foo.cpp", "int main() {}\n")
t.run_build_system("-d2 -sBOOST_BUILD_PATH=" + t.original_workdir + "/..")
t.expect_touch(file_list)
-t.pass_test()
+t.pass_test()
Deleted: branches/release/tools/build/v2/test/test2/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/test2/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,8 +0,0 @@
-# Copyright 2002 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)
-
-
-project-root ;
-
-exe foo : foo.cpp ;
Modified: branches/release/tools/build/v2/test/test_all.py
==============================================================================
--- branches/release/tools/build/v2/test/test_all.py (original)
+++ branches/release/tools/build/v2/test/test_all.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,17 +6,16 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-import os, sys, string
+import os
+import sys
+import string
import BoostBuild
-from BoostBuild import get_toolset
-# clear environment for testing
-#
-for s in (
- 'BOOST_ROOT','BOOST_BUILD_PATH','JAM_TOOLSET','BCCROOT',
- 'MSVCDir','MSVC','MSVCNT','MINGW','watcom'
- ):
+# Clear environment for testing.
+#
+for s in ('BOOST_ROOT', 'BOOST_BUILD_PATH', 'JAM_TOOLSET', 'BCCROOT', 'MSVCDir',
+ 'MSVC', 'MSVCNT', 'MINGW', 'watcom' ):
try:
del os.environ[s]
except:
@@ -24,12 +23,13 @@
BoostBuild.set_defer_annotations(1)
+
def run_tests(critical_tests, other_tests):
"""Runs first critical tests and then other_tests.
Stops on first error, and write the name of failed test to
- test_results.txt. Critical tests are run in the specified order,
- other tests are run starting with the one that failed the last time.
+ test_results.txt. Critical tests are run in the specified order, other
+ tests are run starting with the one that failed the last time.
"""
last_failed = last_failed_test()
other_tests = reorder_tests(other_tests, last_failed)
@@ -50,17 +50,16 @@
f.write(i)
f.close()
failures_count = failures_count + 1
- # Restore the current directory, which might be changed by the
- # test
+ # Restore the current directory, which might be changed by the test.
os.chdir(invocation_dir)
BoostBuild.flush_annotations();
continue
print "PASSED"
BoostBuild.flush_annotations();
pass_count = pass_count + 1
- sys.stdout.flush() # makes testing under emacs more entertaining.
+ sys.stdout.flush() # Makes testing under emacs more entertaining.
- # Erase the file on success
+ # Erase the file on success.
if failures_count == 0:
open('test_results.txt', 'w')
@@ -80,6 +79,7 @@
except:
return None
+
def reorder_tests(tests, first_test):
try:
n = tests.index(first_test)
@@ -93,106 +93,110 @@
critical_tests += ["core_d12", "core_typecheck", "core_delete_module",
"core_varnames", "core_import_module"]
-tests = [ "rebuilds",
- "timedata",
- "project_test3",
- "project_test4",
- "generators_test",
- "dependency_test",
- "path_features",
- "relative_sources",
- "no_type",
+tests = [ "absolute_sources",
+ "alias",
+ "alternatives",
+ "bad_dirname",
+ "build_dir",
+ "build_file",
+ "build_no",
+ "c_file",
"chain",
- "default_build",
- "default_toolset",
- "use_requirements",
+ "clean",
+ "composite",
"conditionals",
"conditionals2",
"conditionals3",
"conditionals_multiple",
"configuration",
- "indirect_conditional",
- "stage",
- "prebuilt",
- "project_dependencies",
- "build_dir",
- "searched_lib",
- "make_rule",
- "alias",
- "alternatives",
+ "custom_generator",
+ "default_build",
"default_features",
- "print",
- "ndebug",
- "explicit",
- "absolute_sources",
+ "default_toolset",
"dependency_property",
- "custom_generator",
- "bad_dirname",
- "c_file",
- "inline",
- "property_expansion",
- "loop",
- "tag",
- "suffix",
- "inherit_toolset",
- "skipping",
- "project_glob",
- "project_root_constants",
- "double_loading",
+ "dependency_test",
+ "disambiguation",
"dll_path",
- "regression",
- "composite",
- "library_chain",
- "unit_test",
- "standalone",
- "expansion",
- "wrapper",
+ "double_loading",
"duplicate",
+ "example_libraries",
+ "example_make",
+ "expansion",
+ "explicit",
+ "file_name_handling",
+ "free_features_request",
+ "generator_selection",
+ "generators_test",
+ "implicit_dependency",
+ "indirect_conditional",
+ "inherit_toolset",
+ "inherited_dependency",
+ "inline",
+ "lib_source_property",
+ "library_chain",
"library_property",
"load_order",
- "wrong_project",
- "using",
- "source_locations",
- "out_of_tree",
+ "loop",
+ "make_rule",
+ "ndebug",
+ "no_type",
"notfile",
+ "ordered_include",
+ "out_of_tree",
+ "path_features",
+ "prebuilt",
+ "print",
+ "project_dependencies",
+ "project_glob",
+ "project_root_constants",
"project_root_rule",
- "resolution",
- "build_file",
- "build_no",
- "disambiguation",
- "clean",
- "lib_source_property",
- "implicit_dependency",
- "example_libraries",
- "example_make",
+ "project_test3",
+ "project_test4",
+ "property_expansion",
+ "rebuilds",
+ "regression",
+ "relative_sources",
"remove_requirement",
- "free_features_request",
- "file_name_handling",
- "sort_rule"
+ "resolution",
+ "searched_lib",
+ "skipping",
+ "sort_rule",
+ "source_locations",
+ "stage",
+ "standalone",
+ "suffix",
+ "tag",
+ "test_result_dumping",
+ "testing_support",
+ "timedata",
+ "unit_test",
+ "use_requirements",
+ "using",
+ "wrapper",
+ "wrong_project"
]
if os.name == 'posix':
tests.append("symlink")
- # On windows, library order is not important, so skip this test
- # Besides, it fails ;-)
- # Further, the test relies on the fact that on Linux, one
- # can build a shared library with unresolved symbols. This is
- # not true on Windows (even with cygwin gcc).
+ # On windows, library order is not important, so skip this test. Besides, it
+ # fails ;-). Further, the test relies on the fact that on Linux, one can
+ # build a shared library with unresolved symbols. This is not true on
+ # Windows (even with cygwin gcc).
if string.find(os.uname()[0], "CYGWIN") == -1:
tests.append("library_order")
-if string.find(get_toolset(), 'gcc') == 0:
+if string.find(BoostBuild.get_toolset(), 'gcc') == 0:
tests.append("gcc_runtime")
-if string.find(get_toolset(), 'gcc') == 0 or string.find(get_toolset(), 'msvc') == 0:
+if ( string.find(BoostBuild.get_toolset(), 'gcc') == 0 )or \
+ ( string.find(BoostBuild.get_toolset(), 'msvc') == 0 ):
tests.append("pch")
if "--extras" in sys.argv:
tests.append("boostbook")
tests.append("qt4")
tests.append("example_qt4")
- # Requires ./whatever.py to work, so is
- # not guaranted to work everywhere.
+ # Requires ./whatever.py to work, so is not guaranted to work everywhere.
tests.append("example_customization")
# Requires gettext tools.
tests.append("example_gettext")
Modified: branches/release/tools/build/v2/test/test_system.html
==============================================================================
--- branches/release/tools/build/v2/test/test_system.html (original)
+++ branches/release/tools/build/v2/test/test_system.html 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -112,12 +112,11 @@
"../../../jam/index.html">$boost_build_root/jam/index.html</a> for
instructions.</li>
- <li>Configure at least one toolset. You can edit
- <tt>site-config.jam</tt> or <tt>user-config.jam</tt> to add new
- toolsets. Or you can create file <tt>test-config.jam</tt> in
- <tt>$boost_build_root/test</tt> directory. In this case,
- <tt>site-config.jam</tt> and <tt>user-config.jam</tt> will be ignored
- for testing.</li>
+ <li>Configure at least one toolset. You can edit <tt>site-config.jam</tt>
+ or <tt>user-config.jam</tt> to add new toolsets. Or you can create file
+ <tt>test-config.jam</tt> in <tt>$boost_build_root/test</tt> directory. In
+ this case, <tt>site-config.jam</tt> and <tt>user-config.jam</tt> will be
+ ignored for testing.</li>
</ol>
<p>When all is set, you can run all the tests using the <tt>test_all.py</tt>
@@ -211,14 +210,14 @@
<p>The "hello.py" module might contain:</p>
<pre class="example">
-from BoostBuild import Tester, List
+from BoostBuild import List
# Create a temporary working directory
-t = Tester()
+t = BoostBuild.Tester()
# Create the needed files
-t.write("project-root.jam", "")
-t.write("Jamfile", """
+t.write("jamroot.jam", "")
+t.write("jamfile.jam", """
exe hello : hello.cpp ;
""")
t.write("hello.cpp", """
Modified: branches/release/tools/build/v2/test/testing_primitives.py
==============================================================================
--- branches/release/tools/build/v2/test/testing_primitives.py (original)
+++ branches/release/tools/build/v2/test/testing_primitives.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,34 +4,27 @@
# 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)
-from BoostBuild import Tester, List
-import os
-from string import strip
+import BoostBuild
import re
-def match_re(actual,expected):
- return re.match(expected,actual,re.DOTALL) != None
+def match_re(actual, expected):
+ return re.match(expected, actual, re.DOTALL) != None
-t = Tester(match = match_re)
+t = BoostBuild.Tester(match=match_re)
t.set_tree('testing-primitives')
-# We expect t5 and t7's output to be dumped to stdout
+# We expect t5 and t7's output to be dumped to stdout.
t.run_build_system(stdout=r'''.*failing t5.*failing t7''')
t.expect_addition('t2.txt')
t.expect_addition('t3.txt')
-
t.expect_addition('t5.out')
-
t.expect_addition('t6.out')
t.expect_addition('t6.txt')
-
t.expect_addition('t7.out')
t.expect_addition('t7.txt')
-
t.expect_addition('t8.out')
-
t.expect_nothing_more()
+
t.cleanup()
-print 'tesing complete'
Modified: branches/release/tools/build/v2/test/timedata.py
==============================================================================
--- branches/release/tools/build/v2/test/timedata.py (original)
+++ branches/release/tools/build/v2/test/timedata.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,16 +1,30 @@
#!/usr/bin/python
-# Copyright David Abrahams 2005. 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)
-# This tests the build step timing facilities.
+# Copyright 2005 David Abrahams
+# Copyright 2008 Jurko Gospodnetic
+# 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)
+
+# Tests the build step timing facilities.
+
import BoostBuild
import re
-t = BoostBuild.Tester(pass_toolset=0)
-t.write("file.jam", """
+################################################################################
+#
+# basic_jam_action_test()
+# -----------------------
+#
+################################################################################
+
+def basic_jam_action_test():
+ """Tests basic Jam action timing support."""
+
+ t = BoostBuild.Tester(pass_toolset=0)
+
+ t.write("file.jam", """
rule time
{
DEPENDS $(<) : $(>) ;
@@ -40,14 +54,13 @@
echo made from $(>) >> $(<)
}
-
time foo : bar ;
make bar : baz ;
""")
-t.write("baz", "nothing\n")
+ t.write("baz", "nothing\n")
-expected_output = """\.\.\.found 4 targets\.\.\.
+ expected_output = """\.\.\.found 4 targets\.\.\.
\.\.\.updating 2 targets\.\.\.
make bar
time foo
@@ -55,10 +68,88 @@
\.\.\.updated 2 targets\.\.\.$
"""
-t.run_build_system("-ffile.jam -d+1", stdout=expected_output,
- match=lambda actual, expected: re.search(expected, actual, re.DOTALL))
-t.expect_addition("foo")
-t.expect_addition("bar")
-t.expect_nothing_more()
+ t.run_build_system("-ffile.jam -d+1", stdout=expected_output, match=lambda
+ actual, expected: re.search(expected, actual, re.DOTALL))
+ t.expect_addition("foo")
+ t.expect_addition("bar")
+ t.expect_nothing_more()
+
+ t.cleanup()
+
+
+################################################################################
+#
+# boost_build_testing_support_timing_rule():
+# ------------------------------------------
+#
+################################################################################
+
+def boost_build_testing_support_timing_rule():
+ """Tests the target build timing rule provided by the Boost Build testing
+ support system.
+ """
+
+ t = BoostBuild.Tester()
+
+ t.write("aaa.cpp", "int main() {}\n")
+
+ t.write("jamroot.jam", """
+import testing ;
+exe my-exe : aaa.cpp ;
+time my-time : my-exe ;
+""")
+
+ t.run_build_system()
+ t.expect_addition("bin/$toolset/debug/aaa.obj")
+ t.expect_addition("bin/$toolset/debug/my-exe.exe")
+ t.expect_addition("bin/$toolset/debug/my-time.time")
+
+ t.expect_content_line("bin/$toolset/debug/my-time.time", "user: *")
+ t.expect_content_line("bin/$toolset/debug/my-time.time", "system: *")
+
+ t.cleanup()
+
+
+################################################################################
+#
+# boost_build_testing_support_timing_rule_with_spaces_in_names()
+# --------------------------------------------------------------
+#
+################################################################################
+
+def boost_build_testing_support_timing_rule_with_spaces_in_names():
+ """Tests the target build timing rule provided by the Boost Build testing
+ support system when used with targets contining spaces in their names.
+ """
+
+ t = BoostBuild.Tester()
+
+ t.write("aaa bbb.cpp", "int main() {}\n")
+
+ t.write("jamroot.jam", """
+import testing ;
+exe "my exe" : "aaa bbb.cpp" ;
+time "my time" : "my exe" ;
+""")
-t.cleanup()
+ t.run_build_system()
+ t.expect_addition("bin/$toolset/debug/aaa bbb.obj")
+ t.expect_addition("bin/$toolset/debug/my exe.exe")
+ t.expect_addition("bin/$toolset/debug/my time.time")
+
+ t.expect_content_line("bin/$toolset/debug/my time.time", "user: *")
+ t.expect_content_line("bin/$toolset/debug/my time.time", "system: *")
+
+ t.cleanup()
+
+
+################################################################################
+#
+# main()
+# ------
+#
+################################################################################
+
+basic_jam_action_test()
+boost_build_testing_support_timing_rule()
+boost_build_testing_support_timing_rule_with_spaces_in_names()
\ No newline at end of file
Modified: branches/release/tools/build/v2/test/tree.py
==============================================================================
--- branches/release/tools/build/v2/test/tree.py (original)
+++ branches/release/tools/build/v2/test/tree.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,7 +1,7 @@
-# Copyright 2003 Dave Abrahams
-# Copyright 2001, 2002 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)
+# Copyright 2003 Dave Abrahams
+# Copyright 2001, 2002 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)
# This file is based in part on the content of svn_tree.py.
@@ -20,7 +20,7 @@
self.removed_files.extend(other.removed_files)
self.modified_files.extend(other.modified_files)
self.touched_files.extend(other.touched_files)
-
+
def ignore_directories(self):
"Removes directories for list of found differences"
@@ -33,13 +33,15 @@
def pprint(self, f=None):
print >> f, "Added files :", self.added_files
- print >> f,"Removed files :", self.removed_files
+ print >> f, "Removed files :", self.removed_files
print >> f, "Modified files:", self.modified_files
print >> f, "Touched files :", self.touched_files
def empty(self):
- return (len(self.added_files) == 0 and len(self.removed_files) == 0)\
- and len(self.modified_files) == 0 and len(self.touched_files) == 0
+ return ( len(self.added_files) == 0 ) and \
+ ( len(self.removed_files) == 0 ) and \
+ ( len(self.modified_files) == 0 ) and \
+ ( len(self.touched_files) == 0 )
def build_tree(dir):
return svn_tree.build_tree_from_wc(dir, load_props=0, ignore_svn=1)
Modified: branches/release/tools/build/v2/test/unit_test.py
==============================================================================
--- branches/release/tools/build/v2/test/unit_test.py (original)
+++ branches/release/tools/build/v2/test/unit_test.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,16 +1,17 @@
#!/usr/bin/python
-# Copyright 2003, 2004 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)
+# Copyright 2003, 2004 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)
+
+# Test the unit_test rule.
-# Test the unit_test rule
import BoostBuild
t = BoostBuild.Tester()
# Create the needed files.
-t.write("Jamroot.jam", """
+t.write("jamroot.jam", """
using testing ;
lib helper : helper.cpp ;
unit-test test : test.cpp : <library>helper ;
@@ -18,11 +19,7 @@
t.write("test.cpp", """
void helper();
-int main()
-{
- helper();
- return 0;
-}
+int main() { helper(); }
""")
t.write("helper.cpp", """
Modified: branches/release/tools/build/v2/test/unit_tests.py
==============================================================================
--- branches/release/tools/build/v2/test/unit_tests.py (original)
+++ branches/release/tools/build/v2/test/unit_tests.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,9 +4,10 @@
# 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)
-from BoostBuild import Tester
+import BoostBuild
+
+t = BoostBuild.Tester(pass_toolset=0)
-t = Tester(pass_toolset=0)
t.run_build_system(extra_args="--debug --build-system=test")
t.cleanup()
Modified: branches/release/tools/build/v2/test/unused.py
==============================================================================
--- branches/release/tools/build/v2/test/unused.py (original)
+++ branches/release/tools/build/v2/test/unused.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,26 +6,26 @@
# Test that unused sources are at least reported.
-from BoostBuild import Tester
+import BoostBuild
from string import find
-t = Tester()
+
+t = BoostBuild.Tester()
t.set_tree("unused")
t.run_build_system()
-# The second invocation should do nothing, and produce
-# no warning. The previous invocation might have printed
-# executed actions and other things, so it's not easy
-# to check if warning was issued or not.
+# The second invocation should do nothing, and produce no warning. The previous
+# invocation might have printed executed actions and other things, so it is not
+# easy to check if warning was issued or not.
t.run_build_system()
t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)
t.run_build_system("-sGENERATE_ONLY_UNUSABLE=1")
t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)
-# Now check that even if main target generates nothing, its
-# usage requirements are still propagated to dependents.
-t.write("a.cpp","""
+# Now check that even if main target generates nothing, its usage requirements
+# are still propagated to dependants.
+t.write("a.cpp", """
#ifdef FOO
int main() {}
#endif
@@ -33,4 +33,3 @@
t.run_build_system("-sGENERATE_NOTHING=1")
t.cleanup()
-
Deleted: branches/release/tools/build/v2/test/unused/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/unused/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,11 +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)
-
-
-exe a : a.cpp b c ;
-
-make-b-main-target ;
-
-# Expands to nothing, intentionally.
-alias c ;
Deleted: branches/release/tools/build/v2/test/unused/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/unused/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,57 +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)
-
-
-import type ;
-import generators ;
-import print ;
-import virtual-target ;
-import "class" : new ;
-import modules ;
-import targets ;
-
-
-type.register X : x ;
-
-class test-target-class : basic-target
-{
- rule __init__ ( name : project )
- {
- basic-target.__init__ $(name) : $(project) ;
- }
-
- rule construct ( source-targets * : property-set )
- {
- if [ modules.peek : GENERATE_NOTHING ]
- {
- return ;
- }
- else if [ modules.peek : GENERATE_ONLY_UNUSABLE ]
- {
- return [ virtual-target.from-file b.x : $(self.project) ]
- ;
- }
- else
- {
- return [ virtual-target.from-file b.x : $(self.project) ]
- [ virtual-target.from-file b.cpp : $(self.project) ]
- ;
- }
- }
-
- rule compute-usage-requirements ( rproperties : targets * )
- {
- return [ property-set.create <define>FOO ] ;
- }
-}
-
-rule make-b-main-target
-{
- local project = [ CALLER_MODULE ] ;
-
- targets.main-target-alternative
- [ new test-target-class b : $(project) ] ;
-}
-
-IMPORT $(__name__) : make-b-main-target : : make-b-main-target ;
Modified: branches/release/tools/build/v2/test/use_requirements.py
==============================================================================
--- branches/release/tools/build/v2/test/use_requirements.py (original)
+++ branches/release/tools/build/v2/test/use_requirements.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,33 +1,29 @@
#!/usr/bin/python
-# Copyright 2003 Dave Abrahams
-# Copyright 2002, 2003, 2004, 2006 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)
-
-from BoostBuild import Tester
-t = Tester()
-
-# Test that use requirements on main target work
-# (and a propagated all the way up, not only to direct
-# dependents)
-t.write("project-root.jam", "import gcc ;")
-
-# Note: 'lib cc ..', not 'lib c', If using 'lib c: ...' the HP-CXX
-# linker will confuse it with the system C runtime.
-t.write(
- "Jamfile",
-"""
- lib b : b.cpp : <link>shared:<define>SHARED_B
- : : <define>FOO <link>shared:<define>SHARED_B
- ;
- lib cc : c.cpp b ;
- exe a : a.cpp cc ;
-""")
-
-t.write(
- "b.cpp",
-"""
+# Copyright 2003 Dave Abrahams
+# Copyright 2002, 2003, 2004, 2006 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)
+
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+
+# Test that use requirements on main target work (and a propagated all the way
+# up, not only to direct dependants).
+t.write("jamroot.jam", "import gcc ;")
+
+# Note: 'lib cc ..', not 'lib c'. If using 'lib c: ...' the HP-CXX linker will
+# confuse it with the system C runtime.
+t.write("jamfile.jam", """
+lib b : b.cpp : <link>shared:<define>SHARED_B : :
+ <define>FOO <link>shared:<define>SHARED_B ;
+lib cc : c.cpp b ;
+exe a : a.cpp cc ;
+""")
+
+t.write("b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -35,9 +31,7 @@
foo() {}\n
""")
-t.write(
- "c.cpp",
-"""
+t.write("c.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -45,10 +39,7 @@
create_lib_please() {}\n
""")
-
-t.write(
- "a.cpp",
-"""
+t.write("a.cpp", """
#ifdef FOO
void
# if defined(_WIN32) && defined(SHARED_B)
@@ -56,30 +47,24 @@
# endif
foo() {}
#endif
-
int main() { foo(); }
""")
t.run_build_system()
-
t.run_build_system("--clean")
+
# Test that use requirements on main target work, when they are referred using
# 'dependency' features.
-t.write("project-root.jam", "import gcc ;")
+t.write("jamroot.jam", "import gcc ;")
-t.write(
- "Jamfile",
-"""
- lib b : b.cpp : <link>shared:<define>SHARED_B
- : : <define>FOO <link>shared:<define>SHARED_B
- ;
- exe a : a.cpp : <use>b ;
+t.write("jamfile.jam", """
+lib b : b.cpp : <link>shared:<define>SHARED_B : : <define>FOO
+ <link>shared:<define>SHARED_B ;
+exe a : a.cpp : <use>b ;
""")
-t.write(
- "b.cpp",
-"""
+t.write("b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -87,11 +72,9 @@
foo() {}
""")
-t.write(
- "a.cpp",
-"""
+t.write("a.cpp", """
#ifdef FOO
-int main() { return 0; }
+int main() {}
#endif
""")
@@ -100,22 +83,17 @@
t.run_build_system("--clean")
-# Test that use requirement on project work
-t.write("Jamfile", "exe a : a.cpp lib//b ;")
+# Test that usage requirements on a project work.
+t.write("jamfile.jam", "exe a : a.cpp lib//b ;")
-t.write(
- "lib/Jamfile",
-"""
+t.write("lib/jamfile.jam", """
project
: requirements <link>shared:<define>SHARED_B
- : usage-requirements <define>FOO <link>shared:<define>SHARED_B
- ;
+ : usage-requirements <define>FOO <link>shared:<define>SHARED_B ;
lib b : b.cpp ;
""")
-t.write(
- "lib/b.cpp",
-"""
+t.write("lib/b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -125,42 +103,29 @@
t.run_build_system()
-# Test that use requirements are inherited correctly
-t.write("Jamfile", "exe a : a.cpp lib/1//b ;")
+# Test that use requirements are inherited correctly.
+t.write("jamfile.jam", "exe a : a.cpp lib/1//b ;")
-t.write(
- "a.cpp",
-"""
+t.write("a.cpp", """
#if defined(FOO) && defined(ZOO)
void foo() {}
#endif
-
int main() { foo(); }
""")
-t.write(
- "lib/Jamfile",
-"""
-project
- : requirements
- : usage-requirements <define>FOO
- ;
+t.write("lib/jamfile.jam", """
+project : requirements : usage-requirements <define>FOO ;
""")
-t.write(
- "lib/1/Jamfile",
-"""
+t.write("lib/1/jamfile.jam", """
project
: requirements <link>shared:<define>SHARED_B
- : usage-requirements <define>ZOO <link>shared:<define>SHARED_B
- ;
+ : usage-requirements <define>ZOO <link>shared:<define>SHARED_B ;
lib b : b.cpp ;
""")
-t.write(
- "lib/1/b.cpp",
-"""
+t.write("lib/1/b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
__declspec(dllexport)
@@ -171,29 +136,22 @@
t.run_build_system()
t.run_build_system("--clean")
-# Test that we correctly handle dependency features
-# in use requirements on target
-t.write(
- "Jamfile",
-"""
- lib b : b.cpp : <link>shared:<define>SHARED_B
- : : <define>FOO <link>shared:<define>SHARED_B
- ;
-
- # Here's the test: we should correctly
- # handle dependency feature and get
- # use requirements from 'b'.
- lib cc : c.cpp : <link>shared:<define>SHARED_C : : <library>b ;
-
- # This will build only if <define>FOO
- # was propagated from 'c'.
- exe a : a.cpp cc ;
-""")
-
-t.write(
- "a.cpp",
-"""
+# Test that we correctly handle dependency features in use requirements on
+# target.
+t.write("jamfile.jam", """
+lib b : b.cpp : <link>shared:<define>SHARED_B : : <define>FOO
+ <link>shared:<define>SHARED_B ;
+
+# Here's the test: we should correctly handle dependency feature and get usage
+# requirements from 'b'.
+lib cc : c.cpp : <link>shared:<define>SHARED_C : : <library>b ;
+
+# This will build only if <define>FOO was propagated from 'c'.
+exe a : a.cpp cc ;
+""")
+
+t.write("a.cpp", """
#ifdef FOO
void
# if defined(_WIN32) && defined(SHARED_B)
@@ -205,10 +163,8 @@
int main() { foo(); }
""")
-t.write(
- "c.cpp",
-"""
-int
+t.write("c.cpp", """
+int
#if defined(_WIN32) && defined(SHARED_C)
__declspec(dllexport)
#endif
@@ -218,119 +174,97 @@
t.run_build_system()
t.run_build_system("--clean")
-# Test correct handling of dependency features in
-# project requirements.
-t.write(
- "Jamfile",
-"""
- exe a : a.cpp lib1//cc ;
+
+# Test correct handling of dependency features in project requirements.
+t.write("jamfile.jam", """
+exe a : a.cpp lib1//cc ;
""")
-t.write(
- "lib1/Jamfile",
-"""
- project
+t.write("lib1/jamfile.jam", """
+project
: requirements <link>shared:<define>SHARED_C
- : usage-requirements <library>../lib2//b <link>shared:<define>SHARED_C
- ;
-
- lib cc : c.cpp ;
+ : usage-requirements <library>../lib2//b <link>shared:<define>SHARED_C ;
+lib cc : c.cpp ;
""")
-t.write(
- "lib1/c.cpp",
-"""
-int
+t.write("lib1/c.cpp", """
+int
#if defined(_WIN32) && defined(SHARED_C)
__declspec(dllexport)
#endif
must_export_something;
""")
-t.write(
- "lib2/Jamfile",
-"""
- lib b : b.cpp : <link>shared:<define>SHARED_B
- : : <define>FOO <link>shared:<define>SHARED_B ;
+t.write("lib2/jamfile.jam", """
+lib b : b.cpp : <link>shared:<define>SHARED_B : : <define>FOO
+ <link>shared:<define>SHARED_B ;
""")
t.copy("b.cpp", "lib2/b.cpp")
t.run_build_system()
-# Test that dependency feature in use requirements are built
-# with the correct properties
+
+# Test that dependency feature in use requirements are built with the correct
+# properties.
t.rm(".")
-t.write(
- "Jamfile",
-"""
-lib main : main.cpp : <use>libs//lib1 : : <library>libs//lib1 ;
+t.write("jamfile.jam", """
+lib main : main.cpp : <use>libs//lib1 : : <library>libs//lib1 ;
exe hello : hello.cpp main : ;
""")
-t.write(
- "main.cpp",
-"""
+t.write("main.cpp", """
void
#if defined(_WIN32) && defined(SHARED_LIB1)
__declspec(dllimport)
#endif
foo();
-int main() { foo(); return 0; }
+int main() { foo(); }
""")
t.write("hello.cpp", "\n")
-t.write(
- "project-root.jam",
-"""
-import gcc ;
+t.write("jamroot.jam", """
+import gcc ;
""")
-t.write(
- "libs/a.cpp",
-"""
+t.write("libs/a.cpp", """
void
#if defined(_WIN32) && defined(SHARED_LIB1)
__declspec(dllexport)
#endif
-foo() {}
+foo() {}
""")
-# This library should be build with the same properties as
-# 'main'. There were a bug when they were generated with
-# empty properties, and there were ambiguity between variants.
-t.write(
- "libs/Jamfile",
-"""
-lib lib1 : a_d.cpp : <variant>debug <link>shared:<define>SHARED_LIB1
-: : <link>shared:<define>SHARED_LIB1 ;
-lib lib1 : a.cpp : <variant>release <link>shared:<define>SHARED_LIB1
-: : <link>shared:<define>SHARED_LIB1 ;
+# This library should be build with the same properties as 'main'. This is a
+# regression test for a bug when they were generated with empty properties, and
+# there were ambiguity between variants.
+t.write("libs/jamfile.jam", """
+lib lib1 : a_d.cpp : <variant>debug <link>shared:<define>SHARED_LIB1 : :
+ <link>shared:<define>SHARED_LIB1 ;
+lib lib1 : a.cpp : <variant>release <link>shared:<define>SHARED_LIB1 : :
+ <link>shared:<define>SHARED_LIB1 ;
""")
-t.write(
- "libs/a_d.cpp",
-"""
+t.write("libs/a_d.cpp", """
void
#if defined(_WIN32) && defined(SHARED_LIB1)
__declspec(dllexport)
#endif
-foo() {}
+foo() {}
""")
t.run_build_system("link=static")
t.expect_addition("libs/bin/$toolset/debug/link-static/a_d.obj")
-# Test that indirect conditionals are respected in
-# usage requirements.
+# Test that indirect conditionals are respected in usage requirements.
t.rm(".")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
rule has-foo ( properties * )
{
return <define>HAS_FOO ;
@@ -339,12 +273,14 @@
exe a : a.cpp b ;
lib b : b.cpp : <link>static : : <conditional>@has-foo ;
""")
+
t.write("a.cpp", """
#ifdef HAS_FOO
void foo();
int main() { foo(); }
#endif
""")
+
t.write("b.cpp", """
void
#if defined(_WIN32) && defined(SHARED_B)
@@ -352,8 +288,8 @@
#endif
foo() {}\n
""")
+
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
-
t.cleanup()
Modified: branches/release/tools/build/v2/test/using.py
==============================================================================
--- branches/release/tools/build/v2/test/using.py (original)
+++ branches/release/tools/build/v2/test/using.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,43 +1,33 @@
#!/usr/bin/python
-# Copyright (C) Vladimir Prus 2005.
-# 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)
+# Copyright (C) Vladimir Prus 2005.
+# 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)
-from BoostBuild import Tester, List
-import string
+import BoostBuild
-t = Tester()
-
-t.write("sub/a.cpp", """
-int main() { return 0; }
+t = BoostBuild.Tester()
+t.write("sub/a.cpp", """
+int main() {}
""")
-t.write("Jamroot", """
+t.write("jamroot.jam", """
using some_tool ;
""")
-t.write("some_tool.jam", """
+t.write("some_tool.jam", """
import project ;
project.initialize $(__name__) ;
-
-rule init ( )
-{
-}
-
+rule init ( ) { }
""")
-t.write("sub/Jamfile", """
-exe a : a.cpp ;
+t.write("sub/jamfile.jam", """
+exe a : a.cpp ;
""")
-
-
t.run_build_system(subdir="sub")
-
t.expect_addition("sub/bin/$toolset/debug/a.exe")
t.cleanup()
-
Deleted: branches/release/tools/build/v2/test/v1-testing/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/v1-testing/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,26 +0,0 @@
-# Copyright 2002, 2003 Dave Abrahams
-# 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)
-
-import testing ;
-
-# A number of tests which should succeed
-compile a.cpp ;
-compile-fail b.cpp ;
-link-fail a.cpp : : link-no ;
-link c.cpp : : link-yes ;
-run c.cpp : : : : run-yes ;
-run-fail c.cpp : : : <define>RESULTCODE=1 : run-no ;
-
-# some tests which should fail
-
-compile-fail a.cpp : : fail-compile-no ;
-compile b.cpp : : fail-compile-yes ;
-link a.cpp : : fail-link-yes ;
-link-fail c.cpp : : fail-link-no ;
-run-fail c.cpp : : : : fail-run-no ;
-run c.cpp : : : <define>RESULTCODE=1 : fail-run-yes ;
-
-# Make sure we still fail if a dependency of an expected-failure test
-# fails.
-link-fail b.cpp : : fail-link-no-dependency ;
Modified: branches/release/tools/build/v2/test/v1_testing.py
==============================================================================
--- branches/release/tools/build/v2/test/v1_testing.py (original)
+++ branches/release/tools/build/v2/test/v1_testing.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,11 +1,11 @@
#!/usr/bin/python
-# Copyright 2002 Dave Abrahams
-# Copyright 2004 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)
+# Copyright 2002 Dave Abrahams
+# Copyright 2004 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)
-from BoostBuild import Tester, List
+import BoostBuild
import os
from string import strip
import re
@@ -14,7 +14,7 @@
def match_re(actual,expected):
return re.match(expected,actual,re.DOTALL) != None
-t = Tester(match = match_re, boost_build_path = os.path.join(os.getcwd(), ".."))
+t = BoostBuild.Tester(match = match_re, boost_build_path = os.path.join(os.getcwd(), ".."))
t.set_tree('v1_testing')
os.environ['TOOLS'] = 'gcc'
@@ -59,11 +59,11 @@
# function, but we actually need to spell out a lot more than
# what we currently have to do that.
-# 4) Introduced error into one of the library files, causing a library build
-# compile to fail. path_test.test was deleted, so the reporting programs
-# would know that failure occurred. Excellent! This is the case that has
-# caused regression testing to report the wrong results in the past, so it
-# was good news to see it working correctly now. We probably should figure
+# 4) Introduced error into one of the library files, causing a library build
+# compile to fail. path_test.test was deleted, so the reporting programs
+# would know that failure occurred. Excellent! This is the case that has
+# caused regression testing to report the wrong results in the past, so it
+# was good news to see it working correctly now. We probably should figure
# out some other test cases just to be sure it is working for full coverage.
t.rename('lib.cpp', 'lib.cpp.bak')
t.rename('lib-err.cpp', 'lib.cpp')
@@ -74,9 +74,9 @@
, 'bin/nolink.test/gcc/debug/runtime-link-dynamic/nolink.test'
, 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
-# 5) Fixed the error in the library file. The library build then worked, and
-# path_test.exe was relinked, without first recompiling path_test.obj. Test
-# was rerun. Exactly right behavior!
+# 5) Fixed the error in the library file. The library build then worked, and
+# path_test.exe was relinked, without first recompiling path_test.obj. Test was
+# rerun. Exactly the right behavior!
t.rename('lib.cpp.bak', 'lib.cpp')
t.run_build_system(arguments = 'test', status = 0)
t.expect_addition(
@@ -85,4 +85,4 @@
, 'bin/run.test/gcc/debug/runtime-link-dynamic/run.test'])
t.cleanup()
-print 'tesing complete'
+print 'testing complete'
Deleted: branches/release/tools/build/v2/test/v1_testing/Jamfile
==============================================================================
--- branches/release/tools/build/v2/test/v1_testing/Jamfile 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,23 +0,0 @@
-# Copyright 2002, 2003 Dave Abrahams
-# 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)
-
-TOOLS = $(TOOLS[1]) ;
-project-root ;
-
-# bring in rules for testing
-import testing ;
-
-lib mylib : lib.cpp ;
-
-compile foo.cpp : : compile ;
-compile-fail foo.cpp : <define>NOCOMPILE : nocompile ;
-
-link foo.cpp <lib>mylib : : link ;
-link-fail foo.cpp <lib>mylib : <define>NOLINK : nolink ;
-
-run foo.cpp <lib>mylib
- : # args
- : # input-files
- : <define>RUN
- : run ;
Deleted: branches/release/tools/build/v2/test/v1_testing/project-root.jam
==============================================================================
--- branches/release/tools/build/v2/test/v1_testing/project-root.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
+++ (empty file)
@@ -1,5 +0,0 @@
-# Copyright 2002 Dave Abrahams
-# 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)
-
-# just label the project root
Modified: branches/release/tools/build/v2/test/wrapper.py
==============================================================================
--- branches/release/tools/build/v2/test/wrapper.py (original)
+++ branches/release/tools/build/v2/test/wrapper.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,46 +1,38 @@
#!/usr/bin/python
-# Copyright 2004 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)
+# Copyright 2004 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)
-# Test that the user can define his own rule that will call builtin main
-# target rule and that this will work.
+# Test that the user can define his own rule that will call built-in main target
+# rule and that this will work.
-from BoostBuild import Tester, List
+import BoostBuild
-t = Tester()
-
-t.write("Jamfile", """ my-test : test.cpp ;
+t = BoostBuild.Tester()
+t.write("jamfile.jam", """
+my-test : test.cpp ;
""")
-t.write("test.cpp", """
-int main()
-{
- return 0;
-}
-
+t.write("test.cpp", """
+int main() {}
""")
-t.write("project-root.jam", """ using testing ;
+t.write("jamroot.jam", """
+using testing ;
rule my-test ( name ? : sources + )
{
- {
- name ?= test ;
- unit-test $(name) : $(sources) ; # /site-config//cppunit /util//testMain ;
- }
+ name ?= test ;
+ unit-test $(name) : $(sources) ; # /site-config//cppunit /util//testMain ;
}
IMPORT $(__name__) : my-test : : my-test ;
-
-
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/test.passed")
t.cleanup()
-
Modified: branches/release/tools/build/v2/test/wrong_project.py
==============================================================================
--- branches/release/tools/build/v2/test/wrong_project.py (original)
+++ branches/release/tools/build/v2/test/wrong_project.py 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -5,39 +5,28 @@
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
-# Regression test. When Jamfile contained "using whatever ; " and the
-# 'whatever' module declared a project, then all targets in Jamfile were
-# considered to be declared in the project associated with 'whatever',
-# not with the Jamfile.
+# Regression test. When Jamfile contained "using whatever ; " and the 'whatever'
+# module declared a project, then all targets in Jamfile were considered to be
+# declared in the project associated with 'whatever', not with the Jamfile.
-from BoostBuild import Tester, List
+import BoostBuild
+t = BoostBuild.Tester()
-t = Tester()
-# Remove temporary directories
+t.write("a.cpp", "int main() {}\n")
-t.write("a.cpp", """
-int main() { return 0; }
-
-""")
-
-t.write("Jamroot", """
+t.write("jamroot.jam", """
using some_tool ;
-exe a : a.cpp ;
+exe a : a.cpp ;
""")
-t.write("some_tool.jam", """
+t.write("some_tool.jam", """
import project ;
project.initialize $(__name__) ;
-
-rule init ( )
-{
-}
-
+rule init ( ) { }
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/a.exe")
t.cleanup()
-
Modified: branches/release/tools/build/v2/tools/acc.jam
==============================================================================
--- branches/release/tools/build/v2/tools/acc.jam (original)
+++ branches/release/tools/build/v2/tools/acc.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -19,15 +19,15 @@
generators.override builtin.lib-generator : acc.prebuilt ;
generators.override acc.searched-lib-generator : searched-lib-generator ;
-# Configures the acc toolset.
+# Configures the acc toolset.
rule init ( version ? : user-provided-command * : options * )
{
- local condition = [ common.check-init-parameters acc
+ local condition = [ common.check-init-parameters acc
: version $(version) ] ;
-
+
local command = [ common.get-invocation-command acc : aCC
: $(user-provided-command) ] ;
-
+
common.handle-options acc : $(condition) : $(command) : $(options) ;
}
@@ -81,6 +81,9 @@
flags acc CFLAGS <threading>multi : -mt ;
flags acc LINKFLAGS <threading>multi : -mt ;
+flags acc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ;
+
+
actions acc.link bind NEEDLIBS
{
$(CONFIG_COMMAND) -AA $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS)
@@ -93,13 +96,13 @@
}
actions acc.compile.c
-{
- $(CONFIG_COMMAND) -Ae -c -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" $(OPTIONS)
+{
+ cc -c -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" $(OPTIONS)
}
actions acc.compile.c++
{
- $(CONFIG_COMMAND) -AA -c -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" $(OPTIONS)
+ $(CONFIG_COMMAND) -AA -c -Wc,--pending_instantiations=$(TEMPLATE_DEPTH) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" $(OPTIONS)
}
actions updated together piecemeal acc.archive
Modified: branches/release/tools/build/v2/tools/boostbook-config.jam
==============================================================================
--- branches/release/tools/build/v2/tools/boostbook-config.jam (original)
+++ branches/release/tools/build/v2/tools/boostbook-config.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -21,9 +21,11 @@
: "InstallRoot" ] ;
}
# Plausible locations.
- docbook_xsl-path ?= [ GLOB "$(boost-dir)\\share" "\\Boost\\share" : docbook-xsl* ] ;
- docbook_dtd-path ?= [ GLOB "$(boost-dir)\\share" "\\Boost\\share" : docbook-xml* ] ;
- boostbook-path ?= [ GLOB "$(boost-dir)\\share" "\\Boost\\share" : boostbook* ] ;
+ local root = [ PWD ] ;
+ while $(root) != $(root:D) { root = $(root:D) ; }
+ docbook_xsl-path ?= [ GLOB "$(boost-dir)\\share" "$(root)Boost\\share" : docbook-xsl* ] ;
+ docbook_dtd-path ?= [ GLOB "$(boost-dir)\\share" "$(root)Boost\\share" : docbook-xml* ] ;
+ boostbook-path ?= [ GLOB "$(boost-dir)\\share" "$(root)Boost\\share" : boostbook* ] ;
docbook_xsl-path = $(docbook_xsl-path[1]) ;
docbook_dtd-path = $(docbook_dtd-path[1]) ;
Modified: branches/release/tools/build/v2/tools/builtin.jam
==============================================================================
--- branches/release/tools/build/v2/tools/builtin.jam (original)
+++ branches/release/tools/build/v2/tools/builtin.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,15 +6,14 @@
# 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)
-# Defines standard features and rules.
+# Defines standard features and rules.
import alias ;
import "class" : new ;
-import feature : feature compose ;
-import toolset : flags ;
-import errors : error ;
-import generate ;
+import errors ;
+import feature ;
import generators ;
+import numbers ;
import os ;
import print ;
import project ;
@@ -23,10 +22,17 @@
import scanner ;
import stage ;
import symlink ;
+import toolset ;
import type ;
+import types/register ;
import utility ;
import virtual-target ;
-import types/register ;
+import message ;
+
+# FIXME: the following generate module import is not needed here but removing it
+# too hastly will break using code (e.g. the main Boost library Jamroot file)
+# that forgot to import the generate module before calling the generate rule.
+import generate ;
.os-names = amiga aix bsd cygwin darwin dos emx freebsd hpux iphone linux netbsd
@@ -125,12 +131,12 @@
# unit-test a : a.cpp : <use>b ;
# lib b : a.cpp b ;
#
-# Here, if <use> is not incidental, we'll decide we have two targets for a.obj
-# with different properties, and will complain.
+# Here, if <use> is not incidental, we would decide we have two targets for
+# a.obj with different properties and complain about it.
#
-# Note that making feature incidental does not mean it's ignored. It may be
-# ignored when creating the virtual target, but the rest of build process will
-# use them.
+# Note that making a feature incidental does not mean it is ignored. It may be
+# ignored when creating a virtual target, but the rest of build process will use
+# them.
feature.feature use : : free dependency incidental ;
feature.feature dependency : : free dependency incidental ;
feature.feature implicit-dependency : : free dependency incidental ;
@@ -146,6 +152,29 @@
on # Fail the compilation if there are warnings.
: incidental propagated ;
+# Feature that allows us to configure the maximal template instantiation depth
+# level allowed by a C++ compiler. Applies only to C++ toolsets whose compilers
+# actually support this configuration setting.
+#
+# Note that Boost Build currently does not allow defining features that take any
+# positive integral value as a parameter, which is what we need here, so we just
+# define some of the values here and leave it up to the user to extend this set
+# as he needs using the feature.extend rule.
+#
+# TODO: This should be upgraded as soon as Boost Build adds support for custom
+# validated feature values or at least features allowing any positive integral
+# value. See related Boost Build related trac ticket #194.
+#
+feature.feature c++-template-depth
+ :
+ [ numbers.range 64 1024 : 64 ]
+ [ numbers.range 20 1000 : 10 ]
+ # Maximum template instantiation depth guaranteed for ANSI/ISO C++
+ # conforming programs.
+ 17
+ :
+ incidental optional propagated ;
+
feature.feature source : : free dependency incidental ;
feature.feature library : : free dependency incidental ;
feature.feature file : : free dependency incidental ;
@@ -165,8 +194,8 @@
# An internal feature that holds the paths of all dependency shared libraries.
-# On Windows, it's needed so that we can add all those paths to PATH when
-# running applications. On Linux, it's needed to add proper -rpath-link command
+# On Windows, it is needed so that we can add all those paths to PATH when
+# running applications. On Linux, it is needed to add proper -rpath-link command
# line options.
feature.feature xdll-path : : free path ;
@@ -207,7 +236,7 @@
# HP/PA-RISC
parisc
-
+
# Advanced RISC Machines
arm
@@ -247,7 +276,7 @@
# HP/PA-RISC
700 7100 7100lc 7200 7300 8000
-
+
# Advanced RISC Machines
armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5t armv5te armv6 armv6j iwmmxt ep9312
@@ -386,6 +415,7 @@
import path ;
import regex ;
import scanner ;
+ import sequence ;
import virtual-target ;
rule __init__ ( includes * )
@@ -394,7 +424,8 @@
for local i in $(includes)
{
- self.includes += [ path.native $(i:G=) ] ;
+ self.includes += [ sequence.transform path.native
+ : [ regex.split $(i:G=) "&&" ] ] ;
}
}
@@ -415,9 +446,9 @@
# Attach binding of including file to included targets. When a target is
# directly created from virtual target this extra information is
# unnecessary. But in other cases, it allows us to distinguish between
- # two headers of the same name included from different places. We don't
+ # two headers of the same name included from different places. We do not
# need this extra information for angle includes, since they should not
- # depend on including file (we can't get literal "." in include path).
+ # depend on including file (we can not get literal "." in include path).
local g2 = $(g)"#"$(b) ;
angle = $(angle:G=$(g)) ;
@@ -480,7 +511,7 @@
# Determine the needed target type.
local actual-type ;
# <source>files can be generated by <conditional>@rule feature
- # in which case we don't consider it a SEARCHED_LIB type.
+ # in which case we do not consider it a SEARCHED_LIB type.
if ! <source> in $(properties:G) &&
( <search> in $(properties:G) || <name> in $(properties:G) )
{
@@ -518,20 +549,20 @@
# The implementation of the 'lib' rule. Beyond standard syntax that rule allows
# simplified: "lib a b c ;".
#
-rule lib ( names + : sources * : requirements * : default-build *
- : usage-requirements * )
+rule lib ( names + : sources * : requirements * : default-build * :
+ usage-requirements * )
{
if $(names[2])
{
if <name> in $(requirements:G)
{
errors.user-error "When several names are given to the 'lib' rule" :
- "it's not allowed to specify the <name> feature." ;
+ "it is not allowed to specify the <name> feature." ;
}
if $(sources)
{
errors.user-error "When several names are given to the 'lib' rule" :
- "it's not allowed to specify sources." ;
+ "it is not allowed to specify sources." ;
}
}
@@ -599,7 +630,7 @@
lib-name ?= $(name) ;
local t = [ new searched-lib-target $(lib-name) : $(project)
: $(shared) : $(search) : $(a) ] ;
- # We return sources for a simple reason. If there's
+ # We return sources for a simple reason. If there is
# lib png : z : <name>png ;
# the 'z' target should be returned, so that apps linking to 'png'
# will link to 'z', too.
@@ -677,11 +708,11 @@
rule register-c-compiler ( id : source-types + : target-types + : requirements *
: optional-properties * )
{
- generators.register [ new C-compiling-generator $(id) : $(source-types)
- : $(target-types) : $(requirements) : $(optional-properties) ] ;
+ generators.register [ new C-compiling-generator $(id) : $(source-types) :
+ $(target-types) : $(requirements) : $(optional-properties) ] ;
}
-# FIXME: this is ugly, should find a better way (we'd like client code to
+# FIXME: this is ugly, should find a better way (we would like client code to
# register all generators as "generators.some-rule" instead of
# "some-module.some-rule".)
#
@@ -726,18 +757,22 @@
}
}
- # It's possible that sources include shared libraries that did not came
+ # It is possible that sources include shared libraries that did not came
# from 'lib' targets, e.g. .so files specified as sources. In this case
# we have to add extra dll-path properties and propagate extra xdll-path
- # properties so that application linking to use will get xdll-path to
+ # properties so that application linking to us will get xdll-path to
# those libraries.
local extra-xdll-paths ;
for local s in $(sources)
{
if [ type.is-derived [ $(s).type ] SHARED_LIB ] && ! [ $(s).action ]
{
- # Unfortunately, we don't have a good way to find the path to a
+ # Unfortunately, we do not have a good way to find the path to a
# file, so use this nasty approach.
+ #
+ # TODO: This needs to be done better. One thing that is really
+ # broken with this is that it does not work correctly with
+ # projects having multiple source locations.
local p = [ $(s).project ] ;
local location = [ path.root [ $(s).name ]
[ $(p).get source-location ] ] ;
@@ -746,8 +781,8 @@
}
# Hardcode DLL paths only when linking executables.
- # Pros: don't need to relink libraries when installing.
- # Cons: "standalone" libraries (plugins, python extensions) can't
+ # Pros: do not need to relink libraries when installing.
+ # Cons: "standalone" libraries (plugins, python extensions) can not
# hardcode paths to dependent libraries.
if [ $(property-set).get <hardcode-dll-paths> ] = true
&& [ type.is-derived $(self.target-types[1]) EXE ]
@@ -800,9 +835,9 @@
# to other shared libraries this one depends on in order to be able to
# find them all at runtime.
- # Just pass all features in property-set, it's theorically possible that
- # we'll propagate <xdll-path> features explicitly specified by the user,
- # but then the user's to blaim for using an internal feature.
+ # Just pass all features in property-set, it is theorically possible
+ # that we will propagate <xdll-path> features explicitly specified by
+ # the user, but then the user is to blaim for using an internal feature.
local values = [ $(property-set).get <xdll-path> ] ;
extra += $(values:G=<xdll-path>) ;
@@ -881,7 +916,7 @@
local result = [ generator.run $(project) $(name) : $(property-set)
: $(sources) ] ;
- # For static linking, if we get a library in source, we can't directly
+ # For static linking, if we get a library in source, we can not directly
# link to it so we need to cause our dependencies to link to that
# library. There are two approaches:
# - adding the library to the list of returned targets.
@@ -892,11 +927,11 @@
# lib a2 : a2.cpp a1 : <link>static ;
# install dist : a2 ;
#
- # here we'll try to install 'a1', even though it's not necessary in the
- # general case. With the second approach, even indirect dependants will
- # link to the library, but it should not cause any harm. So, return all
- # LIB sources together with created targets, so that dependants link to
- # them.
+ # here we will try to install 'a1', even though it is not necessary in
+ # the general case. With the second approach, even indirect dependants
+ # will link to the library, but it should not cause any harm. So, return
+ # all LIB sources together with created targets, so that dependants link
+ # to them.
local usage-requirements ;
if [ $(property-set).get <link> ] = static
{
Modified: branches/release/tools/build/v2/tools/cast.jam
==============================================================================
--- branches/release/tools/build/v2/tools/cast.jam (original)
+++ branches/release/tools/build/v2/tools/cast.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -3,24 +3,25 @@
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-# Defines main target 'cast', used to change type for target. For example,
-# in Qt library one wants two kinds of CPP files -- those that just compiled
-# and those that are passed via the MOC tool.
+# Defines main target 'cast', used to change type for target. For example, in Qt
+# library one wants two kinds of CPP files -- those that just compiled and those
+# that are passed via the MOC tool.
#
# This is done with:
#
# exe main : main.cpp [ cast _ moccable-cpp : widget.cpp ] ;
#
-# Boost.Build will assing target type CPP to both main.cpp and widget.cpp.
-# Then, the cast rule will change target type of widget.cpp to
-# MOCCABLE-CPP, and Qt support will run MOC tool as part of build process.
+# Boost.Build will assing target type CPP to both main.cpp and widget.cpp. Then,
+# the cast rule will change target type of widget.cpp to MOCCABLE-CPP, and Qt
+# support will run the MOC tool as part of the build process.
#
# At the moment, the 'cast' rule only works for non-derived (source) targets.
#
-# Another solution would be to add separate main target 'moc-them' that
-# will moc all the passed sources, not matter what's the type, but I prefer
-# cast, as defining new target type + generator for that type is somewhat
-# simpler then defining main target rule.
+# TODO: The following comment is unclear or incorrect. Clean it up.
+# > Another solution would be to add a separate main target 'moc-them' that
+# > would moc all the passed sources, no matter what their type is, but I prefer
+# > cast, as defining a new target type + generator for that type is somewhat
+# > simpler than defining a main target rule.
import "class" : new ;
import errors ;
@@ -34,11 +35,11 @@
{
import type ;
- rule __init__ ( name : project : type : sources * : requirements *
- : default-build * : usage-requirements * )
+ rule __init__ ( name : project : type : sources * : requirements * :
+ default-build * : usage-requirements * )
{
- typed-target.__init__ $(name) : $(project) : $(type) : $(sources)
- : $(requirements) : $(default-build) : $(usage-requirements) ;
+ typed-target.__init__ $(name) : $(project) : $(type) : $(sources) :
+ $(requirements) : $(default-build) : $(usage-requirements) ;
}
rule construct ( name : source-targets * : property-set )
@@ -48,14 +49,14 @@
{
if ! [ class.is-a $(s) : file-target ]
{
- ECHO "error: source to the 'cast' rule is not a file!" ;
- EXIT ;
+ import errors ;
+ errors.user-error Source to the 'cast' rule is not a file! ;
}
if [ $(s).action ]
{
- ECHO "error: only non-derived target are allowed for 'cast'." ;
- ECHO "error: when building " [ full-name ] ;
- EXIT ;
+ import errors ;
+ errors.user-error Only non-derived target are allowed for
+ 'cast'. : when building [ full-name ] ;
}
local r = [ $(s).clone-with-different-type $(self.type) ] ;
result += [ virtual-target.register $(r) ] ;
@@ -65,27 +66,26 @@
}
-rule cast ( name type : sources * : requirements * : default-build *
- : usage-requirements * )
+rule cast ( name type : sources * : requirements * : default-build * :
+ usage-requirements * )
{
local project = [ project.current ] ;
local real-type = [ type.type-from-rule-name $(type) ] ;
if ! $(real-type)
{
- errors.user-error "No type corresponds to main target rule name '$(type)'"
- : "Hint: try lowercase name" ;
+ errors.user-error No type corresponds to the main target rule name
+ '$(type)' : "Hint: try a lowercase name" ;
}
- # This is a circular module dependency so it must be imported here.
- import targets ;
- targets.main-target-alternative
- [ new cast-target-class $(name) : $(project) : $(real-type)
- : [ targets.main-target-sources $(sources) : $(name) ]
- : [ targets.main-target-requirements $(requirements) : $(project) ]
- : [ targets.main-target-default-build $(default-build) : $(project) ]
- : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ]
- ] ;
+ targets.main-target-alternative [ new cast-target-class $(name) : $(project)
+ : $(real-type)
+ : [ targets.main-target-sources $(sources) : $(name) ]
+ : [ targets.main-target-requirements $(requirements) : $(project) ]
+ : [ targets.main-target-default-build $(default-build) : $(project) ]
+ : [ targets.main-target-usage-requirements $(usage-requirements) :
+ $(project) ] ] ;
}
+
IMPORT $(__name__) : cast : : cast ;
Modified: branches/release/tools/build/v2/tools/common.jam
==============================================================================
--- branches/release/tools/build/v2/tools/common.jam (original)
+++ branches/release/tools/build/v2/tools/common.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -40,9 +40,9 @@
# A toolset configuration may be in one of the following states:
#
# - registered
-# Configuration has been registered (e.g. by autodetection code) but has
-# not yet been marked as used, i.e. 'toolset.using' rule has not yet been
-# called for it.
+# Configuration has been registered (e.g. explicitly or by auto-detection
+# code) but has not yet been marked as used, i.e. 'toolset.using' rule has
+# not yet been called for it.
# - used
# Once called 'toolset.using' rule marks the configuration as 'used'.
#
@@ -87,8 +87,8 @@
# Mark a configuration as 'used'.
#
# Returns 'true' if the state of the configuration has been changed to
- # 'used' and an empty value if it the state wasn't changed. Reports an error
- # if the configuration isn't known.
+ # 'used' and an empty value if it the state has not been changed. Reports an
+ # error if the configuration is not known.
#
rule use ( id )
{
@@ -103,7 +103,7 @@
{
self.used += $(id) ;
- # indicate that the configuration has been marked as 'used'
+ # Indicate that the configuration has been marked as 'used'.
retval = true ;
}
@@ -168,13 +168,13 @@
if $(.had-unspecified-value.$(toolset).$(name))
{
errors.user-error
- "$(toolset) initialization: parameter '$(name)' inconsistent" :
- "no value was specified in earlier initialization" :
- "an explicit value is specified now" ;
+ "$(toolset) initialization: parameter '$(name)'"
+ "inconsistent" : "no value was specified in earlier"
+ "initialization" : "an explicit value is specified now" ;
}
# The below logic is for intel compiler. It calls this rule with
# 'intel-linux' and 'intel-win' as toolset, so we need to get the
- # base part of toolset name. We can't pass 'intel' as toolset
+ # base part of toolset name. We can not pass 'intel' as toolset
# because in that case it will be impossible to register versionless
# intel-linux and intel-win toolsets of a specific version.
local t = $(toolset) ;
@@ -200,9 +200,9 @@
if $(.had-value.$(toolset).$(name))
{
errors.user-error
- "$(toolset) initialization: parameter '$(name)' inconsistent" :
- "an explicit value was specified in an earlier initialization" :
- "no value is specified now" ;
+ "$(toolset) initialization: parameter '$(name)'"
+ "inconsistent" : "an explicit value was specified in an"
+ "earlier initialization" : "no value is specified now" ;
}
.had-unspecified-value.$(toolset).$(name) = true ;
}
@@ -255,30 +255,30 @@
# PATH and in the passed 'additional-path'. Otherwise, verifies that the first
# element of 'user-provided-command' is an existing program.
#
-# This rule returns the command to be used when invoking the tool. If we can't
+# This rule returns the command to be used when invoking the tool. If we can not
# find the tool, a warning is issued. If 'path-last' is specified, PATH is
# checked after 'additional-paths' when searching for 'tool'.
#
-rule get-invocation-command-nodefault (
- toolset : tool : user-provided-command * : additional-paths * : path-last ? )
+rule get-invocation-command-nodefault ( toolset : tool :
+ user-provided-command * : additional-paths * : path-last ? )
{
local command ;
if ! $(user-provided-command)
{
- command = [ common.find-tool $(tool) : $(additional-paths) : $(path-last) ] ;
+ command = [ find-tool $(tool) : $(additional-paths) : $(path-last) ] ;
if ! $(command) && $(.debug-configuration)
{
- ECHO "warning: toolset $(toolset) initialization: can't find tool $(tool)" ;
+ ECHO "warning: toolset $(toolset) initialization: can not find tool $(tool)" ;
ECHO "warning: initialized from" [ errors.nearest-user-location ] ;
}
}
else
{
- command = [ common.check-tool $(user-provided-command) ] ;
+ command = [ check-tool $(user-provided-command) ] ;
if ! $(command) && $(.debug-configuration)
{
ECHO "warning: toolset $(toolset) initialization: " ;
- ECHO "warning: can't find user-provided command " '$(user-provided-command)' ;
+ ECHO "warning: can not find user-provided command " '$(user-provided-command)' ;
ECHO "warning: initialized from" [ errors.nearest-user-location ] ;
}
}
@@ -290,11 +290,11 @@
# Same as get-invocation-command-nodefault, except that if no tool is found,
# returns either the user-provided-command, if present, or the 'tool' parameter.
#
-rule get-invocation-command (
- toolset : tool : user-provided-command * : additional-paths * : path-last ? )
+rule get-invocation-command ( toolset : tool : user-provided-command * :
+ additional-paths * : path-last ? )
{
- local result = [ get-invocation-command-nodefault $(toolset) : $(tool)
- : $(user-provided-command) : $(additional-paths) : $(path-last) ] ;
+ local result = [ get-invocation-command-nodefault $(toolset) : $(tool) :
+ $(user-provided-command) : $(additional-paths) : $(path-last) ] ;
if ! $(result)
{
@@ -334,7 +334,7 @@
# first path found. Otherwise, returns an empty string. If 'path-last' is
# specified, PATH is searched after 'additional-paths'.
#
-rule find-tool ( name : additional-paths * : path-last ? )
+local rule find-tool ( name : additional-paths * : path-last ? )
{
local path = [ path.programs-path ] ;
local match = [ path.glob $(path) : $(name) $(name).exe ] ;
@@ -370,15 +370,16 @@
# Checks if 'command' can be found either in path or is a full name to an
# existing file.
#
-rule check-tool-aux ( command )
+local rule check-tool-aux ( command )
{
if $(command:D)
{
if [ path.exists $(command) ]
# Both NT and Cygwin will run .exe files by their unqualified names.
|| ( [ os.on-windows ] && [ path.exists $(command).exe ] )
- # Only NT will run .bat files by their unqualified names.
- || ( ( [ os.name ] = NT ) && [ path.exists $(command).bat ] )
+ # Only NT will run .bat & .cmd files by their unqualified names.
+ || ( ( [ os.name ] = NT ) && ( [ path.exists $(command).bat ] ||
+ [ path.exists $(command).cmd ] ) )
{
return $(command) ;
}
@@ -397,7 +398,7 @@
# path, checks if it can be found in 'path'. If comand is an absolute path,
# check that it exists. Returns 'command' if ok or empty string otherwise.
#
-rule check-tool ( xcommand + )
+local rule check-tool ( xcommand + )
{
if [ check-tool-aux $(xcommand[1]) ] ||
[ check-tool-aux $(xcommand[-1]) ]
@@ -721,13 +722,13 @@
# <runtime>[joiner]
# :: Collective tag of the build runtime.
# <version:/version-feature | X.Y[.Z]/>[joiner]
-# :: Short version tag taken from the given "version-feature"
-# in the build properties. Or if not present, the literal
-# value as the version number.
+# :: Short version tag taken from the given "version-feature" in the
+# build properties. Or if not present, the literal value as the
+# version number.
# <property:/property-name/>[joiner]
-# :: Direct lookup of the given property-name value in the
-# build properties. /property-name/ is a regular expression.
-# e.g. <property:toolset-.*:flavor> will match every toolset.
+# :: Direct lookup of the given property-name value in the build
+# properties. /property-name/ is a regular expression. E.g.
+# <property:toolset-.*:flavor> will match every toolset.
# /otherwise/
# :: The literal value of the format argument.
#
@@ -756,29 +757,30 @@
result += $(name:B) ;
case <toolset> :
- result += [ join-tag $(f:G=) :
- [ toolset-tag $(name) : $(type) : $(property-set) ] ] ;
+ result += [ join-tag $(f:G=) : [ toolset-tag $(name) : $(type) :
+ $(property-set) ] ] ;
case <threading> :
- result += [ join-tag $(f:G=) :
- [ threading-tag $(name) : $(type) : $(property-set) ] ] ;
+ result += [ join-tag $(f:G=) : [ threading-tag $(name) : $(type)
+ : $(property-set) ] ] ;
case <runtime> :
- result += [ join-tag $(f:G=) :
- [ runtime-tag $(name) : $(type) : $(property-set) ] ] ;
+ result += [ join-tag $(f:G=) : [ runtime-tag $(name) : $(type) :
+ $(property-set) ] ] ;
case <version:*> :
local key = [ MATCH <version:(.*)> : $(f:G) ] ;
local version = [ $(property-set).get <$(key)> ] ;
version ?= $(key) ;
- version = [ MATCH "^([^.]+)[.]([^.]+)[.]?([^.]*)"
- : $(version) ] ;
+ version = [ MATCH "^([^.]+)[.]([^.]+)[.]?([^.]*)" : $(version) ]
+ ;
result += [ join-tag $(f:G=) : $(version[1])_$(version[2]) ] ;
case <property:*> :
local key = [ MATCH <property:(.*)> : $(f:G) ] ;
local p0 = [ MATCH <($(key))> : [ $(property-set).raw ] ] ;
- if $(p0) {
+ if $(p0)
+ {
local p = [ $(property-set).get <$(p0)> ] ;
if $(p)
{
@@ -790,8 +792,8 @@
result += $(f:G=) ;
}
}
- result = [ virtual-target.add-prefix-and-suffix
- $(result:J=) : $(type) : $(property-set) ] ;
+ result = [ virtual-target.add-prefix-and-suffix $(result:J=) : $(type) :
+ $(property-set) ] ;
return $(result) ;
}
}
@@ -895,14 +897,14 @@
local properties = [ $(property-set).raw ] ;
if <runtime-link>static in $(properties) { tag += s ; }
- # This is an ugly thing. In V1, there's a code to automatically detect which
+ # This is an ugly thing. In V1, there is code to automatically detect which
# properties affect a target. So, if <runtime-debugging> does not affect gcc
- # toolset, the tag rules won't even see <runtime-debugging>. Similar
+ # toolset, the tag rules will not even see <runtime-debugging>. Similar
# functionality in V2 is not implemented yet, so we just check for toolsets
- # which are known to care about runtime debug.
- if <toolset>msvc in $(properties)
- || <stdlib>stlport in $(properties)
- || <toolset-intel:platform>win in $(properties)
+ # known to care about runtime debugging.
+ if ( <toolset>msvc in $(properties) ) ||
+ ( <stdlib>stlport in $(properties) ) ||
+ ( <toolset-intel:platform>win in $(properties) )
{
if <runtime-debugging>on in $(properties) { tag += g ; }
}
Modified: branches/release/tools/build/v2/tools/cw.jam
==============================================================================
--- branches/release/tools/build/v2/tools/cw.jam (original)
+++ branches/release/tools/build/v2/tools/cw.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -43,7 +43,7 @@
version $(version) ] ;
command = [ common.get-invocation-command cw : mwcc.exe : $(command) :
- [ default-paths $(version) ] ] ;
+ [ default-paths $(version) ] ] ;
common.handle-options cw : $(condition) : $(command) : $(options) ;
@@ -103,7 +103,8 @@
}
}
-rule default-paths ( version ? ) # FIXME
+
+local rule default-paths ( version ? ) # FIXME
{
local possible-paths ;
local ProgramFiles = [ common.get-program-files-dir ] ;
Modified: branches/release/tools/build/v2/tools/darwin.jam
==============================================================================
--- branches/release/tools/build/v2/tools/darwin.jam (original)
+++ branches/release/tools/build/v2/tools/darwin.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -350,10 +350,14 @@
prepare-framework-path $(<) ;
}
+# Note that using strip without any options was reported to result in broken
+# binaries, at least on OS X 10.5.5, see:
+# http://svn.boost.org/trac/boost/ticket/2347
+# So we pass -S -x.
actions link bind LIBRARIES
{
"$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) -framework$(_)$(FRAMEWORK:D=:S=) $(OPTIONS) $(USER_OPTIONS)
- $(NEED_STRIP)"$(.STRIP)" $(NEED_STRIP)"$(<)"
+ $(NEED_STRIP)"$(.STRIP)" $(NEED_STRIP)-S $(NEED_STRIP)-x $(NEED_STRIP)"$(<)"
}
rule link.dll
Modified: branches/release/tools/build/v2/tools/gcc.jam
==============================================================================
--- branches/release/tools/build/v2/tools/gcc.jam (original)
+++ branches/release/tools/build/v2/tools/gcc.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -10,19 +10,22 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
-import toolset : flags ;
-import property ;
-import generators ;
-import os ;
-import type ;
-import feature ;
import "class" : new ;
-import set ;
import common ;
import errors ;
-import property-set ;
+import feature ;
+import generators ;
+import os ;
import pch ;
+import property ;
+import property-set ;
+import toolset ;
+import type ;
+import rc ;
import regex ;
+import set ;
+import unix ;
+
if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
@@ -32,7 +35,6 @@
feature.extend toolset : gcc ;
-import unix ;
toolset.inherit-generators gcc : unix : unix.link unix.link.dll ;
toolset.inherit-flags gcc : unix ;
toolset.inherit-rules gcc : unix ;
@@ -57,29 +59,31 @@
# xxx.dll DLL
# libxxx.dll.a import library
#
-# Note: user can always override by using the <tag>@rule
-# This settings have been choosen, so that mingw
-# is in line with msvc naming conventions. For
-# cygwin the cygwin naming convention has been choosen.
+# Implementation notes:
+# * User can always override this by using the <tag>@rule.
+# * These settings have been chosen so that mingw is in line with msvc naming
+# conventions.
+# * For cygwin the cygwin naming convention has been chosen.
-# Make the "o" suffix used for gcc toolset on all
-# platforms
+# Make gcc toolset object files use the "o" suffix on all platforms.
type.set-generated-target-suffix OBJ : <toolset>gcc : o ;
-type.set-generated-target-suffix STATIC_LIB : <toolset>gcc <target-os>cygwin : a ;
+type.set-generated-target-suffix OBJ : <toolset>gcc <target-os>windows : o ;
+type.set-generated-target-suffix OBJ : <toolset>gcc <target-os>cygwin : o ;
+type.set-generated-target-suffix STATIC_LIB : <toolset>gcc <target-os>cygwin : a ;
type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc <target-os>cygwin : dll.a ;
type.set-generated-target-prefix IMPORT_LIB : <toolset>gcc <target-os>cygwin : lib ;
-import rc ;
# Initializes the gcc toolset for the given version. If necessary, command may
# be used to specify where the compiler is located. The parameter 'options' is a
# space-delimited list of options, each one specified as
# <option-name>option-value. Valid option names are: cxxflags, linkflags and
-# linker-type. Accepted linker-type values are gnu, darwin, osf, hpux or sun
-# and the default value will be selected based on the current OS.
+# linker-type. Accepted linker-type values are aix, darwin, gnu, hpux, osf or
+# sun and the default value will be selected based on the current OS.
# Example:
# using gcc : 3.4 : : <cxxflags>foo <linkflags>bar <linker-type>sun ;
+#
rule init ( version ? : command * : options * )
{
# Information about the gcc command...
@@ -167,7 +171,7 @@
{
ECHO notice: using gcc libraries :: $(condition) :: $(lib_path) ;
}
- flags gcc.link RUN_PATH $(condition) : $(lib_path) ;
+ toolset.flags gcc.link RUN_PATH $(condition) : $(lib_path) ;
}
# If it's not a system gcc install we should adjust the various programs as
@@ -178,7 +182,7 @@
local archiver =
[ common.get-invocation-command gcc
: ar : [ feature.get-values <archiver> : $(options) ] : $(bin) : search-path ] ;
- flags gcc.archive .AR $(condition) : $(archiver[1]) ;
+ toolset.flags gcc.archive .AR $(condition) : $(archiver[1]) ;
if $(.debug-configuration)
{
ECHO notice: using gcc archiver :: $(condition) :: $(archiver[1]) ;
@@ -284,79 +288,101 @@
generators.override gcc.compile.c.pch : pch.default-c-pch-generator ;
generators.override gcc.compile.c++.pch : pch.default-cpp-pch-generator ;
-flags gcc.compile PCH_FILE <pch>on : <pch-file> ;
+toolset.flags gcc.compile PCH_FILE <pch>on : <pch-file> ;
-# Declare flags and action for compilation
-flags gcc.compile OPTIONS <optimization>off : -O0 ;
-flags gcc.compile OPTIONS <optimization>speed : -O3 ;
-flags gcc.compile OPTIONS <optimization>space : -Os ;
-
-flags gcc.compile OPTIONS <inlining>off : -fno-inline ;
-flags gcc.compile OPTIONS <inlining>on : -Wno-inline ;
-flags gcc.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ;
-
-flags gcc.compile OPTIONS <warnings>off : -w ;
-flags gcc.compile OPTIONS <warnings>on : -Wall ;
-flags gcc.compile OPTIONS <warnings>all : -Wall -pedantic ;
-flags gcc.compile OPTIONS <warnings-as-errors>on : -Werror ;
-
-flags gcc.compile OPTIONS <debug-symbols>on : -g ;
-flags gcc.compile OPTIONS <profiling>on : -pg ;
-flags gcc.compile OPTIONS <rtti>off : -fno-rtti ;
-
-# On cygwin and mingw, gcc generates position independent code by default, and
-# warns if -fPIC is specified. This might not be the right way of checking if
-# we're using cygwin. For example, it's possible to run cygwin gcc from NT
-# shell, or using crosscompiling. But we'll solve that problem when it's time.
-# In that case we'll just add another parameter to 'init' and move this login
-# inside 'init'.
-if [ os.name ] != CYGWIN && [ os.name ] != NT
-{
- # This logic will add -fPIC for all compilations:
- #
- # lib a : a.cpp b ;
- # obj b : b.cpp ;
- # exe c : c.cpp a d ;
- # obj d : d.cpp ;
- #
- # This all is fine, except that 'd' will be compiled with -fPIC even though
- # it's not needed, as 'd' is used only in exe. However, it's hard to detect
- # where a target is going to be used. Alternative, we can set -fPIC only
- # when main target type is LIB but than 'b' will be compiled without -fPIC.
- # In x86-64 that will lead to link errors. So, compile everything with
- # -fPIC.
- #
- # Yet another alternative would be to create propagated <sharedable>
- # feature, and set it when building shared libraries, but that's hard to
- # implement and will increase target path length even more.
- flags gcc.compile OPTIONS <link>shared : -fPIC ;
+# Declare flags and action for compilation.
+toolset.flags gcc.compile OPTIONS <optimization>off : -O0 ;
+toolset.flags gcc.compile OPTIONS <optimization>speed : -O3 ;
+toolset.flags gcc.compile OPTIONS <optimization>space : -Os ;
+
+toolset.flags gcc.compile OPTIONS <inlining>off : -fno-inline ;
+toolset.flags gcc.compile OPTIONS <inlining>on : -Wno-inline ;
+toolset.flags gcc.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ;
+
+toolset.flags gcc.compile OPTIONS <warnings>off : -w ;
+toolset.flags gcc.compile OPTIONS <warnings>on : -Wall ;
+toolset.flags gcc.compile OPTIONS <warnings>all : -Wall -pedantic ;
+toolset.flags gcc.compile OPTIONS <warnings-as-errors>on : -Werror ;
+
+toolset.flags gcc.compile OPTIONS <debug-symbols>on : -g ;
+toolset.flags gcc.compile OPTIONS <profiling>on : -pg ;
+toolset.flags gcc.compile OPTIONS <rtti>off : -fno-rtti ;
+
+rule setup-fpic ( targets * : sources * : properties * )
+{
+ local link = [ feature.get-values link : $(properties) ] ;
+ if $(link) = shared
+ {
+ local target = [ feature.get-values target-os : $(properties) ] ;
+
+ # This logic will add -fPIC for all compilations:
+ #
+ # lib a : a.cpp b ;
+ # obj b : b.cpp ;
+ # exe c : c.cpp a d ;
+ # obj d : d.cpp ;
+ #
+ # This all is fine, except that 'd' will be compiled with -fPIC even though
+ # it is not needed, as 'd' is used only in exe. However, it is hard to
+ # detect where a target is going to be used. Alternatively, we can set -fPIC
+ # only when main target type is LIB but than 'b' would be compiled without
+ # -fPIC which would lead to link errors on x86-64. So, compile everything
+ # with -fPIC.
+ #
+ # Yet another alternative would be to create a propagated <sharedable>
+ # feature and set it when building shared libraries, but that would be hard
+ # to implement and would increase the target path length even more.
+
+ # On Windows, fPIC is default, specifying -fPIC explicitly leads to
+ # a warning.
+ if $(target) != cygwin && $(target) != windows
+ {
+ OPTIONS on $(targets) += -fPIC ;
+ }
+ }
}
+
+# FIXME: this should not use os.name.
if [ os.name ] != NT && [ os.name ] != OSF && [ os.name ] != HPUX && [ os.name ] != AIX
{
- # OSF does have an option called -soname but it doesn't seem to work as
+ # OSF does have an option called -soname but it does not seem to work as
# expected, therefore it has been disabled.
HAVE_SONAME = "" ;
SONAME_OPTION = -h ;
}
-flags gcc.compile USER_OPTIONS <cflags> ;
-flags gcc.compile.c++ USER_OPTIONS <cxxflags> ;
-flags gcc.compile DEFINES <define> ;
-flags gcc.compile INCLUDES <include> ;
+toolset.flags gcc.compile USER_OPTIONS <cflags> ;
+toolset.flags gcc.compile.c++ USER_OPTIONS <cxxflags> ;
+toolset.flags gcc.compile DEFINES <define> ;
+toolset.flags gcc.compile INCLUDES <include> ;
+toolset.flags gcc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ;
+
+rule compile.c++.pch ( targets * : sources * : properties * )
+{
+ setup-fpic $(targets) : $(sources) : $(properties) ;
+}
actions compile.c++.pch
{
"$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
+rule compile.c.pch ( targets * : sources * : properties * )
+{
+ setup-fpic $(targets) : $(sources) : $(properties) ;
+}
+
actions compile.c.pch
{
"$(CONFIG_COMMAND)" -x c-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
-rule compile.c++
+rule compile.c++ ( targets * : sources * : properties * )
{
+ setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-fpic $(targets) : $(sources) : $(properties) ;
+
# Some extensions are compiled as C++ by default. For others, we need to
# pass -x c++. We could always pass -x c++ but distcc does not work with it.
if ! $(>:S) in .cc .cp .cxx .cpp .c++ .C
@@ -364,10 +390,28 @@
LANG on $(<) = "-x c++" ;
}
DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
+
+ # Here we want to raise the template-depth parameter value to something
+ # higher than the default value of 17. Note that we could do this using the
+ # feature.set-default rule but we do not want to set the default value for
+ # all toolsets as well.
+ #
+ # TODO: This 'modified default' has been inherited from some 'older Boost
+ # Build implementation' and has most likely been added to make some Boost
+ # library parts compile correctly. We should see what exactly prompted this
+ # and whether we can get around the problem more locally.
+ local template-depth = [ on $(<) return $(TEMPLATE_DEPTH) ] ;
+ if ! $(template-depth)
+ {
+ TEMPLATE_DEPTH on $(<) = 128 ;
+ }
}
-rule compile.c
+rule compile.c ( targets * : sources * : properties * )
{
+ setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-fpic $(targets) : $(sources) : $(properties) ;
+
# If we use the name g++ then default file suffix -> language mapping does
# not work. So have to pass -x option. Maybe, we can work around this by
# allowing the user to specify both C and C++ compiler names.
@@ -380,7 +424,7 @@
actions compile.c++ bind PCH_FILE
{
- "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-128 $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<:W)" "$(>:W)"
+ "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<:W)" "$(>:W)"
}
actions compile.c bind PCH_FILE
@@ -487,13 +531,13 @@
# Declare flags for linking.
# First, the common flags.
-flags gcc.link OPTIONS <debug-symbols>on : -g ;
-flags gcc.link OPTIONS <profiling>on : -pg ;
-flags gcc.link USER_OPTIONS <linkflags> ;
-flags gcc.link LINKPATH <library-path> ;
-flags gcc.link FINDLIBS-ST <find-static-library> ;
-flags gcc.link FINDLIBS-SA <find-shared-library> ;
-flags gcc.link LIBRARIES <library-file> ;
+toolset.flags gcc.link OPTIONS <debug-symbols>on : -g ;
+toolset.flags gcc.link OPTIONS <profiling>on : -pg ;
+toolset.flags gcc.link USER_OPTIONS <linkflags> ;
+toolset.flags gcc.link LINKPATH <library-path> ;
+toolset.flags gcc.link FINDLIBS-ST <find-static-library> ;
+toolset.flags gcc.link FINDLIBS-SA <find-shared-library> ;
+toolset.flags gcc.link LIBRARIES <library-file> ;
# For <runtime-link>static we made sure there are no dynamic libraries in the
# link. On HP-UX not all system libraries exist as archived libraries (for
@@ -501,26 +545,64 @@
# cannot be specified.
if [ os.name ] != HPUX
{
- flags gcc.link OPTIONS <runtime-link>static : -static ;
+ toolset.flags gcc.link OPTIONS <runtime-link>static : -static ;
}
# Now, the vendor specific flags.
-# The parameter linker can be either gnu, darwin, osf, hpux or sun.
+# The parameter linker can be either aix, darwin, gnu, hpux, osf or sun.
rule init-link-flags ( toolset linker condition )
{
switch $(linker)
{
+ case aix :
+ {
+ #
+ # On AIX we *have* to use the native linker.
+ #
+ # Using -brtl, the AIX linker will look for libraries with both the .a
+ # and .so extensions, such as libfoo.a and libfoo.so. Without -brtl, the
+ # AIX linker looks only for libfoo.a. Note that libfoo.a is an archived
+ # file that may contain shared objects and is different from static libs
+ # as on Linux.
+ #
+ # The -bnoipath strips the prepending (relative) path of libraries from
+ # the loader section in the target library or executable. Hence, during
+ # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded
+ # -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without
+ # this option, the prepending (relative) path + library name is
+ # hard-coded in the loader section, causing *only* this path to be
+ # searched during load-time. Note that the AIX linker does not have an
+ # -soname equivalent, this is as close as it gets.
+ #
+ # The above options are definately for AIX 5.x, and most likely also for
+ # AIX 4.x and AIX 6.x. For details about the AIX linker see:
+ # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf
+ #
+
+ toolset.flags $(toolset).link OPTIONS : -Wl,-brtl -Wl,-bnoipath
+ : unchecked ;
+ }
+
+ case darwin :
+ {
+ # On Darwin, the -s option to ld does not work unless we pass -static,
+ # and passing -static unconditionally is a bad idea. So, don't pass -s.
+ # at all, darwin.jam will use separate 'strip' invocation.
+ toolset.flags $(toolset).link RPATH $(condition) : <dll-path> : unchecked ;
+ toolset.flags $(toolset).link RPATH_LINK $(condition) : <xdll-path> : unchecked ;
+ }
+
case gnu :
{
# Strip the binary when no debugging is needed. We use --strip-all flag
# as opposed to -s since icc (intel's compiler) is generally
# option-compatible with and inherits from the gcc toolset, but does not
# support -s.
- flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off : -Wl,--strip-all : unchecked ;
- flags $(toolset).link RPATH $(condition) : <dll-path> : unchecked ;
- flags $(toolset).link RPATH_LINK $(condition) : <xdll-path> : unchecked ;
- flags $(toolset).link START-GROUP $(condition) : -Wl,--start-group : unchecked ;
- flags $(toolset).link END-GROUP $(condition) : -Wl,--end-group : unchecked ;
+ toolset.flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off : -Wl,--strip-all : unchecked ;
+ toolset.flags $(toolset).link RPATH $(condition) : <dll-path> : unchecked ;
+ toolset.flags $(toolset).link RPATH_LINK $(condition) : <xdll-path> : unchecked ;
+ toolset.flags $(toolset).link START-GROUP $(condition) : -Wl,--start-group : unchecked ;
+ toolset.flags $(toolset).link END-GROUP $(condition) : -Wl,--end-group : unchecked ;
# gnu ld has the ability to change the search behaviour for libraries
# referenced by -l switch. These modifiers are -Bstatic and -Bdynamic
@@ -554,49 +636,52 @@
# search patterns!
# On *nix mixing shared libs with static runtime is not a good idea.
- flags $(toolset).link FINDLIBS-ST-PFX $(condition)/<runtime-link>shared
+ toolset.flags $(toolset).link FINDLIBS-ST-PFX $(condition)/<runtime-link>shared
: -Wl,-Bstatic : unchecked ;
- flags $(toolset).link FINDLIBS-SA-PFX $(condition)/<runtime-link>shared
+ toolset.flags $(toolset).link FINDLIBS-SA-PFX $(condition)/<runtime-link>shared
: -Wl,-Bdynamic : unchecked ;
# On windows allow mixing of static and dynamic libs with static
# runtime.
- flags $(toolset).link FINDLIBS-ST-PFX $(condition)/<runtime-link>static/<target-os>windows
+ toolset.flags $(toolset).link FINDLIBS-ST-PFX $(condition)/<runtime-link>static/<target-os>windows
: -Wl,-Bstatic : unchecked ;
- flags $(toolset).link FINDLIBS-SA-PFX $(condition)/<runtime-link>static/<target-os>windows
+ toolset.flags $(toolset).link FINDLIBS-SA-PFX $(condition)/<runtime-link>static/<target-os>windows
: -Wl,-Bdynamic : unchecked ;
- flags $(toolset).link OPTIONS $(condition)/<runtime-link>static/<target-os>windows
+ toolset.flags $(toolset).link OPTIONS $(condition)/<runtime-link>static/<target-os>windows
: -Wl,-Bstatic : unchecked ;
}
- case darwin :
+ case hpux :
{
- # On Darwin, the -s option to ld does not work unless we pass -static,
- # and passing -static unconditionally is a bad idea. So, don't pass -s.
- # at all, darwin.jam will use separate 'strip' invocation.
- flags $(toolset).link RPATH $(condition) : <dll-path> : unchecked ;
- flags $(toolset).link RPATH_LINK $(condition) : <xdll-path> : unchecked ;
+ toolset.flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off
+ : -Wl,-s : unchecked ;
+ toolset.flags $(toolset).link OPTIONS $(condition)/<link>shared
+ : -fPIC : unchecked ;
}
case osf :
{
- # No --strip-all, just -s.
- flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off : -Wl,-s
- : unchecked ;
- flags $(toolset).link RPATH $(condition) : <dll-path> : unchecked ;
- # This does not supports -R.
- flags $(toolset).link RPATH_OPTION $(condition) : -rpath : unchecked ;
- # -rpath-link is not supported at all.
+ # No --strip-all, just -s.
+ toolset.flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off
+ : -Wl,-s : unchecked ;
+ toolset.flags $(toolset).link RPATH $(condition) : <dll-path>
+ : unchecked ;
+ # This does not supports -R.
+ toolset.flags $(toolset).link RPATH_OPTION $(condition) : -rpath
+ : unchecked ;
+ # -rpath-link is not supported at all.
}
case sun :
{
- flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off : -Wl,-s
+ toolset.flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off
+ : -Wl,-s : unchecked ;
+ toolset.flags $(toolset).link RPATH $(condition) : <dll-path>
: unchecked ;
- flags $(toolset).link RPATH $(condition) : <dll-path> : unchecked ;
# Solaris linker does not have a separate -rpath-link, but allows to use
# -L for the same purpose.
- flags $(toolset).link LINKPATH $(condition) : <xdll-path> : unchecked ;
+ toolset.flags $(toolset).link LINKPATH $(condition) : <xdll-path>
+ : unchecked ;
# This permits shared libraries with non-PIC code on Solaris.
# VP, 2004/09/07: Now that we have -fPIC hardcode in link.dll, the
@@ -604,51 +689,16 @@
# separate question.
# AH, 2004/10/16: it is still necessary because some tests link against
# static libraries that were compiled without PIC.
- flags $(toolset).link OPTIONS $(condition)/<link>shared : -mimpure-text
- : unchecked ;
+ toolset.flags $(toolset).link OPTIONS $(condition)/<link>shared
+ : -mimpure-text : unchecked ;
}
- case hpux :
- {
- flags $(toolset).link OPTIONS $(condition)/<debug-symbols>off
- : -Wl,-s : unchecked ;
- flags $(toolset).link OPTIONS $(condition)/<link>shared
- : -fPIC : unchecked ;
- }
-
- case aix :
- {
- #
- # On AIX we *have* to use the native linker.
- #
- # Using -brtl, the AIX linker will look for libraries with both the .a and .so
- # extensions, such as libfoo.a and libfoo.so. Without -brtl, the AIX linker
- # looks only for libfoo.a. Note that libfoo.a is an archived file that may
- # contain shared objects and is different from static libs as on Linux.
- #
- # The -bnoipath strips the prepending (relative) path of libraries from
- # the loader section in the target library or executable. Hence, during load-
- # time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded -blibpath
- # (*similar* to -lrpath/-lrpath-link) is searched. Without this option,
- # the prepending (relative) path + library name is hard-coded in the loader
- # section, causing *only* this path to be searched during load-time.
- # Note that the AIX linker does not have an -soname equivalent, this
- # is as close as it gets.
- #
- # The above options are definately for AIX 5.x, and most likely also for
- # AIX 4.x and AIX 6.x. For details about AIX linker:
- # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf
- #
-
- flags $(toolset).link OPTIONS : -Wl,-brtl -Wl,-bnoipath : unchecked ;
- }
-
case * :
{
- errors.user-error
+ errors.user-error
"$(toolset) initialization: invalid linker '$(linker)'" :
"The value '$(linker)' specified for <linker> is not recognized." :
- "Possible values are 'gnu', 'darwin', 'osf', 'hpux' or 'sun'" ;
+ "Possible values are 'aix', 'darwin', 'gnu', 'hpux', 'osf' or 'sun'" ;
}
}
}
@@ -656,6 +706,7 @@
# Declare actions for linking.
rule link ( targets * : sources * : properties * )
{
+ setup-threading $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
# Serialize execution of the 'link' action, since running N links in
# parallel is just slower. For now, serialize only gcc links, it might be a
@@ -675,11 +726,11 @@
# always available.
.AR = ar ;
-flags gcc.archive AROPTIONS <archiveflags> ;
+toolset.flags gcc.archive AROPTIONS <archiveflags> ;
rule archive ( targets * : sources * : properties * )
{
- # Always remove archive and start again. Here's rationale from
+ # Always remove archive and start again. Here is the rationale from
#
# Andre Hentz:
#
@@ -719,72 +770,86 @@
rule link.dll ( targets * : sources * : properties * )
{
+ setup-threading $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
}
-# Differ from 'link' above only by -shared.
+# Differs from 'link' above only by -shared.
actions link.dll bind LIBRARIES
{
"$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)
}
-# Set up threading support. It's somewhat contrived, so perform it at the end,
-# to avoid cluttering other code.
-
-if [ os.on-windows ]
-{
- flags gcc OPTIONS <threading>multi : -mthreads ;
-}
-else if [ modules.peek : UNIX ]
+rule setup-threading ( targets * : sources * : properties * )
{
- switch [ modules.peek : JAMUNAME ]
- {
- case SunOS* :
- {
- flags gcc OPTIONS <threading>multi : -pthreads ;
- flags gcc FINDLIBS-SA : rt ;
- }
- case BeOS :
- {
- # BeOS has no threading options, don't set anything here.
- }
- case *BSD :
- {
- flags gcc OPTIONS <threading>multi : -pthread ;
- # there is no -lrt on BSD
- }
- case DragonFly :
- {
- flags gcc OPTIONS <threading>multi : -pthread ;
- # there is no -lrt on BSD - DragonFly is a FreeBSD variant,
- # which anoyingly doesn't say it's a *BSD.
- }
- case IRIX :
+ local threading = [ feature.get-values threading : $(properties) ] ;
+ if $(threading) = multi
+ {
+ local target = [ feature.get-values target-os : $(properties) ] ;
+ local option ;
+ local libs ;
+
+ switch $(target)
{
- # gcc on IRIX does not support multi-threading, don't set anything here.
+ case windows :
+ {
+ option = -mthreads ;
+ }
+ case cygwin :
+ {
+ option = -mthreads ;
+ }
+ case sunos :
+ {
+ option = -pthreads ;
+ libs = rt ;
+ }
+ case beos :
+ {
+ # BeOS has no threading options, so do not set anything here.
+ }
+ case *bsd :
+ {
+ option = -pthread ;
+ # There is no -lrt on BSD.
+ }
+ case sgi :
+ {
+ # gcc on IRIX does not support multi-threading so do not set anything
+ # here.
+ }
+ case darwin :
+ {
+ # Darwin has no threading options so do not set anything here.
+ }
+ case * :
+ {
+ option = -pthread ;
+ libs = rt ;
+ }
}
- case Darwin :
+
+ if $(option)
{
- # Darwin has no threading options, don't set anything here.
+ OPTIONS on $(targets) += $(option) ;
}
- case * :
+ if $(libs)
{
- flags gcc OPTIONS <threading>multi : -pthread ;
- flags gcc FINDLIBS-SA : rt ;
+ FINDLIBS-SA on $(targets) += $(libs) ;
}
- }
+ }
}
local rule cpu-flags ( toolset variable : architecture : instruction-set + : values + : default ? )
{
if $(default)
{
- flags $(toolset) $(variable)
+ toolset.flags $(toolset) $(variable)
<architecture>$(architecture)/<instruction-set>
: $(values) ;
}
- flags $(toolset) $(variable)
+ toolset.flags $(toolset) $(variable)
<architecture>/<instruction-set>$(instruction-set)
<architecture>$(architecture)/<instruction-set>$(instruction-set)
: $(values) ;
@@ -793,8 +858,8 @@
# Set architecture/instruction-set options.
#
# x86 and compatible
-flags gcc OPTIONS <architecture>x86/<address-model>32 : -m32 ;
-flags gcc OPTIONS <architecture>x86/<address-model>64 : -m64 ;
+toolset.flags gcc OPTIONS <architecture>x86/<address-model>32 : -m32 ;
+toolset.flags gcc OPTIONS <architecture>x86/<address-model>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 ;
@@ -828,8 +893,8 @@
cpu-flags gcc OPTIONS : x86 : c3 : -march=c3 ;
cpu-flags gcc OPTIONS : x86 : c3-2 : -march=c3-2 ;
# Sparc
-flags gcc OPTIONS <architecture>sparc/<address-model>32 : -m32 ;
-flags gcc OPTIONS <architecture>sparc/<address-model>64 : -m64 ;
+toolset.flags gcc OPTIONS <architecture>sparc/<address-model>32 : -m32 ;
+toolset.flags gcc OPTIONS <architecture>sparc/<address-model>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 ;
@@ -846,8 +911,8 @@
cpu-flags gcc OPTIONS : sparc : ultrasparc : -mcpu=ultrasparc ;
cpu-flags gcc OPTIONS : sparc : ultrasparc3 : -mcpu=ultrasparc3 ;
# RS/6000 & PowerPC
-flags gcc OPTIONS <architecture>power/<address-model>32 : -m32 ;
-flags gcc OPTIONS <architecture>power/<address-model>64 : -m64 ;
+toolset.flags gcc OPTIONS <architecture>power/<address-model>32 : -m32 ;
+toolset.flags gcc OPTIONS <architecture>power/<address-model>64 : -m64 ;
cpu-flags gcc OPTIONS : power : 403 : -mcpu=403 ;
cpu-flags gcc OPTIONS : power : 505 : -mcpu=505 ;
cpu-flags gcc OPTIONS : power : 601 : -mcpu=601 ;
@@ -881,6 +946,6 @@
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 <architecture>power/<address-model>32/<target-os>aix : -maix32 ;
-flags gcc OPTIONS <architecture>power/<address-model>64/<target-os>aix : -maix64 ;
-flags gcc AROPTIONS <architecture>power/<address-model>64/<target-os>aix : "-X 64" ;
+toolset.flags gcc OPTIONS <architecture>power/<address-model>32/<target-os>aix : -maix32 ;
+toolset.flags gcc OPTIONS <architecture>power/<address-model>64/<target-os>aix : -maix64 ;
+toolset.flags gcc AROPTIONS <architecture>power/<address-model>64/<target-os>aix : "-X 64" ;
Modified: branches/release/tools/build/v2/tools/generate.jam
==============================================================================
--- branches/release/tools/build/v2/tools/generate.jam (original)
+++ branches/release/tools/build/v2/tools/generate.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -2,18 +2,17 @@
# 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)
-# Declares main target 'generate' that can be used to produce targets
-# by calling a user-provides rule, that takes virtual target and produces
-# virtual target.
+# Declares main target 'generate' used to produce targets by calling a
+# user-provided rule that takes and produces virtual targets.
-import targets ;
import "class" : new ;
-import property ;
import errors ;
-import regex ;
-import property-set ;
-import project ;
import feature ;
+import project ;
+import property ;
+import property-set ;
+import targets ;
+import regex ;
feature.feature generating-rule : : free ;
@@ -31,11 +30,10 @@
basic-target.__init__ $(name) : $(project) : $(sources)
: $(requirements) : $(default-build) : $(usage-requirements) ;
- local r = [ $(self.requirements).get <generating-rule> ] ;
- if ! $(r)
+ if ! [ $(self.requirements).get <generating-rule> ]
{
- errors.user-error
- "The generate rule requires <generating-rule> property to be set" ;
+ errors.user-error "The generate rule requires the <generating-rule>"
+ "property to be set" ;
}
}
@@ -44,14 +42,16 @@
local result ;
local gr = [ $(property-set).get <generating-rule> ] ;
- # FIXME: this is copy-paste from virtual-target.jam. Must
- # have n utilty rule to call a rule like this.
+ # FIXME: this is a copy-paste from virtual-target.jam. We should add a
+ # utility rule to call a rule like this.
local rule-name = [ MATCH ^@(.*) : $(gr) ] ;
if $(rule-name)
{
- if $(tag[2])
+ if $(gr[2])
{
- errors.error "<tag>@rulename is present but is not the only <tag> feature" ;
+ local target-name = [ full-name ] ;
+ errors.user-error "Multiple <generating-rule> properties"
+ "encountered for target $(target-name)." ;
}
result = [ indirect.call $(rule-name) $(self.project) $(name)
@@ -79,8 +79,10 @@
targets = $(result) ;
}
}
+ # FIXME: the following loop should be doable using sequence.transform or
+ # some similar utility rule.
local rt ;
- for t in $(targets)
+ for local t in $(targets)
{
rt += [ virtual-target.register $(t) ] ;
}
Modified: branches/release/tools/build/v2/tools/hp_cxx.jam
==============================================================================
--- branches/release/tools/build/v2/tools/hp_cxx.jam (original)
+++ branches/release/tools/build/v2/tools/hp_cxx.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -124,6 +124,8 @@
flags hp_cxx.link FINDLIBS-ST <find-static-library> ;
flags hp_cxx.link FINDLIBS-SA <find-shared-library> ;
+flags hp_cxx.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ;
+
actions link bind LIBRARIES
{
$(CONFIG_COMMAND) -noimplicit_include $(OPTIONS) -o "$(<)" -L$(LIBPATH) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) -lrt -lm
@@ -154,9 +156,20 @@
# Note: We deliberately don't suppress any warnings on the compiler command
# line, the user can always do this in a customized toolset later on.
+rule compile.c++
+{
+ # We preprocess the TEMPLATE_DEPTH command line option here because we found
+ # no way to do it correctly in the actual action code. There we either get
+ # the -pending_instantiations parameter when no c++-template-depth property
+ # has been specified or we get additional quotes around
+ # "-pending_instantiations ".
+ local template-depth = [ on $(1) return $(TEMPLATE_DEPTH) ] ;
+ TEMPLATE_DEPTH on $(1) = "-pending_instantiations "$(template-depth) ;
+}
+
actions compile.c++
{
- $(CONFIG_COMMAND) -x cxx -c -std strict_ansi -nopure_cname -noimplicit_include -timplicit_local -ptr "$(<[1]:D)/cxx_repository" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
+ $(CONFIG_COMMAND) -x cxx -c -std strict_ansi -nopure_cname -noimplicit_include -timplicit_local -ptr "$(<[1]:D)/cxx_repository" $(OPTIONS) $(TEMPLATE_DEPTH) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
}
# Always create archive from scratch. See the gcc toolet for rationale.
Modified: branches/release/tools/build/v2/tools/intel-win.jam
==============================================================================
--- branches/release/tools/build/v2/tools/intel-win.jam (original)
+++ branches/release/tools/build/v2/tools/intel-win.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -3,21 +3,19 @@
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
-import toolset ;
+# Importing common is needed because the rules we inherit here depend on it.
+# That is nasty.
+import common ;
+import errors ;
import feature ;
-import toolset : flags ;
+import intel ;
+import msvc ;
import os ;
-import errors ;
-
-# This is needed because the rule we import here depend on 'common'
-# That's nasty.
-import common ;
+import toolset ;
-import intel ;
feature.extend-subfeature toolset intel : platform : win ;
-import msvc ;
toolset.inherit-generators intel-win <toolset>intel <toolset-intel:platform>win : msvc ;
toolset.inherit-flags intel-win : msvc ;
toolset.inherit-rules intel-win : msvc ;
@@ -31,28 +29,28 @@
# either 'vc6', 'vc7', 'vc7.1'
# or 'native'(default).
)
-{
- local compatibility =
+{
+ local compatibility =
[ feature.get-values <compatibility> : $(options) ] ;
local condition = [ common.check-init-parameters intel-win
: version $(version) : compatibility $(compatibility) ] ;
-
+
command = [ common.get-invocation-command intel-win : icl.exe :
- $(command) ] ;
-
+ $(command) ] ;
+
common.handle-options intel-win : $(condition) : $(command) : $(options) ;
-
+
local root ;
if $(command)
{
root = [ common.get-absolute-tool-path $(command[-1]) ] ;
root = $(root)/ ;
}
-
+
local setup ;
setup = $(root)/iclvars.bat ;
setup = "call \""$(setup)"\" > nul " ;
-
+
if [ os.name ] = NT
{
setup = $(setup)"
@@ -62,52 +60,51 @@
{
setup = "cmd /S /C "$(setup)" \"&&\" " ;
}
-
-
- flags intel-win.compile .CC $(condition) : $(setup)icl ;
- flags intel-win.link .LD $(condition) : $(setup)xilink ;
- flags intel-win.archive .LD $(condition) : $(setup)xilink /lib ;
- flags intel-win.link .MT $(condition) : mt -nologo ;
-
+
+ toolset.flags intel-win.compile .CC $(condition) : $(setup)icl ;
+ toolset.flags intel-win.link .LD $(condition) : $(setup)xilink ;
+ toolset.flags intel-win.archive .LD $(condition) : $(setup)xilink /lib ;
+ toolset.flags intel-win.link .MT $(condition) : mt -nologo ;
+
local m = [ MATCH (.).* : $(version) ] ;
local major = $(m[1]) ;
local C++FLAGS ;
-
+
C++FLAGS += /nologo ;
-
+
# Reduce the number of spurious error messages
C++FLAGS += /Qwn5 /Qwd985 ;
# Enable ADL
C++FLAGS += -Qoption,c,--arg_dep_lookup ; #"c" works for C++, too
-
- # Disable Microsoft "secure" overloads in Dinkumware libraries
- # since they cause compile errors with Intel versions 9 and 10
+
+ # Disable Microsoft "secure" overloads in Dinkumware libraries since they
+ # cause compile errors with Intel versions 9 and 10.
C++FLAGS += -D_SECURE_SCL=0 ;
if $(major) > 5
{
- C++FLAGS += /Zc:forScope ; # Add support for correct for loop scoping
+ C++FLAGS += /Zc:forScope ; # Add support for correct for loop scoping.
}
- # Add options recognized only by intel7
+ # Add options recognized only by intel7 and above.
if $(major) >= 7
{
C++FLAGS += /Qansi_alias ;
}
-
+
if $(compatibility) = vc6
{
- C++FLAGS +=
+ C++FLAGS +=
# Emulate VC6
/Qvc6
-
- # no wchar_t support in vc6 dinkum library. Furthermore, in vc6
+
+ # No wchar_t support in vc6 dinkum library. Furthermore, in vc6
# compatibility-mode, wchar_t is not a distinct type from unsigned
- # short
+ # short.
-DBOOST_NO_INTRINSIC_WCHAR_T
- ;
+ ;
}
else
{
@@ -119,21 +116,19 @@
-D_NATIVE_WCHAR_T_DEFINED
;
}
- }
-
-
+ }
+
if $(compatibility) && $(compatibility) != native
- {
+ {
C++FLAGS += /Q$(base-vc) ;
}
- else
+ else
{
- C++FLAGS +=
+ C++FLAGS +=
-Qoption,cpp,--arg_dep_lookup
- # The following options were intended to disable
- # 'bug-emulation' mode of intel compiler, but later
- # were reported to case ICE with Intel-Win 9.0
- # It's not yet clear which options can be safely used.
+ # The following options were intended to disable the Intel compiler's
+ # 'bug-emulation' mode, but were later reported to be causing ICE with
+ # Intel-Win 9.0. It is not yet clear which options can be safely used.
# -Qoption,cpp,--const_string_literals
# -Qoption,cpp,--new_for_init
# -Qoption,cpp,--no_implicit_typename
@@ -141,28 +136,26 @@
# -Qoption,cpp,--no_microsoft_bugs
;
}
-
- flags intel-win CFLAGS $(condition) : $(C++FLAGS) ;
-
+
+ toolset.flags intel-win CFLAGS $(condition) : $(C++FLAGS) ;
+
if ! $(compatibility)
{
# If there's no backend version, assume 7.1.
compatibility = vc7.1 ;
}
-
+
local extract-version = [ MATCH ^vc(.*) : $(compatibility) ] ;
if ! $(extract-version)
{
errors.user-error "Invalid value for compatibility option:"
- $(compatibility) ;
+ $(compatibility) ;
}
-
+
# Depending on the settings, running of tests require some runtime DLLs.
- flags intel-win RUN_PATH $(condition) : $(root) ;
-
+ toolset.flags intel-win RUN_PATH $(condition) : $(root) ;
+
msvc.configure-version-specific intel-win : $(extract-version[1]) : $(condition) ;
}
-flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;
-
-
+toolset.flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;
Modified: branches/release/tools/build/v2/tools/make.jam
==============================================================================
--- branches/release/tools/build/v2/tools/make.jam (original)
+++ branches/release/tools/build/v2/tools/make.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -7,14 +7,13 @@
# This module defines the 'make' main target rule.
-import targets ;
import "class" : new ;
-import property ;
import errors : error ;
-import type : type ;
-import regex ;
-import property-set ;
import project ;
+import property ;
+import property-set ;
+import regex ;
+import targets ;
class make-target-class : basic-target
@@ -25,19 +24,20 @@
rule __init__ ( name : project : sources * : requirements *
: default-build * : usage-requirements * )
{
- basic-target.__init__ $(name) : $(project) : $(sources)
- : $(requirements) : $(default-build) : $(usage-requirements) ;
+ basic-target.__init__ $(name) : $(project) : $(sources) :
+ $(requirements) : $(default-build) : $(usage-requirements) ;
}
rule construct ( name : source-targets * : property-set )
{
local action-name = [ $(property-set).get <action> ] ;
- # 'm' will always be set -- we add '@' ourselves in 'make' rule below.
+ # 'm' will always be set -- we add '@' ourselves in the 'make' rule
+ # below.
local m = [ MATCH ^@(.*) : $(action-name) ] ;
local a = [ new action $(source-targets) : $(m[1]) : $(property-set) ] ;
- local t = [ new file-target $(self.name) exact
- : [ type.type $(self.name) ] : $(self.project) : $(a) ] ;
+ local t = [ new file-target $(self.name) exact : [ type.type
+ $(self.name) ] : $(self.project) : $(a) ] ;
return [ property-set.empty ] [ virtual-target.register $(t) ] ;
}
}
@@ -45,8 +45,8 @@
# Declares the 'make' main target.
#
-rule make ( target-name : sources * : generating-rule + : requirements *
- : usage-requirements * )
+rule make ( target-name : sources * : generating-rule + : requirements * :
+ usage-requirements * )
{
local project = [ project.current ] ;
@@ -64,8 +64,9 @@
: [ targets.main-target-sources $(sources) : $(target-name) ]
: [ targets.main-target-requirements $(requirements) : $(project) ]
: [ targets.main-target-default-build : $(project) ]
- : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ]
- ] ;
+ : [ targets.main-target-usage-requirements $(usage-requirements) :
+ $(project) ] ] ;
}
+
IMPORT $(__name__) : make : : make ;
Modified: branches/release/tools/build/v2/tools/msvc.jam
==============================================================================
--- branches/release/tools/build/v2/tools/msvc.jam (original)
+++ branches/release/tools/build/v2/tools/msvc.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -4,75 +4,64 @@
# Copyright (c) 2006 Bojan Resnik.
# Copyright (c) 2006 Ilya Sokolov.
# Copyright (c) 2007 Rene Rivera
+# Copyright (c) 2008 Jurko Gospodnetic
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
+################################################################################
+#
+# MSVC Boost Build toolset module.
+# --------------------------------
+#
+# All toolset versions need to have their location either auto-detected or
+# explicitly specified except for the special 'default' version that expects the
+# environment to find the needed tools or report an error.
+#
+################################################################################
+
import "class" : new ;
-import property ;
-import generators ;
-import os ;
-import type ;
-import toolset : flags ;
+import common ;
import errors ;
import feature ;
-import path ;
-import common ;
-import rc ;
-import midl ;
+import generators ;
import mc ;
+import midl ;
+import os ;
+import path ;
import pch ;
+import property ;
+import rc ;
+import toolset ;
+import type ;
-if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
-{
- .debug-configuration = true ;
-}
-
-feature.extend toolset : msvc ;
-
-feature.subfeature toolset msvc : vendor
- : intel
- : propagated optional
- # intel and msvc supposedly have link-compatible objects... remains
- # to be seen, though ;-)
- ;
-
-# List of all registered configurations
-.versions = [ new configurations ] ;
-
-# Inherit MIDL flags
-toolset.inherit-flags msvc : midl ;
-
-# Inherit MC flags
-toolset.inherit-flags msvc : mc ;
-
-# Dynamic runtime comes only in MT flavour.
-toolset.add-requirements <toolset>msvc,<runtime-link>shared:<threading>multi ;
-
-RM = [ common.rm-command ] ;
-nl = "
-" ;
+################################################################################
+#
+# Public rules.
+#
+################################################################################
-# Initialize the toolset for a specific version. As the result, path to compiler
-# and, possible, program names are set up, and will be used when that version of
-# compiler is requested. For example, you might have:
+# Initialize a specific toolset version configuration. As the result, path to
+# compiler and, possible, program names are set up, and will be used when that
+# version of compiler is requested. For example, you might have:
#
# using msvc : 6.5 : cl.exe ;
# using msvc : 7.0 : Y:/foo/bar/cl.exe ;
#
-# The version paramater can be ommited:
+# The version parameter may be ommited:
#
# using msvc : : Z:/foo/bar/cl.exe ;
#
-# Two special version keywords may be supplied:
-# - all - all detected versions will be registered;
+# The following keywords have special meanings when specified as versions:
+# - all - all detected but not yet used versions will be marked as used
+# with their default options.
# - default - this is an equivalent to an empty version.
#
# Depending on a supplied version, detected configurations and presence 'cl.exe'
# in the path different results may be achieved. The following table describes
-# all possible cases:
+# the possible scenarios:
#
# Nothing "x.y"
# Passed Nothing "x.y" detected, detected,
@@ -86,8 +75,9 @@
# "x.y" - refers to a detected version;
# "a.b" - refers to an undetected version.
#
-# Note: for free VC7.1 tools, we do not correctly find vcvars32.bar when user
-# explicitly provides a path.
+# FIXME: Currently the command parameter and the <compiler> property parameter
+# seem to overlap in duties. Remove this duplication. This seems to be related
+# to why someone started preparing to replace init with configure rules.
#
rule init (
# The msvc version being configured. When omitted the tools invoked when no
@@ -141,28 +131,47 @@
{
options += <command>$(command) ;
}
-
configure $(version) : $(options) ;
}
# 'configure' is a newer version of 'init'. The parameter 'command' is passed as
-# a part of the 'options' list.
+# a part of the 'options' list. See the 'init' rule comment for more detailed
+# information.
#
rule configure ( version ? : options * )
{
switch $(version)
{
- case all :
+ case "all" :
if $(options)
{
- errors.error "msvc: options should be empty when 'all' is specified" ;
+ errors.error "MSVC toolset configuration: options should be"
+ "empty when '$(version)' is specified." ;
}
- # Use all detected versions.
- for local v in [ $(.versions).all ]
+ # Configure (i.e. mark as used) all registered versions.
+ local all-versions = [ $(.versions).all ] ;
+ if ! $(all-versions)
+ {
+ if $(.debug-configuration)
+ {
+ ECHO "notice: [msvc-cfg] Asked to configure all registered"
+ "msvc toolset versions when there are none currently"
+ "registered." ;
+ }
+ }
+ else
{
- configure-really $(v) ;
+ for local v in $(all-versions)
+ {
+ # Note that there is no need to skip already configured
+ # versions here as this will request configure-really rule
+ # to configure the version using default options which will
+ # in turn cause it to simply do nothing in case the version
+ # has already been configured.
+ configure-really $(v) ;
+ }
}
case "default" :
@@ -174,135 +183,511 @@
}
-# Supported CPU architectures.
-.cpu-arch-i386 =
- <architecture>/<address-model>
- <architecture>/<address-model>32
- <architecture>x86/<address-model>
- <architecture>x86/<address-model>32 ;
+# Sets up flag definitions dependent on the compiler version used.
+# - 'version' is the version of compiler in N.M format.
+# - 'conditions' is the property set to be used as flag conditions.
+# - 'toolset' is the toolset for which flag settings are to be defined.
+# This makes the rule reusable for other msvc-option-compatible compilers.
+#
+rule configure-version-specific ( toolset : version : conditions )
+{
+ toolset.push-checking-for-flags-module unchecked ;
+ # Starting with versions 7.0, the msvc compiler have the /Zc:forScope and
+ # /Zc:wchar_t options that improve C++ standard conformance, but those
+ # options are off by default. If we are sure that the msvc version is at
+ # 7.*, add those options explicitly. We can be sure either if user specified
+ # version 7.* explicitly or if we auto-detected the version ourselves.
+ if ! [ MATCH ^(6\\.) : $(version) ]
+ {
+ toolset.flags $(toolset).compile CFLAGS $(conditions) : /Zc:forScope /Zc:wchar_t ;
+ toolset.flags $(toolset).compile.c++ C++FLAGS $(conditions) : /wd4675 ;
-.cpu-arch-amd64 =
- <architecture>/<address-model>64
- <architecture>x86/<address-model>64 ;
+ # Explicitly disable the 'function is deprecated' warning. Some msvc
+ # versions have a bug, causing them to emit the deprecation warning even
+ # with /W0.
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<warnings>off : /wd4996 ;
-.cpu-arch-ia64 =
- <architecture>ia64/<address-model>
- <architecture>ia64/<address-model>64 ;
+ if [ MATCH ^([78]\\.) : $(version) ]
+ {
+ # 64-bit compatibility warning deprecated since 9.0, see
+ # http://msdn.microsoft.com/en-us/library/yt4xw8fh.aspx
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<warnings>all : /Wp64 ;
+ }
+ }
+ #
+ # Processor-specific optimization.
+ #
-# Locates the requested setup script under the given folder and returns its full
-# path or nothing in case the script can not be found. In case multiple scripts
-# are found only the first one is returned.
+ if [ MATCH ^([67]) : $(version) ]
+ {
+ # 8.0 deprecates some of the options.
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>speed $(conditions)/<optimization>space : /Ogiy /Gs ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>speed : /Ot ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>space : /Os ;
+
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set> : /GB ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>i386 : /G3 ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>i486 : /G4 ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g5) : /G5 ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g6) : /G6 ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(.cpu-type-g7) : /G7 ;
+
+ # Improve floating-point accuracy. Otherwise, some of C++ Boost's "math"
+ # tests will fail.
+ toolset.flags $(toolset).compile CFLAGS $(conditions) : /Op ;
+
+ # 7.1 and below have single-threaded static RTL.
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>off/<runtime-link>static/<threading>single : /ML ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>on/<runtime-link>static/<threading>single : /MLd ;
+ }
+ else
+ {
+ # 8.0 and above adds some more options.
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set> : /favor:blend ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set>$(.cpu-type-em64t) : /favor:EM64T ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set>$(.cpu-type-amd64) : /favor:AMD64 ;
+
+ # 8.0 and above only has multi-threaded static RTL.
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>off/<runtime-link>static/<threading>single : /MT ;
+ toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>on/<runtime-link>static/<threading>single : /MTd ;
+ }
+ toolset.pop-checking-for-flags-module ;
+}
+
+
+# Registers this toolset including all of its flags, features & generators. Does
+# nothing on repeated calls.
#
-local rule locate-default-setup ( command : parent : setup-name )
+rule register-toolset ( )
{
- local result = [ GLOB $(command) $(parent) : $(setup-name) ] ;
- if $(result[1])
+ if ! msvc in [ feature.values toolset ]
{
- return $(result[1]) ;
+ register-toolset-really ;
}
}
-local rule configure-really ( version ? : options * )
+# Declare action for creating static libraries. If library exists, remove it
+# before adding files. See
+# http://article.gmane.org/gmane.comp.lib.boost.build/4241 for rationale.
+if [ os.name ] in NT
{
- # Note that if no version supplied uses the default configuration condition
- # remains versionless.
- local v = $(version) ;
- if ! $(v)
+ # The 'DEL' command would issue a message to stdout if the file does not
+ # exist, so need a check.
+ actions archive
{
- # take the first detected version
- version = [ $(.versions).all ] ;
- version = $(version[1]) ;
- v = $(version) ;
-
- # Note: 'version' can still be empty at this point if no versions were
- # detected.
- version ?= "default" ;
+ if exist "$(<[1])" DEL "$(<[1])"
+ $(.LD) $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
}
-
- # Version alias -> real version number
- if $(.version-alias-$(version))
+}
+else
+{
+ actions archive
{
- version = $(.version-alias-$(version)) ;
+ $(.RM) "$(<[1])"
+ $(.LD) $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
}
+}
- # Check whether selected configuration is used already
- if $(version) in [ $(.versions).used ]
+
+# For the assembler the following options are turned on by default:
+#
+# -coff generate COFF format object file (compatible with cl.exe output)
+# -Zp4 align structures to 4 bytes
+# -Cp preserve case of user identifiers
+# -Cx preserve case in publics, externs
+#
+actions compile.asm
+{
+ $(.ASM) -nologo -c -coff -Zp4 -Cp -Cx $(USER_ASMFLAGS) -Fo "$(<:W)" "$(>:W)"
+}
+
+
+rule compile.c ( targets + : sources * : properties * )
+{
+ C++FLAGS on $(targets[1]) = ;
+ get-rspline $(targets) : -TC ;
+ compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
+}
+
+
+rule compile.c.pch ( targets + : sources * : properties * )
+{
+ C++FLAGS on $(targets[1]) = ;
+ get-rspline $(targets[1]) : -TC ;
+ get-rspline $(targets[2]) : -TC ;
+ local pch-source = [ on $(<) return $(PCH_SOURCE) ] ;
+ if $(pch-source)
{
- # Allow multiple 'toolset.using' calls for the same configuration if the
- # identical sets of options are used.
- if $(options) && ( $(options) != [ $(.versions).get $(version) : options ] )
- {
- errors.error "msvc: the toolset version '$(version)' already configured." ;
- }
+ DEPENDS $(<) : $(pch-source) ;
+ compile-c-c++-pch-s $(targets) : $(sources) $(pch-source) ;
}
else
{
- # Register a new configuration.
- $(.versions).register $(version) ;
+ compile-c-c++-pch $(targets) : $(sources) ;
+ }
+}
- # Add user-supplied to auto-detected options.
- options = [ $(.versions).get $(version) : options ] $(options) ;
- # Mark the configuration as 'used'.
- $(.versions).use $(version) ;
+# Action for running the C/C++ compiler without using precompiled headers.
+#
+actions compile-c-c++
+{
+ $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
+}
- # Generate conditions and save them.
- local conditions = [ common.check-init-parameters msvc : version $(v) ] ;
- $(.versions).set $(version) : conditions : $(conditions) ;
+rule compile-c-c++ ( targets + : sources * )
+{
+ DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ;
+ DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ;
+}
- local command = [ feature.get-values <command> : $(options) ] ;
- # If version is specified, we try to search first in default paths, and
- # only then in PATH.
- command = [ common.get-invocation-command msvc : cl.exe : $(command) :
- [ default-paths $(version) ] : $(version) ] ;
+# Action for running the C/C++ compiler using precompiled headers. In addition
+# to whatever else it needs to compile, this action also adds a temporary source
+# .cpp file used to compile the precompiled headers themselves.
+#
+# The global .escaped-double-quote variable is used to avoid messing up Emacs
+# syntax highlighting in the messy N-quoted code below.
+#
+actions compile-c-c++-pch
+{
+ $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Yl"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote))" $(.CC.FILTER)
+}
- common.handle-options msvc : $(conditions) : $(command) : $(options) ;
- if ! $(version)
- {
- # Even if version is not explicitly specified, try to detect the
- # version from the path.
- if [ MATCH "(Microsoft Visual Studio 9)" : $(command) ]
- {
- version = 9.0 ;
- }
- if [ MATCH "(Microsoft Visual Studio 8)" : $(command) ]
- {
- version = 8.0 ;
- }
- else if [ MATCH "(NET 2003[\/\\]VC7)" : $(command) ]
- {
- version = 7.1 ;
- }
- else if [ MATCH "(Microsoft Visual C\\+\\+ Toolkit 2003)" : $(command) ]
- {
- version = 7.1toolkit ;
- }
- else if [ MATCH "(.NET[\/\\]VC7)" : $(command) ]
- {
- version = 7.0 ;
- }
- else
- {
- version = 6.0 ;
- }
- }
+# Action for running the C/C++ compiler using precompiled headers. An already
+# built source file for compiling the precompiled headers is expected to be
+# given as one of the source parameters.
+#
+actions compile-c-c++-pch-s
+{
+ $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Yl"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
+}
- # Generate and register setup command.
- local below-8.0 = [ MATCH ^([67]\\.) : $(version) ] ;
+rule compile.c++ ( targets + : sources * : properties * )
+{
+ get-rspline $(targets) : -TP ;
+ compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
+}
- local cpu = i386 amd64 ia64 ;
- if $(below-8.0)
- {
- cpu = i386 ;
- }
- local setup-amd64 ;
+rule compile.c++.pch ( targets + : sources * : properties * )
+{
+ get-rspline $(targets[1]) : -TP ;
+ get-rspline $(targets[2]) : -TP ;
+ local pch-source = [ on $(<) return $(PCH_SOURCE) ] ;
+ if $(pch-source)
+ {
+ DEPENDS $(<) : $(pch-source) ;
+ compile-c-c++-pch-s $(targets) : $(sources) $(pch-source) ;
+ }
+ else
+ {
+ compile-c-c++-pch $(targets) : $(sources) ;
+ }
+}
+
+
+# See midl.jam for details.
+#
+actions compile.idl
+{
+ $(.IDL) /nologo @"@($(<[1]:W).rsp:E=$(.nl)"$(>:W)" $(.nl)-D$(DEFINES) $(.nl)"-I$(INCLUDES:W)" $(.nl)-U$(UNDEFS) $(.nl)$(MIDLFLAGS) $(.nl)/tlb "$(<[1]:W)" $(.nl)/h "$(<[2]:W)" $(.nl)/iid "$(<[3]:W)" $(.nl)/proxy "$(<[4]:W)" $(.nl)/dlldata "$(<[5]:W)")"
+ $(.TOUCH_FILE) "$(<[4]:W)"
+ $(.TOUCH_FILE) "$(<[5]:W)"
+}
+
+
+actions compile.mc
+{
+ $(.MC) $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)"
+}
+
+
+actions compile.rc
+{
+ $(.RC) -l 0x409 -U$(UNDEFS) -D$(DEFINES) -I"$(INCLUDES:W)" -fo "$(<:W)" "$(>:W)"
+}
+
+
+rule link.dll ( targets + : sources * : properties * )
+{
+ DEPENDS $(<) : [ on $(<) return $(DEF_FILE) ] ;
+}
+
+
+# Incremental linking a DLL causes no end of problems: if the actual exports do
+# not change, the import .lib file is never updated. Therefore, the .lib is
+# always out-of-date and gets rebuilt every time. I am not sure that incremental
+# linking is such a great idea in general, but in this case I am sure we do not
+# want it.
+
+# Windows manifest is a new way to specify dependencies on managed DotNet
+# assemblies and Windows native DLLs. The manifests are embedded as resources
+# and are useful in any PE target (both DLL and EXE).
+
+if [ os.name ] in NT
+{
+ actions link bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE
+ {
+ $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)$(LIBRARIES) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
+ if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
+ if exist "$(<[1]).manifest" (
+ $(.MT) -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);1"
+ )
+ }
+
+ actions link.dll bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE
+ {
+ $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)$(LIBRARIES) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
+ if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
+ if exist "$(<[1]).manifest" (
+ $(.MT) -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);2"
+ )
+ }
+}
+else
+{
+ actions link bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE
+ {
+ $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)$(LIBRARIES) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
+ if test -e "$(<[1]).manifest"; then
+ $(.MT) -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);1"
+ fi
+ }
+
+ actions link.dll bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE
+ {
+ $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(.nl)"$(>)" $(.nl)$(LIBRARIES_MENTIONED_BY_FILE) $(.nl)$(LIBRARIES) $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(.nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
+ if test -e "$(<[1]).manifest"; then
+ $(.MT) -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);2"
+ fi
+ }
+}
+
+
+################################################################################
+#
+# Classes.
+#
+################################################################################
+
+class msvc-pch-generator : pch-generator
+{
+ import property-set ;
+
+ rule run-pch ( project name ? : property-set : sources * )
+ {
+ # Searching for the header and source file in the sources.
+ local pch-header ;
+ local pch-source ;
+ for local s in $(sources)
+ {
+ if [ type.is-derived [ $(s).type ] H ]
+ {
+ pch-header = $(s) ;
+ }
+ else if
+ [ type.is-derived [ $(s).type ] CPP ] ||
+ [ type.is-derived [ $(s).type ] C ]
+ {
+ pch-source = $(s) ;
+ }
+ }
+
+ if ! $(pch-header)
+ {
+ errors.user-error "can not build pch without pch-header" ;
+ }
+
+ # If we do not have the PCH source - that is fine. We will just create a
+ # temporary .cpp file in the action.
+
+ local generated = [ generator.run $(project) $(name)
+ : [ property-set.create
+ # Passing of <pch-source> is a dirty trick, needed because
+ # non-composing generators with multiple inputs are subtly
+ # broken. For more detailed information see:
+ # https://zigzag.cs.msu.su:7813/boost.build/ticket/111
+ <pch-source>$(pch-source)
+ [ $(property-set).raw ] ]
+ : $(pch-header) ] ;
+
+ local pch-file ;
+ for local g in $(generated)
+ {
+ if [ type.is-derived [ $(g).type ] PCH ]
+ {
+ pch-file = $(g) ;
+ }
+ }
+
+ return [ property-set.create <pch-header>$(pch-header)
+ <pch-file>$(pch-file) ] $(generated) ;
+ }
+}
+
+
+################################################################################
+#
+# Local rules.
+#
+################################################################################
+
+# Detects versions listed as '.known-versions' by checking registry information,
+# environment variables & default paths. Supports both native Windows and
+# Cygwin.
+#
+local rule auto-detect-toolset-versions ( )
+{
+ if [ os.name ] in NT CYGWIN
+ {
+ # Get installation paths from the registry.
+ for local i in $(.known-versions)
+ {
+ if $(.version-$(i)-reg)
+ {
+ local vc-path ;
+ for local x in "" "Wow6432Node\\"
+ {
+ vc-path += [ W32_GETREG
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\"$(x)"\\Microsoft\\"$(.version-$(i)-reg)
+ : "ProductDir" ] ;
+ }
+
+ if $(vc-path)
+ {
+ vc-path = [ path.join [ path.make-NT $(vc-path[1]) ] "bin" ] ;
+ register-configuration $(i) : [ path.native $(vc-path[1]) ] ;
+ }
+ }
+ }
+ }
+
+ # Check environment and default installation paths.
+ for local i in $(.known-versions)
+ {
+ if ! $(i) in [ $(.versions).all ]
+ {
+ register-configuration $(i) : [ default-path $(i) ] ;
+ }
+ }
+}
+
+
+# Worker rule for toolset version configuration. Takes an explicit version id or
+# nothing in case it should configure the default toolset version (the first
+# registered one or a new 'default' one in case no toolset versions have been
+# registered yet).
+#
+local rule configure-really ( version ? : options * )
+{
+ local v = $(version) ;
+
+ # Decide what the 'default' version is.
+ if ! $(v)
+ {
+ # Take the first registered (i.e. auto-detected) version.
+ version = [ $(.versions).all ] ;
+ version = $(version[1]) ;
+ v = $(version) ;
+
+ # Note: 'version' can still be empty at this point if no versions have
+ # been auto-detected.
+ version ?= "default" ;
+ }
+
+ # Version alias -> real version number.
+ if $(.version-alias-$(version))
+ {
+ version = $(.version-alias-$(version)) ;
+ }
+
+ # Check whether the selected configuration is already in use.
+ if $(version) in [ $(.versions).used ]
+ {
+ # Allow multiple 'toolset.using' calls for the same configuration if the
+ # identical sets of options are used.
+ if $(options) && ( $(options) != [ $(.versions).get $(version) : options ] )
+ {
+ errors.error "MSVC toolset configuration: Toolset version"
+ "'$(version)' already configured." ;
+ }
+ }
+ else
+ {
+ # Register a new configuration.
+ $(.versions).register $(version) ;
+
+ # Add user-supplied to auto-detected options.
+ options = [ $(.versions).get $(version) : options ] $(options) ;
+
+ # Mark the configuration as 'used'.
+ $(.versions).use $(version) ;
+
+ # Generate conditions and save them.
+ local conditions = [ common.check-init-parameters msvc : version $(v) ]
+ ;
+
+ $(.versions).set $(version) : conditions : $(conditions) ;
+
+ local command = [ feature.get-values <command> : $(options) ] ;
+
+ # If version is specified, we try to search first in default paths, and
+ # only then in PATH.
+ command = [ common.get-invocation-command msvc : cl.exe : $(command) :
+ [ default-paths $(version) ] : $(version) ] ;
+
+ common.handle-options msvc : $(conditions) : $(command) : $(options) ;
+
+ if ! $(version)
+ {
+ # Even if version is not explicitly specified, try to detect the
+ # version from the path.
+ # FIXME: We currently detect both Microsoft Visual Studio 9.0 and
+ # 9.0express as 9.0 here.
+ if [ MATCH "(Microsoft Visual Studio 9)" : $(command) ]
+ {
+ version = 9.0 ;
+ }
+ if [ MATCH "(Microsoft Visual Studio 8)" : $(command) ]
+ {
+ version = 8.0 ;
+ }
+ else if [ MATCH "(NET 2003[\/\\]VC7)" : $(command) ]
+ {
+ version = 7.1 ;
+ }
+ else if [ MATCH "(Microsoft Visual C\\+\\+ Toolkit 2003)" :
+ $(command) ]
+ {
+ version = 7.1toolkit ;
+ }
+ else if [ MATCH "(.NET[\/\\]VC7)" : $(command) ]
+ {
+ version = 7.0 ;
+ }
+ else
+ {
+ version = 6.0 ;
+ }
+ }
+
+ # Generate and register setup command.
+
+ local below-8.0 = [ MATCH ^([67]\\.) : $(version) ] ;
+
+ local cpu = i386 amd64 ia64 ;
+ if $(below-8.0)
+ {
+ cpu = i386 ;
+ }
+
+ local setup-amd64 ;
local setup-i386 ;
local setup-ia64 ;
@@ -311,10 +696,11 @@
# TODO: Note that if we specify a non-existant toolset version then
# this rule may find and use a corresponding compiler executable
# belonging to an incorrect toolset version. For example, if you
- # have only MSVC 7.1 installed and specify you want Boost Build to
- # use MSVC 9.0, then you want Boost Build to report an error but
- # this may cause it to silently use the MSVC 7.1 compiler even
- # though it thinks its using the msvc 9.0 toolset.
+ # have only MSVC 7.1 installed, have its executable on the path and
+ # specify you want Boost Build to use MSVC 9.0, then you want Boost
+ # Build to report an error but this may cause it to silently use the
+ # MSVC 7.1 compiler even though it thinks it is using the msvc-9.0
+ # toolset version.
command = [ common.get-absolute-tool-path $(command[-1]) ] ;
local parent = [ path.make $(command) ] ;
@@ -347,7 +733,8 @@
global-setup = $(global-setup[1]) ;
if ! $(below-8.0)
{
- global-setup ?= [ locate-default-setup $(command) : $(parent) : vcvarsall.bat ] ;
+ global-setup ?= [ locate-default-setup $(command) : $(parent) :
+ vcvarsall.bat ] ;
}
local default-setup-amd64 = vcvarsx86_amd64.bat ;
@@ -384,7 +771,7 @@
}
local setup-prefix = "call " ;
- local setup-suffix = " >nul"$(nl) ;
+ local setup-suffix = " >nul"$(.nl) ;
if ! [ os.name ] in NT
{
setup-prefix = "cmd.exe /S /C call " ;
@@ -461,7 +848,7 @@
{
for local cpu-condition in $(cpu-conditions)
{
- ECHO "msvc: condition: '$(cpu-condition)', setup: '$(setup-$(c))'" ;
+ ECHO "notice: [msvc-cfg] condition: '$(cpu-condition)', setup: '$(setup-$(c))'" ;
}
}
@@ -487,112 +874,20 @@
toolset.flags msvc .CC.FILTER $(cpu-conditions) : "|" $(cc-filter) ;
}
}
+
# Set version-specific flags.
configure-version-specific msvc : $(version) : $(conditions) ;
}
}
-# Supported CPU types (only Itanium optimization options are supported from
-# VC++ 2005 on). See http://msdn2.microsoft.com/en-us/library/h66s5s0e(vs.90).aspx
-cpu-type-g5 = i586 pentium pentium-mmx ;
-cpu-type-g6 =
- i686 pentiumpro pentium2 pentium3 pentium3m pentium-m k6 k6-2 k6-3
- winchip-c6 winchip2 c3 c3-2 ;
-
-cpu-type-em64t = prescott nocona
- conroe conroe-xe conroe-l allendale mermon mermon-xe kentsfield kentsfield-xe
- penryn wolfdale yorksfield nehalem ;
-cpu-type-amd64 = k8 opteron athlon64 athlon-fx ;
-
-cpu-type-g7 =
- pentium4 pentium4m athlon athlon-tbird athlon-4 athlon-xp athlon-mp
- $(cpu-type-em64t) $(cpu-type-amd64) ;
-
-cpu-type-itanium = itanium itanium1 merced ;
-cpu-type-itanium2 = itanium2 mckinley ;
-
-
-# Sets up flag definitions dependent on the compiler version used.
-# - 'version' is the version of compiler in N.M format.
-# - 'conditions' is the property set to be used as flag conditions.
-# - 'toolset' is the toolset for which flag settings are to be defined.
-# This makes the rule reusable for other msvc-option-compatible compilers.
-#
-rule configure-version-specific ( toolset : version : conditions )
-{
- toolset.push-checking-for-flags-module unchecked ;
- # Starting with versions 7.0, the msvc compiler have the /Zc:forScope and
- # /Zc:wchar_t options that improve C++ standard conformance, but those
- # options are off by default. If we're sure that msvc version is at 7.*, add
- # those options explicitly. We can be sure either if user specified version
- # 7.* explicitly, or if the installation path contain 7.* (checked above).
- if ! [ MATCH ^(6\\.) : $(version) ]
- {
- toolset.flags $(toolset).compile CFLAGS $(conditions) : /Zc:forScope /Zc:wchar_t ;
- toolset.flags $(toolset).compile.c++ C++FLAGS $(conditions) : /wd4675 ;
-
- # Explicitly disable the 'function is deprecated' warning. Some msvc
- # versions have a bug, causing them to emit the deprecation warning even
- # with /W0.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<warnings>off : /wd4996 ;
-
- if [ MATCH ^([78]\\.) : $(version) ]
- {
- # 64-bit compatibility warning deprecated since 9.0, see
- # http://msdn.microsoft.com/en-us/library/yt4xw8fh.aspx
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<warnings>all : /Wp64 ;
- }
- }
-
- #
- # Processor-specific optimization
- #
-
- if [ MATCH ^([67]) : $(version) ]
- {
- # 8.0 deprecates some of the options.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>speed $(conditions)/<optimization>space : /Ogiy /Gs ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>speed : /Ot ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<optimization>space : /Os ;
-
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set> : /GB ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>i386 : /G3 ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>i486 : /G4 ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(cpu-type-g5) : /G5 ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(cpu-type-g6) : /G6 ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-i386)/<instruction-set>$(cpu-type-g7) : /G7 ;
-
- # Improve floating-point accuracy. Otherwise, some of C++ Boost's "math"
- # tests will fail.
- toolset.flags $(toolset).compile CFLAGS $(conditions) : /Op ;
-
- # 7.1 and below have single-threaded static RTL.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>off/<runtime-link>static/<threading>single : /ML ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>on/<runtime-link>static/<threading>single : /MLd ;
- }
- else
- {
- # 8.0 and above adds some more options.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set> : /favor:blend ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set>$(cpu-type-em64t) : /favor:EM64T ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/$(.cpu-arch-amd64)/<instruction-set>$(cpu-type-amd64) : /favor:AMD64 ;
-
- # 8.0 and above only has multi-threaded static RTL.
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>off/<runtime-link>static/<threading>single : /MT ;
- toolset.flags $(toolset).compile CFLAGS $(conditions)/<runtime-debugging>on/<runtime-link>static/<threading>single : /MTd ;
- }
- toolset.pop-checking-for-flags-module ;
-}
-
-
# Returns the default installation path for the given version.
#
local rule default-path ( version )
{
- # Use auto-detected path if possible
- local path = [ feature.get-values <command> :
- [ $(.versions).get $(version) : options ] ] ;
+ # Use auto-detected path if possible.
+ local path = [ feature.get-values <command> : [ $(.versions).get $(version)
+ : options ] ] ;
if $(path)
{
@@ -600,7 +895,7 @@
}
else
{
- # Check environment
+ # Check environment.
if $(.version-$(version)-env)
{
local vc-path = [ os.environ $(.version-$(version)-env) ] ;
@@ -614,7 +909,7 @@
}
}
- # Check default path
+ # Check default path.
if ! $(path) && $(.version-$(version)-path)
{
path = [ path.native [ path.join $(.ProgramFiles) $(.version-$(version)-path) ] ] ;
@@ -628,7 +923,7 @@
# Returns either the default installation path (if 'version' is not empty) or
# list of all known default paths (if no version is given)
#
-rule default-paths ( version ? )
+local rule default-paths ( version ? )
{
local possible-paths ;
@@ -648,400 +943,266 @@
}
-# Declare generators.
-
-# TODO: Is it possible to combine these? Make the generators non-composing so
-# that they do not convert each source into a separate .rsp file.
-generators.register-linker msvc.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : EXE : <toolset>msvc ;
-generators.register-linker msvc.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB : <toolset>msvc ;
-
-generators.register-archiver msvc.archive : OBJ : STATIC_LIB : <toolset>msvc ;
-generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : <toolset>msvc ;
-generators.register-c-compiler msvc.compile.c : C : OBJ : <toolset>msvc ;
-
-# Using 'register-c-compiler' adds the build directory to INCLUDES
-generators.register-c-compiler msvc.compile.rc : RC : OBJ(%_res) : <toolset>msvc ;
-generators.override msvc.compile.rc : rc.compile.resource ;
-generators.register-standard msvc.compile.asm : ASM : OBJ : <toolset>msvc ;
-
-generators.register-c-compiler msvc.compile.idl : IDL : MSTYPELIB H C(%_i) C(%_proxy) C(%_dlldata) : <toolset>msvc ;
-generators.override msvc.compile.idl : midl.compile.idl ;
-
-generators.register-standard msvc.compile.mc : MC : H RC : <toolset>msvc ;
-generators.override msvc.compile.mc : mc.compile ;
-
-# pch support
-
-feature.feature pch-source : : free dependency ;
-
-class msvc-pch-generator : pch-generator
+local rule get-rspline ( target : lang-opt )
{
- import property-set ;
-
- rule run-pch ( project name ? : property-set : sources * )
- {
- # Searching header and source file in the sources.
- local pch-header ;
- local pch-source ;
- for local s in $(sources)
- {
- if [ type.is-derived [ $(s).type ] H ]
- {
- pch-header = $(s) ;
- }
- else if
- [ type.is-derived [ $(s).type ] CPP ]
- || [ type.is-derived [ $(s).type ] C ]
- {
- pch-source = $(s) ;
- }
- }
-
- if ! $(pch-header)
- {
- errors.user-error "can't build pch without pch-header" ;
- }
-
- # If we don't have PCH source - that's fine. We'll just create a
- # temporary .cpp file in the action.
-
- local generated = [ generator.run $(project) $(name)
- : [ property-set.create
- # Passing of <pch-source> is a dirty trick, needed because
- # non-composing generators with multiple inputs are subtly
- # broken. For more detailed information see:
- # https://zigzag.cs.msu.su:7813/boost.build/ticket/111
- <pch-source>$(pch-source)
- [ $(property-set).raw ] ]
- : $(pch-header) ] ;
-
- local pch-file ;
- for local g in $(generated)
- {
- if [ type.is-derived [ $(g).type ] PCH ]
- {
- pch-file = $(g) ;
- }
- }
-
- return [ property-set.create <pch-header>$(pch-header)
- <pch-file>$(pch-file) ] $(generated) ;
- }
+ CC_RSPLINE on $(target) = [ on $(target) return $(lang-opt) -U$(UNDEFS)
+ $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(.nl)-D$(DEFINES)
+ $(.nl)\"-I$(INCLUDES:W)\" ] ;
}
-# Note: the 'H' source type will catch both '.h' header and '.hpp' header. The
-# latter have HPP type, but HPP type is derived from H. The type of compilation
-# is determined entirely by the destination type.
-generators.register [ new msvc-pch-generator msvc.compile.c.pch : H : C_PCH OBJ : <pch>on <toolset>msvc ] ;
-generators.register [ new msvc-pch-generator msvc.compile.c++.pch : H : CPP_PCH OBJ : <pch>on <toolset>msvc ] ;
-
-generators.override msvc.compile.c.pch : pch.default-c-pch-generator ;
-generators.override msvc.compile.c++.pch : pch.default-cpp-pch-generator ;
-
-flags msvc.compile PCH_FILE <pch>on : <pch-file> ;
-flags msvc.compile PCH_SOURCE <pch>on : <pch-source> ;
-flags msvc.compile PCH_HEADER <pch>on : <pch-header> ;
-
-#
-# Declare flags and action for compilation
+# Unsafe worker rule for the register-toolset() rule. Must not be called
+# multiple times.
#
-feature.feature debug-store : object database : propagated ;
-
-flags msvc.compile CFLAGS <optimization>speed : /O2 ;
-flags msvc.compile CFLAGS <optimization>space : /O1 ;
-
-flags msvc.compile CFLAGS $(.cpu-arch-ia64)/<instruction-set>$(cpu-type-itanium) : /G1 ;
-flags msvc.compile CFLAGS $(.cpu-arch-ia64)/<instruction-set>$(cpu-type-itanium2) : /G2 ;
-
-flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>object : /Z7 ;
-flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>database : /Zi ;
-flags msvc.compile CFLAGS <optimization>off : /Od ;
-flags msvc.compile CFLAGS <inlining>off : /Ob0 ;
-flags msvc.compile CFLAGS <inlining>on : /Ob1 ;
-flags msvc.compile CFLAGS <inlining>full : /Ob2 ;
-
-flags msvc.compile CFLAGS <warnings>on : /W3 ;
-flags msvc.compile CFLAGS <warnings>off : /W0 ;
-flags msvc.compile CFLAGS <warnings>all : /W4 ;
-flags msvc.compile CFLAGS <warnings-as-errors>on : /WX ;
-
-flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>off : /EHs ;
-flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>on : /EHsc ;
-flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>on/<extern-c-nothrow>off : /EHa ;
-flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>on/<extern-c-nothrow>on : /EHac ;
-
-# By default 8.0 enables rtti support while prior versions disabled it. We
-# simply enable or disable it expliclty so we do not have to depend on this
-# default behaviour.
-flags msvc.compile CFLAGS <rtti>on : /GR ;
-flags msvc.compile CFLAGS <rtti>off : /GR- ;
-flags msvc.compile CFLAGS <runtime-debugging>off/<runtime-link>shared : /MD ;
-flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>shared : /MDd ;
-
-flags msvc.compile CFLAGS <runtime-debugging>off/<runtime-link>static/<threading>multi : /MT ;
-flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>static/<threading>multi : /MTd ;
+local rule register-toolset-really ( )
+{
+ feature.extend toolset : msvc ;
-flags msvc.compile.c OPTIONS <cflags> : ;
-flags msvc.compile.c++ OPTIONS <cxxflags> : ;
+ # Intel and msvc supposedly have link-compatible objects.
+ feature.subfeature toolset msvc : vendor : intel : propagated optional ;
-flags msvc.compile PDB_CFLAG <debug-symbols>on/<debug-store>database : /Fd ; # not used yet
+ # Inherit MIDL flags.
+ toolset.inherit-flags msvc : midl ;
-flags msvc.compile DEFINES <define> ;
-flags msvc.compile UNDEFS <undef> ;
-flags msvc.compile INCLUDES <include> ;
+ # Inherit MC flags.
+ toolset.inherit-flags msvc : mc ;
+ # Dynamic runtime comes only in MT flavour.
+ toolset.add-requirements
+ <toolset>msvc,<runtime-link>shared:<threading>multi ;
-rule get-rspline ( target : lang-opt )
-{
- CC_RSPLINE on $(target) = [ on $(target) return $(lang-opt) -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(nl)-D$(DEFINES) $(nl)\"-I$(INCLUDES:W)\" ] ;
-}
+ # Declare msvc toolset specific features.
+ {
+ feature.feature debug-store : object database : propagated ;
+ feature.feature pch-source : : dependency free ;
+ }
+ # Declare generators.
+ {
+ # TODO: Is it possible to combine these? Make the generators
+ # non-composing so that they do not convert each source into a separate
+ # .rsp file.
+ generators.register-linker msvc.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : EXE : <toolset>msvc ;
+ generators.register-linker msvc.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB : <toolset>msvc ;
-rule compile-c-c++ ( targets + : sources * )
-{
- DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ;
- DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ;
-}
+ generators.register-archiver msvc.archive : OBJ : STATIC_LIB : <toolset>msvc ;
+ generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : <toolset>msvc ;
+ generators.register-c-compiler msvc.compile.c : C : OBJ : <toolset>msvc ;
+ # Using 'register-c-compiler' adds the build directory to INCLUDES.
+ generators.register-c-compiler msvc.compile.rc : RC : OBJ(%_res) : <toolset>msvc ;
+ generators.override msvc.compile.rc : rc.compile.resource ;
+ generators.register-standard msvc.compile.asm : ASM : OBJ : <toolset>msvc ;
-actions compile-c-c++
-{
- $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
-}
+ generators.register-c-compiler msvc.compile.idl : IDL : MSTYPELIB H C(%_i) C(%_proxy) C(%_dlldata) : <toolset>msvc ;
+ generators.override msvc.compile.idl : midl.compile.idl ;
+ generators.register-standard msvc.compile.mc : MC : H RC : <toolset>msvc ;
+ generators.override msvc.compile.mc : mc.compile ;
-rule compile.c ( targets + : sources * : properties * )
-{
- C++FLAGS on $(targets[1]) = ;
- get-rspline $(targets) : -TC ;
- compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
-}
+ # Note: the 'H' source type will catch both '.h' and '.hpp' headers as
+ # the latter have their HPP type derived from H. The type of compilation
+ # is determined entirely by the destination type.
+ generators.register [ new msvc-pch-generator msvc.compile.c.pch : H : C_PCH OBJ : <pch>on <toolset>msvc ] ;
+ generators.register [ new msvc-pch-generator msvc.compile.c++.pch : H : CPP_PCH OBJ : <pch>on <toolset>msvc ] ;
+ generators.override msvc.compile.c.pch : pch.default-c-pch-generator ;
+ generators.override msvc.compile.c++.pch : pch.default-cpp-pch-generator ;
+ }
-rule compile.c++ ( targets + : sources * : properties * )
-{
- get-rspline $(targets) : -TP ;
- compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
-}
+ toolset.flags msvc.compile PCH_FILE <pch>on : <pch-file> ;
+ toolset.flags msvc.compile PCH_SOURCE <pch>on : <pch-source> ;
+ toolset.flags msvc.compile PCH_HEADER <pch>on : <pch-header> ;
+ #
+ # Declare flags for compilation.
+ #
-actions compile-c-c++-pch-s
-{
- $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Yl"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
-}
+ toolset.flags msvc.compile CFLAGS <optimization>speed : /O2 ;
+ toolset.flags msvc.compile CFLAGS <optimization>space : /O1 ;
+ toolset.flags msvc.compile CFLAGS $(.cpu-arch-ia64)/<instruction-set>$(.cpu-type-itanium) : /G1 ;
+ toolset.flags msvc.compile CFLAGS $(.cpu-arch-ia64)/<instruction-set>$(.cpu-type-itanium2) : /G2 ;
-# Needed only to avoid messing up Emacs syntax highlighting in the messy
-# N-quoted code below.
-quote = "\"" ;
+ toolset.flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>object : /Z7 ;
+ toolset.flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>database : /Zi ;
+ toolset.flags msvc.compile CFLAGS <optimization>off : /Od ;
+ toolset.flags msvc.compile CFLAGS <inlining>off : /Ob0 ;
+ toolset.flags msvc.compile CFLAGS <inlining>on : /Ob1 ;
+ toolset.flags msvc.compile CFLAGS <inlining>full : /Ob2 ;
+
+ toolset.flags msvc.compile CFLAGS <warnings>on : /W3 ;
+ toolset.flags msvc.compile CFLAGS <warnings>off : /W0 ;
+ toolset.flags msvc.compile CFLAGS <warnings>all : /W4 ;
+ toolset.flags msvc.compile CFLAGS <warnings-as-errors>on : /WX ;
+
+ toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>off : /EHs ;
+ toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>off/<extern-c-nothrow>on : /EHsc ;
+ toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>on/<extern-c-nothrow>off : /EHa ;
+ toolset.flags msvc.compile C++FLAGS <exception-handling>on/<asynch-exceptions>on/<extern-c-nothrow>on : /EHac ;
+
+ # By default 8.0 enables rtti support while prior versions disabled it. We
+ # simply enable or disable it explicitly so we do not have to depend on this
+ # default behaviour.
+ toolset.flags msvc.compile CFLAGS <rtti>on : /GR ;
+ toolset.flags msvc.compile CFLAGS <rtti>off : /GR- ;
+ toolset.flags msvc.compile CFLAGS <runtime-debugging>off/<runtime-link>shared : /MD ;
+ toolset.flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>shared : /MDd ;
+
+ toolset.flags msvc.compile CFLAGS <runtime-debugging>off/<runtime-link>static/<threading>multi : /MT ;
+ toolset.flags msvc.compile CFLAGS <runtime-debugging>on/<runtime-link>static/<threading>multi : /MTd ;
+
+ toolset.flags msvc.compile.c OPTIONS <cflags> : ;
+ toolset.flags msvc.compile.c++ OPTIONS <cxxflags> : ;
+
+ toolset.flags msvc.compile PDB_CFLAG <debug-symbols>on/<debug-store>database : /Fd ; # not used yet
+
+ toolset.flags msvc.compile DEFINES <define> ;
+ toolset.flags msvc.compile UNDEFS <undef> ;
+ toolset.flags msvc.compile INCLUDES <include> ;
+
+ # Declare flags for the assembler.
+ toolset.flags msvc.compile.asm USER_ASMFLAGS <asmflags> ;
+
+ # Declare flags for linking.
+ {
+ toolset.flags msvc.link PDB_LINKFLAG <debug-symbols>on/<debug-store>database : /PDB: ; # not used yet
+ toolset.flags msvc.link LINKFLAGS <debug-symbols>on : /DEBUG ;
+ toolset.flags msvc.link DEF_FILE <def-file> ;
+
+ # The linker disables the default optimizations when using /DEBUG so we
+ # have to enable them manually for release builds with debug symbols.
+ toolset.flags msvc LINKFLAGS <debug-symbols>on/<runtime-debugging>off : /OPT:REF,ICF ;
+
+ toolset.flags msvc LINKFLAGS <user-interface>console : /subsystem:console ;
+ toolset.flags msvc LINKFLAGS <user-interface>gui : /subsystem:windows ;
+ toolset.flags msvc LINKFLAGS <user-interface>wince : /subsystem:windowsce ;
+ toolset.flags msvc LINKFLAGS <user-interface>native : /subsystem:native ;
+ toolset.flags msvc LINKFLAGS <user-interface>auto : /subsystem:posix ;
+
+ toolset.flags msvc.link OPTIONS <linkflags> ;
+ toolset.flags msvc.link LINKPATH <library-path> ;
+
+ toolset.flags msvc.link FINDLIBS_ST <find-static-library> ;
+ toolset.flags msvc.link FINDLIBS_SA <find-shared-library> ;
+ toolset.flags msvc.link LIBRARY_OPTION <toolset>msvc : "" : unchecked ;
+ toolset.flags msvc.link LIBRARIES_MENTIONED_BY_FILE : <library-file> ;
+ }
-actions compile-c-c++-pch
-{
- $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" -Yl"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(quote)$(>[1]:D=)$(quote))" $(.CC.FILTER)
+ toolset.flags msvc.archive AROPTIONS <archiveflags> ;
}
-rule compile.c.pch ( targets + : sources * : properties * )
+# Locates the requested setup script under the given folder and returns its full
+# path or nothing in case the script can not be found. In case multiple scripts
+# are found only the first one is returned.
+#
+# TODO: There used to exist a code comment for the msvc.init rule stating that
+# we do not correctly detect the location of the vcvars32.bat setup script for
+# the free VC7.1 tools in case user explicitly provides a path. This should be
+# tested or simply remove this whole comment in case this toolset version is no
+# longer important.
+#
+local rule locate-default-setup ( command : parent : setup-name )
{
- C++FLAGS on $(targets[1]) = ;
- get-rspline $(targets[1]) : -TC ;
- get-rspline $(targets[2]) : -TC ;
- local pch-source = [ on $(<) return $(PCH_SOURCE) ] ;
- if $(pch-source)
- {
- DEPENDS $(<) : $(pch-source) ;
- compile-c-c++-pch-s $(targets) : $(sources) $(pch-source) ;
- }
- else
+ local result = [ GLOB $(command) $(parent) : $(setup-name) ] ;
+ if $(result[1])
{
- compile-c-c++-pch $(targets) : $(sources) ;
+ return $(result[1]) ;
}
}
-rule compile.c++.pch ( targets + : sources * : properties * )
+# Validates given path, registers found configuration and prints debug
+# information about it.
+#
+local rule register-configuration ( version : path ? )
{
- get-rspline $(targets[1]) : -TP ;
- get-rspline $(targets[2]) : -TP ;
- local pch-source = [ on $(<) return $(PCH_SOURCE) ] ;
- if $(pch-source)
- {
- DEPENDS $(<) : $(pch-source) ;
- compile-c-c++-pch-s $(targets) : $(sources) $(pch-source) ;
- }
- else
+ if $(path)
{
- compile-c-c++-pch $(targets) : $(sources) ;
- }
-}
-
-
-actions compile.rc
-{
- $(.RC) -l 0x409 -U$(UNDEFS) -D$(DEFINES) -I"$(INCLUDES:W)" -fo "$(<:W)" "$(>:W)"
-}
-
-
-# See midl.jam for details
-TOUCH_FILE = [ common.file-touch-command ] ;
+ local command = [ GLOB $(path) : cl.exe ] ;
+ if $(command)
+ {
+ if $(.debug-configuration)
+ {
+ ECHO "notice: [msvc-cfg] msvc-$(version) detected, command: '$(command)'" ;
+ }
-actions compile.idl
-{
- $(.IDL) /nologo @"@($(<[1]:W).rsp:E=$(nl)"$(>:W)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES:W)" $(nl)-U$(UNDEFS) $(nl)$(MIDLFLAGS) $(nl)/tlb "$(<[1]:W)" $(nl)/h "$(<[2]:W)" $(nl)/iid "$(<[3]:W)" $(nl)/proxy "$(<[4]:W)" $(nl)/dlldata "$(<[5]:W)")"
- $(TOUCH_FILE) "$(<[4]:W)"
- $(TOUCH_FILE) "$(<[5]:W)"
+ $(.versions).register $(version) ;
+ $(.versions).set $(version) : options : <command>$(command) ;
+ }
+ }
}
-# Declare flags and action for the assembler
-
-flags msvc.compile.asm USER_ASMFLAGS <asmflags> : ;
-
+################################################################################
#
-# for the assembler the following options are turned on by default:
+# Startup code executed when loading this module.
#
-# -coff generate COFF format object file (compatible with cl.exe output)
-# -Zp4 align structures to 4 bytes
-# -Cp preserve case of user identifiers
-# -Cx preserve case in publics, externs
-
-actions compile.asm
-{
- $(.ASM) -nologo -c -coff -Zp4 -Cp -Cx $(USER_ASMFLAGS) -Fo "$(<:W)" "$(>:W)"
-}
-
-
-# Declare flags and action for linking
-flags msvc.link PDB_LINKFLAG <debug-symbols>on/<debug-store>database : /PDB: ; # not used yet
-flags msvc.link LINKFLAGS <debug-symbols>on : /DEBUG ;
-flags msvc.link DEF_FILE <def-file> ;
-# The linker disables the default optimizations when using /DEBUG. Whe have to
-# enable them manually for release builds with debug symbols.
-flags msvc LINKFLAGS <debug-symbols>on/<runtime-debugging>off : /OPT:REF,ICF ;
-
-flags msvc LINKFLAGS <user-interface>console : /subsystem:console ;
-flags msvc LINKFLAGS <user-interface>gui : /subsystem:windows ;
-flags msvc LINKFLAGS <user-interface>wince : /subsystem:windowsce ;
-flags msvc LINKFLAGS <user-interface>native : /subsystem:native ;
-flags msvc LINKFLAGS <user-interface>auto : /subsystem:posix ;
-
-flags msvc.link OPTIONS <linkflags> ;
-flags msvc.link LINKPATH <library-path> ;
-
-flags msvc.link FINDLIBS_ST <find-static-library> ;
-flags msvc.link FINDLIBS_SA <find-shared-library> ;
-flags msvc.link LIBRARY_OPTION <toolset>msvc : "" : unchecked ;
-flags msvc.link LIBRARIES_MENTIONED_BY_FILE : <library-file> ;
+################################################################################
-flags msvc.archive AROPTIONS <archiveflags> ;
-
-
-rule link.dll ( targets + : sources * : properties * )
-{
- DEPENDS $(<) : [ on $(<) return $(DEF_FILE) ] ;
-}
-
-
-# Declare action for creating static libraries. If library exists, remove it
-# before adding files. See
-# http://article.gmane.org/gmane.comp.lib.boost.build/4241 for rationale.
-if [ os.name ] in NT
-{
- # The 'DEL' command would issue a message to stdout if the file does not
- # exist, so need a check.
- actions archive
- {
- if exist "$(<[1])" DEL "$(<[1])"
- $(.LD) $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
- }
-}
-else
+if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
- actions archive
- {
- $(RM) "$(<[1])"
- $(.LD) $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
- }
+ .debug-configuration = true ;
}
+# Miscellaneous constants.
+.RM = [ common.rm-command ] ;
+.nl = "
+" ;
+.ProgramFiles = [ path.make [ common.get-program-files-dir ] ] ;
+.escaped-double-quote = "\"" ;
+.TOUCH_FILE = [ common.file-touch-command ] ;
-# Incremental linking a DLL causes no end of problems: if the actual exports
-# do not change, the import .lib file is never updated. Therefore, the .lib is
-# always out-of-date and gets rebuilt every time. I'm not sure that incremental
-# linking is such a great idea in general, but in this case I am sure we do not
-# want it.
-
-# Windows manifest is a new way to specify dependencies on managed DotNet
-# assemblies and Windows native DLLs. The manifests are embedded as resources
-# and are useful in any PE target (both DLL and EXE).
-
-if [ os.name ] in NT
-{
- actions link bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE
- {
- $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
- if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
- if exist "$(<[1]).manifest" (
- $(.MT) -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);1"
- )
- }
-
- actions link.dll bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE
- {
- $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
- if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
- if exist "$(<[1]).manifest" (
- $(.MT) -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);2"
- )
- }
-}
-else
-{
- actions link bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE
- {
- $(.LD) $(LINKFLAGS) /out:"$(<[1]:W)" /LIBPATH:"$(LINKPATH:W)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
- if test -e "$(<[1]).manifest"; then
- $(.MT) -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);1"
- fi
- }
+# List of all registered configurations.
+.versions = [ new configurations ] ;
- actions link.dll bind DEF_FILE LIBRARIES_MENTIONED_BY_FILE
- {
- $(.LD) /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:"$(DEF_FILE)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST).lib" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA).lib")"
- if test -e "$(<[1]).manifest"; then
- $(.MT) -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);2"
- fi
- }
-}
+# Supported CPU architectures.
+.cpu-arch-i386 =
+ <architecture>/<address-model>
+ <architecture>/<address-model>32
+ <architecture>x86/<address-model>
+ <architecture>x86/<address-model>32 ;
+.cpu-arch-amd64 =
+ <architecture>/<address-model>64
+ <architecture>x86/<address-model>64 ;
-actions compile.mc
-{
- $(.MC) $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)"
-}
+.cpu-arch-ia64 =
+ <architecture>ia64/<address-model>
+ <architecture>ia64/<address-model>64 ;
-#
-# Autodetection code
-# detects versions listed as '.known-versions' using registry, environment
-# and checking default paths. Supports both native Windows and Cygwin.
-#
+# Supported CPU types (only Itanium optimization options are supported from
+# VC++ 2005 on). See
+# http://msdn2.microsoft.com/en-us/library/h66s5s0e(vs.90).aspx for more
+# detailed information.
+.cpu-type-g5 = i586 pentium pentium-mmx ;
+.cpu-type-g6 = i686 pentiumpro pentium2 pentium3 pentium3m pentium-m k6
+ k6-2 k6-3 winchip-c6 winchip2 c3 c3-2 ;
+.cpu-type-em64t = prescott nocona conroe conroe-xe conroe-l allendale mermon
+ mermon-xe kentsfield kentsfield-xe penryn wolfdale
+ yorksfield nehalem ;
+.cpu-type-amd64 = k8 opteron athlon64 athlon-fx ;
+.cpu-type-g7 = pentium4 pentium4m athlon athlon-tbird athlon-4 athlon-xp
+ athlon-mp $(.cpu-type-em64t) $(.cpu-type-amd64) ;
+.cpu-type-itanium = itanium itanium1 merced ;
+.cpu-type-itanium2 = itanium2 mckinley ;
-.ProgramFiles = [ path.make [ common.get-program-files-dir ] ] ;
+# Known toolset versions, in order of preference.
.known-versions = 9.0 9.0express 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ;
-# Version aliases
+# Version aliases.
.version-alias-6 = 6.0 ;
.version-alias-6.5 = 6.0 ;
.version-alias-7 = 7.0 ;
.version-alias-8 = 8.0 ;
.version-alias-9 = 9.0 ;
-# Name of the registry key that contains Visual C++ installation path
-# (relative to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft"
+# Names of registry keys containing the Visual C++ installation path (relative
+# to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft").
.version-6.0-reg = "VisualStudio\\6.0\\Setup\\Microsoft Visual C++" ;
.version-7.0-reg = "VisualStudio\\7.0\\Setup\\VC" ;
.version-7.1-reg = "VisualStudio\\7.1\\Setup\\VC" ;
@@ -1050,7 +1211,7 @@
.version-9.0-reg = "VisualStudio\\9.0\\Setup\\VC" ;
.version-9.0express-reg = "VCExpress\\9.0\\Setup\\VC" ;
-# Visual C++ Toolkit 2003 do not store its installation path in the registry.
+# Visual C++ Toolkit 2003 does not store its installation path in the registry.
# The environment variable 'VCToolkitInstallDir' and the default installation
# path will be checked instead.
.version-7.1toolkit-path = "Microsoft Visual C++ Toolkit 2003" "bin" ;
@@ -1061,59 +1222,9 @@
.version-7.1toolkit-envpath = "bin" ;
-# Validates given path, registers found configuration and prints debug
-# information about it.
-#
-local rule register-configuration ( version : path ? )
-{
- if $(path)
- {
- local command = [ GLOB $(path) : cl.exe ] ;
+# Auto-detect all the available msvc installations on the system.
+auto-detect-toolset-versions ;
- if $(command)
- {
- if $(.debug-configuration)
- {
- ECHO "notice: msvc-$(version) detected, command: '$(command)'" ;
- }
- $(.versions).register $(version) ;
- $(.versions).set $(version) : options : <command>$(command) ;
- }
- }
-}
-
-if [ os.name ] in NT CYGWIN
-{
- # Get installation paths from the registry.
- for local i in $(.known-versions)
- {
- if $(.version-$(i)-reg)
- {
- local vc-path ;
- for local x in "" "Wow6432Node\\"
- {
- vc-path += [ W32_GETREG
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\"$(x)"\\Microsoft\\"$(.version-$(i)-reg)
- : "ProductDir" ] ;
- }
-
- if $(vc-path)
- {
- vc-path = [ path.native [ path.join [ path.make-NT $(vc-path[1]) ] "bin" ] ] ;
- register-configuration $(i) : $(vc-path[1]) ;
- }
- }
- }
-}
-
-
-# Check environment and default installation paths.
-
-for local i in $(.known-versions)
-{
- if ! $(i) in [ $(.versions).all ]
- {
- register-configuration $(i) : [ default-path $(i) ] ;
- }
-}
+# And finally trigger the actual Boost Build toolset registration.
+register-toolset ;
Modified: branches/release/tools/build/v2/tools/package.jam
==============================================================================
--- branches/release/tools/build/v2/tools/package.jam (original)
+++ branches/release/tools/build/v2/tools/package.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,92 +1,95 @@
-# Copyright (c) 2005 Vladimir Prus.
-# Copyright 2006 Rene Rivera.
+# Copyright (c) 2005 Vladimir Prus.
+# Copyright 2006 Rene Rivera.
#
-# Use, modification and distribution is subject to the Boost Software
-# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
-# http://www.boost.org/LICENSE_1_0.txt)
-
-# Provides mechanism for installing whole packages into a specific
-# directory structure. This is opposed to the 'install' rule, that
-# installs a number of targets to a single directory, and does not
-# care about directory structure at all.
+# Use, modification and distribution is subject to the Boost Software
+# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
+# http://www.boost.org/LICENSE_1_0.txt)
+
+# Provides mechanism for installing whole packages into a specific directory
+# structure. This is opposed to the 'install' rule, that installs a number of
+# targets to a single directory, and does not care about directory structure at
+# all.
-# Example usage:
+# Example usage:
#
-# package.install boost : <properties>
-# : <binaries>
-# : <libraries>
-# : <headers>
-# ;
+# package.install boost : <properties>
+# : <binaries>
+# : <libraries>
+# : <headers>
+# ;
#
-# This will install binaries, libraries and headers to the 'proper' location, given
-# by command line options --prefix, --exec-prefix, --bindir, --libdir and
-# --includedir.
+# This will install binaries, libraries and headers to the 'proper' location,
+# given by command line options --prefix, --exec-prefix, --bindir, --libdir and
+# --includedir.
#
-# The rule is just a convenient wrapper, avoiding the need to define several
-# 'install' targets.
+# The rule is just a convenient wrapper, avoiding the need to define several
+# 'install' targets.
#
-# The only install-related feature is <install-source-root>. It will apply to
-# headers only and if present, paths of headers relatively to source root will be
-# retained after installing. If it's not specified, then "." is assumed, so
-# relative paths in headers are always preserved.
+# The only install-related feature is <install-source-root>. It will apply to
+# headers only and if present, paths of headers relatively to source root will
+# be retained after installing. If it is not specified, then "." is assumed, so
+# relative paths in headers are always preserved.
-import project ;
-import targets ;
import "class" : new ;
import option ;
-import stage ;
+import project ;
import property ;
+import stage ;
+import targets ;
+
rule install ( name : requirements * : binaries * : libraries * : headers * )
{
- # If <install-source-root> is not specified, all headers are installed
- # to prefix/include, no matter what their relative path is. Sometimes
- # that's what needed.
- local install-source-root
- = [ property.select <install-source-root> : $(requirements) ] ;
+ # If <install-source-root> is not specified, all headers are installed to
+ # prefix/include, no matter what their relative path is. Sometimes that is
+ # what is needed.
+ local install-source-root = [ property.select <install-source-root> :
+ $(requirements) ] ;
+ install-source-root = $(install-source-root:G=) ;
requirements = [ property.change $(requirements) : <install-source-root> ] ;
-
- #
- local install-header-subdir
- = [ property.select <install-header-subdir> : $(requirements) ] ;
+
+ local install-header-subdir = [ property.select <install-header-subdir> :
+ $(requirements) ] ;
install-header-subdir = /$(install-header-subdir:G=) ;
install-header-subdir ?= "" ;
- requirements = [ property.change $(requirements) : <install-header-subdir> ] ;
-
- # First, figure out all locations. Use the default if no prefix option given.
- local prefix = [ option.get prefix :
- [ property.select <install-default-prefix> : $(requirements) ] ] ;
- requirements = [ property.change $(requirements) : <install-default-prefix> ] ;
+ requirements = [ property.change $(requirements) : <install-header-subdir> ]
+ ;
+
+ # First, figure out all locations. Use the default if no prefix option
+ # given.
+ local prefix = [ option.get prefix : [ property.select
+ <install-default-prefix> : $(requirements) ] ] ;
+ prefix = $(prefix:G=) ;
+ requirements = [ property.change $(requirements) : <install-default-prefix>
+ ] ;
# Or some likely defaults if neither is given.
if ! $(prefix)
{
if [ modules.peek : NT ] { prefix = C:\\$(name) ; }
- else if [ modules.peek : UNIX ] { prefix = /usr/local ; }
+ else if [ modules.peek : UNIX ] { prefix = /usr/local ; }
}
- # architecture dependent files
+ # Architecture dependent files.
local exec-locate = [ option.get exec-prefix : $(prefix) ] ;
-
- # binaries
+
+ # Binaries.
local bin-locate = [ option.get bindir : $(prefix)/bin ] ;
- # object code libraries
+ # Object code libraries.
local lib-locate = [ option.get libdir : $(prefix)/lib ] ;
- # source header files
+ # Source header files.
local include-locate = [ option.get includedir : $(prefix)/include ] ;
- stage.install $(name)-bin : $(binaries) : $(requirements) <location>$(bin-locate) ;
- stage.install $(name)-lib :
- $(binaries) $(libraries)
- : $(requirements) <location>$(lib-locate)
- <install-dependencies>on <install-type>LIB
- ;
- stage.install $(name)-headers : $(headers) : $(requirements)
- <location>$(include-locate)$(install-header-subdir)
- <install-source-root>$(install-source-root) ;
+ stage.install $(name)-bin : $(binaries) : $(requirements)
+ <location>$(bin-locate) ;
+ stage.install $(name)-lib : $(binaries) $(libraries) : $(requirements)
+ <location>$(lib-locate) <install-dependencies>on <install-type>LIB ;
+ stage.install $(name)-headers : $(headers) : $(requirements)
+ <location>$(include-locate)$(install-header-subdir)
+ <install-source-root>$(install-source-root) ;
alias $(name) : $(name)-bin $(name)-lib $(name)-headers ;
-
+
local c = [ project.current ] ;
local project-module = [ $(c).project-module ] ;
module $(project-module)
Modified: branches/release/tools/build/v2/tools/python.jam
==============================================================================
--- branches/release/tools/build/v2/tools/python.jam (original)
+++ branches/release/tools/build/v2/tools/python.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -650,6 +650,7 @@
case windows : return ;
case hpux : return <library>rt ;
+ case *bsd : return <library>pthread <toolset>gcc:<library>util ;
case aix : return <library>pthread <library>dl ;
@@ -867,9 +868,9 @@
framework-directory = $(framework-directory:D) ;
}
- if $(framework-directory) = Python.framework
+ if $(framework-directory:D=) = Python.framework
{
- debug-message framework directory is \"$(fwk)\" ;
+ debug-message framework directory is \"$(framework-directory)\" ;
}
else
{
@@ -924,7 +925,7 @@
:
: $(target-requirements)
:
- : $(usage-requirements) <framework>$(fwk)
+ : $(usage-requirements) <framework>$(framework-directory)
;
}
else
@@ -1218,7 +1219,7 @@
local path-separator = [ os.path-separator [ translate-os $(target-os) ] ] ;
local set-PYTHONPATH = [ common.variable-setting-command PYTHONPATH :
$(PYTHONPATH:J=$(path-separator)) ] ;
- LAUNCHER on $(target) = $(set-PYTHONPATH) [ on $(target) return $(PYTHON) ] ;
+ LAUNCHER on $(target) = $(set-PYTHONPATH) [ on $(target) return \"$(PYTHON)\" ] ;
}
Modified: branches/release/tools/build/v2/tools/qcc.jam
==============================================================================
--- branches/release/tools/build/v2/tools/qcc.jam (original)
+++ branches/release/tools/build/v2/tools/qcc.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,208 +6,221 @@
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
-import toolset : flags ;
-import property ;
-import generators ;
-import os ;
-import type ;
-import feature ;
import "class" : new ;
-import set ;
import common ;
import errors ;
+import feature ;
+import generators ;
+import os ;
+import property ;
+import set ;
+import toolset ;
+import type ;
+import unix ;
feature.extend toolset : qcc ;
-import unix ;
toolset.inherit-generators qcc : unix : unix.link unix.link.dll ;
generators.override builtin.lib-generator : qcc.prebuilt ;
toolset.inherit-flags qcc : unix ;
toolset.inherit-rules qcc : unix ;
-
-# Make the "o" suffix used for qcc toolset on all
-# platforms
-type.set-generated-target-suffix OBJ : <toolset>qcc : o ;
+# Set typed target suffixes used by the qcc toolset.
+type.set-generated-target-suffix OBJ : <toolset>qcc : o ;
type.set-generated-target-suffix STATIC_LIB : <toolset>qcc : a ;
-# Initializes the qcc toolset for the given version.
-# If necessary, command may be used to specify where the compiler
-# is located.
-# The parameter 'options' is a space-delimited list of options, each
-# one being specified as <option-name>option-value. Valid option names
-# are: cxxflags, linkflags and linker-type. Accepted values for linker-type
-# are gnu and sun, gnu being the default.
+# Initializes the qcc toolset for the given version. If necessary, command may
+# be used to specify where the compiler is located. The parameter 'options' is a
+# space-delimited list of options, each one being specified as
+# <option-name>option-value. Valid option names are: cxxflags, linkflags and
+# linker-type. Accepted values for linker-type are gnu and sun, gnu being the
+# default.
+#
# Example:
# using qcc : 3.4 : : <cxxflags>foo <linkflags>bar <linker-type>sun ;
+#
rule init ( version ? : command * : options * )
{
local condition = [ common.check-init-parameters qcc : version $(version) ] ;
-
local command = [ common.get-invocation-command qcc : QCC : $(command) ] ;
-
common.handle-options qcc : $(condition) : $(command) : $(options) ;
}
generators.register-c-compiler qcc.compile.c++ : CPP : OBJ : <toolset>qcc ;
-generators.register-c-compiler qcc.compile.c : C : OBJ : <toolset>qcc ;
+generators.register-c-compiler qcc.compile.c : C : OBJ : <toolset>qcc ;
generators.register-c-compiler qcc.compile.asm : ASM : OBJ : <toolset>qcc ;
-# Declare flags for compilation
-flags qcc.compile OPTIONS <debug-symbols>on : -gstabs+ ;
-
-# Declare flags and action for compilation
-flags qcc.compile OPTIONS <optimization>off : -O0 ;
-flags qcc.compile OPTIONS <optimization>speed : -O3 ;
-flags qcc.compile OPTIONS <optimization>space : -Os ;
-
-flags qcc.compile OPTIONS <inlining>off : -Wc,-fno-inline ;
-flags qcc.compile OPTIONS <inlining>on : -Wc,-Wno-inline ;
-flags qcc.compile OPTIONS <inlining>full : -Wc,-finline-functions -Wc,-Wno-inline ;
-
-flags qcc.compile OPTIONS <warnings>off : -w ;
-flags qcc.compile OPTIONS <warnings>all : -Wc,-Wall ;
-flags qcc.compile OPTIONS <warnings-as-errors>on : -Wc,-Werror ;
-
-flags qcc.compile OPTIONS <profiling>on : -p ;
-
-flags qcc.compile OPTIONS <cflags> ;
-flags qcc.compile.c++ OPTIONS <cxxflags> ;
-flags qcc.compile DEFINES <define> ;
-flags qcc.compile INCLUDES <include> ;
-
-flags qcc.compile OPTIONS <link>shared : -shared ;
+# Declare flags for compilation.
+toolset.flags qcc.compile OPTIONS <debug-symbols>on : -gstabs+ ;
+# Declare flags and action for compilation.
+toolset.flags qcc.compile OPTIONS <optimization>off : -O0 ;
+toolset.flags qcc.compile OPTIONS <optimization>speed : -O3 ;
+toolset.flags qcc.compile OPTIONS <optimization>space : -Os ;
+
+toolset.flags qcc.compile OPTIONS <inlining>off : -Wc,-fno-inline ;
+toolset.flags qcc.compile OPTIONS <inlining>on : -Wc,-Wno-inline ;
+toolset.flags qcc.compile OPTIONS <inlining>full : -Wc,-finline-functions -Wc,-Wno-inline ;
+
+toolset.flags qcc.compile OPTIONS <warnings>off : -w ;
+toolset.flags qcc.compile OPTIONS <warnings>all : -Wc,-Wall ;
+toolset.flags qcc.compile OPTIONS <warnings-as-errors>on : -Wc,-Werror ;
+
+toolset.flags qcc.compile OPTIONS <profiling>on : -p ;
+
+toolset.flags qcc.compile OPTIONS <cflags> ;
+toolset.flags qcc.compile.c++ OPTIONS <cxxflags> ;
+toolset.flags qcc.compile DEFINES <define> ;
+toolset.flags qcc.compile INCLUDES <include> ;
+
+toolset.flags qcc.compile OPTIONS <link>shared : -shared ;
+
+toolset.flags qcc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ;
+
+
+rule compile.c++
+{
+ # Here we want to raise the template-depth parameter value to something
+ # higher than the default value of 17. Note that we could do this using the
+ # feature.set-default rule but we do not want to set the default value for
+ # all toolsets as well.
+ #
+ # TODO: This 'modified default' has been inherited from some 'older Boost
+ # Build implementation' and has most likely been added to make some Boost
+ # library parts compile correctly. We should see what exactly prompted this
+ # and whether we can get around the problem more locally.
+ local template-depth = [ on $(1) return $(TEMPLATE_DEPTH) ] ;
+ if ! $(template-depth)
+ {
+ TEMPLATE_DEPTH on $(1) = 100 ;
+ }
+}
actions compile.c++
{
- "$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-100 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
+ "$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
actions compile.c
{
- "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
+ "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
actions compile.asm
{
- "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
+ "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
-# The class which check that we don't try to use
-# the <runtime-link>static property while creating or using shared library,
-# since it's not supported by qcc/libc.
+
+# The class checking that we do not try to use the <runtime-link>static property
+# while creating or using a shared library, since it is not supported by qcc/
+# /libc.
+#
class qcc-linking-generator : unix-linking-generator
{
rule generated-targets ( sources + : property-set : project name ? )
{
- if <runtime-link>static in [ $(property-set).raw ]
+ if <runtime-link>static in [ $(property-set).raw ]
{
local m ;
if [ id ] = "qcc.link.dll"
{
m = "on qcc, DLL can't be build with <runtime-link>static" ;
- }
- if ! $(m) {
+ }
+ if ! $(m)
+ {
for local s in $(sources)
{
local type = [ $(s).type ] ;
- if $(type) && [ type.is-derived $(type) SHARED_LIB ]
+ if $(type) && [ type.is-derived $(type) SHARED_LIB ]
{
m = "on qcc, using DLLS together with the <runtime-link>static options is not possible " ;
- }
- }
+ }
+ }
}
if $(m)
{
- errors.user-error $(m) :
- "it's suggested to use <runtime-link>static together with the <link>static" ;
+ errors.user-error $(m) : "It is suggested to use"
+ "<runtime-link>static together with <link>static." ;
}
-
}
-
- return [ unix-linking-generator.generated-targets
+
+ return [ unix-linking-generator.generated-targets
$(sources) : $(property-set) : $(project) $(name) ] ;
- }
+ }
}
-generators.register [ new qcc-linking-generator qcc.link : LIB OBJ : EXE
+generators.register [ new qcc-linking-generator qcc.link : LIB OBJ : EXE
: <toolset>qcc ] ;
-generators.register [ new qcc-linking-generator qcc.link.dll : LIB OBJ : SHARED_LIB
- : <toolset>qcc ] ;
+generators.register [ new qcc-linking-generator qcc.link.dll : LIB OBJ
+ : SHARED_LIB : <toolset>qcc ] ;
generators.override qcc.prebuilt : builtin.prebuilt ;
generators.override qcc.searched-lib-generator : searched-lib-generator ;
-
-# Declare flags for linking
-# First, the common flags
-flags qcc.link OPTIONS <debug-symbols>on : -gstabs+ ;
-flags qcc.link OPTIONS <profiling>on : -p ;
-flags qcc.link OPTIONS <linkflags> ;
-flags qcc.link LINKPATH <library-path> ;
-flags qcc.link FINDLIBS-ST <find-static-library> ;
-flags qcc.link FINDLIBS-SA <find-shared-library> ;
-flags qcc.link LIBRARIES <library-file> ;
-
-flags qcc.link FINDLIBS-SA : m ;
-
-# For <runtime-link>static we made sure there are no dynamic libraries
-# in the link
-flags qcc.link OPTIONS <runtime-link>static : -static ;
+# Declare flags for linking.
+# First, the common flags.
+toolset.flags qcc.link OPTIONS <debug-symbols>on : -gstabs+ ;
+toolset.flags qcc.link OPTIONS <profiling>on : -p ;
+toolset.flags qcc.link OPTIONS <linkflags> ;
+toolset.flags qcc.link LINKPATH <library-path> ;
+toolset.flags qcc.link FINDLIBS-ST <find-static-library> ;
+toolset.flags qcc.link FINDLIBS-SA <find-shared-library> ;
+toolset.flags qcc.link LIBRARIES <library-file> ;
+
+toolset.flags qcc.link FINDLIBS-SA : m ;
+
+# For <runtime-link>static we made sure there are no dynamic libraries in the
+# link.
+toolset.flags qcc.link OPTIONS <runtime-link>static : -static ;
# Assuming this is just like with gcc.
-flags qcc.link RPATH : <dll-path> : unchecked ;
-flags qcc.link RPATH_LINK : <xdll-path> : unchecked ;
-
+toolset.flags qcc.link RPATH : <dll-path> : unchecked ;
+toolset.flags qcc.link RPATH_LINK : <xdll-path> : unchecked ;
-# Declare actions for linking
+# Declare actions for linking.
+#
rule link ( targets * : sources * : properties * )
{
- SPACE on $(targets) = " " ;
- # Serialize execution of the 'link' action, since
- # running N links in parallel is just slower.
- # For now, serialize only qcc links, it might be a good
- # idea to serialize all links.
+ SPACE on $(targets) = " " ;
+ # Serialize execution of the 'link' action, since running N links in
+ # parallel is just slower. For now, serialize only qcc links while it might
+ # be a good idea to serialize all links.
JAM_SEMAPHORE on $(targets) = <s>qcc-link-semaphore ;
}
actions link bind LIBRARIES
{
- "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS)
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS)
}
-# Always remove archive and start again. Here's rationale from
-# Andre Hentz:
-# I had a file, say a1.c, that was included into liba.a.
-# I moved a1.c to a2.c, updated my Jamfiles and rebuilt.
-# My program was crashing with absurd errors.
-# After some debugging I traced it back to the fact that a1.o was *still*
-# in liba.a
+# Always remove archive and start again. Here is the rationale from Andre Hentz:
+# I had a file, say a1.c, that was included into liba.a. I moved a1.c to a2.c,
+# updated my Jamfiles and rebuilt. My program was crashing with absurd errors.
+# After some debugging I traced it back to the fact that a1.o was *still* in
+# liba.a
RM = [ common.rm-command ] ;
-
if [ os.name ] = NT
{
RM = "if exist \"$(<[1])\" DEL \"$(<[1])\"" ;
}
-# Declare action for creating static libraries
-# The 'r' letter means to add files to the archive with replacement
-# Since we remove archive, we don't care about replacement, but
-# there's no option "add without replacement".
-# The 'c' letter means suppresses warning in case the archive
-# does not exists yet. That warning is produced only on
-# some platforms, for whatever reasons.
-actions piecemeal archive
+# Declare action for creating static libraries. The 'r' letter means to add
+# files to the archive with replacement. Since we remove the archive, we do not
+# care about replacement, but there is no option to "add without replacement".
+# The 'c' letter suppresses warnings in case the archive does not exists yet.
+# That warning is produced only on some platforms, for whatever reasons.
+#
+actions piecemeal archive
{
$(RM) "$(<)"
ar rc "$(<)" "$(>)"
@@ -216,13 +229,14 @@
rule link.dll ( targets * : sources * : properties * )
{
- SPACE on $(targets) = " " ;
+ SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>qcc-link-semaphore ;
}
+
# Differ from 'link' above only by -shared.
+#
actions link.dll bind LIBRARIES
{
- "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS)
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS)
}
-
Modified: branches/release/tools/build/v2/tools/stage.jam
==============================================================================
--- branches/release/tools/build/v2/tools/stage.jam (original)
+++ branches/release/tools/build/v2/tools/stage.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -91,13 +91,15 @@
# for relinking.
local l = [ $(build-property-set).get <linkflags> ] ;
ps-raw += $(l:G=<linkflags>) ;
- }
- # Remove the <tag> feature on original targets.
- ps-raw = [ property.change $(ps-raw) : <tag> ] ;
- # And <location>. If stage target has another stage target in sources,
- # then we shall get virtual targets with <location> property set.
- ps-raw = [ property.change $(ps-raw) : <location> ] ;
+ # Remove the <tag> feature on original targets.
+ ps-raw = [ property.change $(ps-raw) : <tag> ] ;
+
+ # And <location>. If stage target has another stage target in
+ # sources, then we shall get virtual targets with the <location>
+ # property set.
+ ps-raw = [ property.change $(ps-raw) : <location> ] ;
+ }
local d = [ $(build-property-set).get <dependency> ] ;
ps-raw += $(d:G=<dependency>) ;
Modified: branches/release/tools/build/v2/tools/testing.jam
==============================================================================
--- branches/release/tools/build/v2/tools/testing.jam (original)
+++ branches/release/tools/build/v2/tools/testing.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -3,51 +3,51 @@
# 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)
-# This module implements regression testing framework. It declares a number of
-# main target rules which perform some action and, if the results are ok,
-# creates an output file.
-#
-# The exact list of rules is:
-# 'compile' -- creates .test file if compilation of sources was
-# successful.
-# 'compile-fail' -- creates .test file if compilation of sources failed.
-# 'run' -- creates .test file is running of executable produced from
-# sources was successful. Also leaves behind .output file
-# with the output from program run.
-# 'run-fail' -- same as above, but .test file is created if running fails.
-#
-# In all cases, presence of .test file is an indication that the test passed.
-# For more convenient reporting, you might want to use C++ Boost regression
-# testing utilities, see http://www.boost.org/more/regression.html
+# This module implements regression testing framework. It declares a number of
+# main target rules which perform some action and, if the results are OK,
+# creates an output file.
#
-# For historical reason, a 'unit-test' rule is available which has the same
-# syntax as 'exe' and behaves just like 'run'.
+# The exact list of rules is:
+# 'compile' -- creates .test file if compilation of sources was
+# successful.
+# 'compile-fail' -- creates .test file if compilation of sources failed.
+# 'run' -- creates .test file is running of executable produced from
+# sources was successful. Also leaves behind .output file
+# with the output from program run.
+# 'run-fail' -- same as above, but .test file is created if running fails.
+#
+# In all cases, presence of .test file is an indication that the test passed.
+# For more convenient reporting, you might want to use C++ Boost regression
+# testing utilities (see http://www.boost.org/more/regression.html).
+#
+# For historical reason, a 'unit-test' rule is available which has the same
+# syntax as 'exe' and behaves just like 'run'.
# Things to do:
# - Teach compiler_status handle Jamfile.v2.
# Notes:
-# - <no-warn> is not implemented, since in Como-specific, and it's not clear
-# how to implement it
-# - std::locale-support is not implemented (it's used in one test).
+# - <no-warn> is not implemented, since it is Como-specific, and it is not
+# clear how to implement it
+# - std::locale-support is not implemented (it is used in one test).
-import targets ;
-import "class" : new ;
-import property ;
-import feature ;
-import toolset ;
import alias ;
-import type ;
+import "class" ;
+import common ;
+import errors ;
+import feature ;
import generators ;
+import os ;
+import path ;
import project ;
+import property ;
import property-set ;
-import virtual-target ;
-import path ;
-import os ;
-import common ;
-import sequence ;
-import errors ;
import regex ;
+import sequence ;
+import targets ;
+import toolset ;
+import type ;
+import virtual-target ;
rule init ( )
@@ -81,29 +81,27 @@
# Helper rule. Create a test target, using basename of first source if no target
# name is explicitly passed. Remembers the created target in a global variable.
+#
rule make-test ( target-type : sources + : requirements * : target-name ? )
{
target-name ?= $(sources[1]:D=:S=) ;
-
- # Having periods (".") in the target name is problematic because the
- # typed generator will strip the suffix and use the bare name for the
- # file targets. Even though the location-prefix averts problems most
- # times it doesn't prevent ambiguity issues when referring to the
- # test targets. For example when using the XML log output. So we
- # rename the target to remove the periods, and provide an alias
- # for users.
+
+ # Having periods (".") in the target name is problematic because the typed
+ # generator will strip the suffix and use the bare name for the file
+ # targets. Even though the location-prefix averts problems most times it
+ # does not prevent ambiguity issues when referring to the test targets. For
+ # example when using the XML log output. So we rename the target to remove
+ # the periods, and provide an alias for users.
local real-name = [ regex.replace $(target-name) "[.]" "~" ] ;
local project = [ project.current ] ;
# The <location-prefix> forces the build system for generate paths in the
# form '$build_dir/array1.test/gcc/debug'. This is necessary to allow
# post-processing tools to work.
- local t =
- [ targets.create-typed-target
- [ type.type-from-rule-name $(target-type) ] : $(project)
- : $(real-name) : $(sources)
- : $(requirements) <location-prefix>$(real-name).test ] ;
-
+ local t = [ targets.create-typed-target [ type.type-from-rule-name
+ $(target-type) ] : $(project) : $(real-name) : $(sources) :
+ $(requirements) <location-prefix>$(real-name).test ] ;
+
# The alias to the real target, per period replacement above.
if $(real-name) != $(target-name)
{
@@ -111,9 +109,9 @@
}
# Remember the test (for --dump-tests). A good way would be to collect all
- # given a project. This has some technical problems: e.g. we can't call this
- # dump from Jamfile since projects referred by 'build-project' are not
- # available until the whole Jamfile is loaded.
+ # given a project. This has some technical problems: e.g. we can not call
+ # this dump from a Jamfile since projects referred by 'build-project' are
+ # not available until the whole Jamfile has been loaded.
.all-tests += $(t) ;
return $(t) ;
}
@@ -121,15 +119,18 @@
# Note: passing more that one cpp file here is known to fail. Passing a cpp file
# and a library target works.
+#
rule compile ( sources + : requirements * : target-name ? )
{
- return [ make-test compile : $(sources) : $(requirements) : $(target-name) ] ;
+ return [ make-test compile : $(sources) : $(requirements) : $(target-name) ]
+ ;
}
rule compile-fail ( sources + : requirements * : target-name ? )
{
- return [ make-test compile-fail : $(sources) : $(requirements) : $(target-name) ] ;
+ return [ make-test compile-fail : $(sources) : $(requirements) :
+ $(target-name) ] ;
}
@@ -141,7 +142,8 @@
rule link-fail ( sources + : requirements * : target-name ? )
{
- return [ make-test link-fail : $(sources) : $(requirements) : $(target-name) ] ;
+ return [ make-test link-fail : $(sources) : $(requirements) : $(target-name)
+ ] ;
}
@@ -149,7 +151,7 @@
{
if $(input-files[2])
{
- # Check that sorting made when creating property-set instance won't
+ # Check that sorting made when creating property-set instance will not
# change the ordering.
if [ sequence.insertion-sort $(input-files) ] != $(input-files)
{
@@ -161,8 +163,8 @@
}
-rule run ( sources + : args * : input-files * : requirements * : target-name ?
- : default-build * )
+rule run ( sources + : args * : input-files * : requirements * : target-name ? :
+ default-build * )
{
requirements += <testing.arg>$(args:J=" ") ;
requirements += [ handle-input-files $(input-files) ] ;
@@ -170,21 +172,24 @@
}
-rule run-fail ( sources + : args * : input-files * : requirements *
- : target-name ? : default-build * )
+rule run-fail ( sources + : args * : input-files * : requirements * :
+ target-name ? : default-build * )
{
requirements += <testing.arg>$(args:J=" ") ;
requirements += [ handle-input-files $(input-files) ] ;
- return [ make-test run-fail : $(sources) : $(requirements) : $(target-name) ] ;
+ return [ make-test run-fail : $(sources) : $(requirements) : $(target-name)
+ ] ;
}
+
# Use 'test-suite' as a synonym for 'alias', for backward compatibility.
IMPORT : alias : : test-suite ;
# For all main targets in 'project-module', which are typed targets with type
# derived from 'TEST', produce some interesting information.
-rule dump-tests # ( project-module )
+#
+rule dump-tests
{
for local t in $(.all-tests)
{
@@ -195,6 +200,7 @@
# Given a project location in normalized form (slashes are forward), compute the
# name of the Boost library.
+#
local rule get-library-name ( path )
{
# Path is in normalized form, so all slashes are forward.
@@ -219,10 +225,11 @@
# Takes a target (instance of 'basic-target') and prints
-# - its type
-# - its name
-# - comments specified via the <test-info> property
-# - relative location of all source from the project root.
+# - its type
+# - its name
+# - comments specified via the <test-info> property
+# - relative location of all source from the project root.
+#
rule dump-test ( target )
{
local type = [ $(target).type ] ;
@@ -230,8 +237,8 @@
local project = [ $(target).project ] ;
local project-root = [ $(project).get project-root ] ;
- local library = [ get-library-name
- [ path.root [ $(project).get location ] [ path.pwd ] ] ] ;
+ local library = [ get-library-name [ path.root [ $(project).get location ]
+ [ path.pwd ] ] ] ;
if $(library)
{
name = $(library)/$(name) ;
@@ -243,19 +250,16 @@
{
if [ class.is-a $(s) : file-reference ]
{
- local location =
- [ path.root
- [ path.root [ $(s).name ] [ $(s).location ] ]
- [ path.pwd ] ] ;
-
- source-files +=
- [ path.relative
- $(location)
- [ path.root $(project-root) [ path.pwd ] ] ] ;
+ local location = [ path.root [ path.root [ $(s).name ]
+ [ $(s).location ] ] [ path.pwd ] ] ;
+
+ source-files += [ path.relative-to [ path.root $(project-root)
+ [ path.pwd ] ] $(location) ] ;
}
}
- local target-name = [ $(project).get location ] // [ $(target).name ] .test ;
+ local target-name = [ $(project).get location ] // [ $(target).name ] .test
+ ;
target-name = $(target-name:J=) ;
local r = [ $(target).requirements ] ;
@@ -281,9 +285,8 @@
# Format them into a single string of quoted strings.
test-info = \"$(test-info:J=\"\ \")\" ;
- ECHO boost-test($(type)) \"$(name)\"
- [$(test-info)]
- ":" \"$(source-files)\" ;
+ ECHO boost-test($(type)) \"$(name)\" [$(test-info)] ":"
+ \"$(source-files)\" ;
}
}
@@ -300,10 +303,10 @@
# Generator which runs an EXE and captures output.
generators.register-standard testing.capture-output : EXE : RUN_OUTPUT ;
-# Generator which creates a target if sources runs successfully. Differs from
-# RUN in that run output is not captured. The reason why it exists is that the
-# 'run' rule is much better for automated testing, but is not user-friendly. See
-# http://article.gmane.org/gmane.comp.lib.boost.build/6353/
+# Generator which creates a target if sources run successfully. Differs from RUN
+# in that run output is not captured. The reason why it exists is that the 'run'
+# rule is much better for automated testing, but is not user-friendly (see
+# http://article.gmane.org/gmane.comp.lib.boost.build/6353).
generators.register-standard testing.unit-test : EXE : UNIT_TEST ;
@@ -311,13 +314,16 @@
# Causes the 'target' to exist after bjam invocation if and only if all the
# dependencies were successfully built.
+#
rule expect-success ( target : dependency + : requirements * )
{
**passed** $(target) : $(sources) ;
}
+
# Causes the 'target' to exist after bjam invocation if and only if all some of
# the dependencies were not successfully built.
+#
rule expect-failure ( target : dependency + : properties * )
{
local grist = [ MATCH ^<(.*)> : $(dependency:G) ] ;
@@ -332,13 +338,14 @@
}
-# The rule/action combination used to report successfull passing of a test.
+# The rule/action combination used to report successful passing of a test.
+#
rule **passed**
{
# Dump all the tests, if needed. We do it here, since dump should happen
- # only after all Jamfiles have been read, and there's no such place
+ # only after all Jamfiles have been read, and there is no such place
# currently defined (but there should be).
- if ! $(.dumped-tests) && --dump-tests in [ modules.peek : ARGV ]
+ if ! $(.dumped-tests) && ( --dump-tests in [ modules.peek : ARGV ] )
{
.dumped-tests = true ;
dump-tests ;
@@ -349,15 +356,20 @@
}
+# Used to create test files signifying passed tests.
+#
actions **passed**
{
- echo passed > $(<)
+ echo passed > "$(<)"
}
+# Used to create replacement object files that do not get created during tests
+# that are expected to fail.
+#
actions (failed-as-expected)
{
- echo failed as expected > $(<)
+ echo failed as expected > "$(<)"
}
@@ -398,6 +410,7 @@
# - if 'none', does not remove anything, ever
# - if empty, removes 'source'
# - if non-empty and not 'none', contains a list of sources to remove.
+#
rule capture-output ( target : source : properties * : targets-to-remove * )
{
output-file on $(target) = $(target:S=.output) ;
@@ -405,7 +418,7 @@
# The INCLUDES kill a warning about independent target...
INCLUDES $(target) : $(target:S=.output) ;
- # but it also puts .output into dependency graph, so we must tell jam it's
+ # but it also puts .output into dependency graph, so we must tell jam it is
# OK if it cannot find the target or updating rule.
NOCARE $(target:S=.output) ;
@@ -431,12 +444,12 @@
{
TEMPORARY $(targets-to-remove) ;
# Set a second action on target that will be executed after capture
- # output action. The 'RmTemps' rule has the 'ignore' modifier so it's
+ # output action. The 'RmTemps' rule has the 'ignore' modifier so it is
# always considered succeeded. This is needed for 'run-fail' test. For
# that test the target will be marked with FAIL_EXPECTED, and without
# 'ignore' successful execution will be negated and be reported as
- # failure. With 'ignore' we don't detect a case where removing files
- # fails, but it's not likely to happen.
+ # failure. With 'ignore' we do not detect a case where removing files
+ # fails, but it is not likely to happen.
RmTemps $(target) : $(targets-to-remove) ;
}
}
@@ -444,77 +457,77 @@
if [ os.name ] = NT
{
- STATUS = %status% ;
- SET_STATUS = "set status=%ERRORLEVEL%" ;
- RUN_OUTPUT_NL = "echo." ;
- STATUS_0 = "%status% EQU 0 (" ;
- STATUS_NOT_0 = "%status% NEQ 0 (" ;
- VERBOSE = "%verbose% EQU 1 (" ;
- ENDIF = ")" ;
- SHELL_SET = "set " ;
- CATENATE = type ;
- CP = copy ;
+ .STATUS = %status% ;
+ .SET_STATUS = "set status=%ERRORLEVEL%" ;
+ .RUN_OUTPUT_NL = "echo." ;
+ .STATUS_0 = "%status% EQU 0 (" ;
+ .STATUS_NOT_0 = "%status% NEQ 0 (" ;
+ .VERBOSE = "%verbose% EQU 1 (" ;
+ .ENDIF = ")" ;
+ .SHELL_SET = "set " ;
+ .CATENATE = type ;
+ .CP = copy ;
}
else
{
- STATUS = "$status" ;
- SET_STATUS = "status=$?" ;
- RUN_OUTPUT_NL = "echo" ;
- STATUS_0 = "test $status -eq 0 ; then" ;
- STATUS_NOT_0 = "test $status -ne 0 ; then" ;
- VERBOSE = "test $verbose -eq 1 ; then" ;
- ENDIF = "fi" ;
- SHELL_SET = "" ;
- CATENATE = cat ;
- CP = cp ;
+ .STATUS = "$status" ;
+ .SET_STATUS = "status=$?" ;
+ .RUN_OUTPUT_NL = "echo" ;
+ .STATUS_0 = "test $status -eq 0 ; then" ;
+ .STATUS_NOT_0 = "test $status -ne 0 ; then" ;
+ .VERBOSE = "test $verbose -eq 1 ; then" ;
+ .ENDIF = "fi" ;
+ .SHELL_SET = "" ;
+ .CATENATE = cat ;
+ .CP = cp ;
}
+
+.VERBOSE_TEST = 0 ;
if --verbose-test in [ modules.peek : ARGV ]
{
- VERBOSE_TEST = 1 ;
-}
-else
-{
- VERBOSE_TEST = 0 ;
+ .VERBOSE_TEST = 1 ;
}
-RM = [ common.rm-command ] ;
+.RM = [ common.rm-command ] ;
actions capture-output bind INPUT_FILES output-file
{
$(PATH_SETUP)
$(LAUNCHER) "$(>)" $(ARGS) "$(INPUT_FILES)" > "$(output-file)" 2>&1
- $(SET_STATUS)
- $(RUN_OUTPUT_NL) >> "$(output-file)"
- echo EXIT STATUS: $(STATUS) >> "$(output-file)"
- if $(STATUS_0)
- $(CP) "$(output-file)" "$(<)"
- $(ENDIF)
- $(SHELL_SET)verbose=$(VERBOSE_TEST)
- if $(STATUS_NOT_0)
- $(SHELL_SET)verbose=1
- $(ENDIF)
- if $(VERBOSE)
+ $(.SET_STATUS)
+ $(.RUN_OUTPUT_NL) >> "$(output-file)"
+ echo EXIT STATUS: $(.STATUS) >> "$(output-file)"
+ if $(.STATUS_0)
+ $(.CP) "$(output-file)" "$(<)"
+ $(.ENDIF)
+ $(.SHELL_SET)verbose=$(.VERBOSE_TEST)
+ if $(.STATUS_NOT_0)
+ $(.SHELL_SET)verbose=1
+ $(.ENDIF)
+ if $(.VERBOSE)
echo ====== BEGIN OUTPUT ======
- $(CATENATE) "$(output-file)"
+ $(.CATENATE) "$(output-file)"
echo ====== END OUTPUT ======
- $(ENDIF)
- exit $(STATUS)
+ $(.ENDIF)
+ exit $(.STATUS)
}
actions quietly updated ignore piecemeal together RmTemps
{
- $(RM) "$(>)"
+ $(.RM) "$(>)"
}
-MAKE_FILE = [ common.file-creation-command ] ;
+.MAKE_FILE = [ common.file-creation-command ] ;
toolset.flags testing.unit-test LAUNCHER <testing.launcher> ;
toolset.flags testing.unit-test ARGS <testing.arg> ;
+
+
rule unit-test ( target : source : properties * )
{
run-path-setup $(target) : $(source) : $(properties) ;
@@ -524,9 +537,10 @@
actions unit-test
{
$(PATH_SETUP)
- $(LAUNCHER) $(>) $(ARGS) && $(MAKE_FILE) $(<)
+ $(LAUNCHER) $(>) $(ARGS) && $(.MAKE_FILE) $(<)
}
+
IMPORT $(__name__) : compile compile-fail run run-fail link link-fail
: : compile compile-fail run run-fail link link-fail ;
@@ -542,9 +556,14 @@
SYSTEM_TIME on $(target) += $(src-string)$(system) ;
}
+
IMPORT testing : record-time : : testing.record-time ;
+# Calling this rule requests that Boost Build time how long it taks to build the
+# 'source' target and display the results both on the standard output and in the
+# 'target' file.
+#
rule time ( target : source : properties * )
{
# Set up rule for recording timing information.
@@ -561,6 +580,6 @@
echo user: $(USER_TIME)
echo system: $(SYSTEM_TIME)
- echo user: $(USER_TIME)" seconds" > $(<)
- echo system: $(SYSTEM_TIME)" seconds" > $(<)
+ echo user: $(USER_TIME)" seconds" > "$(<)"
+ echo system: $(SYSTEM_TIME)" seconds" >> "$(<)"
}
Modified: branches/release/tools/build/v2/tools/types/exe.jam
==============================================================================
--- branches/release/tools/build/v2/tools/types/exe.jam (original)
+++ branches/release/tools/build/v2/tools/types/exe.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,5 +1,9 @@
# Copyright David Abrahams 2004. 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)
-type EXE : exe : : NT CYGWIN ;
-type EXE ;
+
+import type ;
+
+type.register EXE ;
+type.set-generated-target-suffix EXE : <target-os>windows : "exe" ;
+type.set-generated-target-suffix EXE : <target-os>cygiwn : "exe" ;
Modified: branches/release/tools/build/v2/tools/types/lib.jam
==============================================================================
--- branches/release/tools/build/v2/tools/types/lib.jam (original)
+++ branches/release/tools/build/v2/tools/types/lib.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -7,23 +7,25 @@
type.register LIB ;
-if [ os.on-unix ]
-{
- type.set-generated-target-prefix LIB : : "lib" ;
-}
-
-type STATIC_LIB : lib a : LIB : NT CYGWIN ;
-type STATIC_LIB : a : LIB : MACOSX ;
-type STATIC_LIB : a : LIB ;
+type.set-generated-target-prefix LIB : : "lib" ;
+type.set-generated-target-prefix LIB : <target-os>windows : "" ;
+type.set-generated-target-prefix LIB : <target-os>cygwin : "" ;
+
+# FIXME: should not register both extensions on both
+# platforms.
+type.register STATIC_LIB : a lib : LIB ;
+
+type.set-generated-target-suffix STATIC_LIB : <target-os>windows : lib ;
+type.set-generated-target-suffix STATIC_LIB : <target-os>cygwin : lib ;
type.set-generated-target-prefix STATIC_LIB : : lib ;
type IMPORT_LIB : : STATIC_LIB ;
type.set-generated-target-suffix IMPORT_LIB : : lib ;
type.set-generated-target-prefix IMPORT_LIB : : "" ;
-type SHARED_LIB : dll : LIB : NT CYGWIN ;
-type SHARED_LIB : dylib : LIB : MACOSX ;
-type SHARED_LIB : so : LIB ;
+type.register SHARED_LIB : so dll dylib : LIB ;
+type.set-generated-target-suffix SHARED_LIB : <target-os>windows : dll ;
+type.set-generated-target-suffix SHARED_LIB : <target-os>darwin : dylib ;
type SEARCHED_LIB : : LIB ;
# This is needed so that when we create a target of SEARCHED_LIB
Modified: branches/release/tools/build/v2/tools/types/obj.jam
==============================================================================
--- branches/release/tools/build/v2/tools/types/obj.jam (original)
+++ branches/release/tools/build/v2/tools/types/obj.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,5 +1,9 @@
# Copyright David Abrahams 2004. 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)
-type OBJ : obj : : NT CYGWIN ;
-type OBJ : o ;
+
+import type ;
+
+type.register OBJ : o obj ;
+type.set-generated-target-suffix OBJ : <target-os>windows : obj ;
+type.set-generated-target-suffix OBJ : <target-os>cygwin : obj ;
Modified: branches/release/tools/build/v2/tools/vacpp.jam
==============================================================================
--- branches/release/tools/build/v2/tools/vacpp.jam (original)
+++ branches/release/tools/build/v2/tools/vacpp.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -60,7 +60,7 @@
# Enable 64-bit memory addressing model
flags vacpp CFLAGS <address-model>64 : -q64 ;
flags vacpp LINKFLAGS <address-model>64 : -q64 ;
-flags vacpp ARFLAGS <address-model>64 : -X 64 ;
+flags vacpp ARFLAGS <target-os>aix/<address-model>64 : -X 64 ;
# Use absolute path when generating debug information
flags vacpp CFLAGS <debug-symbols>on : -g -qfullpath ;
Modified: branches/release/tools/build/v2/util/doc.jam
==============================================================================
--- branches/release/tools/build/v2/util/doc.jam (original)
+++ branches/release/tools/build/v2/util/doc.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -606,7 +606,7 @@
: jamfile * # The project Jamfile.
)
{
- if $(jamfile<$(jamfile)>.docs[1])
+ if $(jamfile<$(jamfile)>.docs)
{
# Print the docs.
print.section "Project-specific help"
@@ -625,7 +625,7 @@
config-file # The configuration Jamfile.
)
{
- if $(jamfile<$(config-file)>.docs[1])
+ if $(jamfile<$(config-file)>.docs)
{
# Print the docs.
print.section "Configuration help"
@@ -649,7 +649,7 @@
local l = [ MATCH "^[$(ws)]*(#)(.*)$" : $(line) ] ;
while $(l[1]) && $($(var))
{
- if $(l[2]) { comment += [ MATCH "^[$(ws)](.*)$" : $(l[2]) ] ; }
+ if $(l[2]) { comment += [ MATCH "^[$(ws)]?(.*)$" : $(l[2]) ] ; }
else { comment += "" ; }
$(var) = $($(var)[2-]) ;
line = $($(var)[1]) ;
@@ -908,7 +908,7 @@
set-module-copyright $(module-name) : $(comment-block) ;
}
else if $(action[1]) in "print-help-project" "print-help-config"
- && ! $(jamfile<$(target)>.docs[1])
+ && ! $(jamfile<$(target)>.docs)
{
# special module docs for the project jamfile.
jamfile<$(target)>.docs = $(comment-block) ;
Modified: branches/release/tools/build/v2/util/numbers.jam
==============================================================================
--- branches/release/tools/build/v2/util/numbers.jam (original)
+++ branches/release/tools/build/v2/util/numbers.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,35 +6,9 @@
import errors ;
-digits = 0 1 2 3 4 5 6 7 8 9 ;
-powers = 1 ;
-zeros = "" ;
-natural = $(digits) ;
-positive = $(digits[2-]) ;
-incr = $(positive[2-]) ;
-znatural = $(digits) ;
-zero-test = is zero ; # if $(zero-test[$(n)]) == "is" "zero", n == 0
-
-
-local rule extend ( )
-{
- local next = $(digits[2-])$(znatural) ;
- natural += $(next) ;
- positive += $(next) ;
- incr += $(next) ;
- znatural = $(digits)$(znatural) ;
-}
-
-
rule trim-leading-zeroes ( value )
{
- local value2 = [ MATCH "^0(.*)$" : $(value) ] ;
- while $(value2)
- {
- value = $(value2) ;
- value2 = [ MATCH "^0(.*)$" : $(value) ] ;
- }
- return $(value:E="") ;
+ return [ CALC $(value) + 0 ] ;
}
@@ -76,45 +50,22 @@
if $(finish) != 0
{
- while ! $(positive[$(finish)])
+ local result ;
+ while [ less $(start) $(finish) ] || $(start) = $(finish)
{
- extend ;
- }
-
- if $(step) = 1
- {
- return $(positive[$(start)-$(finish)]) ;
- }
- else
- {
- local index = [ increment $(step) ] ;
- local by1 = $(positive[$(start)-$(finish)]) ;
- local result ;
- while $(by1)
- {
- result += $(by1[1]) ;
- by1 = $(by1[$(index)-]) ;
- }
- return $(result) ;
+ result += $(start) ;
+ start = [ CALC $(start) + $(step) ] ;
}
+ return $(result) ;
}
}
rule less ( n1 n2 )
{
- check $(n1) $(n2) ;
- n1 = [ trim-leading-zeroes $(n1) ] ;
- n2 = [ trim-leading-zeroes $(n2) ] ;
-
- # Avoid messy 0 case by appending 1.
- local l1 = [ range 2 [ log10 $(n1)1 ] ] ;
- local l2 = [ range 2 [ log10 $(n2)1 ] ] ;
-
- # Number of digits mismatch?
- if ( $(l1) < $(l2) ) || ( ( $(l1) = $(l2) ) && $(n1) < $(n2) )
+ switch [ CALC $(n2) - $(n1) ]
{
- return true ;
+ case [1-9]* : return true ;
}
}
@@ -184,10 +135,10 @@
assert.result 0 : trim-leading-zeroes 0 ;
assert.result 1234 : trim-leading-zeroes 1234 ;
assert.result 123456 : trim-leading-zeroes 0000123456 ;
- assert.result 10000123456 : trim-leading-zeroes 10000123456 ;
+ assert.result 1000123456 : trim-leading-zeroes 1000123456 ;
assert.result 10000 : trim-leading-zeroes 10000 ;
assert.result 10000 : trim-leading-zeroes 00010000 ;
-
+
assert.true less 1 2 ;
assert.true less 1 12 ;
assert.true less 1 21 ;
Modified: branches/release/tools/build/v2/util/option.jam
==============================================================================
--- branches/release/tools/build/v2/util/option.jam (original)
+++ branches/release/tools/build/v2/util/option.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -6,6 +6,7 @@
import modules ;
+
rule get ( name : default-value ? )
{
local m = [ MATCH --$(name)=(.*) : [ modules.peek : ARGV ] ] ;
@@ -16,23 +17,22 @@
else
{
return $(default-value) ;
- }
+ }
}
+# Check command-line args as soon as possible. For each option try to load
+# module named after option. Is that succeeds, invoke 'process' rule in the
+# module. The rule may return "true" to indicate that the regular build process
+# should not be attempted.
+#
+# Options take the general form of: --<name>[=<value>] [<value>]
+#
rule process ( )
-{
- # Check command-line args as soon as possible. For each option try
- # to load module named after option. Is that succeeds, invoke 'process'
- # rule in the module. The rule may return "true" to indicate that the
- # regular build process should not be attempted.
- #
- # Options take the general form of: --<name>[=<value>] [<value>]
- #
-
+{
local ARGV = [ modules.peek : ARGV ] ;
local BOOST_BUILD_PATH = [ modules.peek : BOOST_BUILD_PATH ] ;
-
+
local dont-build ;
local args = $(ARGV) ;
while $(args)
@@ -62,27 +62,26 @@
args = $(args[2-]) ;
}
- # look in options subdirectories of BOOST_BUILD_PATH for modules
+ # Jook in options subdirectories of BOOST_BUILD_PATH for modules
# matching the full option name and then its prefix.
local plugin-dir = options ;
- local option-files = [
- GLOB $(plugin-dir:D=$(BOOST_BUILD_PATH)) : $(full-name).jam $(prefix).jam
- ] ;
+ local option-files = [ GLOB $(plugin-dir:D=$(BOOST_BUILD_PATH)) :
+ $(full-name).jam $(prefix).jam ] ;
if $(option-files)
{
- # load the file into a module named for the option
+ # Load the file into a module named for the option.
local f = $(option-files[1]) ;
local module-name = --$(f:D=:S=) ;
modules.load $(module-name) : $(f:D=) : $(f:D) ;
- # if there's a process rule, call it with the full option name
- # and its value (if any). If there was no "=" in the option,
- # the value will be empty.
+ # If there is a process rule, call it with the full option name
+ # and its value (if any). If there was no "=" in the option, the
+ # value will be empty.
if process in [ RULENAMES $(module-name) ]
{
- dont-build +=
- [ modules.call-in $(module-name) : process --$(full-name) : $(values) ] ;
+ dont-build += [ modules.call-in $(module-name) : process
+ --$(full-name) : $(values) ] ;
}
}
}
@@ -90,4 +89,3 @@
return $(dont-build) ;
}
-
Modified: branches/release/tools/build/v2/util/path.jam
==============================================================================
--- branches/release/tools/build/v2/util/path.jam (original)
+++ branches/release/tools/build/v2/util/path.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -213,15 +213,11 @@
#
rule pwd ( )
{
- if $(.pwd)
- {
- return $(.pwd) ;
- }
- else
+ if ! $(.pwd)
{
.pwd = [ make [ PWD ] ] ;
- return $(.pwd) ;
}
+ return $(.pwd) ;
}
@@ -264,8 +260,8 @@
local exc = [ GLOB-RECURSIVELY $(real-exclude-patterns) ] ;
exc = [ sequence.transform NORMALIZE_PATH : $(exc) ] ;
- return [ sequence.transform path.make :
- [ set.difference $(inc) : $(exc) ] ] ;
+ return [ sequence.transform path.make : [ set.difference $(inc) : $(exc) ] ]
+ ;
}
@@ -277,11 +273,8 @@
#
rule glob-tree ( roots * : patterns + : exclude-patterns * )
{
- return [ sequence.transform path.make : [ .glob-tree
- [ sequence.transform path.native : $(roots) ]
- : $(patterns)
- : $(exclude-patterns)
- ] ] ;
+ return [ sequence.transform path.make : [ .glob-tree [ sequence.transform
+ path.native : $(roots) ] : $(patterns) : $(exclude-patterns) ] ] ;
}
@@ -292,17 +285,20 @@
{
excluded = [ GLOB $(roots) : $(exclude-patterns) ] ;
}
- local result = [ set.difference
- [ GLOB $(roots) : $(patterns) ] : $(excluded) ] ;
+ local result = [ set.difference [ GLOB $(roots) : $(patterns) ] :
+ $(excluded) ] ;
local subdirs ;
- for local d in [ set.difference
- [ GLOB $(roots) : * ] : $(excluded) ]
+ for local d in [ set.difference [ GLOB $(roots) : * ] : $(excluded) ]
{
- if ! ( $(d:D=) in . .. ) && ! [ CHECK_IF_FILE $(d) ] { subdirs += $(d) ; }
+ if ! ( $(d:D=) in . .. ) && ! [ CHECK_IF_FILE $(d) ]
+ {
+ subdirs += $(d) ;
+ }
}
if $(subdirs)
{
- result += [ .glob-tree $(subdirs) : $(patterns) : $(exclude-patterns) ] ;
+ result += [ .glob-tree $(subdirs) : $(patterns) : $(exclude-patterns) ]
+ ;
}
return $(result) ;
}
@@ -326,32 +322,33 @@
cwd ?= [ pwd ] ;
local path_ele = [ regex.split [ root $(path) $(cwd) ] "/" ] ;
- if ! $(upper_limit) {
+ if ! $(upper_limit)
+ {
upper_limit = / ;
}
local upper_ele = [ regex.split [ root $(upper_limit) $(cwd) ] "/" ] ;
- # Leave only elements in 'path_ele' below 'upper_ele'
- while $(path_ele) && $(upper_ele[1]) = $(path_ele[1]) {
+ # Leave only elements in 'path_ele' below 'upper_ele'.
+ while $(path_ele) && ( $(upper_ele[1]) = $(path_ele[1]) )
+ {
upper_ele = $(upper_ele[2-]) ;
path_ele = $(path_ele[2-]) ;
}
- # All upper elements removed ?
- if ! $(upper_ele)
+ # Have all upper elements been removed ?
+ if $(upper_ele)
{
- # Create the relative paths to parents, number of elements in 'path_ele'
- local result ;
- for local i in $(path_ele) {
- path = [ parent $(path) ] ;
- result += $(path) ;
- }
- return $(result) ;
+ errors.error "$(upper_limit) is not prefix of $(path)" ;
}
- else
+
+ # Create the relative paths to parents, number of elements in 'path_ele'.
+ local result ;
+ for local i in $(path_ele)
{
- errors.error "$(upper_limit) is not prefix of $(path)" ;
+ path = [ parent $(path) ] ;
+ result += $(path) ;
}
+ return $(result) ;
}
Modified: branches/release/tools/build/v2/util/regex.jam
==============================================================================
--- branches/release/tools/build/v2/util/regex.jam (original)
+++ branches/release/tools/build/v2/util/regex.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,17 +1,18 @@
-# Copyright 2001, 2002 Dave Abrahams
-# Copyright 2003 Douglas Gregor
-# Copyright 2003 Rene Rivera
-# Copyright 2002, 2003, 2004, 2005 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)
+# Copyright 2001, 2002 Dave Abrahams
+# Copyright 2003 Douglas Gregor
+# Copyright 2003 Rene Rivera
+# Copyright 2002, 2003, 2004, 2005 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)
#
# Returns a list of the following substrings:
-# 1) from beginning till the first occurence of 'separator' or till the end,
-# 2) between each occurence of 'separator' and the next occurence,
-# 3) from the last occurence of 'separator' till the end.
+# 1) from beginning till the first occurrence of 'separator' or till the end,
+# 2) between each occurrence of 'separator' and the next occurrence,
+# 3) from the last occurrence of 'separator' till the end.
# If no separator is present, the result will contain only one element.
#
+
rule split ( string separator )
{
local result ;
@@ -22,20 +23,23 @@
while $(match)
{
match = [ MATCH ^(.*)($(separator))(.*) : $(s) ] ;
- if $(match) {
- match += "" ; # in case 3rd item was empty - works around MATCH bug
+ if $(match)
+ {
+ match += "" ; # in case 3rd item was empty - works around MATCH bug
result = $(match[3]) $(result) ;
s = $(match[1]) ;
}
}
# Combine the remaining part at the beginning, which does not have
- # separators, with the pieces broken off.
- # Note that rule's signature does not allow initial s to be empty.
+ # separators, with the pieces broken off. Note that the rule's signature
+ # does not allow the initial s to be empty.
return $(s) $(result) ;
}
-# Returns the concatenated results of Applying regex.split to every
-# element of list using the separator pattern.
+
+# Returns the concatenated results of Applying regex.split to every element of
+# the list using the separator pattern.
+#
rule split-list ( list * : separator )
{
local result ;
@@ -45,9 +49,10 @@
}
return $(result) ;
}
-
-# Match string against pattern, and return the elements indicated by
-# indices.
+
+
+# Match string against pattern, and return the elements indicated by indices.
+#
rule match ( pattern : string : indices * )
{
indices ?= 1 2 3 4 5 6 7 8 9 ;
@@ -55,10 +60,10 @@
return $(x[$(indices)]) ;
}
-# Matches all elements of 'list' agains the 'pattern'
-# and returns a list of the elements indicated by indices of
-# all successfull matches. If 'indices' is omitted returns
-# a list of first paranthethised groups of all successfull
+
+# Matches all elements of 'list' agains the 'pattern' and returns a list of
+# elements indicated by indices of all successful matches. If 'indices' is
+# omitted returns a list of first paranthethised groups of all successful
# matches.
#
rule transform ( list * : pattern : indices * )
@@ -71,41 +76,44 @@
if $(m)
{
result += $(m[$(indices)]) ;
- }
+ }
}
return $(result) ;
}
NATIVE_RULE regex : transform ;
-# Escapes all of the characters in symbols using the escape symbol
-# escape-symbol for the given string, and returns the escaped string
+
+# Escapes all of the characters in symbols using the escape symbol escape-symbol
+# for the given string, and returns the escaped string.
+#
rule escape ( string : symbols : escape-symbol )
{
- local result = "" ;
- local m = 1 ;
- while $(m)
- {
- m = [ MATCH ^([^$(symbols)]*)([$(symbols)])(.*) : $(string) ] ;
- if $(m)
- {
- m += "" ; # Supposedly a bug fix; borrowed from regex.split
- result = "$(result)$(m[1])$(escape-symbol)$(m[2])" ;
- string = $(m[3]) ;
- }
- }
- string ?= "" ;
- result = "$(result)$(string)" ;
- return $(result) ;
+ local result = "" ;
+ local m = 1 ;
+ while $(m)
+ {
+ m = [ MATCH ^([^$(symbols)]*)([$(symbols)])(.*) : $(string) ] ;
+ if $(m)
+ {
+ m += "" ; # Supposedly a bug fix; borrowed from regex.split
+ result = "$(result)$(m[1])$(escape-symbol)$(m[2])" ;
+ string = $(m[3]) ;
+ }
+ }
+ string ?= "" ;
+ result = "$(result)$(string)" ;
+ return $(result) ;
}
-# Replaces occurances of a match string in a given string. Returns the
-# new string. The match string can be a regex expression.
+
+# Replaces occurrences of a match string in a given string and returns the new
+# string. The match string can be a regex expression.
#
rule replace (
- string # The string to modify.
- match # The characters to replace.
- replacement # The string to replace with.
+ string # The string to modify.
+ match # The characters to replace.
+ replacement # The string to replace with.
)
{
local result = "" ;
@@ -125,9 +133,9 @@
return $(result) ;
}
-# Replaces occurances of a match string in a given list of strings.
-# Returns the list of new strings. The match string can be a regex
-# expression.
+
+# Replaces occurrences of a match string in a given list of strings and returns
+# a list of new strings. The match string can be a regex expression.
#
# list - the list of strings to modify.
# match - the search expression.
@@ -143,6 +151,7 @@
return $(result) ;
}
+
rule __test__ ( )
{
import assert ;
@@ -153,28 +162,28 @@
assert.result "" a "" b c : split "/a//b/c" / ;
assert.result "" a "" b c "" : split "/a//b/c/" / ;
assert.result "" a "" b c "" "" : split "/a//b/c//" / ;
-
+
assert.result a c b d
- : match (.)(.)(.)(.) : abcd : 1 3 2 4 ;
-
+ : match (.)(.)(.)(.) : abcd : 1 3 2 4 ;
+
assert.result a b c d
- : match (.)(.)(.)(.) : abcd ;
-
+ : match (.)(.)(.)(.) : abcd ;
+
assert.result ababab cddc
- : match ((ab)*)([cd]+) : abababcddc : 1 3 ;
+ : match ((ab)*)([cd]+) : abababcddc : 1 3 ;
- assert.result a.h c.h
- : transform <a.h> \"b.h\" <c.h> : <(.*)> ;
+ assert.result a.h c.h
+ : transform <a.h> \"b.h\" <c.h> : <(.*)> ;
- assert.result a.h b.h c.h
- : transform <a.h> \"b.h\" <c.h> : <([^>]*)>|\"([^\"]*)\" : 1 2 ;
+ assert.result a.h b.h c.h
+ : transform <a.h> \"b.h\" <c.h> : <([^>]*)>|\"([^\"]*)\" : 1 2 ;
assert.result "^<?xml version=\"1.0\"^>"
- : escape "<?xml version=\"1.0\">" : "&|()<>^" : "^" ;
-
+ : escape "<?xml version=\"1.0\">" : "&|()<>^" : "^" ;
+
assert.result "<?xml version=\\\"1.0\\\">"
- : escape "<?xml version=\"1.0\">" : "\\\"" : "\\" ;
-
+ : escape "<?xml version=\"1.0\">" : "\\\"" : "\\" ;
+
assert.result "string string " : replace "string string " " " " " ;
assert.result " string string" : replace " string string" " " " " ;
assert.result "string string" : replace "string string" " " " " ;
Modified: branches/release/tools/build/v2/util/sequence.jam
==============================================================================
--- branches/release/tools/build/v2/util/sequence.jam (original)
+++ branches/release/tools/build/v2/util/sequence.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -204,8 +204,8 @@
}
-# Returns the maximum number in 'elements'. Uses 'ordered' for comparisons, or
-# 'numbers.less' is none is provided.
+# Returns the maximum number in 'elements'. Uses 'ordered' for comparisons or
+# 'numbers.less' if none is provided.
#
rule max-element ( elements + : ordered ? )
{
Modified: branches/release/tools/build/v2/util/utility.jam
==============================================================================
--- branches/release/tools/build/v2/util/utility.jam (original)
+++ branches/release/tools/build/v2/util/utility.jam 2008-10-16 04:42:03 EDT (Thu, 16 Oct 2008)
@@ -1,66 +1,77 @@
-# Copyright 2001, 2002 Dave Abrahams
-# Copyright 2002, 2003, 2004, 2005 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)
+# Copyright 2001, 2002 Dave Abrahams
+# Copyright 2002, 2003, 2004, 2005 Vladimir Prus
+# Copyright 2008 Jurko Gospodnetic
+# 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)
import "class" : is-instance ;
import errors ;
-rule ungrist ( names * )
+
+# For all elements of 'list' which do not already have 'suffix', add 'suffix'.
+#
+rule apply-default-suffix ( suffix : list * )
{
local result ;
- for local name in $(names)
+ for local i in $(list)
{
- local stripped = [ MATCH ^<(.*)>$ : $(name) ] ;
- if ! $(stripped)
+ if $(i:S) = $(suffix)
{
- errors.error "in ungrist" $(names) : $(name) is not of the form <.*> ;
+ result += $(i) ;
+ }
+ else
+ {
+ result += $(i)$(suffix) ;
}
- result += $(stripped) ;
}
return $(result) ;
}
+
+# If 'name' contains a dot, returns the part before the last dot. If 'name'
+# contains no dot, returns it unmodified.
+#
+rule basename ( name )
+{
+ if $(name:S)
+ {
+ name = $(name:B) ;
+ }
+ return $(name) ;
+}
+
+
# Return the file of the caller of the rule that called caller-file.
+#
rule caller-file ( )
{
local bt = [ BACKTRACE ] ;
return $(bt[9]) ;
}
-# Returns the textual representation of argument. If it is a class
-# instance, class its 'str' method. Otherwise, returns the argument.
-rule str ( value )
-{
- if [ is-instance $(value) ]
- {
- return [ $(value).str ] ;
- }
- else
- {
- return $(value) ;
- }
-}
-# Tests if 'a' is equal to 'b'. If 'a' is a class instance,
-# calls its 'equal' method. Uses ordinary jam's comparison otherwise.
+# Tests if 'a' is equal to 'b'. If 'a' is a class instance, calls its 'equal'
+# method. Uses ordinary jam's comparison otherwise.
+#
rule equal ( a b )
{
- if [ is-instance $(a) ]
+ if [ is-instance $(a) ]
{
return [ $(a).equal $(b) ] ;
}
else
{
- if $(a) = $(b)
+ if $(a) = $(b)
{
return true ;
}
}
}
-# Tests if 'a' is less than 'b'. If 'a' is a class instance,
-# calls its 'less' method. Uses ordinary jam's comparison otherwise.
+
+# Tests if 'a' is less than 'b'. If 'a' is a class instance, calls its 'less'
+# method. Uses ordinary jam's comparison otherwise.
+#
rule less ( a b )
{
if [ is-instance $(a) ]
@@ -76,66 +87,74 @@
}
}
-# For all elements of 'list' which do not already have 'suffix',
-# add 'suffix'.
-rule apply-default-suffix ( suffix : list * )
+
+# Returns the textual representation of argument. If it is a class instance,
+# class its 'str' method. Otherwise, returns the argument.
+#
+rule str ( value )
+{
+ if [ is-instance $(value) ]
+ {
+ return [ $(value).str ] ;
+ }
+ else
+ {
+ return $(value) ;
+ }
+}
+
+
+# Accepts a list of gristed values and returns them ungristed. Reports an error
+# in case any of the passed parameters is not gristed, i.e. surrounded in angle
+# brackets < and >.
+#
+rule ungrist ( names * )
{
local result ;
- for local i in $(list)
+ for local name in $(names)
{
- if $(i:S) = $(suffix)
+ local stripped = [ MATCH ^<(.*)>$ : $(name) ] ;
+ if ! $(stripped)
{
- result += $(i) ;
+ errors.error "in ungrist $(names) : $(name) is not of the form <.*>" ;
}
- else
- {
- result += $(i)$(suffix) ;
- }
+ result += $(stripped) ;
}
- return $(result) ;
+ return $(result) ;
}
-# If 'name' contains a dot, returns the part before the last dot.
-# If 'name' contains no dot, returns it unmodified.
-rule basename ( name )
-{
- if $(name:S)
+
+# If the passed value is quoted, unquotes it. Otherwise returns the value
+# unchanged.
+#
+rule unquote ( value ? )
+{
+ local match-result = [ MATCH ^(\")(.*)(\")$ : $(value) ] ;
+ if $(match-result)
{
- name = $(name:B) ;
+ return $(match-result[2]) ;
+ }
+ else
+ {
+ return $(value) ;
}
- return $(name) ;
}
-
rule __test__ ( )
{
import assert ;
import "class" : new ;
- assert.result foo bar : ungrist <foo> <bar> ;
+ import errors : try catch ;
assert.result 123 : str 123 ;
- class test-class__
+ class test-class__
{
- rule __init__ ( )
- {
- }
-
- rule str ( )
- {
- return "str-test-class" ;
- }
-
- rule less ( a )
- {
- return "yes, of course!" ;
- }
-
- rule equal ( a )
- {
- return "not sure" ;
- }
+ rule __init__ ( ) { }
+ rule str ( ) { return "str-test-class" ; }
+ rule less ( a ) { return "yes, of course!" ; }
+ rule equal ( a ) { return "not sure" ; }
}
assert.result "str-test-class" : str [ new test-class__ ] ;
@@ -145,13 +164,72 @@
assert.true equal 1 1 ;
assert.false equal 1 2 ;
assert.result "not sure" : equal [ new test-class__ ] 1 ;
-
- assert.result foo.lib foo.lib : apply-default-suffix .lib : foo.lib foo.lib ;
-
+
+ assert.result foo.lib foo.lib : apply-default-suffix .lib : foo.lib foo.lib
+ ;
+
assert.result foo : basename foo ;
assert.result foo : basename foo.so ;
assert.result foo.so : basename foo.so.1 ;
-}
+ assert.result : unquote ;
+ assert.result "" : unquote "" ;
+ assert.result foo : unquote foo ;
+ assert.result \"foo : unquote \"foo ;
+ assert.result foo\" : unquote foo\" ;
+ assert.result foo : unquote \"foo\" ;
+ assert.result \"foo\" : unquote \"\"foo\"\" ;
+
+ assert.result : ungrist ;
+ assert.result foo : ungrist <foo> ;
+ assert.result <foo> : ungrist <<foo>> ;
+ assert.result foo bar : ungrist <foo> <bar> ;
+
+ try ;
+ {
+ ungrist "" ;
+ }
+ catch "in ungrist : is not of the form <.*>" ;
+
+ try ;
+ {
+ ungrist <> ;
+ }
+ catch "in ungrist <> : <> is not of the form <.*>" ;
+ try ;
+ {
+ ungrist foo ;
+ }
+ catch "in ungrist foo : foo is not of the form <.*>" ;
+ try ;
+ {
+ ungrist <foo ;
+ }
+ catch "in ungrist <foo : <foo is not of the form <.*>" ;
+
+ try ;
+ {
+ ungrist foo> ;
+ }
+ catch "in ungrist foo> : foo> is not of the form <.*>" ;
+
+ try ;
+ {
+ ungrist foo bar ;
+ }
+ catch "in ungrist foo : foo is not of the form <.*>" ;
+
+ try ;
+ {
+ ungrist foo <bar> ;
+ }
+ catch "in ungrist foo : foo is not of the form <.*>" ;
+
+ try ;
+ {
+ ungrist <foo> bar ;
+ }
+ catch "in ungrist bar : bar is not of the form <.*>" ;
+}
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