Re: Win-GHC with GnuWin32 toolset--Mingw32 replacement

Peter Tanski <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.all,gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
On Jan 7, 2007, at 12:42 PM, Neil Mitchell wrote:
>> On a related note, I am running into the same convenience problem
>> with vsvars32.bat as Yhc Issue 49 (http://code.google.com/p/yhc/
>> issues/detail?id=49&can=2&q=).  The quick fix is to have the build
>> find and run vsvars32.bat if the environment variables aren't found
>> the first time.  I'm not sure how to do that with Scons but it should
>> be possible.
>
> Should be relatively easy, there is an environment variable
> %VS71COMNTOOLS% (with different numbers for different versions), which
> points at the Visual Studio install path, and the vsvars32.bat is
> always relative from that.

I looked in the Scons files and couldn't find a search for the  
environment variable %VSnnCOMNTOOLS%.  If you could point me in the  
right direction (and don't have time to play around yourself) I could  
test it out right now.  The most general way to find what the %VSnn... 
% might be to run the 'set' command and pipe it to FIND:

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

>  When spawning via system (or similar), we had very little success.

Because each system runs under its own command environment, I would  
guess.  (I am guessing that, if you are using SCons, you already  
tried propagating the resulting external environment to the ENV.)

> Our alternative would probably be to parse the batch file - just  
> looking for SET lines, and to add them to the environment manually.

You shouldn't even have to parse the file much: each @set command is  
located on one line, for example:

@set INCLUDE=%VCINSTALLDIR%\ATLMFC\INCLUDE;%VCINSTALLDIR%\INCLUDE;% 
VCINSTALLDIR%\PlatformSDK\include;%FrameworkSDKDir%\include;%INCLUDE%

so just grab the line and execute (as a shell command), right?

Cheers,
Pete
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.