From bd1786a674823a3c9e44d638ccb726e720383b71 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 19 Jan 2009 11:17:36 +0000 Subject: [PATCH 01/54] Fix for missing setup command: mt.exe isn't found without this. [SVN r50670] --- v2/tools/intel-win.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/intel-win.jam b/v2/tools/intel-win.jam index 9056fd13b..7cc14f314 100644 --- a/v2/tools/intel-win.jam +++ b/v2/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 2920b2292cb8aabdfd21cd9c5b0f5f5c6cc072b9 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 21 Jan 2009 19:37:33 +0000 Subject: [PATCH 02/54] Make cflags/cxxflags/linkflags work with intel-linux [SVN r50708] --- v2/tools/intel-linux.jam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam index b69a6c8a6..66897e412 100644 --- a/v2/tools/intel-linux.jam +++ b/v2/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 ce683c02883a3f5a848ad7d6d25b5e254381c748 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 29 Jan 2009 15:26:02 +0000 Subject: [PATCH 03/54] Attempt to satisfy intel-linux 9.0's apparent need for -lutil [SVN r50869] --- v2/tools/python.jam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/tools/python.jam b/v2/tools/python.jam index 80aad4ff8..498a2ad89 100644 --- a/v2/tools/python.jam +++ b/v2/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 6ba0a22cbd05468d0537780e598d49ce65287a90 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Fri, 30 Jan 2009 14:57:34 +0000 Subject: [PATCH 04/54] Versioning off by default on unix. [SVN r50902] --- CMake/BoostCore.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMake/BoostCore.cmake b/CMake/BoostCore.cmake index 949c9aee1..3c0d62dd9 100644 --- a/CMake/BoostCore.cmake +++ b/CMake/BoostCore.cmake @@ -449,7 +449,11 @@ endmacro(boost_module) # VARIANT_DISPLAY_NAME: The display name that describes this # variant, e.g., "Debug, static, multi-threaded". # -option(BUILD_VERSIONED "Add versioning information to names of built files" ON) +if (UNIX) + option(BUILD_VERSIONED "Add versioning information to names of built files" OFF) +else(UNIX) + option(BUILD_VERSIONED "Add versioning information to names of built files" ON) +endif(UNIX) macro(boost_library_variant_target_name) set(VARIANT_TARGET_NAME "") From 26cf0e9abfaf028bcc947bb83d4083b8a2f5587f Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sat, 31 Jan 2009 18:53:31 +0000 Subject: [PATCH 05/54] if BUILD_VERSIONED is OFF, don't mangle the include directory name in packages. [SVN r50931] --- CMake/BoostCore.cmake | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMake/BoostCore.cmake b/CMake/BoostCore.cmake index 3c0d62dd9..cfcb1f437 100644 --- a/CMake/BoostCore.cmake +++ b/CMake/BoostCore.cmake @@ -449,12 +449,6 @@ endmacro(boost_module) # VARIANT_DISPLAY_NAME: The display name that describes this # variant, e.g., "Debug, static, multi-threaded". # -if (UNIX) - option(BUILD_VERSIONED "Add versioning information to names of built files" OFF) -else(UNIX) - option(BUILD_VERSIONED "Add versioning information to names of built files" ON) -endif(UNIX) - macro(boost_library_variant_target_name) set(VARIANT_TARGET_NAME "") From febd5744b009f615b295888e3321d3c860201b67 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sat, 31 Jan 2009 20:25:15 +0000 Subject: [PATCH 06/54] Placeholder docs for cmake [SVN r50934] --- CMake/BoostDocs.cmake | 57 ++++++++++++++++++++++++++-------------- CMake/CMakeLists.txt | 4 +++ CMake/doc/CMakeLists.txt | 2 ++ CMake/doc/cmake.qbk | 23 ++++++++++++++++ 4 files changed, 67 insertions(+), 19 deletions(-) create mode 100644 CMake/CMakeLists.txt create mode 100644 CMake/doc/CMakeLists.txt create mode 100644 CMake/doc/cmake.qbk diff --git a/CMake/BoostDocs.cmake b/CMake/BoostDocs.cmake index a82e0423e..f74e7dc22 100644 --- a/CMake/BoostDocs.cmake +++ b/CMake/BoostDocs.cmake @@ -322,6 +322,18 @@ macro(boost_add_documentation SOURCE) COMMENT "Generating HTML documentation for Boost.${PROJECT_NAME}..." MAKE_TARGET ${PROJECT_NAME}-html) + # + # Install associated stuff + # + add_custom_command(TARGET ${PROJECT_NAME}-html + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/src/boostbook.css ${CMAKE_CURRENT_BINARY_DIR}/html/boostbook.css + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/src/docutils.css ${CMAKE_CURRENT_BINARY_DIR}/html/docutils.css + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/src/reference.css ${CMAKE_CURRENT_BINARY_DIR}/html/reference.css + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/boost.png ${CMAKE_CURRENT_BINARY_DIR}/html/boost.png + COMMENT "Copying in associated stuff, boostbook.css and boost.png" + ) + # Install generated documentation install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/boost-${BOOST_VERSION} @@ -439,6 +451,9 @@ set(WANT_DOCBOOK_XSL_VERSION 1.73.2) find_program(XSLTPROC xsltproc DOC "xsltproc transforms XML via XSLT") set(XSLTPROC_FLAGS "--xinclude" CACHE STRING "Flags to pass to xsltproc to transform XML documents") +if(NOT XSLTPROC) + message(STATUS "xsltproc not found... this will disable build of documentation.") +endif() # Find the DocBook DTD (version 4.2) find_path(DOCBOOK_DTD_DIR docbookx.dtd @@ -496,25 +511,29 @@ if (XSLTPROC AND DOXYGEN) endif() endif() -# Turn off BUILD_DOCUMENTATION if it isn't going to succeed. -if (BUILD_DOCUMENTATION) +set(BUILD_OCUMENTATION_OKAY TRUE) +if (NOT XSLTPROC) + message(STATUS "XSLTPROC not found, disabling build of documentation") + set(BUILD_DOCUMENTATION_OKAY FALSE) +elseif (NOT DOXYGEN) + message(STATUS "DOXYGEN not found, disabling build of documentation") + set(BUILD_DOCUMENTATION_OKAY FALSE) +elseif (NOT DOCBOOK_DTD_DIR) + message(STATUS "DOCBOOK_DTD_DIR not found, disabling build of documentation") + message(STATUS "Set DOCBOOK_AUTOCONFIG to ON to get it automatically") + set(BUILD_DOCUMENTATION_OKAY FALSE) +elseif (NOT DOCBOOK_XSL_DIR) + message(STATUS "DOCBOOK_XSL_DIR not found, disabling build of documentation") + message(STATUS "Set DOCBOOK_AUTOCONFIG to ON to get it automatically") + set(BUILD_DOCUMENTATION_OKAY FALSE) +else() + message(STATUS "Documentation prerequisites found, enabling docs build.") set(BUILD_DOCUMENTATION_OKAY TRUE) - if (NOT XSLTPROC) - set(BUILD_DOCUMENTATION_OKAY FALSE) - elseif (NOT DOXYGEN) - set(BUILD_DOCUMENTATION_OKAY FALSE) - elseif (NOT DOCBOOK_DTD_DIR) - set(BUILD_DOCUMENTATION_OKAY FALSE) - elseif (NOT DOCBOOK_XSL_DIR) - set(BUILD_DOCUMENTATION_OKAY FALSE) - else() - set(BUILD_DOCUMENTATION_OKAY TRUE) - endif() +endif() - if (NOT BUILD_DOCUMENTATION_OKAY) - if (BUILD_DOCUMENTATION) - set(BUILD_DOCUMENTATION OFF CACHE BOOL - "Whether to build library documentation" FORCE) - endif() +if (NOT BUILD_DOCUMENTATION_OKAY) + if (BUILD_DOCUMENTATION) + set(BUILD_DOCUMENTATION OFF CACHE BOOL + "Whether to build library documentation" FORCE) endif() -endif() \ No newline at end of file +endif() diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt new file mode 100644 index 000000000..63b3de013 --- /dev/null +++ b/CMake/CMakeLists.txt @@ -0,0 +1,4 @@ +boost_library_project(cmake + DOCDIRS doc + ) + diff --git a/CMake/doc/CMakeLists.txt b/CMake/doc/CMakeLists.txt new file mode 100644 index 000000000..3c1ee246f --- /dev/null +++ b/CMake/doc/CMakeLists.txt @@ -0,0 +1,2 @@ +boost_add_documentation(cmake.qbk) + diff --git a/CMake/doc/cmake.qbk b/CMake/doc/cmake.qbk new file mode 100644 index 000000000..2236e6f0d --- /dev/null +++ b/CMake/doc/cmake.qbk @@ -0,0 +1,23 @@ +[article Boost.CMake + [quickbook 1.3] + [authors [Gregor, Douglas], [Straszheim, Troy] ] + [copyright 2007, 2008, 2009 Douglas Gregor, Troy Straszheim] + [purpose + Building boost with cmake + ] + [id boost.cmake] + [dirname cmake] + [license + 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 + ) + ] +] + +[section:intro Introduction] + +This is a placeholder for documentation of the cmake-based build system. + +[endsect] From 4884de06a2485c5463e3762cdca8cdbe1610ac05 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sun, 1 Feb 2009 19:34:52 +0000 Subject: [PATCH 07/54] A couple pages worth of cmake docs brought over from the wiki [SVN r50956] --- CMake/BoostDocs.cmake | 4 +- CMake/doc/cmake.qbk | 295 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 295 insertions(+), 4 deletions(-) diff --git a/CMake/BoostDocs.cmake b/CMake/BoostDocs.cmake index f74e7dc22..2315ef234 100644 --- a/CMake/BoostDocs.cmake +++ b/CMake/BoostDocs.cmake @@ -316,8 +316,8 @@ macro(boost_add_documentation SOURCE) STYLESHEET ${BOOSTBOOK_XSL_DIR}/html.xsl CATALOG ${CMAKE_BINARY_DIR}/catalog.xml DIRECTORY HTML.manifest - PARAMETERS admon.graphics.path=images - navig.graphics.path=images + PARAMETERS admon.graphics.path=images/ + navig.graphics.path=images/ boost.image.src=boost.png COMMENT "Generating HTML documentation for Boost.${PROJECT_NAME}..." MAKE_TARGET ${PROJECT_NAME}-html) diff --git a/CMake/doc/cmake.qbk b/CMake/doc/cmake.qbk index 2236e6f0d..9ce0cdf8e 100644 --- a/CMake/doc/cmake.qbk +++ b/CMake/doc/cmake.qbk @@ -16,8 +16,299 @@ ] ] -[section:intro Introduction] +[section Configuring and Building Boost with CMake] + +This page describes how to configure and build Boost with CMake. By +following these instructions, you should be able to get CMake, +configure a Boost build tree to your liking with CMake, and then +build, install, and package Boost libraries. + +[@http://www.cmake.org/HTML/Download.html Download CMake] + +There are precompiled binaries for CMake on several different +platforms. The installation of these pre-compiled binaries is mostly +self-explanatory. If you need to build your own copy of CMake, please +see the [@http://www.cmake.org/HTML/Install.html CMake installation +instructions]. In these instructions, we will do things such that the +Boost source tree (with CMake build files) is available in the +directory [^$BOOST/src] and that the build will happen in +[^$BOOST/build]: +[pre +$BOOST/ + src/ (source checked out to here) + build/ (build output here) +] +Note that it is *not* necessary to set any environment +variable =BOOST=, this is a convention used in this document. + +[section Check out Boost-CMake] +To get a copy of Boost with the CMake build system, retrieve it from the [wiki:BoostSubversion Boost Subversion repository] with the URL http://svn.boost.org/svn/boost/trunk]. + +On unix: +[pre +% mkdir $BOOST +% svn co http://svn.boost.org/svn/boost/trunk $BOOST/src +] + +[endsect] + + +[section Configure the Boost source tree] + +To discourage the casual developer from trying the CMake build system +before it is fully developed a "kill switch" has been added to the +CMake file that needs to be turned off or the CMake build system will +simply NOT work. + +This is the makefile generation step, using `CMake`'s configuration +tool. This step differs depending on whether you are using CMake's GUI +on Microsoft Windows or whether you are using the command-line tools +provided on Unix. + +[section On Windows] +Run CMake by selecting it from the Start menu. + +* Use the ''Browse...'' button to point CMake at the Boost source + code in [^ $BOOST\src]. +* Use the second ''Browse...'' button to select the directory where + Boost will build binaries, [^ $BOOST\build]. +* CMake will ask you what kind of project files or make files to + build. If you're using Microsoft Visual Studio, select the + appropriate version to generate project files. Otherwise, you can + use Borland's make files, generate NMake files, etc. +* Click ''Configure'' a first time to configure Boost, which will + search for various libraries on your system and prepare the build. +* You will then be given the opportunity to tune build options in + the CMake GUI (see also [wiki:CMakeBuildConfiguration]. These + options will affect what libraries are built and how. They will + initially appear red. Click ''Configure'' again when you are done + editing them. +* Finally, click ''OK'' to generate project files. + +[endsect] +[section On Unix] +Create the directory that will hold the binaries that CMake build, +[pre mkdir $BOOST/build ] +Change into the build directory you have just created: +[pre cd $BOOST/build ] +Run the CMake configuration program, providing it with the Boost source directory: +[pre cmake $BOOST/src ] + +You'll see output from `cmake`. It looks somewhat like this: +[pre +% cmake BOOST/src +-- Check for working C compiler: /usr/bin/gcc +-- Check for working C compiler: /usr/bin/gcc -- works +-- Check size of void* +-- Check size of void* - done +-- Check for working CXX compiler: /usr/bin/c++ +-- Check for working CXX compiler: /usr/bin/c++ -- works +-- Scanning subdirectories: +-- + io +-- + any +-- + crc +-- + mpl + + (etc, etc) + +-- + program_options +-- + ptr_container +-- + type_traits +-- Configuring done +-- Generating done +-- Build files have been written to: BOOST/build +] + +The directory ^BOOST/build^ should now contain a bunch of generated files, including a top level ^Makefile^, something like this: +[pre +% ls +CMakeCache.txt CPackConfig.cmake Makefile +cmake_install.cmake libs/ CMakeFiles/ +CPackSourceConfig.cmake bin/ lib/ +] + + +That's it! You've now configured your source tree and are ready to start building Boost. + +[endsect] +[endsect] + +[section Build Boost] +Like configuration, the way in which one builds Boost with CMake differs from one platform to another, depending on your platform and how you configured CMake. Either way, you'll be using the tools provided to you by your compiler or operating system vendor. +[section Microsoft Visual Studio] +If you have generated project files for Microsoft Visual Studio, you will need to start up Visual Studio to build Boost. Once Visual Studio has loaded, load the solution or project`Boost` from the Boost build directory you set in the CMake configuration earlier. Then, just click "Build" to build all of Boost. +[endsect] +[section On Unix (and when using makefile variants on Microsoft Windows)] + +The first thing to run is the "modularize" target. +[pre +make modularize +] + +This will MOVE most of the headers and subdirectories from the BOOST/src/boost/boost into BOOST/src/boost/libs. This WILL in effect DISABLE the bjam build system until you 'revert' your svn repository. + +The next step is to run the actual build. + +One builds using standard "make" tools. In the directory BOOST/build (where the generated makefiles are) run `make`: +[pre +make +] + +That's it! Once the build completes (which make take a while, if you are building all of the Boost libraries), the Boost libraries will be available in the `lib` subdirectory of your build directory, ready to be used, installed, or packaged. + +[endsect] + +[section Installing Boost] +The installation of Boost's headers and compiled libraries uses the same tools as building the library. With Microsoft Visual Studio, just load the Boost solution or project and build the 'INSTALL' target to perform the installation. Unix and makefile users will change into the Boost build directory and use the `install` make target, e.g., +[pre +make install +] + +[endsect] + + +[endsect] +[endsect] + +[section Configuring the build] +[section Setting the compiler] + +See '''''Advanced Options''''' below. + +[endsect] +[section Configuration tools] + +Included in the standard cmake distribution are the Windows [^ CMake] +gui and the unix [^ ccmake] curses interface, which allow one to +configure various aspects of the cmake build. + +On Microsoft Windows run the CMake configuration program from the Start menu. On unix, run +[pre +ccmake +] +where `ccmake` will be in CMake's binary directory. If you have not yet run `cmake` in this directory, +you will see an empty list of options: +[pre + Page 0 of 1 + EMPTY CACHE + +EMPTY CACHE: +Press \[enter\] to edit option CMake Version 2.6 - patch 0 +Press [c\] to configure +Press [h\] for help Press [q\] to quit without generating +Press [t\] to toggle advanced mode (Currently Off) +] + +After pressing *c* to configure, (or if you've run [^ cmake] already), +You will be presented with a list of editable build options something like this: + +[pre + BUILD_BOOST_DATE_TIME ON + BUILD_BOOST_FILESYSTEM ON + BUILD_BOOST_GRAPH ON + BUILD_BOOST_IOSTREAMS ON + BUILD_BOOST_PROGRAM_OPTIONS ON + BUILD_BOOST_PYTHON ON + BUILD_BOOST_REGEX ON + BUILD_BOOST_SERIALIZATION ON + BUILD_BOOST_SIGNALS ON + BUILD_BOOST_TEST ON + BUILD_BOOST_THREAD ON + BUILD_BOOST_WAVE ON + BUILD_BOOST_WSERIALIZATION ON + BUILD_DEBUG ON + BUILD_MULTI_THREADED ON + BUILD_RELEASE ON + BUILD_SHARED ON + BUILD_SINGLE_THREADED ON + BUILD_STATIC ON + BUILD_TESTING OFF + BUILD_VERSIONED ON + CMAKE_BACKWARDS_COMPATIBILITY 2.4 + CMAKE_BUILD_TYPE + CMAKE_INSTALL_PREFIX /usr/local + DEBUG_COMPILE_FLAGS -g + EXECUTABLE_OUTPUT_PATH + LIBRARY_OUTPUT_PATH + PYTHON_EXECUTABLE /usr/bin/python2.4 + PYTHON_INCLUDE_PATH /usr/include/python2.4 + PYTHON_LIBRARY /usr/lib/python2.4/config/libpython2.4.so + RELEASE_COMPILE_FLAGS -O3 -DNDEBUG + + +BUILD_VERSIONED: Use versioned library names, e.g., boost_filesystem-gcc41-1_34 +Press [enter\] to edit option CMake Version 2.4 - patch 5 +Press [c\] to configure Press [g\] to generate and exit +Press [h\] for help Press [q\] to quit without generating +Press [t\] to toggle advanced mode (Currently Off) +] + +Use the arrow keys to select particular options. Press '''''c''''' +(for (c)onfigure) to perform the preliminary configuration of the +CMake build system when you are done. When the options you have +selected have stabilized, CMake will give you the (g)enerate +option. If you do not see this option, press '''''c''''' again to +reconfigure. Try the '''''t''''' key to see more options. When +you're done press '''''g''''' to generate makefiles and exit. + +[endsect] +[section CMakeCache.txt] + +The same information is stored in a file [^ CMakeCache.txt] located in the build directory. For this reason, after you've done the initial configuration of a build directory you can invoke [^ ccmake] like this: +[pre +ccmake +] +or have the makefiles do it for you: +[pre +make edit_cache +] + + +The CMakeCache.txt file is hand-editable, though this is usually not as convenient as the cmake-supplied configuration tools mentioned above. An excerpt of this file: +[pre +//// +//// Enable/Disable color output during build. +//// +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//// +//// Use versioned library names, e.g., boost_filesystem-gcc41-1_34 +//// +BUILD_VERSIONED:BOOL=ON +] + +On unix, (?windows too?) the generated makefiles will detect if this file has been edited and will automatically rerun the makefile generation phase. If you should need to trigger this regeneration manually you may execute +[pre +make rebuild_cache +] + +[section Useful options] + +More detail on some of these options is available elsewhere. But here is a summary: + +[table Options + [[Name][Description]] + [[=BUILD_VERSIONED=] [Toggles mangling of compiler name and boost version into library names]] + [[=BUILD_TESTING= ] [Toggles build of testing]] + [[[^ BUILD\_BOOST\_]/library/][Toggles building and testing of [~ library] (e.g. this will appear as [^ BUILD_BOOST_REGEX], [^ BUILD_BOOST_PROGRAM_OPTIONS], etc.)]] + [[=BUILD_=/feature/] [Toggles build of feature /feature/, where /feature/ comes from the list found at *FIXME*, + e.g. [^BUILD_RELEASE], [^BUILD_DEBUG], [^BUILD_MULTI_THREADED], etc.]] + + [[=TEST_BOOST_=/library/][Toggles testing of /library/ (this option appears only if [^ BUILD_BOOST_]/library/ and [^ BUILD_TESTING] are enabled. See *FIXME*)]] + [[[^ CMAKE_OSX_ARCHITECTURES]][ /Mac OS X users/: to build universal binaries, set this to [^ ppc;i386].]] +] + +[^ ccmake] provides the keystroke option [^ t] which toggles advanced mode. Some of the useful options here are: + +[table Advanced options + +[[Option][Description]] +[[=CMAKE_VERBOSE_MAKEFILE=] [Displays full build commands during build. Good for debugging. Advanced option: use [^ t] to toggle display of this option and others. On unix, you can also build verbose by passing the command line option VERBOSE=1 to your [^ make] invocation.]] +[[=CMAKE_CXX_COMPILER=] [Sets the compiler.]] +] + +[endsect] +[endsect] -This is a placeholder for documentation of the cmake-based build system. [endsect] From 853fbfe45b954234aa69b8beedeeb156b3c45c3e Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sun, 1 Feb 2009 21:29:46 +0000 Subject: [PATCH 08/54] Further quickbookization of the wiki [SVN r50959] --- CMake/doc/cmake.qbk | 383 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 379 insertions(+), 4 deletions(-) diff --git a/CMake/doc/cmake.qbk b/CMake/doc/cmake.qbk index 9ce0cdf8e..49230981d 100644 --- a/CMake/doc/cmake.qbk +++ b/CMake/doc/cmake.qbk @@ -42,7 +42,7 @@ Note that it is *not* necessary to set any environment variable =BOOST=, this is a convention used in this document. [section Check out Boost-CMake] -To get a copy of Boost with the CMake build system, retrieve it from the [wiki:BoostSubversion Boost Subversion repository] with the URL http://svn.boost.org/svn/boost/trunk]. +To get a copy of Boost with the CMake build system, retrieve it from the [@http://needlink Boost Subversion repository] with the URL http://svn.boost.org/svn/boost/trunk]. On unix: [pre @@ -79,7 +79,7 @@ Run CMake by selecting it from the Start menu. * Click ''Configure'' a first time to configure Boost, which will search for various libraries on your system and prepare the build. * You will then be given the opportunity to tune build options in - the CMake GUI (see also [wiki:CMakeBuildConfiguration]. These + the CMake GUI (see also [@http://needlink CMakeBuildConfiguration]. These options will affect what libraries are built and how. They will initially appear red. Click ''Configure'' again when you are done editing them. @@ -291,10 +291,10 @@ More detail on some of these options is available elsewhere. But here is a summ [[=BUILD_VERSIONED=] [Toggles mangling of compiler name and boost version into library names]] [[=BUILD_TESTING= ] [Toggles build of testing]] [[[^ BUILD\_BOOST\_]/library/][Toggles building and testing of [~ library] (e.g. this will appear as [^ BUILD_BOOST_REGEX], [^ BUILD_BOOST_PROGRAM_OPTIONS], etc.)]] - [[=BUILD_=/feature/] [Toggles build of feature /feature/, where /feature/ comes from the list found at *FIXME*, + [[=BUILD_=/feature/] [Toggles build of feature /feature/, where /feature/ comes from the list found at *needlink*, e.g. [^BUILD_RELEASE], [^BUILD_DEBUG], [^BUILD_MULTI_THREADED], etc.]] - [[=TEST_BOOST_=/library/][Toggles testing of /library/ (this option appears only if [^ BUILD_BOOST_]/library/ and [^ BUILD_TESTING] are enabled. See *FIXME*)]] + [[=TEST_BOOST_=/library/][Toggles testing of /library/ (this option appears only if [^ BUILD_BOOST_]/library/ and [^ BUILD_TESTING] are enabled. See *needlink*)]] [[[^ CMAKE_OSX_ARCHITECTURES]][ /Mac OS X users/: to build universal binaries, set this to [^ ppc;i386].]] ] @@ -309,6 +309,381 @@ More detail on some of these options is available elsewhere. But here is a summ [endsect] [endsect] +[endsect] +[section Building individual libraries with cmake] +In a configured cmake workspace, `make help` will display a list of available targets. Example: +[pre +% make help +The following are some of the valid targets for this Makefile: +... all (the default if no target is provided) +... clean +... depend +... edit_cache +... install +... install/local +... install/strip +... list_install_components +... package +... package_source +... rebuild_cache +... boost_date_time +... boost_date_time-mt-shared +... boost_date_time-mt-shared-debug +... boost_date_time-mt-static +... boost_date_time-mt-static-debug +... boost_date_time-shared +... boost_date_time-shared-debug +... boost_date_time-static +... boost_date_time-static-debug +... boost_filesystem +... boost_filesystem-mt-shared +... boost_filesystem-mt-shared-debug +... boost_filesystem-mt-static +... boost_filesystem-mt-static-debug +... boost_filesystem-shared +... boost_filesystem-shared-debug +... boost_filesystem-static +... boost_filesystem-static-debug +[etc\] +] + +You can build any target by passing it as an argument: + +[pre +% make boost_signals-static +[ 0%\] Building CXX object libs/signals/src/CMakeFiles/boost_signals-static.dir/trackable.cpp.o +[ 0%\] Building CXX object libs/signals/src/CMakeFiles/boost_signals-static.dir/connection.cpp.o +[100%\] Building CXX object libs/signals/src/CMakeFiles/boost_signals-static.dir/named_slot_map.cpp.o +[100%\] Building CXX object libs/signals/src/CMakeFiles/boost_signals-static.dir/signal_base.cpp.o +[100%\] Building CXX object libs/signals/src/CMakeFiles/boost_signals-static.dir/slot.cpp.o +Linking CXX static library ../../../lib/libboost_signals-gcc41-1_35.a +[100%\] Built target boost_signals-static +] + +[section Preprocessing] + +In build directories corresponding to a source library containing a =CMakeLists.txt= containing a +=boost_add_library= invocation (e.g. =build/libs/signals/src=, =build/libs/filesystem/src=), +more detailed targets are available: +[pre +% cd libs/signals/src +% make help +The following are some of the valid targets for this Makefile: + ['(many omitted)] +... signal_base.o +... signal_base.i +... signal_base.s +... slot.o +... slot.i +... slot.s +] + +making [^ slot.i] will run [^ slot.cpp] through the preprocessor: +[pre +% make slot.i +Preprocessing CXX source to CMakeFiles/boost_signals-mt-shared.dir/slot.cpp.i +] +If you are always interested in seeing the compiler flags you can enable [^ CMAKE_VERBOSE_MAKEFILES] via [^ ccmake] +, or for a one-off just pass [^ VERBOSE=1] on the command line: +[pre +% make VERBOSE=1 slot.i +make[1\]: Entering directory `/home/troy/Projects/boost/branches/CMake/Boost_1_35_0-build' +Preprocessing CXX source to CMakeFiles/boost_signals-mt-shared.dir/slot.cpp.i +cd /home/troy/Projects/boost/branches/CMake/Boost_1_35_0-build/libs/signals/src && /usr/bin/gcc-4.1 +-DBOOST_ALL_NO_LIB=1 -DBOOST_SIGNALS_NO_LIB=1 -Dboost_signals_mt_shared_EXPORTS -fPIC +-I/home/troy/Projects/boost/branches/CMake/Boost_1_35_0 -O3 -DNDEBUG -DBOOST_SIGNALS_DYN_LINK=1 +-pthread -D_REENTRANT -E /home/troy/Projects/boost/branches/CMake/Boost_1_35_0/libs/signals/src/slot.cpp > CMakeFiles/boost_signals-mt-shared.dir/slot.cpp.i +] + +[endsect] + +[endsect] + +[section Adding a Boost Library with CMake] + +This page describes how to introduce a new Boost library into the +CMake-based build system. Any Boost library that provides a library +binary (e.g., [^ boost_signals.dll]) or has regression tests (hopefully, +every Boost library!) will need to be part of the build system. + +To introduce a new library, which resides in the subdirectory [^ libs/libname], follow these steps: + +Create a new file [^ libs/libname/CMakeLists.txt] with your favorite +text editor. This file will contain an invocation of the +[^ boost_library_project] macro, which +identifies each Boost library to the build system. The invocation of +the [^ boost_library_project] will look like this: + +[pre + boost_library_project( + Libname + SRCDIRS src + TESTDIRS test + ) +] + +where [^ Libname] is the properly-capitalization library name, e.g., +[^ Signals] or [^ Smart_ptr]. The [^ SRCDIRS src] line should only +be present if your Boost library actually needs to compile a library +binary; header-only libraries can skip this step. The [^ TESTDIRS +test] line indicates that the subdirectory [^ test] contains +regression tests for your library. Every Boost library should have +these. + +Re-run CMake to reconfigure the source tree, causing CMake to find +the new Boost library. CMake can be re-run either from the command +line (by invoking [^ cmake /path/to/boost] or [^ ccmake /path/to/boost]) +or, on Windows, using the CMake GUI. Once you have reconfigured and +generated new makefiles or project files, CMake knows about your +library. + +If your library has compiled sources (i.e., it is not a header-only +library), follow the instructions on adding a compiled library to +get CMake building and installing your library. + +If your library has regression tests (it ['does] have regression +tests, right?), follow the instructions on adding regression tests +to get CMake to build and run regression tests for your library. + +[endsect] + +[section Adding a Compiled Library to CMake] + +This page describes how to add a new, compiled library to the +CMake-based build system. If your library is a "header-only" library, +and does not require separate compilation of object files into a +library binary, you can safely skip this step. Before adding compiled +libraries to CMake, make sure you have already followed the directions +for *needlink* adding a library to CMake, so that the +CMake system recognizes your Boost library. + +In this page, we will assume that your library resides in the +subdirectory `libs/libname`, and that we want to create the compiled +library `boost_libname`. We will also assume that the sources for this +library reside in the subdirectory `libs/libname/src`. The source +directory should be listed via `SRCDIRS` in the use of the +[@http://needlink boost_library_project macro], as described +in the previous section, [@http://needlink "Adding a Library +to CMake"]. Follow these steps to add this new library into Boost's +build system. If your library has multiple source directories listed +after `SRCDIRS`, follow these steps for each one. + +Create a new file `libs/libname/src/CMakeLists.txt` with your +favorite text editor. This file will contain build rules for your +compiled library. In this file, we will create one or more invocations +of the [@http://needlink boost_add_library macro], which adds a +compiled Boost library to the CMake system. The `boost_add_library` +macro provides the name of the library, the source files from which +the library will be built, and any specific compiler and linker +options needed to help build the library. Let's start by adding a +simple library with a few source files: + +[pre + boost_add_library(boost_libname + mysrc1.cpp mysrc2.cpp + ) +] + +This invocation will build several variants of the =boost_libname= +library from the source files [^ mysrc1.cpp] and [^ mysrc2.cpp]. For +example, it will build both static and shared library, single- and +multi-threaded, debug and release, etc. This invocation also handles +the installation of these libraries. + +For simple libraries, that's it! Rebuilding via CMake (e.g., running +`make` or reloading and rebuilding the Boost project in your IDE) will +build the new library, including several different variants for +different compilation options. Your Boost library will also be +included when the user installs Boost or builds a binary package of +Boost. Within the CMake configuration, you will also see an option +`BUILD_LIBNAME`, which allows the user to decide whether or not to +build this Boost library. + +Many libraries will need specific compilation options when building, +need to link against other libraries (Boost or otherwise), or rely on +certain features of the compilation process to proceed. Follow the +instructions in the remaining part of this page to address these +library-specific needs. + +[section Compilation Flags] + +Many libraries require certain compilation flags when we are building +the library binaries themselves (rather than when the library headers +are included by the user). For example, we want to define the macro +"BUILDING_BOOST_LIBNAME" when building the library. We can do so by +passing the `COMPILE_FLAGS` option to `boost_add_library`: +[pre +boost_add_library(boost_libname + mysrc1.cpp mysrc2.cpp + COMPILE_FLAGS "-DBUILDING_BOOST_LIBNAME=1" +] +Now when CMake builds the library, it will pass the flag `-DBUILDING_BOOST_LIBNAME=1` to the compiler. + +On Windows, shared libraries are built very differently from static +libraries. In particular, when building a shared library, one needs to +be sure to export the right symbols from the DLL using +`dllexport`. When users use the shared library, these symbols will be +imported (via `dllimport`). The typical way to handle this is to +define a macro (say, `BOOST_LIBNAME_DYN_LINK`) when building the +shared library. This macro instructs the library headers to +`dllexport` everything that needs to be exported. We can do this with +variant-specific compile flags, e.g., + +[pre +boost_add_library(boost_libname + mysrc1.cpp mysrc2.cpp + COMPILE_FLAGS "-DBUILDING_BOOST_LIBNAME=1" + SHARED_COMPILE_FLAGS "-DBOOST_LIBNAME_DYN_LINK=1" +] + + +When building a shared library, the `SHARED_COMPILE_FLAGS` options +will be combined with the `COMPILE_FLAGS` options. When building a +static library, the `SHARED_COMPILE_FLAGS` options will be +ignored. There are other options that can be specified per-feature, +such as `LINK_FLAGS` and `LINK_LIBS`; refer to the +[@http://needlink boost_add_library macro reference] for more +information. +[endsect] + +[section Linking to Other Boost Libraries] + +Some Boost libraries depends on other Boost libraries. For example, +perhaps our library uses the Boost.Filesystem library under the +hood. We can use the `DEPENDS` feature of the [@http://needlink +boost_add_library macro] to state which libraries our library depends +on. In this example, we'll link against `boost_filesystem`: + +[pre +boost_add_library(boost_libname + mysrc1.cpp mysrc2.cpp + COMPILE_FLAGS "-DBUILDING_BOOST_LIBNAME=1" + SHARED_COMPILE_FLAGS "-DBOOST_LIBNAME_DYN_LINK=1" + DEPENDS boost_filesystem +] + +Now, each variant of the `boost_libname` library will link against the +appropriate `boost_filesystem` library variant. Whenever +`boost_filesystem` changes, our library will be relinked +appropriately. + +[endsect] + +[section Linking External Libraries/Optional Sources] + +Sometimes, Boost libraries need to link against other libraries +supplied by the system. The primary challenge in linking against these +libraries is /finding/ those libraries, and their associated +headers, on the system. If the library is found, we usually want to +pass some extra compilation flags to our library and add in additional +sources. Otherwise, we just skip these extra sources. + +CMake already contains modules that search for many common system +libraries and tools; search the +[@http://www.cmake.org/HTML/Documentation.html CMake Documentation] for +existing modules that do what you need. For example, say we want to +link against the system's `PNG` (portable network graphics) library. +We can use the supplied `FindPNG` module by adding the following early +in our `CMakeLists.txt` file: + +[pre +include(FindPNG) +] + +Documentation for CMake modules is typically found in the module file +itself. Look into the `Modules` subdirectory of your CMake +installation, either in `Program Files\CMake` (on Windows) or +`/usr/share/cmake-version` (on Unix variants) to find the module of +the same name. The module will typically set a variable that indicates +whether the library was found. For the `FindPNG` module, this variable +is called `PNG_FOUND`. We can use this variable to optionally add +sources to a variable `EXTRA_SOURCES`: + +[pre +include(FindPNG) +set(EXTRA_SOURCES) +if (PNG_FOUND) + list(APPEND EXTRA_SOURCES png.cpp) +endif (PNG_FOUND) +] + +CMake modules also typically define macros specifying the include +directories needed for the library, any compile-time definitions +required to use the library, and linking information for the library +binary. For the `FindPNG` module, these variables are called +`PNG_INCLUDE_DIR`, `PNG_DEFINITIONS` and `PNG_LIBRARY`, respectively. + +The include directory should be added via the CMake `include_directories` macro, e.g., + +[pre +include_directories(${PNG_INCLUDE_DIR}) +] + +The `PNG_DEFINITIONS` value should be added to the `COMPILE_FLAGS` and +the `PNG_LIBRARIES` value to the `LINK_LIBS` option to the +[@http://needlink boost_add_library macro]. Using these features +together, we can search for the `PNG` library on the system and +optionally include PNG support into our library: + +[pre +include(FindPNG) +set(EXTRA_SOURCES) +if (PNG_FOUND) + include_directories(${PNG_PNG_INCLUDE_DIR}) + list(APPEND EXTRA_SOURCES png.cpp) +endif (PNG_FOUND) + +boost_add_library(boost_libname + mysrc1.cpp mysrc2.cpp + ${EXTRA_SOURCES} + COMPILE_FLAGS "-DBUILDING_BOOST_LIBNAME=1 ${PNG_DEFINITIONS}" + LINK_LIBS "${PNG_LIBRARIES}" + SHARED_COMPILE_FLAGS "-DBOOST_LIBNAME_DYN_LINK=1" + DEPENDS boost_filesystem +] + +If CMake does not provide a module to search for the library you need, +don't worry! You can write your own module relatively easily, +following the examples from the CMake `Modules` directory or some of +the Boost-specific examples, such as +[http://svn.boost.org/svn/boost/branches/CMake/Boost_1_35_0/tools/build/CMake/FindICU.cmake +tools/build/CMake/FindICU.cmake]. For a real-life example of finding +system libraries and using that information to add optional, extra +capabilities to a Boost library, check out the build rules for the +Boost.IOStreams library at +[http://svn.boost.org/svn/boost/branches/CMake/Boost_1_35_0/libs/iostreams/src/CMakeLists.txt +libs/iostreams/src/CMakeLists.txt]. + +[endsect] +[section Build Variants] + +The Boost build system defines many different [@http://needlink +build features], which describe specific properties of certain +builds. For example, the `SHARED` feature indicates that we are +building a shared library, while the `MULTI_THREADED` feature +indicates that we are building a multi-threaded library. A specific +set of features is called a *variant*, e.g., `RELEASE` and +`MULTI_THREADED` and `SHARED`. By default, the CMake-based build +system builds several different variants of each Boost library. + +Since some features conflict with certain libraries (a threading +library cannot be `SINGLE_THREADED`!), one can pass additional flags +to [@http://needlink boost_add_library] stating which features +should the library cannot be built with. For example, say that our +library cannot be built as a multi-threaded library, because it uses +thread-unsafe routines from the underlying C library. To disable +multi-threaded variants of the library, pass the option +`NOT_MULTI_THREADED`: + +[pre +boost_add_library(boost_libname + mysrc1.cpp mysrc2.cpp + COMPILE_FLAGS "-DBUILDING_BOOST_LIBNAME=1" + SHARED_COMPILE_FLAGS "-DBOOST_LIBNAME_DYN_LINK=1" + DEPENDS boost_filesystem + NOT_MULTI_THREADED +] +[endsect] [endsect] From 3db5ab3624461168c7e68099e45778107a87156b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 4 Feb 2009 07:47:11 +0000 Subject: [PATCH 09/54] Avoid duplicate target error when using off. Patch from Alexey Pakhunov. [SVN r51007] --- v2/build/virtual-target.jam | 9 +++++++++ v2/tools/msvc.jam | 22 ++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index ac6f58247..9c2874e8b 100644 --- a/v2/build/virtual-target.jam +++ b/v2/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/v2/tools/msvc.jam b/v2/tools/msvc.jam index c181e085f..1402f8592 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 2c61680c80f3859bb01a0e773592f6c494f980d5 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 10/54] Apply patch from Alexey Pakhunov for improved msvc assembler support. Fixes https://zigzag.lvk.cs.msu.su:7813/boost.build/ticket/214 [SVN r51013] --- v2/tools/msvc.jam | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index 1402f8592..372757e8e 100644 --- a/v2/tools/msvc.jam +++ b/v2/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 14a819b8c94595a0aebb118e557680611054ff18 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 8 Feb 2009 16:59:14 +0000 Subject: [PATCH 11/54] Add Jamfile to build PDF versions of all the docs. Tweaked some existing Jamfiles so that PDF build finds all the necessary image files etc. Tweaked fo.xsl to provide more options by default, and improve formatting. [SVN r51104] --- historic/jam/doc/build.jam | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/historic/jam/doc/build.jam b/historic/jam/doc/build.jam index 95f9458e8..5f23814e2 100644 --- a/historic/jam/doc/build.jam +++ b/historic/jam/doc/build.jam @@ -25,14 +25,14 @@ boostbook standalone : bjam : - html + #html html html html/images boost.root=. nav.layout=none - admon.graphics.path=images/ - navig.graphics.path=images/ + html:admon.graphics.path=images/ + html:navig.graphics.path=images/ ; # Copyright Rene Rivera 2005-2006. Use, modification, and distribution are From d17e108120d15c483683c7bf85a4f2791f8f00f3 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 12 Feb 2009 19:10:40 +0000 Subject: [PATCH 12/54] Fix generator_selection on windows [SVN r51227] --- v2/test/generator_selection.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/v2/test/generator_selection.py b/v2/test/generator_selection.py index d141dc334..9616bd5bc 100755 --- a/v2/test/generator_selection.py +++ b/v2/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 4380274a3050b7236a81e411d8cc819c3f783763 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 13/54] 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] --- v2/tools/qt.jam | 4 +- v2/tools/qt4.jam | 524 ++++++++++++++++++++++++++++++----------------- 2 files changed, 342 insertions(+), 186 deletions(-) diff --git a/v2/tools/qt.jam b/v2/tools/qt.jam index ab29f9357..8aa7ca266 100644 --- a/v2/tools/qt.jam +++ b/v2/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/v2/tools/qt4.jam b/v2/tools/qt4.jam index 78df4f5fb..b38549e1e 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 2802fc0b69633a79653289a31ecd6aeef3b4a422 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 13 Feb 2009 16:55:07 +0000 Subject: [PATCH 14/54] Use $(type) instead of type. Fixes #2648 [SVN r51240] --- v2/build/type.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/build/type.jam b/v2/build/type.jam index fdd9acc8f..1a7a57823 100644 --- a/v2/build/type.jam +++ b/v2/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 4355d9ab445b9cc51aea03dfddd656124a1ecda9 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 13 Feb 2009 20:51:25 +0000 Subject: [PATCH 15/54] Use .dll extension for shared libraries on cygwin. Fixes #2734 [SVN r51241] --- v2/tools/types/lib.jam | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/tools/types/lib.jam b/v2/tools/types/lib.jam index 45446cbe1..c343b788a 100644 --- a/v2/tools/types/lib.jam +++ b/v2/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 ae78e921f5bd9758d8debcec36f059517524d3b8 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sun, 15 Feb 2009 19:02:10 +0000 Subject: [PATCH 16/54] Don't unintentially collect all new targets in a global variable. [SVN r51260] --- v2/tools/boostbook.jam | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/tools/boostbook.jam b/v2/tools/boostbook.jam index 8bec8602c..6a2468579 100644 --- a/v2/tools/boostbook.jam +++ b/v2/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 80fd93c3173b61a4a791a32832dd37b927fbb6b5 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 16 Feb 2009 10:40:26 +0000 Subject: [PATCH 17/54] Add preliminary HTMLHelp support. [SVN r51269] --- v2/tools/boostbook.jam | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/tools/boostbook.jam b/v2/tools/boostbook.jam index 6a2468579..bdb14b78e 100644 --- a/v2/tools/boostbook.jam +++ b/v2/tools/boostbook.jam @@ -334,6 +334,7 @@ class boostbook-generator : generator case htmlhelp : { type = HTMLHELP ; + manifest = HTML.manifest ; } case onehtml : type = HTML ; From 48f0248cc14e07d3b04084f43e5a382b8fc5b861 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 18/54] Fix: Correct handling of include paths with spaces. [SVN r51275] --- 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 b38549e1e..f8a9dbe75 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 daaa7260f19252003eb61b82a31a3d4a05f04602 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 19/54] Add support for QtScriptTools (Qt-4.5) [SVN r51300] --- v2/test/qt4/jamroot.jam | 1 + v2/test/qt4/qtscript.cpp | 3 +-- v2/test/qt4/qtscripttools.cpp | 47 +++++++++++++++++++++++++++++++++++ v2/tools/qt4.jam | 5 +++- 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 v2/test/qt4/qtscripttools.cpp diff --git a/v2/test/qt4/jamroot.jam b/v2/test/qt4/jamroot.jam index 6770012b0..0746b91d1 100644 --- a/v2/test/qt4/jamroot.jam +++ b/v2/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/v2/test/qt4/qtscript.cpp b/v2/test/qt4/qtscript.cpp index 275eb4ff2..20528365b 100644 --- a/v2/test/qt4/qtscript.cpp +++ b/v2/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/v2/test/qt4/qtscripttools.cpp b/v2/test/qt4/qtscripttools.cpp new file mode 100644 index 000000000..4d0b7f256 --- /dev/null +++ b/v2/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(); +} diff --git a/v2/tools/qt4.jam b/v2/tools/qt4.jam index f8a9dbe75..4857d8e4c 100644 --- a/v2/tools/qt4.jam +++ b/v2/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) ; From 1b15304dd82eb6f232af9173019a0fe777f0a017 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 18 Feb 2009 12:49:13 +0000 Subject: [PATCH 20/54] 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] --- 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 539fd3003..8f10d6a44 100644 --- a/v2/tools/sun.jam +++ b/v2/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 79234159d1b166cf6a86e7ca604218fef1141650 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 21/54] Refactoring: Rename uic-h to uic to get uniform toolnames. [SVN r51313] --- v2/tools/qt4.jam | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/v2/tools/qt4.jam b/v2/tools/qt4.jam index 4857d8e4c..fc27bcc36 100644 --- a/v2/tools/qt4.jam +++ b/v2/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 2dd7e1e4ae439dd83bf7a45414f02a959a95e7af Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 19 Feb 2009 09:17:20 +0000 Subject: [PATCH 22/54] 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] --- v2/tools/darwin.jam | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/v2/tools/darwin.jam b/v2/tools/darwin.jam index e7652cb5c..925db1b91 100644 --- a/v2/tools/darwin.jam +++ b/v2/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 614176609930b17ce993d23063bde8829c0fa926 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 23/54] Removed trailing spaces. [SVN r51390] --- v2/test/test_all.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/v2/test/test_all.py b/v2/test/test_all.py index c2c43da53..1960ef225 100644 --- a/v2/test/test_all.py +++ b/v2/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 6d33d8fee889056305f9821d2c960339af29d531 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 24/54] Converted tabs to spaces in the Boost Build test/test_all.py to make all whitespace style used in this file consistent. [SVN r51391] --- v2/test/test_all.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 1960ef225..f69cb5f36 100644 --- a/v2/test/test_all.py +++ b/v2/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 73f7977497716d5485474d592166239fe09579a3 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 25/54] Cleaned up the Boost Build example/generate/jamroot.jam example source file. No functional changes. [SVN r51394] --- v2/example/generate/jamroot.jam | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/v2/example/generate/jamroot.jam b/v2/example/generate/jamroot.jam index bc8563a4a..a244f65fc 100644 --- a/v2/example/generate/jamroot.jam +++ b/v2/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 dfa3eb2afb2a3bf6f8b36951446fb1fccc778396 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 26/54] Added a comment specifying several alternative implementations for the common.file-creation-command rule on Windows. [SVN r51395] --- v2/tools/common.jam | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/v2/tools/common.jam b/v2/tools/common.jam index d37c14d7a..20f52d52e 100644 --- a/v2/tools/common.jam +++ b/v2/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 0a29b8a0faf2b80b7c899cbc93526341b673d6cc 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 27/54] Makes the Boost Build testing system correctly report the number of passed test cases instead of reporting all test cases as passed. [SVN r51396] --- v2/test/test_all.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/test/test_all.py b/v2/test/test_all.py index f69cb5f36..26e1019a7 100644 --- a/v2/test/test_all.py +++ b/v2/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 b6ccdc495a709f077cea766dfd9169f81f847e04 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 28 Feb 2009 11:57:44 +0000 Subject: [PATCH 28/54] Don't inherit PCH generators, since they probably don't work. [SVN r51481] --- v2/tools/intel-darwin.jam | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/tools/intel-darwin.jam b/v2/tools/intel-darwin.jam index 9a5ef9982..aa0fd8fb6 100644 --- a/v2/tools/intel-darwin.jam +++ b/v2/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 6a1e955e126035b24d6fa944f6564bda2fff3b97 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 1 Mar 2009 14:16:00 +0000 Subject: [PATCH 29/54] Update links to command line invocation. [SVN r51506] --- v2/doc/src/advanced.xml | 2 +- v2/doc/src/howto.xml | 2 +- v2/doc/src/v1_vs_v2.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/doc/src/advanced.xml b/v2/doc/src/advanced.xml index 9a4662f77..2a30bc8ff 100644 --- a/v2/doc/src/advanced.xml +++ b/v2/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/v2/doc/src/howto.xml b/v2/doc/src/howto.xml index bd0cf5b5e..4a8b892b3 100644 --- a/v2/doc/src/howto.xml +++ b/v2/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/v2/doc/src/v1_vs_v2.xml b/v2/doc/src/v1_vs_v2.xml index 8b77b8f01..482b61cf8 100644 --- a/v2/doc/src/v1_vs_v2.xml +++ b/v2/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 c08d879027da93ced76d890005a5a959b5c1b66f Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 1 Mar 2009 14:16:24 +0000 Subject: [PATCH 30/54] Use xpointer attributes in the boost build documentation. [SVN r51507] --- v2/doc/src/reference.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/v2/doc/src/reference.xml b/v2/doc/src/reference.xml index 80c3484fc..9f8302a22 100644 --- a/v2/doc/src/reference.xml +++ b/v2/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 e1778efe7d949e9826579bc989d7fae3c0e9e9ed Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 3 Mar 2009 13:47:44 +0000 Subject: [PATCH 31/54] Fix pch support. [SVN r51570] --- v2/tools/intel-linux.jam | 46 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam index 66897e412..eff4b6bfe 100644 --- a/v2/tools/intel-linux.jam +++ b/v2/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 93e9235ba9a2e7b76fa17fe28c19c5ebb0842895 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 11 Mar 2009 12:43:24 +0000 Subject: [PATCH 32/54] Use -bnoipath on vacpp/AIX. Patch from Etienne PIERRE. Fixes #2843. [SVN r51697] --- v2/tools/vacpp.jam | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/v2/tools/vacpp.jam b/v2/tools/vacpp.jam index 5addf28e3..a5ac5db8e 100644 --- a/v2/tools/vacpp.jam +++ b/v2/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 f038c75b34880d9757b3370aa1c2680bff5ae1c2 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 13 Mar 2009 19:08:55 +0000 Subject: [PATCH 33/54] Ubreak prebuilt libraries on vacpp. [SVN r51760] --- v2/tools/vacpp.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/vacpp.jam b/v2/tools/vacpp.jam index a5ac5db8e..a2997a6fb 100644 --- a/v2/tools/vacpp.jam +++ b/v2/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 8f3f1efcec5f95500a311ea8c4ec820ec463c090 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Fri, 13 Mar 2009 19:12:02 +0000 Subject: [PATCH 34/54] Don't use -qtwolink. It is reported in http://permalink.gmane.org/gmane.comp.lib.boost.build/20456 as breaking things. [SVN r51761] --- v2/tools/vacpp.jam | 5 ----- 1 file changed, 5 deletions(-) diff --git a/v2/tools/vacpp.jam b/v2/tools/vacpp.jam index a2997a6fb..57a27dcf8 100644 --- a/v2/tools/vacpp.jam +++ b/v2/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 00805f73981a3b9d2036ce240dc5930580fc6722 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 16 Mar 2009 10:57:06 +0000 Subject: [PATCH 35/54] Remove another use of -qtwolink. [SVN r51792] --- v2/tools/vacpp.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/vacpp.jam b/v2/tools/vacpp.jam index 57a27dcf8..a3ab61c6c 100644 --- a/v2/tools/vacpp.jam +++ b/v2/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 5fda052785f8b80944666b818e8b9381d8ebff6e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 21 Mar 2009 22:45:05 +0000 Subject: [PATCH 36/54] 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] --- v2/build/feature.jam | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v2/build/feature.jam b/v2/build/feature.jam index 4982524a4..0005405eb 100644 --- a/v2/build/feature.jam +++ b/v2/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 74b86fe83e70df092b112339f2dc31cbe382a146 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 21 Mar 2009 23:12:15 +0000 Subject: [PATCH 37/54] Include unistd.h Fixes #2596. [SVN r51896] --- historic/jam/src/jam.h | 1 + 1 file changed, 1 insertion(+) diff --git a/historic/jam/src/jam.h b/historic/jam/src/jam.h index 38680c0fc..660c58faf 100644 --- a/historic/jam/src/jam.h +++ b/historic/jam/src/jam.h @@ -410,6 +410,7 @@ #include #include #include +#include #ifndef OS_QNX #include From c9869425968c3689d44f701aecd6b4bf30aefa1c Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 30 Mar 2009 17:16:09 +0000 Subject: [PATCH 38/54] Preserve test targets by default. [SVN r52062] --- v2/tools/testing.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/testing.jam b/v2/tools/testing.jam index 00ae42555..25398ee72 100644 --- a/v2/tools/testing.jam +++ b/v2/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 04115f8cad1c0b1cf1dbfba94c3df434338e40bd Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 30 Mar 2009 17:23:52 +0000 Subject: [PATCH 39/54] Document the preserve-test-targets feature. [SVN r52063] --- v2/doc/src/tasks.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v2/doc/src/tasks.xml b/v2/doc/src/tasks.xml index 4a37c0f8e..0d7549988 100644 --- a/v2/doc/src/tasks.xml +++ b/v2/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 3a2679360c31b4575901af447e146f81a3f8060e Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Tue, 31 Mar 2009 18:54:47 +0000 Subject: [PATCH 40/54] Support for 64-bit compilation on acc. [SVN r52079] --- v2/tools/acc.jam | 3 +++ 1 file changed, 3 insertions(+) diff --git a/v2/tools/acc.jam b/v2/tools/acc.jam index e5a35b683..0f8c4c113 100644 --- a/v2/tools/acc.jam +++ b/v2/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 3b14f70aa6f3d9c1d5964f99f8131cef6be5a0da Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 1 Apr 2009 06:34:39 +0000 Subject: [PATCH 41/54] Add example of using built tool. [SVN r52098] --- v2/example/built_tool/Jamroot.jam | 8 +++++++ v2/example/built_tool/core/Jamfile.jam | 30 ++++++++++++++++++++++++ v2/example/built_tool/core/a.td | 0 v2/example/built_tool/core/core.cpp | 5 ++++ v2/example/built_tool/readme.txt | 5 ++++ v2/example/built_tool/tblgen/Jamfile.jam | 4 ++++ v2/example/built_tool/tblgen/tblgen.cpp | 9 +++++++ 7 files changed, 61 insertions(+) create mode 100644 v2/example/built_tool/Jamroot.jam create mode 100644 v2/example/built_tool/core/Jamfile.jam create mode 100644 v2/example/built_tool/core/a.td create mode 100644 v2/example/built_tool/core/core.cpp create mode 100644 v2/example/built_tool/readme.txt create mode 100644 v2/example/built_tool/tblgen/Jamfile.jam create mode 100644 v2/example/built_tool/tblgen/tblgen.cpp diff --git a/v2/example/built_tool/Jamroot.jam b/v2/example/built_tool/Jamroot.jam new file mode 100644 index 000000000..c458650e8 --- /dev/null +++ b/v2/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/v2/example/built_tool/core/Jamfile.jam b/v2/example/built_tool/core/Jamfile.jam new file mode 100644 index 000000000..2d96f7182 --- /dev/null +++ b/v2/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/v2/example/built_tool/core/a.td b/v2/example/built_tool/core/a.td new file mode 100644 index 000000000..e69de29bb diff --git a/v2/example/built_tool/core/core.cpp b/v2/example/built_tool/core/core.cpp new file mode 100644 index 000000000..31a133726 --- /dev/null +++ b/v2/example/built_tool/core/core.cpp @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} diff --git a/v2/example/built_tool/readme.txt b/v2/example/built_tool/readme.txt new file mode 100644 index 000000000..bbb9f9b3a --- /dev/null +++ b/v2/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/v2/example/built_tool/tblgen/Jamfile.jam b/v2/example/built_tool/tblgen/Jamfile.jam new file mode 100644 index 000000000..af4906278 --- /dev/null +++ b/v2/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/v2/example/built_tool/tblgen/tblgen.cpp b/v2/example/built_tool/tblgen/tblgen.cpp new file mode 100644 index 000000000..fbd058133 --- /dev/null +++ b/v2/example/built_tool/tblgen/tblgen.cpp @@ -0,0 +1,9 @@ + +#include + +int main() +{ + std::cout << "int foo;\n"; + return 0; +} + From 5aeab418da8a998a161117819770c4fef17c6ab0 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 07:29:30 +0000 Subject: [PATCH 42/54] Adjust intel-linux inlining options for newer versions. Fixes #2419. [SVN r52164] --- v2/tools/intel-linux.jam | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam index eff4b6bfe..de5bf8c7c 100644 --- a/v2/tools/intel-linux.jam +++ b/v2/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 8c387334d8d084eaa3c1d6f4cf55eddb2439a12a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 07:38:27 +0000 Subject: [PATCH 43/54] Unbreak prebuilt libraries on pathscale. [SVN r52165] --- v2/tools/pathscale.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/pathscale.jam b/v2/tools/pathscale.jam index 3042750d0..1a81444e1 100644 --- a/v2/tools/pathscale.jam +++ b/v2/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 d1c45ccc300282032c4336cecf2ab3eecc85ffe7 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 18:54:12 +0000 Subject: [PATCH 44/54] Implement project-config.jam loading. [SVN r52170] --- v2/build-system.jam | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/v2/build-system.jam b/v2/build-system.jam index 0a3b571c3..016942f2d 100644 --- a/v2/build-system.jam +++ b/v2/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 69e1e2736084e5c229cc6f8df5062fc82ee40e67 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 18:55:37 +0000 Subject: [PATCH 45/54] Allow Boost.Build to override the value of -j. [SVN r52171] --- historic/jam/src/jam.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/historic/jam/src/jam.c b/historic/jam/src/jam.c index b68a9cb58..cbffb4765 100644 --- a/historic/jam/src/jam.c +++ b/historic/jam/src/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 1a999110ea49292ad63a7dfd1edb35dd7fdf7482 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 21:15:09 +0000 Subject: [PATCH 46/54] Adjust the search for project-config.jam. [SVN r52173] --- v2/build-system.jam | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index 016942f2d..ef2e83068 100644 --- a/v2/build-system.jam +++ b/v2/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 680883548d934a30716e5a5fe499def48cb8695d Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 21:16:05 +0000 Subject: [PATCH 47/54] Make Jamroots inherit from project-config, if one exists. [SVN r52174] --- v2/build/project.jam | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/v2/build/project.jam b/v2/build/project.jam index d7af1fb3b..53c32d027 100644 --- a/v2/build/project.jam +++ b/v2/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 a156ce4b0af7cdf8eafa7de26b9ff3a61f307b4b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 6 Apr 2009 09:46:17 +0000 Subject: [PATCH 48/54] Fix exe extension on Cygwin. Fixes #2913. [SVN r52212] --- v2/tools/types/exe.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/tools/types/exe.jam b/v2/tools/types/exe.jam index af6b33e46..47109513a 100644 --- a/v2/tools/types/exe.jam +++ b/v2/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 9550d9882722c0028b308d24250ba1b6a51b5b45 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Tue, 7 Apr 2009 17:22:51 +0000 Subject: [PATCH 49/54] workaround quickbook bug by using absolute paths... but this breaks boost::function docs build. This whole thing is a train wreck. [SVN r52232] --- CMake/BoostDocs.cmake | 67 +++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/CMake/BoostDocs.cmake b/CMake/BoostDocs.cmake index 2315ef234..efa8e9f68 100644 --- a/CMake/BoostDocs.cmake +++ b/CMake/BoostDocs.cmake @@ -13,7 +13,8 @@ # Transforms the source XML file by applying the given XSL stylesheet. # -# xsl_transform(output input [input2 input3 ...] +# xsl_transform(OUTPUT output +# INPUT input [input2 input3 ...] # STYLESHEET stylesheet # [CATALOG catalog] # [DIRECTORY mainfile] @@ -53,9 +54,9 @@ # If a COMMENT argument is provided, it will be used as the comment # CMake provides when running this XSL transformation. Otherwise, the # comment will be "Generating "output" via XSL transformation...". -macro(xsl_transform OUTPUT INPUT) +macro(xsl_transform) parse_arguments(THIS_XSL - "STYLESHEET;CATALOG;MAKE_ALL_TARGET;MAKE_TARGET;PARAMETERS;DIRECTORY;COMMENT" + "OUTPUT;INPUT;STYLESHEET;CATALOG;MAKE_ALL_TARGET;MAKE_TARGET;PARAMETERS;DIRECTORY;COMMENT" "" ${ARGN} ) @@ -81,18 +82,18 @@ macro(xsl_transform OUTPUT INPUT) # If the user didn't provide a comment for this transformation, # create a default one. if(NOT THIS_XSL_COMMENT) - set(THIS_XSL_COMMENT "Generating ${OUTPUT} via XSL transformation...") + set(THIS_XSL_COMMENT "Generating ${THIS_XSL_OUTPUT} via XSL transformation...") endif() # Figure out the actual output file that we tell CMake about # (THIS_XSL_OUTPUT_FILE) and the output file or directory that we # tell xsltproc about (THIS_XSL_OUTPUT). if (THIS_XSL_DIRECTORY) - set(THIS_XSL_OUTPUT_FILE ${OUTPUT}/${THIS_XSL_DIRECTORY}) - set(THIS_XSL_OUTPUT ${OUTPUT}/) + set(THIS_XSL_OUTPUT_FILE ${THIS_XSL_OUTPUT}/${THIS_XSL_DIRECTORY}) + set(THIS_XSL_OUTPUT ${THIS_XSL_OUTPUT}/) else() - set(THIS_XSL_OUTPUT_FILE ${OUTPUT}) - set(THIS_XSL_OUTPUT ${OUTPUT}) + set(THIS_XSL_OUTPUT_FILE ${THIS_XSL_OUTPUT}) + set(THIS_XSL_OUTPUT ${THIS_XSL_OUTPUT}) endif() if(NOT THIS_XSL_STYLESHEET) @@ -104,9 +105,9 @@ macro(xsl_transform OUTPUT INPUT) COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS} ${THIS_XSL_EXTRA_FLAGS} -o ${THIS_XSL_OUTPUT} --path ${CMAKE_CURRENT_BINARY_DIR} - ${THIS_XSL_STYLESHEET} ${INPUT} + ${THIS_XSL_STYLESHEET} ${THIS_XSL_INPUT} COMMENT ${THIS_XSL_COMMENT} - DEPENDS ${INPUT} ${THIS_XSL_DEFAULT_ARGS}) + DEPENDS ${THIS_XSL_INPUT} ${THIS_XSL_DEFAULT_ARGS}) set_source_files_properties(${THIS_XSL_OUTPUT_FILE} PROPERTIES GENERATED TRUE) @@ -188,14 +189,15 @@ macro(doxygen_to_boostbook OUTPUT) ${CMAKE_CURRENT_BINARY_DIR}/xml/combine.xslt PROPERTIES GENERATED TRUE) xsl_transform( - ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml - ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml + INPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml STYLESHEET ${CMAKE_CURRENT_BINARY_DIR}/xml/combine.xslt COMMENT "Collecting Doxygen XML output for Boost.${PROJECT_NAME}...") # Transform single Doxygen XML file into BoostBook XML - xsl_transform(${OUTPUT} - ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml + xsl_transform( + OUTPUT ${OUTPUT} + INPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml STYLESHEET ${BOOSTBOOK_XSL_DIR}/doxygen/doxygen2boostbook.xsl COMMENT "Transforming Doxygen XML into BoostBook XML for Boost.${PROJECT_NAME}...") endmacro(doxygen_to_boostbook) @@ -224,12 +226,7 @@ macro(boost_add_documentation SOURCE) # If SOURCE is not a full path, it's in the current source # directory. - get_filename_component(THIS_DOC_SOURCE_PATH ${SOURCE} PATH) - if(THIS_DOC_SOURCE_PATH STREQUAL "") - set(THIS_DOC_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}") - else() - set(THIS_DOC_SOURCE_PATH ${SOURCE}) - endif() + get_filename_component(THIS_DOC_SOURCE_PATH ${SOURCE} ABSOLUTE) # If we are parsing C++ headers (with Doxygen) for reference # documentation, do so now and produce the requested BoostBook XML @@ -281,7 +278,7 @@ macro(boost_add_documentation SOURCE) if (BUILD_QUICKBOOK) # Transform Quickbook into BoostBook XML get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) - set(BOOSTBOOK_FILE ${SOURCE_FILENAME}.xml) + set(BOOSTBOOK_FILE ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILENAME}.xml) add_custom_command(OUTPUT ${BOOSTBOOK_FILE} COMMAND quickbook "--output-file=${BOOSTBOOK_FILE}" ${THIS_DOC_SOURCE_PATH} @@ -289,7 +286,7 @@ macro(boost_add_documentation SOURCE) COMMENT "Generating BoostBook documentation for Boost.${PROJECT_NAME}...") # Transform BoostBook into other formats - boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${BOOSTBOOK_FILE}) + boost_add_documentation(${BOOSTBOOK_FILE}) else() message(SEND_ERROR "Quickbook is required to build Boost documentation.\nQuickbook can be built by enabling the BUILD_QUICKBOOK.") @@ -297,8 +294,10 @@ macro(boost_add_documentation SOURCE) elseif (THIS_DOC_EXT STREQUAL ".XML") # Transform BoostBook XML into DocBook XML get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) - set(DOCBOOK_FILE ${SOURCE_FILENAME}.docbook) - xsl_transform(${DOCBOOK_FILE} ${THIS_DOC_SOURCE_PATH} + set(DOCBOOK_FILE ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILENAME}.docbook) + xsl_transform( + OUTPUT ${DOCBOOK_FILE} + INPUT ${THIS_DOC_SOURCE_PATH} ${THIS_DOC_DEFAULT_ARGS} STYLESHEET ${BOOSTBOOK_XSL_DIR}/docbook.xsl CATALOG ${CMAKE_BINARY_DIR}/catalog.xml @@ -306,13 +305,13 @@ macro(boost_add_documentation SOURCE) MAKE_TARGET ${PROJECT_NAME}-docbook) # Transform DocBook into other formats - boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${DOCBOOK_FILE}) + boost_add_documentation(${DOCBOOK_FILE}) elseif(THIS_DOC_EXT STREQUAL ".DOCBOOK") # If requested, build HTML documentation if (BUILD_DOCUMENTATION_HTML) xsl_transform( - ${CMAKE_CURRENT_BINARY_DIR}/html - ${THIS_DOC_SOURCE_PATH} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html + INPUT ${THIS_DOC_SOURCE_PATH} STYLESHEET ${BOOSTBOOK_XSL_DIR}/html.xsl CATALOG ${CMAKE_BINARY_DIR}/catalog.xml DIRECTORY HTML.manifest @@ -321,7 +320,6 @@ macro(boost_add_documentation SOURCE) boost.image.src=boost.png COMMENT "Generating HTML documentation for Boost.${PROJECT_NAME}..." MAKE_TARGET ${PROJECT_NAME}-html) - # # Install associated stuff # @@ -334,6 +332,8 @@ macro(boost_add_documentation SOURCE) COMMENT "Copying in associated stuff, boostbook.css and boost.png" ) + add_dependencies(html ${PROJECT_NAME}-html) + # Install generated documentation install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/boost-${BOOST_VERSION} @@ -344,13 +344,15 @@ macro(boost_add_documentation SOURCE) # If requested, build Unix man pages if (BUILD_DOCUMENTATION_MAN_PAGES) xsl_transform( - ${CMAKE_CURRENT_BINARY_DIR}/man - ${THIS_DOC_SOURCE_PATH} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/man + INPUT ${THIS_DOC_SOURCE_PATH} STYLESHEET ${BOOSTBOOK_XSL_DIR}/manpages.xsl CATALOG ${CMAKE_BINARY_DIR}/catalog.xml DIRECTORY man.manifest COMMENT "Generating man pages for Boost.${PROJECT_NAME}..." - MAKE_ALL_TARGET ${PROJECT_NAME}-man) + MAKE_ALL_TARGET ${PROJECT_NAME}-manpages) + + add_dependencies(manpages ${PROJECT_NAME}-manpages) # Install man pages install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man @@ -531,6 +533,9 @@ else() set(BUILD_DOCUMENTATION_OKAY TRUE) endif() +add_custom_target(html) +add_custom_target(manpages) + if (NOT BUILD_DOCUMENTATION_OKAY) if (BUILD_DOCUMENTATION) set(BUILD_DOCUMENTATION OFF CACHE BOOL From fd233481f8b08eac326fc9bed09d723bc5377768 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Wed, 8 Apr 2009 11:09:43 +0000 Subject: [PATCH 50/54] quickbook bug got fixed (thanks Daniel James), revert previous messy workaround [SVN r52247] --- CMake/BoostDocs.cmake | 70 ++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/CMake/BoostDocs.cmake b/CMake/BoostDocs.cmake index efa8e9f68..a5933b841 100644 --- a/CMake/BoostDocs.cmake +++ b/CMake/BoostDocs.cmake @@ -13,8 +13,7 @@ # Transforms the source XML file by applying the given XSL stylesheet. # -# xsl_transform(OUTPUT output -# INPUT input [input2 input3 ...] +# xsl_transform(output input [input2 input3 ...] # STYLESHEET stylesheet # [CATALOG catalog] # [DIRECTORY mainfile] @@ -54,9 +53,9 @@ # If a COMMENT argument is provided, it will be used as the comment # CMake provides when running this XSL transformation. Otherwise, the # comment will be "Generating "output" via XSL transformation...". -macro(xsl_transform) +macro(xsl_transform OUTPUT INPUT) parse_arguments(THIS_XSL - "OUTPUT;INPUT;STYLESHEET;CATALOG;MAKE_ALL_TARGET;MAKE_TARGET;PARAMETERS;DIRECTORY;COMMENT" + "STYLESHEET;CATALOG;MAKE_ALL_TARGET;MAKE_TARGET;PARAMETERS;DIRECTORY;COMMENT" "" ${ARGN} ) @@ -82,18 +81,18 @@ macro(xsl_transform) # If the user didn't provide a comment for this transformation, # create a default one. if(NOT THIS_XSL_COMMENT) - set(THIS_XSL_COMMENT "Generating ${THIS_XSL_OUTPUT} via XSL transformation...") + set(THIS_XSL_COMMENT "Generating ${OUTPUT} via XSL transformation...") endif() # Figure out the actual output file that we tell CMake about # (THIS_XSL_OUTPUT_FILE) and the output file or directory that we # tell xsltproc about (THIS_XSL_OUTPUT). if (THIS_XSL_DIRECTORY) - set(THIS_XSL_OUTPUT_FILE ${THIS_XSL_OUTPUT}/${THIS_XSL_DIRECTORY}) - set(THIS_XSL_OUTPUT ${THIS_XSL_OUTPUT}/) + set(THIS_XSL_OUTPUT_FILE ${OUTPUT}/${THIS_XSL_DIRECTORY}) + set(THIS_XSL_OUTPUT ${OUTPUT}/) else() - set(THIS_XSL_OUTPUT_FILE ${THIS_XSL_OUTPUT}) - set(THIS_XSL_OUTPUT ${THIS_XSL_OUTPUT}) + set(THIS_XSL_OUTPUT_FILE ${OUTPUT}) + set(THIS_XSL_OUTPUT ${OUTPUT}) endif() if(NOT THIS_XSL_STYLESHEET) @@ -105,9 +104,9 @@ macro(xsl_transform) COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS} ${THIS_XSL_EXTRA_FLAGS} -o ${THIS_XSL_OUTPUT} --path ${CMAKE_CURRENT_BINARY_DIR} - ${THIS_XSL_STYLESHEET} ${THIS_XSL_INPUT} + ${THIS_XSL_STYLESHEET} ${INPUT} COMMENT ${THIS_XSL_COMMENT} - DEPENDS ${THIS_XSL_INPUT} ${THIS_XSL_DEFAULT_ARGS}) + DEPENDS ${INPUT} ${THIS_XSL_DEFAULT_ARGS}) set_source_files_properties(${THIS_XSL_OUTPUT_FILE} PROPERTIES GENERATED TRUE) @@ -189,15 +188,14 @@ macro(doxygen_to_boostbook OUTPUT) ${CMAKE_CURRENT_BINARY_DIR}/xml/combine.xslt PROPERTIES GENERATED TRUE) xsl_transform( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml - INPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml + ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml + ${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml STYLESHEET ${CMAKE_CURRENT_BINARY_DIR}/xml/combine.xslt COMMENT "Collecting Doxygen XML output for Boost.${PROJECT_NAME}...") # Transform single Doxygen XML file into BoostBook XML - xsl_transform( - OUTPUT ${OUTPUT} - INPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml + xsl_transform(${OUTPUT} + ${CMAKE_CURRENT_BINARY_DIR}/xml/all.xml STYLESHEET ${BOOSTBOOK_XSL_DIR}/doxygen/doxygen2boostbook.xsl COMMENT "Transforming Doxygen XML into BoostBook XML for Boost.${PROJECT_NAME}...") endmacro(doxygen_to_boostbook) @@ -226,7 +224,12 @@ macro(boost_add_documentation SOURCE) # If SOURCE is not a full path, it's in the current source # directory. - get_filename_component(THIS_DOC_SOURCE_PATH ${SOURCE} ABSOLUTE) + get_filename_component(THIS_DOC_SOURCE_PATH ${SOURCE} PATH) + if(THIS_DOC_SOURCE_PATH STREQUAL "") + set(THIS_DOC_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE}") + else() + set(THIS_DOC_SOURCE_PATH ${SOURCE}) + endif() # If we are parsing C++ headers (with Doxygen) for reference # documentation, do so now and produce the requested BoostBook XML @@ -278,7 +281,7 @@ macro(boost_add_documentation SOURCE) if (BUILD_QUICKBOOK) # Transform Quickbook into BoostBook XML get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) - set(BOOSTBOOK_FILE ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILENAME}.xml) + set(BOOSTBOOK_FILE ${SOURCE_FILENAME}.xml) add_custom_command(OUTPUT ${BOOSTBOOK_FILE} COMMAND quickbook "--output-file=${BOOSTBOOK_FILE}" ${THIS_DOC_SOURCE_PATH} @@ -286,7 +289,7 @@ macro(boost_add_documentation SOURCE) COMMENT "Generating BoostBook documentation for Boost.${PROJECT_NAME}...") # Transform BoostBook into other formats - boost_add_documentation(${BOOSTBOOK_FILE}) + boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${BOOSTBOOK_FILE}) else() message(SEND_ERROR "Quickbook is required to build Boost documentation.\nQuickbook can be built by enabling the BUILD_QUICKBOOK.") @@ -294,10 +297,8 @@ macro(boost_add_documentation SOURCE) elseif (THIS_DOC_EXT STREQUAL ".XML") # Transform BoostBook XML into DocBook XML get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) - set(DOCBOOK_FILE ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILENAME}.docbook) - xsl_transform( - OUTPUT ${DOCBOOK_FILE} - INPUT ${THIS_DOC_SOURCE_PATH} + set(DOCBOOK_FILE ${SOURCE_FILENAME}.docbook) + xsl_transform(${DOCBOOK_FILE} ${THIS_DOC_SOURCE_PATH} ${THIS_DOC_DEFAULT_ARGS} STYLESHEET ${BOOSTBOOK_XSL_DIR}/docbook.xsl CATALOG ${CMAKE_BINARY_DIR}/catalog.xml @@ -305,13 +306,13 @@ macro(boost_add_documentation SOURCE) MAKE_TARGET ${PROJECT_NAME}-docbook) # Transform DocBook into other formats - boost_add_documentation(${DOCBOOK_FILE}) + boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${DOCBOOK_FILE}) elseif(THIS_DOC_EXT STREQUAL ".DOCBOOK") # If requested, build HTML documentation if (BUILD_DOCUMENTATION_HTML) xsl_transform( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html - INPUT ${THIS_DOC_SOURCE_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/html + ${THIS_DOC_SOURCE_PATH} STYLESHEET ${BOOSTBOOK_XSL_DIR}/html.xsl CATALOG ${CMAKE_BINARY_DIR}/catalog.xml DIRECTORY HTML.manifest @@ -320,6 +321,8 @@ macro(boost_add_documentation SOURCE) boost.image.src=boost.png COMMENT "Generating HTML documentation for Boost.${PROJECT_NAME}..." MAKE_TARGET ${PROJECT_NAME}-html) + add_dependencies(html ${PROJECT_NAME}-html) + # # Install associated stuff # @@ -332,8 +335,6 @@ macro(boost_add_documentation SOURCE) COMMENT "Copying in associated stuff, boostbook.css and boost.png" ) - add_dependencies(html ${PROJECT_NAME}-html) - # Install generated documentation install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/boost-${BOOST_VERSION} @@ -344,14 +345,13 @@ macro(boost_add_documentation SOURCE) # If requested, build Unix man pages if (BUILD_DOCUMENTATION_MAN_PAGES) xsl_transform( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/man - INPUT ${THIS_DOC_SOURCE_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/man + ${THIS_DOC_SOURCE_PATH} STYLESHEET ${BOOSTBOOK_XSL_DIR}/manpages.xsl CATALOG ${CMAKE_BINARY_DIR}/catalog.xml DIRECTORY man.manifest COMMENT "Generating man pages for Boost.${PROJECT_NAME}..." MAKE_ALL_TARGET ${PROJECT_NAME}-manpages) - add_dependencies(manpages ${PROJECT_NAME}-manpages) # Install man pages @@ -486,8 +486,12 @@ if (XSLTPROC AND DOXYGEN) if (DOCBOOK_DTD_DIR AND DOCBOOK_XSL_DIR) # Documentation build options option(BUILD_DOCUMENTATION "Whether to build library documentation" ON) + option(BUILD_DOCUMENTATION_HTML "Whether to build HTML documentation" ON) + add_custom_target(html) + option(BUILD_DOCUMENTATION_MAN_PAGES "Whether to build Unix man pages" ON) + add_custom_target(manpages) # Generate an XML catalog file. configure_file(${CMAKE_SOURCE_DIR}/tools/build/CMake/catalog.xml.in @@ -533,12 +537,10 @@ else() set(BUILD_DOCUMENTATION_OKAY TRUE) endif() -add_custom_target(html) -add_custom_target(manpages) - if (NOT BUILD_DOCUMENTATION_OKAY) if (BUILD_DOCUMENTATION) set(BUILD_DOCUMENTATION OFF CACHE BOOL "Whether to build library documentation" FORCE) endif() endif() + From fac0a649a0a8db95fbfc2800ab1a00199b3cb32f Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Wed, 8 Apr 2009 13:14:14 +0000 Subject: [PATCH 51/54] Silly BUILD_QUICKBOOK. Just use the cmake target. Also check for headers to feed to doxygen in both regular and modularized locations. [SVN r52253] --- CMake/BoostDocs.cmake | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/CMake/BoostDocs.cmake b/CMake/BoostDocs.cmake index a5933b841..17652a3be 100644 --- a/CMake/BoostDocs.cmake +++ b/CMake/BoostDocs.cmake @@ -166,12 +166,20 @@ macro(doxygen_to_boostbook OUTPUT) file(APPEND ${DOXYFILE} "${PARAM}\n") endforeach(PARAM) - set(THIS_DOXY_HEADER_PATH ${CMAKE_SOURCE_DIR}/libs/${libname}/include) + set(THIS_DOXY_MODULAR_HEADER_PATH ${CMAKE_SOURCE_DIR}/libs/${libname}/include) set(THIS_DOXY_HEADER_LIST "") set(THIS_DOXY_HEADERS) foreach(HDR ${THIS_DOXY_DEFAULT_ARGS}) - list(APPEND THIS_DOXY_HEADERS ${THIS_DOXY_HEADER_PATH}/${HDR}) + if(EXISTS ${CMAKE_SOURCE_DIR}/${HDR}) + list(APPEND THIS_DOXY_HEADERS ${CMAKE_SOURCE_DIR}/${HDR}) + elseif(EXISTS ${THIS_DOXY_MODULAR_HEADER_PATH}/${HDR}) + list(APPEND THIS_DOXY_HEADERS ${THIS_DOXY_MODULAR_HEADER_PATH}/${HDR}) + else(EXISTS ${CMAKE_SOURCE_DIR}/${HDR}) + message("Warning: Attempting to generate doxygen to boostbook target for header ${HDR},") + message(" which was not found in the main source directory or in a modularized location") + endif(EXISTS ${CMAKE_SOURCE_DIR}/${HDR}) + set(THIS_DOXY_HEADER_LIST "${THIS_DOXY_HEADER_LIST} ${THIS_DOXY_HEADER_PATH}/${HDR}") endforeach(HDR) @@ -278,22 +286,17 @@ macro(boost_add_documentation SOURCE) get_filename_component(THIS_DOC_EXT ${SOURCE} EXT) string(TOUPPER ${THIS_DOC_EXT} THIS_DOC_EXT) if (THIS_DOC_EXT STREQUAL ".QBK") - if (BUILD_QUICKBOOK) - # Transform Quickbook into BoostBook XML - get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) - set(BOOSTBOOK_FILE ${SOURCE_FILENAME}.xml) - add_custom_command(OUTPUT ${BOOSTBOOK_FILE} - COMMAND quickbook "--output-file=${BOOSTBOOK_FILE}" - ${THIS_DOC_SOURCE_PATH} - DEPENDS ${THIS_DOC_SOURCE_PATH} ${THIS_DOC_DEFAULT_ARGS} - COMMENT "Generating BoostBook documentation for Boost.${PROJECT_NAME}...") + # Transform Quickbook into BoostBook XML + get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) + set(BOOSTBOOK_FILE ${SOURCE_FILENAME}.xml) + add_custom_command(OUTPUT ${BOOSTBOOK_FILE} + COMMAND quickbook "--output-file=${BOOSTBOOK_FILE}" + ${THIS_DOC_SOURCE_PATH} + DEPENDS ${THIS_DOC_SOURCE_PATH} ${THIS_DOC_DEFAULT_ARGS} + COMMENT "Generating BoostBook documentation for Boost.${PROJECT_NAME}...") - # Transform BoostBook into other formats - boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${BOOSTBOOK_FILE}) - else() - message(SEND_ERROR - "Quickbook is required to build Boost documentation.\nQuickbook can be built by enabling the BUILD_QUICKBOOK.") - endif() + # Transform BoostBook into other formats + boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${BOOSTBOOK_FILE}) elseif (THIS_DOC_EXT STREQUAL ".XML") # Transform BoostBook XML into DocBook XML get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE) From b15d1b6464e5b4a397c0c1e3c958fdf9639b73aa Mon Sep 17 00:00:00 2001 From: David Deakins Date: Wed, 8 Apr 2009 21:11:25 +0000 Subject: [PATCH 52/54] As of STLport 5.2, the version number is no longer included in the name of the static libraries. [SVN r52270] --- v2/tools/stlport.jam | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/v2/tools/stlport.jam b/v2/tools/stlport.jam index 4390585ba..d6d2dc6bc 100644 --- a/v2/tools/stlport.jam +++ b/v2/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 7543e32ec9acf40d2ea7d38feebc2872403eba2a Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 10 Apr 2009 20:02:51 +0000 Subject: [PATCH 53/54] Makes it possible to use an installed docutils without referring to a source distro directory. [SVN r52306] --- v2/tools/docutils.jam | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) mode change 100755 => 100644 v2/tools/docutils.jam diff --git a/v2/tools/docutils.jam b/v2/tools/docutils.jam old mode 100755 new mode 100644 index d6155ecfe..9055f8d53 --- a/v2/tools/docutils.jam +++ b/v2/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 13a2d76893f3350fa8bd8c212f4b3c0c6ecc0bba Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 11 Apr 2009 07:22:28 +0000 Subject: [PATCH 54/54] 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] --- v2/build/targets.jam | 143 +++++++++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 60 deletions(-) diff --git a/v2/build/targets.jam b/v2/build/targets.jam index 20da57988..a7aa2c008 100644 --- a/v2/build/targets.jam +++ b/v2/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