diff --git a/v2/build-system.jam b/v2/build-system.jam index 434d2195e..c948c64b6 100644 --- a/v2/build-system.jam +++ b/v2/build-system.jam @@ -238,6 +238,12 @@ local rule load-config ( module-name : filename : path + : must-find ? ) "$(filename)" "from" $(where) "." ; } + # Set source location so that path-constant in config files + # with relative paths work. This is of most importance + # for project-config.jam, but may be used in other + # config files as well. + local attributes = [ project.attributes $(module-name) ] ; + $(attributes).set source-location : $(where:D) : exact ; modules.load $(module-name) : $(filename) : $(path) ; project.load-used-projects $(module-name) ; } @@ -898,6 +904,21 @@ local rule should-clean-project ( project ) modules.poke : PARALLELISM : $(j) ; } + local k = [ option.get keep-going : true : true ] ; + if $(k) in "on" "yes" "true" + { + modules.poke : KEEP_GOING : 1 ; + } + else if $(k) in "off" "no" "false" + { + modules.poke : KEEP_GOING : 0 ; + } + else + { + ECHO "error: Invalid value for the --keep-going option" ; + EXIT ; + } + # The 'all' pseudo target is not strictly needed expect in the case when we # use it below but people often assume they always have this target # available and do not declare it themselves before use which may cause diff --git a/v2/build/feature.jam b/v2/build/feature.jam index 0005405eb..6f54adefb 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) { - if ! ( $(value-string) in $($(feature).subfeatures) ) { + if ! ( $(value-string) in $($(feature).values) ) + && ! ( $(value-string) in $($(feature).subfeatures) ) + { values = [ regex.split $(value-string) - ] ; } } diff --git a/v2/build/project.jam b/v2/build/project.jam index e55521901..b4d2227e6 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -59,7 +59,7 @@ rule load ( jamfile-location ) # If Jamfile is already loaded, don't try again. if ! $(module-name) in $(.jamfile-modules) { - load-jamfile $(jamfile-location) ; + load-jamfile $(jamfile-location) : $(module-name) ; # We want to make sure that child project are loaded only after parent # projects. In particular, because parent projects define attributes @@ -277,6 +277,7 @@ rule find-jamfile ( # local rule load-jamfile ( dir # The directory of the project Jamfile. + : jamfile-module ) { # See if the Jamfile is where it should be. @@ -293,10 +294,6 @@ local rule load-jamfile ( : "Filenames are: " $(jamfile-to-load:D=) ; } - # The module of the Jamfile. - # - local jamfile-module = [ module-name [ path.parent $(jamfile-to-load) ] ] ; - # Initialize the Jamfile module before loading. # initialize $(jamfile-module) : [ path.parent $(jamfile-to-load) ] @@ -1035,6 +1032,16 @@ module project-rules } } + rule always ( target-names * ) + { + import project ; + local t = [ project.current ] ; + for local n in $(target-names) + { + $(t).mark-target-as-always $(n) ; + } + } + rule glob ( wildcards + : excludes * ) { import project ; diff --git a/v2/build/targets.jam b/v2/build/targets.jam index b6ccc0131..3d38002d3 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -303,6 +303,13 @@ class project-target : abstract-target # before main target instances are created. self.explicit-targets += $(target-name) ; } + + rule mark-target-as-always ( target-name ) + { + # Record the name of the target, not instance, since this rule is called + # before main target instances are created. + self.always-targets += $(target-name) ; + } # Add new target alternative # @@ -466,6 +473,11 @@ class project-target : abstract-target self.main-targets += $(t) ; target = $(self.main-target.$(name)) ; } + + if $(name) in $(self.always-targets) + { + $(a).always ; + } $(target).add-alternative $(a) ; } @@ -485,7 +497,17 @@ class project-target : abstract-target local r ; for local v in $(value) { - v = [ path.root [ path.make $(v) ] $(self.location) ] ; + local l = $(self.location) ; + if ! $(l) + { + # Project corresponding to config files do not have + # 'location' attribute, but do have source location. + # It might be more reasonable to make every project have + # a location and use some other approach to prevent buildable + # targets in config files, but that's for later. + l = [ get source-location ] ; + } + v = [ path.root [ path.make $(v) ] $(l) ] ; # Now make the value absolute path. v = [ path.root $(v) [ path.pwd ] ] ; # Constants should be in platform-native form. @@ -1090,7 +1112,12 @@ class basic-target : abstract-target [ full-name ] ; } } - + + rule always ( ) + { + self.always = 1 ; + } + # Returns the list of abstract-targets which are used as sources. The extra # properties specified for sources are not represented. The only user for # this rule at the moment is the "--dump-tests" feature of the test system. @@ -1257,7 +1284,15 @@ class basic-target : abstract-target { local gur = $(result[1]) ; result = $(result[2-]) ; - + + if $(self.always) + { + for local t in $(result) + { + $(t).always ; + } + } + local s = [ create-subvariant $(result) : [ virtual-target.recent-targets ] : $(property-set) : $(source-targets) diff --git a/v2/doc/src/reference.xml b/v2/doc/src/reference.xml index 51720a998..bb838d403 100644 --- a/v2/doc/src/reference.xml +++ b/v2/doc/src/reference.xml @@ -181,6 +181,26 @@ ECHO [ glob-tree *.cpp : .svn ] ; their containing project is built. + + always + always building a metatarget + + The always funciton takes a single + parameter—a list of metatarget names. The top-level targets produced + by the named metatargets will be always considered out of date. Consider this example: + + +exe hello : hello.cpp ; +exe bye : bye.cpp ; +always hello ; + + If a build of hello is requested, then the binary will + always be relinked. The object files will not be recompiled, though. Note that if + a build of hello is not requested, for example you specify just + bye on the command line, hello will not + be relinked. + + constant @@ -1723,7 +1743,7 @@ exe a : a.cpp dependency - The value of dependency feature if a target reference. + The value of a dependency feature is a target reference. When used for building of a main target, the value of dependency feature is treated as additional dependency. diff --git a/v2/kernel/bootstrap.jam b/v2/kernel/bootstrap.jam index fb918e7a8..a629d214f 100644 --- a/v2/kernel/bootstrap.jam +++ b/v2/kernel/bootstrap.jam @@ -131,7 +131,7 @@ local dont-build = [ option.process ] ; # if ! $(dont-build) { - if ! [ MATCH (--python) : $(ARGV) ] + if ! --python in $(ARGV) { # Allow users to override the build system file from the # command-line (mostly for testing) diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index 881ef732c..1565213ec 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -121,6 +121,12 @@ feature.feature asynch-exceptions : off on : propagated ; feature.feature extern-c-nothrow : off on : propagated ; feature.feature debug-symbols : on off : propagated ; +# Controls whether the binary should be stripped -- that is have +# everything not necessary to running removed. This option should +# not be very often needed. Also, this feature will show up in +# target paths of everything, not just binaries. Should fix that +# when impelementing feature relevance. +feature.feature strip : off on : propagated ; feature.feature define : : free ; feature.feature undef : : free ; feature.feature "include" : : free path ; #order-sensitive ; diff --git a/v2/tools/darwin.jam b/v2/tools/darwin.jam index 37bfbf88c..a14987c33 100644 --- a/v2/tools/darwin.jam +++ b/v2/tools/darwin.jam @@ -24,29 +24,11 @@ import errors ; ## Use a framework. feature framework : : free ; -## The MacOSX versions we can target. -.macosx-versions = - 10.6 10.5 10.4 10.3 10.2 10.1 - iphone-3.2 iphonesim-3.2 - iphone-3.1.2 iphonesim-3.1.2 - iphone-3.1 iphonesim-3.1 - iphone-3.0 iphonesim-3.0 - iphone-2.2.1 iphonesim-2.2.1 - iphone-2.2 iphonesim-2.2 - iphone-2.1 iphonesim-2.1 - iphone-2.0 iphonesim-2.0 - iphone-1.x - ; - ## The MacOSX version to compile for, which maps to the SDK to use (sysroot). -feature macosx-version - : $(.macosx-versions) - : propagated link-incompatible symmetric optional ; +feature macosx-version : : propagated link-incompatible symmetric optional ; ## The minimal MacOSX version to target. -feature macosx-version-min - : $(.macosx-versions) - : propagated optional ; +feature macosx-version-min : : propagated optional ; ############################################################################# @@ -170,27 +152,27 @@ rule init ( version ? : command * : options * : requirement * ) # We can turn off strip by specifying it as empty. In which # case we switch to using the linker to do the strip. flags darwin.link.dll OPTIONS - $(condition)/LIB/shared/32/off : -Wl,-x ; + $(condition)/LIB/shared/32/on : -Wl,-x ; flags darwin.link.dll OPTIONS - $(condition)/LIB/shared//off : -Wl,-x ; + $(condition)/LIB/shared//on : -Wl,-x ; flags darwin.link OPTIONS - $(condition)/EXE/32/off : -s ; + $(condition)/EXE/32/on : -s ; flags darwin.link OPTIONS - $(condition)/EXE//off : -s ; + $(condition)/EXE//on : -s ; } else { # Otherwise we need to find a strip program to use. And hence # also tell the link action that we need to use a strip # post-process. - flags darwin.link NEED_STRIP $(condition)/off : "" ; + flags darwin.link NEED_STRIP $(condition)/on : "" ; strip = [ common.get-invocation-command darwin : strip : [ feature.get-values : $(options) ] : $(bin) : search-path ] ; flags darwin.link .STRIP $(condition) : $(strip[1]) ; if $(.debug-configuration) { - ECHO notice: using strip :: $(condition) :: $(strip[1]) ; + ECHO notice: using strip for $(condition) at $(strip[1]) ; } } @@ -202,7 +184,7 @@ rule init ( version ? : command * : options * : requirement * ) flags darwin.archive .LIBTOOL $(condition) : $(archiver[1]) ; if $(.debug-configuration) { - ECHO notice: using archiver :: $(condition) :: $(archiver[1]) ; + ECHO notice: using archiver for $(condition) at $(archiver[1]) ; } # - Initialize the SDKs available in the root for this tool. @@ -220,6 +202,94 @@ rule init ( version ? : command * : options * : requirement * ) #~ EXIT ; } +# Add and set options for a discovered SDK version. +local rule init-sdk ( condition * : root ? : version + : version-feature ? ) +{ + local rule version-to-feature ( version + ) + { + switch $(version[1]) + { + case iphone* : + { + return $(version[1])-$(version[2-]:J=.) ; + } + case mac* : + { + return $(version[2-]:J=.) ; + } + case * : + { + return $(version:J=.) ; + } + } + } + + if $(version-feature) + { + if $(.debug-configuration) + { + ECHO notice: available sdk for $(condition)/$(version-feature) at $(sdk) ; + } + + # Add the version to the features for specifying them. + if ! $(version-feature) in [ feature.values macosx-version ] + { + feature.extend macosx-version : $(version-feature) ; + } + if ! $(version-feature) in [ feature.values macosx-version-min ] + { + feature.extend macosx-version-min : $(version-feature) ; + } + + # Set the flags the version needs to compile with, first + # generic options. + flags darwin.compile OPTIONS $(condition)/$(version-feature) + : -isysroot $(sdk) ; + flags darwin.link OPTIONS $(condition)/$(version-feature) + : -isysroot $(sdk) ; + + # Then device variation options. + switch $(version[1]) + { + case iphone* : + { + flags darwin.compile OPTIONS $(version-feature) + : -miphoneos-version-min=$(version[2-]:J=.) ; + flags darwin.link OPTIONS $(version-feature) + : -miphoneos-version-min=$(version[2-]:J=.) ; + } + + case mac* : + { + flags darwin.compile OPTIONS $(version-feature) + : -miphoneos-version-min=$(version[2-]:J=.) ; + flags darwin.link OPTIONS $(version-feature) + : -miphoneos-version-min=$(version[2-]:J=.) ; + } + } + + return $(version-feature) ; + } + else if $(version[4]) + { + # We have a patch version of an SDK. We want to set up + # both the specific patch version, and the minor version. + # So we recurse to set up the minor version. Plus the minor version. + return + [ init-sdk $(condition) : $(root) + : $(version[1-3]) : [ version-to-feature $(version[1-3]) ] ] + [ init-sdk $(condition) : $(root) + : $(version) : [ version-to-feature $(version) ] ] ; + } + else + { + # Yes, this is intentionally recursive. + return + [ init-sdk $(condition) : $(root) + : $(version) : [ version-to-feature $(version) ] ] ; + } +} + # Determine the MacOSX SDK versions installed and their locations. local rule init-available-sdk-versions ( condition * : root ? ) { @@ -231,45 +301,29 @@ local rule init-available-sdk-versions ( condition * : root ? ) { local sdk-match = [ MATCH ([^0-9]+)([0-9]+)[.]([0-9x]+)[.]?([0-9x]+)? : $(sdk:D=) ] ; local sdk-platform = $(sdk-match[1]:L) ; - local sdk-version = $(sdk-match[2]).$(sdk-match[3]) ; + local sdk-version = $(sdk-match[2-]) ; if $(sdk-version) { switch $(sdk-platform) { case macosx : { - sdk-version = $(sdk-version) ; + sdk-version = mac $(sdk-version) ; } case iphoneos : { - if $(sdk-match[4]) - { - sdk-version = $(sdk-version).$(sdk-match[4]) ; - } - sdk-version = iphone-$(sdk-version) ; + sdk-version = iphone $(sdk-version) ; } case iphonesimulator : { - if $(sdk-match[4]) - { - sdk-version = $(sdk-version).$(sdk-match[4]) ; - } - sdk-version = iphonesim-$(sdk-version) ; + sdk-version = iphonesim $(sdk-version) ; } case * : { sdk-version = $(sdk-version:J=-) ; } } - result += $(sdk-version) ; - flags darwin.compile OPTIONS $(condition)/$(sdk-version) - : -isysroot $(sdk) ; - flags darwin.link OPTIONS $(condition)/$(sdk-version) - : -isysroot $(sdk) ; - if $(.debug-configuration) - { - ECHO notice: available sdk :: $(condition)/$(sdk-version) :: $(sdk) ; - } + result += [ init-sdk $(condition) : $(sdk) : $(sdk-version) ] ; } } return $(result) ; @@ -278,31 +332,6 @@ local rule init-available-sdk-versions ( condition * : root ? ) # Generic options. flags darwin.compile OPTIONS ; -# Minimal OSX target option. Note that the default is for the min-version -# option to not be included to let the compiler default take hold. -for local macosx-version in $(.macosx-versions) -{ - switch $(macosx-version) - { - case iphone* : - { - local version-match = [ MATCH ([^0-9]+)([0-9.]+) : $(macosx-version) ] ; - flags darwin.compile OPTIONS $(macosx-version) - : -miphoneos-version-min=$(version-match[2]) ; - flags darwin.link OPTIONS $(macosx-version) - : -miphoneos-version-min=$(version-match[2]) ; - } - - case * : - { - flags darwin.compile OPTIONS $(macosx-version) - : -mmacosx-version-min=$(macosx-version) ; - flags darwin.link OPTIONS $(macosx-version) - : -mmacosx-version-min=$(macosx-version) ; - } - } -} - # The following adds objective-c support to darwin. # Thanks to http://thread.gmane.org/gmane.comp.lib.boost.build/13759 @@ -468,12 +497,15 @@ local rule prepare-framework-path ( target + ) # The -F option specifies the directories where a framework # is searched for. So, if we find feature # with some path, we need to generate property -F option. - local framework-path = [ on $(target) return $(FRAMEWORK:D) ] ; + local framework-paths = [ on $(target) return $(FRAMEWORK:D) ] ; # Be sure to generate no -F if there's no path. - if $(framework-path) != "" + for local framework-path in $(framework-paths) { - FRAMEWORK_PATH on $(target) += -F$(framework-path) ; + if $(framework-path) != "" + { + FRAMEWORK_PATH on $(target) += -F$(framework-path) ; + } } } diff --git a/v2/tools/docutils.jam b/v2/tools/docutils.jam index 9055f8d53..bf0616174 100644 --- a/v2/tools/docutils.jam +++ b/v2/tools/docutils.jam @@ -44,9 +44,7 @@ generators.register-standard docutils.html : ReST : HTML ; 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) diff --git a/v2/tools/doxygen.jam b/v2/tools/doxygen.jam index a3e3a2561..0c6682958 100644 --- a/v2/tools/doxygen.jam +++ b/v2/tools/doxygen.jam @@ -36,6 +36,7 @@ import toolset : flags ; import alias ; import common ; import modules ; +import project ; # Use to specify extra configuration paramters. These get translated @@ -60,6 +61,9 @@ feature.feature doxygen.doxproc.id : : free ; # The title for the resulting BoostBook reference section. feature.feature doxygen.doxproc.title : : free ; +# Location for images when generating XML +feature.feature doxygen:xml-imagedir : : free ; + # Doxygen configuration input file. type.register DOXYFILE : doxyfile ; @@ -75,6 +79,7 @@ type.register DOXYGEN_HTML_MULTIFILE : html-dir : HTML ; # Redirection HTML file to HTML multifile directory. type.register DOXYGEN_HTML : : HTML ; +type.register DOXYGEN_XML_IMAGES : doxygen-xml-images ; # Initialize the Doxygen module. Parameters are: # name: the name of the 'doxygen' executable. If not specified, the name @@ -152,6 +157,8 @@ rule init ( name ? ) : DOXYFILE : DOXYGEN_HTML_MULTIFILE ; generators.register-standard doxygen.html-redirect : DOXYGEN_HTML_MULTIFILE : DOXYGEN_HTML ; + generators.register-standard doxygen.copy-latex-pngs + : DOXYGEN_HTML : DOXYGEN_XML_IMAGES ; IMPORT $(__name__) : doxygen : : doxygen ; } @@ -343,6 +350,129 @@ rule html-redirect ( target : source : properties * ) : true ; } +rule copy-latex-pngs ( target : source : requirements * ) +{ + local directory = [ path.native + [ feature.get-values : + $(requirements) ] ] ; + if [ os.name ] = NT + { + CP on $(target) = copy /y ; + MKDIR on $(target) = mkdir ; + FROM on $(target) = \\*.png ; + TOHTML on $(target) = .\\html\\$(directory) ; + TOPDF on $(target) = \\$(directory) ; + } + else + { + CP on $(target) = cp ; + MKDIR on $(target) = mkdir -p ; + FROM on $(target) = /*.png ; + TOHTML on $(target) = ./html/$(directory) ; + TOPDF on $(target) = $(target:D)/$(directory) ; + } +} + +actions copy-latex-pngs +{ + $(MKDIR) $(TOHTML) + $(MKDIR) $(<:D)$(TOPDF) + $(CP) $(>:S=)$(FROM) $(TOHTML) + $(CP) $(>:S=)$(FROM) $(<:D)$(TOPDF) + echo "Stamped" > "$(<)" +} + +# building latex images for doxygen XML depends +# on latex, dvips, and ps being in your PATH. +# This is true for most Unix installs, but +# not on Win32, where you will need to install +# MkTex and Ghostscript and add these tools +# to your path. + +actions check-latex +{ + latex -version >$(<) +} + +actions check-dvips +{ + dvips -version >$(<) +} + +if [ os.name ] = "NT" +{ + actions check-gs + { + gswin32c -version >$(<) + } +} +else +{ + actions check-gs + { + gs -version >$(<) + } +} + +rule check-tools ( ) +{ + if ! $(.check-tools-targets) + { + # Find the root project. + local root-project = [ project.current ] ; + root-project = [ $(root-project).project-module ] ; + while + [ project.attribute $(root-project) parent-module ] && + [ project.attribute $(root-project) parent-module ] != user-config + { + root-project = + [ project.attribute $(root-project) parent-module ] ; + } + + .latex.check = [ new file-target latex.check + : + : [ project.target $(root-project) ] + : [ new action : doxygen.check-latex ] + : + ] ; + .dvips.check = [ new file-target dvips.check + : + : [ project.target $(root-project) ] + : [ new action : doxygen.check-dvips ] + : + ] ; + .gs.check = [ new file-target gs.check + : + : [ project.target $(root-project) ] + : [ new action : doxygen.check-gs ] + : + ] ; + .check-tools-targets = $(.latex.check) $(.dvips.check) $(.gs.check) ; + } + return $(.check-tools-targets) ; +} + +project.initialize $(__name__) ; +project doxygen ; + +class doxygen-check-tools-target-class : basic-target +{ + import doxygen ; + rule construct ( name : sources * : property-set ) + { + return [ property-set.empty ] [ doxygen.check-tools ] ; + } +} + +local project = [ project.current ] ; + +targets.main-target-alternative + [ new doxygen-check-tools-target-class check-tools : $(project) + : [ targets.main-target-sources : check-tools : no-renaming ] + : [ targets.main-target-requirements : $(project) ] + : [ targets.main-target-default-build : $(project) ] + : [ targets.main-target-usage-requirements : $(project) ] + ] ; # User-level rule to generate BoostBook XML from a set of headers via Doxygen. # @@ -412,6 +542,43 @@ rule doxygen ( target : sources * : requirements * : default-build * : usage-req requirements = [ property.change $(requirements) : ] ; local target-xml = $(target:B=$(target:B)-xml) ; + # Check whether we need to build images + local images-location = + [ feature.get-values : $(requirements) ] ; + if $(images-location) + { + doxygen $(target).doxygen-xml-images.html : $(sources) + : $(requirements) + QUIET=YES + WARNINGS=NO + WARN_IF_UNDOCUMENTED=NO + /doxygen//check-tools ; + $(project).mark-target-as-explicit + $(target).doxygen-xml-images.html ; + + targets.main-target-alternative + [ new typed-target $(target).doxygen-xml-images + : $(project) : DOXYGEN_XML_IMAGES + : $(target).doxygen-xml-images.html + : [ targets.main-target-requirements $(requirements) + : $(project) ] + : [ targets.main-target-default-build $(default-build) + : $(project) ] + ] ; + + $(project).mark-target-as-explicit + $(target).doxygen-xml-images ; + + if ! [ regex.match "^(.*/)$" : $(images-location) ] + { + images-location = $(images-location)/ ; + } + + requirements += + $(target).doxygen-xml-images + boost.doxygen.formuladir=$(images-location) ; + } + ## The doxygen configuration file. targets.main-target-alternative [ new typed-target $(target-xml:S=.tag) : $(project) : DOXYFILE diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 21b265d8a..2e7c44414 100644 --- a/v2/tools/gcc.jam +++ b/v2/tools/gcc.jam @@ -25,6 +25,7 @@ import rc ; import regex ; import set ; import unix ; +import fortran ; if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] @@ -224,6 +225,7 @@ if [ os.name ] = NT generators.register-c-compiler gcc.compile.c++ : CPP : OBJ : gcc ; generators.register-c-compiler gcc.compile.c : C : OBJ : gcc ; generators.register-c-compiler gcc.compile.asm : ASM : OBJ : gcc ; +generators.register-fortran-compiler gcc.compile.fortran : FORTRAN FORTRAN90 : OBJ : gcc ; # pch support @@ -394,12 +396,19 @@ if [ os.name ] != NT && [ os.name ] != OSF && [ os.name ] != HPUX && [ os.name ] SONAME_OPTION = -h ; } +# HPUX, for some reason, seem to use '+h', not '-h'. +if [ os.name ] = HPUX +{ + HAVE_SONAME = "" ; + SONAME_OPTION = +h ; +} toolset.flags gcc.compile USER_OPTIONS ; toolset.flags gcc.compile.c++ USER_OPTIONS ; toolset.flags gcc.compile DEFINES ; toolset.flags gcc.compile INCLUDES ; toolset.flags gcc.compile.c++ TEMPLATE_DEPTH ; +toolset.flags gcc.compile.fortran USER_OPTIONS ; rule compile.c++.pch ( targets * : sources * : properties * ) { @@ -471,6 +480,10 @@ rule compile.c ( targets * : sources * : properties * ) DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } +rule compile.fortran +{ +} + actions compile.c++ bind PCH_FILE { "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<:W)" "$(>:W)" @@ -481,6 +494,11 @@ actions compile.c bind PCH_FILE "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } +actions compile.fortran +{ + "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<)" "$(>)" +} + rule compile.asm { LANG on $(<) = "-x assembler-with-cpp" ; @@ -676,7 +694,7 @@ rule init-link-flags ( toolset linker condition ) # as opposed to -s since icc (intel's compiler) is generally # option-compatible with and inherits from the gcc toolset, but does not # support -s. - toolset.flags $(toolset).link OPTIONS $(condition)/off : -Wl,--strip-all : unchecked ; + toolset.flags $(toolset).link OPTIONS $(condition)/on : -Wl,--strip-all : unchecked ; toolset.flags $(toolset).link RPATH $(condition) : : unchecked ; toolset.flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; toolset.flags $(toolset).link START-GROUP $(condition) : -Wl,--start-group : unchecked ; @@ -731,7 +749,7 @@ rule init-link-flags ( toolset linker condition ) case hpux : { - toolset.flags $(toolset).link OPTIONS $(condition)/off + toolset.flags $(toolset).link OPTIONS $(condition)/on : -Wl,-s : unchecked ; toolset.flags $(toolset).link OPTIONS $(condition)/shared : -fPIC : unchecked ; @@ -740,7 +758,7 @@ rule init-link-flags ( toolset linker condition ) case osf : { # No --strip-all, just -s. - toolset.flags $(toolset).link OPTIONS $(condition)/off + toolset.flags $(toolset).link OPTIONS $(condition)/on : -Wl,-s : unchecked ; toolset.flags $(toolset).link RPATH $(condition) : : unchecked ; @@ -752,7 +770,7 @@ rule init-link-flags ( toolset linker condition ) case sun : { - toolset.flags $(toolset).link OPTIONS $(condition)/off + toolset.flags $(toolset).link OPTIONS $(condition)/on : -Wl,-s : unchecked ; toolset.flags $(toolset).link RPATH $(condition) : : unchecked ; diff --git a/v2/tools/gfortran.jam b/v2/tools/gfortran.jam index bd7fe70a2..0aa69b85c 100644 --- a/v2/tools/gfortran.jam +++ b/v2/tools/gfortran.jam @@ -36,4 +36,4 @@ actions compile.fortran gcc -Wall $(OPTIONS) -D$(DEFINES) -I$(INCLUDES) -c -o "$(<)" "$(>)" } -generators.register-fortran-compiler gfortran.compile.fortran : FORTRAN : OBJ ; +generators.register-fortran-compiler gfortran.compile.fortran : FORTRAN FORTRAN90 : OBJ ; diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam index 97effd848..06e11fe03 100644 --- a/v2/tools/intel-linux.jam +++ b/v2/tools/intel-linux.jam @@ -32,7 +32,8 @@ type.set-generated-target-suffix PCH : intel li toolset.inherit-rules intel-linux : gcc ; toolset.inherit-flags intel-linux : gcc - : off on full space + : off on full + space speed off all on ; @@ -103,6 +104,7 @@ rule init ( version ? : command * : options * ) SPACE = " " ; flags intel-linux.compile OPTIONS space : "-O1" ; # no specific space optimization flag in icc +flags intel-linux.compile OPTIONS speed : "-O3 -ip" ; # no specific space optimization flag in icc flags intel-linux.compile OPTIONS off : -w0 ; flags intel-linux.compile OPTIONS on : -w1 ; @@ -147,7 +149,12 @@ rule compile.c++.pch ( targets * : sources * : properties * ) # actions compile.c++.pch { - rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" + rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" +} + +actions compile.fortran +{ + "ifort" -c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } rule compile.c.pch ( targets * : sources * : properties * ) @@ -159,7 +166,7 @@ rule compile.c.pch ( targets * : sources * : properties * ) actions compile.c.pch { - rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" + rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" } rule link ( targets * : sources * : properties * ) @@ -186,7 +193,7 @@ rule link.dll ( targets * : sources * : properties * ) # Differ from 'link' above only by -shared. actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) + "$(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) $(USER_OPTIONS) } diff --git a/v2/tools/mpi.jam b/v2/tools/mpi.jam index bad0615b8..38012474e 100644 --- a/v2/tools/mpi.jam +++ b/v2/tools/mpi.jam @@ -163,7 +163,20 @@ rule cmdline_to_features ( cmdline : unknown-features ? ) local add = [ add_feature $(prefix) $(name) $(cmdline) ] ; if $(add) { - result += $(add[1]) ; + + if $(add[1]) = pthread + { + # Uhm. It's not really nice that this MPI implementation + # uses -lpthread as opposed to -pthread. We do want to + # set multi, instead of -lpthread. + result += "multi" ; + MPI_EXTRA_REQUIREMENTS += "multi" ; + } + else + { + result += $(add[1]) ; + } + cmdline = $(add[2]) ; matched = yes ; } @@ -205,7 +218,7 @@ rule cmdline_to_features ( cmdline : unknown-features ? ) if $(otherflags) { for unknown in $(unknown-features) { - result += "$(unknown)$(otherflags)" ; + result += "$(unknown)$(otherflags:J= )" ; } } diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index fbc89d670..6bb0d6ff8 100644 --- a/v2/tools/msvc.jam +++ b/v2/tools/msvc.jam @@ -378,7 +378,7 @@ rule compile-c-c++ ( targets + : sources * ) # syntax highlighting in the messy N-quoted code below. actions compile-c-c++-pch { - $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote))" $(.CC.FILTER) + $(.CC) @"@($(<[1]:W).rsp:E="$(>[2]:W)" -Fo"$(<[2]:W)" -Yc"$(>[1]:D=)" $(YLOPTION)"__bjam_pch_symbol_$(>[1]:D=)" -Fp"$(<[1]:W)" $(CC_RSPLINE))" "@($(<[1]:W).cpp:E=#include $(.escaped-double-quote)$(>[1]:D=)$(.escaped-double-quote)$(.nl))" $(.CC.FILTER) } @@ -1322,7 +1322,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] # Known toolset versions, in order of preference. -.known-versions = 10.0 9.0 9.0express 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ; +.known-versions = 10.0 10.0express 9.0 9.0express 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ; # Version aliases. .version-alias-6 = 6.0 ; @@ -1342,6 +1342,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .version-9.0-reg = "VisualStudio\\9.0\\Setup\\VC" ; .version-9.0express-reg = "VCExpress\\9.0\\Setup\\VC" ; .version-10.0-reg = "VisualStudio\\10.0\\Setup\\VC" ; +.version-10.0express-reg = "VCExpress\\10.0\\Setup\\VC" ; # Visual C++ Toolkit 2003 does not store its installation path in the registry. # The environment variable 'VCToolkitInstallDir' and the default installation diff --git a/v2/tools/pathscale.jam b/v2/tools/pathscale.jam index 1a81444e1..f1dd149a7 100644 --- a/v2/tools/pathscale.jam +++ b/v2/tools/pathscale.jam @@ -30,13 +30,13 @@ rule init ( version ? : command * : options * ) toolset.flags pathscale.compile.fortran90 OPTIONS $(condition) : [ feature.get-values : $(options) ] : unchecked ; - command_c = $(command_c[1--2]) $(command[-1]:B=pathCC) ; + command_c = $(command_c[1--2]) $(command[-1]:B=pathcc) ; toolset.flags pathscale CONFIG_C_COMMAND $(condition) : $(command_c) ; # fortran support local f-command = [ common.get-invocation-command pathscale : pathf90 : $(command) ] ; - local command_f = $(command_f[1--2]) $(f-command[-1]:B=pathf77) ; + local command_f = $(command_f[1--2]) $(f-command[-1]:B=pathf90) ; local command_f90 = $(command_f[1--2]) $(f-command[-1]:B=pathf90) ; toolset.flags pathscale CONFIG_F_COMMAND $(condition) : $(command_f) ; @@ -87,7 +87,7 @@ actions compile.c++ actions compile.fortran { - "$(CONFIG_F_COMMAND)" -f77 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } rule compile.fortran90 ( targets * : sources * : properties * ) diff --git a/v2/tools/pgi.jam b/v2/tools/pgi.jam index ca220235e..752dc5539 100644 --- a/v2/tools/pgi.jam +++ b/v2/tools/pgi.jam @@ -58,7 +58,7 @@ generators.register-fortran-compiler pgi.compile.fortran : FORTRAN : OBJ : shared : -fpic ; -flags pgi.compile OPTIONS on : -g ; +flags pgi.compile OPTIONS on : -gopt ; flags pgi.compile OPTIONS on : -xprofile=tcov ; flags pgi.compile OPTIONS speed : -fast -Mx,8,0x10000000 ; flags pgi.compile OPTIONS space : -xO2 -xspace ; @@ -92,7 +92,7 @@ actions compile.fortran } # Declare flags and actions for linking -flags pgi.link OPTIONS on : -g ; +flags pgi.link OPTIONS on : -gopt ; # Strip the binary when no debugging is needed flags pgi.link OPTIONS off : -s ; flags pgi.link OPTIONS on : -xprofile=tcov ; diff --git a/v2/tools/quickbook.jam b/v2/tools/quickbook.jam index 38d93d9c5..f4874b292 100644 --- a/v2/tools/quickbook.jam +++ b/v2/tools/quickbook.jam @@ -256,9 +256,9 @@ class qbk-scanner : common-scanner { rule pattern ( ) { - return "\\[[ \t]*include[ \t]+([^]]+)\\]" - "\\[[ \t]*include:[a-zA-Z0-9_]+[ \t]+([^]]+)\\]" - "\\[[ \t]*import[ \t]+([^]]+)\\]" ; + return "\\[[ ]*include[ ]+([^]]+)\\]" + "\\[[ ]*include:[a-zA-Z0-9_]+[ ]+([^]]+)\\]" + "\\[[ ]*import[ ]+([^]]+)\\]" ; } } diff --git a/v2/tools/stage.jam b/v2/tools/stage.jam index fcbcd5acc..4c998ff93 100644 --- a/v2/tools/stage.jam +++ b/v2/tools/stage.jam @@ -354,16 +354,36 @@ class installed-exe-generator : generator rule run ( project name ? : property-set : source : multiple ? ) { + local need-relink ; + if [ $(property-set).get ] in NT CYGWIN || [ $(property-set).get ] in windows cygwin { - # Relinking is never needed on NT. - return [ stage.copy-file $(project) + } + else + { + # See if the dll-path properties are not changed during + # install. If so, copy, don't relink. + local a = [ $(source).action ] ; + local p = [ $(a).properties ] ; + local original = [ $(p).get ] ; + local current = [ $(property-set).get ] ; + + if $(current) != $(original) + { + need-relink = true ; + } + } + + + if $(need-relink) + { + return [ stage.relink-file $(project) : $(source) : $(property-set) ] ; } else { - return [ stage.relink-file $(project) + return [ stage.copy-file $(project) : $(source) : $(property-set) ] ; } } diff --git a/v2/tools/types/lib.jam b/v2/tools/types/lib.jam index 345385f85..2810f9436 100644 --- a/v2/tools/types/lib.jam +++ b/v2/tools/types/lib.jam @@ -16,6 +16,7 @@ type.set-generated-target-prefix LIB : cygwin : "cyg" ; type.register STATIC_LIB : a lib : LIB ; type.set-generated-target-suffix STATIC_LIB : windows : lib ; +type.set-generated-target-suffix STATIC_LIB : gcc windows : a ; type.set-generated-target-suffix STATIC_LIB : cygwin : lib ; type.set-generated-target-prefix STATIC_LIB : : lib ; diff --git a/v2/tools/vacpp.jam b/v2/tools/vacpp.jam index a3ab61c6c..f4080fc04 100644 --- a/v2/tools/vacpp.jam +++ b/v2/tools/vacpp.jam @@ -27,7 +27,7 @@ rule init ( version ? : command * : options * ) command = [ common.get-invocation-command vacpp : xlC : $(command) : "/usr/vacpp/bin/xlC" ] ; - + common.handle-options vacpp : $(condition) : $(command) : $(options) ; } @@ -92,7 +92,7 @@ if [ os.name ] = AIX else { # Linux PPC - flags vacpp.compile CFLAGS shared : -qpic ; + flags vacpp.compile CFLAGS shared : -qpic=large ; flags vacpp FINDLIBS : rt ; } @@ -100,13 +100,13 @@ else flags vacpp CFLAGS on : -pg ; flags vacpp LINKFLAGS on : -pg ; -flags vacpp CFLAGS ; -flags vacpp C++FLAGS ; +flags vacpp.compile OPTIONS ; +flags vacpp.compile.c++ OPTIONS ; flags vacpp DEFINES ; flags vacpp UNDEFS ; flags vacpp HDRS ; flags vacpp STDHDRS ; -flags vacpp LINKFLAGS ; +flags vacpp.link OPTIONS ; flags vacpp ARFLAGS ; flags vacpp LIBPATH ; @@ -120,25 +120,28 @@ flags vacpp VA_C_COMPILER multi : xlc_r ; flags vacpp VA_CXX_COMPILER single : xlC ; flags vacpp VA_CXX_COMPILER multi : xlC_r ; +SPACE = " " ; + +flags vacpp.link.dll HAVE_SONAME linux : "" ; actions vacpp.link bind NEEDLIBS { - $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) + $(VA_CXX_COMPILER) $(EXE-LINKFLAGS) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) } actions vacpp.link.dll bind NEEDLIBS { - xlC_r -G $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) + xlC_r -G $(LINKFLAGS) -o "$(<[1])" $(HAVE_SONAME)-Wl,-soname$(SPACE)-Wl,$(<[-1]:D=) -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) $(OPTIONS) $(USER_OPTIONS) } actions vacpp.compile.c { - $(VA_C_COMPILER) -c -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" + $(VA_C_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" } actions vacpp.compile.c++ { - $(VA_CXX_COMPILER) -c -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" + $(VA_CXX_COMPILER) -c $(OPTIONS) $(USER_OPTIONS) -I$(BOOST_ROOT) -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)" } actions updated together piecemeal vacpp.archive