|
Boost-Build : |
From: Alexey Pakhunov (alexeypa_at_[hidden])
Date: 2005-10-03 13:21:26
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:
----------
# Supported CPU architectures
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 = "" 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 = $(.version-7.0-path) ;
.version-7.1-include-i386 = $(.version-7.0-include) ;
.version-7.1-lib-i386 = $(.version-7.0-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 ;
}
for local v in .known-versions
{
for local c in i386 amd64 ia64
{
if $(.version-$(v)-path-$(c))
{
# Get absolute paths
local path = [ pathlist-join $(root) :
$(.version-$(v)-path-$(c)) ] ;
local include = [ pathlist-join $(root) :
$(.version-$(v)-include-$(c):W) ] ;
local lib = [ pathlist-join $(root) :
$(.version-$(v)-lib-$(c):W) ] ;
# Register setup command (set PATH=...)
flags msvc SETUP $(condition)/$(cpu-arch-$(c)) :
[ common.prepend-path-variable-command PATH : $(path) ] ;
# Register compiler includes
for local i in $(include)
{
flags msvc.compile CFLAGS $(condition)/$(cpu-arch-$(c))
: "\"-I$(i)\"" ;
}
# Register compiler library paths
for local i in $(lib)
{
flags msvc.compile LINKFLAGS
$(condition)/$(cpu-arch-$(c)) : "\"-LIBPATH:$(i)\"" ;
}
}
}
}
----------
Basically this is the generic code you need. In order to add a new
version of a compiler (or a configuration) we will need to add few new
variables starting with '.version'.
(I didn't validated actual paths but they were taken from corresponding
vcvars32.bat files)
> * compilers from the PlatformSDK - I'm not sure how these are configured;
They will add own INCLUDE, LIB and PATH settings. New INCLUDE and LIB
directories will be added in front of corresponding variables; PATH - at
the end. (Yes, it sounds like order-sensitive features :-))
> * embedded VC++ - I don't know what to do about this;
> * VC8 PocketPC/SmartPhone - I have no idea how VC8 deals with these, I
> cannot see any vcvars.bat for configuring these.
Yeah. We need to see corresponding vcvars first. But anyway I think we
will able to include them into the existing schema.
> There is still room for improvement in the genericity, but the important
> thing is to get everything working before simplifying it.
The more code we have the harder to debug it. Implementing five
different configurations using 'if' logic produces a lot of code.
> I have tried these with cygwin/bash, but I think they work because of
> the $(setup) trick. I definitely agree that we should support NT and CYGWIN.
The trick was needed only for calling vcvars32.bat. Setting environment
variables works just fine. The only thing we should pay attention to
proper path conversion logic.
> Thanks for the suggestions :).
Welcome. :-)
Best regards/Venlig hilsen,
Alexey Pakhunov.
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