Wireshark-dev: Re: [Wireshark-dev] Wireshark 1.6: End support of older Windows Compilers/SDKs ?
From: Graham Bloice <[email protected]>
Date: Thu, 03 Feb 2011 10:45:58 +0000
On 03/02/2011 10:16, Guy Harris wrote:
On Feb 3, 2011, at 2:02 AM, Graham Bloice wrote:

I've perhaps conjoined two issues.  Compiler and linker flags do depend on the toolchain in use, but IME don't actually vary too much.
"Not too much" != "not at all", so, unless there's a way to make them not vary at all, we *do* need to determine the toolchain in use.
Ack, there will still have to be some conditionals, but hopefully less than we have now.  Of course running a very old VS with a much newer SDK might show some interesting issues with our current configs due to the newer tools in the SDK.

      
Compile time decisions on what the OS API's and structures look like depend on the SDK in use.
In what fashion can one determine the SDK in use?  Or will the user have to specify that in config.nmake as well?
If the user is running from a command prompt that has run the correct toolchain init script then various env vars get set.  The easiest way to get the correct toolchain init script is to open the command prompt from the Start menu entry for the SDK if you have one installed, else the copy of VS you have installed.  You can also run the commands directly with appropriate parms to select the architecture (x86 or x64) and the target OS (to determine what OS API you can use, SetEnv only), e.g. vcvarsall.bat for VS and SetEnv.cmd for the SDK

Looking at my home machine with VS 2010 & SDK 7.1, from the VS prompt I get "WindowsSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\" and from the SDK prompt I get "WindowsSDKDir=C:\Program Files\Microsoft SDKs\Windows\v7.1\".  I don't see a simple env var that simply states the SDK in use.  The SDK prompt also has an sdkdir var set to the same path.

I'll check some other combinations when I get to work.

-- 
Regards,

Graham Bloice