From eff20dcde4c6ad2a57adc844b4bd84a768044879 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 11 Jul 2009 11:04:31 +0000 Subject: [PATCH] Wholesale merge from trunk. [SVN r54880] --- v2/build/generators.jam | 24 +++++++++++-- v2/build/targets.jam | 2 +- v2/doc/src/advanced.xml | 39 +++++++++++++++------ v2/tools/borland.jam | 8 ++--- v2/tools/builtin.jam | 9 ++++- v2/tools/common.jam | 76 +++++++++++++++++++++++++++------------- v2/tools/convert.jam | 62 ++++++++++++++++++++++++++++++++ v2/tools/gcc.jam | 73 +++++++++++++++++++++++++++++++++----- v2/tools/intel-linux.jam | 6 ++++ v2/tools/msvc.jam | 22 +++++++++--- v2/tools/package.jam | 25 +++++++++++-- v2/tools/python.jam | 4 +-- v2/tools/sun.jam | 4 +++ v2/tools/types/lib.jam | 2 +- 14 files changed, 292 insertions(+), 64 deletions(-) create mode 100644 v2/tools/convert.jam diff --git a/v2/build/generators.jam b/v2/build/generators.jam index 2d5531277..d086bb006 100644 --- a/v2/build/generators.jam +++ b/v2/build/generators.jam @@ -1215,6 +1215,10 @@ rule find-viable-generators ( target-type : property-set ) { viable-generators += $(g) ; } + else + { + generators.dout [ indent ] " generator " [ $(g).id ] "is active, discaring" ; + } } # Generators which override 'all'. @@ -1320,8 +1324,20 @@ local rule construct-really ( project name ? : target-type : property-set : # 'construct' in stack, returns only targets of requested 'target-type', # otherwise, returns also unused sources and additionally generated targets. # -rule construct ( project name ? : target-type : property-set * : sources * ) +# If 'top-level' is set, does not suppress generators that are already +# used in the stack. This may be useful in cases where a generator +# has to build a metatargets -- for example a target corresponding to +# built tool. +# +rule construct ( project name ? : target-type : property-set * : sources * : top-level ? ) { + local saved-stack ; + if $(top-level) + { + saved-active = $(.active-generators) ; + .active-generators = ; + } + if (.construct-stack) { ensure-type $(sources) ; @@ -1348,11 +1364,15 @@ rule construct ( project name ? : target-type : property-set * : sources * ) decrease-indent ; .construct-stack = $(.construct-stack[2-]) ; + + if $(top-level) + { + .active-generators = $(saved-active) ; + } return $(result) ; } - # Given 'result', obtained from some generator or generators.construct, adds # 'raw-properties' as usage requirements to it. If result already contains usage # requirements -- that is the first element of result of an instance of the diff --git a/v2/build/targets.jam b/v2/build/targets.jam index a7aa2c008..f924a20e6 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -1434,7 +1434,7 @@ class typed-target : basic-target local r = [ generators.construct $(self.project) $(name:S=) : $(self.type) : [ property-set.create [ $(property-set).raw ] $(self.type) ] - : $(source-targets) ] ; + : $(source-targets) : true ] ; if ! $(r) { ECHO "warn: Unable to construct" [ full-name ] ; diff --git a/v2/doc/src/advanced.xml b/v2/doc/src/advanced.xml index 2a30bc8ff..3350c273d 100644 --- a/v2/doc/src/advanced.xml +++ b/v2/doc/src/advanced.xml @@ -736,6 +736,17 @@ bjam toolset=gcc variant=debug optimization=space Cause the produced binaries to be thread-safe. This requires proper support in the source code itself. + + address-model + + 32,64 + + Explicitly request either 32-bit or 64-bit code generation. This typically + requires that your compiler is appropriately configured. Please refer to + and your compiler documentation + in case of problems. + + toolset @@ -744,6 +755,22 @@ bjam toolset=gcc variant=debug optimization=space The C++ compiler to use. See for a detailed list. + + include + + (Arbitrary string) + + Additional include paths for C and C++ compilers. + + + + define + + (Arbitrary string) + + Additional macro definitions for C and C++ compilers. + + cxxflags @@ -761,19 +788,11 @@ bjam toolset=gcc variant=debug optimization=space - includes + linkflags (Arbitrary string) - Additional include paths for C and C++ compilers. - - - - define - - (Arbitrary string) - - Additional macro definitions for C and C++ compilers. + Custom options to pass to the C++ linker. diff --git a/v2/tools/borland.jam b/v2/tools/borland.jam index 77bd69d4a..c9bf01acc 100644 --- a/v2/tools/borland.jam +++ b/v2/tools/borland.jam @@ -108,10 +108,6 @@ flags borland NEED_IMPLIB LIB/shared : "" ; # -q no banner # -c compile to object # -P C++ code regardless of file extention -# -Ve zero sized empty base classes, this option is on in the IDE by default -# and effects binary compatibility. -# -Vx zero sized empty members, this option is on in the IDE by default -# and effects binary compatibility. # -a8 8 byte alignment, this option is on in the IDE by default # and effects binary compatibility. # @@ -121,13 +117,13 @@ flags borland NEED_IMPLIB LIB/shared : "" ; actions compile.c++ { - "$(CONFIG_COMMAND)" -j5 -g255 -q -c -P -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)" + "$(CONFIG_COMMAND)" -j5 -g255 -q -c -P -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)" } # For C, we don't pass -P flag actions compile.c { - "$(CONFIG_COMMAND)" -j5 -g255 -q -c -Ve -Vx -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)" + "$(CONFIG_COMMAND)" -j5 -g255 -q -c -a8 -b- $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -I"$(STDHDRS)" -o"$(<)" "$(>)" } diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index d55f676b2..02f2c3f9c 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -30,6 +30,7 @@ import types/register ; import utility ; import virtual-target ; import message ; +import convert ; # FIXME: the following generate module import is not needed here but removing it # too hastly will break using code (e.g. the main Boost library Jamroot file) @@ -38,7 +39,13 @@ import generate ; .os-names = aix bsd cygwin darwin freebsd hpux iphone linux netbsd - openbsd osf qnx qnxnto sgi solaris unix unixware windows ; + openbsd osf qnx qnxnto sgi solaris unix unixware windows + elf # Not actually an OS -- used for targeting bare metal where + # object format is ELF. This catches both -elf and -eabi gcc + # targets and well as other compilers targeting ELF. It is not + # clear how often do we need to key of ELF specifically as opposed + # to other bare metal targets, but let's stick with gcc naming. + ; # Feature used to determine which OS we're on. New and # features should be used instead. diff --git a/v2/tools/common.jam b/v2/tools/common.jam index 20f52d52e..feacfa46c 100644 --- a/v2/tools/common.jam +++ b/v2/tools/common.jam @@ -501,10 +501,12 @@ if "\n" = "n" # see below. nl = " " ; + q = "" ; } else { nl = "\n" ; + q = "\"" ; } # Returns the command needed to set an environment variable on the current @@ -526,7 +528,7 @@ rule variable-setting-command ( variable : value ) # sequence that messes up the executed export command which then reports # that the passed variable name is incorrect. # But we have a check for cygwin in kernel/bootstrap.jam already. - return "$(variable)=$(value)$(nl)export $(variable)$(nl)" ; + return "$(variable)=$(q)$(value)$(q)$(nl)export $(variable)$(nl)" ; } } @@ -751,37 +753,42 @@ actions hard-link # rule format-name ( format * : name : type ? : property-set ) { - if [ type.is-derived $(type) LIB ] + local result = "" ; + for local f in $(format) { - local result = "" ; - for local f in $(format) + switch $(f:G) { - switch $(f:G) - { - case : + case : result += $(name:B) ; - - case : + + case : result += [ join-tag $(f:G=) : [ toolset-tag $(name) : $(type) : - $(property-set) ] ] ; - - case : + $(property-set) ] ] ; + + case : result += [ join-tag $(f:G=) : [ threading-tag $(name) : $(type) - : $(property-set) ] ] ; - - case : + : $(property-set) ] ] ; + + case : result += [ join-tag $(f:G=) : [ runtime-tag $(name) : $(type) : - $(property-set) ] ] ; + $(property-set) ] ] ; + + case : + result += [ join-tag $(f:G=) : [ qt-tag $(name) : $(type) : + $(property-set) ] ] ; - case : + case : + result += [ join-tag $(f:G=) : [ address-model-tag $(name) : $(type) : + $(property-set) ] ] ; + + case : local key = [ MATCH : $(f:G) ] ; local version = [ $(property-set).get <$(key)> ] ; version ?= $(key) ; - version = [ MATCH "^([^.]+)[.]([^.]+)[.]?([^.]*)" : $(version) ] - ; + version = [ MATCH "^([^.]+)[.]([^.]+)[.]?([^.]*)" : $(version) ] ; result += [ join-tag $(f:G=) : $(version[1])_$(version[2]) ] ; - case : + case : local key = [ MATCH : $(f:G) ] ; local p0 = [ MATCH <($(key))> : [ $(property-set).raw ] ] ; if $(p0) @@ -793,14 +800,13 @@ rule format-name ( format * : name : type ? : property-set ) } } - case * : + case * : result += $(f:G=) ; - } } - result = [ virtual-target.add-prefix-and-suffix $(result:J=) : $(type) : - $(property-set) ] ; - return $(result) ; } + result = [ virtual-target.add-prefix-and-suffix $(result:J=) : $(type) : + $(property-set) ] ; + return $(result) ; } @@ -846,6 +852,7 @@ local rule toolset-tag ( name : type ? : property-set ) #case mingw* : tag += mgw ; case mipspro* : tag += mp ; case msvc* : tag += vc ; + case qcc* : tag += qcc ; case sun* : tag += sw ; case tru64cxx* : tag += tru ; case vacpp* : tag += xlc ; @@ -922,6 +929,25 @@ local rule runtime-tag ( name : type ? : property-set ) return $(tag:J=) ; } +# Create a tag for the Qt library version +# "4.6.0" will result in tag "qt460" +local rule qt-tag ( name : type ? : property-set ) +{ + local properties = [ $(property-set).get ] ; + local version = [ MATCH "([0123456789]+)[.]?([0123456789]*)[.]?([0123456789]*)" + : $(properties) ] ; + local tag = "qt"$(version:J=) ; + return $(tag) ; +} + +# Create a tag for the address-model +# 64 will simply generate "64" +local rule address-model-tag ( name : type ? : property-set ) +{ + local tag = ; + local version = [ $(property-set).get ] ; + return $(version) ; +} rule __test__ ( ) { diff --git a/v2/tools/convert.jam b/v2/tools/convert.jam new file mode 100644 index 000000000..ac1d70101 --- /dev/null +++ b/v2/tools/convert.jam @@ -0,0 +1,62 @@ +# Copyright (c) 2009 Vladimir Prus +# +# Use, modification and distribution is subject to the Boost Software +# License Version 1.0. (See accompanying file LICENSE_1_0.txt or +# http://www.boost.org/LICENSE_1_0.txt) + +# Implements 'convert' target that takes a bunch of source and +# tries to convert each one to the specified type. +# +# For example: +# +# convert objects obj : a.cpp b.cpp ; +# + +import targets ; +import generators ; +import project ; +import type ; +import "class" : new ; + +class convert-target-class : typed-target +{ + rule __init__ ( name : project : type + : sources * : requirements * : default-build * : usage-requirements * ) + { + typed-target.__init__ $(name) : $(project) : $(type) + : $(sources) : $(requirements) : $(default-build) : $(usage-requirements) ; + } + + rule construct ( name : source-targets * : property-set ) + { + local r = [ generators.construct $(self.project) : $(self.type) + : [ property-set.create [ $(property-set).raw ] # [ feature.expand + $(self.type) ] + # ] + : $(source-targets) ] ; + if ! $(r) + { + errors.error "unable to construct" [ full-name ] ; + } + + return $(r) ; + } + +} + +rule convert ( name type : sources * : requirements * : default-build * + : usage-requirements * ) +{ + local project = [ project.current ] ; + + # This is a circular module dependency, so it must be imported here + modules.import targets ; + targets.main-target-alternative + [ new convert-target-class $(name) : $(project) : [ type.type-from-rule-name $(type) ] + : [ 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) ] + ] ; +} +IMPORT $(__name__) : convert : : convert ; diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 41cb58f86..78d961acf 100644 --- a/v2/tools/gcc.jam +++ b/v2/tools/gcc.jam @@ -349,6 +349,40 @@ rule setup-fpic ( targets * : sources * : properties * ) } } +rule setup-address-model ( targets * : sources * : properties * ) +{ + local model = [ feature.get-values address-model : $(properties) ] ; + if $(model) + { + local option ; + local os = [ feature.get-values target-os : $(properties) ] ; + if $(os) = aix + { + if $(model) = 32 + { + option = -maix32 ; + } + else + { + option = -maix64 ; + } + } + else + { + if $(model) = 32 + { + option = -m32 ; + } + else + { + option = -m64 ; + } + } + OPTIONS on $(targets) += $(option) ; + } +} + + # FIXME: this should not use os.name. if [ os.name ] != NT && [ os.name ] != OSF && [ os.name ] != HPUX && [ os.name ] != AIX { @@ -369,6 +403,7 @@ rule compile.c++.pch ( targets * : sources * : properties * ) { setup-threading $(targets) : $(sources) : $(properties) ; setup-fpic $(targets) : $(sources) : $(properties) ; + setup-address-model $(targets) : $(sources) : $(properties) ; } actions compile.c++.pch @@ -380,6 +415,7 @@ rule compile.c.pch ( targets * : sources * : properties * ) { setup-threading $(targets) : $(sources) : $(properties) ; setup-fpic $(targets) : $(sources) : $(properties) ; + setup-address-model $(targets) : $(sources) : $(properties) ; } actions compile.c.pch @@ -391,6 +427,7 @@ rule compile.c++ ( targets * : sources * : properties * ) { setup-threading $(targets) : $(sources) : $(properties) ; setup-fpic $(targets) : $(sources) : $(properties) ; + setup-address-model $(targets) : $(sources) : $(properties) ; # Some extensions are compiled as C++ by default. For others, we need to # pass -x c++. We could always pass -x c++ but distcc does not work with it. @@ -420,6 +457,7 @@ rule compile.c ( targets * : sources * : properties * ) { setup-threading $(targets) : $(sources) : $(properties) ; setup-fpic $(targets) : $(sources) : $(properties) ; + setup-address-model $(targets) : $(sources) : $(properties) ; # If we use the name g++ then default file suffix -> language mapping does # not work. So have to pass -x option. Maybe, we can work around this by @@ -542,6 +580,28 @@ generators.register generators.override gcc.mingw.link : gcc.link ; generators.override gcc.mingw.link.dll : gcc.link.dll ; +# Cygwin is similar to msvc and mingw in that it uses import libraries. +# While in simple cases, it can directly link to a shared library, +# it is believed to be slower, and not always possible. Define cygwin-specific +# generators here. + +g = [ new gcc-linking-generator gcc.cygwin.link + : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB + : EXE + : gcc cygwin ] ; +$(g).set-rule-name gcc.link ; +generators.register $(g) ; + +g = [ new gcc-linking-generator gcc.cygwin.link.dll + : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB + : IMPORT_LIB SHARED_LIB + : gcc cygwin ] ; +$(g).set-rule-name gcc.link.dll ; +generators.register $(g) ; + +generators.override gcc.cygwin.link : gcc.link ; +generators.override gcc.cygwin.link.dll : gcc.link.dll ; + # Declare flags for linking. # First, the common flags. toolset.flags gcc.link OPTIONS on : -g ; @@ -553,6 +613,7 @@ toolset.flags gcc.link FINDLIBS-SA ; toolset.flags gcc.link LIBRARIES ; toolset.flags gcc.link.dll .IMPLIB-COMMAND windows : "-Wl,--out-implib," ; +toolset.flags gcc.link.dll .IMPLIB-COMMAND cygwin : "-Wl,--out-implib," ; # For static we made sure there are no dynamic libraries in the # link. On HP-UX not all system libraries exist as archived libraries (for @@ -722,6 +783,7 @@ rule init-link-flags ( toolset linker condition ) rule link ( targets * : sources * : properties * ) { setup-threading $(targets) : $(sources) : $(properties) ; + setup-address-model $(targets) : $(sources) : $(properties) ; SPACE on $(targets) = " " ; # Serialize execution of the 'link' action, since running N links in # parallel is just slower. For now, serialize only gcc links, it might be a @@ -786,6 +848,7 @@ actions piecemeal archive rule link.dll ( targets * : sources * : properties * ) { setup-threading $(targets) : $(sources) : $(properties) ; + setup-address-model $(targets) : $(sources) : $(properties) ; SPACE on $(targets) = " " ; JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; } @@ -873,8 +936,6 @@ local rule cpu-flags ( toolset variable : architecture : instruction-set + : val # Set architecture/instruction-set options. # # x86 and compatible -toolset.flags gcc OPTIONS x86/32 : -m32 ; -toolset.flags gcc OPTIONS x86/64 : -m64 ; cpu-flags gcc OPTIONS : x86 : i386 : -march=i386 : default ; cpu-flags gcc OPTIONS : x86 : i486 : -march=i486 ; cpu-flags gcc OPTIONS : x86 : i586 : -march=i586 ; @@ -908,8 +969,6 @@ cpu-flags gcc OPTIONS : x86 : winchip2 : -march=winchip2 ; cpu-flags gcc OPTIONS : x86 : c3 : -march=c3 ; cpu-flags gcc OPTIONS : x86 : c3-2 : -march=c3-2 ; # Sparc -toolset.flags gcc OPTIONS sparc/32 : -m32 ; -toolset.flags gcc OPTIONS sparc/64 : -m64 ; cpu-flags gcc OPTIONS : sparc : c3 : -mcpu=c3 : default ; cpu-flags gcc OPTIONS : sparc : v7 : -mcpu=v7 ; cpu-flags gcc OPTIONS : sparc : cypress : -mcpu=cypress ; @@ -926,8 +985,6 @@ cpu-flags gcc OPTIONS : sparc : v9 : -mcpu=v9 ; cpu-flags gcc OPTIONS : sparc : ultrasparc : -mcpu=ultrasparc ; cpu-flags gcc OPTIONS : sparc : ultrasparc3 : -mcpu=ultrasparc3 ; # RS/6000 & PowerPC -toolset.flags gcc OPTIONS power/32 : -m32 ; -toolset.flags gcc OPTIONS power/64 : -m64 ; cpu-flags gcc OPTIONS : power : 403 : -mcpu=403 ; cpu-flags gcc OPTIONS : power : 505 : -mcpu=505 ; cpu-flags gcc OPTIONS : power : 601 : -mcpu=601 ; @@ -961,6 +1018,4 @@ cpu-flags gcc OPTIONS : power : rios2 : -mcpu=rios2 ; cpu-flags gcc OPTIONS : power : rsc : -mcpu=rsc ; cpu-flags gcc OPTIONS : power : rs64a : -mcpu=rs64 ; # AIX variant of RS/6000 & PowerPC -toolset.flags gcc OPTIONS power/32/aix : -maix32 ; -toolset.flags gcc OPTIONS power/64/aix : -maix64 ; -toolset.flags gcc AROPTIONS power/64/aix : "-X 64" ; +toolset.flags gcc AROPTIONS 64/aix : "-X 64" ; diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam index de5bf8c7c..82c498c3a 100644 --- a/v2/tools/intel-linux.jam +++ b/v2/tools/intel-linux.jam @@ -112,6 +112,7 @@ rule compile.c++ ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + gcc.setup-address-model $(targets) : $(sources) : $(properties) ; DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } @@ -124,6 +125,7 @@ rule compile.c ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + gcc.setup-address-model $(targets) : $(sources) : $(properties) ; DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } @@ -136,6 +138,7 @@ rule compile.c++.pch ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + gcc.setup-address-model $(targets) : $(sources) : $(properties) ; } # # Compiling a pch first deletes any existing *.pchi file, as Intel's compiler @@ -151,6 +154,7 @@ rule compile.c.pch ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + gcc.setup-address-model $(targets) : $(sources) : $(properties) ; } actions compile.c.pch @@ -161,6 +165,7 @@ actions compile.c.pch rule link ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; + gcc.setup-address-model $(targets) : $(sources) : $(properties) ; SPACE on $(targets) = " " ; JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; } @@ -173,6 +178,7 @@ actions link bind LIBRARIES rule link.dll ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; + gcc.setup-address-model $(targets) : $(sources) : $(properties) ; SPACE on $(targets) = " " ; JAM_SEMAPHORE on $(targets) = gcc-link-semaphore ; } diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index 372757e8e..fac62b978 100644 --- a/v2/tools/msvc.jam +++ b/v2/tools/msvc.jam @@ -254,6 +254,11 @@ rule configure-version-specific ( toolset : version : conditions ) # 8.0 and above only has multi-threaded static RTL. toolset.flags $(toolset).compile CFLAGS $(conditions)/off/static/single : /MT ; toolset.flags $(toolset).compile CFLAGS $(conditions)/on/static/single : /MTd ; + + # Specify target machine type so the linker will not need to guess. + toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-amd64) : /MACHINE:X64 ; + toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-i386) : /MACHINE:X86 ; + toolset.flags $(toolset).link LINKFLAGS $(conditions)/$(.cpu-arch-ia64) : /MACHINE:IA64 ; } toolset.pop-checking-for-flags-module ; } @@ -677,11 +682,15 @@ local rule configure-really ( version ? : options * ) # version from the path. # FIXME: We currently detect both Microsoft Visual Studio 9.0 and # 9.0express as 9.0 here. - if [ MATCH "(Microsoft Visual Studio 9)" : $(command) ] + if [ MATCH "(Microsoft Visual Studio 10)" : $(command) ] + { + version = 10.0 ; + } + else if [ MATCH "(Microsoft Visual Studio 9)" : $(command) ] { version = 9.0 ; } - if [ MATCH "(Microsoft Visual Studio 8)" : $(command) ] + else if [ MATCH "(Microsoft Visual Studio 8)" : $(command) ] { version = 8.0 ; } @@ -729,7 +738,10 @@ local rule configure-really ( version ? : options * ) # MSVC 7.1 compiler even though it thinks it is using the msvc-9.0 # toolset version. command = [ common.get-absolute-tool-path $(command[-1]) ] ; - + } + + if $(command) + { local parent = [ path.make $(command) ] ; parent = [ path.parent $(parent) ] ; parent = [ path.native $(parent) ] ; @@ -1263,7 +1275,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] # Known toolset versions, in order of preference. -.known-versions = 9.0 9.0express 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ; +.known-versions = 10.0 9.0 9.0express 8.0 8.0express 7.1 7.1toolkit 7.0 6.0 ; # Version aliases. .version-alias-6 = 6.0 ; @@ -1271,6 +1283,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .version-alias-7 = 7.0 ; .version-alias-8 = 8.0 ; .version-alias-9 = 9.0 ; +.version-alias-10 = 10.0 ; # Names of registry keys containing the Visual C++ installation path (relative # to "HKEY_LOCAL_MACHINE\SOFTWARE\\Microsoft"). @@ -1281,6 +1294,7 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] .version-8.0express-reg = "VCExpress\\8.0\\Setup\\VC" ; .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" ; # 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/package.jam b/v2/tools/package.jam index 25dd02565..e2bda20f9 100644 --- a/v2/tools/package.jam +++ b/v2/tools/package.jam @@ -83,8 +83,26 @@ rule install ( name : requirements * : binaries * : libraries * : headers * ) stage.install $(name)-bin : $(binaries) : $(requirements) $(bin-locate) ; - stage.install $(name)-lib : $(binaries) $(libraries) : $(requirements) - $(lib-locate) on LIB ; + alias $(name)-lib : $(name)-lib-shared $(name)-lib-static ; + + # Since the install location of shared libraries differs on universe + # and cygwin, use target alternatives to make different targets. + # We should have used indirection conditioanl requirements, but it's + # awkward to pass bin-locate and lib-locate from there to another rule. + alias $(name)-lib-shared : $(name)-lib-shared-universe ; + alias $(name)-lib-shared : $(name)-lib-shared-cygwin : cygwin ; + + # For shared libraries, we install both explicitly specified one and the + # shared libraries that the installed executables depend on. + stage.install $(name)-lib-shared-universe : $(binaries) $(libraries) : $(requirements) + $(lib-locate) on SHARED_LIB ; + stage.install $(name)-lib-shared-cygwin : $(binaries) $(libraries) : $(requirements) + $(bin-locate) on SHARED_LIB ; + + # For static libraries, we do not care about executable dependencies, since + # static libraries are already incorporated into them. + stage.install $(name)-lib-static : $(libraries) : $(requirements) + $(lib-locate) on STATIC_LIB ; stage.install $(name)-headers : $(headers) : $(requirements) $(include-locate)$(install-header-subdir) $(install-source-root) ; @@ -94,6 +112,7 @@ rule install ( name : requirements * : binaries * : libraries * : headers * ) local project-module = [ $(c).project-module ] ; module $(project-module) { - explicit $(1)-bin $(1)-lib $(1)-headers $(1) ; + explicit $(1)-bin $(1)-lib $(1)-headers $(1) $(1)-lib-shared $(1)-lib-static + $(1)-lib-shared-universe $(1)-lib-shared-cygwin ; } } diff --git a/v2/tools/python.jam b/v2/tools/python.jam index 498a2ad89..9e05c03ac 100644 --- a/v2/tools/python.jam +++ b/v2/tools/python.jam @@ -91,8 +91,8 @@ feature.feature pythonpath : : free optional path ; # # Example usage: # -# using python 2.3 ; -# using python 2.3 : /usr/local/bin/python ; +# using python : 2.3 ; +# using python : 2.3 : /usr/local/bin/python ; # rule init ( version ? : cmd-or-prefix ? : includes * : libraries ? : condition * : extension-suffix ? ) diff --git a/v2/tools/sun.jam b/v2/tools/sun.jam index 8f10d6a44..0ca927d3e 100644 --- a/v2/tools/sun.jam +++ b/v2/tools/sun.jam @@ -52,6 +52,10 @@ flags sun.compile OPTIONS on : -xprofile=tcov ; flags sun.compile OPTIONS speed : -xO4 ; flags sun.compile OPTIONS space : -xO2 -xspace ; flags sun.compile OPTIONS multi : -mt ; +flags sun.compile OPTIONS off : -erroff ; +flags sun.compile OPTIONS on : -erroff=%none ; +flags sun.compile OPTIONS all : -erroff=%none ; +flags sun.compile OPTIONS on : -errwarn ; flags sun.compile.c++ OPTIONS off : +d ; diff --git a/v2/tools/types/lib.jam b/v2/tools/types/lib.jam index c343b788a..345385f85 100644 --- a/v2/tools/types/lib.jam +++ b/v2/tools/types/lib.jam @@ -9,7 +9,7 @@ type.register LIB ; type.set-generated-target-prefix LIB : : "lib" ; type.set-generated-target-prefix LIB : windows : "" ; -type.set-generated-target-prefix LIB : cygwin : "" ; +type.set-generated-target-prefix LIB : cygwin : "cyg" ; # FIXME: should not register both extensions on both # platforms.