Boost logo

Boost-Build :

From: Alexey Pakhunov (alexeypa_at_[hidden])
Date: 2005-09-21 15:27:33


Alexey Pakhunov wrote:
> The attached patch (msvc.diff) implements items 5 and 6 from the list

Just found an error in the patch:

# take the first detected version
version = $($(.versions).all[1]) ;

Should be:

# take the first detected version
version = [ $(.versions).all ] ;
version = $(version[1]) ;

I attached fixed version.

Best regards/Venlig hilsen,
Alexey Pakhunov.
 --------------080002090701000400060101 Content-Type: text/plain;
name="msvc.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="msvc.diff"

Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.51
diff -c -3 -r1.51 msvc.jam
*** msvc.jam 21 Sep 2005 13:44:06 -0000 1.51
--- msvc.jam 21 Sep 2005 20:19:16 -0000
***************
*** 13,20 ****
import path ;
import sequence : unique ;
import common ;
-
import rc ;

if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
--- 13,20 ----
import path ;
import sequence : unique ;
import common ;
import rc ;
+ import "class" : new ;

if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
***************
*** 30,35 ****
--- 30,38 ----
# to be seen, though ;-)
;

+ # List of all registered configurations
+ .versions = [ new configurations ] ;
+
RM = [ common.rm-command ] ;

# Initialize the toolset for a specific version. As the result, path to
***************
*** 54,169 ****
# Note: for free VC7.1 tools, we don't correctly find vcvars32.bar when user
# explicitly provides a path.
rule init (
! version ? # the msvc version which is being configured. When omitted
# the tools invoked when no explicit version is given will be configured.
: command *
! # the command to invoke the compiler. If not specified:
! # - if version is given, default location for that version will be searched
! #
! # - if version is not given, default locations for 7.1, 7.0 and 6.* will
! # be searched
! #
! # - if compiler is not found in default locations, PATH will be searched.
: options *
! # options can include <setup>, <compiler>, <linker> and <resource-compiler>
)
! {
! # setup will be used if a path has been specified. If setup is
! # not specified, vcvars32.bat will be used instead.
! setup = [ get-values <setup> : $(options) ] ;
! setup ?= vcvars32.bat ;
! compiler = [ get-values <compiler> : $(options) ] ;
! compiler ?= cl ;
! linker = [ get-values <linker> : $(options) ] ;
! linker ?= link ;
! resource-compiler = [ get-values <resource-compiler> : $(options) ] ;
! resource-compiler ?= rc ;
!
! local condition = [ common.check-init-parameters msvc :
! version $(version) ] ;
!
! # If version is specified, we try to search first in default paths,
! # and only then in PATH.
! command = [ common.get-invocation-command msvc : cl.exe : $(command)
! : [ default-paths $(version) ] : $(version) ] ;
!
! common.handle-options msvc : $(condition) : $(command) : $(options) ;
!
if $(command)
! {
! command = [ common.get-absolute-tool-path $(command[-1]) ] ;
}
! local root = $(command:D) ;
!
! setup = $(root)\\bin\\$(setup) ;
!
! # CONSIDER: What's the point of 'call'. Can we invoke the script directly?
! setup = "call \""$(setup)"\" > nul " ;
!
! if [ os.name ] = NT
{
! setup = $(setup)"
! " ;
}
! else
{
! setup = "cmd /S /C "$(setup)" \"&&\" " ;
}

! # prefix with setup, or quoted path if any
! local prefix = $(setup) ;
!
! flags msvc.compile .CC $(condition) : $(prefix)$(compiler) ;
! flags msvc.compile .RC $(condition) : $(prefix)$(resource-compiler) ;
! flags msvc.link .LD $(condition) : $(prefix)$(linker) ;
! flags msvc.archive .LD $(condition) : $(prefix)$(linker) ;
!
! if ! $(version)
{
! # Even if version is not explicitly specified, try to detect the version
! # from the path.
! if [ MATCH "(Microsoft Visual Studio 8)" : $(command) ]
{
! version = 8.0 ;
! }
! else if [ MATCH "(NET 2003[\/\\]VC7)" : $(command) ] ||
! [ MATCH "(Microsoft Visual C\\+\\+ Toolkit 2003)" : $(command) ]
{
! version = 7.1 ;
}
! else if [ MATCH "(.NET[\/\\]VC7)" : $(command) ]
{
! version = 7.0 ;
}
else
{
! version = 6.0 ;
! }
! }
!
! # Starting with versions 7.0, the msvc compiler have the /Zc:forScope
! # and /Zc:wchar_t options that improve C++ standard conformance, but
! # those options are off by default.
! # If we're sure that msvc version is at 7.*, add those options explicitly.
! # We can be sure either if user specified version 7.* explicitly,
! # or if the installation path contain 7.* (this is checked above).
! if ! [ MATCH ^(6\\.) : $(version) ]
! {
! flags msvc.compile CFLAGS $(condition) : /Zc:forScope /Zc:wchar_t ;
! }
!
! # 8.0 deprecates some of the options
! if ! [ MATCH ^([67]\\.) : $(version) ]
! {
! flags msvc.link MANIFEST $(condition) : "mt -nologo -manifest " ;
! flags msvc.link OUTPUTRESOURCE $(condition) : "-outputresource:" ;
}
- else
- {
- flags msvc.compile CFLAGS $(condition)/<optimization>speed $(condition)/<optimization>space : /Ogiy /Gs ;
- flags msvc.compile CFLAGS $(condition)/<optimization>speed : /Ot ;
- flags msvc.compile CFLAGS $(condition)/<optimization>space : /Os ;
- }
}

rule default-paths ( version ? )
--- 57,251 ----
# Note: for free VC7.1 tools, we don't correctly find vcvars32.bar when user
# explicitly provides a path.
rule init (
! version ? # the msvc version which is being configured. When omitted
# the tools invoked when no explicit version is given will be configured.
: command *
! # the command to invoke the compiler. If not specified:
! # - if version is given, default location for that version will be searched
! #
! # - if version is not given, default locations for 7.1, 7.0 and 6.* will
! # be searched
! #
! # - if compiler is not found in default locations, PATH will be searched.
: options *
! # options can include <setup>, <compiler>, <linker> and <resource-compiler>
)
! {
if $(command)
! {
! options += <command>$(command) ;
}
!
! configure $(version) : $(options) ;
! }
!
!
! # 'configure' is a newer version of 'init'. The parameter 'command' is passed as
! # a part of the 'options' list.
! rule configure (
! version ? :
! options *
! )
! {
! switch $(version)
{
! case all :
! if $(options)
! {
! error "msvc: options should be empty when 'all' is specified" ;
! }
!
! # use all detected versions
! for local v in [ $(.versions).all ]
! {
! configure-really $(v) ;
! }
!
! case "default" :
! configure-really : $(options) ;
!
! case * :
! configure-really $(version) : $(options) ;
}
! }
!
!
! local rule configure-really (
! version ? :
! options *
! )
! {
! # If no version supplied use the default configuration. Note that condition
! # remains versionless.
! local v = $(version) ;
! if ! $(v)
{
! # take the first detected version
! version = [ $(.versions).all ] ;
! version = $(version[1]) ;
!
! # Note: 'version' can still be empty at this point if no versions were
! # detected.
! version ?= "default" ;
}

! # If non empty 'options' is given use them instead of any autodetected
! # configuration
! if $(options)
{
! # register a new configuration
! $(.versions).register $(version) ;
! $(.versions).set $(version) : options : $(options) ;
! }
!
! # Mark the configuration as 'used'.
! if [ $(.versions).use $(version) ]
! {
! options = [ $(.versions).get $(version) : options ] ;
!
! # Generate condition and save it
! local condition = [ common.check-init-parameters msvc :
! version $(v) ] ;
!
! $(.versions).set $(version) : condition : $(condition) ;
!
! local command = [ get-values <command> : $(options) ] ;
!
!
! # setup will be used if a path has been specified. If setup is
! # not specified, vcvars32.bat will be used instead.
! setup = [ get-values <setup> : $(options) ] ;
! setup ?= vcvars32.bat ;
! compiler = [ get-values <compiler> : $(options) ] ;
! compiler ?= cl ;
! linker = [ get-values <linker> : $(options) ] ;
! linker ?= link ;
! resource-compiler = [ get-values <resource-compiler> : $(options) ] ;
! resource-compiler ?= rc ;
!
! # If version is specified, we try to search first in default paths,
! # and only then in PATH.
! command = [ common.get-invocation-command msvc : cl.exe : $(command)
! : [ default-paths $(version) ] : $(version) ] ;
!
! common.handle-options msvc : $(condition) : $(command) : $(options) ;
!
! if $(command)
! {
! command = [ common.get-absolute-tool-path $(command[-1]) ] ;
! }
! local root = $(command:D) ;
!
! setup = $(root)\\bin\\$(setup) ;
!
! # CONSIDER: What's the point of 'call'. Can we invoke the script directly?
! setup = "call \""$(setup)"\" > nul " ;
!
! if [ os.name ] = NT
{
! setup = $(setup)"
! " ;
! }
! else
{
! setup = "cmd /S /C "$(setup)" \"&&\" " ;
}
!
! # prefix with setup, or quoted path if any
! local prefix = $(setup) ;
!
! flags msvc.compile .CC $(condition) : $(prefix)$(compiler) ;
! flags msvc.compile .RC $(condition) : $(prefix)$(resource-compiler) ;
! flags msvc.link .LD $(condition) : $(prefix)$(linker) ;
! flags msvc.archive .LD $(condition) : $(prefix)$(linker) ;
!
! if ! $(version)
{
! # Even if version is not explicitly specified, try to detect the version
! # from the path.
! if [ MATCH "(Microsoft Visual Studio 8)" : $(command) ]
! {
! version = 8.0 ;
! }
! else if [ MATCH "(NET 2003[\/\\]VC7)" : $(command) ] ||
! [ MATCH "(Microsoft Visual C\\+\\+ Toolkit 2003)" : $(command) ]
! {
! version = 7.1 ;
! }
! else if [ MATCH "(.NET[\/\\]VC7)" : $(command) ]
! {
! version = 7.0 ;
! }
! else
! {
! version = 6.0 ;
! }
! }
!
! # Starting with versions 7.0, the msvc compiler have the /Zc:forScope
! # and /Zc:wchar_t options that improve C++ standard conformance, but
! # those options are off by default.
! # If we're sure that msvc version is at 7.*, add those options explicitly.
! # We can be sure either if user specified version 7.* explicitly,
! # or if the installation path contain 7.* (this is checked above).
! if ! [ MATCH ^(6\\.) : $(version) ]
! {
! flags msvc.compile CFLAGS $(condition) : /Zc:forScope /Zc:wchar_t ;
! }
!
! # 8.0 deprecates some of the options
! if ! [ MATCH ^([67]\\.) : $(version) ]
! {
! flags msvc.link MANIFEST $(condition) : "mt -nologo -manifest " ;
! flags msvc.link OUTPUTRESOURCE $(condition) : "-outputresource:" ;
}
else
{
! flags msvc.compile CFLAGS $(condition)/<optimization>speed $(condition)/<optimization>space : /Ogiy /Gs ;
! flags msvc.compile CFLAGS $(condition)/<optimization>speed : /Ot ;
! flags msvc.compile CFLAGS $(condition)/<optimization>space : /Os ;
! }
}
}

rule default-paths ( version ? )
***************
*** 203,209 ****
version-8.0-path = [ path.parent $(version-8.0-path) ] ;
version-8.0-path = [ path.join $(version-8.0-path) "VC" ] ;
version-8.0-path = [ path.native $(version-8.0-path) ] ;
!
}

# Fixed so we don't add paths without \\bin to all versions.
--- 285,291 ----
version-8.0-path = [ path.parent $(version-8.0-path) ] ;
version-8.0-path = [ path.join $(version-8.0-path) "VC" ] ;
version-8.0-path = [ path.native $(version-8.0-path) ] ;
!
}

# Fixed so we don't add paths without \\bin to all versions.
***************
*** 226,234 ****
local VCToolkitInstallDir = [ os.environ VCToolkitInstallDir ] ;
if $(VCToolkitInstallDir)
{
! if $(version) = "7.1" || ! $(version)
{
! # NOTE it's impossible to switch between Toolkit and VS.
# I wonder is toolkit and VS can be installed together?
possible-paths += [ path.native [ path.make $(VCToolkitInstallDir) ] ] ;

--- 308,316 ----
local VCToolkitInstallDir = [ os.environ VCToolkitInstallDir ] ;
if $(VCToolkitInstallDir)
{
! if $(version) = "7.1" || ! $(version)
{
! # NOTE it's impossible to switch between Toolkit and VS.
# I wonder is toolkit and VS can be installed together?
possible-paths += [ path.native [ path.make $(VCToolkitInstallDir) ] ] ;

 --------------080002090701000400060101 Content-Type: text/plain;
name="msvc_ignore_spaces.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="msvc_ignore_spaces.diff"

Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.51
diff -w -b -B -c -3 -r1.51 msvc.jam
*** msvc.jam 21 Sep 2005 13:44:06 -0000 1.51
--- msvc.jam 21 Sep 2005 20:19:16 -0000
***************
*** 13,20 ****
import path ;
import sequence : unique ;
import common ;
-
import rc ;

if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
--- 13,20 ----
import path ;
import sequence : unique ;
import common ;
import rc ;
+ import "class" : new ;

if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
***************
*** 30,35 ****
--- 30,38 ----
# to be seen, though ;-)
;

+ # List of all registered configurations
+ .versions = [ new configurations ] ;
+
RM = [ common.rm-command ] ;

# Initialize the toolset for a specific version. As the result, path to
***************
*** 68,73 ****
--- 71,157 ----
# options can include <setup>, <compiler>, <linker> and <resource-compiler>
)
{
+ if $(command)
+ {
+ options += <command>$(command) ;
+ }
+
+ configure $(version) : $(options) ;
+ }
+
+
+ # 'configure' is a newer version of 'init'. The parameter 'command' is passed as
+ # a part of the 'options' list.
+ rule configure (
+ version ? :
+ options *
+ )
+ {
+ switch $(version)
+ {
+ case all :
+ if $(options)
+ {
+ error "msvc: options should be empty when 'all' is specified" ;
+ }
+
+ # use all detected versions
+ for local v in [ $(.versions).all ]
+ {
+ configure-really $(v) ;
+ }
+
+ case "default" :
+ configure-really : $(options) ;
+
+ case * :
+ configure-really $(version) : $(options) ;
+ }
+ }
+
+
+ local rule configure-really (
+ version ? :
+ options *
+ )
+ {
+ # If no version supplied use the default configuration. Note that condition
+ # remains versionless.
+ local v = $(version) ;
+ if ! $(v)
+ {
+ # take the first detected version
+ version = [ $(.versions).all ] ;
+ version = $(version[1]) ;
+
+ # Note: 'version' can still be empty at this point if no versions were
+ # detected.
+ version ?= "default" ;
+ }
+
+ # If non empty 'options' is given use them instead of any autodetected
+ # configuration
+ if $(options)
+ {
+ # register a new configuration
+ $(.versions).register $(version) ;
+ $(.versions).set $(version) : options : $(options) ;
+ }
+
+ # Mark the configuration as 'used'.
+ if [ $(.versions).use $(version) ]
+ {
+ options = [ $(.versions).get $(version) : options ] ;
+
+ # Generate condition and save it
+ local condition = [ common.check-init-parameters msvc :
+ version $(v) ] ;
+
+ $(.versions).set $(version) : condition : $(condition) ;
+
+ local command = [ get-values <command> : $(options) ] ;
+
+
# setup will be used if a path has been specified. If setup is
# not specified, vcvars32.bat will be used instead.
setup = [ get-values <setup> : $(options) ] ;
***************
*** 79,87 ****
resource-compiler = [ get-values <resource-compiler> : $(options) ] ;
resource-compiler ?= rc ;

- local condition = [ common.check-init-parameters msvc :
- version $(version) ] ;
-
# If version is specified, we try to search first in default paths,
# and only then in PATH.
command = [ common.get-invocation-command msvc : cl.exe : $(command)
--- 163,168 ----
***************
*** 165,170 ****
--- 246,252 ----
flags msvc.compile CFLAGS $(condition)/<optimization>space : /Os ;
}
}
+ }

rule default-paths ( version ? )
{
 --------------080002090701000400060101--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk