|
Boost-Build : |
From: Andrey Melnikov (melnikov_at_[hidden])
Date: 2005-08-01 13:57:20
Vladimir Prus wrote:
> On Saturday 30 July 2005 19:33, Andrey Melnikov wrote:
>
>>Vladimir Prus wrote:
>>
> I (and I think others here), prefer unified diff.
Now it's unified (cvs diff -u msvc.jam)
>
> Here are the comments on the patch:
>
>
>>- else if [ MATCH "(\\.NET 2003\\VC7)" : $(command) ] ||
>>+ else if [ MATCH "(NET 2003[\/\\\\]VC7)" : $(command) ] ||
>> [ MATCH "(Microsoft Visual C\\+\\+ Toolkit 2003)" :
>
> $(command) ]
>
>> {
>> version = 7.1 ;
>> }
>>- else if [ MATCH "(.NET\\VC7)" : $(command) ]
>>+ else if [ MATCH "(.NET[\/\\\\]VC7)" : $(command) ]
>
>
> I'm not sure about this [\/\\\\] thing. After jam unescapes the string, you
> get [/\\] The second backslash does not seem necessary inside character set.
<snip>
> Am I missing something?
I was missing that backslash isn't nesessary inside RegEx character set
in Boost. In other regular expressions flavours (e.g. php preg or perl
regexps) 4 slashes are required because \] isn't a valid metecharacter
escape sequence. So it fixed now.
>> # 8.0 deprecates some of the options
>>- if ! [ MATCH ^([67].*) : $(version) ]
>>+ if $(version) = "8.0"
>
>
> This just waits to break when 8.1 is released ;-) What was wrong with the
> previous condition?
Actually dot wasn't escaped and it waited to break with 60.0 :) Fixed
now. I also fixed the same problem in another place now.
>>+ possible-paths = $(possible-paths)\\bin ;
>>+
>>+ local VCToolkitInstallDir = [ modules.peek : VCToolkitInstallDir ] ;
>>+ if $(VCToolkitInstallDir)
>>+ {
<snip>
>
> This means that if the user has
>
> using msvc : 7.1 ;
>
> then 7.1 toolkit will never be used? I'm not sure that's good, why I can both
> using the free toolkit, and explicitly specify the version?
I don't understand what you mean. But the bug is obvious. Fixed.
>
>>@@ -357,6 +389,7 @@
>> 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
>> }
>
>
> I'd appreciate a comment saying why manifests are usefull for DLLs, too.
I added a comment now but it's pretty useless because it's rather obvious.
>>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?
>
>
> Yes, we no longer need :J
Fixed too. No :J, no modules.peek for VS* variables. Only ARGV uses
modules.peek now.
>>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.
>
>
> I'm looking forward at revised version of this patch, and the new one!
>
I think it would be better to finish with this patch and Alexey's patch
first. Then I'll get back to lib* patch.
Andrey
--------------040308090107050403000406 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 -u -r1.48 msvc.jam
--- msvc.jam 15 Jul 2005 13:35:58 -0000 1.48
+++ msvc.jam 1 Aug 2005 18:37:58 -0000
@@ -68,7 +68,7 @@
# options can include <setup>, <compiler>, <linker> and <resource-compiler>
)
{
- # setup will be used iff a path has been specified. If setup is
+ # 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,12 +126,12 @@
{
version = 8.0 ;
}
- else if [ MATCH "(\\.NET 2003\\VC7)" : $(command) ] ||
+ else if [ MATCH "(NET 2003[\/\\]VC7)" : $(command) ] ||
[ MATCH "(Microsoft Visual C\\+\\+ Toolkit 2003)" : $(command) ]
{
version = 7.1 ;
}
- else if [ MATCH "(.NET\\VC7)" : $(command) ]
+ else if [ MATCH "(.NET[\/\\]VC7)" : $(command) ]
{
version = 7.0 ;
}
@@ -147,23 +147,22 @@
# 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) ]
+ 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) ]
+ 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:" ;
+ flags msvc.link MANIFEST $(condition) : "mt -nologo -manifest " ;
+ flags msvc.link OUTPUTRESOURCE $(condition) : "-outputresource:" ;
}
else
{
- flags msvc.compile CFLAGS $(condition)/<optimization>speed : /Ogity /O2 /Gs ;
- flags msvc.compile CFLAGS $(condition)/<optimization>space : /Ogisy /O1 /Gs ;
+ 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 ;
}
}
@@ -183,23 +182,33 @@
local version-7.1-path = $(ProgramFiles)"\\Microsoft Visual Studio .NET 2003\\VC7" ;
local version-8.0-path = $(ProgramFiles)"\\Microsoft Visual Studio 8" ;
- local VS71COMNTOOLS = [ modules.peek : VS71COMNTOOLS ] ;
+ local VS71COMNTOOLS = [ os.environ VS71COMNTOOLS ] ;
if $(VS71COMNTOOLS)
{
# VS71COMNTOOLS is set by VS .NET 2003 to <VSDIR>\Common7\Tools
- version-7.1-path = [ path.make "$(VS71COMNTOOLS:J= )" ] ;
+ version-7.1-path = [ path.make $(VS71COMNTOOLS) ] ;
version-7.1-path = [ path.parent $(version-7.1-path) ] ;
version-7.1-path = [ path.parent $(version-7.1-path) ] ;
version-7.1-path = [ path.join $(version-7.1-path) "VC7" ] ;
version-7.1-path = [ path.native $(version-7.1-path) ] ;
}
- local VCToolkitInstallDir = [ modules.peek : VCToolkitInstallDir ] ;
- if $(VCToolkitInstallDir)
+ local VS80COMNTOOLS = [ os.environ VS80COMNTOOLS ] ;
+
+ if $(VS80COMNTOOLS)
{
- version-7.1-path = [ path.make "$(VCToolkitInstallDir:J= )" ] ;
+ # VS80COMNTOOLS is set by VS .NET 2005 to <VSDIR>\Common7\Tools
+ version-8.0-path = [ path.make "$(VS80COMNTOOLS)" ] ;
+ 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,9 +219,21 @@
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.
+ # The vcvars32.bat is actually in "bin" directory.
# (except for free VC7.1 tools)
- possible-paths = $(possible-paths)\\bin $(possible-paths) ;
+ possible-paths = $(possible-paths)\\bin ;
+
+ 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) ] ] ;
+
+ }
+ }
return $(possible-paths) ;
}
@@ -236,6 +257,10 @@
# 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 ;
@@ -354,9 +379,16 @@
# rebuilt every time. I'm not sure that incremental linking is
# such a great idea in general, but in this case I'm sure we
# don't want it.
+
+# Windows Manifests is a new way to specify dependencies
+# on managed DotNet assemblies and Windows native DLLs. The
+# manifests are embedded as resourses and are useful in
+# any PE targets (both DLL and EXE)
+
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
--------------040308090107050403000406--
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