diff options
Diffstat (limited to 'setup-vc.cmd')
-rw-r--r-- | setup-vc.cmd | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/setup-vc.cmd b/setup-vc.cmd new file mode 100644 index 0000000..e93262e --- /dev/null +++ b/setup-vc.cmd | |||
@@ -0,0 +1,90 @@ | |||
1 | @echo off | ||
2 | REM | ||
3 | REM Setting up command line to use Visual C++ 2005/2008 Express | ||
4 | REM | ||
5 | REM Visual C++ 2005: | ||
6 | REM VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8\VC | ||
7 | REM VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\ | ||
8 | REM VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8 | ||
9 | REM | ||
10 | REM Visual C++ 2008: | ||
11 | REM VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 9.0\VC | ||
12 | REM VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\ | ||
13 | REM VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 9.0 | ||
14 | REM | ||
15 | |||
16 | REM Test for VC++2005 FIRST, because it is the norm with Lua 5.1.4 | ||
17 | REM LuaBinaries and LfW. All prebuilt modules and lua.exe are built | ||
18 | REM with it. | ||
19 | REM | ||
20 | set VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8 | ||
21 | if not exist "%VSINSTALLDIR%\VC\vcvarsall.bat" goto TRY_VC9 | ||
22 | |||
23 | REM Win32 headers must be separately downloaded for VC++2005 | ||
24 | REM (VC++2008 SP1 carries an SDK with it) | ||
25 | REM | ||
26 | set _SDK=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.cmd | ||
27 | if not exist "%_SDK%" goto ERR_NOSDK | ||
28 | call "%_SDK%" | ||
29 | goto FOUND_VC | ||
30 | |||
31 | :TRY_VC9 | ||
32 | set VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 9.0 | ||
33 | if not exist "%VSINSTALLDIR%\VC\vcvarsall.bat" goto ERR_NOVC | ||
34 | |||
35 | echo. | ||
36 | echo *** Warning: Visual C++ 2008 in use *** | ||
37 | echo. | ||
38 | echo Using VC++2005 is recommended for runtime compatibility issues | ||
39 | echo (LuaBinaries and LfW use it; if you compile everything from | ||
40 | echo scratch, ignore this message) | ||
41 | echo. | ||
42 | |||
43 | :FOUND_VC | ||
44 | set VCINSTALLDIR=%VSINSTALLDIR%\vc | ||
45 | |||
46 | REM vcvars.bat sets the following values right: | ||
47 | REM | ||
48 | REM PATH=... | ||
49 | REM INCLUDE=%VCINSTALLDIR%\ATLMFC\INCLUDE;%VCINSTALLDIR%\INCLUDE;%VCINSTALLDIR%\PlatformSDK\include;%FrameworkSDKDir%\include;%INCLUDE% | ||
50 | REM LIB=%VCINSTALLDIR%\ATLMFC\LIB;%VCINSTALLDIR%\LIB;%VCINSTALLDIR%\PlatformSDK\lib;%FrameworkSDKDir%\lib;%LIB% | ||
51 | REM LIBPATH=%FrameworkDir%\%FrameworkVersion%;%VCINSTALLDIR%\ATLMFC\LIB | ||
52 | REM | ||
53 | call "%VSINSTALLDIR%\VC\vcvarsall.bat" | ||
54 | |||
55 | REM 'timeit.exe' is part of the MS Server Res Kit Tools (needed for "make perftest") | ||
56 | REM | ||
57 | set _RESKIT=C:\Program Files\Windows Resource Kits\Tools\ | ||
58 | if not exist "%_RESKIT%\timeit.exe" goto WARN_NOTIMEIT | ||
59 | PATH=%PATH%;%_RESKIT% | ||
60 | goto EXIT | ||
61 | |||
62 | :WARN_NOTIMEIT | ||
63 | echo. | ||
64 | echo ** WARNING: Windows Server 2003 Resource Kit Tools - not detected | ||
65 | echo You will need the 'timeit' utility to run 'make perftest' | ||
66 | echo http://www.microsoft.com/downloads/details.aspx?familyid=9D467A69-57FF-4AE7-96EE-B18C4790CFFD | ||
67 | echo. | ||
68 | goto EXIT | ||
69 | |||
70 | REM --- | ||
71 | :ERR_NOVC | ||
72 | echo. | ||
73 | echo ** ERROR: Visual C++ 2005/08 Express - not detected | ||
74 | echo You can set the environment variables separately, and run 'make-vc.cmd' | ||
75 | echo or download the compiler from: | ||
76 | echo http://msdn.microsoft.com/vstudio/express/downloads/ | ||
77 | echo. | ||
78 | goto EXIT | ||
79 | |||
80 | :ERR_NOSDK | ||
81 | echo. | ||
82 | echo ** ERROR: Windows Server 2003 Platform SDK - not detected | ||
83 | echo You will need the core API's of it to compile Win32 applications. | ||
84 | echo http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB | ||
85 | echo. | ||
86 | goto EXIT | ||
87 | |||
88 | :EXIT | ||
89 | set _SDK= | ||
90 | set _RESKIT= | ||