Boost logo

Boost-Build :

From: Michael Stevens (Michael.Stevens_at_[hidden])
Date: 2004-07-22 05:18:44


> Michael,
> you've mentioned you've got some scripts to compile stuff with VC7.1 under
> Linux with V2. Could you share those scripts?

No problem. This all works best with the free toolkit version of VC7.1 This
has all the .exe and .dll needed in a single directory which mean a lot less
messing about setting up paths.

The first thing is the simple shell script wrapper 'vcrun71' which is used to
execute the compiler/linker. This simple sets up INCLUDE and LIB and then
execute Wine with the specified executable. The script contains absolute
paths to everything so it is not very clever!
Also shell script wrappers can never be transparent as quote processing takes
place. So quotes will be dropped with disastrous effect for filenames with
spaces in.

To get this to run I have a simple cross compile toolset 'msvc-X.jam'. The
active code in this simply add a 'cross' subfeature and provides a new 'init'
function. The new 'init' by-passes all the usual tool searching etc etc, and
provides a simple 'prefix' argument.
I think this methodology is fairly extensible to all no standard toolset
usages. Rather then try and cover every build possibility and command line
argument in a toolset (such as 32/64 bit) the user should customise an
existing toolset.

Did you see my recent 'msvc patch' posting. This is required if you want to
create static libraries (archives).

The 'msvc-X.jam' file also contains a fair bit of dead code. Most of this was
an attempt to fix the definition for the 'actions archive'. Oddly these
redefinitions didn't seem to work!

> I'm getting impatient waiting for VC7.1 to finish on 800Mz box using
> network drive, so I hope Athlon 2800+ will do better even with wine.
Oh yes the compiler seems to run relatively slowly under wine emulation!
Hopefully you Athlon is still faster!

Good luck,

Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation and
Bayesian Filtering
 --Boundary-00=_ES5/AoO1N+0qrLM Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
# Copyright (c) 2003 Michael Stevens
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# Support for the X-Cross compilation (for example using wine) for
# the msvc toolset.
import toolset : flags ;
import feature ;
import type ;
import common ;
import msvc ;
# ISSUE Redefinition in external module does not work
module msvc
rule link.dll ( targets + : sources * : properties * )
ECHO MSVC-X link rule ;
common.response-file $(targets) : $(sources) : $(targets[3]) : $(properties) ;
DEPENDS $(<) : [ on $(<) return $(DEF_FILE) ] ;
rule archive ( targets + : sources * : properties * )
ECHO MSVC-X archive rule ;
common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ;
actions archive
#ECHO MSVC-X archive action ;
$(RM) "$(<[1])"
$(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(<[2])"
} # module msvc
# REMOVED I would like to override the type registration away from the Incorrect spec dependant on OS
#type.set-generated-target-suffix STATIC_LIB : <toolset>msvc : lib ;
#type.register STATIC_LIB : lib a : LIB : main ;
# Cross compilation as a msvc subfeature
# Cross compilation is link compatible!
feature.subfeature toolset msvc : cross
: propagated optional
# Configure msvc toolset for Cross compilation
# Allow direct control of the compilation command line
# Paths and enviroment variable must be configured elsewhere.
# NOTE The build configuration remains "msvc".
# For example, you might have:
# using msvc-X : 7.0 : "vcrun " ;
# will invoke the standard compiler tool "cl" with "vcrun cl"
rule init (
version # version identification which is being configured
: prefix # literal prefix prepended to command line
: cross ? # cross compilation identifiction, default "wine"
: compiler ?
: linker ? )
cross ?= "wine" ;
compiler ?= "cl" ;
linker ?= "link" ;
local condition = [ common.check-init-parameters msvc : 
version $(version) ] ;
feature.extend <toolset>msvc version : $(version) ;
feature.extend <toolset>msvc cross : $(cross) ;
condition = $(condition) <toolset-msvc:cross>$(cross) ; msvc : flags msvc.compile .CC $(condition) : $(prefix)$(compiler) ; msvc : flags .LD $(condition) : $(prefix)$(linker) ; msvc : flags msvc.archive .LD $(condition) : $(prefix)$(linker) ;
rule test
 --Boundary-00=_ES5/AoO1N+0qrLM Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
# ISSUE Execution of the script will result in " being stripped.
# This means vc will fail if filenames have spaces in
export INCLUDE="D:/Program Files/MVC++Tk 2003/include"
export LIB="D:/Program Files/MVC++Tk 2003/lib"
wine --debugmsg warn-all,fixme-all -- "D:/Program Files/MVC++Tk 2003/bin/"$*

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at