Boost logo

Boost-Build :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-10-02 10:15:34


Hi All,

The attached patch is the first attempt at removing the need to call
vcvars.bat. I have tested it on versions 6.0, 7.1 and 8.0. I haven't
tested with 7.0, but it should work.

There are several issues with this patch at the moment, so I am opening
it up for comment:

* It does not add the FrameworkSDK to the PATH, INCLUDE and LIB. This
could be done by a frameworksdk.jam file as an "SDK" :).

* PlatformSDK is hardcoded. This could be moved into the
msplatformsdk.jam file when this becomes available. Also, this would
need to be revised for PocketPC/SmartPhone compilations (i.e. embedded
VC++ and 8.0 when targetting WinCE platforms).

* This hasn't been tested with standalone targets such as the 7.1
toolkit, embedded VC++ and the compilers in the PlatformSDK distributions.

* There should really be a path flag/variable associated with each
toolset+version, that updates the environment variable when an action is
being called (this should be generic for any environment variable, e.g.

set-env PATH : $(root)/bin;$(PATH) ;

).

* The <include> and <library-path> features are not updated - the
command-line are added manually. This means that they are moved to the
command-line, not the response files. I want to do something like:

feature $(condition) : <include>$(root)/include ;

* There isn't any current support for the amd64 and ia64 native and
cross-compile builds.

- Reece
 --------------060605070504000602080103 Content-Type: text/plain;
name="msvc-novcvars.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="msvc-novcvars.diff"

Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.56
diff -u -r1.56 msvc.jam
--- msvc.jam 26 Sep 2005 06:02:41 -0000 1.56
+++ msvc.jam 2 Oct 2005 14:51:46 -0000
@@ -167,10 +167,6 @@

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) ] ;
@@ -192,31 +188,7 @@
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.compile .ASM $(condition) : $(prefix)$(assembler) ;
- 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
@@ -242,7 +214,72 @@
version = 6.0 ;
}
}
-
+
+ # Setup PATH from vcvars.bat
+
+ local path = ;
+
+ if [ MATCH ^(6\\.) : $(version) ] # VC 6.0
+ {
+ path = $(root)/../Common/MSDev98/bin ;
+ path = $(path);$(root)/bin ;
+ path = $(path);$(root)/../Common/WinNT ;
+ path = $(path);$(root)/../Common/Tools ;
+ }
+ else # VC 7.0 and above
+ {
+ path = $(root)/../Common7/IDE ;
+ path = $(path);$(root)/bin ;
+ path = $(path);$(root)/../Common7/Tools ;
+ path = $(path);$(root)/../Common7/Tools/bin/prerelease ;
+ path = $(path);$(root)/../Common7/Tools/bin ;
+ }
+
+ setup = "set PATH="$(path)";%PATH%" ;
+
+ if [ os.name ] = NT
+ {
+ setup = $(setup)"
+" ;
+ }
+ else
+ {
+ setup = "cmd /S /C "$(setup)" \"&&\" " ;
+ }
+
+ # prefix with setup, or quoted path if any
+ local prefix = $(setup) ;
+
+ # Bind the command line tools to the associated action
+
+ flags msvc.compile .CC $(condition) : $(prefix)$(compiler) ;
+ flags msvc.compile .RC $(condition) : $(prefix)$(resource-compiler) ;
+ flags msvc.compile .ASM $(condition) : $(prefix)$(assembler) ;
+ flags msvc.link .LD $(condition) : $(prefix)$(linker) ;
+ flags msvc.archive .LD $(condition) : $(prefix)$(linker) ;
+
+ # Setup INCLUDE and LIB from vcvars.bat
+
+ if [ MATCH ^(6\\.) : $(version) ] # VC 6.0
+ {
+ flags msvc.compile CFLAGS $(condition) : "-I\"$(root)/atl/include\"" ;
+ flags msvc.compile CFLAGS $(condition) : "-I\"$(root)/mfc/include\"" ;
+ flags msvc LINKFLAGS $(condition) : "-LIBPATH:\"$(root)/mfc/lib\"" ;
+ }
+ else # VC 7.0 and above
+ {
+ flags msvc.compile CFLAGS $(condition) : "-I\"$(root)/atlmfc/include\"" ;
+ flags msvc LINKFLAGS $(condition) : "-LIBPATH:\"$(root)/atlmfc/lib\"" ;
+ }
+
+ flags msvc.compile CFLAGS $(condition) : "-I\"$(root)/include\"" ;
+ flags msvc.compile CFLAGS $(condition) : "-I\"$(root)/PlatformSDK/include/prerelease\"" ;
+ flags msvc.compile CFLAGS $(condition) : "-I\"$(root)/PlatformSDK/include\"" ;
+
+ flags msvc LINKFLAGS $(condition) : "-LIBPATH:\"$(root)/lib\"" ;
+ flags msvc LINKFLAGS $(condition) : "-LIBPATH:\"$(root)/PlatformSDK/lib/prerelease\"" ;
+ flags msvc LINKFLAGS $(condition) : "-LIBPATH:\"$(root)/PlatformSDK/lib\"" ;
+
# 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.
 --------------060605070504000602080103--


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