From 55ffa8f9a42c1f0c498d1b64424d83b0b5fb1f7e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 21 Mar 2006 16:26:47 +0000 Subject: [PATCH 001/160] Quick fix to allow configure different Python versions for different toolsets. [SVN r33421] --- v2/build/project.jam | 16 ++++++++++++++++ v2/tools/python.jam | 26 ++++++++++++++++++-------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/v2/build/project.jam b/v2/build/project.jam index 74f901b64..e848cc99f 100644 --- a/v2/build/project.jam +++ b/v2/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/v2/tools/python.jam b/v2/tools/python.jam index e75a406ac..475976684 100644 --- a/v2/tools/python.jam +++ b/v2/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 27bc9b810b48e43ac2d3ad52014d4fb75a9e1aaf Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 06:56:28 +0000 Subject: [PATCH 002/160] 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] --- v2/tools/python.jam | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index 475976684..3377f3d7a 100644 --- a/v2/tools/python.jam +++ b/v2/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 6c7982f2f4ef400fafe454f7d48e7f835e898652 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 08:52:30 +0000 Subject: [PATCH 003/160] Explicitly pass -RTTI on. [SVN r33432] --- v2/tools/cw.jam | 3 +++ 1 file changed, 3 insertions(+) diff --git a/v2/tools/cw.jam b/v2/tools/cw.jam index beb7737ea..3b0a4ba71 100644 --- a/v2/tools/cw.jam +++ b/v2/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 5ee1809d96cfffb949931c4c929eaf74a51e820a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 09:51:24 +0000 Subject: [PATCH 004/160] Force all dependents of python to get 'dl' library on Linux. [SVN r33433] --- v2/tools/python.jam | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index 3377f3d7a..cd98ce5b3 100644 --- a/v2/tools/python.jam +++ b/v2/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 6a61f3a4b99d3c1fe83f7ae7aeedea8695179201 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:03:59 +0000 Subject: [PATCH 005/160] Move qt.jam to qt3.jam. [SVN r33435] --- v2/tools/qt3.jam | 213 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 v2/tools/qt3.jam diff --git a/v2/tools/qt3.jam b/v2/tools/qt3.jam new file mode 100644 index 000000000..dba571092 --- /dev/null +++ b/v2/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 ab9b0a29dff0b3e676ccfc739f4a2c106414b5cc Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:09:18 +0000 Subject: [PATCH 006/160] Don't support QTDIR for Qt4, as Qt4 itself deprecates this environment variable. [SVN r33436] --- v2/tools/qt4.jam | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/v2/tools/qt4.jam b/v2/tools/qt4.jam index eb045c29c..2c121cea9 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 fc80d56d79bad31b3fbdfd1bdb78646206368e63 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:14:00 +0000 Subject: [PATCH 007/160] Declare 'dl' target only once, to avoid ambiguity if several python versions are configured. [SVN r33437] --- v2/tools/python.jam | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index cd98ce5b3..5ffc48612 100644 --- a/v2/tools/python.jam +++ b/v2/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 ca5fbaaf47662995dee0f24055710a7ab3e80365 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:16:38 +0000 Subject: [PATCH 008/160] Remove qt.jam as it's moved to qt3.jam. [SVN r33438] --- v2/tools/qt.jam | 208 ------------------------------------------------ 1 file changed, 208 deletions(-) delete mode 100644 v2/tools/qt.jam diff --git a/v2/tools/qt.jam b/v2/tools/qt.jam deleted file mode 100644 index a8d8839da..000000000 --- a/v2/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 358d3f9da96abf82078e483cd47443701c2e8865 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:21:28 +0000 Subject: [PATCH 009/160] Add forwarding qt.jam. [SVN r33439] --- v2/tools/qt.jam | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 v2/tools/qt.jam diff --git a/v2/tools/qt.jam b/v2/tools/qt.jam new file mode 100644 index 000000000..ab29f9357 --- /dev/null +++ b/v2/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 a1bbd3b36b508c23e9f21425f60662aa824a19fa Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 14:13:43 +0000 Subject: [PATCH 010/160] Make dependents of Python link to 'util' library on Unix. [SVN r33440] --- v2/tools/python.jam | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index 5ffc48612..e28734979 100644 --- a/v2/tools/python.jam +++ b/v2/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 cf030feb98ba8a3b07d81a2bfbb22395bc8d2f04 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 14:28:39 +0000 Subject: [PATCH 011/160] Don't append lib paths for all gcc version to a single RUN_PATH. [SVN r33441] --- v2/tools/gcc.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 24c4111f5..1ead6c8f8 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 213a53acb813257049dfbcbccf417a552d1d142c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 15:10:27 +0000 Subject: [PATCH 012/160] Use project name 'qt' for Qt4 and 'qt3' for Qt3. [SVN r33442] --- v2/tools/qt3.jam | 2 +- v2/tools/qt4.jam | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/tools/qt3.jam b/v2/tools/qt3.jam index dba571092..8bae89e5e 100644 --- a/v2/tools/qt3.jam +++ b/v2/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/v2/tools/qt4.jam b/v2/tools/qt4.jam index 2c121cea9..4b5a2888d 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 6ab05a7bf96188f659df098a3966499b51fc41c4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 23 Mar 2006 08:35:37 +0000 Subject: [PATCH 013/160] Allow to explicitly specify root, in case where we have trouble auto-detecting it from the compiler name. [SVN r33453] --- v2/tools/gcc.jam | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 1ead6c8f8..28ad9c0ae 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 3af30fce69ccddb5f621d3881410dafba1985cca Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 25 Mar 2006 16:28:19 +0000 Subject: [PATCH 014/160] Add missing "undef" feature. It's used in plenty of places but was never defined. [SVN r33473] --- v2/tools/builtin.jam | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index aed2e997c..4e1bba72e 100644 --- a/v2/tools/builtin.jam +++ b/v2/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 9efe599d5267cce8db602fd332897c7759d7350c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 26 Mar 2006 06:26:01 +0000 Subject: [PATCH 015/160] Add RmTemps, which is the really quite version of Clean. [SVN r33474] --- v2/tools/common.jam | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/v2/tools/common.jam b/v2/tools/common.jam index c5bbd4294..06d66366d 100644 --- a/v2/tools/common.jam +++ b/v2/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 9ce942b0c5cb3e5bda209dd9dbf15e63ec5c4e59 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 26 Mar 2006 06:28:51 +0000 Subject: [PATCH 016/160] 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] --- v2/tools/gcc.jam | 71 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 28ad9c0ae..6a05c9e6a 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 f85c9725644ddfb87765ac051c9c07894f2e6a42 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 27 Mar 2006 03:28:19 +0000 Subject: [PATCH 017/160] Fix missing var expansion in error message about conflicting properties. [SVN r33482] --- v2/build/feature.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/build/feature.jam b/v2/build/feature.jam index b2cfd7cd0..e6ad37f35 100644 --- a/v2/build/feature.jam +++ b/v2/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 2813affa7d63611f5c3a702a1b0aa3594e60f748 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 28 Mar 2006 13:26:31 +0000 Subject: [PATCH 018/160] Unbreak Qt3. Patch from Jurgen Hunold. [SVN r33503] --- v2/tools/qt3.jam | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/v2/tools/qt3.jam b/v2/tools/qt3.jam index 8bae89e5e..4148f9422 100644 --- a/v2/tools/qt3.jam +++ b/v2/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 cb4bb153c54ce431ec7f1b420ddb9ce32790d8cb Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 29 Mar 2006 11:05:05 +0000 Subject: [PATCH 019/160] Set LD_LIBRARY_PATH when running tests built with intel-linux. [SVN r33515] --- v2/tools/intel-linux.jam | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam index e33b601a2..ea1eec3ff 100644 --- a/v2/tools/intel-linux.jam +++ b/v2/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 b3c54cd8940e1dbd0039810612f2fbe27a65d1bc Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 29 Mar 2006 11:42:04 +0000 Subject: [PATCH 020/160] Fix rpath and strip for OFS linker. [SVN r33519] --- v2/tools/gcc.jam | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 6a05c9e6a..4e6551125 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 3b7c6068eae662e181789b43fcf77b07edbb7057 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 29 Mar 2006 15:20:08 +0000 Subject: [PATCH 021/160] Fix LD_LIBRARY_PATH setting for 64-bit gcc. [SVN r33521] --- v2/tools/gcc.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 4e6551125..0ec3f24ec 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 35992c9ea750af04d02d8ae93142fc338d133be1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 4 Apr 2006 23:16:13 +0000 Subject: [PATCH 022/160] Add support for STLport 5.x release. [SVN r33531] --- v2/tools/stlport.jam | 155 +++++++++++++++++++++++++++---------------- 1 file changed, 97 insertions(+), 58 deletions(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index a9db490d3..f70c7407d 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 bb28db9fe562a9ac016b1ed385e27d06c5b993b8 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 4 Apr 2006 23:17:43 +0000 Subject: [PATCH 023/160] Fix building with intel-win32 toolset, it was missing linking to some of the system DLLs. [SVN r33532] --- historic/jam/src/build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/historic/jam/src/build.jam b/historic/jam/src/build.jam index 8698efe57..eb066f1b4 100644 --- a/historic/jam/src/build.jam +++ b/historic/jam/src/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 81d10205de8cf28e27e07ee8210caf80c700929c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 5 Apr 2006 05:36:52 +0000 Subject: [PATCH 024/160] 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] --- v2/tools/gcc.jam | 12 ++++++++ v2/tools/msvc.jam | 2 +- v2/tools/rc.jam | 74 +++++++++++++++++++++++++++++------------------ 3 files changed, 59 insertions(+), 29 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 0ec3f24ec..8200a077b 100644 --- a/v2/tools/gcc.jam +++ b/v2/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/v2/tools/msvc.jam b/v2/tools/msvc.jam index 7eabfadf5..f8fc21b7d 100644 --- a/v2/tools/msvc.jam +++ b/v2/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/v2/tools/rc.jam b/v2/tools/rc.jam index 388e40858..1929b1564 100644 --- a/v2/tools/rc.jam +++ b/v2/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 10ead373c3a5317c7460960fe3e7b6c5034f151c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 5 Apr 2006 07:10:36 +0000 Subject: [PATCH 025/160] Disable various frontend options that seem to cause ICE's with intel 9.0. [SVN r33542] --- v2/tools/intel-win.jam | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/v2/tools/intel-win.jam b/v2/tools/intel-win.jam index 1d24755cc..cfe82b284 100644 --- a/v2/tools/intel-win.jam +++ b/v2/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 a473fbb25f8e8d79f03b0cfa4e7341985771b4b8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 5 Apr 2006 08:33:09 +0000 Subject: [PATCH 026/160] --debug-configuration works for intel-linux.jam [SVN r33547] --- v2/tools/intel-linux.jam | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam index ea1eec3ff..8a69cefc3 100644 --- a/v2/tools/intel-linux.jam +++ b/v2/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 36f3ea648be345628287e54d976103a9c30d735c Mon Sep 17 00:00:00 2001 From: Stefan Slapeta Date: Wed, 5 Apr 2006 11:19:34 +0000 Subject: [PATCH 027/160] Added necessary systems libraries for intel-win32 [SVN r33552] --- historic/jam/src/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/historic/jam/src/build.bat b/historic/jam/src/build.bat index 19d40df5e..7850eff5c 100644 --- a/historic/jam/src/build.bat +++ b/historic/jam/src/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 d98c2876ac30cedc4e95df0f9b549611dbf5183d Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 7 Apr 2006 00:48:49 +0000 Subject: [PATCH 028/160] Per ticket #81 . Use start/end-group options of the GNU linker to allow for cyclic dependencies in libraries. [SVN r33575] --- v2/tools/gcc.jam | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 8200a077b..824e79443 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 81ff6d87fa2ec823bed74e0a46dd35287a34007b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 07:32:09 +0000 Subject: [PATCH 029/160] Make it possible to suppress 'lib' prefix for a target type derived from 'LIB'. [SVN r33576] --- v2/build/virtual-target.jam | 18 +++++++++--------- v2/tools/python.jam | 21 ++++++++++++++++++++- v2/tools/types/lib.jam | 6 ++++++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index d36d104e1..f543652b0 100644 --- a/v2/build/virtual-target.jam +++ b/v2/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/v2/tools/python.jam b/v2/tools/python.jam index e28734979..c215599a9 100644 --- a/v2/tools/python.jam +++ b/v2/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/v2/tools/types/lib.jam b/v2/tools/types/lib.jam index 9c753cc2c..21fab6773 100644 --- a/v2/tools/types/lib.jam +++ b/v2/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 6b2cc5bded65073ae7b3d36322cdded73b2c8d39 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 07:37:06 +0000 Subject: [PATCH 030/160] Remove floatsam. [SVN r33578] --- v2/build/virtual-target.jam | 8 -------- 1 file changed, 8 deletions(-) diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index f543652b0..3c52b32d5 100644 --- a/v2/build/virtual-target.jam +++ b/v2/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 936ed4700eb75da2ed747649e3fdd7c52bcac3ac Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 07:45:07 +0000 Subject: [PATCH 031/160] New library QtUiTools. Support buildable Qt tree. Patch from Juergen Hunold. [SVN r33580] --- v2/tools/qt4.jam | 386 +++++++++++++++++++++++++---------------------- 1 file changed, 208 insertions(+), 178 deletions(-) diff --git a/v2/tools/qt4.jam b/v2/tools/qt4.jam index 4b5a2888d..eb35658b1 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 b0a5b47c7287e75568387aa3445ec3fe4f3b0eae Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 08:07:58 +0000 Subject: [PATCH 032/160] Fix URLs of packages. [SVN r33582] --- v2/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/index.html b/v2/index.html index b2772e5f1..988ef07d8 100644 --- a/v2/index.html +++ b/v2/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 0a2c3191b1f66edebd2538f95e77b5174ce11efe Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:06:21 +0000 Subject: [PATCH 033/160] Try to improve diagnostics when no alternative can be found. [SVN r33586] --- v2/build/targets.jam | 31 +++++++++++++++++++++---------- v2/test/alternatives.py | 4 ++-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/v2/build/targets.jam b/v2/build/targets.jam index 96c60ac36..cab4436e1 100644 --- a/v2/build/targets.jam +++ b/v2/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/v2/test/alternatives.py b/v2/test/alternatives.py index f9d60feea..5c5ada90e 100644 --- a/v2/test/alternatives.py +++ b/v2/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 8b2442f6ef4180c6c6f2f436580a159ea1f13774 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:19:47 +0000 Subject: [PATCH 034/160] Add Juergen's copyright, with his permission. [SVN r33587] --- v2/tools/qt4.jam | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v2/tools/qt4.jam b/v2/tools/qt4.jam index eb35658b1..6872cd63f 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 538aec0607d6c62ee19525692032f610b5aa027b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:28:45 +0000 Subject: [PATCH 035/160] Make Qt4 module work in "import qt4; using qt4 : ....." scenario. Add method 'initialized'. [SVN r33588] --- v2/tools/qt4.jam | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/v2/tools/qt4.jam b/v2/tools/qt4.jam index 6872cd63f..a919a2251 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 24e1a811af9f5c2e9a512e09d0e1899133b5341f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:32:04 +0000 Subject: [PATCH 036/160] New Qt example. [SVN r33589] --- v2/example/qt/qt4/hello/Jamroot | 14 +++ v2/example/qt/qt4/hello/arrow.cpp | 159 ++++++++++++++++++++++++++++++ v2/example/qt/qt4/hello/arrow.h | 30 ++++++ v2/example/qt/qt4/hello/main.cpp | 27 +++++ 4 files changed, 230 insertions(+) create mode 100644 v2/example/qt/qt4/hello/Jamroot create mode 100644 v2/example/qt/qt4/hello/arrow.cpp create mode 100644 v2/example/qt/qt4/hello/arrow.h create mode 100644 v2/example/qt/qt4/hello/main.cpp diff --git a/v2/example/qt/qt4/hello/Jamroot b/v2/example/qt/qt4/hello/Jamroot new file mode 100644 index 000000000..83952f17b --- /dev/null +++ b/v2/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/v2/example/qt/qt4/hello/arrow.cpp b/v2/example/qt/qt4/hello/arrow.cpp new file mode 100644 index 000000000..c3ca83d0e --- /dev/null +++ b/v2/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/v2/example/qt/qt4/hello/arrow.h b/v2/example/qt/qt4/hello/arrow.h new file mode 100644 index 000000000..d7743864f --- /dev/null +++ b/v2/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/v2/example/qt/qt4/hello/main.cpp b/v2/example/qt/qt4/hello/main.cpp new file mode 100644 index 000000000..df27444bd --- /dev/null +++ b/v2/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 c2478e7567058ec773ed19c170aeba6a5778e598 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Apr 2006 11:37:20 +0000 Subject: [PATCH 037/160] Fix a couple of warnings that break automated tests [SVN r33590] --- v2/example/qt/qt4/hello/arrow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/v2/example/qt/qt4/hello/arrow.cpp b/v2/example/qt/qt4/hello/arrow.cpp index c3ca83d0e..e821b1690 100644 --- a/v2/example/qt/qt4/hello/arrow.cpp +++ b/v2/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 d334ba87f9d994e44d972614b47195a105519c41 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 9 Apr 2006 07:20:25 +0000 Subject: [PATCH 038/160] 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] --- v2/tools/common.jam | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/v2/tools/common.jam b/v2/tools/common.jam index 06d66366d..00b8d8284 100644 --- a/v2/tools/common.jam +++ b/v2/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 98137a6c1ef93089c5ab38c01a6c1f8bbbf4decd Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 9 Apr 2006 07:23:47 +0000 Subject: [PATCH 039/160] 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] --- v2/tools/stlport.jam | 59 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index f70c7407d..df50967e4 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 362459eea08a493162d81e77f526a21728e5efa7 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:22:57 +0000 Subject: [PATCH 040/160] Fix diagnostic. [SVN r33621] --- v2/tools/common.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/common.jam b/v2/tools/common.jam index 00b8d8284..0c42a15d3 100644 --- a/v2/tools/common.jam +++ b/v2/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 2b75bd8d3cdb40147a968708a9328598b79bff34 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:24:38 +0000 Subject: [PATCH 041/160] Print 'success' message [SVN r33622] --- v2/nightly.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/nightly.sh b/v2/nightly.sh index ffc8afaa8..6fb31b868 100644 --- a/v2/nightly.sh +++ b/v2/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 d16cb811718a1a4f42f5829b7ede24cb44d5ca34 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:26:26 +0000 Subject: [PATCH 042/160] Don't configure Qt if already configured. [SVN r33623] --- v2/example/qt/qt4/moccable-cpp/Jamroot | 16 +++++++++++----- v2/example/qt/qt4/uic/Jamroot | 13 +++++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/v2/example/qt/qt4/moccable-cpp/Jamroot b/v2/example/qt/qt4/moccable-cpp/Jamroot index cf38c5223..d07b9c7d3 100644 --- a/v2/example/qt/qt4/moccable-cpp/Jamroot +++ b/v2/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/v2/example/qt/qt4/uic/Jamroot b/v2/example/qt/qt4/uic/Jamroot index b343868c3..40675a72e 100644 --- a/v2/example/qt/qt4/uic/Jamroot +++ b/v2/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 72f3261def9dd0089c0a9864bda41b154a83488e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:29:30 +0000 Subject: [PATCH 043/160] Test that 'unit-test' will find searched libraries. [SVN r33624] --- v2/test/searched_lib.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/v2/test/searched_lib.py b/v2/test/searched_lib.py index e6a61ca7a..8de51dcaf 100644 --- a/v2/test/searched_lib.py +++ b/v2/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 c491e3512384bcf976c9da1e783f128d71fea6c2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 07:30:23 +0000 Subject: [PATCH 044/160] Some fixes [SVN r33625] --- v2/tools/package.jam | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/v2/tools/package.jam b/v2/tools/package.jam index 06547ebe3..ff9dd0eb0 100644 --- a/v2/tools/package.jam +++ b/v2/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 742901b4370d67c93bb2a99022144f94216a990d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 09:40:41 +0000 Subject: [PATCH 045/160] Support using Qt3 and Qt4 at the same time. [SVN r33627] --- v2/tools/qt3.jam | 14 +++++++------- v2/tools/qt4.jam | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/v2/tools/qt3.jam b/v2/tools/qt3.jam index 4148f9422..ba7c63928 100644 --- a/v2/tools/qt3.jam +++ b/v2/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/v2/tools/qt4.jam b/v2/tools/qt4.jam index a919a2251..72bf1d67d 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 ed9936d296ce08e1bd51da6464d1e2bd74374a69 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 10:28:06 +0000 Subject: [PATCH 046/160] Include jam docs as appendix into Boost.Build docs. [SVN r33629] --- v2/doc/Jamfile.v2 | 3 +++ v2/doc/src/userman.xml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/v2/doc/Jamfile.v2 b/v2/doc/Jamfile.v2 index 29767bb18..0541fd277 100644 --- a/v2/doc/Jamfile.v2 +++ b/v2/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/v2/doc/src/userman.xml b/v2/doc/src/userman.xml index ef80b7803..e53812b79 100644 --- a/v2/doc/src/userman.xml +++ b/v2/doc/src/userman.xml @@ -18,5 +18,10 @@ + + Boost.Jam documentation + + From 1982d2c88396d4721e28a5881647d7f53a229ea1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 10:46:40 +0000 Subject: [PATCH 047/160] Fix dependency [SVN r33630] --- v2/doc/Jamfile.v2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/doc/Jamfile.v2 b/v2/doc/Jamfile.v2 index 0541fd277..708140252 100644 --- a/v2/doc/Jamfile.v2 +++ b/v2/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 5647da05dc5997bf218e0214ab94fb56b84d8ca1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 11:26:04 +0000 Subject: [PATCH 048/160] 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] --- v2/tools/make.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/tools/make.jam b/v2/tools/make.jam index 0caee31df..bd00ae92e 100644 --- a/v2/tools/make.jam +++ b/v2/tools/make.jam @@ -47,7 +47,12 @@ rule make ( target-name : sources * : generating-rule + : requirements * ) # The '@' sign causes the feature.jam module to qualify rule name # with the module name of current project, if needed. - requirements += @$(generating-rule) ; + local m = [ MATCH ^(@).* : $(generating-rule) ] ; + if ! $(m) + { + generating-rule = @$(generating-rule) ; + } + requirements += $(generating-rule) ; targets.main-target-alternative [ new make-target-class $(target-name) : $(project) From 5c8969305170bc2be100e3e093b579b8ee1db48e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 11:34:53 +0000 Subject: [PATCH 049/160] Document make/notfile rules. Document action syntax. [SVN r33633] --- v2/doc/src/advanced.xml | 105 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/v2/doc/src/advanced.xml b/v2/doc/src/advanced.xml index 5e3c18a7b..553e85377 100644 --- a/v2/doc/src/advanced.xml +++ b/v2/doc/src/advanced.xml @@ -200,6 +200,51 @@ import module : rule ; + + + Sometimes, you'd need to specify the actual command lines to be used + when creating targets. In jam language, you use named actions to do this. + For example: + +actions create-file-from-another +{ + create-file-from-another $(<) $(>) +} + + This specifies a named action called + create-file-from-another. The text inside braces is the + command to invoke. The $(<) variable will be expanded to list of + generated files, and the $(>) variable will be expanded + to the list of source files. + + + To flexibly adjust command line, you can define a rule with the + same name as the action, and taking three parameters -- targets, sources + and properties. For example: + +rule create-file-from-another ( targets * : sources * : properties * ) +{ + if <variant>debug in $(properties) + { + OPTIONS on $(targets) = --debug ; + } +} +actions create-file-from-another +{ + create-file-from-another $(OPTIONS) $(<) $(>) +} + + In this example, the rule checks if certain build property is specified. + If so, it sets variable OPIONS that's used inside + action. Note that the variable is set "on targets" -- the value will + be only visible inside action, not globally. Were it set globally, + using variable named OPTIONS in two unrelated + actions would be impossible. + + + More details can be found in Jam reference, + +

@@ -1609,6 +1654,66 @@ unit-test helpers_test are not covered here.
+ +
+ + Raw commands: 'make' and 'notfile' + + Sometimes, the builtin target types are not enough, and you + want Boost.Build to just run specific commands. There are two main + target rules that make it possible: make + and notfile. + + + The make rule is used when you want to + create one file from a number of sources using some specific command. + The notfile is used to unconditionally run + a command. + + + + Suppose you want to create file file.out from + file file.in by running command + in2out. Here's how you'd do this in Boost.Build: + +actions in2out +{ + in2out $(<) $(>) +} +make file.out : file.in : @in2out ; + + If you run bjam and file.out + does not exist, Boost.Build will run the in2out + command to create that file. For more details on specifying actions, + see . + + + + + The make rule is useful to express custom + transformation that are used just once or twice in your project. For + transformations that are used often, you are advised to declare + new generator, as described in . + + + + + It could be that you just want to run some command unconditionally, + and that command does not create any specific files. The, you can use + the notfile rule. For example: + +notfile echo_something : @echo ; +actions echo +{ + echo "something" +} + + The only difference from the make rule is + that the name of the target is not considered a name of a file, so + Boost.Build will unconditionally run the action. + + +
From 0ceee51b6c3b64922bbd063c19183124bf0b4e5f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 12:33:15 +0000 Subject: [PATCH 050/160] Improve indentation for --debug-generators. [SVN r33634] --- v2/build/generators.jam | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/v2/build/generators.jam b/v2/build/generators.jam index 511f78082..7390f945c 100644 --- a/v2/build/generators.jam +++ b/v2/build/generators.jam @@ -271,7 +271,7 @@ class generator : sources + # Source targets. ) { - generators.dout [ indent ] " generator" $(self.id) ; + generators.dout [ indent ] " ** generator" $(self.id) ; generators.dout [ indent ] " multiple:" $(mutliple) ; generators.dout [ indent ] " composing:" $(self.composing) ; @@ -353,7 +353,6 @@ class generator # If this is 1->1 transformation, apply it to all consumed targets in order. if ! $(self.source-types[2]) && ! $(self.composing) { - generators.dout [ indent ] "alt1" ; for local r in $(consumed) { result += [ generated-targets $(r) : $(property-set) : $(project) $(name) ] ; #(targets) ; @@ -361,7 +360,6 @@ class generator } else { - generators.dout [ indent ] "alt2 : consumed is" $(consumed) ; if $(consumed) { result += [ generated-targets $(consumed) : $(property-set) @@ -859,7 +857,7 @@ local rule try-one-generator ( project name ? : generator : ! [ set.intersection $(source-types) : $(viable-source-types) ] { local id = [ $(generator).id ] ; - generators.dout [ indent ] "generator '$(id)' pruned" ; + generators.dout [ indent ] " ** generator '$(id)' pruned" ; #generators.dout [ indent ] "source-types" '$(source-types)' ; #generators.dout [ indent ] "viable-source-types" '$(viable-source-types)' ; } From c5fef0be31bde28abcfce8b1115aaf3a656c42b5 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 12:36:12 +0000 Subject: [PATCH 051/160] Use "@rule" syntax for make example. [SVN r33635] --- v2/example/make/Jamroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/example/make/Jamroot b/v2/example/make/Jamroot index 03724f900..3fb84856f 100644 --- a/v2/example/make/Jamroot +++ b/v2/example/make/Jamroot @@ -7,7 +7,7 @@ exe main : main.cpp ; # Create 'main.cpp' from 'main.cpp.pro' using action # 'do-something' defined below. # -make main.cpp : main.cpp.pro : do-something ; +make main.cpp : main.cpp.pro : @do-something ; # In this example, we'll just copy a file. # Need to find out the name of a command to copy a file. From 5a652ec491ae3ddd966fd8d6291abe5c2cdaa593 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 12:48:43 +0000 Subject: [PATCH 052/160] Revive boostbook.py tests, working around BoostBook dislike of classes outside of any namespaces. [SVN r33636] --- v2/test/boostbook/a.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/v2/test/boostbook/a.hpp b/v2/test/boostbook/a.hpp index 6375c0a82..8d7ac1b24 100644 --- a/v2/test/boostbook/a.hpp +++ b/v2/test/boostbook/a.hpp @@ -1,7 +1,12 @@ +// Seems like Boostbook does like classes outside of namespaces, +// and won't generate anything for them. +namespace boost { + /// A class class A { public: /// A constructor A(); }; +} \ No newline at end of file From 52839d2e6e01ad32c2b0a207a047a49107995d70 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 13:05:26 +0000 Subject: [PATCH 053/160] Add a couple of tests for examples. [SVN r33637] --- v2/test/example_libraries.py | 22 ++++++++++++++++++++++ v2/test/example_qt4.py | 26 ++++++++++++++++++++++++++ v2/test/test_all.py | 7 ++----- 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 v2/test/example_libraries.py create mode 100644 v2/test/example_qt4.py diff --git a/v2/test/example_libraries.py b/v2/test/example_libraries.py new file mode 100644 index 000000000..21421f685 --- /dev/null +++ b/v2/test/example_libraries.py @@ -0,0 +1,22 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'libraries' example. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/libraries") + +t.run_build_system() + +t.expect_addition(["app/bin/$toolset/debug/app", + "util/foo/bin/$toolset/debug/bar.dll"]) + + +t.cleanup() diff --git a/v2/test/example_qt4.py b/v2/test/example_qt4.py new file mode 100644 index 000000000..e10423d1d --- /dev/null +++ b/v2/test/example_qt4.py @@ -0,0 +1,26 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2006. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# Test the 'qt4' examples. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.set_tree("../example/qt/qt4/hello") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/arrow"]) + +t.set_tree("../example/qt/qt4/moccable-cpp") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/main"]) + +t.set_tree("../example/qt/qt4/uic") +t.run_build_system() +t.expect_addition(["bin/$toolset/debug/hello"]) + +t.cleanup() diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 298359b05..56d571864 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -140,6 +140,7 @@ tests = [ "rebuilds", "clean", "lib_source_property", "implicit_dependency", + "example_libraries", ] if os.name == 'posix': @@ -155,13 +156,9 @@ if os.name == 'posix': if string.find(get_toolset(), 'gcc') == 0: tests.append("gcc_runtime") -if os.environ.has_key('QTDIR'): - tests.append("railsys") -else: - print 'skipping railsys test since QTDIR environment variable is unset' - if "--extras" in sys.argv: tests.append("boostbook") + tests.append("example_qt4") else: print 'Note: skipping extra tests' From dd0215dc98538d2a75c73bec0a482c82c0391754 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 10 Apr 2006 13:06:03 +0000 Subject: [PATCH 054/160] Summarize M11 changes. [SVN r33638] --- v2/changes.txt | 94 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/v2/changes.txt b/v2/changes.txt index 1bdf422af..3f7bb7021 100644 --- a/v2/changes.txt +++ b/v2/changes.txt @@ -1,5 +1,97 @@ -Milestone 10 () +Milestone 11 (not yet released) + +Changes in this release: + + - New C++ compilers: IBM xlf, HP aCC, HP CXX, Intel fortran compiler. + - New tools: Qt4 support, MS message compiler and IDL compiler. + - New main targets: 'notfile' and 'cast'. + + - Core changes: + + - Only one file required at top level of a project, named Jamroot. + - Jamfiles can now contain project-specific help messages. + - "Indirect conditional requirements" introduced + (http://tinyurl.com/mn3jp) + - Strip suffix in main target names when computing names of generated + files (URL) + - The 'source-location' project attribute can contain + several directories. + - Usage requirements are propagated not only direct dependents, + but to indirect dependents. + + - Command line option changes (see http://tinyurl.com/zbycz) + - New option --build-dir + - The --clean option cleans only target below the current directory, + not globally. + - New --clean-all option was added. + - New option --debug-building + - Running "bjam some_directory" works even if there's no Jamfile + in the current directory. + + - Toolset improvements: + - Assembling support with gcc, borland and msvc. + - Support amd64/ia64 cross-compiling with msvc. + - Improved, registry-based autodetection for msvc. + - Serialize execution of gcc.link actions + - Precompiled headers supported on MSVC + (Need documentation) + + - New features and + - The 'glob' rule accepts wildcards in directory names. + - The 'stage' rule was renamed to 'install' + (the old name still available for compatibility) + - The feature can accept user-defined function as value + (URL) + - The 'install' rule can install a directory hierarchy preserving relative + paths. + - The 'install' rule no longer allows to change library + name during install. + - The Jamfile referred via 'use-project' may declare project id different + from the one in 'use-project'. + - The 'using' rule now searches the directory of containing Jamfile. + + +The following bugs were fixed: + + - The feature was ignored for static linking + - Fix #include scanning for C files. + - Child projects were sometimes loaded before parent projects. + - Fix project references with absolute paths on Windows. + - The feature was ignored for 'install' targets. + - A generator having the same type in sources and targets was causing hang. + - Use 'icpc' command for Intel, fixing errors with 8.1 and higher. + - Generation of PS files with the FOP tool really produces .PS files. + - No dependency scanning was done for C files. + - The 'constant' and 'path-constant' rules did not accept multi-element + value. + - Don't pass -fcoalesce-templates to gcc on OSX 10.4 + - Fix static lib suffix on OSX. + - Fix rpath setting on Intel/Linux. + - The 'install' rule don't unnecessary scans #includes in installed + headers. + + +Developer visible changes: + + - Ability to customize type's prefix depending on build properties. + - Generator's 'run' method can return usage-requirements. + - Main target rule is automatically declared for each new target type. + - 'Link incompatible' feature attribute was removed + - Generators no longer bypass unhandled sources, they just ignore them. + - If there are several applicable generators, immediately report ambiguity. + Provide a way to explicitly resolve conflicts between generators. + - The 'flags' rule can match absense of feature. + - Great improvement in response files handling + - The 'toolset.flags' rules allows value-less feature to signify + absense of this feature (fix hack-hack). + - Automatically declare main target rule for each declared target type. + - When inheriting types, inherit generators for the base type, as opposed + to using various hacks to invoke base generators when needed. + - Improve diagnostic for "duplicate actual target" and generator ambiguity. + + +Milestone 10 (October 29, 2004) Changes in this release: From c0c682196c6ab4b5c7d42864f5ee530470e05481 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 06:00:58 +0000 Subject: [PATCH 055/160] Unbreak versioned config for sun compiler. Thanks to Doug Gregor for the bug report. [SVN r33652] --- v2/tools/sun.jam | 1 - 1 file changed, 1 deletion(-) diff --git a/v2/tools/sun.jam b/v2/tools/sun.jam index 0c951a35f..e00799d58 100644 --- a/v2/tools/sun.jam +++ b/v2/tools/sun.jam @@ -16,7 +16,6 @@ feature.extend toolset : sun ; toolset.inherit sun : unix ; generators.override sun.prebuilt : builtin.lib-generator ; generators.override sun.searched-lib-generator : searched-lib-generator ; -feature.subfeature toolset sun : version ; feature.extend stdlib : sun-stlport ; feature.compose sun-stlport From aff8de18abd50d3fca7eec1a8e9189a9759f952f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 06:14:44 +0000 Subject: [PATCH 056/160] Workaround broken -s option with Apple gcc 4.0.x on Darwin. Thanks to Doug Gregor for report and suggested fix. [SVN r33654] --- v2/tools/darwin.jam | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/v2/tools/darwin.jam b/v2/tools/darwin.jam index b009a85bc..8756d0a56 100644 --- a/v2/tools/darwin.jam +++ b/v2/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 b9e68f7dfd0ed6225ad4a85e1a19ee0a7aeec774 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 07:25:48 +0000 Subject: [PATCH 057/160] Tests for more examples. [SVN r33656] --- v2/test/example_customization.py | 23 +++++++++++++++++++++++ v2/test/example_gettext.py | 31 +++++++++++++++++++++++++++++++ v2/test/example_make.py | 20 ++++++++++++++++++++ v2/test/test_all.py | 7 +++++++ 4 files changed, 81 insertions(+) create mode 100644 v2/test/example_customization.py create mode 100644 v2/test/example_gettext.py create mode 100644 v2/test/example_make.py diff --git a/v2/test/example_customization.py b/v2/test/example_customization.py new file mode 100644 index 000000000..fbb12071f --- /dev/null +++ b/v2/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/v2/test/example_gettext.py b/v2/test/example_gettext.py new file mode 100644 index 000000000..3fcc4ec04 --- /dev/null +++ b/v2/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/v2/test/example_make.py b/v2/test/example_make.py new file mode 100644 index 000000000..3eb360912 --- /dev/null +++ b/v2/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/v2/test/test_all.py b/v2/test/test_all.py index 56d571864..6f856e782 100644 --- a/v2/test/test_all.py +++ b/v2/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 0388b73ee725544a8304b57a39ce7c0ae3d572b0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 08:16:35 +0000 Subject: [PATCH 058/160] Disable 'deprecation' warnings when warnings=off. Otherwise, user building with warnings=off will still get some warnings. [SVN r33658] --- v2/tools/msvc.jam | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index f8fc21b7d..c7b69be7a 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 d16721d0ba0097bbb972bab93efc1be049d02d52 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 11 Apr 2006 08:17:22 +0000 Subject: [PATCH 059/160] Clarify comment [SVN r33659] --- v2/tools/msvc.jam | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index c7b69be7a..a963957b4 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 3dad3e1012acb1bec7d7add6f046d23aeb5b7fc8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 12 Apr 2006 07:12:52 +0000 Subject: [PATCH 060/160] 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] --- v2/tools/darwin.jam | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/v2/tools/darwin.jam b/v2/tools/darwin.jam index 8756d0a56..c13de782e 100644 --- a/v2/tools/darwin.jam +++ b/v2/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 8ec7666721ab0269d51433e5fb8205daffc02db1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 12 Apr 2006 15:23:15 +0000 Subject: [PATCH 061/160] Revert error message, using "error" rule. [SVN r33678] --- v2/build/project.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/build/project.jam b/v2/build/project.jam index e848cc99f..0a512e523 100644 --- a/v2/build/project.jam +++ b/v2/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 7fce97e9c4958cc3831dd35560c1e77ed23eed6d Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Wed, 12 Apr 2006 22:38:10 +0000 Subject: [PATCH 062/160] fix boost/doc build breakage [SVN r33684] --- v2/doc/Jamfile.v2 | 5 ++++- v2/doc/src/standalone.xml | 27 +++++++++++++++++++++++++++ v2/doc/src/userman.xml | 5 ----- 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 v2/doc/src/standalone.xml diff --git a/v2/doc/Jamfile.v2 b/v2/doc/Jamfile.v2 index 708140252..e5e83c479 100644 --- a/v2/doc/Jamfile.v2 +++ b/v2/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/v2/doc/src/standalone.xml b/v2/doc/src/standalone.xml new file mode 100644 index 000000000..e53812b79 --- /dev/null +++ b/v2/doc/src/standalone.xml @@ -0,0 +1,27 @@ + + + + + + Boost.Build v2 User Manual + + + + + + + + + + + + + + Boost.Jam documentation + + + + diff --git a/v2/doc/src/userman.xml b/v2/doc/src/userman.xml index e53812b79..ef80b7803 100644 --- a/v2/doc/src/userman.xml +++ b/v2/doc/src/userman.xml @@ -18,10 +18,5 @@ - - Boost.Jam documentation - - From 189966d3d55fbdaf1e3d45edf5b14230aa7bf8bf Mon Sep 17 00:00:00 2001 From: Nicola Musatti Date: Thu, 13 Apr 2006 07:36:55 +0000 Subject: [PATCH 063/160] Added to support bcc32 5.8.2 as a separate toolset [SVN r33686] --- v1/borland-5_8_2-tools.jam | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 v1/borland-5_8_2-tools.jam diff --git a/v1/borland-5_8_2-tools.jam b/v1/borland-5_8_2-tools.jam new file mode 100644 index 000000000..590d6e702 --- /dev/null +++ b/v1/borland-5_8_2-tools.jam @@ -0,0 +1,14 @@ +# (C) Copyright David Abrahams 2002. +# 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) + +# The following #// line will be used by the regression test table generation +# program as the column heading for HTML tables. Must not include version number. +#//
Borland +{ + BCCROOT = $(BCC_582_ROOT) ; + extends-toolset borland ; + C++FLAGS = [ difference $(C++FLAGS) : -WU ] ; + CFLAGS = [ difference $(CFLAGS) : -WU ] -DBOOST_ALL_NO_LIB=1 ; + LINKFLAGS = [ difference $(LINKFLAGS) : -WU ] ; +} From da6609dc09a991b7f858ac9861814418196ba4c2 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 14 Apr 2006 20:07:35 +0000 Subject: [PATCH 064/160] Fix RC tool to fallback to the null rc type when a real one can't be found. [SVN r33699] --- v2/tools/gcc.jam | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 824e79443..41a0e1d0f 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 34a433e808c48526a666ef0764fd7bb01ba4f813 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 065/160] Fixed shadowing of rc variable in if-clause. [SVN r33714] --- v2/tools/gcc.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 41a0e1d0f..cde7767eb 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 2cda71032b1b5d1aceeaca56c4bd9496f198d203 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 066/160] Add QtOpenGL to the list of buildable modules. [SVN r33728] --- v2/tools/qt4.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/qt4.jam b/v2/tools/qt4.jam index 72bf1d67d..9f2c63f98 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 c083c0104de42d9df1e8381fc5bc8eb0a2478ff5 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 067/160] Correct QSql to QtSql in dependency list of Qt3Support. [SVN r33735] --- v2/tools/qt4.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/tools/qt4.jam b/v2/tools/qt4.jam index 9f2c63f98..0ca818109 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 d5dfde2c11fc656ae587e8f5e7d78469a9c51d18 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 19 Apr 2006 20:13:54 +0000 Subject: [PATCH 068/160] Fix missing online help docs, and refactor to not use header scanning to speed up the parsing of Jamfiles for docs. [SVN r33746] --- v2/build-system.jam | 3 -- v2/build/project.jam | 2 +- v2/kernel/bootstrap.jam | 26 +++++++--- v2/options/help.jam | 61 +++++++++++++--------- v2/util/doc.jam | 112 +++++++++++++++++++++++++++++----------- v2/util/option.jam | 7 +-- 6 files changed, 141 insertions(+), 70 deletions(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index 90a2a6895..5100dcd74 100755 --- a/v2/build-system.jam +++ b/v2/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/v2/build/project.jam b/v2/build/project.jam index 0a512e523..dd7fe3920 100644 --- a/v2/build/project.jam +++ b/v2/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/v2/kernel/bootstrap.jam b/v2/kernel/bootstrap.jam index 5d8736caf..67b681449 100755 --- a/v2/kernel/bootstrap.jam +++ b/v2/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/v2/options/help.jam b/v2/options/help.jam index 05d1fcb25..c087592ee 100755 --- a/v2/options/help.jam +++ b/v2/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/v2/util/doc.jam b/v2/util/doc.jam index aedd38304..1c79c54df 100644 --- a/v2/util/doc.jam +++ b/v2/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/v2/util/option.jam b/v2/util/option.jam index daa56b011..57944a8b6 100644 --- a/v2/util/option.jam +++ b/v2/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 4edfde6e74b85fd8f1c13e4c0f078b708454ed13 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 19 Apr 2006 21:10:11 +0000 Subject: [PATCH 069/160] Fix file reading on Windows. [SVN r33748] --- v2/util/doc.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v2/util/doc.jam b/v2/util/doc.jam index 1c79c54df..5f4829709 100644 --- a/v2/util/doc.jam +++ b/v2/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 85e596c2438a10718f0f6a4d416583fdca75797f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 13:43:47 +0000 Subject: [PATCH 070/160] Grammar fixes. [SVN r33791] --- v2/tools/cast.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/cast.jam b/v2/tools/cast.jam index cc21f7179..086d2f93c 100644 --- a/v2/tools/cast.jam +++ b/v2/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 4dcff4675e68771042c4b89274b0028c75ab54cb Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 13:59:41 +0000 Subject: [PATCH 071/160] Prevent --clean from deleting files that were used as sources of 'cast'. [SVN r33792] --- v2/build-system.jam | 13 +++++++++---- v2/test/clean.py | 16 ++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index 5100dcd74..96ffbd5e1 100755 --- a/v2/build-system.jam +++ b/v2/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/v2/test/clean.py b/v2/test/clean.py index dcd3b5ed5..043f53597 100644 --- a/v2/test/clean.py +++ b/v2/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 e0ea86ef532ef5fcd012110192994dd3bef67f26 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 14:09:51 +0000 Subject: [PATCH 072/160] Digital Mars fixes. Patch from Arjan Knepper. [SVN r33794] --- v2/tools/dmc.jam | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/v2/tools/dmc.jam b/v2/tools/dmc.jam index caa610f04..8af8725a8 100644 --- a/v2/tools/dmc.jam +++ b/v2/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 25d8717aed64af42f898846b0260dcc54c37d746 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 14:16:07 +0000 Subject: [PATCH 073/160] Adjust for pdf file name change [SVN r33795] --- v2/roll.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/roll.sh b/v2/roll.sh index 4f20fa3b1..e63209f9c 100644 --- a/v2/roll.sh +++ b/v2/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 9390b1e9fe14de497c96f40e44bdf928aa681e63 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 24 Apr 2006 14:33:59 +0000 Subject: [PATCH 074/160] Extensive editorial changes. Patch from Richard Peters. [SVN r33796] --- v2/doc/src/advanced.xml | 54 ++++++++++++++++++++-------------------- v2/doc/src/extending.xml | 36 +++++++++++++-------------- v2/doc/src/reference.xml | 20 +++++++-------- v2/doc/src/tutorial.xml | 4 +-- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/v2/doc/src/advanced.xml b/v2/doc/src/advanced.xml index 553e85377..8187a1f9e 100644 --- a/v2/doc/src/advanced.xml +++ b/v2/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/v2/doc/src/extending.xml b/v2/doc/src/extending.xml index de0ba2a3b..34e1893d9 100644 --- a/v2/doc/src/extending.xml +++ b/v2/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/v2/doc/src/tutorial.xml b/v2/doc/src/tutorial.xml index 998335a91..10b7a1c99 100644 --- a/v2/doc/src/tutorial.xml +++ b/v2/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 d027fa3585e046e4317e6d85ec4a66e45361500e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 05:35:25 +0000 Subject: [PATCH 075/160] Fix paths [SVN r33801] --- v2/roll.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/roll.sh b/v2/roll.sh index e63209f9c..2f206b883 100644 --- a/v2/roll.sh +++ b/v2/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 9edfd33dd1ace072c3c506b54fc43a8c01415d54 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 10:09:01 +0000 Subject: [PATCH 076/160] Editorial changes. Patch from Richard Peters. [SVN r33803] --- historic/jam/doc/bjam.qbk | 91 +++++++++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 23 deletions(-) diff --git a/historic/jam/doc/bjam.qbk b/historic/jam/doc/bjam.qbk index b5bd6de1c..78cd1feee 100644 --- a/historic/jam/doc/bjam.qbk +++ b/historic/jam/doc/bjam.qbk @@ -74,7 +74,12 @@ Jam isn't under the blinkin GNU copyright, so you can incorporate it into commer [section:building Building BJam] -Installing =BJam= after building it is simply a matter of copying the generated executables someplace in your =PATH=. For building the executables there are a set of =build= bootstrap scripts to accomodate particular environments. The scripts take one optional argument, the name of the toolset to build with. When the toolset is not given an attempt is made to detect an available toolset and use that. The build scripts accept these areguments: +Installing =BJam= after building it is simply a matter of copying the +generated executables someplace in your =PATH=. For building the executables +there are a set of =build= bootstrap scripts to accomodate particular +environments. The scripts take one optional argument, the name of the toolset +to build with. When the toolset is not given an attempt is made to detect an +available toolset and use that. The build scripts accept these arguments: [pre /build/ \[/toolset/\] @@ -265,7 +270,7 @@ The supported toolsets, and wether they are auto-detected, are: ] -The built executables are placed in a subdirectory specific to your platform. For example, in Linux running on an Intel x86 compatible chip, the executables are placed in: "=bin.linuxx86=". The =bjam\[.exe\]= executable can be used to invoke Boost.Build. +The built executables are placed in a subdirectory specific to your platform. For example, in Linux running on an Intel x86 compatible chip, the executables are placed in: "=bin.linuxx86=". The =bjam[.exe]= executable can be used to invoke Boost.Build. The build scripts support additional invocation arguments for use by developers of Boost.Jam. The extra arguments come after the toolset, and can take the form of "=--option=" or targets for the =build.jam= script: @@ -321,8 +326,11 @@ Options are either singular or have an accompanying value. When a value is allow [ [[^-d''' '''0]] [Turn off all debugging levels. Only errors are reported.] ] - [ [[^-f''' '''/Jambase/]] - [Read /Jambase/ instead of using the built-in Jambase. Only one -f flag is permitted, but the /Jambase/ may explicitly include other files. A /Jambase/ name of "-" is allowed, in which case console input is read until it is closed. At which point the input is treated as the Jambase.] ] + [ [[^-f''' '''/Jambase/]] [Read /Jambase/ instead of using the built-in + Jambase. Only one -f flag is permitted, but the /Jambase/ may explicitly + include other files. A /Jambase/ name of "-" is allowed, in which case + console input is read until it is closed, at which point the input is + treated as the Jambase.] ] [ [[^-j''' '''/n/]] [Run up to /n/ shell commands concurrently (UNIX and NT only). The default is 1.] ] @@ -396,7 +404,7 @@ The Boost.Build v2 initialization behavior has been implemented. This behavior o In the parsing phase, =bjam= reads and parses the =Jambase= file, by default the built-in one. It is written in the [link jam.language jam language]. The last action of the =Jambase= is to read (via the "include" rule) a user-provided file called "=Jamfile=". -Collectively, the purpose of the =Jambase= and the =Jamfile= is to name built target and source files, construct the dependency graph among them, and associate build actions with targets. The =Jambase= defines boilerplate rules and variable assignments, and the =Jamfile= uses these to specify the actual relationship among the target and source files. +Collectively, the purpose of the =Jambase= and the =Jamfile= is to name build targets and source files, construct the dependency graph among them, and associate build actions with targets. The =Jambase= defines boilerplate rules and variable assignments, and the =Jamfile= uses these to specify the actual relationship among the target and source files. [endsect] @@ -438,23 +446,27 @@ The =-j= flag instructs =bjam= to build more than one target at a time. If there [section:lexical Lexical Features] -=BJam= treats its input files as whitespace-separated tokens, with two exceptions: double quotes (") can enclose whitespace to embed it into a token, and everything between the matching curly braces ({}) in the definition of a rule action is treated as a single string. A backslash (\) can escape a double quote, or any single whitespace character. +=BJam= treats its input files as whitespace-separated tokens, with two exceptions: double quotes (") can enclose whitespace to embed it into a token, and everything between the matching curly braces ({}) in the definition of a rule action is treated as a single string. A backslash (\\) can escape a double quote, or any single whitespace character. =BJam= requires whitespace (blanks, tabs, or newlines) to surround all tokens, including the colon (:) and semicolon (;) tokens. -=BJam= keywords (an mentioned in this document) are reserved and generally must be quoted with double quotes (") to be used as arbitrary tokens, such as variable or target names. +=BJam= keywords (an mentioned in this document) are reserved and generally +must be quoted with double quotes (") to be used as arbitrary tokens, such as +variable or target names. + +Comments start with the [^#] character and extend until the end of line. [endsect] [section:target Targets] -The essential =bjam= data entity is a target. Built targets are files to be updated. Source targets are the files used in updating built targets. Built targets and source targets are collectively referred to as file targets, and frequently built targets are source targets for other built targets. Pseudotargets are symbols which represent dependencies on other targets, but which are not themselves associated with any real file. +The essential =bjam= data entity is a target. Build targets are files to be updated. Source targets are the files used in updating built targets. Built targets and source targets are collectively referred to as file targets, and frequently built targets are source targets for other built targets. Pseudotargets are symbols which represent dependencies on other targets, but which are not themselves associated with any real file. A file target's identifier is generally the file's name, which can be absolutely rooted, relative to the directory of =bjam='s invocation, or simply local (no directory). Most often it is the last case, and the actual file path is bound using the =$(SEARCH)= and =$(LOCATE)= special variables. See [link jam.language.variables.builtins.search SEARCH and LOCATE Variables] below. A local filename is optionally qualified with grist, a string value used to assure uniqueness. A file target with an identifier of the form /file(member)/ is a library member (usually an =ar=(1) archive on Unix). [section Binding Detection] -Whenever a target is bound to a location in the filesystem, Boost Jam will look for a variable called =BINDRULE= (first "on" the target being bound, then in the global module). If non-empty, =$(BINDRULE\[1\])= names a rule which is called with the name of the target and the path it is being bound to. The signature of the rule named by =$(BINDRULE\[1\])= should match the following: +Whenever a target is bound to a location in the filesystem, Boost Jam will look for a variable called =BINDRULE= (first "on" the target being bound, then in the global module). If non-empty, =$(BINDRULE[1])= names a rule which is called with the name of the target and the path it is being bound to. The signature of the rule named by =$(BINDRULE[1])= should match the following: [pre rule /bind-rule/ ( /target/ : /path/ ) @@ -489,7 +501,7 @@ actions \[ /modifiers/ \] /rulename/ { /commands/ } Invoke a rule. [pre -rulename /field1/ : /field2/ : /.../ : /fieldN/ ; +/rulename/ /field1/ : /field2/ : /.../ : /fieldN/ ; ] Invoke a rule under the influence of target's specific variables.. @@ -511,7 +523,7 @@ Rules fall into two categories: updating rules (with actions), and pure procedur When an updating rule is invoked, its updating actions are added to those associated with its built targets ([^$(1)]) before the rule's procedure is run. Later, to build the targets in the updating phase, /commands/ are passed to the OS command shell, with [^$(1)] and [^$(2)] replaced by bound versions of the target names. See Binding above. -Rule invokation may be indirected through a variable: +Rule invocation may be indirected through a variable: [pre $(/var/) /field1/ : /field2/ : /.../ : /fieldN/ ; @@ -522,7 +534,11 @@ on /target/ $(/var/) /field1/ : /field2/ : /.../ : /fieldN/ ; \[ on /target/ $(/var/) /field1/ : /field2/ : /.../ : /fieldN/ \] ] -The variable's value names the rule (or rules) to be invoked. A rule is invoked for each element in the list of [^$(/var/)]'s values. The fields [^/field1/ : /field2/ : /.../] are passed as arguments for each invokation. For the [ ... ] forms, the return value is the concatenation of the return values for all of the invokations. +The variable's value names the rule (or rules) to be invoked. A rule is +invoked for each element in the list of [^$(/var/)]'s values. The fields +[^/field1/ : /field2/ : /.../] are passed as arguments for each +invokation. For the [ ... ] forms, the return value is the concatenation of +the return values for all of the invocations. [section Action Modifiers] @@ -761,7 +777,7 @@ Currently supported data types : '=REG_DWORD=', '=REG_SZ=', '=REG_EXPAND_SZ=', ' [pre local PSDK-location = - \[ PROFILE HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\MicrosoftSDK\\\\Directories : "Install Dir" \] ; + \[ W32_GETREG HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\MicrosoftSDK\\\\Directories : "Install Dir" \] ; ] [pre @@ -775,7 +791,8 @@ rule SHELL ( /command/ : * ) [[=no-output=] [Don't capture the output of the command. Instead an empty ("") string value is returned in place of the output.]] ] -Because the Perforce/Jambase defines a =SHELL= rule which hides the builtin. =COMMAND= can be used as an alias for =SHELL= in such a case. +Because the Perforce/Jambase defines a =SHELL= rule which hides the +builtin rule, =COMMAND= can be used as an alias for =SHELL= in such a case. [endsect] @@ -908,14 +925,14 @@ A variable is defined with: [pre /variable/ = /elements/ ; -/variable/ += /elements ; +/variable/ += /elements/ ; /variable/ on /targets/ = /elements/ ; /variable/ on /targets/ += /elements/ ; /variable/ default = /elements/ ; /variable/ ?= /elements/ ; ] -The first two forms set /variable/ globally. The third and forth forms set a target-specific variable. The [^=] operator replaces any previous elements of /variable/ with /elements/; the [^+=] operation adds /elements/ to /variable/'s list of elements. The final two forms are synonymous: they set /variable/ globally, but only if it was previously unset. +The first two forms set /variable/ globally. The third and forth forms set a target-specific variable. The [^\=] operator replaces any previous elements of /variable/ with /elements/; the [^+=] operation adds /elements/ to /variable/'s list of elements. The final two forms are synonymous: they set /variable/ globally, but only if it was previously unset. Variables referenced in updating commands will be replaced with their values; target-specific values take precedence over global values. Variables passed as arguments (=$(1)= and =$(2)=) to actions are replaced with their bound values; the "=bind=" modifier can be used on actions to cause other variables to be replaced with bound values. See Action Modifiers above. @@ -959,8 +976,10 @@ A variable element's string value can be parsed into grist and filename-related [variablelist -[[[^\[['n]\]]] - [Select element number ['n] (starting at 1). If the variable contains fewer than ['n] elements, the result is a zero-element list. ['n] can be negative in which case the element number ['n] from the last leftward is returned]] +[[[^\[['n]\]]] [Select element number ['n] (starting at 1). If the variable + contains fewer than ['n] elements, the result is a zero-element list. ['n] + can be negative in which case the element number ['n] from the last leftward + is returned.]] [[[^\[['n]-['m]\]]] [Select elements number ['n] through ['m]. ['n] and ['m] can be negative in which case they refer to elements counting from the last leftward.]] @@ -993,7 +1012,17 @@ A variable element's string value can be parsed into grist and filename-related [Replace uppercase characters with lowercase.]] [[[^:W]] - [When invoking Windows-based tools from [@http://www.cygwin.com/ Cygwin] it can be important to pass them true windows-style paths. Tthe =:W= modifier which, *under Cygwin only*, turns a cygwin path into a Win32 path using the [@http://www.cygwin.com/cygwin-api/func-cygwin-conv-to-win32-path.html =cygwin_conv_to_win32_path=] function. On other platforms, the string is unchanged. [^x = "/cygdrive/c/Program Files/Borland" ; ECHO $(x:W) ; # prints "C:\\Program Files\\Borland" on Cygwin]]] + [When invoking Windows-based tools from [@http://www.cygwin.com/ Cygwin] + it can be important to pass them true windows-style paths. The =:W= + modifier, *under Cygwin only*, turns a cygwin path into a Win32 path using + the [@http://www.cygwin.com/cygwin-api/func-cygwin-conv-to-win32-path.html + =cygwin_conv_to_win32_path=] function. On other platforms, the string is + unchanged. For example +`` + x = "/cygdrive/c/Program Files/Borland" ; ECHO $(x:W) ; +`` +prints [^"C:\\Program Files\\Borland"] on Cygwin +]] [[[^:['chars]]] [Select the components listed in ['chars].]] @@ -1050,7 +1079,9 @@ This section discusses variables that have special meaning to =bjam=. [section:search SEARCH and LOCATE] -These two variables control the binding of file target names to locations in the file system. Generally, =$(SEARCH)= is used to find existing sources while= $(LOCATE)= is used to fix the location for built targets. +These two variables control the binding of file target names to locations in +the file system. Generally, =$(SEARCH)= is used to find existing sources +while =$(LOCATE)= is used to fix the location for built targets. Rooted (absolute path) file targets are bound as is. Unrooted file target names are also normally bound as is, and thus relative to the current directory, but the settings of =$(LOCATE)= and =$(SEARCH)= alter this: @@ -1064,7 +1095,13 @@ Both =$(SEARCH)= and =$(LOCATE)= should be set target-specific and not globally. [section:hdrscan HDRSCAN and HDRRULE] -These two variable control header file scanning. =$(HDRSCAN)= is an =egrep(1)= pattern, with ()'s surrounding the file name, used to find file inclusion statements in source files. =Jambase= uses =$(HDRPATTERN)= as the pattern for =$(HDRSCAN)=. =$(HDRRULE)= is the name of a rule to invoke with the results of the scan: the scanned file is the target, the found files are the sources. This is the only place where =bjam= invokes a rule through a variable setting. +These two variables control header file scanning. =$(HDRSCAN)= is an +=egrep(1)= pattern, with ()'s surrounding the file name, used to find file +inclusion statements in source files. =Jambase= uses =$(HDRPATTERN)= as the +pattern for =$(HDRSCAN)=. =$(HDRRULE)= is the name of a rule to invoke with +the results of the scan: the scanned file is the target, the found files are +the sources. This is the only place where =bjam= invokes a rule through a +variable setting. Both =$(HDRSCAN)= and =$(HDRRULE)= must be set for header file scanning to take place, and they should be set target-specific and not globally. If they were set globally, all files, including executables and libraries, would be scanned for header file include statements. @@ -1420,7 +1457,7 @@ This section is derived from the official Jam documentation and from experience * A Jam *target* is an abstract entity identified by an arbitrary string. The build-in =DEPENDS= rule creates a link in the dependency graph between the named targets. -* Note that the documentation for the built-in =INCLUDES= rule is incorrect: [^INCLUDES ['targets1] : ['targets2]] causes everything that depends on a member of /targets1/ to depend on all members of /targets2/. It does this in an odd way, by tacking /targets2/ onto a special tail section in the dependency list of everything in /targets1/. It seems to be OK to create circular dependencies this way; in fact, it appears to be the "right thing to do" when a single build action produces both /targets1/ and /targets2/. +* Note that the original Jam documentation for the built-in =INCLUDES= rule is incorrect: [^INCLUDES ['targets1] : ['targets2]] causes everything that depends on a member of /targets1/ to depend on all members of /targets2/. It does this in an odd way, by tacking /targets2/ onto a special tail section in the dependency list of everything in /targets1/. It seems to be OK to create circular dependencies this way; in fact, it appears to be the "right thing to do" when a single build action produces both /targets1/ and /targets2/. * When a rule is invoked, if there are =actions= declared with the same name as the rule, the actions are added to the updating actions for the target identified by the rule's first argument. It is actually possible to invoke an undeclared rule if corresponding actions are declared: the rule is treated as empty. @@ -1445,7 +1482,15 @@ This section is derived from the official Jam documentation and from experience * When Jam is invoked it imports all environment variable settings into corresponding Jam variables, followed by all command-line (-s...) variable settings. Variables whose name ends in PATH, Path, or path are split into string lists on OS-specific path-list separator boundaries (e.g. ":" for UNIX and ";" for Windows). All other variables are split on space (" ") boundaries. Boost Jam modifies that behavior by allowing variables to be quoted. -* A variable whose value is an empty list or which consists entirely of empty strings has a negative logical value. Thus, for example, code like the following allows a sensible non-empty default which can easily be overridden by the user: [^MESSAGE ?\= starting jam... ; if $(MESSAGE) { ECHO The message is: $(MESSAGE) ; }] If the user wants a specific message, he invokes jam with "-sMESSAGE=message text". If he wants no message, he invokes jam with -sMESSAGE\= and nothing at all is printed. +* A variable whose value is an empty list or which consists entirely of empty + strings has a negative logical value. Thus, for example, code like the + following allows a sensible non-empty default which can easily be overridden + by the user: + `` +MESSAGE ?\= starting jam... ; +if $(MESSAGE) { ECHO The message is: $(MESSAGE) ; } +`` + If the user wants a specific message, he invokes jam with [^"-sMESSAGE\=message text"]. If he wants no message, he invokes jam with [^-sMESSAGE\=] and nothing at all is printed. * The parsing of command line options in Jam can be rather unintuitive, with regards to how other Unix programs accept options. There are two variants accepted as valid for an option: From e3c1b38ed53436f3b03f0af672fd67138bc1cf5d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 13:10:03 +0000 Subject: [PATCH 077/160] Ignore msvc 8.0 manifests. [SVN r33807] --- v2/test/BoostBuild.py | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/test/BoostBuild.py b/v2/test/BoostBuild.py index 070f97e14..c5b4c59a6 100644 --- a/v2/test/BoostBuild.py +++ b/v2/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 64e74f3465503a965b9bfd571309d779cbfaf49d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 13:11:25 +0000 Subject: [PATCH 078/160] Windows fixes [SVN r33808] --- v2/test/example_libraries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/test/example_libraries.py b/v2/test/example_libraries.py index 21421f685..2d2d468e2 100644 --- a/v2/test/example_libraries.py +++ b/v2/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 5038ddac99f59108890125c6572e7d4c4cfb2e2f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 13:45:30 +0000 Subject: [PATCH 079/160] Windows fixes [SVN r33809] --- v2/test/searched_lib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/test/searched_lib.py b/v2/test/searched_lib.py index 8de51dcaf..353d21dea 100644 --- a/v2/test/searched_lib.py +++ b/v2/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 b28b5b878f1079c3999f4fd0c7f162d7ade785df Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 14:29:21 +0000 Subject: [PATCH 080/160] Windows fixes [SVN r33810] --- v2/test/library_chain.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v2/test/library_chain.py b/v2/test/library_chain.py index a78c681ef..f98de9646 100644 --- a/v2/test/library_chain.py +++ b/v2/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 d0a84a6bc4c2148b232ab48dd2c6f688e0078e5f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 14:46:15 +0000 Subject: [PATCH 081/160] Windows fixes [SVN r33811] --- v2/test/alternatives.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/test/alternatives.py b/v2/test/alternatives.py index 5c5ada90e..0c1d91abb 100644 --- a/v2/test/alternatives.py +++ b/v2/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 9fef1689f54528d64b605e85497b8079adfe5ea5 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 14:54:32 +0000 Subject: [PATCH 082/160] Create 'failed_test' dir only if test fails [SVN r33812] --- v2/test/BoostBuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/test/BoostBuild.py b/v2/test/BoostBuild.py index c5b4c59a6..239f76975 100644 --- a/v2/test/BoostBuild.py +++ b/v2/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 704a10c51fe90a5c85386c39233255b3c3b1dab9 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Apr 2006 15:20:30 +0000 Subject: [PATCH 083/160] Windows fixed [SVN r33813] --- v2/test/implicit_dependency.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/v2/test/implicit_dependency.py b/v2/test/implicit_dependency.py index f7ff01789..5fecdd23a 100644 --- a/v2/test/implicit_dependency.py +++ b/v2/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 b3bcc4a935b7a979413914d46d6e8e1eedc4df5c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 07:34:41 +0000 Subject: [PATCH 084/160] Support [SVN r33822] --- v2/tools/msvc.jam | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index a963957b4..19d296ede 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 88745b21eb376cbb6fb217a69633aab751093ff0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 07:37:38 +0000 Subject: [PATCH 085/160] Fix typo [SVN r33823] --- v2/tools/como-win.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/como-win.jam b/v2/tools/como-win.jam index 73060dfd7..50b48c9d6 100644 --- a/v2/tools/como-win.jam +++ b/v2/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 1b8f6b878f5ccf75e783f0040a47fc9a5e6b304d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 08:30:00 +0000 Subject: [PATCH 086/160] Unbreak como-win. It was using old response files mechanism. [SVN r33824] --- v2/tools/como-win.jam | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/v2/tools/como-win.jam b/v2/tools/como-win.jam index 50b48c9d6..e1d309133 100644 --- a/v2/tools/como-win.jam +++ b/v2/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 e419ac4153ae8d88003f5e4985e4ff8e2a21f969 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 09:33:55 +0000 Subject: [PATCH 087/160] Handle runtime variants [SVN r33825] --- v2/tools/cw.jam | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/v2/tools/cw.jam b/v2/tools/cw.jam index 3b0a4ba71..f9048ee88 100644 --- a/v2/tools/cw.jam +++ b/v2/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 d3e3d86bfe89ba44658670418e77f365bc6b2422 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 26 Apr 2006 13:28:52 +0000 Subject: [PATCH 088/160] Don't return random value from 'bjam_call'. [SVN r33830] --- historic/jam/src/builtins.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/historic/jam/src/builtins.c b/historic/jam/src/builtins.c index c9e708a48..20d413b7c 100644 --- a/historic/jam/src/builtins.c +++ b/historic/jam/src/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 922f927e49dea45c2463f4537e9ec03ff8b90b9a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 27 Apr 2006 15:18:15 +0000 Subject: [PATCH 089/160] Fix runtime library paths for CW. [SVN r33839] --- v2/tools/cw.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/tools/cw.jam b/v2/tools/cw.jam index f9048ee88..88b111625 100644 --- a/v2/tools/cw.jam +++ b/v2/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 17beafee4841dab582d0c92f9523674a2fdb8cb6 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 090/160] handle command-line arguments as bjam does [SVN r33935] --- v2/build/build-request.jam | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/v2/build/build-request.jam b/v2/build/build-request.jam index 3fed9469f..82d39b022 100644 --- a/v2/build/build-request.jam +++ b/v2/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 b32b261b1f7f792fb99a6a87e119a3fc6530e75f Mon Sep 17 00:00:00 2001 From: Matthias Troyer Date: Fri, 5 May 2006 15:34:29 +0000 Subject: [PATCH 091/160] Increased template-depth to accomodate serialization library [SVN r33939] --- v2/tools/gcc.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index cde7767eb..92f64e0ca 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 4f17b37d63bb8cce998f90911ac08df25b19e603 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 17 May 2006 12:57:53 +0000 Subject: [PATCH 092/160] 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] --- v2/tools/msvc.jam | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index 19d296ede..f4344cdaf 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 ebf2b165c0d63637ca1dc3a1306b4e72708f353a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 06:32:16 +0000 Subject: [PATCH 093/160] Allow empty list of source types in call to generators.register-composing. [SVN r33993] --- v2/build/generators.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/build/generators.jam b/v2/build/generators.jam index 7390f945c..66588a715 100644 --- a/v2/build/generators.jam +++ b/v2/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 0125f7a47e51159c31e442ccbeb99f04b622940c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 09:15:03 +0000 Subject: [PATCH 094/160] Fix a bug that prevented parent attributes from being inherited. [SVN r33995] --- v2/build/project.jam | 12 +++++------- v2/build/targets.jam | 4 +--- v2/test/load_order.py | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/v2/build/project.jam b/v2/build/project.jam index dd7fe3920..32254750f 100644 --- a/v2/build/project.jam +++ b/v2/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/v2/build/targets.jam b/v2/build/targets.jam index cab4436e1..d18419348 100644 --- a/v2/build/targets.jam +++ b/v2/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/v2/test/load_order.py b/v2/test/load_order.py index 535fbafa8..25b4ba803 100644 --- a/v2/test/load_order.py +++ b/v2/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 3f2f2d6399cb875f556169b34558da34e7a74dff Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 10:37:10 +0000 Subject: [PATCH 095/160] Stop intel-linux from failing due unknown name of archiver command. [SVN r33997] --- v2/tools/gcc.jam | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 92f64e0ca..db739eae1 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 7cb8b443ecace2e482c3e1082bbd3bb2f31946fc Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 10:37:52 +0000 Subject: [PATCH 096/160] Don't pass -s on Darwin. [SVN r33998] --- v2/tools/gcc.jam | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index db739eae1..a0b2b113c 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 0855fc4784cb2c2f19412ca897e8a3fdbeec933f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 18 May 2006 11:02:29 +0000 Subject: [PATCH 097/160] Attempt the fix python on OSX. [SVN r34000] --- v2/tools/python.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index c215599a9..e6d016a8d 100644 --- a/v2/tools/python.jam +++ b/v2/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 c6187cb58ef6d3e0addcd3b3fd6b029fad1b9de2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 19 May 2006 09:13:37 +0000 Subject: [PATCH 098/160] Minor refactoring [SVN r34024] --- v2/build/targets.jam | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/v2/build/targets.jam b/v2/build/targets.jam index d18419348..91e992ebe 100644 --- a/v2/build/targets.jam +++ b/v2/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 a77fb5f38ddcfbaf7d06ea311a7ee97d5b03328e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 19 May 2006 13:38:57 +0000 Subject: [PATCH 099/160] Restore file-referece.location method. [SVN r34032] --- v2/build/targets.jam | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v2/build/targets.jam b/v2/build/targets.jam index 91e992ebe..5c2df682b 100644 --- a/v2/build/targets.jam +++ b/v2/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 d870e9667158b1e2cd0d57b82aff9916350d83f4 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 21 May 2006 18:21:30 +0000 Subject: [PATCH 100/160] Fix argument mismatch of "libraries *" vs. "libraries +". [SVN r34052] --- v2/tools/stlport.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index df50967e4..f976abd72 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 23970414af4b103f3162b9c6efabb2f7d1ebcf19 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 23 May 2006 14:21:58 +0000 Subject: [PATCH 101/160] Try to preserve relative paths in sources. Based on a patch from Ryan Gallagher. [SVN r34062] --- v2/build/generators.jam | 17 +++++++++++++++-- v2/build/project.jam | 12 +++++++++++- v2/test/relative_sources.py | 24 ++++++++++++++++++++++-- v2/util/path.jam | 23 ++++++++++++++++++++--- 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/v2/build/generators.jam b/v2/build/generators.jam index 66588a715..c19651f8b 100644 --- a/v2/build/generators.jam +++ b/v2/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/v2/build/project.jam b/v2/build/project.jam index 32254750f..0e644690c 100644 --- a/v2/build/project.jam +++ b/v2/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/v2/test/relative_sources.py b/v2/test/relative_sources.py index 8bab211ad..b94e241a6 100644 --- a/v2/test/relative_sources.py +++ b/v2/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() diff --git a/v2/util/path.jam b/v2/util/path.jam index cedff58a8..2134c1235 100644 --- a/v2/util/path.jam +++ b/v2/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) ] ; + } } } From 37243ba85c953930e422e137acd3a77200efd9af Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 23 May 2006 14:28:20 +0000 Subject: [PATCH 102/160] Fix CVS address [SVN r34064] --- v2/nightly.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/nightly.sh b/v2/nightly.sh index 6fb31b868..07f33de5a 100644 --- a/v2/nightly.sh +++ b/v2/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 57f5c303b7ae4d4385ba80113464f718cd928552 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 103/160] Removed -soname option for Tru64. [SVN r34079] --- v2/tools/gcc.jam | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index a0b2b113c..b297af9d4 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 65ff7464a7a02f4d4a2fd297c9d79746bbc893e1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 25 May 2006 07:59:36 +0000 Subject: [PATCH 104/160] 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] --- v2/build/property.jam | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/v2/build/property.jam b/v2/build/property.jam index b4c4169f9..3ad0cd340 100644 --- a/v2/build/property.jam +++ b/v2/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 65f3f30ff95bbc183a2a562a53e1b9876b5d475f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 25 May 2006 08:14:30 +0000 Subject: [PATCH 105/160] 64-bit fixes. Patch from Andreas Fredriksson. [SVN r34086] --- historic/jam/src/pathunix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/historic/jam/src/pathunix.c b/historic/jam/src/pathunix.c index 94391c3e2..725a51f5f 100644 --- a/historic/jam/src/pathunix.c +++ b/historic/jam/src/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 8757406c902f47476f97ea268de914e5afadd808 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sun, 4 Jun 2006 06:55:48 +0000 Subject: [PATCH 106/160] Respect RUN_PATH variable when running Python tests. [SVN r34159] --- v2/tools/python.jam | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index e6d016a8d..3fcd6b446 100644 --- a/v2/tools/python.jam +++ b/v2/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 43c3f39ef85f02be95db18b442bc7fc0c5964bd0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 6 Jun 2006 20:42:08 +0000 Subject: [PATCH 107/160] Rewrite version bump script to not have external dependencies. Bump to bjam to 3.1.13. [SVN r34205] --- historic/jam/doc/bjam.qbk | 4 +- historic/jam/src/boost-jam.spec | 2 +- historic/jam/src/build.jam | 2 +- historic/jam/src/bump_version.py | 83 ++++++++++++++++++++----------- historic/jam/src/debian/copyright | 6 +-- historic/jam/src/patchlevel.h | 6 +-- 6 files changed, 64 insertions(+), 39 deletions(-) diff --git a/historic/jam/doc/bjam.qbk b/historic/jam/doc/bjam.qbk index 78cd1feee..f337c98b1 100644 --- a/historic/jam/doc/bjam.qbk +++ b/historic/jam/doc/bjam.qbk @@ -1,6 +1,6 @@ [article Boost.Jam [quickbook 1.3] - [version 3.1.12] + [version: 3.1.13] [authors [Rivera, Rene], [Abrahams, David], [Prus, Vladimir]] [copyright 2003 2004 2005 2006 Rene Rivera, David Abrahams, Vladimir Prus] [category tool-build] @@ -21,7 +21,7 @@ [/ Shortcuts ] -[def :version: 3.1.12] +[def :version: 3.1.13] [/ Images ] diff --git a/historic/jam/src/boost-jam.spec b/historic/jam/src/boost-jam.spec index 0a3a1baaf..c68756c7b 100644 --- a/historic/jam/src/boost-jam.spec +++ b/historic/jam/src/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/historic/jam/src/build.jam b/historic/jam/src/build.jam index eb066f1b4..32f028bae 100644 --- a/historic/jam/src/build.jam +++ b/historic/jam/src/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/historic/jam/src/bump_version.py b/historic/jam/src/bump_version.py index 9757f7b6a..9423c4c77 100644 --- a/historic/jam/src/bump_version.py +++ b/historic/jam/src/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/historic/jam/src/debian/copyright b/historic/jam/src/debian/copyright index 4b4dcbfc8..f72e4e3a9 100644 --- a/historic/jam/src/debian/copyright +++ b/historic/jam/src/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/historic/jam/src/patchlevel.h b/historic/jam/src/patchlevel.h index a1a6df001..2dca9ccd2 100644 --- a/historic/jam/src/patchlevel.h +++ b/historic/jam/src/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 5cb7524ce750c7df5e170a8bf28bcc3cf3689fa9 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 6 Jun 2006 23:58:07 +0000 Subject: [PATCH 108/160] Make the action timeout attempt to also close any open dialogs before killing processes. Thanks to Bronek Kozicki. [SVN r34210] --- historic/jam/src/build.bat | 10 +++--- historic/jam/src/build.jam | 10 +++--- historic/jam/src/execnt.c | 64 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 10 deletions(-) diff --git a/historic/jam/src/build.bat b/historic/jam/src/build.bat index 7850eff5c..9699e967b 100644 --- a/historic/jam/src/build.bat +++ b/historic/jam/src/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/historic/jam/src/build.jam b/historic/jam/src/build.jam index 32f028bae..479b892eb 100644 --- a/historic/jam/src/build.jam +++ b/historic/jam/src/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/historic/jam/src/execnt.c b/historic/jam/src/execnt.c index 29a6b6515..1d43df1ce 100644 --- a/historic/jam/src/execnt.c +++ b/historic/jam/src/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 4cf428cc111ef8ff014410ebd2f31ed1aa683a72 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Jun 2006 02:16:58 +0000 Subject: [PATCH 109/160] Fix out of order function definitions. [SVN r34211] --- historic/jam/src/execnt.c | 122 +++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/historic/jam/src/execnt.c b/historic/jam/src/execnt.c index 1d43df1ce..a888a3f67 100644 --- a/historic/jam/src/execnt.c +++ b/historic/jam/src/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 edb362111353809a016fa9111cf6934ac56b6768 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Jun 2006 02:59:15 +0000 Subject: [PATCH 110/160] Fix rpm building on Linux installs that have both rpmbuild and rpm. [SVN r34213] --- historic/jam/src/build.jam | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/historic/jam/src/build.jam b/historic/jam/src/build.jam index 479b892eb..cb6a724bd 100644 --- a/historic/jam/src/build.jam +++ b/historic/jam/src/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 0b38c56f93c581da9f4f7d16a4d3216da2d689d0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Jun 2006 03:00:29 +0000 Subject: [PATCH 111/160] Remove debug message. [SVN r34214] --- historic/jam/src/build.jam | 1 - 1 file changed, 1 deletion(-) diff --git a/historic/jam/src/build.jam b/historic/jam/src/build.jam index cb6a724bd..878017cc0 100644 --- a/historic/jam/src/build.jam +++ b/historic/jam/src/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 d0c0f6e9a45702eb9b7ea3d5c718f15637d434b1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 7 Jun 2006 03:05:47 +0000 Subject: [PATCH 112/160] Remove warning when building rpm packages. [SVN r34216] --- historic/jam/src/boost-jam.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/historic/jam/src/boost-jam.spec b/historic/jam/src/boost-jam.spec index c68756c7b..0bac6912c 100644 --- a/historic/jam/src/boost-jam.spec +++ b/historic/jam/src/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 5beb55541e0a4fbbfe97ade4d950c1561a4494d0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 8 Jun 2006 05:05:05 +0000 Subject: [PATCH 113/160] On Sun, always link to the 'rt' library. [SVN r34229] --- v2/tools/sun.jam | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/v2/tools/sun.jam b/v2/tools/sun.jam index e00799d58..05426cb93 100644 --- a/v2/tools/sun.jam +++ b/v2/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 abca27c1d1adce65beed12b1a9c1d03e2c253291 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 8 Jun 2006 05:14:02 +0000 Subject: [PATCH 114/160] When reporting that now toolsets are configured, mention the URL. [SVN r34231] --- v2/build-system.jam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index 96ffbd5e1..c0747ff4b 100755 --- a/v2/build-system.jam +++ b/v2/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 17a3d340c2976b2a9bd9b5d75205da4cde833512 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 8 Jun 2006 05:31:39 +0000 Subject: [PATCH 115/160] Revert the path for preserving relative names of sources, since it breaks UBLAS tests. Will reconsider later. [SVN r34233] --- v2/build/generators.jam | 17 ++--------------- v2/build/project.jam | 12 +----------- v2/test/relative_sources.py | 24 ++---------------------- v2/util/path.jam | 23 +++-------------------- 4 files changed, 8 insertions(+), 68 deletions(-) diff --git a/v2/build/generators.jam b/v2/build/generators.jam index c19651f8b..66588a715 100644 --- a/v2/build/generators.jam +++ b/v2/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/v2/build/project.jam b/v2/build/project.jam index 0e644690c..32254750f 100644 --- a/v2/build/project.jam +++ b/v2/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/v2/test/relative_sources.py b/v2/test/relative_sources.py index b94e241a6..8bab211ad 100644 --- a/v2/test/relative_sources.py +++ b/v2/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() diff --git a/v2/util/path.jam b/v2/util/path.jam index 2134c1235..cedff58a8 100644 --- a/v2/util/path.jam +++ b/v2/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) ] ; } } From f007f8eab18497e28fd07d998a57b23a6e7bd478 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 12 Jun 2006 20:49:07 +0000 Subject: [PATCH 116/160] Add newly missing arg to match method. [SVN r34291] --- v2/tools/stlport.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index f976abd72..5f79f3f9f 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 db70fdbed398ed30e523dd80960c22556c3a7074 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 13 Jun 2006 15:47:54 +0000 Subject: [PATCH 117/160] Fix calculation of 5.x version number. [SVN r34293] --- v2/tools/stlport.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index 5f79f3f9f..19dbedc02 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 a3050629b1b49340a77ad36f149668dcf6712480 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 15 Jun 2006 11:13:06 +0000 Subject: [PATCH 118/160] Fix unsupported command-line warnings when using Intel C++. It is inheriting these frags from msvc.jam. [SVN r34310] --- v2/tools/msvc.jam | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index f4344cdaf..896833e77 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 eaf3e52104a01a766fcdcf08f4a5922aa4fd81b9 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 16 Jun 2006 21:52:54 +0000 Subject: [PATCH 119/160] Add compiler specific bin dir to lib paths, as it contains important runtime dynamic libraries, for example for mingw. [SVN r34319] --- v2/tools/gcc.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index b297af9d4..c6d182bc9 100644 --- a/v2/tools/gcc.jam +++ b/v2/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 2c4fc1420de34d752514850a327c9b06442a6870 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 19 Jun 2006 06:51:54 +0000 Subject: [PATCH 120/160] 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] --- v2/tools/sun.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/sun.jam b/v2/tools/sun.jam index 05426cb93..9ec4f6e4e 100644 --- a/v2/tools/sun.jam +++ b/v2/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 df3b8437fa584fe4aa2069db29b17a1fb21ad4af Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 19 Jun 2006 20:06:57 +0000 Subject: [PATCH 121/160] Use default match logic to prevent variant fallback bugs, where the requested build is ignored and an alternate is used. [SVN r34357] --- v2/tools/stlport.jam | 47 ++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index 19dbedc02..95b1212f2 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 f5821fb3bbd5931c93cffbba88fb0deb90ef8bcf Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 20 Jun 2006 21:28:29 +0000 Subject: [PATCH 122/160] Disable the multi-thread requirement for STLport5 as the match fallback prevents coherent use of build requirements. [SVN r34362] --- v2/tools/stlport.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index 95b1212f2..cceafb64a 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 769ecd0b52e0f1ba5a409099d610a2a4f4fa194a Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Thu, 22 Jun 2006 14:52:49 +0000 Subject: [PATCH 123/160] 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] --- v2/tools/msvc.jam | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index 896833e77..9bb8369a3 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 3a8bbe7d0b2e135b4c02735637410911ac3abdac Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 25 Jun 2006 10:06:30 +0000 Subject: [PATCH 124/160] 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] --- v2/tools/msvc.jam | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index 9bb8369a3..b4cfa4f02 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 2701d7684189a98ca3733be1fa75204f41d13ba8 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 27 Jun 2006 14:08:14 +0000 Subject: [PATCH 125/160] Work around STLport link requirements when linking static vs. multi thread modes. [SVN r34415] --- v2/tools/stlport.jam | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index cceafb64a..bc0f7027f 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 b154e9ed1687605b4faa5b1df57c39feef9bc5bb Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 27 Jun 2006 23:39:16 +0000 Subject: [PATCH 126/160] Oops, removed too much of the requirements code. [SVN r34419] --- v2/tools/stlport.jam | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index bc0f7027f..cda3be262 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 6774a1604ed2f87859f307bbf95d7b4772b9c211 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Thu, 29 Jun 2006 21:50:00 +0000 Subject: [PATCH 127/160] - 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] --- v2/tools/msvc.jam | 57 +++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index b4cfa4f02..961ba2479 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 d8053baead2b04bad28cb2ff9bb166e5dad379c9 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 2 Jul 2006 19:01:52 +0000 Subject: [PATCH 128/160] Make static non-import libs have the "lib" prefix to conform to the bbv1 and auto-link existing practice. [SVN r34446] --- v2/tools/types/lib.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v2/tools/types/lib.jam b/v2/tools/types/lib.jam index 21fab6773..e47a0c6fe 100644 --- a/v2/tools/types/lib.jam +++ b/v2/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 ad1e6a2db508e6be27043bc2b213ea284be8c1a0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 2 Jul 2006 22:23:43 +0000 Subject: [PATCH 129/160] 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] --- v2/tools/package.jam | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/v2/tools/package.jam b/v2/tools/package.jam index ff9dd0eb0..e44f851bf 100644 --- a/v2/tools/package.jam +++ b/v2/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 757cd4a0cd94ebd30a4123cf7bd527cd2959389e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Jul 2006 05:25:40 +0000 Subject: [PATCH 130/160] * rc.jam (init): Set flags for and features. Suggestion from Klaus Nowikow. [SVN r34470] --- v2/tools/rc.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v2/tools/rc.jam b/v2/tools/rc.jam index 1929b1564..077e9446c 100644 --- a/v2/tools/rc.jam +++ b/v2/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 a7f3c8a3c4a2a5e8a5b9d4c49ec4008d16fcc865 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Jul 2006 06:47:20 +0000 Subject: [PATCH 131/160] 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] --- v2/build-system.jam | 3 ++- v2/build/project.jam | 30 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index c0747ff4b..e327d0b48 100755 --- a/v2/build-system.jam +++ b/v2/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/v2/build/project.jam b/v2/build/project.jam index 32254750f..feecab007 100644 --- a/v2/build/project.jam +++ b/v2/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 eaa779f560c7e429a910b2542fa0920a875c4ebc Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 7 Jul 2006 07:14:46 +0000 Subject: [PATCH 132/160] Add example of calling Python modules from Boost.Build. [SVN r34474] --- v2/example/python_modules/Jamroot | 5 +++++ v2/example/python_modules/python_helpers.jam | 7 +++++++ v2/example/python_modules/python_helpers.py | 15 +++++++++++++++ v2/example/python_modules/readme.txt | 11 +++++++++++ 4 files changed, 38 insertions(+) create mode 100644 v2/example/python_modules/Jamroot create mode 100644 v2/example/python_modules/python_helpers.jam create mode 100644 v2/example/python_modules/python_helpers.py create mode 100644 v2/example/python_modules/readme.txt diff --git a/v2/example/python_modules/Jamroot b/v2/example/python_modules/Jamroot new file mode 100644 index 000000000..f504aaeb0 --- /dev/null +++ b/v2/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/v2/example/python_modules/python_helpers.jam b/v2/example/python_modules/python_helpers.jam new file mode 100644 index 000000000..d21e2d732 --- /dev/null +++ b/v2/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/v2/example/python_modules/python_helpers.py b/v2/example/python_modules/python_helpers.py new file mode 100644 index 000000000..4b5839f27 --- /dev/null +++ b/v2/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/v2/example/python_modules/readme.txt b/v2/example/python_modules/readme.txt new file mode 100644 index 000000000..421f771ab --- /dev/null +++ b/v2/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 9734c8de4ac9f7a19a89eb0b90bbeb092a040617 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Mon, 10 Jul 2006 15:37:26 +0000 Subject: [PATCH 133/160] Fix: Support for precompiled headers in msvc.jam was broken by the previous patch [SVN r34500] --- v2/tools/msvc.jam | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index 961ba2479..8191ac15a 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 f651aa659e0ea2977829d16773b2bc393b0704ba Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Mon, 10 Jul 2006 17:54:35 +0000 Subject: [PATCH 134/160] -Yl patch by Bojan Resnik for precompiled headers with debug info [SVN r34502] --- v2/tools/msvc.jam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index 8191ac15a..661c2d185 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 c73716c6bec6dabe9f0b748fc89dff14d5ce9f52 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 12 Jul 2006 23:11:56 +0000 Subject: [PATCH 135/160] Correct extra-libs logic for QNX [SVN r34520] --- v2/tools/python.jam | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index 3fcd6b446..534afea0a 100644 --- a/v2/tools/python.jam +++ b/v2/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 467ba04af33b2dc60b29a991582fe6c14ccf0436 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 13 Jul 2006 07:39:58 +0000 Subject: [PATCH 136/160] Fix syntax error. [SVN r34521] --- v2/tools/python.jam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index 534afea0a..d10a6c38c 100644 --- a/v2/tools/python.jam +++ b/v2/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 8fd23e4502d90bf2580443856b19e32f267b22e8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 15 Jul 2006 05:54:35 +0000 Subject: [PATCH 137/160] 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] --- historic/jam/src/execnt.c | 89 ++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 15 deletions(-) diff --git a/historic/jam/src/execnt.c b/historic/jam/src/execnt.c index a888a3f67..55bafc82e 100644 --- a/historic/jam/src/execnt.c +++ b/historic/jam/src/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 b9ff2093c04e66773da3c6ba4c7435bf6b1ef68a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 06:27:50 +0000 Subject: [PATCH 138/160] 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] --- historic/jam/src/execnt.c | 119 +++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 40 deletions(-) diff --git a/historic/jam/src/execnt.c b/historic/jam/src/execnt.c index 55bafc82e..e5e5a2889 100644 --- a/historic/jam/src/execnt.c +++ b/historic/jam/src/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 1fe1853c49c028c8d7e7f778a0f741c076deb207 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 06:34:00 +0000 Subject: [PATCH 139/160] Update version to M11 [SVN r34607] --- v2/build/version.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/build/version.jam b/v2/build/version.jam index 915140c45..3eb71a172 100644 --- a/v2/build/version.jam +++ b/v2/build/version.jam @@ -5,7 +5,7 @@ rule boost-build ( ) { - return "V2 (Milestone 10)" ; + return "V2 (Milestone 11)" ; } rule jam ( ) { From 904408a754421c96e8a0200b0c8e02719f63a14b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 07:16:17 +0000 Subject: [PATCH 140/160] No longer exclude the 'make' example [SVN r34609] --- v2/roll.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/v2/roll.sh b/v2/roll.sh index 2f206b883..eb0415b46 100644 --- a/v2/roll.sh +++ b/v2/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 e79bbbf0cd7c8fb7e279e38b5fca4fa63971ef4b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 07:19:26 +0000 Subject: [PATCH 141/160] Remove 'draft' indicator. They currently result if huge "draft" text that more scares users that warns about incomplete docs. [SVN r34610] --- v2/doc/src/standalone.xml | 2 +- v2/doc/src/tutorial.xml | 2 +- v2/doc/src/userman.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/doc/src/standalone.xml b/v2/doc/src/standalone.xml index e53812b79..c16af5dfe 100644 --- a/v2/doc/src/standalone.xml +++ b/v2/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/v2/doc/src/tutorial.xml b/v2/doc/src/tutorial.xml index 10b7a1c99..39b023826 100644 --- a/v2/doc/src/tutorial.xml +++ b/v2/doc/src/tutorial.xml @@ -4,7 +4,7 @@ - + Tutorial diff --git a/v2/doc/src/userman.xml b/v2/doc/src/userman.xml index ef80b7803..f4a9202f1 100644 --- a/v2/doc/src/userman.xml +++ b/v2/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 26bb02849d9c3316f935f0292f1c8de82d8d1548 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 07:31:21 +0000 Subject: [PATCH 142/160] Pass pass to BoostBook XSL. Remove broken configuration of msvc. [SVN r34612] --- v2/test/test-config-example.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/test/test-config-example.jam b/v2/test/test-config-example.jam index 4e98dbfd3..dd19b9549 100644 --- a/v2/test/test-config-example.jam +++ b/v2/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 e3688159dc8c1392b44c956b9f515f17e671b149 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 20 Jul 2006 07:39:15 +0000 Subject: [PATCH 143/160] Update version number [SVN r34614] --- v2/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/v2/index.html b/v2/index.html index 988ef07d8..9b68c2f53 100644 --- a/v2/index.html +++ b/v2/index.html @@ -36,9 +36,9 @@ div.sidebar p.rubric { Quick access

Please note that the build system commonly takes advantage of Jam's Dynamic Scoping feature (see - the local command in the "Flow of Control" section below the link - target) to temporarily "change" a global variable by declaring a - local of the same name.

+ "../../../doc/html/jam/language.html#jam.language.flow_of_control">Jam's + Dynamic Scoping feature (see the local command in the "Flow of + Control" section below the link target) to temporarily "change" a global + variable by declaring a local of the same name.

Many of the variables that are used to configure how Boost.Build works internally are listed here with brief diff --git a/v1/como-tools.jam b/v1/como-tools.jam index 02719ceeb..872cf7956 100644 --- a/v1/como-tools.jam +++ b/v1/como-tools.jam @@ -1,8 +1,12 @@ - -# modify, sell and distribute this software is granted provided this -# copyright notice appears in all copies. This software is provided -# "as is" without express or implied warranty, and with no claim as -# to its suitability for any purpose. +#~ Copyright 2001-2002 David Abrahams. +#~ Copyright 2002 Rene Rivera. +#~ Copyright 2002 Beman Dawes. +#~ Copyright 2003 Joel de Guzman. +#~ Copyright 2003 Jens Maurer. +#~ Copyright 2003 Matin Wille. +#~ 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) # The following #// line will be used by the regression test table generation # program as the column heading for HTML tables. Must not include version number. diff --git a/v1/edg-tools.html b/v1/edg-tools.html index 2e336aff4..b7246795f 100644 --- a/v1/edg-tools.html +++ b/v1/edg-tools.html @@ -66,7 +66,7 @@ 09 Jul, 2003

-

Written by Jens +

Copyright 2003 Jens Maurer.

Distributed under the Boost Software License, Version 1.0. (See diff --git a/v1/gcc-nocygwin-tools.html b/v1/gcc-nocygwin-tools.html index 5c95749b5..75dc893fb 100644 --- a/v1/gcc-nocygwin-tools.html +++ b/v1/gcc-nocygwin-tools.html @@ -170,7 +170,7 @@

As of 2002/01/24, some of the Boost test library DLLs don't link because of unresolved externals. This problem is shared by the mingw toolset.

-

Written May 2002 and revised January 2003 by Raoul Gough

+

Copyright 2002-2003 by Raoul + Gough

diff --git a/v1/gen_aix_import_file.py b/v1/gen_aix_import_file.py index a2ba63e25..bf6c2e63f 100644 --- a/v1/gen_aix_import_file.py +++ b/v1/gen_aix_import_file.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +#~ Copyright 2002 David Abrahams. +#~ 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) + # Valid arguments setValueArgs = {"-ld" : "LD", "-ldflags" : "LDFLAGS", diff --git a/v1/hacking.txt b/v1/hacking.txt index 8b7f0fedc..4fd80e3ef 100644 --- a/v1/hacking.txt +++ b/v1/hacking.txt @@ -147,3 +147,9 @@ HTML DOCUMENTATION. http://tidy.sourceforge.net/src/old/tidy_src_020411.tgz and "-i -wrap 78" command line parameters. + +-- +Copyright 2002-2003 Vladimir Prus. +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) diff --git a/v1/mipspro-tools.jam b/v1/mipspro-tools.jam index c8b33f66a..d0f2df6e8 100644 --- a/v1/mipspro-tools.jam +++ b/v1/mipspro-tools.jam @@ -1,3 +1,12 @@ +#~ Copyright 2001-2002 David Abrahams. +#~ Copyright 2002-2004 Rene Rivera. +#~ Copyright 2002 Ralf W. Grosse-Kunstleve. +#~ Copyright 2003 Jens Maurer. +#~ Distributed under the Boost Software License, Version 1.0. +#~ (See accompanying file LICENSE_1_0.txt or copy at +#~ http://www.boost.org/LICENSE_1_0.txt) + + # This file was originally based on gcc-tools.jam by David Abrahams. # # It has been written for and tested with MIPSpro 7.3 on IRIX 6.5 diff --git a/v1/msvc-tools.html b/v1/msvc-tools.html index 57f557af6..5be3666b1 100644 --- a/v1/msvc-tools.html +++ b/v1/msvc-tools.html @@ -81,9 +81,9 @@
-

Revised - - 14 May, 2002

+

Revised $Date$

+ +

Copyright © Dave Abrahams 2002-2003, Rene Rivera 2002-2003.

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or diff --git a/v1/python.jam b/v1/python.jam index f3a312d0c..25ebae8f6 100644 --- a/v1/python.jam +++ b/v1/python.jam @@ -1,3 +1,14 @@ +#~ Copyright 2001-2005 David Abrahams. +#~ Copyright 2002-2005 Rene Rivera. +#~ Copyright 2004 Markus Schöpflin. +#~ Copyright 2005 Caleb Epstein. +#~ Copyright 2006 Jim Douglas. +#~ Copyright 2006 Alexander Nasonov. +#~ 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) + + if ! $(gPYTHON_INCLUDED) { gPYTHON_INCLUDED = true ; @@ -65,39 +76,39 @@ if $(PYTHON_WINDOWS) } else if $(UNIX) { - # PYTHON_EMBEDDED_LIBRARY: Libraries to include when - # embedding Python in C++ code. We need the Python library, - # libdl for dynamic loading and possibly libutil on BSD-like - # systems (including Linux). A dynamic libpython should - # automatically pick up the libutil dependency, but we cannot - # tell here if we are linking with a static or dynamic - # libpython, so we include libutil for all UNIX systems where - # it is available. + # PYTHON_EMBEDDED_LIBRARY: Libraries to include when + # embedding Python in C++ code. We need the Python library, + # libdl for dynamic loading and possibly libutil on BSD-like + # systems (including Linux). A dynamic libpython should + # automatically pick up the libutil dependency, but we cannot + # tell here if we are linking with a static or dynamic + # libpython, so we include libutil for all UNIX systems where + # it is available. - if $(OS) = MACOSX - { - PYTHON_EMBEDDED_LIBRARY = ; - } - else if $(OS) = SOLARIS - { - PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) dl ; - } - else if $(OS) = OSF - { - PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) ; - } - else if $(OS) = QNXNTO - { - PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) ; - } - else if $(OS) = FREEBSD - { - PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) util ; - } - else - { - PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) dl util ; - } + if $(OS) = MACOSX + { + PYTHON_EMBEDDED_LIBRARY = ; + } + else if $(OS) = SOLARIS + { + PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) dl ; + } + else if $(OS) = OSF + { + PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) ; + } + else if $(OS) = QNXNTO + { + PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) ; + } + else if $(OS) = FREEBSD + { + PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) util ; + } + else + { + PYTHON_EMBEDDED_LIBRARY = python$(PYTHON_VERSION) dl util ; + } } @@ -518,8 +529,8 @@ rule boost-python-runtest ( : $(requirements) boost-python-disable-borland python-intel-use-gcc-stdlib # unless otherwise - # specified, assume the GCC standard - # library is needed for intel + # specified, assume the GCC standard + # library is needed for intel : $(target) : $(local-build) ] ; diff --git a/v1/qcc-3.3.1-tools.jam b/v1/qcc-3_3_1-tools.jam similarity index 100% rename from v1/qcc-3.3.1-tools.jam rename to v1/qcc-3_3_1-tools.jam diff --git a/v1/qcc-3.3.5-cpp-tools.jam b/v1/qcc-3_3_5-cpp-tools.jam similarity index 100% rename from v1/qcc-3.3.5-cpp-tools.jam rename to v1/qcc-3_3_5-cpp-tools.jam diff --git a/v1/qcc-3.3.5-gpp-tools.jam b/v1/qcc-3_3_5-gpp-tools.jam similarity index 100% rename from v1/qcc-3.3.5-gpp-tools.jam rename to v1/qcc-3_3_5-gpp-tools.jam diff --git a/v1/sunpro-tools.html b/v1/sunpro-tools.html index 758b78c05..af33ec7fc 100644 --- a/v1/sunpro-tools.html +++ b/v1/sunpro-tools.html @@ -202,6 +202,12 @@

Revised $Date$

-

Christopher Currie, Gennadiy Rozental, Jens Maurer

+

Copyright 2003 Christopher Currie, 2003 Gennadiy Rozental, 2003 Jens + Maurer

+ +

Distributed under the Boost Software License, Version 1.0. (See + accompanying file LICENSE_1_0.txt or + copy at www.boost.org/LICENSE_1_0.txt)

diff --git a/v1/sunpro-tools.jam b/v1/sunpro-tools.jam index 932f45b26..475aa064b 100644 --- a/v1/sunpro-tools.jam +++ b/v1/sunpro-tools.jam @@ -1,8 +1,8 @@ #~ Copyright 2002 Christopher Currie, Gennadiy Rozental. #~ Copyright 2003 Christopher Currie. -#~ Use, modification and distribution is subject to the Boost Software -#~ License Version 1.0. (See accompanying file LICENSE_1_0.txt or +#~ 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) # The following #// line will be used by the regression test table diff --git a/v1/test/test-testing.jam b/v1/test/test-testing.jam index 4f403fa09..518beb60e 100644 --- a/v1/test/test-testing.jam +++ b/v1/test/test-testing.jam @@ -1,3 +1,5 @@ +#~ Copyright 2004 Misha Bergal. + import testing ; local rule assert ( path : expected ) diff --git a/v1/vc-7_1-stlport-tools.jam b/v1/vc-7_1-stlport-tools.jam index c87cde07d..c4bd9113b 100644 --- a/v1/vc-7_1-stlport-tools.jam +++ b/v1/vc-7_1-stlport-tools.jam @@ -1,3 +1,9 @@ +#~ Copyright 2004 Aleksey Gurtovoy. +#~ Copyright 2005 David Abrahams. +#~ 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) + extends-toolset msvc ; flags $(gCURRENT_TOOLSET) STLPORT_LIB_BASE_NAME ; diff --git a/v1/vc-7_1-tools.jam b/v1/vc-7_1-tools.jam index 7529d6725..3a5fd120e 100644 --- a/v1/vc-7_1-tools.jam +++ b/v1/vc-7_1-tools.jam @@ -1,3 +1,9 @@ +#~ Copyright 2004 Aleksey Gurtovoy. +#~ Copyright 2005 David Abrahams. +#~ 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) + extends-toolset msvc ; # singleton variables... diff --git a/v1/vc-8_0-amd64-tools.jam b/v1/vc-8_0-amd64-tools.jam index 2e63446ca..bf4283ea7 100644 --- a/v1/vc-8_0-amd64-tools.jam +++ b/v1/vc-8_0-amd64-tools.jam @@ -1,3 +1,10 @@ +#~ Copyright 2005 Peter Dimov. +#~ Copyright 2005 David Abrahams. +#~ Copyright 2005 Rene Rivera. +#~ 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) + extends-toolset vc-8_0 ; if $(VC80_ROOT) diff --git a/v1/vc-8_0-tools.jam b/v1/vc-8_0-tools.jam index 88be34c7c..4267ae40a 100644 --- a/v1/vc-8_0-tools.jam +++ b/v1/vc-8_0-tools.jam @@ -1,3 +1,9 @@ +#~ Copyright 2004 Aleksey Gurtovoy. +#~ Copyright 2005 David Abrahams. +#~ 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) + extends-toolset msvc ; # singleton variables... diff --git a/v1/vc-8_0-x86_amd64-tools.jam b/v1/vc-8_0-x86_amd64-tools.jam index 1667d3982..4329856fb 100644 --- a/v1/vc-8_0-x86_amd64-tools.jam +++ b/v1/vc-8_0-x86_amd64-tools.jam @@ -1,3 +1,8 @@ +#~ Copyright 2004 Aleksey Gurtovoy. +#~ Distributed under the Boost Software License, Version 1.0. +#~ (See accompanying file LICENSE_1_0.txt or copy at +#~ http://www.boost.org/LICENSE_1_0.txt) + # # This is my first cut at getting the x86 to amd64 cross compiler working # with a change also to lwm_win32.hpp (no long_type is defined in THIS compiler) diff --git a/v1/vc7-stlport-tools.jam b/v1/vc7-stlport-tools.jam index d59a8b855..9f849de70 100644 --- a/v1/vc7-stlport-tools.jam +++ b/v1/vc7-stlport-tools.jam @@ -1,3 +1,10 @@ +#~ Copyright 2003 John Maddock. +#~ Copyright 2004 Rene Rivera. +#~ Copyright 2004 Aleksey Gurtovoy. +#~ 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) + extends-toolset msvc-stlport ; flags $(gCURRENT_TOOLSET) STLPORT_LIB_BASE_NAME ; diff --git a/v1/vc7-tools.jam b/v1/vc7-tools.jam index 4f0849798..9f690086f 100644 --- a/v1/vc7-tools.jam +++ b/v1/vc7-tools.jam @@ -1,3 +1,12 @@ +#~ Copyright 2002-2003 David Abrahams. +#~ Copyright 2002 Beman Dawes. +#~ Copyright 2002 Rene Rivera. +#~ Copyright 2003 Thomas Witt. +#~ Copyright 2003 John Maddock. +#~ 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) + extends-toolset msvc ; # singleton variables... From cc4c2720094ffbb245f36b90ec560f41de9d6197 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 24 Jul 2006 16:19:17 +0000 Subject: [PATCH 156/160] Fix various inspection errors. [SVN r34698] --- boost.css | 6 ++++++ index.html | 20 ++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/boost.css b/boost.css index cf5c8a97f..d0a30762d 100644 --- a/boost.css +++ b/boost.css @@ -1,3 +1,9 @@ +/* +Copyright 2002 David Abrahams. +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) + */ H1 { FONT-SIZE: 200% diff --git a/index.html b/index.html index 2490fdf12..6272221c8 100644 --- a/index.html +++ b/index.html @@ -1,9 +1,21 @@ - + + + + - + + + + -Automatic redirection failed, please go to -v1/build_system.htm. + Automatic redirection failed, please go to v1/build_system.htm. From d0cbd356a4fb52c0c713851acecbba3fcd2b95fb Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 25 Jul 2006 05:50:44 +0000 Subject: [PATCH 157/160] More patches from Bronek [SVN r34724] --- historic/jam/src/execnt.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/historic/jam/src/execnt.c b/historic/jam/src/execnt.c index 01d9cb380..081bc56ef 100644 --- a/historic/jam/src/execnt.c +++ b/historic/jam/src/execnt.c @@ -1010,7 +1010,9 @@ kill_all(DWORD pid, HANDLE process) } /* Recursive check if first process is parent (directly or indirectly) of -the second one. Both processes are passed as process ids, not handles */ +the second one. Both processes are passed as process ids, not handles. +Special return value 2 means that the second process is smss.exe and its +parent process is System (first argument is ignored) */ static int is_parent_child(DWORD parent, DWORD child) { @@ -1065,10 +1067,14 @@ is_parent_child(DWORD parent, DWORD child) This check must be performed before comparison of process creation time */ if (stricmp(pinfo.szExeFile, "csrss.exe") == 0 - || stricmp(pinfo.szExeFile, "smss.exe") == 0) + && is_parent_child(parent, pinfo.th32ParentProcessID) == 2) { - if (is_parent_child(4, pinfo.th32ParentProcessID)) - return 1; + return 1; + } + else if (stricmp(pinfo.szExeFile, "smss.exe") == 0 + && pinfo.th32ParentProcessID == 4) + { + return 2; } if (hchild != 0) @@ -1090,7 +1096,7 @@ is_parent_child(DWORD parent, DWORD child) if (tchild == 0.0 || tparent == 0.0 || tchild < tparent) return 0; - return is_parent_child(parent, pinfo.th32ParentProcessID); + return is_parent_child(parent, pinfo.th32ParentProcessID) & 1; } } From f44f673cfc729beff46487adb89fb1e23ff11a54 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 26 Jul 2006 01:33:43 +0000 Subject: [PATCH 158/160] Add missing copyright+license. [SVN r34736] --- historic/jam/index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/historic/jam/index.html b/historic/jam/index.html index fb517c46c..61bfe50ba 100644 --- a/historic/jam/index.html +++ b/historic/jam/index.html @@ -5,6 +5,11 @@ + From 79b20405d9a033f6c1777991719df1cab119e6e0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 27 Jul 2006 06:55:52 +0000 Subject: [PATCH 159/160] Fix logic for adding 'rt' on Sun. [SVN r34750] --- v2/tools/python.jam | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index b76947ba8..2c8486d78 100644 --- a/v2/tools/python.jam +++ b/v2/tools/python.jam @@ -52,6 +52,8 @@ lib dl ; lib util ; # Python uses pthread symbols. lib pthread ; +# Extra library needed by phtread on some platforms. +lib rt ; # Initializes the Python toolset. @@ -152,15 +154,17 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) # affected by threading mode. extra-libs += pthread ; + extra-libs-conditional = ; # Add 'rt' option on Sun. While we duplicate the # logic already in sun.jam and gcc.jam, I see no easy # way to refactor it. - condition += sun:rt ; + # Note that for 'sun' toolset, rt is already unconditionally + # added. switch [ modules.peek : JAMUNAME ] { - case SunOS* : + case SunOS* : { - condition += gcc:rt ; + extra-libs-conditional += gcc:rt ; } } @@ -178,8 +182,8 @@ rule init-unix ( version ? : root ? : includes ? : libraries ? : condition * ) ; alias python - : $(extra-libs) - : $(condition) + : $(extra-libs) + : $(condition) $(extra-libs-conditional) : : $(includes) $(libraries) From 0d3089e7d155c5c692a2b1668a6323fe623a6a30 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 28 Jul 2006 12:09:25 +0000 Subject: [PATCH 160/160] Fix reference to no-existing response file code [SVN r34758] --- v2/tools/como-win.jam | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/v2/tools/como-win.jam b/v2/tools/como-win.jam index e1d309133..0787db8aa 100644 --- a/v2/tools/como-win.jam +++ b/v2/tools/como-win.jam @@ -104,16 +104,9 @@ actions compile.c++ $(CONFIG_COMMAND) -c -e5 --no_version --no_prelink_verbose --display_error_number --long_long --diag_suppress=9,21,161,748,940,962 --diag_error=461 -D__STL_LONG_LONG -U$(UNDEFS) -D$(DEFINES) $(WARN) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<)" "$(>)" } -#### Archive #### - -rule archive ( targets + : sources * : properties * ) -{ - common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ; -} - actions updated together piecemeal archive { - $(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object "$(LIBRARIES)" - lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" "$(LIBRARIES)" + $(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object "$(>)" + lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" "$(>)" }