From 319e76656028fea50f4d4a1abed85ee4335ee7cf Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 19 Jan 2009 11:17:36 +0000 Subject: [PATCH 01/45] Fix for missing setup command: mt.exe isn't found without this. [SVN r50670] --- src/tools/intel-win.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/intel-win.jam b/src/tools/intel-win.jam index 9056fd13b..7cc14f314 100644 --- a/src/tools/intel-win.jam +++ b/src/tools/intel-win.jam @@ -76,7 +76,7 @@ rule init ( version ? : # the compiler version toolset.flags intel-win.compile .CC $(condition) : $(setup)icl ; toolset.flags intel-win.link .LD $(condition) : $(setup)xilink ; toolset.flags intel-win.archive .LD $(condition) : $(setup)xilink /lib ; - toolset.flags intel-win.link .MT $(condition) : mt -nologo ; + toolset.flags intel-win.link .MT $(condition) : $(setup)mt -nologo ; local m = [ MATCH (.).* : $(version) ] ; local major = $(m[1]) ; From e5de1a11607dd49932dbbf3dd6b8f4e2ad89e7bc Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 21 Jan 2009 19:37:33 +0000 Subject: [PATCH 02/45] Make cflags/cxxflags/linkflags work with intel-linux [SVN r50708] --- src/tools/intel-linux.jam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index b69a6c8a6..66897e412 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -91,7 +91,7 @@ rule compile.c++ ( targets * : sources * : properties * ) actions compile.c++ { - "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } rule compile.c ( targets * : sources * : properties * ) @@ -102,7 +102,7 @@ rule compile.c ( targets * : sources * : properties * ) actions compile.c { - "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } rule link ( targets * : sources * : properties * ) @@ -114,7 +114,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-SA) -l$(FINDLIBS-ST) $(OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS) } rule link.dll ( targets * : sources * : properties * ) From 5c69c43f95c216ac405f385553c67694bb312d4a Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 29 Jan 2009 15:26:02 +0000 Subject: [PATCH 03/45] Attempt to satisfy intel-linux 9.0's apparent need for -lutil [SVN r50869] --- src/tools/python.jam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/python.jam b/src/tools/python.jam index 80aad4ff8..498a2ad89 100644 --- a/src/tools/python.jam +++ b/src/tools/python.jam @@ -654,7 +654,8 @@ local rule system-library-dependencies ( target-os ) case aix : return pthread dl ; - case * : return pthread dl gcc:util ; + case * : return pthread dl + gcc:util linux:util ; } } From c78994c8541f8e97c892b5f9cc56ad91769e351b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 4 Feb 2009 07:47:11 +0000 Subject: [PATCH 04/45] Avoid duplicate target error when using off. Patch from Alexey Pakhunov. [SVN r51007] --- src/build/virtual-target.jam | 9 +++++++++ src/tools/msvc.jam | 22 ++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/build/virtual-target.jam b/src/build/virtual-target.jam index ac6f58247..9c2874e8b 100644 --- a/src/build/virtual-target.jam +++ b/src/build/virtual-target.jam @@ -655,6 +655,8 @@ class notfile-target : abstract-file-target { NOTFILE $(target) ; ALWAYS $(target) ; + # TEMPORARY $(target) ; + NOUPDATE $(target) ; } } @@ -675,6 +677,7 @@ class action import property-set ; import indirect ; import path ; + import set : difference ; rule __init__ ( sources * : action-name + : property-set ? ) { @@ -700,6 +703,12 @@ class action self.targets += $(targets) ; } + rule replace-targets ( old-targets * : new-targets * ) + { + self.targets = [ set.difference $(self.targets) : $(old-targets) ] ; + self.targets += $(new-targets) ; + } + rule targets ( ) { return $(self.targets) ; diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index c181e085f..1402f8592 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -981,16 +981,22 @@ class msvc-linking-generator : linking-generator { local result = [ linking-generator.generated-targets $(sources) : $(property-set) : $(project) $(name) ] ; - if [ $(property-set).get ] = "off" + + if $(result) { - if ! $(name) - { - name = [ determine-output-name $(sources) ] ; - } - + local name = [ $(result[0]).name ] ; local action = [ $(result[0]).action ] ; - result += [ virtual-target.register - [ class.new file-target $(name) : MANIFEST : $(project) : $(action) ] ] ; + + if [ $(property-set).get ] = "off" + { + local target = [ class.new file-target $(name) : MANIFEST : $(project) : $(action) ] ; + local registered-target = [ virtual-target.register $(target) ] ; + if $(action) && ( $(target) != $(registered-target) ) + { + $(action).replace-targets $(target) : $(registered-target) ; + } + result += $(registered-target) ; + } } return $(result) ; } From 7c4d02c2506d859c564d2c2cb03c78dd029b7307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Wed, 4 Feb 2009 19:14:01 +0000 Subject: [PATCH 05/45] Apply patch from Alexey Pakhunov for improved msvc assembler support. Fixes https://zigzag.lvk.cs.msu.su:7813/boost.build/ticket/214 [SVN r51013] --- src/tools/msvc.jam | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 1402f8592..372757e8e 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -296,14 +296,13 @@ else # For the assembler the following options are turned on by default: # -# -coff generate COFF format object file (compatible with cl.exe output) # -Zp4 align structures to 4 bytes # -Cp preserve case of user identifiers # -Cx preserve case in publics, externs # actions compile.asm { - $(.ASM) -nologo -c -coff -Zp4 -Cp -Cx $(USER_ASMFLAGS) -Fo "$(<:W)" "$(>:W)" + $(.ASM) -c -Zp4 -Cp -Cx -D$(DEFINES) $(ASMFLAGS) $(USER_ASMFLAGS) -Fo "$(<:W)" "$(>:W)" } @@ -852,8 +851,13 @@ local rule configure-really ( version ? : options * ) resource-compiler = [ feature.get-values : $(options) ] ; resource-compiler ?= rc ; + # Turn on some options for i386 assembler + # -coff generate COFF format object file (compatible with cl.exe output) + local default-assembler-amd64 = ml64 ; + local default-assembler-i386 = "ml -coff" ; + local default-assembler-ia64 = ias ; + assembler = [ feature.get-values : $(options) ] ; - assembler ?= ml ; idl-compiler = [ feature.get-values : $(options) ] ; idl-compiler ?= midl ; @@ -880,9 +884,12 @@ local rule configure-really ( version ? : options * ) } } + local cpu-assembler = $(assembler) ; + cpu-assembler ?= $(default-assembler-$(c)) ; + toolset.flags msvc.compile .CC $(cpu-conditions) : $(setup-$(c))$(compiler) /Zm800 -nologo ; toolset.flags msvc.compile .RC $(cpu-conditions) : $(setup-$(c))$(resource-compiler) ; - toolset.flags msvc.compile .ASM $(cpu-conditions) : $(setup-$(c))$(assembler) ; + toolset.flags msvc.compile .ASM $(cpu-conditions) : $(setup-$(c))$(cpu-assembler) -nologo ; toolset.flags msvc.link .LD $(cpu-conditions) : $(setup-$(c))$(linker) /NOLOGO /INCREMENTAL:NO ; toolset.flags msvc.archive .LD $(cpu-conditions) : $(setup-$(c))$(linker) /lib /NOLOGO ; toolset.flags msvc.compile .IDL $(cpu-conditions) : $(setup-$(c))$(idl-compiler) ; @@ -1119,6 +1126,15 @@ local rule register-toolset-really ( ) # Declare flags for the assembler. toolset.flags msvc.compile.asm USER_ASMFLAGS ; + toolset.flags msvc.compile.asm ASMFLAGS on : "/Zi /Zd" ; + + toolset.flags msvc.compile.asm ASMFLAGS on : /W3 ; + toolset.flags msvc.compile.asm ASMFLAGS off : /W0 ; + toolset.flags msvc.compile.asm ASMFLAGS all : /W4 ; + toolset.flags msvc.compile.asm ASMFLAGS on : /WX ; + + toolset.flags msvc.compile.asm DEFINES ; + # Declare flags for linking. { toolset.flags msvc.link PDB_LINKFLAG on/database : /PDB: ; # not used yet From 34c4942aee0872e6ccdf28ef24d1fdc25af7afe1 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 12 Feb 2009 19:10:40 +0000 Subject: [PATCH 06/45] Fix generator_selection on windows [SVN r51227] --- test/generator_selection.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/generator_selection.py b/test/generator_selection.py index d141dc334..9616bd5bc 100755 --- a/test/generator_selection.py +++ b/test/generator_selection.py @@ -36,11 +36,19 @@ alias the-other-obj : Other//other-obj ; t.write("Other/mygen.jam", """ import generators ; +import os ; import type ; type.register MY_TYPE : extension ; generators.register-standard mygen.generate-a-cpp-file : MY_TYPE : CPP ; rule generate-a-cpp-file { ECHO Generating a CPP file... ; } -actions generate-a-cpp-file { echo "void g() {}" > "$(<)" } +if [ os.name ] = NT +{ + actions generate-a-cpp-file { echo void g() {} > "$(<)" } +} +else +{ + actions generate-a-cpp-file { echo "void g() {}" > "$(<)" } +} """) t.write("Other/jamfile.jam", """ From 83f272906b39f103944baea876d90aa3e504e625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Thu, 12 Feb 2009 20:38:33 +0000 Subject: [PATCH 07/45] Major refactoring of Qt4 toolchain featuring: - support for multiple 'using qt' statements. - auto-detection of Qt version using qmake. - support for user-specified version. - better debug messages. - support for toolset requirements. [SVN r51230] --- src/tools/qt.jam | 4 +- src/tools/qt4.jam | 524 ++++++++++++++++++++++++++++++---------------- 2 files changed, 342 insertions(+), 186 deletions(-) diff --git a/src/tools/qt.jam b/src/tools/qt.jam index ab29f9357..8aa7ca266 100644 --- a/src/tools/qt.jam +++ b/src/tools/qt.jam @@ -9,9 +9,9 @@ import qt4 ; -rule init ( prefix ? ) +rule init ( prefix : full_bin ? : full_inc ? : full_lib ? : version ? : condition * ) { - qt4.init $(prefix) ; + qt4.init $(prefix) : $(full_bin) : $(full_inc) : $(full_lib) : $(version) : $(condition) ; } diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index 78df4f5fb..b38549e1e 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -1,6 +1,6 @@ # Copyright 2002-2006 Vladimir Prus # Copyright 2005 Alo Sarv -# Copyright 2005-2006 Juergen Hunold +# Copyright 2005-2009 Juergen Hunold # # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at @@ -66,20 +66,108 @@ import scanner ; # Or add more auto-configuration (like python). feature.feature qt3support : off on : propagated link-incompatible ; +# The Qt version used for requirements +# Valid are 4.4 or 4.5.0 +# Auto-detection via qmake sets 'major.minor.patch' +feature.feature qt : : propagated ; + project.initialize $(__name__) ; project qt ; # Save the project so that we tolerate 'import + using' combo. .project = [ project.current ] ; +# Helper utils for easy debug output +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = TRUE ; +} -# Initialized the QT support module. The 'prefix' parameter tells where QT is -# installed. +local rule debug-message ( message * ) +{ + if $(.debug-configuration) = TRUE + { + ECHO notice: [qt4-cfg] $(message) ; + } +} + +# Capture qmake output line by line +local rule read-output ( content ) +{ + local lines ; + local nl = " +" ; + local << = "([^$(nl)]*)[$(nl)](.*)" ; + local line+ = [ MATCH "$(<<)" : "$(content)" ] ; + while $(line+) + { + lines += $(line+[1]) ; + line+ = [ MATCH "$(<<)" : "$(line+[2])" ] ; + } + return $(lines) ; +} + +# Capture Qt version from qmake +local rule check-version ( bin_prefix ) +{ + full-cmd = $(bin_prefix)"/qmake -v" ; + debug-message Running '$(full-cmd)' ; + local output = [ SHELL $(full-cmd) ] ; + for line in [ read-output $(output) ] + { + # Parse the output to get all the results. + if [ MATCH "QMake" : $(line) ] + { + # Skip first line of output + } + else + { + temp = [ MATCH "([0-9]*)\\.([0-9]*)\\.([0-9]*)" : $(line) ] ; + } + } + return $(temp) ; +} + +# Validate the version string and extract the major/minor part we care about. # -rule init ( prefix : full_bin ? : full_inc ? : full_lib ? ) +local rule split-version ( version ) +{ + local major-minor = [ MATCH ^([0-9]+)\.([0-9]+)(.*)$ : $(version) : 1 2 3 ] ; + if ! $(major-minor[2]) || $(major-minor[3]) + { + ECHO "Warning: 'using qt' expects a two part (major, minor) version number; got" $(version) instead ; + + # Add a zero to account for the missing digit if necessary. + major-minor += 0 ; + } + + return $(major-minor[1]) $(major-minor[2]) ; +} + +# Initialize the QT support module. +# Parameters: +# - 'prefix' parameter tells where Qt is installed. +# - 'full_bin' optional full path to Qt binaries (qmake,moc,uic,rcc) +# - 'full_inc' optional full path to Qt top-level include directory +# - 'full_lib' optional full path to Qt library directory +# - 'version' optional version of Qt, else autodetected via 'qmake -v' +# - 'condition' optional requirements +rule init ( prefix : full_bin ? : full_inc ? : full_lib ? : version ? : condition * ) { project.push-current $(.project) ; + debug-message "==== Configuring Qt ... ====" ; + for local v in version cmd-or-prefix includes libraries condition + { + if $($(v)) + { + debug-message " user-specified "$(v): '$($(v))' ; + } + } + + # Needed as default value + .prefix = $(prefix) ; + # pre-build paths to detect reinitializations changes local inc_prefix lib_prefix bin_prefix ; if $(full_inc) @@ -107,38 +195,15 @@ rule init ( prefix : full_bin ? : full_inc ? : full_lib ? ) bin_prefix = $(prefix)/bin ; } - if $(.initialized) - { - if $(prefix) != $(.prefix) - { - errors.error - "Attempt the reinitialize QT with different installation prefix" ; - } - if $(inc_prefix) != $(.incprefix) - { - errors.error - "Attempt the reinitialize QT with different include path" ; - } - if $(lib_prefix) != $(.libprefix) - { - errors.error - "Attempt the reinitialize QT with different library path" ; - } - if $(bin_prefix) != $(.binprefix) - { - errors.error - "Attempt the reinitialize QT with different bin path" ; - } - } - else - { - .initialized = true ; - .prefix = $(prefix) ; + # Globally needed variables + .incprefix = $(inc_prefix) ; + .libprefix = $(lib_prefix) ; + .binprefix = $(bin_prefix) ; - # Setup prefixes for include, binaries and libs. - .incprefix = $(.prefix)/include ; - .libprefix = $(.prefix)/lib ; - .binprefix = $(.prefix)/bin ; + if ! $(.initialized) + { + # Make sure this is initialised only once + .initialized = true ; # Generates cpp files from header files using "moc" tool generators.register-standard qt4.moc : H : CPP(moc_%) : qt4 ; @@ -160,138 +225,225 @@ rule init ( prefix : full_bin ? : full_inc ? : full_lib ? ) # dependency scanner for wrapped files. type.set-scanner QRC : qrc-scanner ; - - # Test for a buildable Qt. - if [ glob $(.prefix)/Jamroot ] - { - .bjam-qt = true - # this will declare QtCore (and qtmain on windows) - add-shared-library QtCore ; - } - else - # Setup common pre-built Qt. - # Special setup for QtCore on which everything depends - { - local usage-requirements = - $(.incprefix) - $(.libprefix) - $(.libprefix) - multi - qt4 ; - - 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 the qtmain library - # (for WinMain). - .suffix_version = "4" ; - .suffix_debug = "d" ; - lib qtmain - : # sources - : # requirements - qtmain$(.suffix_debug) - debug - ; - - lib qtmain - : # sources - : # requirements - qtmain - ; - main = qtmain ; - } - else if [ os.name ] = MACOSX - { - # On MacOS X, both debug and release libraries are available. - .suffix_version = "" ; - .suffix_debug = "_debug" ; - } - else - { - # Since Qt-4.2, debug versions on unix have to be built - # separately and therefore have no suffix. - .suffix_version = "" ; - .suffix_debug = "" ; - } - - lib QtCore : $(main) - : # requirements - QtCore$(.suffix_version) - : # default-build - : # usage-requirements - QT_CORE_LIB - QT_NO_DEBUG - $(.incprefix)/QtCore - $(usage-requirements) - ; - lib QtCore : $(main) - : # requirements - QtCore$(.suffix_debug)$(.suffix_version) - debug - : # default-build - : # usage-requirements - QT_CORE_LIB - $(.incprefix)/QtCore - $(usage-requirements) - ; - } - - # Initialising the remaining libraries is canonical - add-shared-library QtGui : QtCore : QT_GUI_LIB ; - add-shared-library QtNetwork : QtCore : QT_NETWORK_LIB ; - add-shared-library QtSql : QtCore : QT_SQL_LIB ; - add-shared-library QtXml : QtCore : QT_XML_LIB ; - - add-shared-library Qt3Support : QtGui QtNetwork QtXml QtSql - : QT_QT3SUPPORT_LIB QT3_SUPPORT - : on ; - - # Dummy target to enable "off" and - # "/qt//Qt3Support" at the same time. This enables quick - # switching from one to the other for test/porting purposes. - alias Qt3Support : : : : off ; - - # OpenGl Support - add-shared-library QtOpenGL : QtGui : QT_OPENGL_LIB ; - - # SVG-Support (Qt 4.1) - add-shared-library QtSvg : QtXml QtOpenGL : QT_SVG_LIB ; - - # Test-Support (Qt 4.1) - add-shared-library QtTest : QtCore ; - - # Qt designer library - add-shared-library QtDesigner : QtGui QtXml ; - - # Support for dynamic Widgets (Qt 4.1) - add-static-library QtUiTools : QtGui QtXml ; - - # DBus-Support (Qt 4.2) - add-shared-library QtDBus : QtXml ; - - # Script-Engine (Qt 4.3) - add-shared-library QtScript : QtGui QtXml ; - - # WebKit (Qt 4.4) - add-shared-library QtWebKit : QtGui : QT_WEBKIT_LIB ; - - # Phonon Multimedia (Qt 4.4) - add-shared-library phonon : QtGui QtXml : QT_PHONON_LIB ; - - # XmlPatterns-Engine (Qt 4.4) - add-shared-library QtXmlPatterns : QtNetwork : QT_XMLPATTERNS_LIB ; - - # Help-Engine (Qt 4.4) - add-shared-library QtHelp : QtGui QtSql QtXml ; - - # AssistantClient Support - # Compat library - # Pre-4.4 help system, use QtHelp for new programs - add-shared-library QtAssistantClient : QtGui : : : QtAssistant ; + # Save value of first occuring prefix + .PREFIX = $(prefix) ; } + if $(version) + { + major-minor = [ split-version $(version) ] ; + version = $(major-minor:J=.) ; + } + else + { + version = [ check-version $(bin_prefix) ] ; + if $(version) + { + version = $(version:J=.) ; + } + debug-message Detected version '$(version)' ; + } + + local target-requirements = $(condition) ; + + # Add the version, if any, to the target requirements. + if $(version) + { + if ! $(version) in [ feature.values qt ] + { + feature.extend qt : $(version) ; + } + target-requirements += $(version:E=default) ; + } + + local target-os = [ feature.get-values target-os : $(condition) ] ; + if ! $(target-os) + { + target-os ?= [ feature.defaults target-os ] ; + target-os = $(target-os:G=) ; + target-requirements += $(target-os) ; + } + + # Build exact requirements for the tools + local tools-requirements = $(target-requirements:J=/) ; + + debug-message "Details of this Qt configuration:" ; + debug-message " prefix: " '$(prefix:E=)' ; + debug-message " binary path: " '$(bin_prefix:E=)' ; + debug-message " include path:" '$(inc_prefix:E=)' ; + debug-message " library path:" '$(lib_prefix:E=)' ; + debug-message " target requirements:" '$(target-requirements)' ; + debug-message " tool requirements: " '$(tools-requirements)' ; + + # setup the paths for the tools + toolset.flags qt4.moc .BINPREFIX $(tools-requirements) : $(bin_prefix) ; + toolset.flags qt4.rcc .BINPREFIX $(tools-requirements) : $(bin_prefix) ; + toolset.flags qt4.uic-h .BINPREFIX $(tools-requirements) : $(bin_prefix) ; + + # TODO: 2009-02-12: Better support for directories + # Most likely needed are separate getters for: include,libraries,binaries and sources. + toolset.flags qt4.directory .PREFIX $(tools-requirements) : $(prefix) ; + + # Test for a buildable Qt. + if [ glob $(.prefix)/Jamroot ] + { + .bjam-qt = true + + # this will declare QtCore (and qtmain on windows) + add-shared-library QtCore ; + } + else + # Setup common pre-built Qt. + # Special setup for QtCore on which everything depends + { + local usage-requirements = + $(.incprefix) + $(.libprefix) + $(.libprefix) + multi + qt4 ; + + local suffix ; + + # Since Qt-4.2, debug versions on unix have to be built + # separately and therefore have no suffix. + .suffix_version = "" ; + .suffix_debug = "" ; + + # Control flag for auto-configuration of the debug libraries. + # This setup requires Qt 'configure -debug-and-release'. + # Only available on some platforms. + # ToDo: 2009-02-12: Maybe throw this away and + # require separate setup with debug as condition. + .have_separate_debug = FALSE ; + + # Setup other platforms + if $(target-os) in windows cygwin + { + .have_separate_debug = TRUE ; + + # On NT, the libs have "4" suffix, and "d" suffix in debug builds. + .suffix_version = "4" ; + .suffix_debug = "d" ; + + # On Windows we must link against the qtmain library + lib qtmain + : # sources + : # requirements + qtmain$(.suffix_debug) + debug + $(target-requirements) + ; + + lib qtmain + : # sources + : # requirements + qtmain + $(target-requirements) + ; + } + else if $(target-os) = darwin + { + # On MacOS X, both debug and release libraries are available. + .suffix_debug = "_debug" ; + + .have_separate_debug = TRUE ; + + alias qtmain ; + } + else + { + alias qtmain : : $(target-requirements) ; + } + + lib QtCore : qtmain + : # requirements + QtCore$(.suffix_version) + $(target-requirements) + : # default-build + : # usage-requirements + QT_CORE_LIB + QT_NO_DEBUG + $(.incprefix)/QtCore + $(usage-requirements) + ; + + if $(.have_separate_debug) = TRUE + { + debug-message Configure debug libraries with suffix '$(.suffix_debug)' ; + + lib QtCore : $(main) + : # requirements + QtCore$(.suffix_debug)$(.suffix_version) + debug + $(target-requirements) + : # default-build + : # usage-requirements + QT_CORE_LIB + $(.incprefix)/QtCore + $(usage-requirements) + ; + } + } + + # Initialising the remaining libraries is canonical + # parameters 'module' : 'depends-on' : 'usage-define' : 'requirements' : 'include' + # 'include' only for non-canonical include paths. + add-shared-library QtGui : QtCore : QT_GUI_LIB : $(target-requirements) ; + add-shared-library QtNetwork : QtCore : QT_NETWORK_LIB : $(target-requirements) ; + add-shared-library QtSql : QtCore : QT_SQL_LIB : $(target-requirements) ; + add-shared-library QtXml : QtCore : QT_XML_LIB : $(target-requirements) ; + + add-shared-library Qt3Support : QtGui QtNetwork QtXml QtSql + : QT_QT3SUPPORT_LIB QT3_SUPPORT + : on $(target-requirements) ; + + # Dummy target to enable "off" and + # "/qt//Qt3Support" at the same time. This enables quick + # switching from one to the other for test/porting purposes. + alias Qt3Support : : off $(target-requirements) ; + + # OpenGl Support + add-shared-library QtOpenGL : QtGui : QT_OPENGL_LIB : $(target-requirements) ; + + # SVG-Support (Qt 4.1) + add-shared-library QtSvg : QtXml QtOpenGL : QT_SVG_LIB : $(target-requirements) ; + + # Test-Support (Qt 4.1) + add-shared-library QtTest : QtCore : : $(target-requirements) ; + + # Qt designer library + add-shared-library QtDesigner : QtGui QtXml : : $(target-requirements) ; + + # Support for dynamic Widgets (Qt 4.1) + add-static-library QtUiTools : QtGui QtXml : $(target-requirements) ; + + # DBus-Support (Qt 4.2) + add-shared-library QtDBus : QtXml : : $(target-requirements) ; + + # Script-Engine (Qt 4.3) + add-shared-library QtScript : QtGui QtXml : : $(target-requirements) ; + + # WebKit (Qt 4.4) + add-shared-library QtWebKit : QtGui : QT_WEBKIT_LIB : $(target-requirements) ; + + # Phonon Multimedia (Qt 4.4) + add-shared-library phonon : QtGui QtXml : QT_PHONON_LIB : $(target-requirements) ; + + # XmlPatterns-Engine (Qt 4.4) + add-shared-library QtXmlPatterns : QtNetwork : QT_XMLPATTERNS_LIB : $(target-requirements) ; + + # Help-Engine (Qt 4.4) + add-shared-library QtHelp : QtGui QtSql QtXml : : $(target-requirements) ; + + # AssistantClient Support + # Compat library + # Pre-4.4 help system, use QtHelp for new programs + add-shared-library QtAssistantClient : QtGui : : $(target-requirements) : QtAssistant ; + + debug-message "==== Configured Qt-$(version) ====" ; + project.pop-current ; } @@ -420,7 +572,7 @@ class moc-inc-generator : generator # rule directory { - return $(.prefix) ; + return $(.PREFIX) ; } # Add a shared Qt library. @@ -474,19 +626,22 @@ rule add-library ( lib-name : version ? : depends-on * : usage-defines * : requi $(usage-defines) $(.incprefix)/$(real_include) ; - - lib $(lib-name) - : # sources - $(depends-on) - : # requirements - $(lib-name)$(.suffix_debug)$(version) - $(requirements) - debug - : # default-build - : # usage-requirements - $(usage-defines) - $(.incprefix)/$(real_include) - ; + + if $(.have_separate_debug) = TRUE + { + lib $(lib-name) + : # sources + $(depends-on) + : # requirements + $(lib-name)$(.suffix_debug)$(version) + $(requirements) + debug + : # default-build + : # usage-requirements + $(usage-defines) + $(.incprefix)/$(real_include) + ; + } } # Make library explicit so that a simple qt4 will not bring in everything. @@ -494,18 +649,19 @@ rule add-library ( lib-name : version ? : depends-on * : usage-defines * : requi explicit $(lib-name) ; } +# Use $(.BINPREFIX[-1]) for the paths as several tools-requirements can match. +# The exact match is the last one. # Get and from current toolset. flags qt4.moc INCLUDES ; flags qt4.moc DEFINES ; - # Processes headers to create Qt MetaObject information. Qt4-moc has its # c++-parser, so pass INCLUDES and DEFINES. -# +# actions moc { - $(.binprefix)/moc -I$(INCLUDES) -D$(DEFINES) -f $(>) -o $(<) + $(.BINPREFIX[-1])/moc -I$(INCLUDES) -D$(DEFINES) -f $(>) -o $(<) } @@ -514,7 +670,7 @@ actions moc # actions moc.inc { - $(.binprefix)/moc -I$(INCLUDES) -D$(DEFINES) $(>) -o $(<) + $(.BINPREFIX[-1])/moc -I$(INCLUDES) -D$(DEFINES) $(>) -o $(<) } @@ -522,7 +678,7 @@ actions moc.inc # actions rcc { - $(.binprefix)/rcc $(>) -name $(>:B) -o $(<) + $(.BINPREFIX[-1])/rcc $(>) -name $(>:B) -o $(<) } @@ -530,7 +686,7 @@ actions rcc # actions uic-h { - $(.binprefix)/uic $(>) -o $(<) + $(.BINPREFIX[-1])/uic $(>) -o $(<) } From 1b9601f79d896b26332c8fe7c5608536b00a63cd Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 13 Feb 2009 16:55:07 +0000 Subject: [PATCH 08/45] Use $(type) instead of type. Fixes #2648 [SVN r51240] --- src/build/type.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/type.jam b/src/build/type.jam index fdd9acc8f..1a7a57823 100644 --- a/src/build/type.jam +++ b/src/build/type.jam @@ -117,7 +117,7 @@ rule register-suffixes ( suffixes + : type ) { .type.$(s) = $(type) ; } - else if $(.type.$(s)) != type + else if $(.type.$(s)) != $(type) { errors.error Attempting to specify multiple types for suffix \"$(s)\" : "Old type $(.type.$(s)), New type $(type)" ; From 8d541bc8445355647c206fdc1f98abbc6f052d20 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 13 Feb 2009 20:51:25 +0000 Subject: [PATCH 09/45] Use .dll extension for shared libraries on cygwin. Fixes #2734 [SVN r51241] --- src/tools/types/lib.jam | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/types/lib.jam b/src/tools/types/lib.jam index 45446cbe1..c343b788a 100644 --- a/src/tools/types/lib.jam +++ b/src/tools/types/lib.jam @@ -25,6 +25,7 @@ type.set-generated-target-prefix IMPORT_LIB : : "" ; type.register SHARED_LIB : so dll dylib : LIB ; type.set-generated-target-suffix SHARED_LIB : windows : dll ; +type.set-generated-target-suffix SHARED_LIB : cygwin : dll ; type.set-generated-target-suffix SHARED_LIB : darwin : dylib ; type SEARCHED_LIB : : LIB ; From 46ee4613a0fea9cf418d979494c69f0ecbb5a348 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sun, 15 Feb 2009 19:02:10 +0000 Subject: [PATCH 10/45] Don't unintentially collect all new targets in a global variable. [SVN r51260] --- src/tools/boostbook.jam | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/boostbook.jam b/src/tools/boostbook.jam index 8bec8602c..6a2468579 100644 --- a/src/tools/boostbook.jam +++ b/src/tools/boostbook.jam @@ -311,6 +311,7 @@ class boostbook-generator : generator local global-catalog = [ boostbook.xml-catalog ] ; local catalog = $(global-catalog[1]) ; local catalog-file = $(global-catalog[2]) ; + local targets ; # Add the catalog to the property set property-set = [ $(property-set).add-raw $(catalog-file) ] ; From a8c9875b9ba6cc3d39e3633b4d6d833a9a275ce1 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 16 Feb 2009 10:40:26 +0000 Subject: [PATCH 11/45] Add preliminary HTMLHelp support. [SVN r51269] --- src/tools/boostbook.jam | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/boostbook.jam b/src/tools/boostbook.jam index 6a2468579..bdb14b78e 100644 --- a/src/tools/boostbook.jam +++ b/src/tools/boostbook.jam @@ -334,6 +334,7 @@ class boostbook-generator : generator case htmlhelp : { type = HTMLHELP ; + manifest = HTML.manifest ; } case onehtml : type = HTML ; From b9b1382251f7ea52176cf37424bff61d903018f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Mon, 16 Feb 2009 19:35:15 +0000 Subject: [PATCH 12/45] Fix: Correct handling of include paths with spaces. [SVN r51275] --- src/tools/qt4.jam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index b38549e1e..f8a9dbe75 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -661,7 +661,7 @@ flags qt4.moc DEFINES ; # actions moc { - $(.BINPREFIX[-1])/moc -I$(INCLUDES) -D$(DEFINES) -f $(>) -o $(<) + $(.BINPREFIX[-1])/moc -I"$(INCLUDES)" -D$(DEFINES) -f $(>) -o $(<) } @@ -670,7 +670,7 @@ actions moc # actions moc.inc { - $(.BINPREFIX[-1])/moc -I$(INCLUDES) -D$(DEFINES) $(>) -o $(<) + $(.BINPREFIX[-1])/moc -I"$(INCLUDES)" -D$(DEFINES) $(>) -o $(<) } From 18b11c79601a04edfc83fd933f6df7b06ee3600b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Tue, 17 Feb 2009 19:30:19 +0000 Subject: [PATCH 13/45] Add support for QtScriptTools (Qt-4.5) [SVN r51300] --- src/tools/qt4.jam | 5 +++- test/qt4/jamroot.jam | 1 + test/qt4/qtscript.cpp | 3 +-- test/qt4/qtscripttools.cpp | 47 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 test/qt4/qtscripttools.cpp diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index f8a9dbe75..4857d8e4c 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -423,7 +423,10 @@ rule init ( prefix : full_bin ? : full_inc ? : full_lib ? : version ? : conditio add-shared-library QtDBus : QtXml : : $(target-requirements) ; # Script-Engine (Qt 4.3) - add-shared-library QtScript : QtGui QtXml : : $(target-requirements) ; + add-shared-library QtScript : QtGui QtXml : QT_SCRIPT_LIB : $(target-requirements) ; + + # Tools for the Script-Engine (Qt 4.5) + add-shared-library QtScriptTools : QtScript : QT_SCRIPTTOOLS_LIB : $(target-requirements) ; # WebKit (Qt 4.4) add-shared-library QtWebKit : QtGui : QT_WEBKIT_LIB : $(target-requirements) ; diff --git a/test/qt4/jamroot.jam b/test/qt4/jamroot.jam index 6770012b0..0746b91d1 100644 --- a/test/qt4/jamroot.jam +++ b/test/qt4/jamroot.jam @@ -27,6 +27,7 @@ if [ qt4.initialized ] [ run qtxml.cpp /qt//QtXml ] [ run qtnetwork.cpp /qt//QtNetwork ] [ run qtscript.cpp /qt//QtScript ] + [ run qtscripttools.cpp /qt//QtScriptTools ] [ run qtxmlpatterns.cpp /qt//QtXmlPatterns ] # ToDo: runable example code diff --git a/test/qt4/qtscript.cpp b/test/qt4/qtscript.cpp index 275eb4ff2..20528365b 100644 --- a/test/qt4/qtscript.cpp +++ b/test/qt4/qtscript.cpp @@ -20,7 +20,7 @@ operator << (std::ostream& stream, QString const& string) BOOST_AUTO_TEST_CASE( defines) { - BOOST_CHECK_EQUAL(BOOST_IS_DEFINED(QT_CORE_LIB), true); + BOOST_CHECK_EQUAL(BOOST_IS_DEFINED(QT_SCRIPT_LIB), true); } BOOST_AUTO_TEST_CASE( script ) @@ -30,5 +30,4 @@ BOOST_AUTO_TEST_CASE( script ) BOOST_CHECK_EQUAL(three.toNumber(), 3); BOOST_CHECK_EQUAL(three.toString(), QLatin1String("3")); - } diff --git a/test/qt4/qtscripttools.cpp b/test/qt4/qtscripttools.cpp new file mode 100644 index 000000000..4d0b7f256 --- /dev/null +++ b/test/qt4/qtscripttools.cpp @@ -0,0 +1,47 @@ +// (c) Copyright Juergen Hunold 2009 +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_TEST_MODULE QtScriptTools + +#include + +#include + +#include + +#include + +#include + +namespace utf = boost::unit_test::framework; + +std::ostream& +operator << (std::ostream& stream, QString const& string) +{ + stream << qPrintable(string); + return stream; +} + +BOOST_AUTO_TEST_CASE( defines) +{ + BOOST_CHECK_EQUAL(BOOST_IS_DEFINED(QT_SCRIPTTOOLS_LIB), true); +} + +BOOST_AUTO_TEST_CASE( script ) +{ + QApplication app(utf::master_test_suite().argc, + utf::master_test_suite().argv); + + QScriptEngine myEngine; + QScriptValue three = myEngine.evaluate("1 + 2"); + + QScriptEngineDebugger debugger; + debugger.attachTo(&myEngine); + + BOOST_CHECK_EQUAL(three.toNumber(), 3); + BOOST_CHECK_EQUAL(three.toString(), QLatin1String("3")); + + debugger.detach(); +} From ad8b13cb7e1f7edcb5d50a7d7d690105d93f5a44 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 18 Feb 2009 12:49:13 +0000 Subject: [PATCH 14/45] Do not use -fast, since it causes the code to be generated for the processor the compiler is running on. Use -xO4 instead. Fixes #2773. [SVN r51308] --- src/tools/sun.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/sun.jam b/src/tools/sun.jam index 539fd3003..8f10d6a44 100644 --- a/src/tools/sun.jam +++ b/src/tools/sun.jam @@ -49,7 +49,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 ; +flags sun.compile OPTIONS speed : -xO4 ; flags sun.compile OPTIONS space : -xO2 -xspace ; flags sun.compile OPTIONS multi : -mt ; From 7ab89e8ed7ea162938dc94f9ec04e72918699aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Wed, 18 Feb 2009 19:11:49 +0000 Subject: [PATCH 15/45] Refactoring: Rename uic-h to uic to get uniform toolnames. [SVN r51313] --- src/tools/qt4.jam | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/qt4.jam b/src/tools/qt4.jam index 4857d8e4c..fc27bcc36 100644 --- a/src/tools/qt4.jam +++ b/src/tools/qt4.jam @@ -210,7 +210,7 @@ rule init ( prefix : full_bin ? : full_inc ? : full_lib ? : version ? : conditio # The OBJ result type is a fake, 'H' will be really produced. See # comments on the generator class, defined below the 'init' function. - generators.register [ new uic-h-generator qt4.uic-h : UI : OBJ : + generators.register [ new uic-generator qt4.uic : UI : OBJ : qt4 ] ; # The OBJ result type is a fake here too. @@ -277,9 +277,9 @@ rule init ( prefix : full_bin ? : full_inc ? : full_lib ? : version ? : conditio debug-message " tool requirements: " '$(tools-requirements)' ; # setup the paths for the tools - toolset.flags qt4.moc .BINPREFIX $(tools-requirements) : $(bin_prefix) ; - toolset.flags qt4.rcc .BINPREFIX $(tools-requirements) : $(bin_prefix) ; - toolset.flags qt4.uic-h .BINPREFIX $(tools-requirements) : $(bin_prefix) ; + toolset.flags qt4.moc .BINPREFIX $(tools-requirements) : $(bin_prefix) ; + toolset.flags qt4.rcc .BINPREFIX $(tools-requirements) : $(bin_prefix) ; + toolset.flags qt4.uic .BINPREFIX $(tools-requirements) : $(bin_prefix) ; # TODO: 2009-02-12: Better support for directories # Most likely needed are separate getters for: include,libraries,binaries and sources. @@ -467,7 +467,7 @@ rule initialized ( ) # linking generator tries to convert sources to OBJ, but it produces target of # type H. This is non-standard, but allowed. That header won't be mocced. # -class uic-h-generator : generator +class uic-generator : generator { rule __init__ ( * : * ) { @@ -482,7 +482,7 @@ class uic-h-generator : generator name = $(name:B) ; } - local a = [ new action $(sources[1]) : qt4.uic-h : $(property-set) ] ; + local a = [ new action $(sources[1]) : qt4.uic : $(property-set) ] ; # The 'ui_' prefix is to match qmake's default behavior. local target = [ new file-target ui_$(name) : H : $(project) : $(a) ] ; @@ -687,7 +687,7 @@ actions rcc # Generates user-interface source from .ui files. # -actions uic-h +actions uic { $(.BINPREFIX[-1])/uic $(>) -o $(<) } From 5873b7bc2356719f3dbeccaeaca78d4ea42dada3 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 19 Feb 2009 09:17:20 +0000 Subject: [PATCH 16/45] When deciding what options compiler accepts, use the version number the compiler has reported, as opposed to the version number specified by the user in user-config.jam. [SVN r51326] --- src/tools/darwin.jam | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tools/darwin.jam b/src/tools/darwin.jam index e7652cb5c..925db1b91 100644 --- a/src/tools/darwin.jam +++ b/src/tools/darwin.jam @@ -91,6 +91,9 @@ rule init ( version ? : command * : options * : requirement * ) # - The configured compile driver command. local command = [ common.get-invocation-command darwin : g++ : $(command) ] ; + # The version as reported by the compiler + local real-version ; + # - Autodetect the root and bin dir if not given. if $(command) { @@ -113,8 +116,9 @@ rule init ( version ? : command * : options * : requirement * ) # - The 'command' variable can have multiple elements. When calling # the SHELL builtin we need a single string. local command-string = $(command:J=" ") ; - version ?= [ MATCH "^([0-9.]+)" + real-version = [ MATCH "^([0-9.]+)" : [ SHELL "$(command-string) -dumpversion" ] ] ; + version ?= $(real-version) ; } # - Define the condition for this toolset instance. @@ -125,12 +129,12 @@ rule init ( version ? : command * : options * : requirement * ) common.handle-options darwin : $(condition) : $(command) : $(options) ; # - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates. - if $(version) < "4.0.0" + if $(real-version) < "4.0.0" { flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ; } # - GCC 4.2 and higher in Darwin does not have -Wno-long-double. - if $(version) < "4.2.0" + if $(real-version) < "4.2.0" { flags darwin.compile OPTIONS $(condition) : -Wno-long-double ; } From 955acd74da97be11dffadb0722b9ac5b132dc302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 22 Feb 2009 15:55:04 +0000 Subject: [PATCH 17/45] Removed trailing spaces. [SVN r51390] --- test/test_all.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/test_all.py b/test/test_all.py index c2c43da53..1960ef225 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -13,8 +13,8 @@ import BoostBuild xml = "--xml" in sys.argv toolset = BoostBuild.get_toolset() - - + + # Clear environment for testing. # for s in ('BOOST_ROOT', 'BOOST_BUILD_PATH', 'JAM_TOOLSET', 'BCCROOT', 'MSVCDir', @@ -42,7 +42,7 @@ def run_tests(critical_tests, other_tests): pass_count = 0 failures_count = 0 - + for i in all_tests: passed = 1 if not xml: @@ -58,12 +58,12 @@ def run_tests(critical_tests, other_tests): failures_count = failures_count + 1 # Restore the current directory, which might be changed by the test. os.chdir(invocation_dir) - + if not xml: if passed: print "PASSED" else: - print "FAILED" + print "FAILED" else: rs = "succeed" if not passed: @@ -79,8 +79,8 @@ def run_tests(critical_tests, other_tests): print """ -""" - +""" + pass_count = pass_count + 1 sys.stdout.flush() # Makes testing under emacs more entertaining. From 478d847f1738f52f175dd39c133a428441f70646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 22 Feb 2009 16:02:58 +0000 Subject: [PATCH 18/45] Converted tabs to spaces in the Boost Build test/test_all.py to make all whitespace style used in this file consistent. [SVN r51391] --- test/test_all.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_all.py b/test/test_all.py index 1960ef225..f69cb5f36 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -45,8 +45,8 @@ def run_tests(critical_tests, other_tests): for i in all_tests: passed = 1 - if not xml: - print ("%-25s : " %(i)), + if not xml: + print ("%-25s : " %(i)), try: __import__(i) except SystemExit: From 16f13773ef322150ffca59b9c8f2adadfaefe30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 22 Feb 2009 16:56:04 +0000 Subject: [PATCH 19/45] Cleaned up the Boost Build example/generate/jamroot.jam example source file. No functional changes. [SVN r51394] --- example/generate/jamroot.jam | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/example/generate/jamroot.jam b/example/generate/jamroot.jam index bc8563a4a..a244f65fc 100644 --- a/example/generate/jamroot.jam +++ b/example/generate/jamroot.jam @@ -2,32 +2,28 @@ # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) -import common ; import "class" : new ; +import common ; rule generate-example ( project name : property-set : sources * ) { local result ; for local s in $(sources) { - #local ea = [ $(s).action ] ; - #local ep = [ $(ea).properties ] ; + #local source-name = [ $(s).name ] ; + #local source-action = [ $(s).action ] ; + #local source-properties = [ $(source-action).properties ] ; - # Create a new action, that takes the source target - # and runs 'common.copy' comamnd on it. - local a = [ - new non-scanning-action $(s) : common.copy : $(property-set) ] ; + # Create a new action, that takes the source target and runs the + # 'common.copy' command on it. + local a = [ new non-scanning-action $(s) : common.copy : $(property-set) + ] ; - local source-name = [ $(s).name ] ; - - # Create the target to represent the result of the action. - # The target has the name that was specified in Jamfile - # and passed here via the 'name' parameter, - # and the same type and project as the source. - result += [ new file-target $(name) - : [ $(s).type ] - : $(project) - : $(a) ] ; + # Create a target to represent the action result. Uses the target name + # passed here via the 'name' parameter and the same type and project as + # the source. + result += [ new file-target $(name) : [ $(s).type ] : $(project) : $(a) + ] ; } return $(result) ; } From 58efd51dc4f71b9fd25ecc9ee3198e9949a2a8dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 22 Feb 2009 17:34:25 +0000 Subject: [PATCH 20/45] Added a comment specifying several alternative implementations for the common.file-creation-command rule on Windows. [SVN r51395] --- src/tools/common.jam | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/tools/common.jam b/src/tools/common.jam index d37c14d7a..20f52d52e 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -559,6 +559,23 @@ rule file-creation-command ( ) { if [ os.name ] = NT { + # A few alternative implementations on Windows: + # + # 'type NUL >> ' + # That would construct an empty file instead of a file containing + # a space and an end-of-line marker but it would also not change + # the target's timestamp in case the file already exists. + # + # 'type NUL > ' + # That would construct an empty file instead of a file containing + # a space and an end-of-line marker but it would also destroy an + # already existing file by overwriting it with an empty one. + # + # I guess the best solution would be to allow Boost Jam to define + # built-in functions such as 'create a file', 'touch a file' or 'copy a + # file' which could be used from inside action code. That would allow + # completely portable operations without this kind of kludge. + # (22.02.2009.) (Jurko) return "echo. > " ; } else From 9de7e80a1ae53c9634d63cc44b3b4b963f6aa3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 22 Feb 2009 17:36:30 +0000 Subject: [PATCH 21/45] Makes the Boost Build testing system correctly report the number of passed test cases instead of reporting all test cases as passed. [SVN r51396] --- test/test_all.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_all.py b/test/test_all.py index f69cb5f36..26e1019a7 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -80,8 +80,8 @@ def run_tests(critical_tests, other_tests): """ - - pass_count = pass_count + 1 + if passed: + pass_count = pass_count + 1 sys.stdout.flush() # Makes testing under emacs more entertaining. # Erase the file on success. From dfda1c2bc4b6b00d4ab684c9f7fea75c552f19d0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 28 Feb 2009 11:57:44 +0000 Subject: [PATCH 22/45] Don't inherit PCH generators, since they probably don't work. [SVN r51481] --- src/tools/intel-darwin.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/intel-darwin.jam b/src/tools/intel-darwin.jam index 9a5ef9982..aa0fd8fb6 100644 --- a/src/tools/intel-darwin.jam +++ b/src/tools/intel-darwin.jam @@ -17,7 +17,12 @@ import generators ; feature.extend-subfeature toolset intel : platform : darwin ; toolset.inherit-generators intel-darwin - intel darwin : gcc : gcc.mingw.link gcc.mingw.link.dll ; + intel darwin + : gcc + # Don't inherit PCH generators. They were not tested, and probably + # don't work for this compiler. + : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch + ; generators.override intel-darwin.prebuilt : builtin.lib-generator ; generators.override intel-darwin.prebuilt : builtin.prebuilt ; From 1f96953d9e0006b348d500410371c752ee6127c2 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 1 Mar 2009 14:16:00 +0000 Subject: [PATCH 23/45] Update links to command line invocation. [SVN r51506] --- doc/src/advanced.xml | 2 +- doc/src/howto.xml | 2 +- doc/src/v1_vs_v2.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/advanced.xml b/doc/src/advanced.xml index 9a4662f77..2a30bc8ff 100644 --- a/doc/src/advanced.xml +++ b/doc/src/advanced.xml @@ -1402,7 +1402,7 @@ bjam app1 lib1//lib1 toolset=gcc variant=debug optimization=full bjam app1 lib1//lib1 gcc debug optimization=full The complete syntax, which has some additional shortcuts, is - described in . + described in . diff --git a/doc/src/howto.xml b/doc/src/howto.xml index bd0cf5b5e..4a8b892b3 100644 --- a/doc/src/howto.xml +++ b/doc/src/howto.xml @@ -22,7 +22,7 @@ If you're trying to build a project which uses Boost.Build, see and then read about - . + . diff --git a/doc/src/v1_vs_v2.xml b/doc/src/v1_vs_v2.xml index 8b77b8f01..482b61cf8 100644 --- a/doc/src/v1_vs_v2.xml +++ b/doc/src/v1_vs_v2.xml @@ -92,7 +92,7 @@ bjam toolset=msvc variant=release some_target bjam msvc release some_target - See the reference for a + See the reference for a complete description of the syntax. From 27b96125bc6943b23f3ae2e8a757ef611f0db596 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 1 Mar 2009 14:16:24 +0000 Subject: [PATCH 24/45] Use xpointer attributes in the boost build documentation. [SVN r51507] --- doc/src/reference.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/src/reference.xml b/doc/src/reference.xml index 80c3484fc..9f8302a22 100644 --- a/doc/src/reference.xml +++ b/doc/src/reference.xml @@ -770,10 +770,10 @@ using gcc : &toolset_ops; ; &option_list_intro; - - @@ -848,7 +848,7 @@ using msvc : &toolset_ops; ; &option_list_intro; - @@ -1034,7 +1034,7 @@ using intel-win : &toolset_ops; ; &option_list_intro; - @@ -1042,7 +1042,7 @@ using intel-win : &toolset_ops; ; The Linux version supports the following additional options: - @@ -1073,7 +1073,7 @@ using acc : &toolset_ops; ; &option_list_intro; - @@ -1108,7 +1108,7 @@ using borland : &toolset_ops; ; &option_list_intro; - @@ -1135,7 +1135,7 @@ using como-linux : &toolset_ops; ; &option_list_intro; - @@ -1170,10 +1170,10 @@ using cw : &toolset_ops; ; &option_list_intro; - - @@ -1232,7 +1232,7 @@ using dmc : &toolset_ops; ; &option_list_intro; - @@ -1257,7 +1257,7 @@ using hp_cxx : &toolset_ops; ; &option_list_intro; - @@ -1293,7 +1293,7 @@ using sun : &toolset_ops; ; &option_list_intro; - From 3ab33a913860c8883acaa1c0f2518e1d59c87c96 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 3 Mar 2009 13:47:44 +0000 Subject: [PATCH 25/45] Fix pch support. [SVN r51570] --- src/tools/intel-linux.jam | 46 +++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index 66897e412..eff4b6bfe 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -13,6 +13,7 @@ import gcc ; import common ; import errors ; import generators ; +import type ; feature.extend-subfeature toolset intel : platform : linux ; @@ -22,6 +23,12 @@ generators.override intel-linux.prebuilt : builtin.lib-generator ; generators.override intel-linux.prebuilt : builtin.prebuilt ; generators.override intel-linux.searched-lib-generator : searched-lib-generator ; +# Override default do-nothing generators. +generators.override intel-linux.compile.c.pch : pch.default-c-pch-generator ; +generators.override intel-linux.compile.c++.pch : pch.default-cpp-pch-generator ; + +type.set-generated-target-suffix PCH : intel linux : pchi ; + toolset.inherit-rules intel-linux : gcc ; toolset.inherit-flags intel-linux : gcc : off on full space @@ -87,22 +94,50 @@ rule compile.c++ ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } -actions compile.c++ +actions compile.c++ bind PCH_FILE { - "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)" } rule compile.c ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } -actions compile.c +actions compile.c bind PCH_FILE { - "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)" +} + +rule compile.c++.pch ( targets * : sources * : properties * ) +{ + gcc.setup-threading $(targets) : $(sources) : $(properties) ; + gcc.setup-fpic $(targets) : $(sources) : $(properties) ; +} +# +# Compiling a pch first deletes any existing *.pchi file, as Intel's compiler +# won't over-write an existing pch: instead it creates filename$1.pchi, filename$2.pchi +# etc - which appear not to do anything except take up disk space :-( +# +actions compile.c++.pch +{ + rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" +} + +rule compile.c.pch ( targets * : sources * : properties * ) +{ + gcc.setup-threading $(targets) : $(sources) : $(properties) ; + gcc.setup-fpic $(targets) : $(sources) : $(properties) ; +} + +actions compile.c.pch +{ + rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" } rule link ( targets * : sources * : properties * ) @@ -129,3 +164,6 @@ actions link.dll bind LIBRARIES { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) } + + + From 917f6d4f785a25e650eb12d586d63c471ed733d4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 11 Mar 2009 12:43:24 +0000 Subject: [PATCH 26/45] Use -bnoipath on vacpp/AIX. Patch from Etienne PIERRE. Fixes #2843. [SVN r51697] --- src/tools/vacpp.jam | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/tools/vacpp.jam b/src/tools/vacpp.jam index 5addf28e3..a5ac5db8e 100644 --- a/src/tools/vacpp.jam +++ b/src/tools/vacpp.jam @@ -75,6 +75,22 @@ if [ os.name ] = AIX flags vacpp.compile C++FLAGS : -qfuncsect ; flags vacpp.link LINKFLAGS static : -qtwolink ; + + # The -bnoipath strips the prepending (relative) path of libraries from + # the loader section in the target library or executable. Hence, during + # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded + # -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without + # this option, the prepending (relative) path + library name is + # hard-coded in the loader section, causing *only* this path to be + # searched during load-time. Note that the AIX linker does not have an + # -soname equivalent, this is as close as it gets. + # + # The above options are definately for AIX 5.x, and most likely also for + # AIX 4.x and AIX 6.x. For details about the AIX linker see: + # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf + # + flags vacpp.link LINKFLAGS shared : -bnoipath ; + # Run-time linking flags vacpp.link EXE-LINKFLAGS shared : -brtl -qtwolink ; } From 7793f0a060bc34381016853c40dfd12b8ffff846 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 13 Mar 2009 19:08:55 +0000 Subject: [PATCH 27/45] Ubreak prebuilt libraries on vacpp. [SVN r51760] --- src/tools/vacpp.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/vacpp.jam b/src/tools/vacpp.jam index a5ac5db8e..a2997a6fb 100644 --- a/src/tools/vacpp.jam +++ b/src/tools/vacpp.jam @@ -16,7 +16,7 @@ import os ; feature.extend toolset : vacpp ; toolset.inherit vacpp : unix ; -generators.override vacpp.prebuilt : builtin.lib-generator ; +generators.override vacpp.prebuilt : builtin.prebuilt ; generators.override vacpp.searched-lib-generator : searched-lib-generator ; # Configure the vacpp toolset From 7c6af70505ba983c35309635fb157d1272037859 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 13 Mar 2009 19:12:02 +0000 Subject: [PATCH 28/45] Don't use -qtwolink. It is reported in http://permalink.gmane.org/gmane.comp.lib.boost.build/20456 as breaking things. [SVN r51761] --- src/tools/vacpp.jam | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/tools/vacpp.jam b/src/tools/vacpp.jam index a2997a6fb..57a27dcf8 100644 --- a/src/tools/vacpp.jam +++ b/src/tools/vacpp.jam @@ -69,12 +69,7 @@ flags vacpp LINKFLAGS off : -s ; if [ os.name ] = AIX { - # Tell the linker to discard unneeded object files from archive libraries. - # Please note that the static constructors contained by the discarded object - # files will not be invoked. flags vacpp.compile C++FLAGS : -qfuncsect ; - flags vacpp.link LINKFLAGS static : -qtwolink ; - # The -bnoipath strips the prepending (relative) path of libraries from # the loader section in the target library or executable. Hence, during From ca3f90c0620a9ae7613b1a8b4660020f64426e00 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 16 Mar 2009 10:57:06 +0000 Subject: [PATCH 29/45] Remove another use of -qtwolink. [SVN r51792] --- src/tools/vacpp.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/vacpp.jam b/src/tools/vacpp.jam index 57a27dcf8..a3ab61c6c 100644 --- a/src/tools/vacpp.jam +++ b/src/tools/vacpp.jam @@ -87,7 +87,7 @@ if [ os.name ] = AIX flags vacpp.link LINKFLAGS shared : -bnoipath ; # Run-time linking - flags vacpp.link EXE-LINKFLAGS shared : -brtl -qtwolink ; + flags vacpp.link EXE-LINKFLAGS shared : -brtl ; } else { From 222e32cf978f81e81679dd5b9a0b470486975cd1 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 21 Mar 2009 22:45:05 +0000 Subject: [PATCH 30/45] Ubreak stdlib=sun-stlport. This patch makes the feature module check if a feature value is actually a complete permissible value, before splitting at '-' and treating each element as subfeature. Patch from Noel Belcourt. [SVN r51893] --- src/build/feature.jam | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/build/feature.jam b/src/build/feature.jam index 4982524a4..0005405eb 100644 --- a/src/build/feature.jam +++ b/src/build/feature.jam @@ -469,7 +469,9 @@ rule validate-value-string ( feature value-string ) if $($(feature).subfeatures) { - values = [ regex.split $(value-string) - ] ; + if ! ( $(value-string) in $($(feature).subfeatures) ) { + values = [ regex.split $(value-string) - ] ; + } } if ! ( $(values[1]) in $($(feature).values) ) && From e0c99b52e3c1db4e8fa0ebe1cbd52a6ef33dc6aa Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 21 Mar 2009 23:12:15 +0000 Subject: [PATCH 31/45] Include unistd.h Fixes #2596. [SVN r51896] --- src/engine/jam.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/jam.h b/src/engine/jam.h index 38680c0fc..660c58faf 100644 --- a/src/engine/jam.h +++ b/src/engine/jam.h @@ -410,6 +410,7 @@ #include #include #include +#include #ifndef OS_QNX #include From b6ed5d3cc3af018f2c0d03d42294cf515a592620 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 30 Mar 2009 17:16:09 +0000 Subject: [PATCH 32/45] Preserve test targets by default. [SVN r52062] --- src/tools/testing.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/testing.jam b/src/tools/testing.jam index 00ae42555..25398ee72 100644 --- a/src/tools/testing.jam +++ b/src/tools/testing.jam @@ -62,7 +62,7 @@ feature.feature test-info : : free incidental ; feature.feature testing.arg : : free incidental ; feature.feature testing.input-file : : free dependency ; -feature.feature preserve-test-targets : off on : incidental propagated ; +feature.feature preserve-test-targets : on off : incidental propagated ; # Register target types. type.register TEST : test ; From 33cf727d5324802e5d341067a90b82980f2aebc3 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 30 Mar 2009 17:23:52 +0000 Subject: [PATCH 33/45] Document the preserve-test-targets feature. [SVN r52063] --- doc/src/tasks.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/src/tasks.xml b/doc/src/tasks.xml index 4a37c0f8e..0d7549988 100644 --- a/doc/src/tasks.xml +++ b/doc/src/tasks.xml @@ -457,10 +457,12 @@ rule run ( sources + : args * : input-files * : requirements * : target-name ? - The run and the run-fail rules, if the test - passes, automatically delete the linked executable, to save space. This - behaviour can be suppressed by passing the - --preserve-test-targets command line option. + preserve-test-targets + If the preserve-test-targets feature has the value + off, then run and the run-fail + rules will remove the executable after running it. This somewhat decreases + disk space requirements for continuous testing environments. The default + value of preserve-test-targets feature is on. From 502d5df52ee49563f3e5f8cce99b7651951ee732 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 31 Mar 2009 18:54:47 +0000 Subject: [PATCH 34/45] Support for 64-bit compilation on acc. [SVN r52079] --- src/tools/acc.jam | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/acc.jam b/src/tools/acc.jam index e5a35b683..0f8c4c113 100644 --- a/src/tools/acc.jam +++ b/src/tools/acc.jam @@ -63,6 +63,9 @@ flags acc LINKFLAGS off : -s ; flags acc CFLAGS on : -pg ; flags acc LINKFLAGS on : -pg ; +flags acc CFLAGS 64 : +DD64 ; +flags acc LINKFLAGS 64 : +DD64 ; + flags acc CFLAGS ; flags acc C++FLAGS ; flags acc DEFINES ; From 6ff23cb92d37e8bad32553e7f2e14ee2b303d3e0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 1 Apr 2009 06:34:39 +0000 Subject: [PATCH 35/45] Add example of using built tool. [SVN r52098] --- example/built_tool/Jamroot.jam | 8 +++++++ example/built_tool/core/Jamfile.jam | 30 +++++++++++++++++++++++++++ example/built_tool/core/a.td | 0 example/built_tool/core/core.cpp | 5 +++++ example/built_tool/readme.txt | 5 +++++ example/built_tool/tblgen/Jamfile.jam | 4 ++++ example/built_tool/tblgen/tblgen.cpp | 9 ++++++++ 7 files changed, 61 insertions(+) create mode 100644 example/built_tool/Jamroot.jam create mode 100644 example/built_tool/core/Jamfile.jam create mode 100644 example/built_tool/core/a.td create mode 100644 example/built_tool/core/core.cpp create mode 100644 example/built_tool/readme.txt create mode 100644 example/built_tool/tblgen/Jamfile.jam create mode 100644 example/built_tool/tblgen/tblgen.cpp diff --git a/example/built_tool/Jamroot.jam b/example/built_tool/Jamroot.jam new file mode 100644 index 000000000..c458650e8 --- /dev/null +++ b/example/built_tool/Jamroot.jam @@ -0,0 +1,8 @@ + +import feature ; + +feature.feature tblgen : : dependency free ; + +project built_tool ; + +build-project core ; \ No newline at end of file diff --git a/example/built_tool/core/Jamfile.jam b/example/built_tool/core/Jamfile.jam new file mode 100644 index 000000000..2d96f7182 --- /dev/null +++ b/example/built_tool/core/Jamfile.jam @@ -0,0 +1,30 @@ + +import toolset ; + +project : requirements ../tblgen//tblgen ; + + +# Create a.c using a custom action defined below. +make a.c : a.td : @tblgen ; + +# Use a.c in executable. +exe core : core.cpp a.c ; + +# The action has to invoke the tool built in other +# parts of the project. The feature is used +# to specify the location of the tool, and the flags +# statement below make the full path to the tool +# available inside the action. +toolset.flags tblgen COMMAND ; + +# We generally want a.c to be rebuilt when the tool changes. +rule tblgen ( targets * : sources * : properties * ) +{ + DEPENDS $(targets) : [ on $(targets) return $(COMMAND) ] ; +} + +# The action that invokes the tool +actions tblgen bind COMMAND +{ + $(COMMAND:E=tblgen) > $(<) +} diff --git a/example/built_tool/core/a.td b/example/built_tool/core/a.td new file mode 100644 index 000000000..e69de29bb diff --git a/example/built_tool/core/core.cpp b/example/built_tool/core/core.cpp new file mode 100644 index 000000000..31a133726 --- /dev/null +++ b/example/built_tool/core/core.cpp @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} diff --git a/example/built_tool/readme.txt b/example/built_tool/readme.txt new file mode 100644 index 000000000..bbb9f9b3a --- /dev/null +++ b/example/built_tool/readme.txt @@ -0,0 +1,5 @@ + +This example shows how to build an executable and then use it +for generating other targets. The 'tblgen' subdirectory builds +a tool, while the 'core' subdirectory uses that tool. Refer +to core/Jamfile.jam for detailed comments. \ No newline at end of file diff --git a/example/built_tool/tblgen/Jamfile.jam b/example/built_tool/tblgen/Jamfile.jam new file mode 100644 index 000000000..af4906278 --- /dev/null +++ b/example/built_tool/tblgen/Jamfile.jam @@ -0,0 +1,4 @@ + +project : requirements -tblgen//tblgen ; + +exe tblgen : tblgen.cpp ; \ No newline at end of file diff --git a/example/built_tool/tblgen/tblgen.cpp b/example/built_tool/tblgen/tblgen.cpp new file mode 100644 index 000000000..fbd058133 --- /dev/null +++ b/example/built_tool/tblgen/tblgen.cpp @@ -0,0 +1,9 @@ + +#include + +int main() +{ + std::cout << "int foo;\n"; + return 0; +} + From a7eeaf28b78bd1c18fc44a6430cadd27bf6728ea Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 07:29:30 +0000 Subject: [PATCH 36/45] Adjust intel-linux inlining options for newer versions. Fixes #2419. [SVN r52164] --- src/tools/intel-linux.jam | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index eff4b6bfe..de5bf8c7c 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -14,6 +14,7 @@ import common ; import errors ; import generators ; import type ; +import numbers ; feature.extend-subfeature toolset intel : platform : linux ; @@ -62,7 +63,27 @@ rule init ( version ? : command * : options * ) { bin ?= [ common.get-absolute-tool-path $(command[-1]) ] ; root ?= $(bin:D) ; - + + local command-string = $(command:J=" ") ; + local version-output = [ SHELL "$(command-string) --version" ] ; + local real-version = [ MATCH "([0-9.]+)" : $(version-output) ] ; + local major = [ MATCH "([0-9]+).*" : $(real-version) ] ; + + # If we failed to determine major version, use the behaviour for + # the current compiler. + if $(major) && [ numbers.less $(major) 10 ] + { + flags intel-linux.compile OPTIONS $(condition)/off : "-Ob0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-Ob1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-Ob2" ; + } + else + { + flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; + } + if $(root) { # Libraries required to run the executable may be in either @@ -81,9 +102,6 @@ rule init ( version ? : command * : options * ) SPACE = " " ; -flags intel-linux.compile OPTIONS off : "-Ob0" ; -flags intel-linux.compile OPTIONS on : "-Ob1" ; -flags intel-linux.compile OPTIONS full : "-Ob2" ; flags intel-linux.compile OPTIONS space : "-O1" ; # no specific space optimization flag in icc flags intel-linux.compile OPTIONS off : -w0 ; From 97c15415aac6ff4ffb067f345d700d504b3fe267 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 07:38:27 +0000 Subject: [PATCH 37/45] Unbreak prebuilt libraries on pathscale. [SVN r52165] --- src/tools/pathscale.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/pathscale.jam b/src/tools/pathscale.jam index 3042750d0..1a81444e1 100644 --- a/src/tools/pathscale.jam +++ b/src/tools/pathscale.jam @@ -13,7 +13,7 @@ import fortran ; feature.extend toolset : pathscale ; toolset.inherit pathscale : unix ; -generators.override pathscale.prebuilt : builtin.lib-generator ; +generators.override pathscale.prebuilt : builtin.prebuilt ; generators.override pathscale.searched-lib-generator : searched-lib-generator ; # Documentation and toolchain description located From 19851c700ffe03a08f991dbe8005c75cc5c46eb4 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 18:54:12 +0000 Subject: [PATCH 38/45] Implement project-config.jam loading. [SVN r52170] --- src/build-system.jam | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/build-system.jam b/src/build-system.jam index 0a3b571c3..016942f2d 100644 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -388,6 +388,15 @@ local rule load-configuration-files ECHO "notice: User configuration file loading explicitly disabled." ; } } + + initialize-config-module project-config ; + + if [ project.find "." : "." ] + { + local project-module = [ project.load "." ] ; + local root = [ project.attribute $(project-module) project-root ] ; + load-config project-config : project-config.jam : $(root) ; + } } From ca203a07848f48d9a305f9c5b5dfdc858d3933ec Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 18:55:37 +0000 Subject: [PATCH 39/45] Allow Boost.Build to override the value of -j. [SVN r52171] --- src/engine/jam.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/engine/jam.c b/src/engine/jam.c index b68a9cb58..cbffb4765 100644 --- a/src/engine/jam.c +++ b/src/engine/jam.c @@ -476,6 +476,25 @@ int main( int argc, char * * argv, char * * arg_environ ) ++globs.noexec; } + /* The build system may set the PARALLELISM variable to override -j + options. */ + { + LIST *p = L0; + p = var_get ("PARALLELISM"); + if (p) + { + int j = atoi (p->string); + if (j == -1) + { + printf( "Invalid value of PARALLELISM: %s\n", p->string); + } + else + { + globs.jobs = j; + } + } + } + /* Now make target. */ { PROFILE_ENTER( MAIN_MAKE ); From 2e5e78b713ffb7e7dbe98bb244b748aeefa778fb Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 21:15:09 +0000 Subject: [PATCH 40/45] Adjust the search for project-config.jam. [SVN r52173] --- src/build-system.jam | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/build-system.jam b/src/build-system.jam index 016942f2d..ef2e83068 100644 --- a/src/build-system.jam +++ b/src/build-system.jam @@ -388,14 +388,23 @@ local rule load-configuration-files ECHO "notice: User configuration file loading explicitly disabled." ; } } - - initialize-config-module project-config ; - - if [ project.find "." : "." ] + + # We look for project-config.jam from "." upward. + # I am not sure this is 100% right decision, we might as well check for + # it only alonside the Jamroot file. However: + # + # - We need to load project-root.jam before Jamroot + # - We probably would need to load project-root.jam even if there's no + # Jamroot - e.g. to implement automake-style out-of-tree builds. + local file = [ path.glob "." : project-config.jam ] ; + if ! $(file) { - local project-module = [ project.load "." ] ; - local root = [ project.attribute $(project-module) project-root ] ; - load-config project-config : project-config.jam : $(root) ; + file = [ path.glob-in-parents "." : project-config.jam ] ; + } + if $(file) + { + initialize-config-module project-config ; + load-config project-config : project-config.jam : $(file:D) ; } } From 9505640385169a9dc5203d4efb87a48e82951c9f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 21:16:05 +0000 Subject: [PATCH 41/45] Make Jamroots inherit from project-config, if one exists. [SVN r52174] --- src/build/project.jam | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/build/project.jam b/src/build/project.jam index d7af1fb3b..53c32d027 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -439,6 +439,10 @@ rule initialize ( { parent-module = site-config ; } + else if $(module-name) = project-config + { + parent-module = user-config ; + } else { # We search for parent/project-root only if Jamfile was specified, i.e. @@ -453,7 +457,15 @@ rule initialize ( # inherit from user-config. if $(location) { - parent-module = user-config ; + # If project-config module exist, inherit from it. + if $(project-config.attributes) + { + parent-module = project-config ; + } + else + { + parent-module = user-config ; + } jamroot = true ; } } From d0ce66eefea5f94a468d8ff4ffc8fe79f270a54d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 6 Apr 2009 09:46:17 +0000 Subject: [PATCH 42/45] Fix exe extension on Cygwin. Fixes #2913. [SVN r52212] --- src/tools/types/exe.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/types/exe.jam b/src/tools/types/exe.jam index af6b33e46..47109513a 100644 --- a/src/tools/types/exe.jam +++ b/src/tools/types/exe.jam @@ -6,4 +6,4 @@ import type ; type.register EXE ; type.set-generated-target-suffix EXE : windows : "exe" ; -type.set-generated-target-suffix EXE : cygiwn : "exe" ; +type.set-generated-target-suffix EXE : cygwin : "exe" ; From 7ac3cc378f64cee1850e512007a1104a8f1f9e50 Mon Sep 17 00:00:00 2001 From: David Deakins Date: Wed, 8 Apr 2009 21:11:25 +0000 Subject: [PATCH 43/45] As of STLport 5.2, the version number is no longer included in the name of the static libraries. [SVN r52270] --- src/tools/stlport.jam | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tools/stlport.jam b/src/tools/stlport.jam index 4390585ba..d6d2dc6bc 100644 --- a/src/tools/stlport.jam +++ b/src/tools/stlport.jam @@ -142,7 +142,14 @@ class stlport-target-class : basic-target name += _static ; } - name += .$(self.version.5) ; + # Starting with version 5.2.0, the STLport static libraries no longer + # include a version number in their name + local version.pre.5.2 = [ MATCH "^(5[.][01]+).*" : $(version) ] ; + if $(version.pre.5.2) || [ feature.get-values : $(raw) ] != "static" + { + name += .$(self.version.5) ; + } + name = $(name:J=) ; if [ feature.get-values : $(raw) ] = "on" From 7741be55271e31d5cdd57d4de3310e4c994c7f3a Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 10 Apr 2009 20:02:51 +0000 Subject: [PATCH 44/45] Makes it possible to use an installed docutils without referring to a source distro directory. [SVN r52306] --- src/tools/docutils.jam | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/tools/docutils.jam diff --git a/src/tools/docutils.jam b/src/tools/docutils.jam old mode 100755 new mode 100644 index d6155ecfe..9055f8d53 --- a/src/tools/docutils.jam +++ b/src/tools/docutils.jam @@ -42,15 +42,19 @@ type.set-scanner ReST : rst-scanner ; generators.register-standard docutils.html : ReST : HTML ; -rule init ( docutils-dir ? ) +rule init ( docutils-dir ? : tools-dir ? ) { + ECHO docutils-dir= $(docutils-dir) ; docutils-dir ?= [ modules.peek : DOCUTILS_DIR ] ; + ECHO tools-dir= $(tools-dir) ; + tools-dir ?= $(docutils-dir)/tools ; if ! $(.initialized) { .initialized = true ; .docutils-dir = $(docutils-dir) ; - + .tools-dir = $(tools-dir:R="") ; + .setup = [ common.prepend-path-variable-command PYTHONPATH : $(.docutils-dir) $(.docutils-dir)/extras ] ; @@ -62,7 +66,7 @@ rule html ( target : source : properties * ) if ! [ on $(target) return $(RST2XXX) ] { local python-cmd = [ property.select : $(properties) ] ; - RST2XXX on $(target) = $(python-cmd:G=:E="python") $(.docutils-dir)/tools/rst2html.py ; + RST2XXX on $(target) = $(python-cmd:G=:E="python") $(.tools-dir)/rst2html.py ; } } From 47c9cd43fc55f07cb80cf943871eec22177f8281 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 11 Apr 2009 07:22:28 +0000 Subject: [PATCH 45/45] Improve handling of 'complete' build type. Previous code used default-build attribute to cause a number of property sets be requested, and then used indirect conditional requirements to filter out inappropriate ones, using the no feature. This worked but is messy, and resulted in a pile of unclear messages about no. This patch introduces custom main target class that handles filtering, so we don't ever try to build with undesired property sets. [SVN r52319] --- src/build/targets.jam | 143 ++++++++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 60 deletions(-) diff --git a/src/build/targets.jam b/src/build/targets.jam index 20da57988..a7aa2c008 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -78,6 +78,7 @@ import property-set ; import sequence ; import set ; import toolset ; +import build-request ; # Base class for all abstract targets. @@ -557,7 +558,6 @@ local rule end-building ( main-target-instance ) class main-target : abstract-target { import assert ; - import build-request ; import errors ; import feature ; import print ; @@ -657,65 +657,8 @@ class main-target : abstract-target rule apply-default-build ( property-set ) { - # 1. First, see what properties from default-build are already present - # in property-set. - - local raw = [ $(property-set).raw ] ; - local specified-features = $(raw:G) ; - - local defaults-to-apply ; - for local d in [ $(self.default-build).raw ] - { - if ! $(d:G) in $(specified-features) - { - defaults-to-apply += $(d) ; - } - } - - # 2. If there are any defaults to be applied, form a new build request. - # Pass it through to 'expand-no-defaults' since default-build might - # contain "release debug" resulting in two property-sets. - local result ; - if $(defaults-to-apply) - { - properties = [ - build-request.expand-no-defaults - - # We have to compress subproperties here to prevent property - # lists like: - # - # msvc 7.1 multi - # - # from being expanded into: - # - # 7.1/multi - # msvc/7.1/multi - # - # due to a cross-product property combination. That may be an - # indication that build-request.expand-no-defaults is the wrong - # rule to use here. - [ feature.compress-subproperties $(raw) ] - $(defaults-to-apply) - ] ; - - if $(properties) - { - for local p in $(properties) - { - result += [ property-set.create - [ feature.expand [ feature.split $(p) ] ] ] ; - } - } - else - { - result = [ property-set.empty ] ; - } - } - else - { - result = $(property-set) ; - } - return $(result) ; + return [ targets.apply-default-build $(property-set) + : $(self.default-build) ] ; } # Select an alternative for this main target, by finding all alternatives @@ -883,6 +826,69 @@ rule generate-from-reference ( return [ $(target).generate $(rproperties) ] ; } +rule apply-default-build ( property-set : default-build ) +{ + # 1. First, see what properties from default-build are already present + # in property-set. + + local raw = [ $(property-set).raw ] ; + local specified-features = $(raw:G) ; + + local defaults-to-apply ; + for local d in [ $(default-build).raw ] + { + if ! $(d:G) in $(specified-features) + { + defaults-to-apply += $(d) ; + } + } + + # 2. If there are any defaults to be applied, form a new build request. + # Pass it through to 'expand-no-defaults' since default-build might + # contain "release debug" resulting in two property-sets. + local result ; + if $(defaults-to-apply) + { + properties = [ + build-request.expand-no-defaults + + # We have to compress subproperties here to prevent property + # lists like: + # + # msvc 7.1 multi + # + # from being expanded into: + # + # 7.1/multi + # msvc/7.1/multi + # + # due to a cross-product property combination. That may be an + # indication that build-request.expand-no-defaults is the wrong + # rule to use here. + [ feature.compress-subproperties $(raw) ] + $(defaults-to-apply) + ] ; + + if $(properties) + { + for local p in $(properties) + { + result += [ property-set.create + [ feature.expand [ feature.split $(p) ] ] ] ; + } + } + else + { + result = [ property-set.empty ] ; + } + } + else + { + result = $(property-set) ; + } + return $(result) ; +} + # Given a build request and requirements, return properties common to dependency # build request and target requirements. @@ -1559,6 +1565,23 @@ rule main-target-alternative ( target ) return $(target) ; } +# Creates a new metargets with the specified properties, using 'klass' as +# the class. The 'name', 'sources', +# 'requirements', 'default-build' and 'usage-requirements' are assumed to be in +# the form specified by the user in Jamfile corresponding to 'project'. +# +rule create-metatarget ( klass : project : name : sources * : requirements * : + default-build * : usage-requirements * ) +{ + return [ + targets.main-target-alternative + [ new $(klass) $(name) : $(project) + : [ targets.main-target-sources $(sources) : $(name) ] + : [ targets.main-target-requirements $(requirements) : $(project) ] + : [ targets.main-target-default-build $(default-build) : $(project) ] + : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ] + ] ] ; +} # Creates a typed-target with the specified properties. The 'name', 'sources', # 'requirements', 'default-build' and 'usage-requirements' are assumed to be in