From ed6079fb3d393fe22dd6e2dc1b8eca89b949bab5 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 21 Mar 2006 16:26:47 +0000 Subject: [PATCH 001/154] Quick fix to allow configure different Python versions for different toolsets. [SVN r33421] --- src/build/project.jam | 16 ++++++++++++++++ src/tools/python.jam | 26 ++++++++++++++++++-------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/build/project.jam b/src/build/project.jam index 74f901b64..e848cc99f 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -674,6 +674,22 @@ rule current ( ) return $(.current-project) ; } +# Temporary changes the current project to 'project'. Should +# be followed by 'pop-current'. +rule push-current ( project ) +{ + .saved-current-project += $(.current-project) ; + .current-project = $(project) ; +} + +rule pop-current ( ) +{ + .current-project = $(.saved-current-project[-1]) ; + .saved-current-project = $(.saved-current-project[1--2]) ; +} + + + # Returns the project-attribute instance for the specified jamfile module. rule attributes ( project ) { diff --git a/src/tools/python.jam b/src/tools/python.jam index e75a406ac..475976684 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -39,6 +39,11 @@ import toolset : flags ; project.initialize $(__name__) ; project python ; +# Save the project so that if 'init' is called several +# times we define new targets in the python project, +# not in whatever project we were called by. +.project = [ project.current ] ; + # Initializes the Python toolset. # - version -- the version of Python to use. Should be in Major.Minor format, # for example 2.3 @@ -57,9 +62,12 @@ project python ; # using python 2.3 : /usr/local ; # Root specified, include and lib paths # # will be guessed # -rule init ( version ? : root ? : includes ? : libraries ? : cygwin-condition ? ) +rule init ( version ? : root ? : includes ? : libraries ? + : cygwin-condition * ) { .configured = true ; + + project.push-current $(.project) ; if [ os.name ] = NT { @@ -71,11 +79,13 @@ rule init ( version ? : root ? : includes ? : libraries ? : cygwin-condition ? ) } else if [ modules.peek : UNIX ] { - init-unix $(version) : $(root) : $(includes) : $(libraries) ; + init-unix $(version) : $(root) : $(includes) : $(libraries) : $(cygwin-condition) ; } + + project.pop-current ; } -rule init-unix ( version ? : root ? : includes ? : libraries ? ) +rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) { root ?= /usr ; includes ?= $(root)/include/python$(version) ; @@ -100,17 +110,17 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? ) # loaded in the interpreter, the symbols in the interpreter # are used. If we linked to libpython, we'd get duplicate # symbols. So declare two targets -- one for headers and another - # for library. + # for library. alias python_for_extensions - : - : + : + : $(condition) : : $(includes) ; alias python - : - : + : + : $(condition) : : $(includes) $(libraries) From 0390c210ca9a928bdf3ecce7bd8076b44943a4b9 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 06:56:28 +0000 Subject: [PATCH 002/154] When Python is initialized several times, for different toolsets, use only one interpreter command when running Boost.Python tests, not all initialized ones. [SVN r33428] --- src/tools/python.jam | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 475976684..3377f3d7a 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -92,18 +92,35 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) libraries ?= $(root)/lib/python$(version)/config ; # Find the 'python' binary, which is used for testing. - # Look first in $(root)/bin, then in PATH. + # Look first in $(root)/bin, then in PATH. local interpreter = [ common.get-invocation-command python : python : : $(root)/bin : path-last ] ; + if $(interpreter:D) != $(root)/bin + { + ECHO "warning: was expecting Python interpreter in " $(root)/bin ; + ECHO "warning: found only in PATH:" $(interpreter) ; + } + if --debug-configuration in [ modules.peek : ARGV ] { ECHO "notice: Python include path is" $(includes) ; ECHO "notice: Python library path is" $(libraries) ; - ECHO "notice: Python interpreter is" $(interpreter) ; + ECHO "notice: Python interpreter is" $(interpreter) ; + } + + # If not specific condition is specified, set global value + # If condition is specified, set PYTHON on target. It will + # override the global value. + if ! $(condition) + { + PYTHON = $(interpreter) ; + } + else + { + flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ; } - flags python.capture-output PYTHON : $(interpreter) ; # On Linux, we don't want to link either Boost.Python or # Python extensions to libpython, so that when extensions From 9997a8a80fd106e69c92fe074f7fbe19613904c6 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 08:52:30 +0000 Subject: [PATCH 003/154] Explicitly pass -RTTI on. [SVN r33432] --- src/tools/cw.jam | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/cw.jam b/src/tools/cw.jam index beb7737ea..3b0a4ba71 100644 --- a/src/tools/cw.jam +++ b/src/tools/cw.jam @@ -134,6 +134,9 @@ flags cw.compile CFLAGS off : -inline off ; flags cw.compile CFLAGS on : -inline on ; flags cw.compile CFLAGS full : -inline all ; flags cw.compile CFLAGS off : -Cpp_exceptions off ; + + +flags cw.compile CFLAGS on : -RTTI on ; flags cw.compile CFLAGS off : -RTTI off ; flags cw.compile CFLAGS on : -w on ; From a85b6d2aab8f69c5b14b24dabc05811f6ca69dab Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 09:51:24 +0000 Subject: [PATCH 004/154] Force all dependents of python to get 'dl' library on Linux. [SVN r33433] --- src/tools/python.jam | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 3377f3d7a..cd98ce5b3 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -121,6 +121,9 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ; } + # Dynamic linker lib. Necessary to specify it explicitly + # on some platforms. + lib dl ; # On Linux, we don't want to link either Boost.Python or # Python extensions to libpython, so that when extensions @@ -136,7 +139,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) ; alias python - : + : dl : $(condition) : : $(includes) From 9f015fc475c27aa2324c01c6abefd0b51410730c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:03:59 +0000 Subject: [PATCH 005/154] Move qt.jam to qt3.jam. [SVN r33435] --- src/tools/qt3.jam | 213 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 src/tools/qt3.jam diff --git a/src/tools/qt3.jam b/src/tools/qt3.jam new file mode 100644 index 000000000..dba571092 --- /dev/null +++ b/src/tools/qt3.jam @@ -0,0 +1,213 @@ +# Copyright (C) Vladimir Prus 2002. 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. + +# Support for the Qt GUI library version 3 +# (http://www.trolltech.com/products/qt3/index.html). +# For new developments, it's recommented to use Qt4 via the qt4 +# Boost.Build module. + +import modules ; +import feature ; +import errors ; +import type ; +import "class" : new ; +import generators ; +import project ; +import toolset : flags ; + +# Convert this module into a project, so that we can declare +# targets here. + +project.initialize $(__name__) ; +project qt ; + +# Initialized the QT support module. The 'prefix' parameter +# tells where QT is installed. When not given, environmental +# variable QTDIR should be set. +rule init ( prefix ? ) +{ + if ! $(prefix) + { + prefix = [ modules.peek : QTDIR ] ; + if ! $(prefix) + { + errors.error + "QT installation prefix not given and QTDIR variable is empty" ; + } + } + + if $(.initialized) + { + if $(prefix) != $(.prefix) + { + errors.error + "Attempt the reinitialize QT with different installation prefix" ; + } + } + else + { + .initialized = true ; + .prefix = $(prefix) ; + + generators.register-standard qt.moc : H : CPP(moc_%) : qt ; + # Note: the OBJ target type here is fake, take a look + # at qt4.jam/uic-h-generator for explanations that + # apply in this case as well. + generators.register [ new moc-h-generator + qt.moc.cpp : MOCCABLE_CPP : OBJ : qt ] ; + + # The UI type is defined in types/qt.jam, + # and UIC_H is only used in qt.jam, but not in qt4.jam, so + # define it here. + type.register UIC_H : : H ; + + generators.register-standard qt.uic-h : UI : UIC_H : qt ; + + # The following generator is used to convert UI files to CPP + # It creates UIC_H from UI, and constructs CPP from UI/UIC_H + # In addition, it also returns UIC_H target, so that it can bee + # mocced. + class qt::uic-cpp-generator : generator + { + rule __init__ ( ) + { + generator.__init__ qt.uic-cpp : UI UIC_H : CPP : qt ; + } + + rule run ( project name ? : properties * : sources + ) + { + # Consider this: + # obj test : test_a.cpp : off ; + # + # This generator will somehow be called in this case, and, + # will fail -- which is okay. However, if there are + # properties they will be converted to sources, so the size of + # 'sources' will be more than 1. In this case, the base generator + # will just crash -- and that's not good. Just use a quick test + # here. + + local result ; + if ! $(sources[2]) + { + # Construct CPP as usual + result = [ generator.run $(project) $(name) + : $(properties) : $(sources) ] ; + + # If OK, process UIC_H with moc. It's pretty clear that + # the object generated with UIC will have Q_OBJECT macro. + if $(result) + { + local action = [ $(result[1]).action ] ; + local sources = [ $(action).sources ] ; + local mocced = [ generators.construct $(project) $(name) + : CPP : $(properties) : $(sources[2]) ] ; + result += $(mocced[2-]) ; + } + } + + return $(result) ; + } + } + + generators.register [ new qt::uic-cpp-generator ] ; + + # Finally, declare prebuilt target for QT library. + local usage-requirements = + $(.prefix)/include + $(.prefix)/lib + $(.prefix)/lib + qt + ; + lib qt : : qt-mt multi : : $(usage-requirements) ; + lib qt : : qt single : : $(usage-requirements) ; + } +} + +class moc-h-generator : generator +{ + rule __init__ ( * : * ) + { + generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + } + + rule run ( project name ? : property-set : sources * ) + { + if ! $(sources[2]) && [ $(sources[1]).type ] = MOCCABLE_CPP + { + name = [ $(sources[1]).name ] ; + name = $(name:B) ; + + local a = [ new action $(sources[1]) : qt.moc.cpp : + $(property-set) ] ; + + local target = [ + new file-target $(name) : MOC : $(project) : $(a) ] ; + + local r = [ virtual-target.register $(target) ] ; + + # Since this generator will return H target, the linking generator + # won't use it at all, and won't set any dependency on it. + # However, we need to target to be seen by bjam, so that dependency + # from sources to this generated header is detected -- if jam does + # not know about this target, it won't do anything. + DEPENDS all : [ $(r).actualize ] ; + + return $(r) ; + } + } +} + + +# Query the installation directory +# This is needed in at least two scenarios +# First, when re-using sources from the Qt-Tree. +# Second, to "install" custom Qt plugins to the Qt-Tree. +rule directory +{ + return $(.prefix) ; +} + +# -f forces moc to include the processed source file. +# Without it, it would think that .qpp is not a header and would not +# include it from the generated file. +actions moc +{ + $(.prefix)/bin/moc -f $(>) -o $(<) +} + +# When moccing .cpp files, we don't need -f, otherwise generated +# code will include .cpp and we'll get duplicated symbols. +actions moc.cpp +{ + $(.prefix)/bin/moc $(>) -o $(<) +} + + +space = " " ; + +# Sometimes it's required to make 'plugins' available during +# uic invocation. To help with this we add paths to all dependency +# libraries to uic commane line. The intention is that it's possible +# to write +# +# exe a : ... a.ui ... : some_plugin ; +# +# and have everything work. We'd add quite a bunch of unrelated paths +# but it won't hurt. +flags qt.uic-h LIBRARY_PATH ; +actions uic-h +{ + $(.prefix)/bin/uic $(>) -o $(<) -L$(space)$(LIBRARY_PATH) +} + +flags qt.uic-cpp LIBRARY_PATH ; +# The second target is uic-generated header name. It's placed in +# build dir, but we want to include it using only basename. +actions uic-cpp +{ + $(.prefix)/bin/uic $(>[1]) -i $(>[2]:D=) -o $(<) -L$(space)$(LIBRARY_PATH) +} + + From cb5f8fba20d7fbb88dd9cc2d878ad64857316fcb Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:09:18 +0000 Subject: [PATCH 006/154] Don't support QTDIR for Qt4, as Qt4 itself deprecates this environment variable. [SVN r33436] --- src/tools/qt4.jam | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index eb045c29c..2c121cea9 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -49,20 +49,9 @@ project.initialize $(__name__) ; project qt4 ; # Initialized the QT support module. The 'prefix' parameter -# tells where QT is installed. When not given, environmental -# variable QTDIR should be set. -rule init ( prefix ? ) +# tells where QT is installed. +rule init ( prefix ) { - if ! $(prefix) - { - prefix = [ modules.peek : QTDIR ] ; - if ! $(prefix) - { - errors.error - "QT installation prefix not given and QTDIR variable is empty" ; - } - } - if $(.initialized) { if $(prefix) != $(.prefix) From f10aa46a3e529d81239ce68aabb79dc5bea6f0bf Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:14:00 +0000 Subject: [PATCH 007/154] Declare 'dl' target only once, to avoid ambiguity if several python versions are configured. [SVN r33437] --- src/tools/python.jam | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index cd98ce5b3..5ffc48612 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -44,6 +44,11 @@ project python ; # not in whatever project we were called by. .project = [ project.current ] ; +# Dynamic linker lib. Necessary to specify it explicitly +# on some platforms. +lib dl ; + + # Initializes the Python toolset. # - version -- the version of Python to use. Should be in Major.Minor format, # for example 2.3 @@ -119,11 +124,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) else { flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ; - } - - # Dynamic linker lib. Necessary to specify it explicitly - # on some platforms. - lib dl ; + } # On Linux, we don't want to link either Boost.Python or # Python extensions to libpython, so that when extensions From 71c1fbd9804ca79e3e2f055223585cd790039e86 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:16:38 +0000 Subject: [PATCH 008/154] Remove qt.jam as it's moved to qt3.jam. [SVN r33438] --- src/tools/qt.jam | 208 ----------------------------------------------- 1 file changed, 208 deletions(-) delete mode 100644 src/tools/qt.jam diff --git a/src/tools/qt.jam b/src/tools/qt.jam deleted file mode 100644 index a8d8839da..000000000 --- a/src/tools/qt.jam +++ /dev/null @@ -1,208 +0,0 @@ -# Copyright (C) Vladimir Prus 2002. 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 modules ; -import feature ; -import errors ; -import type ; -import "class" : new ; -import generators ; -import project ; -import toolset : flags ; - -# Convert this module into a project, so that we can declare -# targets here. - -project.initialize $(__name__) ; -project qt ; - -# Initialized the QT support module. The 'prefix' parameter -# tells where QT is installed. When not given, environmental -# variable QTDIR should be set. -rule init ( prefix ? ) -{ - if ! $(prefix) - { - prefix = [ modules.peek : QTDIR ] ; - if ! $(prefix) - { - errors.error - "QT installation prefix not given and QTDIR variable is empty" ; - } - } - - if $(.initialized) - { - if $(prefix) != $(.prefix) - { - errors.error - "Attempt the reinitialize QT with different installation prefix" ; - } - } - else - { - .initialized = true ; - .prefix = $(prefix) ; - - generators.register-standard qt.moc : H : CPP(moc_%) : qt ; - # Note: the OBJ target type here is fake, take a look - # at qt4.jam/uic-h-generator for explanations that - # apply in this case as well. - generators.register [ new moc-h-generator - qt.moc.cpp : MOCCABLE_CPP : OBJ : qt ] ; - - # The UI type is defined in types/qt.jam, - # and UIC_H is only used in qt.jam, but not in qt4.jam, so - # define it here. - type.register UIC_H : : H ; - - generators.register-standard qt.uic-h : UI : UIC_H : qt ; - - # The following generator is used to convert UI files to CPP - # It creates UIC_H from UI, and constructs CPP from UI/UIC_H - # In addition, it also returns UIC_H target, so that it can bee - # mocced. - class qt::uic-cpp-generator : generator - { - rule __init__ ( ) - { - generator.__init__ qt.uic-cpp : UI UIC_H : CPP : qt ; - } - - rule run ( project name ? : properties * : sources + ) - { - # Consider this: - # obj test : test_a.cpp : off ; - # - # This generator will somehow be called in this case, and, - # will fail -- which is okay. However, if there are - # properties they will be converted to sources, so the size of - # 'sources' will be more than 1. In this case, the base generator - # will just crash -- and that's not good. Just use a quick test - # here. - - local result ; - if ! $(sources[2]) - { - # Construct CPP as usual - result = [ generator.run $(project) $(name) - : $(properties) : $(sources) ] ; - - # If OK, process UIC_H with moc. It's pretty clear that - # the object generated with UIC will have Q_OBJECT macro. - if $(result) - { - local action = [ $(result[1]).action ] ; - local sources = [ $(action).sources ] ; - local mocced = [ generators.construct $(project) $(name) - : CPP : $(properties) : $(sources[2]) ] ; - result += $(mocced[2-]) ; - } - } - - return $(result) ; - } - } - - generators.register [ new qt::uic-cpp-generator ] ; - - # Finally, declare prebuilt target for QT library. - local usage-requirements = - $(.prefix)/include - $(.prefix)/lib - $(.prefix)/lib - qt - ; - lib qt : : qt-mt multi : : $(usage-requirements) ; - lib qt : : qt single : : $(usage-requirements) ; - } -} - -class moc-h-generator : generator -{ - rule __init__ ( * : * ) - { - generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; - } - - rule run ( project name ? : property-set : sources * ) - { - if ! $(sources[2]) && [ $(sources[1]).type ] = MOCCABLE_CPP - { - name = [ $(sources[1]).name ] ; - name = $(name:B) ; - - local a = [ new action $(sources[1]) : qt.moc.cpp : - $(property-set) ] ; - - local target = [ - new file-target $(name) : MOC : $(project) : $(a) ] ; - - local r = [ virtual-target.register $(target) ] ; - - # Since this generator will return H target, the linking generator - # won't use it at all, and won't set any dependency on it. - # However, we need to target to be seen by bjam, so that dependency - # from sources to this generated header is detected -- if jam does - # not know about this target, it won't do anything. - DEPENDS all : [ $(r).actualize ] ; - - return $(r) ; - } - } -} - - -# Query the installation directory -# This is needed in at least two scenarios -# First, when re-using sources from the Qt-Tree. -# Second, to "install" custom Qt plugins to the Qt-Tree. -rule directory -{ - return $(.prefix) ; -} - -# -f forces moc to include the processed source file. -# Without it, it would think that .qpp is not a header and would not -# include it from the generated file. -actions moc -{ - $(.prefix)/bin/moc -f $(>) -o $(<) -} - -# When moccing .cpp files, we don't need -f, otherwise generated -# code will include .cpp and we'll get duplicated symbols. -actions moc.cpp -{ - $(.prefix)/bin/moc $(>) -o $(<) -} - - -space = " " ; - -# Sometimes it's required to make 'plugins' available during -# uic invocation. To help with this we add paths to all dependency -# libraries to uic commane line. The intention is that it's possible -# to write -# -# exe a : ... a.ui ... : some_plugin ; -# -# and have everything work. We'd add quite a bunch of unrelated paths -# but it won't hurt. -flags qt.uic-h LIBRARY_PATH ; -actions uic-h -{ - $(.prefix)/bin/uic $(>) -o $(<) -L$(space)$(LIBRARY_PATH) -} - -flags qt.uic-cpp LIBRARY_PATH ; -# The second target is uic-generated header name. It's placed in -# build dir, but we want to include it using only basename. -actions uic-cpp -{ - $(.prefix)/bin/uic $(>[1]) -i $(>[2]:D=) -o $(<) -L$(space)$(LIBRARY_PATH) -} - - From 55008084b318c0470aaadc841fe46c0c49ba2273 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:21:28 +0000 Subject: [PATCH 009/154] Add forwarding qt.jam. [SVN r33439] --- src/tools/qt.jam | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/tools/qt.jam diff --git a/src/tools/qt.jam b/src/tools/qt.jam new file mode 100644 index 000000000..ab29f9357 --- /dev/null +++ b/src/tools/qt.jam @@ -0,0 +1,17 @@ +# Copyright (c) 2006 Vladimir Prus. +# +# 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) + +# Forwarning toolset file to Qt GUI library. Forwards to the toolset file +# for the current version of Qt. + +import qt4 ; + +rule init ( prefix ? ) +{ + qt4.init $(prefix) ; +} + + From 01447a62c3b5b2ccdb359519a0c8a8eda4cc42c2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 14:13:43 +0000 Subject: [PATCH 010/154] Make dependents of Python link to 'util' library on Unix. [SVN r33440] --- src/tools/python.jam | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 5ffc48612..e28734979 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -46,7 +46,10 @@ project python ; # Dynamic linker lib. Necessary to specify it explicitly # on some platforms. -lib dl ; +lib dl ; +# This contains 'openpty' function need by python. Again, on +# some system need to pass this to linker explicitly. +lib util ; # Initializes the Python toolset. @@ -140,7 +143,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) ; alias python - : dl + : dl util : $(condition) : : $(includes) From 8365dbd676c07eac60677cb31f42d397c80bffa1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 14:28:39 +0000 Subject: [PATCH 011/154] Don't append lib paths for all gcc version to a single RUN_PATH. [SVN r33441] --- src/tools/gcc.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 24c4111f5..1ead6c8f8 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -65,7 +65,7 @@ rule init ( version ? : command * : options * ) { local path = [ common.get-absolute-tool-path $(command[-1]) ] ; local lib_path = $(path:D)/lib ; - flags gcc.link RUN_PATH : $(lib_path) ; + flags gcc.link RUN_PATH $(condition) : $(lib_path) ; } From 84652e1dfe3690275873e04d685d81d35712eaf3 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 15:10:27 +0000 Subject: [PATCH 012/154] Use project name 'qt' for Qt4 and 'qt3' for Qt3. [SVN r33442] --- src/tools/qt3.jam | 2 +- src/tools/qt4.jam | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qt3.jam b/src/tools/qt3.jam index dba571092..8bae89e5e 100644 --- a/src/tools/qt3.jam +++ b/src/tools/qt3.jam @@ -21,7 +21,7 @@ import toolset : flags ; # targets here. project.initialize $(__name__) ; -project qt ; +project qt3 ; # Initialized the QT support module. The 'prefix' parameter # tells where QT is installed. When not given, environmental diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index 2c121cea9..4b5a2888d 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -46,7 +46,7 @@ import os ; import virtual-target ; project.initialize $(__name__) ; -project qt4 ; +project qt ; # Initialized the QT support module. The 'prefix' parameter # tells where QT is installed. From e30e52e60e24d6f7d973d70bf4f5d2d28d27a9b7 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 23 Mar 2006 08:35:37 +0000 Subject: [PATCH 013/154] Allow to explicitly specify root, in case where we have trouble auto-detecting it from the compiler name. [SVN r33453] --- src/tools/gcc.jam | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 1ead6c8f8..28ad9c0ae 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -17,6 +17,12 @@ import set ; import common ; import errors ; +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} + + feature.extend toolset : gcc ; import unix ; @@ -28,7 +34,6 @@ generators.override gcc.prebuilt : builtin.prebuilt ; generators.override gcc.searched-lib-generator : searched-lib-generator ; - # Make the "o" suffix used for gcc toolset on all # platforms type.set-generated-target-suffix OBJ : gcc : o ; @@ -60,11 +65,21 @@ rule init ( version ? : command * : options * ) # If gcc is installed in non-standard location, we'd need to # add LD_LIBRARY_PATH when running programs created with it - # (for unit-test/run rules). + # (for unit-test/run rules). if $(command) { - local path = [ common.get-absolute-tool-path $(command[-1]) ] ; - local lib_path = $(path:D)/lib ; + local root = [ feature.get-values : $(options) ] ; + if ! $(root) + { + root = [ common.get-absolute-tool-path $(command[-1]) ] ; + root = $(root:D) ; + } + local lib_path = $(root)/lib ; + if $(.debug-configuration) + { + ECHO "notice: gcc lib directory for version" $(condition) ; + ECHO "notice: is" $(lib_path) ; + } flags gcc.link RUN_PATH $(condition) : $(lib_path) ; } From a29731a37466f7f77ad01d288457d9ea202e6f50 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 25 Mar 2006 16:28:19 +0000 Subject: [PATCH 014/154] Add missing "undef" feature. It's used in plenty of places but was never defined. [SVN r33473] --- src/tools/builtin.jam | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/builtin.jam b/src/tools/builtin.jam index aed2e997c..4e1bba72e 100644 --- a/src/tools/builtin.jam +++ b/src/tools/builtin.jam @@ -50,6 +50,7 @@ feature asynch-exceptions : off on : propagated ; feature extern-c-nothrow : off on : propagated ; feature debug-symbols : on off : propagated ; feature define : : free ; +feature undef : : free ; feature "include" : : free path ; #order-sensitive ; feature cflags : : free ; feature cxxflags : : free ; From a0b73d1f2622cc377f1c487efaad94185736c70c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 26 Mar 2006 06:26:01 +0000 Subject: [PATCH 015/154] Add RmTemps, which is the really quite version of Clean. [SVN r33474] --- src/tools/common.jam | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tools/common.jam b/src/tools/common.jam index c5bbd4294..06d66366d 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -387,8 +387,9 @@ rule get-program-files-dir ( ) if [ os.name ] = NT { - RM = del /f ; + RM = del /f /q ; CP = copy ; + IGNORE = "2>nul >nul & setlocal" ; } else { @@ -546,6 +547,14 @@ actions copy $(CP) "$(>)" "$(<)" } +rule RmTemps +{ +} +actions quietly updated piecemeal together RmTemps +{ + $(RM) "$(>)" $(IGNORE) +} + rule __test__ ( ) { import assert ; From 6934ddd4202f488c43516100cad3e217a1154868 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 26 Mar 2006 06:28:51 +0000 Subject: [PATCH 016/154] Fixes for MinGW compilation. * Configuration prefers using the AR in the compiler specific bin dir. * Fix pre-delete of archives so it uses it's own action, and hence allows the archive action to be a single command. * That fixes the problem of command line limits on the CMD shell, for archives that have many source files. [SVN r33475] --- src/tools/gcc.jam | 71 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 28ad9c0ae..6a05c9e6a 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -63,27 +63,38 @@ rule init ( version ? : command * : options * ) } init-link-flags gcc $(linker) $(condition) ; + local root = [ feature.get-values : $(options) ] ; + local bin ; + if $(command) + { + bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ; + root ?= $(bin:D) ; + } + # If gcc is installed in non-standard location, we'd need to # add LD_LIBRARY_PATH when running programs created with it # (for unit-test/run rules). if $(command) { - local root = [ feature.get-values : $(options) ] ; - if ! $(root) - { - root = [ common.get-absolute-tool-path $(command[-1]) ] ; - root = $(root:D) ; - } local lib_path = $(root)/lib ; if $(.debug-configuration) { - ECHO "notice: gcc lib directory for version" $(condition) ; - ECHO "notice: is" $(lib_path) ; + ECHO notice: using gcc libraries :: $(condition) :: $(lib_path) ; } flags gcc.link RUN_PATH $(condition) : $(lib_path) ; } - + #~ If it's not a system gcc install we should adjust the various + #~ programs as needed to prefer using the install specific versions. + #~ This is essential for correct use of MinGW and for cross-compiling. + local archiver = + [ common.get-invocation-command gcc + : ar : [ feature.get-values : $(options) ] : $(bin) : PATH ] ; + flags gcc.archive .AR $(condition) : $(archiver[1]) ; + if $(.debug-configuration) + { + ECHO notice: using gcc archiver :: $(condition) :: $(archiver[1]) ; + } } if [ os.name ] = NT @@ -338,21 +349,38 @@ actions link bind LIBRARIES } -# 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 -RM = [ common.rm-command ] ; +flags gcc.archive AROPTIONS ; -if [ os.name ] = NT +rule archive ( targets * : sources * : properties * ) { - RM = "if exist \"$(<[1])\" DEL \"$(<[1])\"" ; + # 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 + # + # Rene Rivera: + # + # Originally removing the archive was done by splicing an RM + # onto the archive action. That makes archives fail to build on NT + # when they have many files because it will no longer execute the + # action directly and blow the line length limit. Instead we + # remove the file in a different action, just before the building + # of the archive. + # + local clean.a = $(targets[1])(clean) ; + TEMPORARY $(clean.a) ; + NOCARE $(clean.a) ; + LOCATE on $(clean.a) = [ on $(targets[1]) return $(LOCATE) ] ; + DEPENDS $(clean.a) : $(sources) ; + DEPENDS $(targets) : $(clean.a) ; + common.RmTemps $(clean.a) : $(targets) ; } - # 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 @@ -362,8 +390,7 @@ if [ os.name ] = NT # some platforms, for whatever reasons. actions piecemeal archive { - $(RM) "$(<)" - ar rc "$(<)" "$(>)" + "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)" } From ad99b23a0bf2c7e06011e6b735b7697513374177 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 27 Mar 2006 03:28:19 +0000 Subject: [PATCH 017/154] Fix missing var expansion in error message about conflicting properties. [SVN r33482] --- src/build/feature.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/feature.jam b/src/build/feature.jam index b2cfd7cd0..e6ad37f35 100644 --- a/src/build/feature.jam +++ b/src/build/feature.jam @@ -658,7 +658,7 @@ rule expand-composites ( properties * ) error explicitly-specified values of non-free feature $(f) conflict : "existing values:" [ get-values $(f) : $(properties) ] : - "value from expanding " $(p) ":" (x:G=) ; + "value from expanding " $(p) ":" $(x:G=) ; } else { From 0b918c04ba2a7fb474f376d9f30537dcfcb8fe88 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 28 Mar 2006 13:26:31 +0000 Subject: [PATCH 018/154] Unbreak Qt3. Patch from Jurgen Hunold. [SVN r33503] --- src/tools/qt3.jam | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/qt3.jam b/src/tools/qt3.jam index 8bae89e5e..4148f9422 100644 --- a/src/tools/qt3.jam +++ b/src/tools/qt3.jam @@ -51,19 +51,19 @@ rule init ( prefix ? ) .initialized = true ; .prefix = $(prefix) ; - generators.register-standard qt.moc : H : CPP(moc_%) : qt ; + generators.register-standard qt3.moc : H : CPP(moc_%) : qt ; # Note: the OBJ target type here is fake, take a look # at qt4.jam/uic-h-generator for explanations that # apply in this case as well. generators.register [ new moc-h-generator - qt.moc.cpp : MOCCABLE_CPP : OBJ : qt ] ; + qt3.moc.cpp : MOCCABLE_CPP : OBJ : qt ] ; # The UI type is defined in types/qt.jam, # and UIC_H is only used in qt.jam, but not in qt4.jam, so # define it here. type.register UIC_H : : H ; - generators.register-standard qt.uic-h : UI : UIC_H : qt ; + generators.register-standard qt3.uic-h : UI : UIC_H : qt ; # The following generator is used to convert UI files to CPP # It creates UIC_H from UI, and constructs CPP from UI/UIC_H @@ -73,7 +73,7 @@ rule init ( prefix ? ) { rule __init__ ( ) { - generator.__init__ qt.uic-cpp : UI UIC_H : CPP : qt ; + generator.__init__ qt3.uic-cpp : UI UIC_H : CPP : qt ; } rule run ( project name ? : properties * : sources + ) @@ -139,7 +139,7 @@ class moc-h-generator : generator name = [ $(sources[1]).name ] ; name = $(name:B) ; - local a = [ new action $(sources[1]) : qt.moc.cpp : + local a = [ new action $(sources[1]) : qt3.moc.cpp : $(property-set) ] ; local target = [ @@ -196,13 +196,13 @@ space = " " ; # # and have everything work. We'd add quite a bunch of unrelated paths # but it won't hurt. -flags qt.uic-h LIBRARY_PATH ; +flags qt3.uic-h LIBRARY_PATH ; actions uic-h { $(.prefix)/bin/uic $(>) -o $(<) -L$(space)$(LIBRARY_PATH) } -flags qt.uic-cpp LIBRARY_PATH ; +flags qt3.uic-cpp LIBRARY_PATH ; # The second target is uic-generated header name. It's placed in # build dir, but we want to include it using only basename. actions uic-cpp From 316a8103b984f2ba6d14832b58afcd1f48624c7d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 29 Mar 2006 11:05:05 +0000 Subject: [PATCH 019/154] Set LD_LIBRARY_PATH when running tests built with intel-linux. [SVN r33515] --- src/tools/intel-linux.jam | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index e33b601a2..ea1eec3ff 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -43,7 +43,24 @@ rule init ( version ? : command * : options * ) common.handle-options intel-linux : $(condition) : $(command) : $(options) ; gcc.init-link-flags intel-linux gnu $(condition) ; - + + local root = [ feature.get-values : $(options) ] ; + local bin ; + if $(command) + { + bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ; + root ?= $(bin:D) ; + + if $(command) + { + local lib_path = $(root)/lib ; + if $(.debug-configuration) + { + ECHO notice: using intel libraries :: $(condition) :: $(lib_path) ; + } + flags intel-linux.link RUN_PATH $(condition) : $(lib_path) ; + } + } } SPACE = " " ; From e32ee364245bc24461cf1ee9e70b5570f7c99413 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 29 Mar 2006 11:42:04 +0000 Subject: [PATCH 020/154] Fix rpath and strip for OFS linker. [SVN r33519] --- src/tools/gcc.jam | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 6a05c9e6a..4e6551125 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -59,7 +59,15 @@ rule init ( version ? : command * : options * ) local linker = [ feature.get-values : $(options) ] ; if ! $(linker) { - linker = gnu ; + + if [ os.name ] = OSF + { + linker = osf ; + } + else + { + linker = gnu ; + } } init-link-flags gcc $(linker) $(condition) ; @@ -303,6 +311,19 @@ rule init-link-flags ( toolset linker condition ) flags $(toolset).link RPATH $(condition) : : unchecked ; flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; } + + case osf : + { + # No --strip-all, just -s + flags $(toolset).link OPTIONS $(condition)/off : -Wl,-s + : unchecked ; + + flags $(toolset).link RPATH $(condition) : : unchecked ; + # This does not supports -R + flags $(toolset).link RPATH_OPTION $(condition) : -rpath : unchecked ; + # -rpath-link is not supported at all. + } + case sun : { @@ -345,7 +366,7 @@ rule link ( targets * : sources * : properties * ) 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) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) } @@ -403,7 +424,7 @@ rule link.dll ( targets * : sources * : properties * ) # 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,$(SONAME_OPTION)$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) } # Set up threading support. It's somewhat contrived, so perform it at the end, From 20065dfe2131dd65f528f0f812520b78ee625f65 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 29 Mar 2006 15:20:08 +0000 Subject: [PATCH 021/154] Fix LD_LIBRARY_PATH setting for 64-bit gcc. [SVN r33521] --- src/tools/gcc.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 4e6551125..0ec3f24ec 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -84,7 +84,12 @@ rule init ( version ? : command * : options * ) # (for unit-test/run rules). if $(command) { - local lib_path = $(root)/lib ; + # On multilib 64-bit boxes, there are both 32-bit and 64-bit + # libraries and all must be added to LD_LIBRARY_PATH. The linker + # will pick the right onces. + # Note that we don't provide a clean way to build 32-bit binary + # with 64-bit compiler, but user can always pass -m32 manually. + local lib_path = $(root)/lib $(root)/lib32 $(root)/lib64 ; if $(.debug-configuration) { ECHO notice: using gcc libraries :: $(condition) :: $(lib_path) ; From 997b0f87db652f151a41dd323703f5951c3d230d Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 4 Apr 2006 23:16:13 +0000 Subject: [PATCH 022/154] Add support for STLport 5.x release. [SVN r33531] --- src/tools/stlport.jam | 155 ++++++++++++++++++++++++++---------------- 1 file changed, 97 insertions(+), 58 deletions(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index a9db490d3..f70c7407d 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -1,5 +1,6 @@ -# (C) Copyright Gennadiy Rozental 2002. -# (C) Copyright Vladimir Prus 2003. +# (C) Copyright Gennadiy Rozental 2002. +# (C) Copyright Vladimir Prus 2003. +# (C) Copyright Rene Rivera 2006. # Permission to copy, use, # modify, sell and distribute this software is granted provided this # copyright notice appears in all copies. This software is provided @@ -22,7 +23,7 @@ # on used toolset. # Also, finish various flags: # -# This is copied from V1 toolset, "+" means "impelemnted" +# This is copied from V1 toolset, "+" means "implemented" #+flags $(CURR_TOOLSET) DEFINES off : _STLP_NO_OWN_IOSTREAMS=1 _STLP_HAS_NO_NEW_IOSTREAMS=1 ; #+flags $(CURR_TOOLSET) DEFINES off : _STLP_NO_EXTENSIONS=1 ; # flags $(CURR_TOOLSET) DEFINES off : _STLP_NO_ANACHRONISMS=1 ; @@ -37,7 +38,7 @@ import feature : feature subfeature ; import project ; import "class" : new ; import targets ; -import property-set ; +import property-set ; import common ; # Make this module into a project. @@ -68,7 +69,7 @@ subfeature stdlib stlport : extensions : noext : optional propagated ; # STLport debug allocation -- NOT YET SUPPORTED #subfeature stdlib stlport : debug-alloc : off on ; -# Declare a special target class to handle the creation of search-lib-target +# Declare a special target class to handle the creation of search-lib-target # instances for STLport. We need a special class, because otherwise we'll have # - declare prebuilt targets for all possible toolsets. And by the time 'init' # is called we don't even know the list of toolsets that are registered @@ -78,16 +79,17 @@ subfeature stdlib stlport : extensions : noext : optional propagated ; class stlport-target-class : basic-target { import feature project type errors generators ; - import set : difference ; - - rule __init__ ( project : headers ? : libraries ? : version ? ) + import set : difference ; + + rule __init__ ( project : headers ? : libraries + : version ? ) { basic-target.__init__ stlport : $(project) ; self.headers = $(headers) ; self.libraries = $(libraries) ; self.version = $(version) ; + self.version.5 = [ MATCH "^(5[.][^.]+).*" : $(version) ] ; } - + rule match ( property-set ) { # Override the rule which detects if this basic-target is @@ -97,29 +99,39 @@ class stlport-target-class : basic-target # requirements, but then stlport-$(version) would show in # the common properties, causing recursive building of ourselfs. + local matched ; if [ $(property-set).get ] = $(self.version) { - return stlport-$(self.version) ; - } - else - { - return no-match ; + if $(self.version.5) + { + # And for STLport 5.x multi-threading is required. + if [ $(property-set).get ] = multi + { + matched = stlport-$(self.version) ; + } + } + else + { + matched = stlport-$(self.version) ; + } } + matched ?= no-match ; + + return $(matched) ; } - + rule generate ( property-set ) { # Since this target is built with stlport, it will also # have /stlport//stlport in requirements, which will # cause a loop in main target references. Remove that property # manually. - + property-set = [ property-set.create [ difference [ $(property-set).raw ] : /stlport//stlport stlport ] ] ; return [ basic-target.generate $(property-set) ] ; } - - + rule construct ( name : source-targets * : property-set ) { # Deduce the name of stlport library, based on toolset and @@ -128,96 +140,123 @@ class stlport-target-class : basic-target local hostios = [ feature.get-values : $(raw) ] ; local toolset = [ feature.get-values : $(raw) ] ; - - # We don't need libraries if host istreams are used. For - # msvc, automatic library selection will be used. - if ! $(hostios) && $(toolset) != msvc - { - local debug = [ feature.get-values : $(raw) ] ; + if $(self.version.5) + { + # Version 5.x + # STLport host IO streams no longer supported. So we always + # need libraries. + + # name: stlport(stl)?[dg]?.M.R + local name = stlport ; + if [ feature.get-values : $(raw) ] = "on" + { + name += stl ; + switch $(toolset) + { + case gcc* : name += g ; + case darwin* : name += g ; + case * : name += d ; + } + } + name += .$(self.version.5) ; + + return [ generators.construct + $(self.project) $(name:J=) : SEARCHED_LIB : $(property-set) ] ; + } + else if ! $(hostios) && $(toolset) != msvc + { + # We don't need libraries if host istreams are used. For + # msvc, automatic library selection will be used. + + # name: stlport_(_stldebug)? local name = stlport ; name = $(name)_$(toolset) ; - if $(debug) = "on" + if [ feature.get-values : $(raw) ] = "on" { name = $(name)_stldebug ; } - - return [ generators.construct $(self.project) $(name) : SEARCHED_LIB - : $(property-set) ] ; + + return [ generators.construct + $(self.project) $(name) : SEARCHED_LIB : $(property-set) ] ; } else { return [ property-set.empty ] ; - } + } } - + rule compute-usage-requirements ( subvariant ) { - local usage-requirements ; - usage-requirements += - $(self.headers) - $(self.libraries) - $(self.libraries) - ; - + local usage-requirements = + $(self.headers) + $(self.libraries) + $(self.libraries) + ; + local rproperties = [ $(subvariant).build-properties ] ; # CONSIDER: should this "if" sequence be replaced with # some use of 'property-map' class? if [ $(rproperties).get ] = "on" { - usage-requirements += _STLP_DEBUG=1 - _STLP_DEBUG_UNINITIALIZED=1 ; + usage-requirements += + _STLP_DEBUG=1 + _STLP_DEBUG_UNINITIALIZED=1 ; } - if [ $(rproperties).get ] = "on" + if [ $(rproperties).get ] = "on" { - usage-requirements += _STLP_USE_DYNAMIC_LIB=1 ; + usage-requirements += + _STLP_USE_DYNAMIC_LIB=1 ; } if [ $(rproperties).get ] = noext { - usage-requirements += _STLP_NO_EXTENSIONS=1 ; + usage-requirements += + _STLP_NO_EXTENSIONS=1 ; } if [ $(rproperties).get ] = hostios { - usage-requirements += _STLP_NO_OWN_IOSTREAMS=1 - _STLP_HAS_NO_NEW_IOSTREAMS=1 ; + usage-requirements += + _STLP_NO_OWN_IOSTREAMS=1 + _STLP_HAS_NO_NEW_IOSTREAMS=1 ; } - + return [ property-set.create $(usage-requirements) ] ; - } + } } -rule stlport-target ( headers ? : libraries ? : version ? ) +rule stlport-target ( headers ? : libraries + : version ? ) { local project = [ project.current ] ; - + targets.main-target-alternative - [ new stlport-target-class $(project) : $(headers) : $(libraries) + [ new stlport-target-class $(project) : $(headers) : $(libraries) : $(version) ] ; } local .version-subfeature-defined ; -# Initialize stlport support. -rule init ( version ? : - headers # Location of header files - libraries ? # Location of libraries - ) +# Initialize stlport support. +rule init ( + version ? : + headers # Location of header files + libraries * # Location of libraries, lib and bin subdirs of STLport. + ) { # FIXME: need to use common.check-init-parameters here. # At the moment, that rule always tries to define subfeature # of the 'toolset' feature, while we need to define subfeature # of stlport, so tweaks to check-init-parameters are needed. if $(version) - { + { if ! $(.version-subfeature-defined) - { + { feature.subfeature stdlib stlport : version : : propagated ; .version-subfeature-defined = true ; - } + } feature.extend-subfeature stdlib stlport : version : $(version) ; } - + # Declare the main target for this STLPort version. stlport-target $(headers) : $(libraries) : $(version) ; } From aaf31f754fef09e8afe1d6417ffbf63d530eeb7a Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 4 Apr 2006 23:17:43 +0000 Subject: [PATCH 023/154] Fix building with intel-win32 toolset, it was missing linking to some of the system DLLs. [SVN r33532] --- src/engine/build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/build.jam b/src/engine/build.jam index 8698efe57..eb066f1b4 100644 --- a/src/engine/build.jam +++ b/src/engine/build.jam @@ -177,7 +177,7 @@ toolset intel-win32 icl : /Fe : -D [ opt --release : /ML /O2 /Ob2 /Gy /GF /GA /GB ] [ opt --debug : /MLd /DEBUG /Z7 /Od /Ob0 ] -I$(--python-include) - : $(--python-lib[1]) ; + : kernel32.lib advapi32.lib $(--python-lib[1]) ; ## KCC ? toolset kcc KCC : "-o " : -D : From 6187be22dd906652d50723308b265e4137f13858 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 5 Apr 2006 05:36:52 +0000 Subject: [PATCH 024/154] Add support for toolset specific resource compiler tool. Make gcc toolset configure a resource compiler if available, and optionally can be user configured. This allows the use of RC files with MinGW and CYGWIN. MSVC minor adjustment to changed name of RC rule. [SVN r33539] --- src/tools/gcc.jam | 12 ++++++++ src/tools/msvc.jam | 2 +- src/tools/rc.jam | 74 ++++++++++++++++++++++++++++------------------ 3 files changed, 59 insertions(+), 29 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 0ec3f24ec..8200a077b 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -39,6 +39,7 @@ generators.override gcc.searched-lib-generator : searched-lib-generator ; type.set-generated-target-suffix OBJ : gcc : o ; type.set-generated-target-suffix STATIC_LIB : gcc : a ; +import rc ; # Initializes the gcc toolset for the given version. # If necessary, command may be used to specify where the compiler @@ -100,6 +101,8 @@ rule init ( version ? : command * : options * ) #~ If it's not a system gcc install we should adjust the various #~ programs as needed to prefer using the install specific versions. #~ This is essential for correct use of MinGW and for cross-compiling. + + #~ - The archive builder. local archiver = [ common.get-invocation-command gcc : ar : [ feature.get-values : $(options) ] : $(bin) : PATH ] ; @@ -108,6 +111,15 @@ rule init ( version ? : command * : options * ) { ECHO notice: using gcc archiver :: $(condition) :: $(archiver[1]) ; } + + #~ - The resource compiler. + local rc = + [ common.get-invocation-command gcc + : windres : [ feature.get-values : $(options) ] : $(bin) : PATH ] ; + local rc-type = + [ feature.get-values : $(options) ] ; + rc-type ?= windres ; + rc.configure $(rc) : $(condition) : $(rc-type) ; } if [ os.name ] = NT diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 7eabfadf5..f8fc21b7d 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -500,7 +500,7 @@ generators.register-c-compiler msvc.compile.c : C : OBJ : msvc ; # Using 'register-c-compiler' adds the build directory to INCLUDES generators.register-c-compiler msvc.compile.rc : RC : OBJ(%_res) : msvc ; -generators.override msvc.compile.rc : rc.resource-compile ; +generators.override msvc.compile.rc : rc.compile.resource ; generators.register-standard msvc.compile.asm : ASM : OBJ : msvc ; generators.register-c-compiler msvc.compile.idl : IDL : MSTYPELIB H C(%_i) C(%_proxy) C(%_dlldata) : msvc ; diff --git a/src/tools/rc.jam b/src/tools/rc.jam index 388e40858..1929b1564 100644 --- a/src/tools/rc.jam +++ b/src/tools/rc.jam @@ -2,12 +2,24 @@ # 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) 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) import type ; import generators ; import feature ; import errors ; import scanner ; +import toolset : flags ; + +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} type.register RC : rc ; @@ -15,40 +27,50 @@ rule init ( ) { } -rule resource-compile ( target : sources * : properties * ) +# Configures a new resource compilation command specific to a condition, +# usually a toolset selection condition. The possible options are: +# +# * (rc|windres) - Indicates the type of options the command +# accepts. +# +# Even though the arguments are all optional, only when a command, condition, +# and at minimum the rc-type option are given will the command be configured. +# This is so that callers don't have to check auto-configuration values +# before calling this. And still get the functionality of build failures when +# the resource compiler can't be found. +# +rule configure ( command ? : condition ? : options * ) { - local OS = [ feature.get-values : $(properties) ] ; - switch $(OS) + local rc-type = [ feature.get-values : $(options) ] ; + + if $(command) && $(condition) && $(rc-type) { - case "NT" : - resource-compile-nt $(target) : $(sources[1]) ; - case "CYGWIN" : - resource-compile-cygwin $(target) : $(sources[1]) ; - case "FREEBSD" : - create-empty-object $(target) : $(sources[1]) ; - case "SOLARIS" : - create-empty-object $(target) : $(sources[1]) ; - case "KFREEBSD" : - create-empty-object $(target) : $(sources[1]) ; - case "LINUX" : - create-empty-object $(target) : $(sources[1]) ; - case "*" : - errors.error "Cannot process RC files for OS=$(OS)" ; + flags rc.compile.resource .RC $(condition) : $(command) ; + flags rc.compile.resource .RC_TYPE $(condition) : $(rc-type:L) ; + if $(.debug-configuration) + { + ECHO notice: using rc compiler :: $(condition) :: $(command) ; + } } } - -actions quietly resource-compile-nt +rule compile.resource ( target : sources * : properties * ) { - rc /i "$(>:D)" /i "$(<:D)" /fo "$(<)" "$(>)" + local rc-type = [ on $(target) return $(.RC_TYPE) ] ; + compile.resource.$(rc-type) $(target) : $(sources[1]) ; } -actions quietly resource-compile-cygwin +actions compile.resource.rc { - windres --include-dir "$(>:D)" -o "$(<)" -i "$(>)" + "$(.RC)" -l 0x409 "-U$(UNDEFS)" "-D$(DEFINES)" -I"$(>:D)" -I"$(<:D)" -I"$(INCLUDES)" -fo "$(<)" "$(>)" } -actions quietly create-empty-object +actions compile.resource.windres +{ + "$(.RC)" "-U$(UNDEFS)" "-D$(DEFINES)" -I"$(>:D)" -I"$(<:D)" -I"$(INCLUDES)" -o "$(<)" -i "$(>)" +} + +actions quietly compile.resource.null { as /dev/null -o "$(<)" } @@ -62,7 +84,7 @@ actions quietly create-empty-object # See http://article.gmane.org/gmane.comp.lib.boost.build/5643/ # # Using 'register-c-compiler' adds the build directory to INCLUDES -generators.register-c-compiler rc.resource-compile : RC : OBJ(%_res) ; +generators.register-c-compiler rc.compile.resource : RC : OBJ(%_res) ; # Register scanner for resources class res-scanner : scanner @@ -129,7 +151,3 @@ class res-scanner : scanner scanner.register res-scanner : include ; type.set-scanner RC : res-scanner ; - - - - From 9e24c0ecd20b8cefbaaf85e09e152451f2fcf323 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 5 Apr 2006 07:10:36 +0000 Subject: [PATCH 025/154] Disable various frontend options that seem to cause ICE's with intel 9.0. [SVN r33542] --- src/tools/intel-win.jam | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tools/intel-win.jam b/src/tools/intel-win.jam index 1d24755cc..cfe82b284 100644 --- a/src/tools/intel-win.jam +++ b/src/tools/intel-win.jam @@ -117,11 +117,15 @@ rule init ( version ? : # the compiler version { C++FLAGS += -Qoption,cpp,--arg_dep_lookup - -Qoption,cpp,--const_string_literals - -Qoption,cpp,--new_for_init - -Qoption,cpp,--no_implicit_typename - -Qoption,cpp,--no_friend_injection - -Qoption,cpp,--no_microsoft_bugs + # 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. + # -Qoption,cpp,--const_string_literals + # -Qoption,cpp,--new_for_init + # -Qoption,cpp,--no_implicit_typename + # -Qoption,cpp,--no_friend_injection + # -Qoption,cpp,--no_microsoft_bugs ; } From 117f001882a1e0843074703bb14ac48d78a07eb9 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 5 Apr 2006 08:33:09 +0000 Subject: [PATCH 026/154] --debug-configuration works for intel-linux.jam [SVN r33547] --- src/tools/intel-linux.jam | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index ea1eec3ff..8a69cefc3 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -27,7 +27,12 @@ toolset.inherit-flags intel-linux : gcc : off on full space off all on ; - + +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} + # Initializes the intel-linux toolset # version in mandatory # name (default icc) is used to invoke the specified intellinux complier @@ -46,12 +51,12 @@ rule init ( version ? : command * : options * ) local root = [ feature.get-values : $(options) ] ; local bin ; - if $(command) + if $(command) || $(root) { bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ; root ?= $(bin:D) ; - if $(command) + if $(root) { local lib_path = $(root)/lib ; if $(.debug-configuration) From 55da156d99ba47a8ad07d908b285a5d1a32c30d6 Mon Sep 17 00:00:00 2001 From: Stefan Slapeta Date: Wed, 5 Apr 2006 11:19:34 +0000 Subject: [PATCH 027/154] Added necessary systems libraries for intel-win32 [SVN r33552] --- src/engine/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/build.bat b/src/engine/build.bat index 19d40df5e..7850eff5c 100644 --- a/src/engine/build.bat +++ b/src/engine/build.bat @@ -298,7 +298,7 @@ if "_%BOOST_JAM_TOOLSET%_" == "_gcc-nocygwin_" ( set _known_=1 ) if "_%BOOST_JAM_TOOLSET%_" == "_intel-win32_" ( - set BOOST_JAM_CC=icl -DNT /nologo + set BOOST_JAM_CC=icl -DNT /nologo kernel32.lib advapi32.lib set BOOST_JAM_OPT_JAM=/Febootstrap\jam0 set BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0 set BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0 From 7caae4d9f5e1e67f7c71383051df9962553dbd94 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 7 Apr 2006 00:48:49 +0000 Subject: [PATCH 028/154] Per ticket #81 . Use start/end-group options of the GNU linker to allow for cyclic dependencies in libraries. [SVN r33575] --- src/tools/gcc.jam | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 8200a077b..824e79443 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -317,6 +317,8 @@ rule init-link-flags ( toolset linker condition ) : unchecked ; flags $(toolset).link RPATH $(condition) : : unchecked ; flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; + flags $(toolset).link START-GROUP $(condition) : -Wl,--start-group : unchecked ; + flags $(toolset).link END-GROUP $(condition) : -Wl,--end-group : unchecked ; } case darwin : { @@ -383,7 +385,7 @@ rule link ( targets * : sources * : properties * ) actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } @@ -441,7 +443,7 @@ rule link.dll ( targets * : sources * : properties * ) # Differ from 'link' above only by -shared. actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } # Set up threading support. It's somewhat contrived, so perform it at the end, From 91b01acc3bb16058f06a357727b9ef7535cf98c6 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 07:32:09 +0000 Subject: [PATCH 029/154] Make it possible to suppress 'lib' prefix for a target type derived from 'LIB'. [SVN r33576] --- src/build/virtual-target.jam | 18 +++++++++--------- src/tools/python.jam | 21 ++++++++++++++++++++- src/tools/types/lib.jam | 6 ++++++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/build/virtual-target.jam b/src/build/virtual-target.jam index d36d104e1..f543652b0 100644 --- a/src/build/virtual-target.jam +++ b/src/build/virtual-target.jam @@ -470,15 +470,15 @@ rule add-prefix-and-suffix ( specified-name : type ? : property-set ) suffix = .$(suffix) ; local prefix = [ type.generated-target-prefix $(type) : $(property-set) ] ; - - if ! $(prefix) - && [ type.is-derived $(type) LIB ] && [ os.on-unix ] - # This becomes hacky! Need to introduce more general mechanism. - # Invoke type.set-target-prefix in unix toolkit? - && ! [ type.is-derived $(type) PYTHON_EXTENSION ] - { - prefix = lib ; - } + +# if ! $(prefix) +# && [ type.is-derived $(type) LIB ] && [ os.on-unix ] +# # This becomes hacky! Need to introduce more general mechanism. +# # Invoke type.set-target-prefix in unix toolkit? +# && ! [ type.is-derived $(type) PYTHON_EXTENSION ] +# { +# prefix = lib ; +# } if [ MATCH ^($(prefix)) : $(specified-name) ] { prefix = ; diff --git a/src/tools/python.jam b/src/tools/python.jam index e28734979..c215599a9 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -128,6 +128,22 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) { flags python.capture-output PYTHON $(condition:J=/) : $(interpreter) ; } + + + local extra-libs ; + if [ os.name ] = SOLARIS + { + extra-libs = dl ; + } + else if [ os.name ] = OSF || [ os.name ] = QNXTO + { + # Nothing. + } + else + { + extra-libs = dl util ; + } + # On Linux, we don't want to link either Boost.Python or # Python extensions to libpython, so that when extensions @@ -143,7 +159,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) ; alias python - : dl util + : $(extra-libs) : $(condition) : : $(includes) @@ -373,6 +389,9 @@ type.set-generated-target-suffix PYTHON_EXTENSION : : so ; type.set-generated-target-suffix PYTHON_EXTENSION : NT : dll ; type.set-generated-target-suffix PYTHON_EXTENSION : CYGWIN : so ; +# Unset 'lib' prefix for PYTHON_EXTENSION +type.set-generated-target-prefix PYTHON_EXTENSION : : "" ; + rule python-extension ( name : sources * : requirements * : default-build * : usage-requirements * ) { diff --git a/src/tools/types/lib.jam b/src/tools/types/lib.jam index 9c753cc2c..21fab6773 100644 --- a/src/tools/types/lib.jam +++ b/src/tools/types/lib.jam @@ -3,9 +3,15 @@ # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import type ; # for set-generated-target-suffix +import os ; 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 ; From 4d3bc9cceda36dfdd99b83570321d2b078a09027 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 07:37:06 +0000 Subject: [PATCH 030/154] Remove floatsam. [SVN r33578] --- src/build/virtual-target.jam | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/build/virtual-target.jam b/src/build/virtual-target.jam index f543652b0..3c52b32d5 100644 --- a/src/build/virtual-target.jam +++ b/src/build/virtual-target.jam @@ -471,14 +471,6 @@ rule add-prefix-and-suffix ( specified-name : type ? : property-set ) local prefix = [ type.generated-target-prefix $(type) : $(property-set) ] ; -# if ! $(prefix) -# && [ type.is-derived $(type) LIB ] && [ os.on-unix ] -# # This becomes hacky! Need to introduce more general mechanism. -# # Invoke type.set-target-prefix in unix toolkit? -# && ! [ type.is-derived $(type) PYTHON_EXTENSION ] -# { -# prefix = lib ; -# } if [ MATCH ^($(prefix)) : $(specified-name) ] { prefix = ; From b558dea5cd59212cf133f4344c10f874b2e4b561 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 07:45:07 +0000 Subject: [PATCH 031/154] New library QtUiTools. Support buildable Qt tree. Patch from Juergen Hunold. [SVN r33580] --- src/tools/qt4.jam | 386 +++++++++++++++++++++++++--------------------- 1 file changed, 208 insertions(+), 178 deletions(-) diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index 4b5a2888d..eb35658b1 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -83,186 +83,216 @@ rule init ( prefix ) # Generates .cpp file from qrc file generators.register-standard qt4.rcc : QRC : CPP(qrc_%) ; - local usage-requirements = - $(.prefix)/include - $(.prefix)/lib - $(.prefix)/lib - multi ; - - local suffix ; - if [ os.name ] = NT + # Test for a buildable Qt. + if [ glob $(.prefix)/Jamroot ] { - # On NT, the libs have "4" suffix, and "d" suffix in debug builds - # Also, on NT we must link against qtmain library (for WinMain) - suffix_version = "4" ; - suffix_debug = "d" ; - lib qtmain : : qtmain$(suffix_debug) debug ; - lib qtmain : : qtmain release ; - main = qtmain ; - } - else - { - # On X11, debug versions of libs have "_debug" suffix - suffix_version = "" ; - suffix_debug = "_debug" ; + # Import all Qt Modules + local all-libraries = QtCore QtGui QtNetwork QtXml QtSql QtSvg Qt3Support QtTest QtAssistantClient QtUiTools ; + for local l in $(all-libraries) + { + alias $(l) : $(.prefix)//$(l) ; + explicit $(l) ; + } + } + else + # Use pre-built Qt + { + local usage-requirements = + $(.prefix)/include + $(.prefix)/lib + $(.prefix)/lib + multi ; + + local suffix ; + if [ os.name ] = NT + { + # On NT, the libs have "4" suffix, and "d" suffix in debug builds + # Also, on NT we must link against qtmain library (for WinMain) + suffix_version = "4" ; + suffix_debug = "d" ; + lib qtmain : : qtmain$(suffix_debug) debug ; + lib qtmain : : qtmain release ; + main = qtmain ; + } + else + { + # On X11, debug versions of libs have "_debug" suffix + suffix_version = "" ; + suffix_debug = "_debug" ; + } + + lib QtCore : $(main) + : QtCore$(suffix_version) release + : + : # usage-requirements + QT_CORE_LIB + QT_NO_DEBUG + $(.prefix)/include/QtCore + $(usage-requirements) + ; + lib QtCore : $(main) + : QtCore$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + QT_CORE_LIB + $(.prefix)/include/QtCore + $(usage-requirements) + ; + + lib QtGui : QtCore + : QtGui$(suffix_version) release + : + : # usage-requirements + QT_GUI_LIB + $(.prefix)/include/QtGui + gui + ; + + lib QtGui : QtCore + : QtGui$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + QT_GUI_LIB + $(.prefix)/include/QtGui + gui + ; + + lib QtNetwork : QtCore + : QtNetwork$(suffix_version) release + : + : # usage-requirements + QT_NETWORK_LIB + $(.prefix)/include/QtNetwork + ; + lib QtNetwork : QtCore + : QtNetwork$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + QT_NETWORK_LIB + $(.prefix)/include/QtNetwork + ; + + lib QtSql : QtCore + : QtSql$(suffix_version) release + : + : # usage-requirements + QT_SQL_LIB + $(.prefix)/include/QtSql + ; + lib QtSql : QtCore + : QtSql$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + QT_SQL_LIB + $(.prefix)/include/QtSql + ; + + lib QtXml : QtCore + : QtXml$(suffix_version) release + : + : # usage-requirements + QT_XML_LIB + $(.prefix)/include/QtXml + ; + lib QtXml : QtCore + : QtXml$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + QT_XML_LIB + $(.prefix)/include/QtXml + ; + + lib Qt3Support : QtGui QtNetwork QtXml QSql + : Qt3Support$(suffix_version) release + : + : # usage-requirements + QT_QT3SUPPORT_LIB + QT3_SUPPORT + $(.prefix)/include/Qt3Support + ; + lib Qt3Support : QtGui QtNetwork QtXml QSql + : Qt3Support$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + QT_QT3SUPPORT_LIB + QT3_SUPPORT + $(.prefix)/include/Qt3Support + ; + + # OpenGl Support + lib QtOpenGL : QtGui + : QtOpenGL$(suffix_version) release + : + : # usage-requirements + QT_OPENGL_LIB + $(.prefix)/include/QtOpenGL + ; + lib QtOpenGL : QtGui + : QtOpenGL$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + QT_OPENGL_LIB + $(.prefix)/include/QtOpenGL + ; + + # SVG-Support (Qt 4.1) + lib QtSvg : QtXml QtOpenGL + : QtSvg$(suffix_version) release + : + : # usage-requirements + QT_SVG_LIB + $(.prefix)/include/QtSvg + ; + lib QtSvg : QtXml QtOpenGL + : QtSvg$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + QT_SVG_LIB + $(.prefix)/include/QtSvg + ; + + # Test-Support (Qt 4.1) + lib QtTest : QtCore + : QtTest$(suffix_version) release + : + : # usage-requirements + $(.prefix)/include/QtTest + ; + lib QtTest : QtCore + : QtTest$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + $(.prefix)/include/QtTest + ; + + # AssistantClient Support + lib QtAssistantClient : QtGui + : QtAssistantClient$(suffix_version) release + : + : # usage-requirements + $(.prefix)/include/QtAssistantClient + ; + lib QtAssistantClient : QtGui + : QtAssistantClient$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + $(.prefix)/include/QtAssistantClient + ; + + # Support for dynamic Widgets (Qt 4.1) + lib QtUiTools : QtGui QtXml + : QtUiTools$(suffix_version) release + : + : # usage-requirements + $(.prefix)/include/QtUiTools + ; + lib QtUiTools : QtGui QtXml + : QtUiTools$(suffix_debug)$(suffix_version) debug + : + : # usage-requirements + $(.prefix)/include/QtUiTools + ; } - - lib QtCore : $(main) - : QtCore$(suffix_version) release - : - : # usage-requirements - QT_CORE_LIB - $(.prefix)/include/QtCore - $(usage-requirements) - ; - lib QtCore : $(main) - : QtCore$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - QT_CORE_LIB - $(.prefix)/include/QtCore - $(usage-requirements) - ; - - lib QtGui : QtCore - : QtGui$(suffix_version) release - : - : # usage-requirements - QT_GUI_LIB - $(.prefix)/include/QtGui - gui - ; - - lib QtGui : QtCore - : QtGui$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - QT_GUI_LIB - $(.prefix)/include/QtGui - gui - ; - - lib QtNetwork : QtCore - : QtNetwork$(suffix_version) release - : - : # usage-requirements - QT_NETWORK_LIB - $(.prefix)/include/QtNetwork - ; - lib QtNetwork : QtCore - : QtNetwork$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - QT_NETWORK_LIB - $(.prefix)/include/QtNetwork - ; - - lib QtSql : QtCore - : QtSql$(suffix_version) release - : - : # usage-requirements - QT_SQL_LIB - $(.prefix)/include/QtSql - ; - lib QtSql : QtCore - : QtSql$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - QT_SQL_LIB - $(.prefix)/include/QtSql - ; - - lib QtXml : QtCore - : QtXml$(suffix_version) release - : - : # usage-requirements - QT_XML_LIB - $(.prefix)/include/QtXml - ; - lib QtXml : QtCore - : QtXml$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - QT_XML_LIB - $(.prefix)/include/QtXml - ; - - lib Qt3Support : QtGui QtNetwork QtXml QSql - : Qt3Support$(suffix_version) release - : - : # usage-requirements - QT_QT3SUPPORT_LIB - QT3_SUPPORT - $(.prefix)/include/Qt3Support - ; - lib Qt3Support : QtGui QtNetwork QtXml QSql - : Qt3Support$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - QT_QT3SUPPORT_LIB - QT3_SUPPORT - $(.prefix)/include/Qt3Support - ; - - # OpenGl Support - lib QtOpenGL : QtGui - : QtOpenGL$(suffix_version) release - : - : # usage-requirements - QT_OPENGL_LIB - $(.prefix)/include/QtOpenGL - ; - lib QtOpenGL : QtGui - : QtOpenGL$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - QT_OPENGL_LIB - $(.prefix)/include/QtOpenGL - ; - - # SVG-Support (Qt 4.1) - lib QtSvg : QtXml QtOpenGL - : QtSvg$(suffix_version) release - : - : # usage-requirements - QT_SVG_LIB - $(.prefix)/include/QtSvg - ; - lib QtSvg : QtXml QtOpenGL - : QtSvg$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - QT_SVG_LIB - $(.prefix)/include/QtSvg - ; - - # Test-Support (Qt 4.1) - lib QtTest : QtCore - : QtTest$(suffix_version) release - : - : # usage-requirements - $(.prefix)/include/QtTest - ; - lib QtTest : QtCore - : QtTest$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - $(.prefix)/include/QtTest - ; - - # AssistantClient Support - lib QtAssistantClient : QtGui - : QtAssistantClient$(suffix_version) release - : - : # usage-requirements - $(.prefix)/include/QtAssistantClient - ; - lib QtAssistantClient : QtGui - : QtAssistantClient$(suffix_debug)$(suffix_version) debug - : - : # usage-requirements - $(.prefix)/include/QtAssistantClient - ; } } From b92c99eb5f56331bf80e67d1cd28b33e11dfab5a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 08:07:58 +0000 Subject: [PATCH 032/154] Fix URLs of packages. [SVN r33582] --- website/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/index.html b/website/index.html index b2772e5f1..988ef07d8 100644 --- a/website/index.html +++ b/website/index.html @@ -129,9 +129,9 @@ div.sidebar p.rubric { section of the Boost getting started docs.

Boost.Build releases are also available. There's zip + "http://prdownloads.sourceforge.net/boost/boost-build-2.0-m10.zip">zip archive, and tar.bz2 + "http://prdownloads.sourceforge.net/boost/boost-build-2.0-m10.tar.bz2">tar.bz2 archive of the current release. Older releases are available from the SourceForce From 9a0d3bb3f7f3a10d4e34fc0d4c3b10a2522c73b2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:06:21 +0000 Subject: [PATCH 033/154] Try to improve diagnostics when no alternative can be found. [SVN r33586] --- src/build/targets.jam | 31 +++++++++++++++++++++---------- test/alternatives.py | 4 ++-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/build/targets.jam b/src/build/targets.jam index 96c60ac36..cab4436e1 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -584,7 +584,7 @@ class main-target : abstract-target # Returns the best viable alternative for this property-set # See the documentation for selection rules. - local rule select-alternatives ( property-set ) + local rule select-alternatives ( property-set debug ? ) { # When selecting alternatives we have to consider defaults, # for example: @@ -607,7 +607,7 @@ class main-target : abstract-target while $(worklist) && ! $(bad) { local v = $(worklist[1]) ; - local properties = [ $(v).match $(property-set) ] ; + local properties = [ $(v).match $(property-set) $(debug) ] ; if $(properties) != no-match { @@ -752,11 +752,8 @@ class main-target : abstract-target local best-alternatives = [ select-alternatives $(property-set) ] ; if ! $(best-alternatives) { - errors.error - "failed to build" [ full-name ] - "with properties" [ $(property-set).raw ] - "because no best-matching alternative could be found" - ; + ECHO "error: No best alternative for" [ full-name ] ; + select-alternatives $(property-set) debug ; return [ property-set.empty ] ; } else @@ -931,7 +928,8 @@ rule common-properties2 ( build-request requirements ) # Apply non-conditional requirements. # There's a slight bug here: it's possible that conditional # requirement change a value set by non-conditional requirements. This - # should be error, but we don't detect it yet. + # should be error, but we don't detect it yet. + local raw = [ $(build-request).raw ] ; raw = [ property.refine $(raw) : [ feature.expand [ $(requirements).non-conditional ] ] ] ; @@ -1071,7 +1069,7 @@ class basic-target : abstract-target # Returns the alternative condition for this alternative, if # the condition is satisfied by 'property-set'. - rule match ( property-set ) + rule match ( property-set debug ? ) { # The condition is composed of all base non-conditional properties. # It's not clear if we should expand 'self.requirements' or not. @@ -1084,12 +1082,25 @@ class basic-target : abstract-target local bcondition = [ $(self.requirements).base ] ; local ccondition = [ $(self.requirements).conditional ] ; local condition = [ set.difference $(bcondition) : $(ccondition) ] ; + if $(debug) + { + ECHO " next alternative: required properties:" $(condition:E=(empty)) ; + } + if $(condition) in [ $(property-set).raw ] { - return $(condition) ; + if $(debug) + { + ECHO " matched" ; + } + return $(condition) ; } else { + if $(debug) + { + ECHO " not matched" ; + } return no-match ; } } diff --git a/test/alternatives.py b/test/alternatives.py index f9d60feea..5c5ada90e 100644 --- a/test/alternatives.py +++ b/test/alternatives.py @@ -86,7 +86,7 @@ exe a : a_empty.cpp ; exe a : a.cpp ; """) t.run_build_system("--no-error-backtrace", status=1) -t.fail_test(find(t.stdout(), "because no best-matching alternative could be found") == -1) +t.fail_test(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. @@ -96,7 +96,7 @@ exe a : a.cpp : on ; """) t.run_build_system("--no-error-backtrace", status=1) -t.fail_test(find(t.stdout(), "because no best-matching alternative could be found") == -1) +t.fail_test(find(t.stdout(), "No best alternative") == -1) From 6c25769ec93da2fee7356dcfc490aa19bf9c03f9 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:19:47 +0000 Subject: [PATCH 034/154] Add Juergen's copyright, with his permission. [SVN r33587] --- src/tools/qt4.jam | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index eb35658b1..6872cd63f 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -1,5 +1,7 @@ -# Copyright 2002 Vladimir Prus +# Copyright 2002-2006 Vladimir Prus # Copyright 2005 Alo Sarv +# Copyright 2005-2006 Juergen 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) From 5921d4c464ab4634782a715b3a28cff03f8947e4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:28:45 +0000 Subject: [PATCH 035/154] Make Qt4 module work in "import qt4; using qt4 : ....." scenario. Add method 'initialized'. [SVN r33588] --- src/tools/qt4.jam | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index 6872cd63f..a919a2251 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -50,10 +50,16 @@ import virtual-target ; project.initialize $(__name__) ; project qt ; +# Save the project so that we tolerate 'import + using' combo. +.project = [ project.current ] ; + + # Initialized the QT support module. The 'prefix' parameter # tells where QT is installed. rule init ( prefix ) { + project.push-current $(.project) ; + if $(.initialized) { if $(prefix) != $(.prefix) @@ -296,8 +302,17 @@ rule init ( prefix ) ; } } + + project.pop-current ; } +rule initialized ( ) +{ + return $(.initialized) ; +} + + + # This custom generator is needed because it QT4, UI files are translated # only in H files, and no C++ files are created. Further, the H files # need not be passed via MOC. The header is used only via inclusion. From 6931006fb1ef733a3472c7ed14ba5a4f0d65afa8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:32:04 +0000 Subject: [PATCH 036/154] New Qt example. [SVN r33589] --- example/qt/qt4/hello/Jamroot | 14 +++ example/qt/qt4/hello/arrow.cpp | 159 +++++++++++++++++++++++++++++++++ example/qt/qt4/hello/arrow.h | 30 +++++++ example/qt/qt4/hello/main.cpp | 27 ++++++ 4 files changed, 230 insertions(+) create mode 100644 example/qt/qt4/hello/Jamroot create mode 100644 example/qt/qt4/hello/arrow.cpp create mode 100644 example/qt/qt4/hello/arrow.h create mode 100644 example/qt/qt4/hello/main.cpp diff --git a/example/qt/qt4/hello/Jamroot b/example/qt/qt4/hello/Jamroot new file mode 100644 index 000000000..83952f17b --- /dev/null +++ b/example/qt/qt4/hello/Jamroot @@ -0,0 +1,14 @@ + +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 multi ; + +exe arrow : main.cpp arrow.cpp arrow.h /qt//QtGui ; \ No newline at end of file diff --git a/example/qt/qt4/hello/arrow.cpp b/example/qt/qt4/hello/arrow.cpp new file mode 100644 index 000000000..c3ca83d0e --- /dev/null +++ b/example/qt/qt4/hello/arrow.cpp @@ -0,0 +1,159 @@ +// Copyright 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) + +#include "arrow.h" + +#include + +#include +#include +#include + +#include +#include + +Arrow_widget::Arrow_widget(QWidget* parent) : QWidget(parent), color_(0) +{ + QPalette pal = palette(); + pal.setBrush(backgroundRole(), QBrush(Qt::white)); + setPalette(pal); +} + +void Arrow_widget::slotChangeColor() +{ + color_ = (color_ + 1) % 3; + update(); +} + +void +Arrow_widget::draw_arrow(int x1, int y1, int x2, int y2, QPainter& painter) +{ + // The length of the from the tip of the arrow to the point + // where line starts. + const int arrowhead_length = 16; + + QPainterPath arrow; + arrow.moveTo(x1, y1); + + // Determine the angle of the straight line. + double a1 = (x2-x1); + double a2 = (y2-y1); + double b1 = 1; + double b2 = 0; + + double straight_length = sqrt(a1*a1 + a2*a2); + + double dot_product = a1*b1 + a2*b2; + double cosine = dot_product/ + (sqrt(pow(a1, 2) + pow(a2, 2))*sqrt(b1 + b2)); + double angle = acos(cosine); + if (y1 < y2) + { + angle = -angle; + } + double straight_angle = angle*180/M_PI; + + double max_delta = 30; + double limit = 10; + + double angle_to_vertical; + if (fabs(straight_angle) < 90) + angle_to_vertical = fabs(straight_angle); + else if (straight_angle > 0) + angle_to_vertical = 180-straight_angle; + else + angle_to_vertical = 180-(-straight_angle); + + double angle_delta = 0; + if (angle_to_vertical > limit) + angle_delta = 30 * (angle_to_vertical - limit)/90; + double start_angle = straight_angle > 0 + ? straight_angle - angle_delta : + straight_angle + angle_delta; + + + QMatrix m1; + m1.translate(x1, y1); + m1.rotate(-start_angle); + + double end_angle = straight_angle > 0 + ? (straight_angle + 180 + angle_delta) : + (straight_angle + 180 - angle_delta); + + QMatrix m2; + m2.reset(); + m2.translate(x2, y2); + m2.rotate(-end_angle); + + arrow.cubicTo(m1.map(QPoint(straight_length/2, 0)), + m2.map(QPoint(straight_length/2, 0)), + m2.map(QPoint(arrowhead_length, 0))); + + painter.save(); + painter.setBrush(Qt::NoBrush); + painter.drawPath(arrow); + painter.restore(); + + painter.save(); + painter.translate(x2, y2); + + painter.rotate(-90); + painter.rotate(-end_angle); + painter.rotate(180); + + QPolygon arrowhead(4); + arrowhead.setPoint(0, 0, 0); + arrowhead.setPoint(1, arrowhead_length/3, -arrowhead_length*5/4); + arrowhead.setPoint(2, 0, -arrowhead_length); + arrowhead.setPoint(3, -arrowhead_length/3, -arrowhead_length*5/4); + + painter.drawPolygon(arrowhead); + + painter.restore(); + +} + + +void Arrow_widget::paintEvent(QPaintEvent*) +{ + QPainter p(this); + + p.setRenderHint(QPainter::Antialiasing); + + int base_x = 550; + int base_y = 200; + + if (color_ == 0) + p.setBrush(Qt::black); + else if (color_ == 1) + p.setBrush(Qt::green); + else if (color_ == 2) + p.setBrush(Qt::yellow); + else + p.setBrush(Qt::black); + + for (int x_step = 0; x_step < 6; ++x_step) + { + for (int y_step = 1; y_step <= 3; ++y_step) + { + draw_arrow(base_x, base_y, base_x+x_step*100, + base_y - y_step*50, p); + + draw_arrow(base_x, base_y, base_x+x_step*100, + base_y + y_step*50, p); + + draw_arrow(base_x, base_y, base_x-x_step*100, + base_y + y_step*50, p); + + draw_arrow(base_x, base_y, base_x-x_step*100, + base_y - y_step*50, p); + } + } + + draw_arrow(50, 400, 1000, 450, p); + draw_arrow(1000, 400, 50, 450, p); + +} + diff --git a/example/qt/qt4/hello/arrow.h b/example/qt/qt4/hello/arrow.h new file mode 100644 index 000000000..d7743864f --- /dev/null +++ b/example/qt/qt4/hello/arrow.h @@ -0,0 +1,30 @@ +// Copyright 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) + +#include + +#include +#include +#include + +#include +#include + +class Arrow_widget : public QWidget +{ + Q_OBJECT +public: + Arrow_widget(QWidget* parent = 0); + +public slots: + void slotChangeColor(); + +private: + void draw_arrow(int x1, int y1, int x2, int y2, QPainter& painter); + void paintEvent(QPaintEvent*); + +private: + int color_; +}; diff --git a/example/qt/qt4/hello/main.cpp b/example/qt/qt4/hello/main.cpp new file mode 100644 index 000000000..df27444bd --- /dev/null +++ b/example/qt/qt4/hello/main.cpp @@ -0,0 +1,27 @@ +// Copyright 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) + +#include "arrow.h" + +#include +#include + +int main(int ac, char* av[]) +{ + QApplication app(ac, av); + Arrow_widget* w = new Arrow_widget; + w->resize(1100, 480); + + QTimer timer; + QObject::connect(&timer, SIGNAL(timeout()), + w, SLOT(slotChangeColor())); + + timer.start(2000); + + w->show(); + app.exec(); + return 0; +} + From cdad507ba22799a72b1cab600cce389e2fa65b7b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:37:20 +0000 Subject: [PATCH 037/154] Fix a couple of warnings that break automated tests [SVN r33590] --- example/qt/qt4/hello/arrow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/example/qt/qt4/hello/arrow.cpp b/example/qt/qt4/hello/arrow.cpp index c3ca83d0e..e821b1690 100644 --- a/example/qt/qt4/hello/arrow.cpp +++ b/example/qt/qt4/hello/arrow.cpp @@ -55,7 +55,6 @@ Arrow_widget::draw_arrow(int x1, int y1, int x2, int y2, QPainter& painter) } double straight_angle = angle*180/M_PI; - double max_delta = 30; double limit = 10; double angle_to_vertical; @@ -87,9 +86,9 @@ Arrow_widget::draw_arrow(int x1, int y1, int x2, int y2, QPainter& painter) m2.translate(x2, y2); m2.rotate(-end_angle); - arrow.cubicTo(m1.map(QPoint(straight_length/2, 0)), - m2.map(QPoint(straight_length/2, 0)), - m2.map(QPoint(arrowhead_length, 0))); + arrow.cubicTo(m1.map(QPointF(straight_length/2, 0)), + m2.map(QPointF(straight_length/2, 0)), + m2.map(QPointF(arrowhead_length, 0))); painter.save(); painter.setBrush(Qt::NoBrush); From a5d1abd22fd734d6be1e24e647eabc88bb5bd9c9 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 9 Apr 2006 07:20:25 +0000 Subject: [PATCH 038/154] Only show tool not found warnings when dubgging configuration. This is to prevent spurious warnings when trying to set up varied tools and they are not usually available on a given platform. [SVN r33604] --- src/tools/common.jam | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/tools/common.jam b/src/tools/common.jam index 06d66366d..00b8d8284 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -17,6 +17,10 @@ import path ; import sequence ; import toolset ; +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} # Configurations # @@ -230,8 +234,11 @@ rule get-invocation-command ( command = [ common.find-tool $(tool) : $(additional-paths) : $(path-last) ] ; if ! $(command) { - ECHO "warning: toolset $(toolset) initialization: can't find tool $(tool)" ; - ECHO "warning: initialized from" [ errors.nearest-user-location ] ; + if $(.debug-configuration) + { + ECHO "warning: toolset $(toolset) initialization: can't find tool $(tool)" ; + ECHO "warning: initialized from" [ errors.nearest-user-location ] ; + } } } else @@ -239,9 +246,12 @@ rule get-invocation-command ( command = [ common.check-tool $(user-provided-command) ] ; if ! $(command) { - ECHO "warning: toolset $(toolset) initialization: " ; - ECHO "warning: can't find user-provided command '$(user-provided-command:J= )'" ; - ECHO "warning: initialized from" [ errors.nearest-user-location ] ; + if $(.debug-configuration) + { + ECHO "warning: toolset $(toolset) initialization: " ; + ECHO "warning: can't find user-provided command '$(user-provided-command:J= )'" ; + ECHO "warning: initialized from" [ errors.nearest-user-location ] ; + } # It's possible, in theory, that user-provided command is OK, but we're # not smart enough to understand that. command = $(user-provided-command) ; From 3bb96653bb9b2ed97ee231061f95e8cbd9785dff Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 9 Apr 2006 07:23:47 +0000 Subject: [PATCH 039/154] Fix +/* change that was requireing specifying the lib paths. Allow explicitly asking to install the STLport lib by refering to it directly: /stlport//stlport/on. Allow setting up to use STLport by only using the library target /stlport//stlport. [SVN r33605] --- src/tools/stlport.jam | 59 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index f70c7407d..df50967e4 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -40,6 +40,7 @@ import "class" : new ; import targets ; import property-set ; import common ; +import type ; # Make this module into a project. project.initialize $(__name__) ; @@ -81,7 +82,7 @@ class stlport-target-class : basic-target import feature project type errors generators ; import set : difference ; - rule __init__ ( project : headers ? : libraries + : version ? ) + rule __init__ ( project : headers ? : libraries * : version ? ) { basic-target.__init__ stlport : $(project) ; self.headers = $(headers) ; @@ -160,9 +161,46 @@ class stlport-target-class : basic-target } } name += .$(self.version.5) ; + name = $(name:J=) ; - return [ generators.construct - $(self.project) $(name:J=) : SEARCHED_LIB : $(property-set) ] ; + if [ feature.get-values : $(raw) ] = "on" + { + #~ Allow explicitly asking to install the STLport lib by + #~ refering to it directly: /stlport//stlport/on + #~ This allows for install packaging of all libs one might need for + #~ a standalone distribution. + import path : make : path-make ; + local runtime-link + = [ feature.get-values : $(raw) ] ; + local lib-file.props + = [ property-set.create $(raw) $(runtime-link) ] ; + local lib-file.prefix + = [ type.generated-target-prefix $(runtime-link:U)_LIB : $(lib-file.props) ] ; + local lib-file.suffix + = [ type.generated-target-suffix $(runtime-link:U)_LIB : $(lib-file.props) ] ; + lib-file.prefix + ?= "" "lib" ; + lib-file.suffix + ?= "" ; + local lib-file + = [ GLOB $(self.libraries) [ modules.peek : PATH ] : + $(lib-file.prefix)$(name).$(lib-file.suffix) ] ; + lib-file + = [ new file-reference [ path-make $(lib-file[1]) ] : $(self.project) ] ; + lib-file + = [ $(lib-file).generate "" ] ; + local lib-file.requirements + = [ targets.main-target-requirements + [ $(lib-file.props).raw ] $(lib-file[-1]) + : $(self.project) ] ; + return [ generators.construct $(self.project) $(name) : LIB : $(lib-file.requirements) : : LIB ] ; + } + else + { + #~ Otherwise, it's just a regular usage of the library. + return [ generators.construct + $(self.project) $(name) : SEARCHED_LIB : $(property-set) ] ; + } } else if ! $(hostios) && $(toolset) != msvc { @@ -219,6 +257,21 @@ class stlport-target-class : basic-target _STLP_NO_OWN_IOSTREAMS=1 _STLP_HAS_NO_NEW_IOSTREAMS=1 ; } + + #~ Allow setting up to use STLport by only using the library target + #~ /stlport//stlport. + #~ TODO: Make it possible to use /stlport//stlport/5.0 to select + #~ a specific configured version. + if $(self.version) + { + usage-requirements += + stlport-$(self.version) ; + } + else + { + usage-requirements += + stlport ; + } return [ property-set.create $(usage-requirements) ] ; } From 321dccff1a50c9712ad9f034bd202f3b1efab5f2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:22:57 +0000 Subject: [PATCH 040/154] Fix diagnostic. [SVN r33621] --- src/tools/common.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/common.jam b/src/tools/common.jam index 00b8d8284..0c42a15d3 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -249,7 +249,7 @@ rule get-invocation-command ( if $(.debug-configuration) { ECHO "warning: toolset $(toolset) initialization: " ; - ECHO "warning: can't find user-provided command '$(user-provided-command:J= )'" ; + ECHO "warning: can't find user-provided command " '$(user-provided-command)' ; ECHO "warning: initialized from" [ errors.nearest-user-location ] ; } # It's possible, in theory, that user-provided command is OK, but we're From 85408039c08843e101b6da20ea72b70022150dbf Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:24:38 +0000 Subject: [PATCH 041/154] Print 'success' message [SVN r33622] --- scripts/nightly.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/nightly.sh b/scripts/nightly.sh index ffc8afaa8..6fb31b868 100644 --- a/scripts/nightly.sh +++ b/scripts/nightly.sh @@ -13,3 +13,4 @@ cd boost-build/build/v2 ./roll.sh > ../roll-log cd .. scp boost-build.zip boost-build.tar.bz2 vladimir_prus@shell.sf.net:/home/groups/b/bo/boost/htdocs/boost-build2 > scp-log +echo "Upload successfull" From 1e56320bdc0768f4e9f07af267733fdddf979aee Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:26:26 +0000 Subject: [PATCH 042/154] Don't configure Qt if already configured. [SVN r33623] --- example/qt/qt4/moccable-cpp/Jamroot | 16 +++++++++++----- example/qt/qt4/uic/Jamroot | 13 +++++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/example/qt/qt4/moccable-cpp/Jamroot b/example/qt/qt4/moccable-cpp/Jamroot index cf38c5223..d07b9c7d3 100644 --- a/example/qt/qt4/moccable-cpp/Jamroot +++ b/example/qt/qt4/moccable-cpp/Jamroot @@ -1,12 +1,18 @@ +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 ] - /qt4//QtGui ; + /qt//QtGui + : multi + ; -#cast _ moccable-cpp : main.cpp ; diff --git a/example/qt/qt4/uic/Jamroot b/example/qt/qt4/uic/Jamroot index b343868c3..40675a72e 100644 --- a/example/qt/qt4/uic/Jamroot +++ b/example/qt/qt4/uic/Jamroot @@ -3,7 +3,16 @@ # (See accompanying file LICENSE_1_0.txt # or copy at http://www.boost.org/LICENSE_1_0.txt) -project +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 multi ; -exe hello : main.cpp hello_world_widget.ui : /qt4//QtGui ; +exe hello : main.cpp hello_world_widget.ui : /qt//QtGui ; From b48dc6225f8c2700b302c3d983a2f4f2c5fc69ea Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:29:30 +0000 Subject: [PATCH 043/154] Test that 'unit-test' will find searched libraries. [SVN r33624] --- test/searched_lib.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/test/searched_lib.py b/test/searched_lib.py index e6a61ca7a..8de51dcaf 100644 --- a/test/searched_lib.py +++ b/test/searched_lib.py @@ -41,7 +41,7 @@ local here = [ project.attribute $(__name__) location ] ; here = [ path.root $(here) [ path.pwd ] ] ; exe main : main.cpp helper ; -lib helper : helper.cpp test_lib : $(here)/lib ; +lib helper : helper.cpp test_lib ; lib test_lib : : test_lib lib ; """) t.write("main.cpp", """ @@ -57,10 +57,32 @@ __declspec(dllexport) #endif helper() { foo(); } """) -t.run_build_system(stderr=None) # gcc warns about libraries which are not in -rpath. +t.run_build_system() t.expect_addition("bin/$toolset/debug/main.exe") t.rm("bin/$toolset/debug/main.exe") +# Test the 'unit-test' will correctly add runtime paths +# to searched libraries. +t.write('Jamfile', """ + +import path ; +import project ; +import testing ; + +project : requirements false ; + +local here = [ project.attribute $(__name__) location ] ; +here = [ path.root $(here) [ path.pwd ] ] ; + +unit-test main : main.cpp helper ; +lib helper : helper.cpp test_lib ; +lib test_lib : : test_lib 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', """ From 0241919bc02efd8186e062b0d818b030230da017 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:30:23 +0000 Subject: [PATCH 044/154] Some fixes [SVN r33625] --- src/tools/package.jam | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/tools/package.jam b/src/tools/package.jam index 06547ebe3..ff9dd0eb0 100644 --- a/src/tools/package.jam +++ b/src/tools/package.jam @@ -41,9 +41,10 @@ rule install ( name : requirements * : binaries * : libraries * : headers * ) { local install-source-root = [ property.select : $(requirements) ] ; - install-source-root ?= "." ; - - + # If is not specified, all headers are installed + # to prefix/include, no matter what their relative path is. Sometimes + # that's what needed. + requirements = [ property.change $(requirements) : ] ; @@ -70,7 +71,11 @@ rule install ( name : requirements * : binaries * : libraries * : headers * ) stage.install $(name)-bin : $(binaries) : $(requirements) $(bin-locate) ; - stage.install $(name)-lib : $(libraries) : $(requirements) $(lib-locate) ; + stage.install $(name)-lib : + $(binaries) $(libraries) + : $(requirements) $(lib-locate) + on LIB + ; stage.install $(name)-headers : $(headers) : $(requirements) $(include-locate) $(install-source-root) ; alias $(name) : $(name)-bin $(name)-lib $(name)-headers ; From c59abb7cdff76d1d058d613377fe4836637d98a4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 09:40:41 +0000 Subject: [PATCH 045/154] Support using Qt3 and Qt4 at the same time. [SVN r33627] --- src/tools/qt3.jam | 14 +++++++------- src/tools/qt4.jam | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/tools/qt3.jam b/src/tools/qt3.jam index 4148f9422..ba7c63928 100644 --- a/src/tools/qt3.jam +++ b/src/tools/qt3.jam @@ -51,19 +51,19 @@ rule init ( prefix ? ) .initialized = true ; .prefix = $(prefix) ; - generators.register-standard qt3.moc : H : CPP(moc_%) : qt ; + generators.register-standard qt3.moc : H : CPP(moc_%) : qt3 ; # Note: the OBJ target type here is fake, take a look # at qt4.jam/uic-h-generator for explanations that # apply in this case as well. - generators.register [ new moc-h-generator - qt3.moc.cpp : MOCCABLE_CPP : OBJ : qt ] ; + generators.register [ new moc-h-generator-qt3 + qt3.moc.cpp : MOCCABLE_CPP : OBJ : qt3 ] ; # The UI type is defined in types/qt.jam, # and UIC_H is only used in qt.jam, but not in qt4.jam, so # define it here. type.register UIC_H : : H ; - generators.register-standard qt3.uic-h : UI : UIC_H : qt ; + generators.register-standard qt3.uic-h : UI : UIC_H : qt3 ; # The following generator is used to convert UI files to CPP # It creates UIC_H from UI, and constructs CPP from UI/UIC_H @@ -73,7 +73,7 @@ rule init ( prefix ? ) { rule __init__ ( ) { - generator.__init__ qt3.uic-cpp : UI UIC_H : CPP : qt ; + generator.__init__ qt3.uic-cpp : UI UIC_H : CPP : qt3 ; } rule run ( project name ? : properties * : sources + ) @@ -118,14 +118,14 @@ rule init ( prefix ? ) $(.prefix)/include $(.prefix)/lib $(.prefix)/lib - qt + qt3 ; lib qt : : qt-mt multi : : $(usage-requirements) ; lib qt : : qt single : : $(usage-requirements) ; } } -class moc-h-generator : generator +class moc-h-generator-qt3 : generator { rule __init__ ( * : * ) { diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index a919a2251..72bf1d67d 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -74,19 +74,20 @@ rule init ( prefix ) .prefix = $(prefix) ; # Generates cpp files from header files using "moc" tool - generators.register-standard qt4.moc : H : CPP(moc_%) ; + generators.register-standard qt4.moc : H : CPP(moc_%) : qt4 ; # The OBJ result type is a fake, 'H' will be really produces. # See comments on the generator calss, defined below # the 'init' function. - generators.register [ new uic-h-generator qt4.uic-h : UI : OBJ ] ; + generators.register [ new uic-h-generator qt4.uic-h : UI : OBJ + : qt4 ] ; # The OBJ result type is a fake here too. generators.register [ new moc-h-generator - qt4.moc.inc : MOCCABLE_CPP : OBJ ] ; + qt4.moc.inc : MOCCABLE_CPP : OBJ : qt4 ] ; generators.register [ new moc-inc-generator - qt4.moc.inc : MOCCABLE_H : OBJ ] ; + qt4.moc.inc : MOCCABLE_H : OBJ : qt4 ] ; # Generates .cpp file from qrc file generators.register-standard qt4.rcc : QRC : CPP(qrc_%) ; @@ -98,7 +99,12 @@ rule init ( prefix ) local all-libraries = QtCore QtGui QtNetwork QtXml QtSql QtSvg Qt3Support QtTest QtAssistantClient QtUiTools ; for local l in $(all-libraries) { - alias $(l) : $(.prefix)//$(l) ; + alias $(l) + : $(.prefix)//$(l) + : + : + : qt4 + ; explicit $(l) ; } } @@ -109,7 +115,9 @@ rule init ( prefix ) $(.prefix)/include $(.prefix)/lib $(.prefix)/lib - multi ; + multi + qt4 + ; local suffix ; if [ os.name ] = NT From 7f6e08a108f9d753ab219482928f3bf2c93a63f3 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 10:28:06 +0000 Subject: [PATCH 046/154] Include jam docs as appendix into Boost.Build docs. [SVN r33629] --- doc/Jamfile.v2 | 3 +++ doc/src/userman.xml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 29767bb18..0541fd277 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -6,8 +6,11 @@ boostbook userman : src/userman.xml : toc.section.depth=1 doc.standalone=true nav.layout=none + jam_docs ; +xml jam_docs : ../../../jam/doc/bjam.qbk ; + if ! $(BOOST_ROOT) { BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ; diff --git a/doc/src/userman.xml b/doc/src/userman.xml index ef80b7803..e53812b79 100644 --- a/doc/src/userman.xml +++ b/doc/src/userman.xml @@ -18,5 +18,10 @@ + + Boost.Jam documentation + + From f8dafa7ac0ef7cb29f747523262a6a1c9718d28c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 10:46:40 +0000 Subject: [PATCH 047/154] Fix dependency [SVN r33630] --- doc/Jamfile.v2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 0541fd277..708140252 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -6,7 +6,8 @@ boostbook userman : src/userman.xml : toc.section.depth=1 doc.standalone=true nav.layout=none - jam_docs + jam_docs + jam_docs ; xml jam_docs : ../../../jam/doc/bjam.qbk ; From d66d2676d67f47a7f0a1f56eff826dd2fb0d0040 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 11:26:04 +0000 Subject: [PATCH 048/154] Make it possible to specify rule name with '@' prefix to the 'make' rule, just like for 'notfile' rule. Using rule name without '@' still works for backward compatibility. [SVN r33632] --- src/tools/make.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/make.jam b/src/tools/make.jam index 0caee31df..bd00ae92e 100644 --- a/src/tools/make.jam +++ b/src/tools/make.jam @@ -47,7 +47,12 @@ rule make ( target-name : sources * : generating-rule + : requirements * ) # The '@' sign causes the feature.jam module to qualify rule name # with the module name of current project, if needed. - requirements += @$(generating-rule) ; + local m = [ MATCH ^(@).* : $(generating-rule) ] ; + if ! $(m) + { + generating-rule = @$(generating-rule) ; + } + requirements += $(generating-rule) ; targets.main-target-alternative [ new make-target-class $(target-name) : $(project) From 3e102b6fce8f281bcda757f9f793e7b24852a99f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 11:34:53 +0000 Subject: [PATCH 049/154] Document make/notfile rules. Document action syntax. [SVN r33633] --- doc/src/advanced.xml | 105 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/doc/src/advanced.xml b/doc/src/advanced.xml index 5e3c18a7b..553e85377 100644 --- a/doc/src/advanced.xml +++ b/doc/src/advanced.xml @@ -200,6 +200,51 @@ import module : rule ; + + + Sometimes, you'd need to specify the actual command lines to be used + when creating targets. In jam language, you use named actions to do this. + For example: + +actions create-file-from-another +{ + create-file-from-another $(<) $(>) +} + + This specifies a named action called + create-file-from-another. The text inside braces is the + command to invoke. The $(<) variable will be expanded to list of + generated files, and the $(>) variable will be expanded + to the list of source files. + + + To flexibly adjust command line, you can define a rule with the + same name as the action, and taking three parameters -- targets, sources + and properties. For example: + +rule create-file-from-another ( targets * : sources * : properties * ) +{ + if <variant>debug in $(properties) + { + OPTIONS on $(targets) = --debug ; + } +} +actions create-file-from-another +{ + create-file-from-another $(OPTIONS) $(<) $(>) +} + + In this example, the rule checks if certain build property is specified. + If so, it sets variable OPIONS that's used inside + action. Note that the variable is set "on targets" -- the value will + be only visible inside action, not globally. Were it set globally, + using variable named OPTIONS in two unrelated + actions would be impossible. + + + More details can be found in Jam reference, + +

@@ -1609,6 +1654,66 @@ unit-test helpers_test are not covered here.
+ +
+ + Raw commands: 'make' and 'notfile' + + Sometimes, the builtin target types are not enough, and you + want Boost.Build to just run specific commands. There are two main + target rules that make it possible: make + and notfile. + + + The make rule is used when you want to + create one file from a number of sources using some specific command. + The notfile is used to unconditionally run + a command. + + + + Suppose you want to create file file.out from + file file.in by running command + in2out. Here's how you'd do this in Boost.Build: + +actions in2out +{ + in2out $(<) $(>) +} +make file.out : file.in : @in2out ; + + If you run bjam and file.out + does not exist, Boost.Build will run the in2out + command to create that file. For more details on specifying actions, + see . + + + + + The make rule is useful to express custom + transformation that are used just once or twice in your project. For + transformations that are used often, you are advised to declare + new generator, as described in . + + + + + It could be that you just want to run some command unconditionally, + and that command does not create any specific files. The, you can use + the notfile rule. For example: + +notfile echo_something : @echo ; +actions echo +{ + echo "something" +} + + The only difference from the make rule is + that the name of the target is not considered a name of a file, so + Boost.Build will unconditionally run the action. + + +
From 99b496e18074592f1be9b21fceaa3273edd8c420 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 12:33:15 +0000 Subject: [PATCH 050/154] Improve indentation for --debug-generators. [SVN r33634] --- src/build/generators.jam | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/build/generators.jam b/src/build/generators.jam index 511f78082..7390f945c 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -271,7 +271,7 @@ class generator : sources + # Source targets. ) { - generators.dout [ indent ] " generator" $(self.id) ; + generators.dout [ indent ] " ** generator" $(self.id) ; generators.dout [ indent ] " multiple:" $(mutliple) ; generators.dout [ indent ] " composing:" $(self.composing) ; @@ -353,7 +353,6 @@ class generator # If this is 1->1 transformation, apply it to all consumed targets in order. if ! $(self.source-types[2]) && ! $(self.composing) { - generators.dout [ indent ] "alt1" ; for local r in $(consumed) { result += [ generated-targets $(r) : $(property-set) : $(project) $(name) ] ; #(targets) ; @@ -361,7 +360,6 @@ class generator } else { - generators.dout [ indent ] "alt2 : consumed is" $(consumed) ; if $(consumed) { result += [ generated-targets $(consumed) : $(property-set) @@ -859,7 +857,7 @@ local rule try-one-generator ( project name ? : generator : ! [ set.intersection $(source-types) : $(viable-source-types) ] { local id = [ $(generator).id ] ; - generators.dout [ indent ] "generator '$(id)' pruned" ; + generators.dout [ indent ] " ** generator '$(id)' pruned" ; #generators.dout [ indent ] "source-types" '$(source-types)' ; #generators.dout [ indent ] "viable-source-types" '$(viable-source-types)' ; } From a6cc79cf1c071173781c922d29638c5274d71642 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 12:36:12 +0000 Subject: [PATCH 051/154] Use "@rule" syntax for make example. [SVN r33635] --- example/make/Jamroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/make/Jamroot b/example/make/Jamroot index 03724f900..3fb84856f 100644 --- a/example/make/Jamroot +++ b/example/make/Jamroot @@ -7,7 +7,7 @@ exe main : main.cpp ; # Create 'main.cpp' from 'main.cpp.pro' using action # 'do-something' defined below. # -make main.cpp : main.cpp.pro : do-something ; +make main.cpp : main.cpp.pro : @do-something ; # In this example, we'll just copy a file. # Need to find out the name of a command to copy a file. From 3a4cbec7b3cfa39f9a639cd7814ba4609b6cf510 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 12:48:43 +0000 Subject: [PATCH 052/154] Revive boostbook.py tests, working around BoostBook dislike of classes outside of any namespaces. [SVN r33636] --- test/boostbook/a.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/boostbook/a.hpp b/test/boostbook/a.hpp index 6375c0a82..8d7ac1b24 100644 --- a/test/boostbook/a.hpp +++ b/test/boostbook/a.hpp @@ -1,7 +1,12 @@ +// Seems like Boostbook does like classes outside of namespaces, +// and won't generate anything for them. +namespace boost { + /// A class class A { public: /// A constructor A(); }; +} \ No newline at end of file From b31d716fb7bfc6f1661ff4d49a717f02fefcf91a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 13:05:26 +0000 Subject: [PATCH 053/154] Add a couple of tests for examples. [SVN r33637] --- test/example_libraries.py | 22 ++++++++++++++++++++++ test/example_qt4.py | 26 ++++++++++++++++++++++++++ test/test_all.py | 7 ++----- 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 test/example_libraries.py create mode 100644 test/example_qt4.py diff --git a/test/example_libraries.py b/test/example_libraries.py new file mode 100644 index 000000000..21421f685 --- /dev/null +++ b/test/example_libraries.py @@ -0,0 +1,22 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'libraries' example. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/libraries") + +t.run_build_system() + +t.expect_addition(["app/bin/$toolset/debug/app", + "util/foo/bin/$toolset/debug/bar.dll"]) + + +t.cleanup() diff --git a/test/example_qt4.py b/test/example_qt4.py new file mode 100644 index 000000000..e10423d1d --- /dev/null +++ b/test/example_qt4.py @@ -0,0 +1,26 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'qt4' examples. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/qt/qt4/hello") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/arrow"]) + +t.set_tree("../example/qt/qt4/moccable-cpp") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/main"]) + +t.set_tree("../example/qt/qt4/uic") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/hello"]) + +t.cleanup() diff --git a/test/test_all.py b/test/test_all.py index 298359b05..56d571864 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -140,6 +140,7 @@ tests = [ "rebuilds", "clean", "lib_source_property", "implicit_dependency", + "example_libraries", ] if os.name == 'posix': @@ -155,13 +156,9 @@ if os.name == 'posix': if string.find(get_toolset(), 'gcc') == 0: tests.append("gcc_runtime") -if os.environ.has_key('QTDIR'): - tests.append("railsys") -else: - print 'skipping railsys test since QTDIR environment variable is unset' - if "--extras" in sys.argv: tests.append("boostbook") + tests.append("example_qt4") else: print 'Note: skipping extra tests' From 79b92f0dc521add589bddcfb606e981f3d5ba42a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 13:06:03 +0000 Subject: [PATCH 054/154] Summarize M11 changes. [SVN r33638] --- notes/changes.txt | 94 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/notes/changes.txt b/notes/changes.txt index 1bdf422af..3f7bb7021 100644 --- a/notes/changes.txt +++ b/notes/changes.txt @@ -1,5 +1,97 @@ -Milestone 10 () +Milestone 11 (not yet released) + +Changes in this release: + + - New C++ compilers: IBM xlf, HP aCC, HP CXX, Intel fortran compiler. + - New tools: Qt4 support, MS message compiler and IDL compiler. + - New main targets: 'notfile' and 'cast'. + + - Core changes: + + - Only one file required at top level of a project, named Jamroot. + - Jamfiles can now contain project-specific help messages. + - "Indirect conditional requirements" introduced + (http://tinyurl.com/mn3jp) + - Strip suffix in main target names when computing names of generated + files (URL) + - The 'source-location' project attribute can contain + several directories. + - Usage requirements are propagated not only direct dependents, + but to indirect dependents. + + - Command line option changes (see http://tinyurl.com/zbycz) + - New option --build-dir + - The --clean option cleans only target below the current directory, + not globally. + - New --clean-all option was added. + - New option --debug-building + - Running "bjam some_directory" works even if there's no Jamfile + in the current directory. + + - Toolset improvements: + - Assembling support with gcc, borland and msvc. + - Support amd64/ia64 cross-compiling with msvc. + - Improved, registry-based autodetection for msvc. + - Serialize execution of gcc.link actions + - Precompiled headers supported on MSVC + (Need documentation) + + - New features and + - The 'glob' rule accepts wildcards in directory names. + - The 'stage' rule was renamed to 'install' + (the old name still available for compatibility) + - The feature can accept user-defined function as value + (URL) + - The 'install' rule can install a directory hierarchy preserving relative + paths. + - The 'install' rule no longer allows to change library + name during install. + - The Jamfile referred via 'use-project' may declare project id different + from the one in 'use-project'. + - The 'using' rule now searches the directory of containing Jamfile. + + +The following bugs were fixed: + + - The feature was ignored for static linking + - Fix #include scanning for C files. + - Child projects were sometimes loaded before parent projects. + - Fix project references with absolute paths on Windows. + - The feature was ignored for 'install' targets. + - A generator having the same type in sources and targets was causing hang. + - Use 'icpc' command for Intel, fixing errors with 8.1 and higher. + - Generation of PS files with the FOP tool really produces .PS files. + - No dependency scanning was done for C files. + - The 'constant' and 'path-constant' rules did not accept multi-element + value. + - Don't pass -fcoalesce-templates to gcc on OSX 10.4 + - Fix static lib suffix on OSX. + - Fix rpath setting on Intel/Linux. + - The 'install' rule don't unnecessary scans #includes in installed + headers. + + +Developer visible changes: + + - Ability to customize type's prefix depending on build properties. + - Generator's 'run' method can return usage-requirements. + - Main target rule is automatically declared for each new target type. + - 'Link incompatible' feature attribute was removed + - Generators no longer bypass unhandled sources, they just ignore them. + - If there are several applicable generators, immediately report ambiguity. + Provide a way to explicitly resolve conflicts between generators. + - The 'flags' rule can match absense of feature. + - Great improvement in response files handling + - The 'toolset.flags' rules allows value-less feature to signify + absense of this feature (fix hack-hack). + - Automatically declare main target rule for each declared target type. + - When inheriting types, inherit generators for the base type, as opposed + to using various hacks to invoke base generators when needed. + - Improve diagnostic for "duplicate actual target" and generator ambiguity. + + +Milestone 10 (October 29, 2004) Changes in this release: From 43625aa81bcce455bc4e9a6d1e2f70c226c18433 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 06:00:58 +0000 Subject: [PATCH 055/154] Unbreak versioned config for sun compiler. Thanks to Doug Gregor for the bug report. [SVN r33652] --- src/tools/sun.jam | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tools/sun.jam b/src/tools/sun.jam index 0c951a35f..e00799d58 100644 --- a/src/tools/sun.jam +++ b/src/tools/sun.jam @@ -16,7 +16,6 @@ feature.extend toolset : sun ; toolset.inherit sun : unix ; generators.override sun.prebuilt : builtin.lib-generator ; generators.override sun.searched-lib-generator : searched-lib-generator ; -feature.subfeature toolset sun : version ; feature.extend stdlib : sun-stlport ; feature.compose sun-stlport From c932264ba1c3caddc1c1bce810984b19e4c63848 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 06:14:44 +0000 Subject: [PATCH 056/154] Workaround broken -s option with Apple gcc 4.0.x on Darwin. Thanks to Doug Gregor for report and suggested fix. [SVN r33654] --- src/tools/darwin.jam | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/darwin.jam b/src/tools/darwin.jam index b009a85bc..8756d0a56 100644 --- a/src/tools/darwin.jam +++ b/src/tools/darwin.jam @@ -39,6 +39,8 @@ rule init ( version ? : command * : options * ) } gcc.init-link-flags darwin darwin $(condition) ; + + flags darwin.link NEED_STRIP $(condition)/off : "" ; } feature framework : : free ; @@ -56,7 +58,8 @@ _ = " " ; actions link bind LIBRARIES { - $(CONFIG_COMMAND) $(ST_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) $(OPTIONS) + $(CONFIG_COMMAND) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) $(OPTIONS) + $(NEED_STRIP)strip $(NEED_STRIP)"$(<)" } actions link.dll bind LIBRARIES From 06adc0f63ba6f9ed3f312a37a94b448513bfece2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 07:25:48 +0000 Subject: [PATCH 057/154] Tests for more examples. [SVN r33656] --- test/example_customization.py | 23 +++++++++++++++++++++++ test/example_gettext.py | 31 +++++++++++++++++++++++++++++++ test/example_make.py | 20 ++++++++++++++++++++ test/test_all.py | 7 +++++++ 4 files changed, 81 insertions(+) create mode 100644 test/example_customization.py create mode 100644 test/example_gettext.py create mode 100644 test/example_make.py diff --git a/test/example_customization.py b/test/example_customization.py new file mode 100644 index 000000000..fbb12071f --- /dev/null +++ b/test/example_customization.py @@ -0,0 +1,23 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'libraries' example. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/customization") + +t.run_build_system() + +t.expect_addition(["bin/$toolset/debug/codegen.exe", + "bin/$toolset/debug/usage.cpp"]) + + + +t.cleanup() diff --git a/test/example_gettext.py b/test/example_gettext.py new file mode 100644 index 000000000..3fcc4ec04 --- /dev/null +++ b/test/example_gettext.py @@ -0,0 +1,31 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'libraries' example. +from BoostBuild import Tester, List +import os +import string + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/gettext") + +t.run_build_system(stderr=None) + +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) +input = input_fd.read(); + +t.fail_test(string.find(input, "international hello") != 0) + +t.cleanup() diff --git a/test/example_make.py b/test/example_make.py new file mode 100644 index 000000000..3eb360912 --- /dev/null +++ b/test/example_make.py @@ -0,0 +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) + +# Test the 'libraries' example. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/make") + +t.run_build_system() + +t.expect_addition(["bin/$toolset/debug/main.exe"]) + +t.cleanup() diff --git a/test/test_all.py b/test/test_all.py index 56d571864..6f856e782 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -141,6 +141,7 @@ tests = [ "rebuilds", "lib_source_property", "implicit_dependency", "example_libraries", + "example_make", ] if os.name == 'posix': @@ -159,6 +160,12 @@ if string.find(get_toolset(), 'gcc') == 0: if "--extras" in sys.argv: tests.append("boostbook") tests.append("example_qt4") + # Requires ./whatever.py to work, so is + # not guaranted to work everywhere. + tests.append("example_customization") + # Requires gettext tools. + tests.append("example_gettext") + else: print 'Note: skipping extra tests' From e4cd4dfb039b1a917c3d46bfdff57bbfefeca818 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 08:16:35 +0000 Subject: [PATCH 058/154] Disable 'deprecation' warnings when warnings=off. Otherwise, user building with warnings=off will still get some warnings. [SVN r33658] --- src/tools/msvc.jam | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index f8fc21b7d..c7b69be7a 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -399,7 +399,10 @@ local rule configure-version-specific ( version : condition ) { flags msvc.compile CFLAGS $(condition) : /Zc:forScope /Zc:wchar_t ; flags msvc.compile.c++ C++FLAGS $(condition) : /wd4675 ; - flags msvc.compile CFLAGS $(condition)/all : /Wp64 ; # 64-bit compatibility warning + # disable the function is deprecated warning + flags msvc.compile CFLAGS $(condition)/off : /wd4996 ; + # 64-bit compatibility warning + flags msvc.compile CFLAGS $(condition)/all : /Wp64 ; } # From 3c56507060a08b1e22534a578f3fe1e10db05160 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 08:17:22 +0000 Subject: [PATCH 059/154] Clarify comment [SVN r33659] --- src/tools/msvc.jam | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index c7b69be7a..a963957b4 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -399,7 +399,9 @@ local rule configure-version-specific ( version : condition ) { flags msvc.compile CFLAGS $(condition) : /Zc:forScope /Zc:wchar_t ; flags msvc.compile.c++ C++FLAGS $(condition) : /wd4675 ; - # disable the function is deprecated warning + # disable the function is deprecated warning + # Some version of msvc have a bug, that cause deprecation + # warning to be emitted even with /W0 flags msvc.compile CFLAGS $(condition)/off : /wd4996 ; # 64-bit compatibility warning flags msvc.compile CFLAGS $(condition)/all : /Wp64 ; From 34ef669b1758976ab305608a97d3bdbac73bc789 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 12 Apr 2006 07:12:52 +0000 Subject: [PATCH 060/154] Ignore static and don't pass -static to linker on Darwin, as it's not supported by the toolset. Thanks to Doug Gregor for diagnosing this. [SVN r33675] --- src/tools/darwin.jam | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/darwin.jam b/src/tools/darwin.jam index 8756d0a56..c13de782e 100644 --- a/src/tools/darwin.jam +++ b/src/tools/darwin.jam @@ -21,7 +21,11 @@ generators.override darwin.prebuilt : builtin.prebuilt ; generators.override darwin.searched-lib-generator : searched-lib-generator ; toolset.inherit-rules darwin : gcc ; -toolset.inherit-flags darwin : gcc ; +toolset.inherit-flags darwin : gcc + : # On Darwin, static runtime is just not supported. So don't inherit + # any flags settings for static + static + ; # No additional initialization should be necessary rule init ( version ? : command * : options * ) From ddf2e4e8dce6a9dbf0c7773fd4d87277760d0967 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 12 Apr 2006 15:23:15 +0000 Subject: [PATCH 061/154] Revert error message, using "error" rule. [SVN r33678] --- src/build/project.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build/project.jam b/src/build/project.jam index e848cc99f..0a512e523 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -108,8 +108,8 @@ rule load-parent ( location ) if ! $(found) { - error "Could not find parent for project at '$(location)'" - : "Did not find Jamfile or project-root.jam in any parent directory." ; + ECHO "error: Could not find parent for project at '$(location)'" ; + ECHO "error: Did not find Jamfile or project-root.jam in any parent directory." ; EXIT ; } From 1f4ad31bbc4c96f7a28b28bf30f5c04ef1a70caa Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Wed, 12 Apr 2006 22:38:10 +0000 Subject: [PATCH 062/154] fix boost/doc build breakage [SVN r33684] --- doc/Jamfile.v2 | 5 ++++- doc/src/standalone.xml | 27 +++++++++++++++++++++++++++ doc/src/userman.xml | 5 ----- 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 doc/src/standalone.xml diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 708140252..e5e83c479 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -1,8 +1,11 @@ +import quickbook + ; + project tools/build/v2/doc ; -boostbook userman : src/userman.xml +boostbook userman : src/standalone.xml : toc.section.depth=1 doc.standalone=true nav.layout=none diff --git a/doc/src/standalone.xml b/doc/src/standalone.xml new file mode 100644 index 000000000..e53812b79 --- /dev/null +++ b/doc/src/standalone.xml @@ -0,0 +1,27 @@ + + + + + + Boost.Build v2 User Manual + + + + + + + + + + + + + + Boost.Jam documentation + + + + diff --git a/doc/src/userman.xml b/doc/src/userman.xml index e53812b79..ef80b7803 100644 --- a/doc/src/userman.xml +++ b/doc/src/userman.xml @@ -18,10 +18,5 @@ - - Boost.Jam documentation - - From 664b30e0e338e50a4345090c2b737a6b7206e776 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 14 Apr 2006 20:07:35 +0000 Subject: [PATCH 063/154] Fix RC tool to fallback to the null rc type when a real one can't be found. [SVN r33699] --- src/tools/gcc.jam | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 824e79443..41a0e1d0f 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -105,7 +105,7 @@ rule init ( version ? : command * : options * ) #~ - The archive builder. local archiver = [ common.get-invocation-command gcc - : ar : [ feature.get-values : $(options) ] : $(bin) : PATH ] ; + : ar : [ feature.get-values : $(options) ] : $(bin) : search-path ] ; flags gcc.archive .AR $(condition) : $(archiver[1]) ; if $(.debug-configuration) { @@ -115,10 +115,21 @@ rule init ( version ? : command * : options * ) #~ - The resource compiler. local rc = [ common.get-invocation-command gcc - : windres : [ feature.get-values : $(options) ] : $(bin) : PATH ] ; + : windres : [ feature.get-values : $(options) ] : $(bin) : search-path ] ; local rc-type = [ feature.get-values : $(options) ] ; rc-type ?= windres ; + if ! $(rc) + { + #~ If we can't find an RC compiler we fallback to a null RC compiler + #~ that creates empty object files. This allows the same Jamfiles + #~ to work across the board. The null RC uses the assembler to create + #~ the empty objects, so configure that. + local rc = + [ common.get-invocation-command gcc + : as : : $(bin) : search-path ] ; + rc-type = null ; + } rc.configure $(rc) : $(condition) : $(rc-type) ; } From c9c181da31e965c676cb8ef9acee2ef68d3f5586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Sun, 16 Apr 2006 18:15:30 +0000 Subject: [PATCH 064/154] Fixed shadowing of rc variable in if-clause. [SVN r33714] --- src/tools/gcc.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 41a0e1d0f..cde7767eb 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -125,7 +125,7 @@ rule init ( version ? : command * : options * ) #~ that creates empty object files. This allows the same Jamfiles #~ to work across the board. The null RC uses the assembler to create #~ the empty objects, so configure that. - local rc = + rc = [ common.get-invocation-command gcc : as : : $(bin) : search-path ] ; rc-type = null ; From 55d0695f7471645c3cca3d0ee5e399fec41a64f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Mon, 17 Apr 2006 20:59:54 +0000 Subject: [PATCH 065/154] Add QtOpenGL to the list of buildable modules. [SVN r33728] --- src/tools/qt4.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index 72bf1d67d..9f2c63f98 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -96,7 +96,7 @@ rule init ( prefix ) if [ glob $(.prefix)/Jamroot ] { # Import all Qt Modules - local all-libraries = QtCore QtGui QtNetwork QtXml QtSql QtSvg Qt3Support QtTest QtAssistantClient QtUiTools ; + local all-libraries = QtCore QtGui QtNetwork QtXml QtSql QtSvg QtOpenGL Qt3Support QtTest QtAssistantClient QtUiTools ; for local l in $(all-libraries) { alias $(l) From 51d32652034a2855b21a7b8144964ac39515ad15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Tue, 18 Apr 2006 18:57:02 +0000 Subject: [PATCH 066/154] Correct QSql to QtSql in dependency list of Qt3Support. [SVN r33735] --- src/tools/qt4.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index 9f2c63f98..0ca818109 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -218,7 +218,7 @@ rule init ( prefix ) $(.prefix)/include/QtXml ; - lib Qt3Support : QtGui QtNetwork QtXml QSql + lib Qt3Support : QtGui QtNetwork QtXml QtSql : Qt3Support$(suffix_version) release : : # usage-requirements @@ -226,7 +226,7 @@ rule init ( prefix ) QT3_SUPPORT $(.prefix)/include/Qt3Support ; - lib Qt3Support : QtGui QtNetwork QtXml QSql + lib Qt3Support : QtGui QtNetwork QtXml QtSql : Qt3Support$(suffix_debug)$(suffix_version) debug : : # usage-requirements From 89143e97237011ebf60ea2a503ed059a89c82ba6 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 19 Apr 2006 20:13:54 +0000 Subject: [PATCH 067/154] Fix missing online help docs, and refactor to not use header scanning to speed up the parsing of Jamfiles for docs. [SVN r33746] --- src/build-system.jam | 3 -- src/build/project.jam | 2 +- src/kernel/bootstrap.jam | 26 ++++++--- src/options/help.jam | 61 ++++++++++++--------- src/util/doc.jam | 112 +++++++++++++++++++++++++++++---------- src/util/option.jam | 7 +-- 6 files changed, 141 insertions(+), 70 deletions(-) diff --git a/src/build-system.jam b/src/build-system.jam index 90a2a6895..5100dcd74 100755 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -26,7 +26,6 @@ import "class" : new ; import builtin ; import make ; import os ; -import option ; import version ; @@ -141,8 +140,6 @@ if --version in [ modules.peek : ARGV ] } -option.process ; - # We always load project in "." so that 'use-project' directives has # any chance of been seen. Otherwise, we won't be able to refer to diff --git a/src/build/project.jam b/src/build/project.jam index 0a512e523..dd7fe3920 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -204,7 +204,7 @@ JAMFILE ?= [Bb]uild.jam [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam ; # causes this to search not the given directory but the ones above it up # to the directory given in it. # -local rule find-jamfile ( +rule find-jamfile ( dir # The directory(s) to look for a Jamfile. parent-root ? # Optional flag indicating to search for the parent Jamfile. : no-errors ? diff --git a/src/kernel/bootstrap.jam b/src/kernel/bootstrap.jam index 5d8736caf..67b681449 100755 --- a/src/kernel/bootstrap.jam +++ b/src/kernel/bootstrap.jam @@ -1,5 +1,5 @@ # (C) Copyright David Abrahams, 2001. -# (C) Copyright Rene Rivera, 2003. +# (C) Copyright Rene Rivera, 2003 2006. # # See accompanying license for terms and conditions of use. # @@ -112,11 +112,23 @@ IMPORT modules : import : : import ; # import modules ; -# Allow users to override the build system file from the -# command-line (mostly for testing) -local build-system = [ MATCH --build-system=(.*) : $(ARGV) ] ; -build-system ?= build-system ; +# Process option plugins first to alow them to prevent loading +# the rest of the build system. +# +import option ; +local dont-build = [ option.process ] ; -# Use last element in case of multiple command-line options -import $(build-system[-1]) ; +# Should we skip building, i.e. loding the build system, according +# to the options processed? +# +if ! $(dont-build) +{ + # Allow users to override the build system file from the + # command-line (mostly for testing) + local build-system = [ MATCH --build-system=(.*) : $(ARGV) ] ; + build-system ?= build-system ; + + # Use last element in case of multiple command-line options + import $(build-system[-1]) ; +} diff --git a/src/options/help.jam b/src/options/help.jam index 05d1fcb25..c087592ee 100755 --- a/src/options/help.jam +++ b/src/options/help.jam @@ -13,6 +13,7 @@ import sequence ; import set ; import project ; import print ; +import os ; # List of possible modules, but which really aren't. @@ -57,37 +58,36 @@ rule process ( local module-files = [ GLOB $(path-to-modules) : $(m)\\.jam ] ; modules-to-scan += $(module-files[1]) ; } - do-scan $(modules-to-scan[1--2]) ; - do-scan $(modules-to-scan[-1]) : print-help-all ; + do-scan $(modules-to-scan) : print-help-all ; did-help = true ; - + case --help-enable-* : local option = [ MATCH --help-enable-(.*) : $(command) ] ; option = $(option:L) ; set-option $(option) : enabled ; did-help = true ; - + case --help-disable-* : local option = [ MATCH --help-disable-(.*) : $(command) ] ; option = $(option:L) ; set-option $(option) ; did-help = true ; - + case --help-output : set-output $(values[1]) ; did-help = true ; - + case --help-output-file : set-output-file $(values[1]) ; did-help = true ; - + case --help-options : local doc-module-spec = [ split-symbol doc ] ; do-scan $(doc-module-spec[1]) : print-help-options ; did-help = true ; - + case --help-usage : print-help-usage ; did-help = true ; - + case --help : local spec = $(values[1]) ; if $(spec) @@ -114,25 +114,38 @@ rule process ( else { # First print documentation from the current Jamfile, if any. - if [ project.find "." : "." ] + local project-file = + [ project.find-jamfile . : no-error ] + [ project.find-jamfile . parent : no-error ] ; + for local p in $(project-file) { - local m = [ project.load "." ] ; - local help = [ modules.peek $(m) : project-help ] ; - if $(help) - { - print.text "Project-specific help" ; - print.text "" ; - print.text $(help) ; - } + do-scan $(p) : print-help-project $(p) ; } - print-help-top ; + # Next any user-config help. + local user-path = [ os.home-directories ] [ os.environ BOOST_BUILD_PATH ] ; + local user-config = [ GLOB $(user-path) : user-config.jam ] ; + if $(user-config) + { + do-scan $(user-config[1]) : print-help-config user $(user-config[1]) ; + } + + # Next any site-config help. + local site-config = [ GLOB $(user-path) : site-config.jam ] ; + if $(site-config) + { + do-scan $(site-config[1]) : print-help-config site $(site-config[1]) ; + } + + # Then the overall help. + print-help-top ; } did-help = true ; } if $(did-help) { UPDATE all ; + NOCARE all ; } return $(did-help) ; } @@ -153,11 +166,11 @@ local rule split-symbol ( local module-path = [ GLOB $(path-to-modules) : $(module-name)\\.jam ] ; if $(module-path) { - # The 'module-name' in fact refers to module. Return the full - # module path and a symbol within it. If 'symbol' passed to this - # rule is already module, 'symbol-name' will be empty. Otherwise, - # it's initialized on the previous loop iteration. - # In case there are several modules by this name, + # The 'module-name' in fact refers to module. Return the full + # module path and a symbol within it. If 'symbol' passed to this + # rule is already module, 'symbol-name' will be empty. Otherwise, + # it's initialized on the previous loop iteration. + # In case there are several modules by this name, # use the first one. result = $(module-path[1]) $(symbol-name) ; } diff --git a/src/util/doc.jam b/src/util/doc.jam index aedd38304..1c79c54df 100644 --- a/src/util/doc.jam +++ b/src/util/doc.jam @@ -570,6 +570,41 @@ local rule print-help-variables ( } } +# Generate documentation for a project. +# +local rule print-help-project ( + unused ? + : jamfile * # The project Jamfile. + ) +{ + if $(jamfile<$(jamfile)>.docs[1]) + { + # Print the docs. + print.section "Project-specific help" + Project has jamfile at $(jamfile) ; + + print.lines $(jamfile<$(jamfile)>.docs) "" ; + } +} + +# Generate documentation for a config file. +# +local rule print-help-config ( + unused ? + : type # The type of configuration file user or site. + config-file # The configuration Jamfile. + ) +{ + if $(jamfile<$(config-file)>.docs[1]) + { + # Print the docs. + print.section "Configuration help" + Configuration file at $(config-file) ; + + print.lines $(jamfile<$(config-file)>.docs) "" ; + } +} + local rule __test__ { } @@ -808,11 +843,11 @@ local rule scan-class ( rule scan-module ( target # The module file. : text * # The text in the file, one item per line. - : binding + : action * # Rule to call to output docs for the module. ) -{ +{ if $(.option.debug) { ECHO "HELP:" scanning module target '$(target)' ; } - local module-name = $(.module<$(target)>.name) ; + local module-name = $(target:B) ; local module-documented = ; local comment-block = ; local syntax-block = ; @@ -836,6 +871,12 @@ rule scan-module ( # mark as the copy for the module. set-module-copyright $(module-name) : $(comment-block) ; } + else if $(action[1]) in "print-help-project" "print-help-config" + && ! $(jamfile<$(target)>.docs[1]) + { + # special module docs for the project jamfile. + jamfile<$(target)>.docs = $(comment-block) ; + } else if ! $(module-documented) { # document the module. @@ -843,11 +884,9 @@ rule scan-module ( module-documented = true ; } } - for local action in $(.module<$(target)>.actions) + if $(action) { - local action-rule = [ $(action).front ] ; $(action).pop-front ; - local action-args = [ $(action).get ] ; - local ignored = [ $(action-rule) $(module-name) : $(action-args) ] ; + $(action[1]) $(module-name) : $(action[2-]) ; } } @@ -855,6 +894,38 @@ rule scan-module ( # header scanning phase. IMPORT $(__name__) : scan-module : : doc.scan-module ; +# Read in a file using the SHELL builtin and return the +# individual lines as would be done for header scanning. +# +local rule read-file ( + file # The file to read in. + ) +{ + if ! $(.file<$(file)>.lines) + { + local content ; + switch [ modules.peek : OS ] + { + case NT : + content = [ SHELL "TYPE \"$(file)\"" ] ; + + case * : + content = [ SHELL "cat \"$(file)\"" ] ; + } + local lines ; + local nl = " +" ; + local << = "([^$(nl)]*)[$(nl)](.*)" ; + local line+ = [ MATCH "$(<<)" : "$(content)" ] ; + while $(line+) + { + lines += $(line+[1]) ; + line+ = [ MATCH "$(<<)" : "$(line+[2])" ] ; + } + .file<$(file)>.lines = $(lines) ; + } + return $(.file<$(file)>.lines) ; +} # Add a scan action to perform to generate the help documentation. # The action rule is passed the name of the module as the first argument. @@ -866,38 +937,21 @@ local rule do-scan ( : action * # The action rule, plus the secondary arguments to pass to the action rule. ) { - local targets = ; - for local module-file in $(modules) - { - local module-name = $(module-file:B) ; - .module<$(module-file)>.name = $(module-name) ; - if $(action) - { - .module<$(module-file)>.actions += [ class.new vector $(action) ] ; - } - HDRSCAN on $(module-file) = "^(.*).$" ; - HDRRULE on $(module-file) = doc.scan-module ; - NOTFILE $(module-name).scan ; - ALWAYS $(module-name).scan ; - INCLUDES $(module-name).scan : $(module-file) ; - targets += $(module-name).scan ; - } - if $(help-output) = console - { - DEPENDS all : $(targets) ; - } if $(help-output) = text { print.output $(help-output-file).txt plain ; ALWAYS $(help-output-file).txt ; - DEPENDS $(help-output-file).txt : $(targets) ; DEPENDS all : $(help-output-file).txt ; } if $(help-output) = html { print.output $(help-output-file).html html ; ALWAYS $(help-output-file).html ; - DEPENDS $(help-output-file).html : $(targets) ; DEPENDS all : $(help-output-file).html ; } + for local module-file in $(modules[1--2]) + { + scan-module $(module-file) : [ read-file $(module-file) ] ; + } + scan-module $(modules[-1]) : [ read-file $(modules[-1]) ] : $(action) ; } diff --git a/src/util/option.jam b/src/util/option.jam index daa56b011..57944a8b6 100644 --- a/src/util/option.jam +++ b/src/util/option.jam @@ -88,11 +88,6 @@ rule process ( ) } } - if $(dont-build) - { - # Exit without printing "don't know how to build..." and "found 1 target" - # messages. - EXIT ; - } + return $(dont-build) ; } From 4befe28c111159fbec37c5a152eace00cddbc0a9 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 19 Apr 2006 21:10:11 +0000 Subject: [PATCH 068/154] Fix file reading on Windows. [SVN r33748] --- src/util/doc.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/doc.jam b/src/util/doc.jam index 1c79c54df..5f4829709 100644 --- a/src/util/doc.jam +++ b/src/util/doc.jam @@ -14,6 +14,7 @@ import set ; import container ; import "class" ; import sequence ; +import path ; # The type of output to generate. # "console" is formated text echoed to the console (the default); @@ -901,6 +902,7 @@ local rule read-file ( file # The file to read in. ) { + file = [ path.native [ path.root [ path.make $(file) ] [ path.pwd ] ] ] ; if ! $(.file<$(file)>.lines) { local content ; From e021439843607a67c47fcec8057bf8a7f3c21cd2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 13:43:47 +0000 Subject: [PATCH 069/154] Grammar fixes. [SVN r33791] --- src/tools/cast.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cast.jam b/src/tools/cast.jam index cc21f7179..086d2f93c 100644 --- a/src/tools/cast.jam +++ b/src/tools/cast.jam @@ -72,7 +72,7 @@ rule cast ( name type : sources * : requirements * : default-build * if ! $(real-type) { errors.user-error "No type corresponds to main target rule nam '$(type)'" - : "Hint: try lowercase the name" ; + : "Hint: try lowercase name" ; } From 2a544062f573a186045c9c06edf9caa7ccaeb7d8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 13:59:41 +0000 Subject: [PATCH 070/154] Prevent --clean from deleting files that were used as sources of 'cast'. [SVN r33792] --- src/build-system.jam | 13 +++++++++---- test/clean.py | 16 ++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/build-system.jam b/src/build-system.jam index 5100dcd74..96ffbd5e1 100755 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -386,10 +386,15 @@ else if $(clean) for local t in [ virtual-target.all-targets ] { local p = [ $(t).project ] ; - if $(t) in $(targets-to-clean) - || [ is-child [ $(p).project-module ] ] = true - { - to-clean += $(t) ; + + # Remove only derived targets. + if [ $(t).action ] + { + if $(t) in $(targets-to-clean) + || [ is-child [ $(p).project-module ] ] = true + { + to-clean += $(t) ; + } } } local to-clean-actual ; diff --git a/test/clean.py b/test/clean.py index dcd3b5ed5..043f53597 100644 --- a/test/clean.py +++ b/test/clean.py @@ -114,13 +114,17 @@ 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. +t.rm(".") +t.write("Jamroot", """ +import cast ; +cast a cpp : a.h ; +""") +t.write("a.h", "") - - - - - - +t.run_build_system("--clean") +t.expect_nothing("a.h") t.cleanup() From 1479c1fe5f9b632e3f56d69ae0f5a859d9ca4c1f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 14:09:51 +0000 Subject: [PATCH 071/154] Digital Mars fixes. Patch from Arjan Knepper. [SVN r33794] --- src/tools/dmc.jam | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/tools/dmc.jam b/src/tools/dmc.jam index caa610f04..8af8725a8 100644 --- a/src/tools/dmc.jam +++ b/src/tools/dmc.jam @@ -2,6 +2,7 @@ # (C) Copyright Christof Meerwald 2003. # (C) Copyright Aleksey Gurtovoy 2004. +# (C) Copyright Arjan Knepper 2006. # # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at @@ -56,16 +57,23 @@ generators.register-c-compiler dmc.compile.c : C : OBJ : dmc ; # Declare flags -# FIXME: what's this 'debug-store'? -#flags dmc.compile OPTIONS on/object : -g ; -flags dmc.compile OPTIONS on : -g ; -flags dmc.link on : -co ; +# dmc optlink has some limitation on the amount of debug-info included. Therefore only linenumbers are enabled in debug builds. +# flags dmc.compile OPTIONS on : -g ; +flags dmc.compile OPTIONS on : -gl ; +flags dmc.link OPTIONS on : /CO /NOPACKF /DEBUGLI ; +flags dmc.link OPTIONS off : /PACKF ; flags dmc.compile OPTIONS off : -S -o+none ; flags dmc.compile OPTIONS speed : -o+time ; flags dmc.compile OPTIONS space : -o+space ; flags dmc.compile OPTIONS on : -Ae ; flags dmc.compile OPTIONS on : -Ar ; +# FIXME: +# Compiling sources to be linked into a shared lib (dll) the -WD cflag should be used +# Compiling sources to be linked into a static lib (lib) or executable the -WA cflag should be used +# But for some reason the -WD cflag is always in use. +# flags dmc.compile OPTIONS shared : -WD ; +# flags dmc.compile OPTIONS static : -WA ; # Note that these two options actually imply multithreading support on DMC # because there is no single-threaded dynamic runtime library. Specifying @@ -94,16 +102,9 @@ flags dmc LIBRARIES ; flags dmc FINDLIBS ; flags dmc FINDLIBS ; - -# FIXME: what's this? -# flags msvc STDHDRS : $(DMC_ROOT)$(SLASH)include ; - - -# FIXME: how one action handles both linking of executables and -# shared libraries? Does it work for shared libraries at all? actions together link bind LIBRARIES { - "$(.root)link" $(OPTIONS) -delexecutable -noi -implib:"$(<[2])" "$(>)" $(LIBRARIES) , "$(<[1])" , NUL , user32.lib kernel32.lib "$(FINDLIBS:S=.lib)" , "$(<[2]:B).def" + "$(.root)link" $(OPTIONS) /NOI /DE /XN "$(>)" , "$(<[1])" ,, $(LIBRARIES) user32.lib kernel32.lib "$(FINDLIBS:S=.lib)" , "$(<[2]:B).def" } actions together link.dll bind LIBRARIES @@ -112,10 +113,9 @@ actions together link.dll bind LIBRARIES echo DESCRIPTION 'A Library' >> $(<[2]:B).def echo EXETYPE NT >> $(<[2]:B).def echo SUBSYSTEM WINDOWS >> $(<[2]:B).def - echo CODE SHARED EXECUTE >> $(<[2]:B).def - echo DATA WRITE >> $(<[2]:B).def - - "$(.root)link" $(OPTIONS) -delexecutable -noi -implib:"$(<[2])" "$(>)" $(LIBRARIES) , "$(<[1])" , NUL , user32.lib kernel32.lib "$(FINDLIBS:S=.lib)" , "$(<[2]:B).def" + echo CODE EXECUTE READ >> $(<[2]:B).def + echo DATA READ WRITE >> $(<[2]:B).def + "$(.root)link" $(OPTIONS) /NOI /DE /XN /ENTRY:_DllMainCRTStartup /IMPLIB:"$(<[2])" "$(>)" $(LIBRARIES) , "$(<[1])" ,, user32.lib kernel32.lib "$(FINDLIBS:S=.lib)" , "$(<[2]:B).def" } actions compile.c @@ -125,10 +125,10 @@ actions compile.c actions compile.c++ { - "$(.root)dmc" -cpp -c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o"$(<)" "$(>)" + "$(.root)dmc" -cpp -c -Ab $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o"$(<)" "$(>)" } actions together piecemeal archive { - "$(.root)lib" $(OPTIONS) -c -n -p128 "$(<)" "$(>)" + "$(.root)lib" $(OPTIONS) -c -n -p256 "$(<)" "$(>)" } From 870a174d90c8e5d7a4baf530fcbdb929ab6ffffb Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 14:16:07 +0000 Subject: [PATCH 072/154] Adjust for pdf file name change [SVN r33795] --- scripts/roll.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/roll.sh b/scripts/roll.sh index 4f20fa3b1..e63209f9c 100644 --- a/scripts/roll.sh +++ b/scripts/roll.sh @@ -26,11 +26,12 @@ cd doc /home/ghost/Work/boost-rc/tools/jam/src/bin.linuxx86/bjam --v2 /home/ghost/Work/boost-rc/tools/jam/src/bin.linuxx86/bjam --v2 pdf cp `find bin -name "*.pdf"` ../.. +mv standalone.pdf useman.pdf rm -rf bin cd .. # Get the boost logo. -wget http://boost.org/boost-build2/boost.png +wget http://boost.sf.net/boost-build2/boost.png # Adjust the links, so they work with the standalone package perl -pi -e 's%../../../boost.png%boost.png%' index.html From 1f5995bc7181f2f631857e2fcafd8f7b58c62436 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 14:33:59 +0000 Subject: [PATCH 073/154] Extensive editorial changes. Patch from Richard Peters. [SVN r33796] --- doc/src/advanced.xml | 54 +++++++++++++++++++++---------------------- doc/src/extending.xml | 36 ++++++++++++++--------------- doc/src/reference.xml | 20 ++++++++-------- doc/src/tutorial.xml | 4 ++-- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/doc/src/advanced.xml b/doc/src/advanced.xml index 553e85377..8187a1f9e 100644 --- a/doc/src/advanced.xml +++ b/doc/src/advanced.xml @@ -42,7 +42,7 @@ So, to be able to successfully use Boost.Build, you need to know only - three things: + four things: @@ -57,7 +57,7 @@ How the build process works - Some Basics about the Boost.Jam language. See the + Some Basics about the Boost.Jam language. See also the Boost.Jam documentation. @@ -150,8 +150,8 @@ x = [ helper 1 : 2 : 3 ] ; result of the call must be used inside some expression, you need to add brackets around the call, like shown on the second line. -if cond { statements } [ else statement ] - Regular if-statement. The condition is composed of: +if cond { statements } [ else { statements } ] + This is a regular if-statement. The condition is composed of: Literals (true if at least one string is not empty) Comparisons: a @@ -184,11 +184,11 @@ return values ; rule test ( ) { if 1 = 1 { - return "resonable" ; + return "reasonable" ; } return "strange" ; } will return strange, not -resonable. +reasonable. @@ -251,8 +251,8 @@ actions create-file-from-another Configuration The Boost.Build configuration is specified in the file - user-config.jam. You can edit the one in top-level - directory of Boost.Build installation create a copy in your home directory + user-config.jam. You can edit the one in the top-level + directory of Boost.Build installation or create a copy in your home directory and edit that. (See for the exact search paths.) The primary function of that file is to declare which compilers and other tools are available. The simplest syntax to configure @@ -452,7 +452,7 @@ bjam optimization=space Changes build directories for all project roots being built. When this option is specified, all Jamroot files should declare project name. - The build directory for the project root will be computed by contanating + The build directory for the project root will be computed by concatanating the value of the option, the project name specified in Jamroot, and the build dir specified in Jamroot (or bin, if none is specified). @@ -699,7 +699,7 @@ exe c : c.cpp /boost/program_options//program_options ; -
+
Requirements Requirements are the properties that should always be present when building a target. Typically, they are includes and defines: @@ -964,7 +964,7 @@ project tennis build-dir Empty if the parent has no build directory set. - Otherwise, the parent's build directory with with the + Otherwise, the parent's build directory with the relative path from parent to the current project appended to it. @@ -998,7 +998,7 @@ project tennis called Jamroot rather than Jamfile. When loading a project, Boost.Build looks for either Jamroot or - Jamfile. They are handled indentically, except + Jamfile. They are handled identically, except that if the file is called Jamroot, the search for a parent project is not performed. @@ -1171,7 +1171,7 @@ bjam app1 lib1//lib1 gcc debug optimization=full
Building a main target When you request, directly or indirectly, a build of a main target - with specific requirements, the following steps are made. Some brief + with specific requirements, the following steps are done. Some brief explanation is provided, and more details are given in . @@ -1406,7 +1406,7 @@ lib aux : : <name>aux ; - When a library uses another library you should put that another + 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 @@ -1477,15 +1477,15 @@ lib a : a.cpp : <use>b : : <library>b ; The alias rule gives alternative name to - a group of targets. For example, to give name + a group of targets. For example, to give the name core to a group of three other targets with the following code: alias core : im reader writer ; - Using core on the command line, or in source list + Using core on the command line, or in the source list of any other target is the same as explicitly using im, reader, and - writer, just more convenient. + writer, but it is just more convenient. @@ -1539,7 +1539,7 @@ install dist : hello helpers : <location>/usr/bin ; While you can achieve the same effect by changing the target name to /usr/bin, using the location - property is better, because it allows you to use a memnonic target + property is better, because it allows you to use a mnemonic target name. @@ -1565,7 +1565,7 @@ install dist : hello ; will find all targets that hello depends on, and install - all of the which are either executables or libraries. More + 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 -install install : install-bin install-lib ; +alias install : install-bin install-lib ; install install-bin : applications : /usr/bin ; install install-lib : helper : /usr/lib ; @@ -1589,7 +1589,7 @@ install install-lib : helper : /usr/lib ; Because the install rule just copies targets, most free features see the definition of "free" in . - have no effect when used in requirements of the install. + have no effect when used in requirements of the install rule. The only two which matter are dependency and, on Unix, @@ -1895,9 +1895,9 @@ actions echo The value of those features is passed without modification to the - corresponding tools. For cflags that's both C and C++ - compilers, for cxxflags that's C++ compiler and for - linkflags that's linker. The features are handy when + corresponding tools. For cflags that's both the C and C++ + compilers, for cxxflags that's the C++ compiler and for + linkflags that's the linker. The features are handy when you're trying to do something special that cannot be achieved by higher-level feature in Boost.Build. @@ -1908,7 +1908,7 @@ actions echo - The <warnings> feature controls warning level of compilers. It has the following values: + The <warnings> feature controls the warning level of compilers. It has the following values: off - disables all warnings. on - enables default warning level for the tool. @@ -1923,8 +1923,8 @@ actions echo - The <warnings-as-errors> makes it possible treat warnings as errors and abort - compilation on warning. The value on enables this behaviour. The default value is + The <warnings-as-errors> makes it possible to treat warnings as errors and abort + compilation on a warning. The value on enables this behaviour. The default value is off. diff --git a/doc/src/extending.xml b/doc/src/extending.xml index de0ba2a3b..34e1893d9 100644 --- a/doc/src/extending.xml +++ b/doc/src/extending.xml @@ -160,8 +160,8 @@ type.register PLUGIN : : SHARED_LIB ; properties of the base type - in particular generators and suffix. Typically, you'll change the new type in some way. For example, using type.set-generated-target-suffix you can set the suffix for - the new type. Or you can write special generator for the new type. For - example, it can generate additional metainformation for plugin. + the new type. Or you can write special a generator for the new type. For + example, it can generate additional metainformation for the plugin. In either way, the PLUGIN type can be used whenever SHARED_LIB can. For example, you can directly link plugins to an application. @@ -195,7 +195,7 @@ class verbatim-scanner : common-scanner All the complex logic is in the common-scanner class, and you only need to override the method that returns the regular expression to be used for scanning. The - paranthethis in the regular expression indicate which part + parentheses in the regular expression indicate which part of the string is the name of the included file. Only the first parenthesized group in the regular expression will be recognized; if you can't express everything you want that @@ -212,7 +212,7 @@ scanner.register verbatim-scanner : include ; of paths that should be searched for the included files. - Finally, we assign the new scaner to the VERBATIM + Finally, we assign the new scanner to the VERBATIM target type: type.set-scanner VERBATIM : verbatim-scanner ; @@ -233,7 +233,7 @@ type.set-scanner VERBATIM : verbatim-scanner ; For each additional tool, a Boost.Build object called generator must be created. That object has specific types of targets that it - accepts an produces. Using that information, Boost.Build is able + accepts and produces. Using that information, Boost.Build is able to automatically invoke the generator. For example, if you declare a generator that takes a target of the type D and produces a target of the type OBJ, when placing a @@ -270,7 +270,7 @@ actions inline-file specified using named "actions" blocks and the name of the action block should be specified when creating targets. By convention, generators use the same name of the action block as their own id. So, - in above example, the "inline-file" actions block will be use to + in above example, the "inline-file" actions block will be used to convert the source into the target. @@ -293,7 +293,7 @@ generators.register-composing mex.mex : CPP LIB : MEX ; is a composing generator corresponding to the proper linker. - You should also know about two specific function for registering + You should also know about two specific functions for registering generators: generators.register-c-compiler and generators.register-linker. The first sets up header dependecy scanning for C files, and the seconds handles various @@ -306,7 +306,7 @@ generators.register-composing mex.mex : CPP LIB : MEX ; Custom generator classes The standard generators allows you to specify source and target - types, action, and a set of flags. If you need anything more complex, + types, an action, and a set of flags. If you need anything more complex, you need to create a new generator class with your own logic. Then, you have to create an instance of that class and register it. Here's @@ -332,7 +332,7 @@ generators.register There are two methods of interest. The run method is responsible for the overall process - it takes a number of source targets, - converts them the the right types, and creates the result. The + converts them to the right types, and creates the result. The generated-targets method is called when all sources are converted to the right types to actually create the result. @@ -344,7 +344,7 @@ generators.register suppose you have a program analysis tool that should be given a name of executable and the list of all sources. Naturally, you don't want to list all source files manually. Here's how the - generated-target method can find the list of + generated-targets method can find the list of sources automatically: class itrace-generator : generator { @@ -375,13 +375,13 @@ generators.register [ new itrace-generator nm.itrace : EXE : ITRACE ] ; The run method can be overriden to completely - customize the way generator works. In particular, the conversion of + customize the way the generator works. In particular, the conversion of sources to the desired types can be completely customized. Here's another real example. Tests for the Boost Python library usually consist of two parts: a Python program and a C++ file. The C++ file is compiled to Python extension that is loaded by the Python program. But in the likely case that both files have the same name, - the created Python extension must be renamed. Otherwise, Python + the created Python extension must be renamed. Otherwise, the Python program will import itself, not the extension. Here's how it can be done: @@ -462,7 +462,7 @@ actions inline-file We first define a new feature. Then, the flags invocation says that whenever verbatin.inline-file action is run, the value of the verbatim-options feature will be added to the - OPTIONS variable, an can be used inside the action body. + OPTIONS variable, and can be used inside the action body. You'd need to consult online help (--help) to find all the features of the toolset.flags rule. and - significally affects the build, make it “propagated,” so that the + significantly affects the build, make it “propagated,” so that the whole project is built with the same value by default @@ -635,7 +635,7 @@ actions link bind DEF_FILE targets in general, only source files." I'm not sure what I meant by that; maybe you can figure it out. --> - We've almost done, but should stop for a small workaround. Add the following + We are almost done, but we should stop for a small workaround. Add the following code to msvc.jam @@ -655,7 +655,7 @@ rule link Variants and composite features. - Sometimes you want to create a shorcut for some set of + Sometimes you want to create a shortcut for some set of features. For example, release is a value of <variant> and is a shortcut for a set of features. @@ -685,7 +685,7 @@ feature.compose <parallelism>fake : <library>/mpi//fake/<parallel - This will allow you to specify value of feature + This will allow you to specify the value of feature parallelism, which will expand to link to the necessary library. @@ -807,7 +807,7 @@ time g++ as the command. Second, while some tools have a logical - "installation root", it's better if user doesn't have to remember whether + "installation root", it's better if the user doesn't have to remember whether a specific tool requires a full command or a path. of the property sets. Each split - part should have the either the form + part should have either the form feature-name=feature-value1[","feature-valueN]* @@ -288,17 +288,17 @@ exe app : app.cpp : <implicit-dependency>parser ; selecting the main target alternative to use, - determining "common" properties + determining "common" properties, building targets referred by the sources list and - dependency properties + dependency properties, adding the usage requirements produces when building - dependencies to the "common" properties + dependencies to the "common" properties, - building the target using generators + building the target using generators, - computing the usage requirements to be returned + computing the usage requirements to be returned. @@ -330,10 +330,10 @@ exe app : app.cpp : <implicit-dependency>parser ; If there's one viable alternative, it's choosen. Otherwise, an attempt is made to find one best alternative. An alternative - a is better than another alternative b, iff set of properties - in b's condition is strict subset of the set of properities of + a is better than another alternative b, iff the set of properties + in b's condition is a strict subset of the set of properities of 'a's condition. If there's one viable alternative, which is - better than all other, it's selected. Otherwise, an error is + better than all others, it's selected. Otherwise, an error is reported. diff --git a/doc/src/tutorial.xml b/doc/src/tutorial.xml index 998335a91..10b7a1c99 100644 --- a/doc/src/tutorial.xml +++ b/doc/src/tutorial.xml @@ -537,7 +537,7 @@ exe e10 : e10.cpp foo ; - When one library uses another, you put the second library is + When one library uses another, you put the second library in the source list of the first. For example: lib utils : utils.cpp /boost/filesystem//fs ; @@ -550,7 +550,7 @@ exe app : app.cpp core ; as a static library, its dependency on utils is passed along to core's dependents, causing app to be linked with both - core and utils." + core and utils. From b512f28e27cd7c76e21a2acd4802ea2a5da3b3d1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 05:35:25 +0000 Subject: [PATCH 074/154] Fix paths [SVN r33801] --- scripts/roll.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/roll.sh b/scripts/roll.sh index e63209f9c..2f206b883 100644 --- a/scripts/roll.sh +++ b/scripts/roll.sh @@ -26,7 +26,7 @@ cd doc /home/ghost/Work/boost-rc/tools/jam/src/bin.linuxx86/bjam --v2 /home/ghost/Work/boost-rc/tools/jam/src/bin.linuxx86/bjam --v2 pdf cp `find bin -name "*.pdf"` ../.. -mv standalone.pdf useman.pdf +mv ../../standalone.pdf ../../userman.pdf rm -rf bin cd .. From f4790c18389c7346eff5bd4b888d6325ec65e16e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 13:10:03 +0000 Subject: [PATCH 075/154] Ignore msvc 8.0 manifests. [SVN r33807] --- test/BoostBuild.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/BoostBuild.py b/test/BoostBuild.py index 070f97e14..c5b4c59a6 100644 --- a/test/BoostBuild.py +++ b/test/BoostBuild.py @@ -479,6 +479,7 @@ class Tester(TestCmd.TestCmd): self.ignore('*.pdb') # msvc program database files self.ignore('*.rsp') # response files self.ignore('*.tds') # borland debug symbols + self.ignore('*.manifest') # msvc DLL manifests # debug builds of bjam built with gcc produce this profiling data self.ignore('gmon.out') From c6622eadc15f2b5075e8876d1b1bc0d0d12583c3 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 13:11:25 +0000 Subject: [PATCH 076/154] Windows fixes [SVN r33808] --- test/example_libraries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/example_libraries.py b/test/example_libraries.py index 21421f685..2d2d468e2 100644 --- a/test/example_libraries.py +++ b/test/example_libraries.py @@ -15,7 +15,7 @@ t.set_tree("../example/libraries") t.run_build_system() -t.expect_addition(["app/bin/$toolset/debug/app", +t.expect_addition(["app/bin/$toolset/debug/app.exe", "util/foo/bin/$toolset/debug/bar.dll"]) From f78581a75ef7a3a9d9353c5db646aaa893492c49 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 13:45:30 +0000 Subject: [PATCH 077/154] Windows fixes [SVN r33809] --- test/searched_lib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/searched_lib.py b/test/searched_lib.py index 8de51dcaf..353d21dea 100644 --- a/test/searched_lib.py +++ b/test/searched_lib.py @@ -26,6 +26,7 @@ t.expect_addition("lib/bin/$toolset/debug/test_lib.dll") # if (os.name == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc': t.copy("lib/bin/$toolset/debug/test_lib.lib", "lib/test_lib.lib") + t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll") else: t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/test_lib.dll") @@ -61,7 +62,7 @@ t.run_build_system() t.expect_addition("bin/$toolset/debug/main.exe") t.rm("bin/$toolset/debug/main.exe") -# Test the 'unit-test' will correctly add runtime paths +# Test that 'unit-test' will correctly add runtime paths # to searched libraries. t.write('Jamfile', """ From 52b6d2cb238baca9277ba4bfde45f167c29f29e1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 14:29:21 +0000 Subject: [PATCH 078/154] Windows fixes [SVN r33810] --- test/library_chain.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/library_chain.py b/test/library_chain.py index a78c681ef..f98de9646 100644 --- a/test/library_chain.py +++ b/test/library_chain.py @@ -7,7 +7,7 @@ # Test that a chain of libraries work ok, not matter if we use static or # shared linking. -from BoostBuild import Tester, List +from BoostBuild import Tester, List, get_toolset import string import os @@ -96,7 +96,7 @@ exe main : main.cpp png ; lib png : z : png ; lib z : : zzz ; """) -t.run_build_system("-a -d+2", status=1, stderr=None) +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. rsp = t.adjust_names("bin/$toolset/debug/main.exe.rsp")[0] @@ -125,8 +125,10 @@ void a() {} t.run_build_system(subdir="a") t.expect_addition("a/bin/$toolset/debug/a.dll") -# FIXME: for Windows, need to link to .lib, not .dll! -file = t.adjust_names(["a/bin/$toolset/debug/a.dll"])[0] +if (os.name == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc': + file = t.adjust_names(["a/bin/$toolset/debug/a.lib"])[0] +else: + file = t.adjust_names(["a/bin/$toolset/debug/a.dll"])[0] t.write("b/Jamfile", """ lib b : b.cpp ../%s ; From 5b65d0b342b59d00fa2e52cc7a334324db52a2d3 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 14:46:15 +0000 Subject: [PATCH 079/154] Windows fixes [SVN r33811] --- test/alternatives.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/alternatives.py b/test/alternatives.py index 5c5ada90e..0c1d91abb 100644 --- a/test/alternatives.py +++ b/test/alternatives.py @@ -85,7 +85,7 @@ t.write("Jamfile", """ exe a : a_empty.cpp ; exe a : a.cpp ; """) -t.run_build_system("--no-error-backtrace", status=1) +t.run_build_system("--no-error-backtrace", status=None) t.fail_test(find(t.stdout(), "No best alternative") == -1) # Another ambiguity test: two matches properties in one alternative are @@ -95,7 +95,7 @@ exe a : a_empty.cpp : off off ; exe a : a.cpp : on ; """) -t.run_build_system("--no-error-backtrace", status=1) +t.run_build_system("--no-error-backtrace", status=None) t.fail_test(find(t.stdout(), "No best alternative") == -1) From 9de5f9cf5140b961ab71c5a63d0e829d18e61f14 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 14:54:32 +0000 Subject: [PATCH 080/154] Create 'failed_test' dir only if test fails [SVN r33812] --- test/BoostBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/BoostBuild.py b/test/BoostBuild.py index c5b4c59a6..239f76975 100644 --- a/test/BoostBuild.py +++ b/test/BoostBuild.py @@ -370,7 +370,7 @@ class Tester(TestCmd.TestCmd): if condition and dump_stdio: self.dump_stdio() - if '--preserve' in sys.argv: + if condition and '--preserve' in sys.argv: print print "*** Copying the state of working dir into 'failed_test' ***" print From 0bd46dfddf6bf741c451ea532c8b6b731014c3d4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 15:20:30 +0000 Subject: [PATCH 081/154] Windows fixed [SVN r33813] --- test/implicit_dependency.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/implicit_dependency.py b/test/implicit_dependency.py index f7ff01789..5fecdd23a 100644 --- a/test/implicit_dependency.py +++ b/test/implicit_dependency.py @@ -20,10 +20,21 @@ explicit a.h ; exe hello : hello.cpp : a.h ; -actions gen-header +import os ; +if [ os.name ] = NT { - echo "int i;" > $(<) -} + actions gen-header + { + echo int i; > $(<) + } +} +else +{ + actions gen-header + { + echo "int i;" > $(<) + } +} """) t.write("hello.cpp", """ From ecca3e63689ebf68330ea8dd9ddea064e0798e78 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 07:34:41 +0000 Subject: [PATCH 082/154] Support [SVN r33822] --- src/tools/msvc.jam | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index a963957b4..19d296ede 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -660,6 +660,8 @@ flags msvc.link FINDLIBS_SA ; flags msvc.link LIBRARY_OPTION msvc : "" : unchecked ; flags msvc.link LIBRARIES_MENTIONED_BY_FILE : ; +flags msvc.archive AROPTIONS ; + rule link.dll ( targets + : sources * : properties * ) { @@ -677,7 +679,7 @@ if [ os.name ] in NT actions archive { if exist "$(<[1])" DEL "$(<[1])" - $(.LD) /lib /NOLOGO /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.LD) /lib /NOLOGO $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" } } else @@ -685,7 +687,7 @@ else actions archive { $(RM) "$(<[1])" - $(.LD) /lib /NOLOGO /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.LD) /lib /NOLOGO $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" } } From 3207599aadc762c517598c286b50997b767de6ae Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 07:37:38 +0000 Subject: [PATCH 083/154] Fix typo [SVN r33823] --- src/tools/como-win.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/como-win.jam b/src/tools/como-win.jam index 73060dfd7..50b48c9d6 100644 --- a/src/tools/como-win.jam +++ b/src/tools/como-win.jam @@ -46,7 +46,7 @@ generators.register-linker como-win.link : como win ; # Note that status of shared libraries support is not clear, so we don't # define the link.dll generator. -generators.register-archiver como-winc.archive +generators.register-archiver como-win.archive : OBJ : STATIC_LIB : como win ; From 98c52ffd035a7323d7dc66f6b3e4b6252193d2f2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 08:30:00 +0000 Subject: [PATCH 084/154] Unbreak como-win. It was using old response files mechanism. [SVN r33824] --- src/tools/como-win.jam | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/tools/como-win.jam b/src/tools/como-win.jam index 50b48c9d6..e1d309133 100644 --- a/src/tools/como-win.jam +++ b/src/tools/como-win.jam @@ -84,19 +84,14 @@ flags como-win FINDLIBS ; flags como-win FINDLIBS ; RM = [ common.rm-command ] ; +nl = " +" ; -#### Link #### - -rule link ( targets + : sources * : properties * ) -{ - common.response-file $(targets) : $(sources) : $(targets[2]) - : $(properties) ; -} # for como, we repeat all libraries so that dependencies are always resolved -actions link bind LIBRARIES RSP +actions link bind LIBRARIES { - $(CONFIG_COMMAND) --no_version --no_prelink_verbose $(LINKFLAGS) -o "$(<[1]:S=)" @"$(RSP:W)" "$(LIBRARIES)" "$(FINDLIBS:S=.lib)" && $(RM) "$(RSP)" + $(CONFIG_COMMAND) --no_version --no_prelink_verbose $(LINKFLAGS) -o "$(<[1]:S=)" @"@($(<[1]:W).rsp:E=$(nl)"$(>)")" "$(LIBRARIES)" "$(FINDLIBS:S=.lib)" } actions compile.c @@ -116,9 +111,9 @@ rule archive ( targets + : sources * : properties * ) common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ; } -actions updated together piecemeal archive bind RSP +actions updated together piecemeal archive { - $(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object @"$(RSP:W)" - lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" @"$(RSP:W)" && $(RM) "$(RSP)" + $(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object "$(LIBRARIES)" + lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" "$(LIBRARIES)" } From 9595046f70e7326d97effd4b385e83d62a68009a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 09:33:55 +0000 Subject: [PATCH 085/154] Handle runtime variants [SVN r33825] --- src/tools/cw.jam | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/tools/cw.jam b/src/tools/cw.jam index 3b0a4ba71..f9048ee88 100644 --- a/src/tools/cw.jam +++ b/src/tools/cw.jam @@ -78,6 +78,22 @@ rule init ( version ? : command * : options * ) flags cw.compile .CC $(condition) : $(prefix)$(compiler) ; flags cw.link .LD $(condition) : $(prefix)$(linker) ; flags cw.archive .LD $(condition) : $(prefix)$(linker) ; + + if [ MATCH ^([89]\\.) : $(version) ] + { + if [ os.name ] = NT + { + # The runtime libraries + flags cw.compile CFLAGS static/single/off : -runtime ss ; + flags cw.compile CFLAGS static/single/on : -runtime ssd ; + + flags cw.compile CFLAGS static/multi/off : -runtime sm ; + flags cw.compile CFLAGS static/multi/on : -runtime smd ; + + flags cw.compile CFLAGS shared/off : -runtime dm ; + flags cw.compile CFLAGS shared/on : -runtime dmd ; + } + } } rule default-paths ( version ? ) # FIXME @@ -100,6 +116,9 @@ rule default-paths ( version ? ) # FIXME return $(possible-paths) ; } + + + ## declare generators generators.register-c-compiler cw.compile.c++ : CPP : OBJ : cw ; From fb75ecee817164b3de4cb765f1f2df3d2522fa47 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 13:28:52 +0000 Subject: [PATCH 086/154] Don't return random value from 'bjam_call'. [SVN r33830] --- src/engine/builtins.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/engine/builtins.c b/src/engine/builtins.c index c9e708a48..20d413b7c 100644 --- a/src/engine/builtins.c +++ b/src/engine/builtins.c @@ -1621,7 +1621,13 @@ bjam_call(PyObject* self, PyObject* args) { /* PySequence_GetItem returns new reference. */ PyObject* e = PySequence_GetItem(a, i); - l = list_new(l, newstr(PyString_AsString(e))); + char* s = PyString_AsString(e); + if (!s) + { + printf("Invalid parameter type passed from Python\n"); + exit(1); + } + l = list_new(l, newstr(s)); Py_DECREF(e); } lol_add(inner->args, l); @@ -1632,6 +1638,8 @@ bjam_call(PyObject* self, PyObject* args) result = evaluate_rule( rulename, inner ); frame_free( inner ); + + return Py_None; } /** Accepts three arguments: module name, rule name and Python callable. From 1e6f0b3d0589b36eb71d7a2b1a927f656bf80bcc Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 27 Apr 2006 15:18:15 +0000 Subject: [PATCH 087/154] Fix runtime library paths for CW. [SVN r33839] --- src/tools/cw.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/cw.jam b/src/tools/cw.jam index f9048ee88..88b111625 100644 --- a/src/tools/cw.jam +++ b/src/tools/cw.jam @@ -45,6 +45,7 @@ rule init ( version ? : command * : options * ) common.handle-options cw : $(condition) : $(command) : $(options) ; + local root = [ feature.get-values : $(options) ] ; if $(command) { command = [ common.get-absolute-tool-path $(command[-1]) ] ; @@ -56,7 +57,11 @@ rule init ( version ? : command * : options * ) # map the batch file in setup so it can be executed other-tools = $(tool-root:D) ; - root = $(other-tools:D) ; + root ?= $(other-tools:D) ; + + flags cw.link RUN_PATH $(condition) : + "$(root)\\Win32-x86 Support\\Libraries\\Runtime" + "$(root)\\Win32-x86 Support\\Libraries\\Runtime\\Libs\\MSL_All-DLLs" ; setup = "set \"CWFOLDER="$(root)"\" && call \""$(setup)"\" > nul " ; From 312f8f0e500d33f5af6e1363b038a728ed5ad1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 5 May 2006 10:22:18 +0000 Subject: [PATCH 088/154] handle command-line arguments as bjam does [SVN r33935] --- src/build/build-request.jam | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/build/build-request.jam b/src/build/build-request.jam index 3fed9469f..82d39b022 100644 --- a/src/build/build-request.jam +++ b/src/build/build-request.jam @@ -125,9 +125,14 @@ rule from-command-line ( command-line * ) local properties ; command-line = $(command-line[2-]) ; + local skip-next = ; for local e in $(command-line) { - if ! [ MATCH "^(-).*" : $(e) ] + if $(skip-next) + { + skip-next = ; + } + else if ! [ MATCH "^(-).*" : $(e) ] { # Build request spec either has "=" in it, or completely # consists of implicit feature values. @@ -142,6 +147,10 @@ rule from-command-line ( command-line * ) targets += $(e) ; } } + else if [ MATCH "^(-[-ldjfsto])$" : $(e) ] + { + skip-next = true ; + } } return [ new vector [ new vector $(targets) ] [ new vector $(properties) ] ] ; } From 748d97865bfc9f717fb49678e13aa11948cf4cb8 Mon Sep 17 00:00:00 2001 From: Matthias Troyer Date: Fri, 5 May 2006 15:34:29 +0000 Subject: [PATCH 089/154] Increased template-depth to accomodate serialization library [SVN r33939] --- src/tools/gcc.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index cde7767eb..92f64e0ca 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -224,7 +224,7 @@ rule compile.c++ actions compile.c++ { - "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-100 $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-128 $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } rule compile.c From c63a37042f20c9b6a027cd381f4f9d253805cc41 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 17 May 2006 12:57:53 +0000 Subject: [PATCH 090/154] Fix / options for using: - Specifying them used to wipe away pre-detected msvc paths. - The OPTIONS variable set by common.handle-options was not used anywhere. Fix default path detection: - Wrong variable name was used. Patch from Ilya Sokolov. [SVN r33982] --- src/tools/msvc.jam | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 19d296ede..f4344cdaf 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -193,18 +193,12 @@ local rule configure-really ( # Register a new configuration $(.versions).register $(version) ; - # Set new options if any - if $(options) - { - $(.versions).set $(version) : options : $(options) ; - } + # Add user-supplied to auto-detected options + options = [ $(.versions).get $(version) : options ] $(options) ; # Mark the configuration as 'used'. $(.versions).use $(version) ; - # Get auto-detected or user-supplied options - options = [ $(.versions).get $(version) : options ] ; - # Generate condition and save it local condition = [ common.check-init-parameters msvc : version $(v) ] ; @@ -477,13 +471,13 @@ rule default-paths ( version ? ) if $(version) { - default-path += [ default-path $(version) ] ; + possible-paths += [ default-path $(version) ] ; } else { for local i in $(.known-versions) { - default-path += [ default-path $(i) ] ; + possible-paths += [ default-path $(i) ] ; } } @@ -557,8 +551,8 @@ flags msvc.compile CFLAGS on/static/ flags msvc.compile CFLAGS off/static/multi : /MT ; flags msvc.compile CFLAGS on/static/multi : /MTd ; -flags msvc.compile USER_CFLAGS : ; -flags msvc.compile.c++ USER_CFLAGS : ; +flags msvc.compile.c OPTIONS : ; +flags msvc.compile.c++ OPTIONS : ; flags msvc.compile PDB_CFLAG on/database : /Fd ; # not used yet @@ -591,17 +585,17 @@ rule compile.pch ( targets + : sources * : properties * ) # The actions differ only by explicit selection of input language actions compile.c bind PCH_HEADER PCH_FILE { - $(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" + $(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" } actions compile.c++ bind PCH_HEADER PCH_FILE { - $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" + $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" } actions compile.pch bind PCH_SOURCE { - $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(PCH_SOURCE:W)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" /Yc"$(>[1]:D=)" -Fp"$(<[2]:W)" + $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(PCH_SOURCE:W)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" /Yc"$(>[1]:D=)" -Fp"$(<[2]:W)" } @@ -651,7 +645,7 @@ flags msvc LINKFLAGS wince : /subsystem:windowsce ; flags msvc LINKFLAGS native : /subsystem:native ; flags msvc LINKFLAGS auto : /subsystem:posix ; -flags msvc.link USER_LINKFLAGS ; +flags msvc.link OPTIONS ; flags msvc.link LINKPATH ; @@ -707,7 +701,7 @@ if [ os.name ] in NT { actions link bind DEF_FILE { - $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" if exist "$(<[1]).manifest" ( mt -nologo -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);1" ) @@ -715,7 +709,7 @@ if [ os.name ] in NT actions link.dll bind DEF_FILE { - $(.LD) /NOLOGO /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.LD) /NOLOGO /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /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:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" if exist "$(<[1]).manifest" ( mt -nologo -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);2" ) @@ -725,7 +719,7 @@ else { actions link bind DEF_FILE { - $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" if test -e "$(<[1]).manifest"; then $(.MT) -nologo -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);1" fi @@ -733,7 +727,7 @@ else actions link.dll bind DEF_FILE { - $(.LD) /NOLOGO /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.LD) /NOLOGO /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /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:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" if test -e "$(<[1]).manifest"; then $(.MT) -nologo -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);2" fi From 4a8143b8226ea65f559356bea508ed5123955c7e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 06:32:16 +0000 Subject: [PATCH 091/154] Allow empty list of source types in call to generators.register-composing. [SVN r33993] --- src/build/generators.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/generators.jam b/src/build/generators.jam index 7390f945c..66588a715 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -645,7 +645,7 @@ rule register-standard ( id : source-types * : target-types + : requirements * ) # Creates new instance of the 'composing-generator' class 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) ] ; From e76518b57a51ce1762d80baf0f543858d4d94049 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 09:15:03 +0000 Subject: [PATCH 092/154] Fix a bug that prevented parent attributes from being inherited. [SVN r33995] --- src/build/project.jam | 12 +++++------- src/build/targets.jam | 4 +--- test/load_order.py | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/build/project.jam b/src/build/project.jam index dd7fe3920..32254750f 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -71,13 +71,11 @@ rule load ( jamfile-location ) # after parent projects. In particular, because parent projects # define attributes whch are inherited by children, and we don't # want children to be loaded before parents has defined everything. - # So, for "build-project" and "use-project" we only record relevant - # information, and actually load the mentioned projects after - # loading the current Jamfile. - for local p in [ attribute $(module-name) projects-to-build ] - { - load [ path.root $(p) $(jamfile-location) ] ; - } + # + # While "build-project" and "use-project" can potentially refer + # to child projects from parent projects, we don't immediately + # loading child projects when seing those attributes. Instead, + # we record the minimal information that will be used only later. local used = [ modules.peek $(module-name) : .used-projects ] ; import project ; diff --git a/src/build/targets.jam b/src/build/targets.jam index cab4436e1..d18419348 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -281,9 +281,7 @@ class project-target : abstract-target local self-location = [ get location ] ; for local pn in [ get projects-to-build ] { - local p = [ project.module-name - [ path.root $(pn) $(self-location) ] ] ; - result += [ project.target $(p) ] ; + result += [ find $(pn) ] ; } return $(result) ; diff --git a/test/load_order.py b/test/load_order.py index 535fbafa8..25b4ba803 100644 --- a/test/load_order.py +++ b/test/load_order.py @@ -41,9 +41,35 @@ int main() { return 0; } 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")) +# Regression test: parent requirements were ignored in some cases +t.rm(".") +t.write("Jamroot", """ +build-project src ; +""") + +t.write("src/Jamfile", """ +project : requirements EVERYTHING_OK ; +""") + +t.write("src/app/Jamfile", """ +exe test : 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() From c48bd867cf08e11c459f370d9de84a3ce7ded747 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 10:37:10 +0000 Subject: [PATCH 093/154] Stop intel-linux from failing due unknown name of archiver command. [SVN r33997] --- src/tools/gcc.jam | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 92f64e0ca..db739eae1 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -399,6 +399,12 @@ actions link bind LIBRARIES "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } +# Default value. Mostly for the sake of intel-linux +# that inherits from gcc, but does not has the same +# logic to set the .AR variable. We can put the same +# logic in intel-linux, but that's hardly worth the trouble +# as on Linux, 'ar' is always available. +.AR = ar ; flags gcc.archive AROPTIONS ; From 744bec5297f15d825fb3ba9cb071d6daf200181a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 10:37:52 +0000 Subject: [PATCH 094/154] Don't pass -s on Darwin. [SVN r33998] --- src/tools/gcc.jam | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index db739eae1..a0b2b113c 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -333,11 +333,10 @@ rule init-link-flags ( toolset linker condition ) } case darwin : { - # we can't pass -s to ld unless we also pass -static - # so we removed -s completly from OPTIONS and add it - # to ST_OPTIONS - flags $(toolset).link ST_OPTIONS $(condition)/off : -s - : unchecked ; + # 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) : : unchecked ; flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; } From 74f8c07c87b6408f1b07da03c7317a1021a80f53 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 11:02:29 +0000 Subject: [PATCH 095/154] Attempt the fix python on OSX. [SVN r34000] --- src/tools/python.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index c215599a9..e6d016a8d 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -223,7 +223,12 @@ rule init-mac ( version : root ? : includes ? : libraries ? ) flags python.capture-output PYTHON : $(interpreter) ; - PYTHON_FRAMEWORK ?= /System/Library/Frameworks/Python.framework ; + PYTHON_FRAMEWORK ?= $(root) ; + while $(PYTHON_FRAMEWORK:D=) && $(PYTHON_FRAMEWORK:D=) != Python.framework + { + PYTHON_FRAMEWORK = $(PYTHON_FRAMEWORK:D) ; + } + PYTHON_FRAMEWORK = $(PYTHON_FRAMEWORK:D)/Python ; alias python_for_extensions : From 8e9a2657dba7766e4d0fc44a8ede3484e1c7a5d1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 19 May 2006 09:13:37 +0000 Subject: [PATCH 096/154] Minor refactoring [SVN r34024] --- src/build/targets.jam | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/build/targets.jam b/src/build/targets.jam index d18419348..91e992ebe 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -791,21 +791,22 @@ class file-reference : abstract-target rule generate ( properties ) { - return [ property-set.empty ] - [ virtual-target.from-file $(self.name) - : [ location ] + compute-location ; + return [ property-set.empty ] + [ virtual-target.from-file $(self.name) + : $(self.file-location) : $(self.project) ] ; } # Returns true if the referred file really exists; rule exists ( ) { - location ; + compute-location ; return $(self.file-path) ; } # Returns the location of target. Needed by 'testing.jam' - rule location ( ) + rule compute-location ( ) { if ! $(self.file-location) { From 05d518281d7e2bccf9b9dc28948e67b7db7338a5 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 19 May 2006 13:38:57 +0000 Subject: [PATCH 097/154] Restore file-referece.location method. [SVN r34032] --- src/build/targets.jam | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/build/targets.jam b/src/build/targets.jam index 91e992ebe..5c2df682b 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -791,7 +791,7 @@ class file-reference : abstract-target rule generate ( properties ) { - compute-location ; + location ; return [ property-set.empty ] [ virtual-target.from-file $(self.name) : $(self.file-location) @@ -801,12 +801,12 @@ class file-reference : abstract-target # Returns true if the referred file really exists; rule exists ( ) { - compute-location ; + location ; return $(self.file-path) ; } - + # Returns the location of target. Needed by 'testing.jam' - rule compute-location ( ) + rule location ( ) { if ! $(self.file-location) { From bed7507c643d0d0a04db8f43a7ca3ceba40796a0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 21 May 2006 18:21:30 +0000 Subject: [PATCH 098/154] Fix argument mismatch of "libraries *" vs. "libraries +". [SVN r34052] --- src/tools/stlport.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index df50967e4..f976abd72 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -277,7 +277,7 @@ class stlport-target-class : basic-target } } -rule stlport-target ( headers ? : libraries + : version ? ) +rule stlport-target ( headers ? : libraries * : version ? ) { local project = [ project.current ] ; From aafe2d6065864a5e1a39b32e389240738bc7a4e3 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 23 May 2006 14:21:58 +0000 Subject: [PATCH 099/154] Try to preserve relative paths in sources. Based on a patch from Ryan Gallagher. [SVN r34062] --- src/build/generators.jam | 17 +++++++++++++++-- src/build/project.jam | 12 +++++++++++- src/util/path.jam | 23 ++++++++++++++++++++--- test/relative_sources.py | 24 ++++++++++++++++++++++-- 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/src/build/generators.jam b/src/build/generators.jam index 66588a715..c19651f8b 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -105,6 +105,7 @@ class generator import virtual-target ; import "class" : new ; import property ; + import path ; EXPORT class@generator : indent increase-indent decrease-indent generators.dout ; @@ -414,8 +415,20 @@ class generator } } - # Names of sources might include directory. We should strip it. - name = $(name:D=) ; + # See if we need to add directory to the target name. + local dir = [ $(sources[1]).name ] ; + dir = $(dir:D) ; + if $(dir) && + # Never append '..' to target path. + ! [ MATCH .*(\\.\\.).* : $(dir) ] + && + ! [ path.is-rooted $(dir) ] + { + # Relative path is always relative to the source + # directory. Retain it, so that users can have files + # with the same in two different subdirectories. + name = $(dir)/$(name) ; + } } # Assign an action for each target diff --git a/src/build/project.jam b/src/build/project.jam index 32254750f..0e644690c 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -924,7 +924,17 @@ module project-rules # prject. So, just make the name absolute. for local p in $(paths) { - result += [ path.root $(p) [ path.pwd ] ] ; + # If the path is below source location, use relative path. + # Otherwise, use full path just to avoid any ambiguities. + local rel = [ path.relative $(p) $(location) : no-error ] ; + if $(rel) = not-a-child + { + result += [ path.root $(p) [ path.pwd ] ] ; + } + else + { + result += $(rel) ; + } } } else diff --git a/src/util/path.jam b/src/util/path.jam index cedff58a8..2134c1235 100644 --- a/src/util/path.jam +++ b/src/util/path.jam @@ -306,8 +306,9 @@ rule glob-in-parents ( dir : patterns + : upper-limit ? ) # Assuming 'child' is a subdirectory of 'parent', return the relative # path from 'parent' to 'child' # -rule relative ( child parent ) +rule relative ( child parent : no-error ? ) { + local not-a-child ; if $(parent) = "." { return $(child) ; @@ -326,10 +327,26 @@ rule relative ( child parent ) } else { - errors.error $(child) is not a subdir of $(parent) ; + not-a-child = true ; + split1 = ; } } - return [ join $(split2) ] ; + + if $(not-a-child) + { + if $(no-error) + { + return not-a-child ; + } + else + { + errors.error $(child) is not a subdir of $(parent) ; + } + } + else + { + return [ join $(split2) ] ; + } } } diff --git a/test/relative_sources.py b/test/relative_sources.py index 8bab211ad..b94e241a6 100644 --- a/test/relative_sources.py +++ b/test/relative_sources.py @@ -5,10 +5,30 @@ from BoostBuild import Tester t = Tester() -t.write("project-root.jam", "import gcc ;") -t.write("Jamfile", "exe a : src/a.cpp ;") +# Test that relative path to source, 'src', is preserved. +t.write("Jamroot", "exe a : src/a.cpp ;") t.write("src/a.cpp", "int main() { return 0; }\n") t.run_build_system() +t.expect_addition("bin/$toolset/debug/src/a.obj") + + +# Test that the relative path to source is preserved +# when using 'glob'. +t.rm("bin") +t.write("Jamroot", "exe a : [ glob src/*.cpp ] ;") +t.run_build_system() +t.expect_addition("bin/$toolset/debug/src/a.obj") + + +# Test that relative path with ".." is *not* added to +# target path. +t.rm(".") +t.write("Jamroot", "") +t.write("a.cpp", "int main() { return 0; }\n") +t.write("build/Jamfile", "exe a : ../a.cpp ; ") +t.run_build_system(subdir="build") +t.expect_addition("build/bin/$toolset/debug/a.obj") + t.cleanup() From 04cc22508bddc47d2717891c2f7e4bcc76f46af7 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 23 May 2006 14:28:20 +0000 Subject: [PATCH 100/154] Fix CVS address [SVN r34064] --- scripts/nightly.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nightly.sh b/scripts/nightly.sh index 6fb31b868..07f33de5a 100644 --- a/scripts/nightly.sh +++ b/scripts/nightly.sh @@ -7,7 +7,7 @@ set -e cd /tmp rm -rf boost-build -cvs -d :ext:vladimir_prus@cvs.sourceforge.net:/cvsroot/boost co -P -d boost-build boost/tools > /tmp/boost_build_checkout_log +cvs -d :ext:vladimir_prus@boost.cvs.sourceforge.net:/cvsroot/boost co -P -d boost-build boost/tools > /tmp/boost_build_checkout_log mv /tmp/boost_build_checkout_log boost-build/checkout-log cd boost-build/build/v2 ./roll.sh > ../roll-log From 0fd1f6cf7aa5f92bdca98a3240c0864239a8c2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Sch=C3=B6pflin?= Date: Wed, 24 May 2006 10:37:55 +0000 Subject: [PATCH 101/154] Removed -soname option for Tru64. [SVN r34079] --- src/tools/gcc.jam | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index a0b2b113c..b297af9d4 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -189,18 +189,13 @@ if [ os.name ] != CYGWIN && [ os.name ] != NT # to implement and will increase target path length even more. flags gcc.compile OPTIONS shared : -fPIC ; } -if [ os.name ] != NT +if [ os.name ] != NT && [ os.name ] != OSF { - HAVE_SONAME = "" ; + # OSF does have an option called -soname but it doesn't seem to work as + # expected, therefore it has been disabled. - if [ os.name ] = OSF - { - SONAME_OPTION = -soname ; - } - else - { - SONAME_OPTION = -h ; - } + HAVE_SONAME = "" ; + SONAME_OPTION = -h ; } From 84d68a4f35e699a94ef759b89dc8c6540bd6e30c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 25 May 2006 07:59:36 +0000 Subject: [PATCH 102/154] Don't validate properties inside condition, because those properties might involve values that might not be defined, and features that are not defined. [SVN r34084] --- src/build/property.jam | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/build/property.jam b/src/build/property.jam index b4c4169f9..3ad0cd340 100644 --- a/src/build/property.jam +++ b/src/build/property.jam @@ -139,19 +139,12 @@ rule expand-subfeatures-in-conditions ( properties * ) local e ; for local c in $(condition) { - if [ MATCH "^(|)" : $(c:G) ] || - [ MATCH "^()" : $(c:G) ] - { - # It common that condition includes a toolset which - # was never defined, or mentiones subfeatures which - # were never defined. In that case, validation will - # only produce an spirious error, so don't validate. - e += [ feature.expand-subfeatures $(c) : true ] ; - } - else - { - e += [ feature.expand-subfeatures $(c) ] ; - } + # It common that condition includes a toolset which + # was never defined, or mentiones subfeatures which + # were never defined. In that case, validation will + # only produce an spirious error, so prevent + # validation by passing 'true' as second parameter. + e += [ feature.expand-subfeatures $(c) : true ] ; } if $(e) = $(condition) From 77eb712d31022f6c626ce4b554e432847a967bde Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 25 May 2006 08:14:30 +0000 Subject: [PATCH 103/154] 64-bit fixes. Patch from Andreas Fredriksson. [SVN r34086] --- src/engine/pathunix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/pathunix.c b/src/engine/pathunix.c index 94391c3e2..725a51f5f 100644 --- a/src/engine/pathunix.c +++ b/src/engine/pathunix.c @@ -287,11 +287,11 @@ path_parent( PATHNAME *f ) DWORD ShortPathToLongPath(LPCTSTR lpszShortPath,LPTSTR lpszLongPath,DWORD cchBuffer) { - DWORD i=0; + LONG i=0; TCHAR path[_MAX_PATH]={0}; TCHAR ret[_MAX_PATH]={0}; - DWORD pos=0, prev_pos=0; - DWORD len=_tcslen(lpszShortPath); + LONG pos=0, prev_pos=0; + LONG len=_tcslen(lpszShortPath); /* Is the string valid? */ if (!lpszShortPath) { From 0cb799820aa483810b964ead02b36e146ab6d2ab Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sun, 4 Jun 2006 06:55:48 +0000 Subject: [PATCH 104/154] Respect RUN_PATH variable when running Python tests. [SVN r34159] --- src/tools/python.jam | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/python.jam b/src/tools/python.jam index e6d016a8d..3fcd6b446 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -527,6 +527,12 @@ generators.register-standard testing.expect-success rule capture-output ( target : sources * : properties * ) { + # Setup up proper DLL search path. + # Here, $(sources[1]) is python module and $(sources[2]) is + # DLL. Only $(sources[1]) is passed to testing.capture-output, + # so RUN_PATH variable on $(sources[2]) is not consulted. Move it + # over explicitly. + RUN_PATH on $(sources[1]) = [ on $(sources[2]) return $(RUN_PATH) ] ; PYTHONPATH = [ on $(sources[2]) return $(LOCATE) ] ; testing.capture-output $(target) : $(sources[1]) : $(properties) ; local c = [ common.prepend-path-variable-command PYTHONPATH : $(PYTHONPATH) ] ; From 3c57f9b00e13757d97a17ba729a32ec6232e2ea1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 6 Jun 2006 20:42:08 +0000 Subject: [PATCH 105/154] Rewrite version bump script to not have external dependencies. Bump to bjam to 3.1.13. [SVN r34205] --- src/engine/boost-jam.spec | 2 +- src/engine/build.jam | 2 +- src/engine/bump_version.py | 83 ++++++++++++++++++++++++------------- src/engine/debian/copyright | 6 +-- src/engine/patchlevel.h | 6 +-- 5 files changed, 62 insertions(+), 37 deletions(-) diff --git a/src/engine/boost-jam.spec b/src/engine/boost-jam.spec index 0a3a1baaf..c68756c7b 100644 --- a/src/engine/boost-jam.spec +++ b/src/engine/boost-jam.spec @@ -1,5 +1,5 @@ Name: boost-jam -Version: 3.1.12 +Version: 3.1.13 Summary: Build tool Release: 1 Source: %{name}-%{version}.tgz diff --git a/src/engine/build.jam b/src/engine/build.jam index eb066f1b4..32f028bae 100644 --- a/src/engine/build.jam +++ b/src/engine/build.jam @@ -12,7 +12,7 @@ if $(VMS) { . = "_" ; } else { . = "." ; } # Info about what we are building. -_VERSION_ = 3 1 12 ; +_VERSION_ = 3 1 13 ; NAME = boost-jam ; VERSION = $(_VERSION_:J=$(.)) ; RELEASE = 1 ; diff --git a/src/engine/bump_version.py b/src/engine/bump_version.py index 9757f7b6a..9423c4c77 100644 --- a/src/engine/bump_version.py +++ b/src/engine/bump_version.py @@ -7,49 +7,74 @@ # and updates all necessary files. For the time being, it's assumes presense # of 'perl' executable and Debian-specific 'dch' executable. # - -import sys -import string + import os +import os.path +import re +import string +import sys -def spec(version): - os.system("perl -pi -e 's|^Version:.*|Version: %s|' boost-jam.spec" % - string.join(version, ".")) +srcdir = os.path.abspath(os.path.dirname(__file__ )) +docdir = os.path.abspath(os.path.join(srcdir,"..","doc")) -def build_jam(version): - os.system("perl -pi -e 's|^VERSION = .* ;|VERSION = %s\$(.)%s\$(.)%s ;|' build.jam" - % (version[0], version[1], version[2])) +def edit(file,replacements): + print " '%s'..." %(file) + text = open(file,'r').read() + while len(replacements) > 0: + #~ print " '%s' ==> '%s'" % (replacements[0],replacements[1]) + text = re.compile(replacements[0],re.M).subn(replacements[1],text)[0] + replacements = replacements[2:] + #~ print text + open(file,'w').write(text) -def index_html(version): - os.system("perl -pi -e 's|This is version .* of BJam|This is version %s of BJam|' index.html" - % string.join(version, ".")) +def make_edits(version): + edit(os.path.join(srcdir,"boost-jam.spec"), [ + '^Version:.*$','Version: %s' % string.join(version, "."), + ]) -def jam_c(version): - re = "\\*major_version = .*, \\*minor_version = .*, \\*changenum = .*"; - new = ('*major_version = "%02d", *minor_version = "%02d", *changenum = "%02d";' % - (int(version[0]), int(version[1]), int(version[2]))) - os.system("perl -pi -e 's|%s|%s|' jam.c" % (re, new)) + edit(os.path.join(srcdir,"build.jam"), [ + '^_VERSION_ = .* ;$','_VERSION_ = %s %s %s ;' % (version[0], version[1], version[2]), + ]) -def patchlevel(version): - os.system("perl -pi -e 's|VERSION .*|VERSION \"%s\"|' patchlevel.h" % - string.join(version, ".")) + edit(os.path.join(docdir,"bjam.qbk"), [ + '\[version.*\]','[version: %s]' % string.join(version, '.'), + '\[def :version:.*\]','[def :version: %s]' % string.join(version, '.'), + ]) -def dch(version): - os.system("dch --ignore-dirname -v " + string.join(version, ".") + "-1") - -bumpers = [spec, build_jam, index_html, jam_c, patchlevel, dch] + edit(os.path.join(srcdir,"patchlevel.h"), [ + '^#define VERSION_MAJOR .*$', + '#define VERSION_MAJOR %s' % (version[0]), + '^#define VERSION_MINOR .*$', + '#define VERSION_MINOR %s' % (version[1]), + '^#define VERSION_PATCH .*$', + '#define VERSION_PATCH %s' % (version[2]), + '^#define VERSION_MAJOR_SYM .*$', + '#define VERSION_MAJOR_SYM "0%s"' % (version[0]), + '^#define VERSION_MINOR_SYM .*$', + '#define VERSION_MINOR_SYM "%s"' % (version[1]), + '^#define VERSION_PATCH_SYM .*$', + '#define VERSION_PATCH_SYM "%s"' % (version[2]), + '^#define VERSION .*$', + '#define VERSION "%s"' % string.join(version, '.'), + '^#define JAMVERSYM .*$', + '#define JAMVERSYM "JAMVERSION=%s.%s"' % (version[0],version[1]), + ]) def main(): if len(sys.argv) < 2: print "Expect new version as argument" sys.exit(1) - - new_version = string.split(sys.argv[1], ".") - print "Setting version to", new_version - for b in bumpers: - b(new_version) + + version = string.split(sys.argv[1], ".") + print "Setting version to", version + make_edits(version) if __name__ == '__main__': main() + +#~ Copyright 2006 Rene Rivera. +#~ Copyright 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) diff --git a/src/engine/debian/copyright b/src/engine/debian/copyright index 4b4dcbfc8..f72e4e3a9 100644 --- a/src/engine/debian/copyright +++ b/src/engine/debian/copyright @@ -17,9 +17,9 @@ Copyright: Some portions are also: - Copyright 2001-2004 David Abrahams. - Copyright 2002-2005 Rene Rivera. - Copyright 2003-2005 Vladimir Prus. + Copyright 2001-2006 David Abrahams. + Copyright 2002-2006 Rene Rivera. + 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) diff --git a/src/engine/patchlevel.h b/src/engine/patchlevel.h index a1a6df001..2dca9ccd2 100644 --- a/src/engine/patchlevel.h +++ b/src/engine/patchlevel.h @@ -9,9 +9,9 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 1 -#define VERSION_PATCH 12 +#define VERSION_PATCH 13 #define VERSION_MAJOR_SYM "03" #define VERSION_MINOR_SYM "1" -#define VERSION_PATCH_SYM "12" -#define VERSION "3.1.12" +#define VERSION_PATCH_SYM "13" +#define VERSION "3.1.13" #define JAMVERSYM "JAMVERSION=3.1" From f5a8baad1e790a91490d9d5c1fe42fa8ce49f9df Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 6 Jun 2006 23:58:07 +0000 Subject: [PATCH 106/154] Make the action timeout attempt to also close any open dialogs before killing processes. Thanks to Bronek Kozicki. [SVN r34210] --- src/engine/build.bat | 10 +++---- src/engine/build.jam | 10 +++---- src/engine/execnt.c | 64 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 10 deletions(-) diff --git a/src/engine/build.bat b/src/engine/build.bat index 7850eff5c..9699e967b 100644 --- a/src/engine/build.bat +++ b/src/engine/build.bat @@ -210,7 +210,7 @@ if "_%BOOST_JAM_TOOLSET%_" == "_metrowerks_" ( if "_%BOOST_JAM_TOOLSET%_" == "_metrowerks_" ( if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( set PATH=%BOOST_JAM_TOOLSET_ROOT%Other Metrowerks Tools\Command Line Tools;%PATH%) - set BOOST_JAM_CC=mwcc -runtime ss -cwd include -DNT -ladvapi32.lib + set BOOST_JAM_CC=mwcc -runtime ss -cwd include -DNT -lkernel32.lib -ladvapi32.lib -luser32.lib set BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe set BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe set BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe @@ -225,7 +225,7 @@ if "_%BOOST_JAM_TOOLSET%_" == "_msvc_" ( if "_%BOOST_JAM_TOOLSET%_" == "_msvc_" ( if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( set PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%) - set BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd -DNT -DYYDEBUG kernel32.lib advapi32.lib + set BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib set BOOST_JAM_OPT_JAM=/Febootstrap\jam0 set BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0 set BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0 @@ -240,7 +240,7 @@ if "_%BOOST_JAM_TOOLSET%_" == "_vc7_" ( if "_%BOOST_JAM_TOOLSET%_" == "_vc7_" ( if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( set PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%) - set BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd -DNT -DYYDEBUG kernel32.lib advapi32.lib + set BOOST_JAM_CC=cl /nologo /GZ /Zi /MLd -DNT -DYYDEBUG kernel32.lib advapi32.lib user32.lib set BOOST_JAM_OPT_JAM=/Febootstrap\jam0 set BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0 set BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0 @@ -255,7 +255,7 @@ if "_%BOOST_JAM_TOOLSET%_" == "_vc8_" ( if "_%BOOST_JAM_TOOLSET%_" == "_vc8_" ( if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" ( set PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%) - set BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib + set BOOST_JAM_CC=cl /nologo /RTC1 /Zi /MTd -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib set BOOST_JAM_OPT_JAM=/Febootstrap\jam0 set BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0 set BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0 @@ -298,7 +298,7 @@ if "_%BOOST_JAM_TOOLSET%_" == "_gcc-nocygwin_" ( set _known_=1 ) if "_%BOOST_JAM_TOOLSET%_" == "_intel-win32_" ( - set BOOST_JAM_CC=icl -DNT /nologo kernel32.lib advapi32.lib + set BOOST_JAM_CC=icl -DNT /nologo kernel32.lib advapi32.lib user32.lib set BOOST_JAM_OPT_JAM=/Febootstrap\jam0 set BOOST_JAM_OPT_MKJAMBASE=/Febootstrap\mkjambase0 set BOOST_JAM_OPT_YYACC=/Febootstrap\yyacc0 diff --git a/src/engine/build.jam b/src/engine/build.jam index 32f028bae..479b892eb 100644 --- a/src/engine/build.jam +++ b/src/engine/build.jam @@ -177,7 +177,7 @@ toolset intel-win32 icl : /Fe : -D [ opt --release : /ML /O2 /Ob2 /Gy /GF /GA /GB ] [ opt --debug : /MLd /DEBUG /Z7 /Od /Ob0 ] -I$(--python-include) - : kernel32.lib advapi32.lib $(--python-lib[1]) ; + : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## KCC ? toolset kcc KCC : "-o " : -D : @@ -203,7 +203,7 @@ toolset kylix bc++ : -o : -D [ opt --debug : -runtime ssd -opt none -inline off ] -I$(--python-include) ; toolset metrowerks $(mwcc) .link : "-o " : - : -subsystem console -ladvapi32.lib + : -subsystem console -lkernel32.lib -ladvapi32.lib -luser32.lib [ opt --release : -runtime ss ] [ opt --debug : -runtime ssd ] : $(--python-lib[1]) ; @@ -228,7 +228,7 @@ toolset msvc cl : /Fe : -D [ opt --release : /ML /O2 /Ob2 /Gy /GF /GA /GB ] [ opt --debug : /MLd /DEBUG /Z7 /Od /Ob0 ] -I$(--python-include) - : kernel32.lib advapi32.lib $(--python-lib[1]) ; + : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## QNX 6.x GCC 3.x/2.95.3 toolset qcc qcc : "-o " : -D : -Wc,-pedantic @@ -264,14 +264,14 @@ toolset vc7 cl : /Fe : -D [ opt --release : /ML /O2 /Ob2 /Gy /GF /GA /GB ] [ opt --debug : /MLd /DEBUG /Z7 /Od /Ob0 ] -I$(--python-include) - : kernel32.lib advapi32.lib $(--python-lib[1]) ; + : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## Microsoft Visual C++ 2005 toolset vc8 cl : /Fe : -D : /nologo [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ] [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ] -I$(--python-include) - : kernel32.lib advapi32.lib $(--python-lib[1]) ; + : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ; ## VMS/OpenVMS DEC C toolset vmsdecc cc : /OBJECT= : "/DEFINES=(" "," ")" : /STANDARD=VAXC /PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES diff --git a/src/engine/execnt.c b/src/engine/execnt.c index 29a6b6515..1d43df1ce 100644 --- a/src/engine/execnt.c +++ b/src/engine/execnt.c @@ -897,6 +897,67 @@ check_process_exit( return result; } +int is_parent_child(DWORD parent, DWORD child) +{ + HANDLE process_snapshot_h = INVALID_HANDLE_VALUE; + + if (parent == child) + return 1; + + process_snapshot_h = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); + if (INVALID_HANDLE_VALUE != process_snapshot_h) + { + BOOL ok = TRUE; + PROCESSENTRY32 pinfo; + pinfo.dwSize = sizeof(PROCESSENTRY32); + for ( + ok = Process32First(process_snapshot_h, &pinfo); + ok == TRUE; + ok = Process32Next(process_snapshot_h, &pinfo) ) + { + if (pinfo.th32ProcessID == child && pinfo.th32ParentProcessID) + return is_parent_child(parent, pinfo.th32ParentProcessID); + } + + CloseHandle(process_snapshot_h); + } + + return 0; +} + +int related(HANDLE h, DWORD p) +{ + return is_parent_child(get_process_id(h), p); +} + +BOOL CALLBACK window_enum(HWND hwnd, LPARAM lParam) +{ + char buf[10] = {0}; + HANDLE h = *((HANDLE*) (lParam)); + DWORD pid = 0; + + if (!GetClassNameA(hwnd, buf, 10)) + return TRUE; // failed to read class name + + if (strcmp(buf, "#32770")) + return TRUE; // not a dialog + + GetWindowThreadProcessId(hwnd, &pid); + if (related(h, pid)) + { + PostMessage(hwnd, WM_QUIT, 0, 0); + // just one window at a time + return FALSE; + } + + return TRUE; +} + +void close_alert(HANDLE process) +{ + EnumWindows(&window_enum, (LPARAM) &process); +} + static double running_time(HANDLE process) { @@ -1046,6 +1107,9 @@ my_wait( int *status ) double t = running_time(active_handles[i]); if ( t > (double)globs.timeout ) { + /* the job may have left an alert dialog around, + try and get rid of it before killing */ + close_alert(active_handles[i]); /* we have a "runaway" job, kill it */ kill_all(0,active_handles[i]); /* indicate the job "finished" so we query its status below */ From 3a1816338407f256edbd4a7bbefbd7cd1a1cdec1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Jun 2006 02:16:58 +0000 Subject: [PATCH 107/154] Fix out of order function definitions. [SVN r34211] --- src/engine/execnt.c | 122 ++++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/src/engine/execnt.c b/src/engine/execnt.c index 1d43df1ce..a888a3f67 100644 --- a/src/engine/execnt.c +++ b/src/engine/execnt.c @@ -897,67 +897,6 @@ check_process_exit( return result; } -int is_parent_child(DWORD parent, DWORD child) -{ - HANDLE process_snapshot_h = INVALID_HANDLE_VALUE; - - if (parent == child) - return 1; - - process_snapshot_h = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); - if (INVALID_HANDLE_VALUE != process_snapshot_h) - { - BOOL ok = TRUE; - PROCESSENTRY32 pinfo; - pinfo.dwSize = sizeof(PROCESSENTRY32); - for ( - ok = Process32First(process_snapshot_h, &pinfo); - ok == TRUE; - ok = Process32Next(process_snapshot_h, &pinfo) ) - { - if (pinfo.th32ProcessID == child && pinfo.th32ParentProcessID) - return is_parent_child(parent, pinfo.th32ParentProcessID); - } - - CloseHandle(process_snapshot_h); - } - - return 0; -} - -int related(HANDLE h, DWORD p) -{ - return is_parent_child(get_process_id(h), p); -} - -BOOL CALLBACK window_enum(HWND hwnd, LPARAM lParam) -{ - char buf[10] = {0}; - HANDLE h = *((HANDLE*) (lParam)); - DWORD pid = 0; - - if (!GetClassNameA(hwnd, buf, 10)) - return TRUE; // failed to read class name - - if (strcmp(buf, "#32770")) - return TRUE; // not a dialog - - GetWindowThreadProcessId(hwnd, &pid); - if (related(h, pid)) - { - PostMessage(hwnd, WM_QUIT, 0, 0); - // just one window at a time - return FALSE; - } - - return TRUE; -} - -void close_alert(HANDLE process) -{ - EnumWindows(&window_enum, (LPARAM) &process); -} - static double running_time(HANDLE process) { @@ -1059,6 +998,67 @@ kill_all(DWORD pid, HANDLE process) TerminateProcess(process,-2); } +int is_parent_child(DWORD parent, DWORD child) +{ + HANDLE process_snapshot_h = INVALID_HANDLE_VALUE; + + if (parent == child) + return 1; + + process_snapshot_h = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); + if (INVALID_HANDLE_VALUE != process_snapshot_h) + { + BOOL ok = TRUE; + PROCESSENTRY32 pinfo; + pinfo.dwSize = sizeof(PROCESSENTRY32); + for ( + ok = Process32First(process_snapshot_h, &pinfo); + ok == TRUE; + ok = Process32Next(process_snapshot_h, &pinfo) ) + { + if (pinfo.th32ProcessID == child && pinfo.th32ParentProcessID) + return is_parent_child(parent, pinfo.th32ParentProcessID); + } + + CloseHandle(process_snapshot_h); + } + + return 0; +} + +int related(HANDLE h, DWORD p) +{ + return is_parent_child(get_process_id(h), p); +} + +BOOL CALLBACK window_enum(HWND hwnd, LPARAM lParam) +{ + char buf[10] = {0}; + HANDLE h = *((HANDLE*) (lParam)); + DWORD pid = 0; + + if (!GetClassNameA(hwnd, buf, 10)) + return TRUE; // failed to read class name + + if (strcmp(buf, "#32770")) + return TRUE; // not a dialog + + GetWindowThreadProcessId(hwnd, &pid); + if (related(h, pid)) + { + PostMessage(hwnd, WM_QUIT, 0, 0); + // just one window at a time + return FALSE; + } + + return TRUE; +} + +void close_alert(HANDLE process) +{ + EnumWindows(&window_enum, (LPARAM) &process); +} + static int my_wait( int *status ) { From 90169492028d6bf1da8c5c756feb9bb797c94f68 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Jun 2006 02:59:15 +0000 Subject: [PATCH 108/154] Fix rpm building on Linux installs that have both rpmbuild and rpm. [SVN r34213] --- src/engine/build.jam | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/engine/build.jam b/src/engine/build.jam index 479b892eb..cb6a724bd 100644 --- a/src/engine/build.jam +++ b/src/engine/build.jam @@ -762,7 +762,8 @@ dist.bin = if $(NT) { - zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7z.exe" "7zn.exe" ] ; + zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7z.exe" ] ; + zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7zn.exe" ] ; zip ?= [ GLOB $(PATH) : zip.exe ] ; zip ?= zip ; zip = $(zip[1]) ; @@ -849,7 +850,10 @@ rule .package ( dst-dir : src-files + ) } # RPM distro file. -rpm-tool = [ GLOB $(PATH) : "rpmbuild" "rpm" ] ; +rpm-tool = [ GLOB $(PATH) : "rpmbuild" ] ; +rpm-tool ?= [ GLOB $(PATH) : "rpm" ] ; +rpm-tool = $(rpm-tool[1]) ; +ECHO --- [$(rpm-tool)] ; rule .rpm ( name : source ) { local rpm-arch = ; @@ -878,8 +882,9 @@ rule .rpm ( name : source ) .clean $(name).$(rpm-arch).rpm $(name).src.rpm ; } actions [RPM] { + set -e export BOOST_JAM_TOOLSET="$(toolset)" - $(rpm-tool[1]) -ta $(target-opt)$(arch) $(>) | tee rpm.out + $(rpm-tool) -ta $(target-opt)$(arch) $(>) | tee rpm.out cp `grep -e '^Wrote:' rpm.out | sed 's/^Wrote: //'` . rm -f rpm.out } From 729fdec89e11bd8a228137d1de6299619b4c1321 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Jun 2006 03:00:29 +0000 Subject: [PATCH 109/154] Remove debug message. [SVN r34214] --- src/engine/build.jam | 1 - 1 file changed, 1 deletion(-) diff --git a/src/engine/build.jam b/src/engine/build.jam index cb6a724bd..878017cc0 100644 --- a/src/engine/build.jam +++ b/src/engine/build.jam @@ -853,7 +853,6 @@ rule .package ( dst-dir : src-files + ) rpm-tool = [ GLOB $(PATH) : "rpmbuild" ] ; rpm-tool ?= [ GLOB $(PATH) : "rpm" ] ; rpm-tool = $(rpm-tool[1]) ; -ECHO --- [$(rpm-tool)] ; rule .rpm ( name : source ) { local rpm-arch = ; From 1ef43b04751898ebc713a8633953c7541e05f011 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Jun 2006 03:05:47 +0000 Subject: [PATCH 110/154] Remove warning when building rpm packages. [SVN r34216] --- src/engine/boost-jam.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/boost-jam.spec b/src/engine/boost-jam.spec index c68756c7b..0bac6912c 100644 --- a/src/engine/boost-jam.spec +++ b/src/engine/boost-jam.spec @@ -52,7 +52,7 @@ install -m 755 bin/bjam $RPM_BUILD_ROOT%{_bindir}/bjam-%{version} ln -sf bjam-%{version} $RPM_BUILD_ROOT%{_bindir}/bjam cp -R *.html *.png *.css LICENSE*.txt images jam $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} -find $RPM_BUILD_ROOT -name CVS -type d -depth -exec rm -r {} \; +find $RPM_BUILD_ROOT -name CVS -type d -exec rm -r {} \; %files %defattr(-,root,root) From 84afe1a5f4caf98bdf4200348c0830053ee8385a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 8 Jun 2006 05:05:05 +0000 Subject: [PATCH 111/154] On Sun, always link to the 'rt' library. [SVN r34229] --- src/tools/sun.jam | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tools/sun.jam b/src/tools/sun.jam index e00799d58..05426cb93 100644 --- a/src/tools/sun.jam +++ b/src/tools/sun.jam @@ -29,7 +29,11 @@ rule init ( version ? : command * : options * ) command = [ common.get-invocation-command sun : CC : $(command) : "/opt/SUNWspro/bin" ] ; - + + # Even if the real compiler is not found, put CC to + # command line so that user see command line that would have being executed. + command ?= CC ; + common.handle-options sun : $(condition) : $(command) : $(options) ; command_c = $(command[1--2]) $(command[-1]:B=cc) ; @@ -84,6 +88,9 @@ flags sun.link RPATH ; # it, even though it's bad idea. flags sun.link RPATH ; +# The POSIX real-time library is always needed (nanosleep, clock_gettime etc.) +flags sun.link FINDLIBS-SA : rt ; + rule link ( targets * : sources * : properties * ) { SPACE on $(targets) = " " ; From 2d7da04038b0e4a14afe0ad80e7e4e20ca9b1e71 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 8 Jun 2006 05:14:02 +0000 Subject: [PATCH 112/154] When reporting that now toolsets are configured, mention the URL. [SVN r34231] --- src/build-system.jam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/build-system.jam b/src/build-system.jam index 96ffbd5e1..c0747ff4b 100755 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -153,7 +153,8 @@ if ! [ feature.values ] { ECHO "warning: no toolsets are configured." ; ECHO "warning: you won't be able to build C++ programs." ; - ECHO "warning: please consult the documentation." ; + ECHO "warning: please consult the documentation at" ; + ECHO "warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html" ; ECHO ; } From f56c300b236c3c38f7d849c82faeeba4da264bb0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 8 Jun 2006 05:31:39 +0000 Subject: [PATCH 113/154] Revert the path for preserving relative names of sources, since it breaks UBLAS tests. Will reconsider later. [SVN r34233] --- src/build/generators.jam | 17 ++--------------- src/build/project.jam | 12 +----------- src/util/path.jam | 23 +++-------------------- test/relative_sources.py | 24 ++---------------------- 4 files changed, 8 insertions(+), 68 deletions(-) diff --git a/src/build/generators.jam b/src/build/generators.jam index c19651f8b..66588a715 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -105,7 +105,6 @@ class generator import virtual-target ; import "class" : new ; import property ; - import path ; EXPORT class@generator : indent increase-indent decrease-indent generators.dout ; @@ -415,20 +414,8 @@ class generator } } - # See if we need to add directory to the target name. - local dir = [ $(sources[1]).name ] ; - dir = $(dir:D) ; - if $(dir) && - # Never append '..' to target path. - ! [ MATCH .*(\\.\\.).* : $(dir) ] - && - ! [ path.is-rooted $(dir) ] - { - # Relative path is always relative to the source - # directory. Retain it, so that users can have files - # with the same in two different subdirectories. - name = $(dir)/$(name) ; - } + # Names of sources might include directory. We should strip it. + name = $(name:D=) ; } # Assign an action for each target diff --git a/src/build/project.jam b/src/build/project.jam index 0e644690c..32254750f 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -924,17 +924,7 @@ module project-rules # prject. So, just make the name absolute. for local p in $(paths) { - # If the path is below source location, use relative path. - # Otherwise, use full path just to avoid any ambiguities. - local rel = [ path.relative $(p) $(location) : no-error ] ; - if $(rel) = not-a-child - { - result += [ path.root $(p) [ path.pwd ] ] ; - } - else - { - result += $(rel) ; - } + result += [ path.root $(p) [ path.pwd ] ] ; } } else diff --git a/src/util/path.jam b/src/util/path.jam index 2134c1235..cedff58a8 100644 --- a/src/util/path.jam +++ b/src/util/path.jam @@ -306,9 +306,8 @@ rule glob-in-parents ( dir : patterns + : upper-limit ? ) # Assuming 'child' is a subdirectory of 'parent', return the relative # path from 'parent' to 'child' # -rule relative ( child parent : no-error ? ) +rule relative ( child parent ) { - local not-a-child ; if $(parent) = "." { return $(child) ; @@ -327,26 +326,10 @@ rule relative ( child parent : no-error ? ) } else { - not-a-child = true ; - split1 = ; + errors.error $(child) is not a subdir of $(parent) ; } } - - if $(not-a-child) - { - if $(no-error) - { - return not-a-child ; - } - else - { - errors.error $(child) is not a subdir of $(parent) ; - } - } - else - { - return [ join $(split2) ] ; - } + return [ join $(split2) ] ; } } diff --git a/test/relative_sources.py b/test/relative_sources.py index b94e241a6..8bab211ad 100644 --- a/test/relative_sources.py +++ b/test/relative_sources.py @@ -5,30 +5,10 @@ from BoostBuild import Tester t = Tester() -# Test that relative path to source, 'src', is preserved. -t.write("Jamroot", "exe a : src/a.cpp ;") +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.run_build_system() -t.expect_addition("bin/$toolset/debug/src/a.obj") - - -# Test that the relative path to source is preserved -# when using 'glob'. -t.rm("bin") -t.write("Jamroot", "exe a : [ glob src/*.cpp ] ;") -t.run_build_system() -t.expect_addition("bin/$toolset/debug/src/a.obj") - - -# Test that relative path with ".." is *not* added to -# target path. -t.rm(".") -t.write("Jamroot", "") -t.write("a.cpp", "int main() { return 0; }\n") -t.write("build/Jamfile", "exe a : ../a.cpp ; ") -t.run_build_system(subdir="build") -t.expect_addition("build/bin/$toolset/debug/a.obj") - t.cleanup() From 3a5d4108ca70c87f8a9bc0af6696e1247bad1267 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 12 Jun 2006 20:49:07 +0000 Subject: [PATCH 114/154] Add newly missing arg to match method. [SVN r34291] --- src/tools/stlport.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index f976abd72..5f79f3f9f 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -91,7 +91,7 @@ class stlport-target-class : basic-target self.version.5 = [ MATCH "^(5[.][^.]+).*" : $(version) ] ; } - rule match ( property-set ) + rule match ( property-set debug ? ) { # Override the rule which detects if this basic-target is # suitable for the specified property set. @@ -118,6 +118,11 @@ class stlport-target-class : basic-target } matched ?= no-match ; + if $(debug) + { + ECHO " stlport.match: " $(matched) ; + } + return $(matched) ; } From e6283de5d4e8027d5b8e8aef199eaf8a86ba9b2b Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 13 Jun 2006 15:47:54 +0000 Subject: [PATCH 115/154] Fix calculation of 5.x version number. [SVN r34293] --- src/tools/stlport.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index 5f79f3f9f..19dbedc02 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -88,7 +88,7 @@ class stlport-target-class : basic-target self.headers = $(headers) ; self.libraries = $(libraries) ; self.version = $(version) ; - self.version.5 = [ MATCH "^(5[.][^.]+).*" : $(version) ] ; + self.version.5 = [ MATCH "^(5[.][0123456789]+).*" : $(version) ] ; } rule match ( property-set debug ? ) From 6398c5697327870190ef1303c287477b8a170cee Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 15 Jun 2006 11:13:06 +0000 Subject: [PATCH 116/154] Fix unsupported command-line warnings when using Intel C++. It is inheriting these frags from msvc.jam. [SVN r34310] --- src/tools/msvc.jam | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index f4344cdaf..896833e77 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -423,6 +423,13 @@ local rule configure-version-specific ( version : condition ) # "math" tests will fail. flags msvc.compile CFLAGS $(condition) : /Op ; } + else + { + # 8.0 adds some more options + flags msvc.compile CFLAGS $(condition)/$(cpu-arch-amd64)/ : /favor:blend ; + flags msvc.compile CFLAGS $(condition)/$(cpu-arch-amd64)/$(cpu-type-em64t) : /favor:EM64T ; + flags msvc.compile CFLAGS $(condition)/$(cpu-arch-amd64)/$(cpu-type-amd64) : /favor:AMD64 ; + } } @@ -518,10 +525,6 @@ feature.feature debug-store : object database : propagated ; flags msvc.compile CFLAGS speed : /O2 ; flags msvc.compile CFLAGS space : /O1 ; -flags msvc.compile CFLAGS $(cpu-arch-amd64)/ : /favor:blend ; -flags msvc.compile CFLAGS $(cpu-arch-amd64)/$(cpu-type-em64t) : /favor:EM64T ; -flags msvc.compile CFLAGS $(cpu-arch-amd64)/$(cpu-type-amd64) : /favor:AMD64 ; - flags msvc.compile CFLAGS $(cpu-arch-ia64)/$(cpu-type-itanium) : /G1 ; flags msvc.compile CFLAGS $(cpu-arch-ia64)/$(cpu-type-itanium2) : /G2 ; From 708298cb2f20ce7846f708d04fe4dbc6baba58c1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 16 Jun 2006 21:52:54 +0000 Subject: [PATCH 117/154] Add compiler specific bin dir to lib paths, as it contains important runtime dynamic libraries, for example for mingw. [SVN r34319] --- src/tools/gcc.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index b297af9d4..c6d182bc9 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -90,7 +90,7 @@ rule init ( version ? : command * : options * ) # will pick the right onces. # Note that we don't provide a clean way to build 32-bit binary # with 64-bit compiler, but user can always pass -m32 manually. - local lib_path = $(root)/lib $(root)/lib32 $(root)/lib64 ; + local lib_path = $(root)/bin $(root)/lib $(root)/lib32 $(root)/lib64 ; if $(.debug-configuration) { ECHO notice: using gcc libraries :: $(condition) :: $(lib_path) ; From 2776a44d7db26d24ac9633eb8e7a1b68f13adfef Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 19 Jun 2006 06:51:54 +0000 Subject: [PATCH 118/154] Remove -xarch=generic: 1) When speccifying an architecture using -xarch/-xtarget, it needs to come before the compilation type (e.g. -fast) flags 2) It makes it hard to build 64-bit builds using -xarch=v9,v9a and v9b. Suggestion from Tomas Puverle. [SVN r34353] --- src/tools/sun.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/sun.jam b/src/tools/sun.jam index 05426cb93..9ec4f6e4e 100644 --- a/src/tools/sun.jam +++ b/src/tools/sun.jam @@ -48,7 +48,7 @@ generators.register-c-compiler sun.compile.c++ : CPP : OBJ : sun ; # Declare flags and actions for compilation flags sun.compile OPTIONS on : -g ; flags sun.compile OPTIONS on : -xprofile=tcov ; -flags sun.compile OPTIONS speed : -fast -xarch=generic ; +flags sun.compile OPTIONS speed : -fast ; flags sun.compile OPTIONS space : -xO2 -xspace ; flags sun.compile OPTIONS multi : -mt ; From 32d5000a95856b1a60dab0145c6f600210ad672c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 19 Jun 2006 20:06:57 +0000 Subject: [PATCH 119/154] Use default match logic to prevent variant fallback bugs, where the requested build is ignored and an alternate is used. [SVN r34357] --- src/tools/stlport.jam | 47 ++++++++++++------------------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index 19dbedc02..95b1212f2 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -89,41 +89,15 @@ class stlport-target-class : basic-target self.libraries = $(libraries) ; self.version = $(version) ; self.version.5 = [ MATCH "^(5[.][0123456789]+).*" : $(version) ] ; - } - - rule match ( property-set debug ? ) - { - # Override the rule which detects if this basic-target is - # suitable for the specified property set. - # Basically, just checks that requested version is equal to - # self.version. We could have added stlport-$(version) to - # requirements, but then stlport-$(version) would show in - # the common properties, causing recursive building of ourselfs. - local matched ; - if [ $(property-set).get ] = $(self.version) + local requirements ; + requirements += $(self.version) ; + if $(self.version.5) { - if $(self.version.5) - { - # And for STLport 5.x multi-threading is required. - if [ $(property-set).get ] = multi - { - matched = stlport-$(self.version) ; - } - } - else - { - matched = stlport-$(self.version) ; - } + # For STLport 5.x multi-threading is required. + requirements += multi ; } - matched ?= no-match ; - - if $(debug) - { - ECHO " stlport.match: " $(matched) ; - } - - return $(matched) ; + self.requirements = [ property-set.create $(requirements) ] ; } rule generate ( property-set ) @@ -133,8 +107,13 @@ class stlport-target-class : basic-target # cause a loop in main target references. Remove that property # manually. - property-set = [ property-set.create [ difference - [ $(property-set).raw ] : /stlport//stlport stlport ] ] ; + property-set = [ property-set.create + [ difference + [ $(property-set).raw ] : + /stlport//stlport + stlport + ] + ] ; return [ basic-target.generate $(property-set) ] ; } From 073f6cc405257161b7ecd01e7276f7f5fc0d8994 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 20 Jun 2006 21:28:29 +0000 Subject: [PATCH 120/154] Disable the multi-thread requirement for STLport5 as the match fallback prevents coherent use of build requirements. [SVN r34362] --- src/tools/stlport.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index 95b1212f2..cceafb64a 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -95,7 +95,12 @@ class stlport-target-class : basic-target if $(self.version.5) { # For STLport 5.x multi-threading is required. - requirements += multi ; + #~ requirements += multi ; + + #~ Doesn't currently work as the matching fallback takes over + #~ and matches a build without stlport when threading-multi is not + #~ specified. Question stands as to wether single-thread code + #~ can use the multi-thread STLport. } self.requirements = [ property-set.create $(requirements) ] ; } From a114cab9b43a7e75e06cb766b5c013e9d0707c8f Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Thu, 22 Jun 2006 14:52:49 +0000 Subject: [PATCH 121/154] Common command lines refactored out in msvc.jam. Hardcoded repeatedly used switches like /Zm800 -nologo and /NOLOGO /INCREMENTAL:NO have been moved to one place. [SVN r34376] --- src/tools/msvc.jam | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 896833e77..9bb8369a3 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -343,18 +343,22 @@ local rule configure-really ( "command: '$(command[$(i)])'" ; } - flags msvc.compile .CC $(cond) : $(command[$(i)])$(compiler) ; + flags msvc.compile .CC $(cond) : $(command[$(i)])$(compiler) /Zm800 -nologo ; flags msvc.compile .RC $(cond) : $(command[$(i)])$(resource-compiler) ; flags msvc.compile .ASM $(cond) : $(command[$(i)])$(assembler) ; - flags msvc.link .LD $(cond) : $(command[$(i)])$(linker) ; - flags msvc.archive .LD $(cond) : $(command[$(i)])$(linker) ; + flags msvc.link .LD $(cond) : $(command[$(i)])$(linker) /NOLOGO /INCREMENTAL:NO ; + flags msvc.archive .LD $(cond) : $(command[$(i)])$(linker) /lib /NOLOGO ; flags msvc.compile .IDL $(cond) : $(command[$(i)])$(idl-compiler) ; flags msvc.compile .MC $(cond) : $(command[$(i)])$(mc-compiler) ; if ! [ os.name ] in NT { - flags msvc.link .MT $(cond) : $(command[$(i)])$(manifest-tool) ; + flags msvc.link .MT $(cond) : $(command[$(i)])$(manifest-tool) -nologo ; } + else + { + flags msvc.link .MT $(cond) : $(manifest-tool) -nologo ; + } } } @@ -588,17 +592,17 @@ rule compile.pch ( targets + : sources * : properties * ) # The actions differ only by explicit selection of input language actions compile.c bind PCH_HEADER PCH_FILE { - $(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" + $(.CC) -TC -U$(UNDEFS) $(CFLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" } actions compile.c++ bind PCH_HEADER PCH_FILE { - $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" + $(.CC) -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" } actions compile.pch bind PCH_SOURCE { - $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(PCH_SOURCE:W)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" /Yc"$(>[1]:D=)" -Fp"$(<[2]:W)" + $(.CC) -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(PCH_SOURCE:W)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" /Yc"$(>[1]:D=)" -Fp"$(<[2]:W)" } @@ -676,7 +680,7 @@ if [ os.name ] in NT actions archive { if exist "$(<[1])" DEL "$(<[1])" - $(.LD) /lib /NOLOGO $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.LD) $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" } } else @@ -684,7 +688,7 @@ else actions archive { $(RM) "$(<[1])" - $(.LD) /lib /NOLOGO $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.LD) $(AROPTIONS) /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" } } @@ -704,17 +708,17 @@ if [ os.name ] in NT { actions link bind DEF_FILE { - $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.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:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" if exist "$(<[1]).manifest" ( - mt -nologo -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);1" + $(.MT) -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);1" ) } actions link.dll bind DEF_FILE { - $(.LD) /NOLOGO /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /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:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.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:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" if exist "$(<[1]).manifest" ( - mt -nologo -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);2" + $(.MT) -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);2" ) } } @@ -722,17 +726,17 @@ else { actions link bind DEF_FILE { - $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.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:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" if test -e "$(<[1]).manifest"; then - $(.MT) -nologo -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);1" + $(.MT) -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);1" fi } actions link.dll bind DEF_FILE { - $(.LD) /NOLOGO /DLL $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /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:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" + $(.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:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")" if test -e "$(<[1]).manifest"; then - $(.MT) -nologo -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);2" + $(.MT) -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);2" fi } } From 35630f4c9800c1635184bc00473cd6ff95ff1c59 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 25 Jun 2006 10:06:30 +0000 Subject: [PATCH 122/154] VC8 only has the multi-threaded version of the static run-time libraries, so use that version for single-threaded builds on VC8 and use the single-threaded libraries on the other versions. Reported by Sohail Somani. [SVN r34391] --- src/tools/msvc.jam | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 9bb8369a3..b4cfa4f02 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -426,6 +426,10 @@ local rule configure-version-specific ( version : condition ) # Improve floating-point accuracy. Otherwise, some of C++ Boost's # "math" tests will fail. flags msvc.compile CFLAGS $(condition) : /Op ; + + # 7.1 and below have single-threaded static RTL + flags msvc.compile CFLAGS $(condition)/off/static/single : /ML ; + flags msvc.compile CFLAGS $(condition)/on/static/single : /MLd ; } else { @@ -433,6 +437,10 @@ local rule configure-version-specific ( version : condition ) flags msvc.compile CFLAGS $(condition)/$(cpu-arch-amd64)/ : /favor:blend ; flags msvc.compile CFLAGS $(condition)/$(cpu-arch-amd64)/$(cpu-type-em64t) : /favor:EM64T ; flags msvc.compile CFLAGS $(condition)/$(cpu-arch-amd64)/$(cpu-type-amd64) : /favor:AMD64 ; + + # 8.0 only has multi-threaded static RTL + flags msvc.compile CFLAGS $(condition)/off/static/single : /MT ; + flags msvc.compile CFLAGS $(condition)/on/static/single : /MTd ; } } @@ -553,8 +561,6 @@ flags msvc.compile CFLAGS on : /GR ; flags msvc.compile CFLAGS off/shared : /MD ; flags msvc.compile CFLAGS on/shared : /MDd ; -flags msvc.compile CFLAGS off/static/single : /ML ; -flags msvc.compile CFLAGS on/static/single : /MLd ; flags msvc.compile CFLAGS off/static/multi : /MT ; flags msvc.compile CFLAGS on/static/multi : /MTd ; From 88bd58147e46f1fa391946736d2bdffedfba07a6 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 27 Jun 2006 14:08:14 +0000 Subject: [PATCH 123/154] Work around STLport link requirements when linking static vs. multi thread modes. [SVN r34415] --- src/tools/stlport.jam | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index cceafb64a..bc0f7027f 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -89,20 +89,6 @@ class stlport-target-class : basic-target self.libraries = $(libraries) ; self.version = $(version) ; self.version.5 = [ MATCH "^(5[.][0123456789]+).*" : $(version) ] ; - - local requirements ; - requirements += $(self.version) ; - if $(self.version.5) - { - # For STLport 5.x multi-threading is required. - #~ requirements += multi ; - - #~ Doesn't currently work as the matching fallback takes over - #~ and matches a build without stlport when threading-multi is not - #~ specified. Question stands as to wether single-thread code - #~ can use the multi-thread STLport. - } - self.requirements = [ property-set.create $(requirements) ] ; } rule generate ( property-set ) @@ -246,6 +232,19 @@ class stlport-target-class : basic-target _STLP_NO_OWN_IOSTREAMS=1 _STLP_HAS_NO_NEW_IOSTREAMS=1 ; } + if $(self.version.5) + { + # Version 5.x + if [ $(rproperties).get ] = "single" + { + # Since STLport5 doesn't normally support single-thread + # we force STLport5 into the multi-thread mode. Hence + # getting what other libs provide of single-thread code + # linking against a multi-thread lib. + usage-requirements += + _STLP_THREADS=1 ; + } + } #~ Allow setting up to use STLport by only using the library target #~ /stlport//stlport. From e6b220de4f6d9b02d4e6e2a333fb11705f5e85dc Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 27 Jun 2006 23:39:16 +0000 Subject: [PATCH 124/154] Oops, removed too much of the requirements code. [SVN r34419] --- src/tools/stlport.jam | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index bc0f7027f..cda3be262 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -89,6 +89,10 @@ class stlport-target-class : basic-target self.libraries = $(libraries) ; self.version = $(version) ; self.version.5 = [ MATCH "^(5[.][0123456789]+).*" : $(version) ] ; + + local requirements ; + requirements += $(self.version) ; + self.requirements = [ property-set.create $(requirements) ] ; } rule generate ( property-set ) From 8aedb29fdb56abd9ef64c7b5fc59f8c041d722c3 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Thu, 29 Jun 2006 21:50:00 +0000 Subject: [PATCH 125/154] - New "cc-compile" rule in msvc.jam to reduce code duplication in actions - Minor whitespace fixes in msvc.jam: - tabs > spaces - trailing whitespace has been removed [SVN r34427] --- src/tools/msvc.jam | 57 ++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index b4cfa4f02..961ba2479 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -355,12 +355,12 @@ local rule configure-really ( { flags msvc.link .MT $(cond) : $(command[$(i)])$(manifest-tool) -nologo ; } - else - { + else + { flags msvc.link .MT $(cond) : $(manifest-tool) -nologo ; - } + } } - } + } # Set version-specific flags configure-version-specific $(version) : $(condition) ; @@ -577,41 +577,44 @@ flags msvc.compile PCH_SOURCE ; flags msvc.compile PCH_HEADER on : ; flags msvc.compile PCH_FILE on : ; -rule compile.c ( targets + : sources * : properties * ) +local rule cc-compile ( targets + : sources * : rsp-content * : suffix * ) +{ + CC_RSPLINE on $(<) = [ on $(<) return -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)" -Yu"$(PCH_HEADER:D=)" ] ; +} + +actions cc-compile +{ + $(.CC) @"@($(<[1]:W).rsp:E="$(>)"$(nl) -Fo"$(<[1]:W)"$(nl) $(CC_RSPLINE))" +} + +local rule cc-compile-c-c++ ( targets + : sources * : lang-opt ) { DEPENDS $(<) : [ on $(<) return $(PCH_HEADER) ] ; DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; + cc-compile $(targets) : $(sources) + : [ on $(<) return "$(>)"$(nl) $(CC_RSPLINE) ] + : [ on $(<) return $(lang-opt) -Fp"$(PCH_FILE:W)" ] ; +} + +# The actions differ only by explicit selection of input language +rule compile.c ( targets + : sources * : properties * ) +{ + cc-compile-c-c++ $(<) : $(>) : -TC ; } rule compile.c++ ( targets + : sources * : properties * ) { - DEPENDS $(<) : [ on $(<) return $(PCH_HEADER) ] ; - DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; + cc-compile-c-c++ $(<) : $(>) : -TP ; } rule compile.pch ( targets + : sources * : properties * ) { DEPENDS $(<) : [ on $(<) return $(PCH_SOURCE) ] ; + cc-compile $(<) : $(>) + : [ on $(<) return $(nl)"$(PCH_SOURCE:W)" $(CC_RSPLINE) ] + : [ on $(<) return -Yc"$(>[1]:D=)" -TP -Fp"$(<[2]:W)" ] ; } - -# The actions differ only by explicit selection of input language -actions compile.c bind PCH_HEADER PCH_FILE -{ - $(.CC) -TC -U$(UNDEFS) $(CFLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" -} - -actions compile.c++ bind PCH_HEADER PCH_FILE -{ - $(.CC) -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)" -Fp"$(PCH_FILE:W)" -} - -actions compile.pch bind PCH_SOURCE -{ - $(.CC) -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) @"@($(<[1]:W).rsp:E=$(nl)"$(PCH_SOURCE:W)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" /Yc"$(>[1]:D=)" -Fp"$(<[2]:W)" -} - - actions compile.rc { $(.RC) -l 0x409 -U$(UNDEFS) -D$(DEFINES) -I"$(INCLUDES)" -fo "$(<:W)" "$(>:W)" @@ -718,7 +721,7 @@ if [ os.name ] in NT if exist "$(<[1]).manifest" ( $(.MT) -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);1" ) - } + } actions link.dll bind DEF_FILE { @@ -726,7 +729,7 @@ if [ os.name ] in NT if exist "$(<[1]).manifest" ( $(.MT) -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);2" ) - } + } } else { From 4dd062bff42aea1059b20448b807902141422ff3 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 2 Jul 2006 19:01:52 +0000 Subject: [PATCH 126/154] Make static non-import libs have the "lib" prefix to conform to the bbv1 and auto-link existing practice. [SVN r34446] --- src/tools/types/lib.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/types/lib.jam b/src/tools/types/lib.jam index 21fab6773..e47a0c6fe 100644 --- a/src/tools/types/lib.jam +++ b/src/tools/types/lib.jam @@ -15,9 +15,11 @@ if [ os.on-unix ] type STATIC_LIB : lib a : LIB : NT CYGWIN ; type STATIC_LIB : a : LIB : MACOSX ; type STATIC_LIB : a : 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 ; From de62cd7a45c9b3ab2be2e0117e6777e01f8ec28b Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 2 Jul 2006 22:23:43 +0000 Subject: [PATCH 127/154] Fix a variety of differences in the install process between BBv1 and BBv2... versioned subdir for the headers; stage libs only; default built variants, version tag. [SVN r34448] --- src/tools/package.jam | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tools/package.jam b/src/tools/package.jam index ff9dd0eb0..e44f851bf 100644 --- a/src/tools/package.jam +++ b/src/tools/package.jam @@ -39,14 +39,19 @@ import property ; rule install ( name : requirements * : binaries * : libraries * : headers * ) { - local install-source-root = [ property.select - : $(requirements) ] ; # If 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 : $(requirements) ] ; requirements = [ property.change $(requirements) : ] ; + # + local install-header-subdir + = [ property.select : $(requirements) ] ; + install-header-subdir = /$(install-header-subdir:G=) ; + install-header-subdir ?= "" ; + requirements = [ property.change $(requirements) : ] ; # First, figure out all locations. local prefix = [ option.get prefix : "" ] ; @@ -77,7 +82,8 @@ rule install ( name : requirements * : binaries * : libraries * : headers * ) on LIB ; stage.install $(name)-headers : $(headers) : $(requirements) - $(include-locate) $(install-source-root) ; + $(include-locate)$(install-header-subdir) + $(install-source-root) ; alias $(name) : $(name)-bin $(name)-lib $(name)-headers ; local c = [ project.current ] ; From 3405ecc24805605750123a30f35a0c71be15e2c4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Jul 2006 05:25:40 +0000 Subject: [PATCH 128/154] * rc.jam (init): Set flags for and features. Suggestion from Klaus Nowikow. [SVN r34470] --- src/tools/rc.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/rc.jam b/src/tools/rc.jam index 1929b1564..077e9446c 100644 --- a/src/tools/rc.jam +++ b/src/tools/rc.jam @@ -47,6 +47,8 @@ rule configure ( command ? : condition ? : options * ) { flags rc.compile.resource .RC $(condition) : $(command) ; flags rc.compile.resource .RC_TYPE $(condition) : $(rc-type:L) ; + flags rc.compile.resource DEFINES ; + flags rc.compile.resource INCLUDES ; if $(.debug-configuration) { ECHO notice: using rc compiler :: $(condition) :: $(command) ; From 08bec0da7d62f9fb718bba2fe60d18d5a312a422 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Jul 2006 06:47:20 +0000 Subject: [PATCH 129/154] Make 'use-project' in user-config work. * build/project.jam (load-used-projects): New, extracted from 'load'. (load): Call 'load-used-projects' * build-system.jam: Call 'load-used-projects' for site-config and user-config. Thanks to Andrei Melnikov for the bug report. [SVN r34472] --- src/build-system.jam | 3 ++- src/build/project.jam | 30 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/build-system.jam b/src/build-system.jam index c0747ff4b..e327d0b48 100755 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -99,6 +99,7 @@ if ! $(ignore-config) } modules.load site-config : : $(path) ; + project.load-used-projects site-config ; } @@ -122,7 +123,7 @@ if ! $(ignore-config) } modules.load user-config : : $(user-path) ; - + project.load-used-projects user-config ; } diff --git a/src/build/project.jam b/src/build/project.jam index 32254750f..feecab007 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -76,22 +76,28 @@ rule load ( jamfile-location ) # to child projects from parent projects, we don't immediately # loading child projects when seing those attributes. Instead, # we record the minimal information that will be used only later. - - local used = [ modules.peek $(module-name) : .used-projects ] ; - import project ; - while $(used) - { - local id = $(used[1]) ; - local where = $(used[2]) ; - - project.use $(id) : [ path.root - [ path.make $(where) ] $(jamfile-location) ] ; - used = $(used[3-]) ; - } + load-used-projects $(module-name) ; } return $(module-name) ; } +rule load-used-projects ( module-name ) +{ + local used = [ modules.peek $(module-name) : .used-projects ] ; + local location = [ attribute $(module-name) location ] ; + import project ; + while $(used) + { + local id = $(used[1]) ; + local where = $(used[2]) ; + + project.use $(id) : [ path.root + [ path.make $(where) ] $(location) ] ; + used = $(used[3-]) ; + } +} + + # Note the use of character groups, as opposed to listing # 'Jamroot' and 'jamroot'. With the latter, we'd get duplicate # matches on windows and would have to eliminate duplicates. From 8ab8ea9946ad635417d01b4f2f96e9b04c77d8b8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Jul 2006 07:14:46 +0000 Subject: [PATCH 130/154] Add example of calling Python modules from Boost.Build. [SVN r34474] --- example/python_modules/Jamroot | 5 +++++ example/python_modules/python_helpers.jam | 7 +++++++ example/python_modules/python_helpers.py | 15 +++++++++++++++ example/python_modules/readme.txt | 11 +++++++++++ 4 files changed, 38 insertions(+) create mode 100644 example/python_modules/Jamroot create mode 100644 example/python_modules/python_helpers.jam create mode 100644 example/python_modules/python_helpers.py create mode 100644 example/python_modules/readme.txt diff --git a/example/python_modules/Jamroot b/example/python_modules/Jamroot new file mode 100644 index 000000000..f504aaeb0 --- /dev/null +++ b/example/python_modules/Jamroot @@ -0,0 +1,5 @@ + +import python_helpers ; + +ECHO "test1:" [ python_helpers.test1 ] ; +ECHO "test2:" [ python_helpers.test2 1234 : 5678 ] ; \ No newline at end of file diff --git a/example/python_modules/python_helpers.jam b/example/python_modules/python_helpers.jam new file mode 100644 index 000000000..d21e2d732 --- /dev/null +++ b/example/python_modules/python_helpers.jam @@ -0,0 +1,7 @@ + +# Import the Python rules to Boost.Build +PYTHON_IMPORT_RULE python_helpers : test1 : python_helpers : test1 ; +PYTHON_IMPORT_RULE python_helpers : test2 : python_helpers : test2 ; + +# Make the new rules accessible to everybody who imports us. +EXPORT python_helpers : test1 test2 ; diff --git a/example/python_modules/python_helpers.py b/example/python_modules/python_helpers.py new file mode 100644 index 000000000..4b5839f27 --- /dev/null +++ b/example/python_modules/python_helpers.py @@ -0,0 +1,15 @@ + +# Declare a couple of functions called from Boost.Build +# +# Each function will receive as many arguments as there ":"-separated +# arguments in bjam call. Each argument is a list of strings. +# As a special exception (aka bug), if no arguments are passed in bjam, +# Python function will be passed a single empty list. +# +# All Python functions must return a list of strings, which may be empty. + +def test1(l): + return ["foo", "bar"] + +def test2(l, l2): + return [l[0], l2[0]] \ No newline at end of file diff --git a/example/python_modules/readme.txt b/example/python_modules/readme.txt new file mode 100644 index 000000000..421f771ab --- /dev/null +++ b/example/python_modules/readme.txt @@ -0,0 +1,11 @@ + +This example shows how you can use Python modules from Boost.Build. + +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. \ No newline at end of file From 6e1c7a37041e326d7be0be78ab5fe8344c4504ba Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Mon, 10 Jul 2006 15:37:26 +0000 Subject: [PATCH 131/154] Fix: Support for precompiled headers in msvc.jam was broken by the previous patch [SVN r34500] --- src/tools/msvc.jam | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 961ba2479..8191ac15a 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -577,42 +577,45 @@ flags msvc.compile PCH_SOURCE ; flags msvc.compile PCH_HEADER on : ; flags msvc.compile PCH_FILE on : ; -local rule cc-compile ( targets + : sources * : rsp-content * : suffix * ) +rule get-rspline ( target : lang-opt ) { - CC_RSPLINE on $(<) = [ on $(<) return -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)" -Yu"$(PCH_HEADER:D=)" ] ; + CC_RSPLINE on $(target) = [ on $(target) return $(lang-opt) -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(OPTIONS) -c $(nl)-D$(DEFINES) $(nl)\"-I$(INCLUDES)\" ] ; } -actions cc-compile +rule compile-c-c++ ( targets + : sources * ) { - $(.CC) @"@($(<[1]:W).rsp:E="$(>)"$(nl) -Fo"$(<[1]:W)"$(nl) $(CC_RSPLINE))" + DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ; + DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ; } -local rule cc-compile-c-c++ ( targets + : sources * : lang-opt ) +actions compile-c-c++ { - DEPENDS $(<) : [ on $(<) return $(PCH_HEADER) ] ; - DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; - cc-compile $(targets) : $(sources) - : [ on $(<) return "$(>)"$(nl) $(CC_RSPLINE) ] - : [ on $(<) return $(lang-opt) -Fp"$(PCH_FILE:W)" ] ; + $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" } -# The actions differ only by explicit selection of input language rule compile.c ( targets + : sources * : properties * ) { - cc-compile-c-c++ $(<) : $(>) : -TC ; + C++FLAGS on $(targets[1]) = ; + get-rspline $(targets) : -TC ; + compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; } rule compile.c++ ( targets + : sources * : properties * ) { - cc-compile-c-c++ $(<) : $(>) : -TP ; + get-rspline $(targets[1]) : -TP ; + compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ; +} + +actions compile-pch +{ + $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[1]:W)" -Yc"$(>[1]:D=)" -Fp"$(<[2]:W)" $(CC_RSPLINE))" } rule compile.pch ( targets + : sources * : properties * ) { DEPENDS $(<) : [ on $(<) return $(PCH_SOURCE) ] ; - cc-compile $(<) : $(>) - : [ on $(<) return $(nl)"$(PCH_SOURCE:W)" $(CC_RSPLINE) ] - : [ on $(<) return -Yc"$(>[1]:D=)" -TP -Fp"$(<[2]:W)" ] ; + get-rspline $(targets[1]) : -TP ; + compile-pch $(targets) : $(sources) [ on $(<) return $(PCH_SOURCE) ] ; } actions compile.rc From 41636a56508e46aa4871f7758309a1d37759fb0a Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Mon, 10 Jul 2006 17:54:35 +0000 Subject: [PATCH 132/154] -Yl patch by Bojan Resnik for precompiled headers with debug info [SVN r34502] --- src/tools/msvc.jam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 8191ac15a..661c2d185 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -1,6 +1,7 @@ # Copyright (c) 2003 David Abrahams. # Copyright (c) 2005 Vladimir Prus. # Copyright (c) 2005 Alexey Pakhunov. +# Copyright (c) 2006 Bojan Resnik. # # Use, modification and distribution is subject to the Boost Software # License Version 1.0. (See accompanying file LICENSE_1_0.txt or @@ -608,7 +609,7 @@ rule compile.c++ ( targets + : sources * : properties * ) actions compile-pch { - $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[1]:W)" -Yc"$(>[1]:D=)" -Fp"$(<[2]:W)" $(CC_RSPLINE))" + $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[1]:W)" -Yc"$(>[1]:D=)" -Yl"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[2]:W)" $(CC_RSPLINE))" } rule compile.pch ( targets + : sources * : properties * ) From 5b8b9f4a02a6756566da3b7c864c2af11a7244b4 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 12 Jul 2006 23:11:56 +0000 Subject: [PATCH 133/154] Correct extra-libs logic for QNX [SVN r34520] --- src/tools/python.jam | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 3fcd6b446..534afea0a 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -131,19 +131,14 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) local extra-libs ; - if [ os.name ] = SOLARIS - { - extra-libs = dl ; - } - else if [ os.name ] = OSF || [ os.name ] = QNXTO - { - # Nothing. - } - else - { - extra-libs = dl util ; - } + switch [ os.name ] + { + case SOLARIS : extra-libs = dl ; + case OSF: extra-libs = ; + case QNXTO: extra-libs = util ; + case *: extra-libs = dl util ; + } # On Linux, we don't want to link either Boost.Python or # Python extensions to libpython, so that when extensions @@ -159,7 +154,7 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) ; alias python - : $(extra-libs) + : $(extra-libs) : $(condition) : : $(includes) From 5f65035c81ad80aae61c66e3f76d4bb021beeffd Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 13 Jul 2006 07:39:58 +0000 Subject: [PATCH 134/154] Fix syntax error. [SVN r34521] --- src/tools/python.jam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 534afea0a..d10a6c38c 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -135,9 +135,9 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) switch [ os.name ] { case SOLARIS : extra-libs = dl ; - case OSF: extra-libs = ; - case QNXTO: extra-libs = util ; - case *: extra-libs = dl util ; + case OSF : extra-libs = ; + case QNXTO : extra-libs = util ; + case * : extra-libs = dl util ; } # On Linux, we don't want to link either Boost.Python or From 42e6ab6ab2590e10a7b648a4766f97e5f3231e04 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 15 Jul 2006 05:54:35 +0000 Subject: [PATCH 135/154] Improve auto-closing of dialog boxes. - Don't close boxes owned by 'explorer.exe'. - Close dialog parented by csrss.exe ("Unable to locate component/dll") - Various cleanups Patch from Bronek Kozicki. [SVN r34536] --- src/engine/execnt.c | 89 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 15 deletions(-) diff --git a/src/engine/execnt.c b/src/engine/execnt.c index a888a3f67..55bafc82e 100644 --- a/src/engine/execnt.c +++ b/src/engine/execnt.c @@ -1002,6 +1002,8 @@ int is_parent_child(DWORD parent, DWORD child) { HANDLE process_snapshot_h = INVALID_HANDLE_VALUE; + if (!child) + return 0; if (parent == child) return 1; @@ -1016,8 +1018,37 @@ int is_parent_child(DWORD parent, DWORD child) ok == TRUE; ok = Process32Next(process_snapshot_h, &pinfo) ) { - if (pinfo.th32ProcessID == child && pinfo.th32ParentProcessID) + if (pinfo.th32ProcessID == child) + { + CloseHandle(process_snapshot_h); + if (!stricmp(pinfo.szExeFile, "explorer.exe")) + { + /* explorer.exe is orphaned and process_id of its parent may + accidentally match process_id of process we are after. We must not + close dialog boxes displayed by children of explorer.exe even + though (thanks to its parent process id) it might appear to be + our child. This is not very reliable - there might be more + orphaned processes or shell might be something else than + explorer.exe, but this is most common and important scenario */ + return 0; + } + if (!stricmp(pinfo.szExeFile, "csrss.exe")) + { + /* csrss.exe may display message box like following: + xyz.exe - Unable To Locate Component + This application has failed to start because boost_foo-bar.dll + was not found. Re-installing the application may fix the problem + This actually happens when starting test process that depends on + dynamic library which failed to build. We want to automatically + close these message boxes even though csrss.exe is not our + child process. We may depend on the fact that (in all current + versions of Windows) csrss.exe is indirectly child of System which + always has process id == 4 */ + if (is_parent_child(4, pinfo.th32ParentProcessID)) + return 1; + } return is_parent_child(parent, pinfo.th32ParentProcessID); + } } CloseHandle(process_snapshot_h); @@ -1026,28 +1057,44 @@ int is_parent_child(DWORD parent, DWORD child) return 0; } -int related(HANDLE h, DWORD p) +int related(DWORD d, DWORD p) { - return is_parent_child(get_process_id(h), p); + return is_parent_child(d, p); } +typedef struct PROCESS_HANDLE_ID {HANDLE h; DWORD pid;} PROCESS_HANDLE_ID; + BOOL CALLBACK window_enum(HWND hwnd, LPARAM lParam) { - char buf[10] = {0}; - HANDLE h = *((HANDLE*) (lParam)); + char buf[7] = {0}; + PROCESS_HANDLE_ID p = *((PROCESS_HANDLE_ID*) (lParam)); DWORD pid = 0; + DWORD tid = 0; - if (!GetClassNameA(hwnd, buf, 10)) - return TRUE; // failed to read class name + if (!IsWindowVisible(hwnd)) + return TRUE; + + if (!GetClassNameA(hwnd, buf, 7)) + return TRUE; /* failed to read class name; presume it's not a dialog */ if (strcmp(buf, "#32770")) - return TRUE; // not a dialog + return TRUE; /* not a dialog */ - GetWindowThreadProcessId(hwnd, &pid); - if (related(h, pid)) + tid = GetWindowThreadProcessId(hwnd, &pid); + if (tid && related(p.pid, pid)) { - PostMessage(hwnd, WM_QUIT, 0, 0); - // just one window at a time + /* ask really nice */ + PostMessageA(hwnd, WM_CLOSE, 0, 0); + /* now wait and see if it worked. If not, insist */ + if (WaitForSingleObject(p.h, 200) == WAIT_TIMEOUT) + { + PostThreadMessageA(tid, WM_QUIT, 0, 0); + if (WaitForSingleObject(p.h, 500) == WAIT_TIMEOUT) + { + PostThreadMessageA(tid, WM_QUIT, 0, 0); + WaitForSingleObject(p.h, 500); + } + } return FALSE; } @@ -1056,7 +1103,13 @@ BOOL CALLBACK window_enum(HWND hwnd, LPARAM lParam) void close_alert(HANDLE process) { - EnumWindows(&window_enum, (LPARAM) &process); + DWORD pid = get_process_id(process); + /* If process already exited or we just cannot get its process id, do not go any further */ + if (pid) + { + PROCESS_HANDLE_ID p = {process, pid}; + EnumWindows(&window_enum, (LPARAM) &p); + } } static int @@ -1094,9 +1147,10 @@ my_wait( int *status ) if ( globs.timeout > 0 ) { + unsigned int alert_wait = 1; /* with a timeout we wait for a finish or a timeout, we check every second to see if something timed out */ - for (waitcode = WAIT_TIMEOUT; waitcode == WAIT_TIMEOUT;) + for (waitcode = WAIT_TIMEOUT; waitcode == WAIT_TIMEOUT; ++alert_wait) { waitcode = WaitForMultipleObjects( num_active, active_handles, FALSE, 1*1000 /* 1 second */ ); if ( waitcode == WAIT_TIMEOUT ) @@ -1105,10 +1159,15 @@ my_wait( int *status ) for ( i = 0; i < num_active; ++i ) { double t = running_time(active_handles[i]); + + /* periodically (each 5 secs) review and close alert dialogs hanging around */ + if ((alert_wait % ((unsigned int) 5)) == 0) + close_alert(active_handles[i]); + if ( t > (double)globs.timeout ) { /* the job may have left an alert dialog around, - try and get rid of it before killing */ + try and get rid of it before killing */ close_alert(active_handles[i]); /* we have a "runaway" job, kill it */ kill_all(0,active_handles[i]); From 837f57e2ba0882cf932d79f2b026401574f9a564 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 06:27:50 +0000 Subject: [PATCH 136/154] Improvements in auto-closing on dialog boxes. In particular, new check that parent's creation time is less than child's creation time. Patch from Bronek Kozicki. [SVN r34605] --- src/engine/execnt.c | 119 +++++++++++++++++++++++++++++--------------- 1 file changed, 79 insertions(+), 40 deletions(-) diff --git a/src/engine/execnt.c b/src/engine/execnt.c index 55bafc82e..e5e5a2889 100644 --- a/src/engine/execnt.c +++ b/src/engine/execnt.c @@ -915,6 +915,17 @@ running_time(HANDLE process) return 0.0; } +static double +creation_time(HANDLE process) +{ + FILETIME creation, exit, kernel, user, current; + if (GetProcessTimes(process, &creation, &exit, &kernel, &user)) + { + return filetime_seconds(creation); + } + return 0.0; +} + /* it's just stupidly silly that one has to do this! */ typedef struct PROCESS_BASIC_INFORMATION__ { LONG ExitStatus; @@ -998,7 +1009,10 @@ kill_all(DWORD pid, HANDLE process) TerminateProcess(process,-2); } -int is_parent_child(DWORD parent, DWORD child) +/* recursive check if first process is parent (directly or indirectly) of +the latter one. Both processes are passed as process ids, not handles */ +static int +is_parent_child(DWORD parent, DWORD child) { HANDLE process_snapshot_h = INVALID_HANDLE_VALUE; @@ -1020,33 +1034,53 @@ int is_parent_child(DWORD parent, DWORD child) { if (pinfo.th32ProcessID == child) { - CloseHandle(process_snapshot_h); - if (!stricmp(pinfo.szExeFile, "explorer.exe")) + /* + Unfortunately, process ids are not really unique. There might + be spurious "parent and child" relationship match between + two non-related processes if real parent process of a given + process has exited (while child process kept running as an + "orphan") and the process id of such parent process has been + reused by internals of the operating system when creating + another process. Thus additional check is needed - process + creation time. */ + double tchild = 0.0; + double tparent = 0.0; + HANDLE hchild = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pinfo.th32ProcessID); + if (hchild != 0) { - /* explorer.exe is orphaned and process_id of its parent may - accidentally match process_id of process we are after. We must not - close dialog boxes displayed by children of explorer.exe even - though (thanks to its parent process id) it might appear to be - our child. This is not very reliable - there might be more - orphaned processes or shell might be something else than - explorer.exe, but this is most common and important scenario */ - return 0; + HANDLE hparent = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pinfo.th32ParentProcessID); + if (hparent != 0) + { + tchild = creation_time(hchild); + tparent = creation_time(hparent); + + CloseHandle(hparent); + } + CloseHandle(hchild); } - if (!stricmp(pinfo.szExeFile, "csrss.exe")) + CloseHandle(process_snapshot_h); + + /* was child created before alleged parent? */ + if (tchild == 0.0 || tparent == 0.0 || tchild < tparent) + return 0; + + /* csrss.exe may display message box like following: + xyz.exe - Unable To Locate Component + This application has failed to start because + boost_foo-bar.dll was not found. Re-installing the + application may fix the problem + This actually happens when starting test process that depends + on a dynamic library which failed to build. We want to + automatically close these message boxes even though csrss.exe + is not our child process. We may depend on the fact that (in + all current versions of Windows) csrss.exe is indirectly + child of System process, which always has process id == 4 */ + if (stricmp(pinfo.szExeFile, "csrss.exe") == 0) { - /* csrss.exe may display message box like following: - xyz.exe - Unable To Locate Component - This application has failed to start because boost_foo-bar.dll - was not found. Re-installing the application may fix the problem - This actually happens when starting test process that depends on - dynamic library which failed to build. We want to automatically - close these message boxes even though csrss.exe is not our - child process. We may depend on the fact that (in all current - versions of Windows) csrss.exe is indirectly child of System which - always has process id == 4 */ if (is_parent_child(4, pinfo.th32ParentProcessID)) return 1; } + return is_parent_child(parent, pinfo.th32ParentProcessID); } } @@ -1057,31 +1091,35 @@ int is_parent_child(DWORD parent, DWORD child) return 0; } -int related(DWORD d, DWORD p) -{ - return is_parent_child(d, p); -} - typedef struct PROCESS_HANDLE_ID {HANDLE h; DWORD pid;} PROCESS_HANDLE_ID; -BOOL CALLBACK window_enum(HWND hwnd, LPARAM lParam) +/* This function is called by the operating system for each topmost window. */ +BOOL CALLBACK +window_enum(HWND hwnd, LPARAM lParam) { char buf[7] = {0}; PROCESS_HANDLE_ID p = *((PROCESS_HANDLE_ID*) (lParam)); DWORD pid = 0; DWORD tid = 0; + /* we want to find and close any window that: + 1. is visible and + 2. is a dialog and + 3. is displayed by any of our child processes */ if (!IsWindowVisible(hwnd)) return TRUE; - if (!GetClassNameA(hwnd, buf, 7)) + if (!GetClassNameA(hwnd, buf, sizeof(buf))) return TRUE; /* failed to read class name; presume it's not a dialog */ - - if (strcmp(buf, "#32770")) + + if (strcmp(buf, "#32770") != 0) return TRUE; /* not a dialog */ + /* GetWindowThreadProcessId returns 0 on error, otherwise thread id + of window message pump thread */ tid = GetWindowThreadProcessId(hwnd, &pid); - if (tid && related(p.pid, pid)) + + if (tid && is_parent_child(p.pid, pid)) { /* ask really nice */ PostMessageA(hwnd, WM_CLOSE, 0, 0); @@ -1089,22 +1127,22 @@ BOOL CALLBACK window_enum(HWND hwnd, LPARAM lParam) if (WaitForSingleObject(p.h, 200) == WAIT_TIMEOUT) { PostThreadMessageA(tid, WM_QUIT, 0, 0); - if (WaitForSingleObject(p.h, 500) == WAIT_TIMEOUT) - { - PostThreadMessageA(tid, WM_QUIT, 0, 0); - WaitForSingleObject(p.h, 500); - } + WaitForSingleObject(p.h, 300); } + + /* done, we do not want to check any other window now */ return FALSE; } return TRUE; } -void close_alert(HANDLE process) +static void +close_alert(HANDLE process) { DWORD pid = get_process_id(process); - /* If process already exited or we just cannot get its process id, do not go any further */ + /* If process already exited or we just cannot get its process id, do not + go any further */ if (pid) { PROCESS_HANDLE_ID p = {process, pid}; @@ -1160,7 +1198,8 @@ my_wait( int *status ) { double t = running_time(active_handles[i]); - /* periodically (each 5 secs) review and close alert dialogs hanging around */ + /* periodically (each 5 secs) check and close message boxes + displayed by any of our child processes */ if ((alert_wait % ((unsigned int) 5)) == 0) close_alert(active_handles[i]); From 9607545f83c7f446a79e33670b6a92e2f700e04a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 06:34:00 +0000 Subject: [PATCH 137/154] Update version to M11 [SVN r34607] --- src/build/version.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/version.jam b/src/build/version.jam index 915140c45..3eb71a172 100644 --- a/src/build/version.jam +++ b/src/build/version.jam @@ -5,7 +5,7 @@ rule boost-build ( ) { - return "V2 (Milestone 10)" ; + return "V2 (Milestone 11)" ; } rule jam ( ) { From 4aad2b5f60b456f7115cef6194ec196b90ebd4a1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 07:16:17 +0000 Subject: [PATCH 138/154] No longer exclude the 'make' example [SVN r34609] --- scripts/roll.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/roll.sh b/scripts/roll.sh index 2f206b883..eb0415b46 100644 --- a/scripts/roll.sh +++ b/scripts/roll.sh @@ -10,8 +10,6 @@ cd ../boost-build # This one is not fully finished rm -rf example/versioned -# This one is too low-level and misleading -rm -rf example/make # Remove unnecessary top-level files find . -maxdepth 1 -type f | egrep -v "roll.sh|bootstrap.jam|build-system.jam|boost_build_v2.html|boost.png|index.html|hacking.txt|site-config.jam|user-config.jam" | xargs rm -f From 24cf10561080f94dddb0482e5fc0d99556df0762 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 07:19:26 +0000 Subject: [PATCH 139/154] Remove 'draft' indicator. They currently result if huge "draft" text that more scares users that warns about incomplete docs. [SVN r34610] --- doc/src/standalone.xml | 2 +- doc/src/tutorial.xml | 2 +- doc/src/userman.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/standalone.xml b/doc/src/standalone.xml index e53812b79..c16af5dfe 100644 --- a/doc/src/standalone.xml +++ b/doc/src/standalone.xml @@ -3,7 +3,7 @@ "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> + id="bbv2" last-revision="$Date$"> Boost.Build v2 User Manual diff --git a/doc/src/tutorial.xml b/doc/src/tutorial.xml index 10b7a1c99..39b023826 100644 --- a/doc/src/tutorial.xml +++ b/doc/src/tutorial.xml @@ -4,7 +4,7 @@ - + Tutorial diff --git a/doc/src/userman.xml b/doc/src/userman.xml index ef80b7803..f4a9202f1 100644 --- a/doc/src/userman.xml +++ b/doc/src/userman.xml @@ -3,7 +3,7 @@ "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> + id="bbv2" last-revision="$Date$"> Boost.Build v2 User Manual From 3b121523c59b8717fb436300273392547dc19c72 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 07:31:21 +0000 Subject: [PATCH 140/154] Pass pass to BoostBook XSL. Remove broken configuration of msvc. [SVN r34612] --- test/test-config-example.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test-config-example.jam b/test/test-config-example.jam index 4e98dbfd3..dd19b9549 100644 --- a/test/test-config-example.jam +++ b/test/test-config-example.jam @@ -5,11 +5,11 @@ # while site-config.jam and user-config.jam will be ignored. using gcc ; -using msvc : : "P:/Program Files/Microsoft Visual Studio/vc98" : : vcvars32-p.bat ; using borland ; using boostbook : /home/ghost/build/docbook/xsl : /home/ghost/build/docbook/dtd - ; + : /home/ghost/Work/boost-rc/tools/boostbook + ; using doxygen ; \ No newline at end of file From cc7e0e6bdae1766d2344f42e763a6dddc7fd5b21 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 07:39:15 +0000 Subject: [PATCH 141/154] Update version number [SVN r34614] --- website/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/index.html b/website/index.html index 988ef07d8..9b68c2f53 100644 --- a/website/index.html +++ b/website/index.html @@ -36,9 +36,9 @@ div.sidebar p.rubric { Quick access