|
Boost-Build : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-10-03 18:43:21
Alexey Pakhunov wrote:
> Reece Dunn wrote:
>
>>That's where I am moving to. That is why I am using $(root), etc. The
>>main problems are:
>>* VC6 - does not follow the pattern that VC 7.0, 7.1 and 8.0 do;
>>* VC7.1toolkit - this only has a single PATH, INCLUDE and LIB setting;
>
> Don't worry, I know the trick. :-) Try this:
I have been playing around with your suggestion and have come up with
something that works :). Thanks for your help!
The attached patch gives the current version that I have. I am having
some issues with the msvc-8.0/<architecture>ia64 and am not sure why :(.
However, the x86 and amd64 versions work!
I am not going to have access to my development machine for two weeks,
but will monitor the mailing lists :).
- Reece
--------------030705040900090702050809 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 3 Oct 2005 23:16:43 -0000
@@ -32,6 +32,62 @@
# to be seen, though ;-)
;
+cpu-arch-i386 =
+ <architecture>/<address-model>
+ <architecture>/<address-model>32
+ <architecture>x86/<address-model>
+ <architecture>x86/<address-model>32 ;
+
+cpu-arch-amd64 =
+ <architecture>/<address-model>64
+ <architecture>x86/<address-model>64 ;
+
+cpu-arch-ia64 =
+ <architecture>ia64/<address-model>
+ <architecture>ia64/<address-model>64 ;
+
+.version-6.0-path-i386 = Common/MSDev98/bin vc98/bin Common/tools/WinNT Common/tools ;
+.version-6.0-include-i386 = vc98/atl/include vc98/include vc98/mfc/include ;
+.version-6.0-lib-i386 = vc98/lib vc98/mfc/lib ;
+
+.version-7.0-path-i386 = Common7/IDE vc7/bin Common7/Tools Common7/Tools/bin/prerelease Common7/Tools/bin ;
+.version-7.0-include-i386 = vc7/atlmfc/include vc7/include vc7/PlatformSDK/include/prerelease VC7/PlatformSDK/include ;
+.version-7.0-lib-i386 = vc7/atlmfc/lib vc7/lib vc7/PlatformSDK/lib/prerelease vc7/PlatformSDK/lib ;
+
+.version-7.1-path-i386 = Common7/IDE vc7/bin Common7/Tools Common7/Tools/bin/prerelease Common7/Tools/bin ;
+.version-7.1-include-i386 = vc7/atlmfc/include vc7/include vc7/PlatformSDK/include/prerelease VC7/PlatformSDK/include ;
+.version-7.1-lib-i386 = vc7/atlmfc/lib vc7/lib vc7/PlatformSDK/lib/prerelease vc7/PlatformSDK/lib ;
+
+.version-7.1toolkit-path-i386 = bin ;
+.version-7.1toolkit-include-i386 = include ;
+.version-7.1toolkit-lib-i386 = lib ;
+
+.version-8.0-path-i386 = Common7/IDE vc/bin Common7/Tools Common7/Tools/bin vc/PlatformSDK/bin ;
+.version-8.0-include-i386 = vc/atlmfc/include vc/include vc/PlatformSDK/include ;
+.version-8.0-lib-i386 = vc/atlmfc/lib vc/lib vc/PlatformSDK/lib ;
+
+.version-8.0-path-amd64 = Common7/IDE VC/bin/x86_amd64 vc/bin Common7/Tools Common7/Tools/bin vc/PlatformSDK/bin ;
+.version-8.0-include-amd64 = vc/atlmfc/include vc/include vc/PlatformSDK/include ;
+.version-8.0-lib-amd64 = vc/atlmfc/lib/amd64 vc/lib/amd64 vc/PlatformSDK/lib/amd64 ;
+
+.version-8.0-path-ia64 = Common7/IDE vc/bin/x86_ia64 vc/bin Common7/Tools Common7/Tools/bin vc/PlatformSDK/bin ;
+.version-8.0-include-ia64 = vc/atlmfc/include vc/include vc/PlatformSDK/include ;
+.version-8.0-lib-ia64 = vc/atlmfc/lib/ia64 vc/lib/ia64 vc/PlatformSDK/lib/ia64 ;
+
+# Prepend with $(root) all paths in $(paths)
+local rule pathlist-join ( root : paths * )
+{
+ local retval ;
+
+ for local i in $(paths)
+ {
+ retval += [ path.join $(root) $(i) ] ;
+ }
+
+ return $(retval) ;
+}
+
+
# List of all registered configurations
.versions = [ new configurations ] ;
@@ -167,10 +223,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,39 +244,24 @@
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)
+ # Bind the command line tools to the associated action
+
+ flags msvc.compile .CC $(condition) : $(compiler) ;
+ flags msvc.compile .RC $(condition) : $(resource-compiler) ;
+ flags msvc.compile .ASM $(condition) : $(assembler) ;
+ flags msvc.link .LD $(condition) : $(linker) ;
+ flags msvc.archive .LD $(condition) : $(linker) ;
+
+ # Even if version is not explicitly specified, try to detect the version
+ # from the path.
+
+ 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) ]
{
version = 7.1 ;
@@ -240,9 +277,38 @@
else
{
version = 6.0 ;
- }
+ }
}
-
+
+ # vcvars.bat PATH, INCLUDE and LIB setup
+
+ for local c in $(.known-platforms)
+ {
+ if $(.version-$(version)-path-$(c))
+ {
+ # Get absolute paths
+ local path = [ pathlist-join $(root:P) : $(.version-$(version)-path-$(c)) ] ;
+ local inc = [ pathlist-join $(root:P) : $(.version-$(version)-include-$(c):W) ] ;
+ local lib = [ pathlist-join $(root:P) : $(.version-$(version)-lib-$(c):W) ] ;
+
+ # Register setup command (set PATH=...)
+ setup = [ common.prepend-path-variable-command PATH : $(path) ] ;
+ flags msvc SETUP $(condition)/$(cpu-arch-$(c)) : $(setup) ;
+
+ # Register compiler includes
+ for local i in $(inc)
+ {
+ flags msvc.compile INCLUDES $(condition)/$(cpu-arch-$(c)) : $(i) ;
+ }
+
+ # Register compiler library paths
+ for local i in $(lib)
+ {
+ flags msvc.link LINKPATH $(condition)/$(cpu-arch-$(c)) : $(i) ;
+ }
+ }
+ }
+
# 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.
@@ -392,15 +458,18 @@
# The actions differ only by explicit selection of input language
actions compile.c bind RSP
{
+ $(SETUP)
$(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(RSP:W)" -c -Fo"$(<[1]:W)" && $(RM) "$(RSP)"
}
actions compile.c++ bind RSP
{
+ $(SETUP)
$(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(USER_CFLAGS) @"$(RSP:W)" -c -Fo"$(<[1]:W)" && $(RM) "$(RSP)"
}
actions compile.rc
{
+ $(SETUP)
$(.RC) -l 0x409 -U$(UNDEFS) -D$(DEFINES) -I"$(INCLUDES)" -fo "$(<:W)" "$(>:W)"
}
@@ -418,6 +487,7 @@
actions compile.asm
{
+ $(SETUP)
$(.ASM) -nologo -c -coff -Zp4 -Cp -Cx $(USER_ASMFLAGS) -Fo "$(<:W)" "$(>:W)"
}
@@ -474,6 +544,7 @@
actions archive bind RSP
{
if exist "$(<[1])" DEL "$(<[1])"
+ $(SETUP)
$(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(RSP)" && $(RM) "$(RSP)"
}
}
@@ -482,6 +553,7 @@
actions archive bind RSP
{
$(RM) "$(<[1])"
+ $(SETUP)
$(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(RSP)" && $(RM) "$(RSP)"
}
}
@@ -500,12 +572,14 @@
actions link bind DEF_FILE RSP
{
+ $(SETUP)
$(.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
{
+ $(SETUP)
$(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"$(RSP:W)" && $(RM) "$(RSP)"
$(MANIFEST)$(<[1]).manifest $(OUTPUTRESOURCE)$(<[1]);#2
}
--------------030705040900090702050809--
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