Boost logo

Boost-Build :

From: Andrey Melnikov (melnikov_at_[hidden])
Date: 2005-07-30 10:33:04


Vladimir Prus wrote:
> As I've said before, I'd like to roll Milestone 11 of Boost.Build V2
> in early August.
>
> There's a couple of pending things:
>
> - msvc patches from Andrey (waiting for him to send a diff against CVS)

Here is a diff. As a GUI guy used to graphical diffs of Perforce and
Clearcase, I found contextual (-c) diffs the most human-readable. I can
send the diff in any other format if you want.

Fixes in this patch:

- minor spellings errors in comments ("iff" and "vccars" instead of "if"
and "vcvars")
- correct escaping of metacharacters in regular expressions
- Fixed a condition so /Zc:forScope /Zc:wchar_t are added in MSVC 8.x too
- Side-by-side manifests are now used for exe targets too, not only for
DLLs.
- Reworked /Ogity|/Ogisy options selection code (a minor refactoring)
- Search paths without /bin are now only added if vc 7.1 is going to be
detected.
- Added autodetection for VC8.0 using VS80COMNTOOLS variable

A question: Do we still need these =J hacks? Can we just replace [
modules.peek ] with [ os.environ ] and remove =J lines everywhere in the
VS detection code?

Also I realized that installing CVS and getting a diff is extremely easy
and I don't need to install anything or set environment variables. I'm
going to write a more straightforward CVS/patch HOWTO in Wiki.

Also I have lib* prefix patch and maybe some other patches pending
because they aren't in msvc.jam. I'll take a look and send you a diff soon.

Andrey
 --------------020308010202080202020309 Content-Type: text/plain;
name="msvc.jam.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="msvc.jam.diff"

Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.48
diff -c -r1.48 msvc.jam
*** msvc.jam 15 Jul 2005 13:35:58 -0000 1.48
--- msvc.jam 30 Jul 2005 14:59:50 -0000
***************
*** 68,74 ****
# options can include <setup>, <compiler>, <linker> and <resource-compiler>
)
{
! # setup will be used iff a path has been specified. If setup is
# not specified, vcvars32.bat will be used instead.
setup = [ get-values <setup> : $(options) ] ;
setup ?= vcvars32.bat ;
--- 68,74 ----
# 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 ;
***************
*** 126,137 ****
{
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 ;
}
--- 126,137 ----
{
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 ;
}
***************
*** 147,169 ****
# 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 ^(7\..*) : $(version) ]
{
flags msvc.compile CFLAGS $(condition) : /Zc:forScope /Zc:wchar_t ;
}

# 8.0 deprecates some of the options
! if ! [ MATCH ^([67].*) : $(version) ]
{
! flags msvc.compile CFLAGS $(condition)/<optimization>speed : /O2 ;
! flags msvc.compile CFLAGS $(condition)/<optimization>space : /O1 ;
! flags msvc.link.dll MANIFEST : "mt -manifest " ;
! flags msvc.link.dll OUTPUTRESOURCE : "-outputresource:" ;
}
else
{
! flags msvc.compile CFLAGS $(condition)/<optimization>speed : /Ogity /O2 /Gs ;
! flags msvc.compile CFLAGS $(condition)/<optimization>space : /Ogisy /O1 /Gs ;
}
}

--- 147,168 ----
# 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 ^([78]\..*) : $(version) ]
{
flags msvc.compile CFLAGS $(condition) : /Zc:forScope /Zc:wchar_t ;
}

# 8.0 deprecates some of the options
! if $(version) = "8.0"
{
! 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 ;
}
}

***************
*** 194,205 ****
version-7.1-path = [ path.native $(version-7.1-path) ] ;
}

! local VCToolkitInstallDir = [ modules.peek : VCToolkitInstallDir ] ;
! if $(VCToolkitInstallDir)
{
! version-7.1-path = [ path.make "$(VCToolkitInstallDir:J= )" ] ;
}
!
if $(version)
{
local v = [ MATCH ^(6|[^6].*) : $(version) ] ;
--- 193,214 ----
version-7.1-path = [ path.native $(version-7.1-path) ] ;
}

! local VS80COMNTOOLS = [ modules.peek : VS80COMNTOOLS ] ;
!
! if $(VS80COMNTOOLS)
{
! # VS80COMNTOOLS is set by VS .NET 2005 to <VSDIR>\Common7\Tools
! version-8.0-path = [ path.make "$(VS80COMNTOOLS:J= )" ] ;
! version-8.0-path = [ path.parent $(version-8.0-path) ] ;
! 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.
! # Path without 7.1
!
if $(version)
{
local v = [ MATCH ^(6|[^6].*) : $(version) ] ;
***************
*** 210,218 ****
possible-paths += $(version-8.0-path) $(version-7.1-path) $(version-7.0-path) $(version-6-path) ;
}

! # The vccars32.bat is actually in "bin" directory.
# (except for free VC7.1 tools)
! possible-paths = $(possible-paths)\\bin $(possible-paths) ;

return $(possible-paths) ;
}
--- 219,246 ----
possible-paths += $(version-8.0-path) $(version-7.1-path) $(version-7.0-path) $(version-6-path) ;
}

! # The vcvars32.bat is actually in "bin" directory.
# (except for free VC7.1 tools)
! possible-paths = $(possible-paths)\\bin ;
!
! local VCToolkitInstallDir = [ modules.peek : VCToolkitInstallDir ] ;
! if $(VCToolkitInstallDir)
! {
!
! if $(version) = "7.1"
! {
! VCToolkitInstallDir = [ path.native [ path.make "$(VCToolkitInstallDir:J= )" ] ] ;
! # NOTE it's impossible to switch between Toolkit and VS.
! # I wonder is toolkit and VS can be installed together?
!
! possible-paths += ;
! }
! if ! $(version)
! {
! possible-paths += [ path.make "$(VCToolkitInstallDir:J= )" ] ;
! }
!
! }

return $(possible-paths) ;
}
***************
*** 236,241 ****
--- 264,273 ----
# Declare flags and action for compilation
#
feature.feature debug-store : object database : propagated ;
+
+ flags msvc.compile CFLAGS <optimization>speed : /O2 ;
+ flags msvc.compile CFLAGS <optimization>space : /O1 ;
+
flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>object : /Z7 ;
flags msvc.compile CFLAGS <debug-symbols>on/<debug-store>database : /Zi ;
flags msvc.compile CFLAGS <optimization>off : /Od ;
***************
*** 357,362 ****
--- 389,395 ----
actions link bind DEF_FILE RSP
{
$(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(USER_LINKFLAGS) @"$(RSP:W)" && $(RM) "$(RSP)"
+ $(MANIFEST)$(<[1]).manifest $(OUTPUTRESOURCE)$(<[1]);#2
}

actions link.dll bind DEF_FILE RSP
 --------------020308010202080202020309--


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