[Yhc] VC(++) environment variables (vcvars32.bat, Issue 49)

Peter Tanski p.tanski at gmail.com
Sun Jan 7 18:32:40 EST 2007


[redirected from cvs-ghc list]

On Jan 7, 2007, at 3:03 PM, Neil Mitchell wrote:
> Peter Tanski wrote:
>> Ah.  Nothing like a little exploration :)  Does ./build/platform.py
>> sound like the right place to do it?
>
> That's well beyond my scons knowledge. If you repost the question to
> the yhc@ list I'm sure our scons expert will be able to give you an
> idea.

To carry the discussion we were having, here is the summary:

I looked at Issue 49, on setting the correct environment variables  
for a Visual Studio (Visual C++) toolset using vcvars32.bat or  
whatever the correct batch file is (see below).  This shouldn't be  
too hard to do but I don't know which SCons files I should modify for  
this.  If any of you have extra time, would you please point me in  
the right direction?

The basic strategy I want to try is this:

1. find the correct Visual Studio build by querying the system and  
finding the %VSnnCOMNTOOLS% installation.  In DOS, this would be as  
simple as:

C:\> set | find "COMNTOOLS"
VS80COMNTOOLS=C:\....

2. find the correct vcvars32.bat or vsvars32.bat (possibly by  
searching the Start Menu for the Visual Studio [version] Command  
Prompt) and examining the shortcut.  There are only two "Start Menu"  
systems to check, the current User and "All Users."  There is a  
program, 'getlnk' from Bamboo Software <http://www.inwa.net/~frog/ 
bamboo.htm> to query the .lnk file in case there isn't a Windows  
program.  (Note: easiest solution is to query the settings in the  
Registry, under \Software\Microsoft\VisualStudio\[version]\External  
Tools, I believe. I haven't explored this thoroughly and expect there  
is some cool Python or scons function for that purpose.)

3. run the batch file and query the environment variables

4. propagate the variables into scons ENV

... after this, if Yhc ever needs the Visual Studio tools again, it  
might be able to perform the same process after (or during)  
installation.

>> The vcvarsall.bat in the \Visual Studio X\VC\ directory has goto's
>> that essentially redirect to the \Visual Studio X\Common7\Tools
>> \vsvars32.bat; my vsvars32.bat doesn't have any goto's in it.
>
> The one in my VC98 installation has some if's in it, so a little more
> complex than just set's. It's also named vcvars32.bat instead of
> vSvars32.bat.

Thanks very much for any any help you can give.

Cheers,
Pete


More information about the Yhc mailing list