From: David Abrahams (gclbb-jamboost_at_[hidden])
Date: 2003-05-08 11:33:22
Ali Azarbayejani <ali_at_[hidden]> writes:
> Vladimir Prus wrote:
>> I've a question for msvc users. Now, V2 works ok if you specify
>> using msvc : 6.5 ;
>> in user-config.jam. But if you write
>> using msvc ;
>> then it will works only if vcvasrs32.bat was called previously. Two people
>> already stumbled on it, and I think something should be done. The options are
>> 1. Document the the second case ("using msvc ; ") works only if vcvars32.bat
>> were called.
>> 2. If vcvars32.bat is in path, use that to find the path to compiler. Invoke
>> vcvars32.bat before all tool invocations. If vcvars32.bat is not in path,
>> look though default install location for versions 7.1, 7.0 and 6. If compiler
>> is found in any of locations, it will be used.
>> 3. Try to sense if vcvars32.bat was already called. If so, use variables it
>> sets to find the path to compiler. If vcvars32.bat is not already called, use
>> logic from (2).
>> Can anybody comment on those variants or offer more alternatives?
> I would prefer not having to depend on vcvars32.bat at all.
Bad idea, IMO. The .bat file knows how to set things up so that the
compiler works. Otherwise, we have to encode information which is
already given to us by Microsoft into the build system. Each time
they release a new compiler we're going to have to look to find out
how the setup steps changed.
> Also, I don't want my build to produce side effects.
What side-effects? Environment settings for each invoked action
disappear as soon as the action completes.
> How about
> (1) check default installation locations; if so, use those
> (2) check if tools (cl, link) are in PATH; if so, use those
I think you got those backwards. If the user doesn't specify a
version to use, IMO you should use the one in his path (if any).
Users expect to be able to invoke the vcvars32.bat for a particular
compiler version and then invoke a build to get it to use that
> (3) NEVER invoke vcvars32.bat if it's going to make a permanent change
> to my Environment;
It is NEVER going to make a permanent change to your environment.
> at least I need the option to be able to invoke a
> completely non-intrusive build with no side effects.
You already do.
> (4) Documenting and warning about vcvars32.bat are fine and good, and if
> a user wants to invoke it manually, it should make (2) work, but don't
> do it for me automatically unless it can be done in a way that doesn't
> produce side effects.
It's basically impossible to produce any side effects, so you don't
have anything to worry about.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
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