1@echo off
2
3REM Use old Windows SDK 6.1 so created .exe will be compatible with
4REM old Windows versions.
5REM Windows SDK 6.1 may be downloaded at:
6REM  http://www.microsoft.com/en-us/download/details.aspx?id=11310
7set PATH_OLD=%PATH%
8
9REM The SDK creates a false install of Visual Studio at one of these locations
10set PATH=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin;%PATH%
11set PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin;%PATH%
12
13REM set up the environment to compile to x86
14call VCVARS32
15if "%ERRORLEVEL%"=="0" (
16  cl /D "GUI=0" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:x86 /SUBSYSTEM:CONSOLE /out:setuptools/cli-32.exe
17  cl /D "GUI=1" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:x86 /SUBSYSTEM:WINDOWS /out:setuptools/gui-32.exe
18) else (
19  echo Windows SDK 6.1 not found to build Windows 32-bit version
20)
21
22REM buildout (and possibly other implementations) currently depend on
23REM the 32-bit launcher scripts without the -32 in the filename, so copy them
24REM there for now.
25copy setuptools/cli-32.exe setuptools/cli.exe
26copy setuptools/gui-32.exe setuptools/gui.exe
27
28REM now for 64-bit
29REM Use the x86_amd64 profile, which is the 32-bit cross compiler for amd64
30call VCVARSx86_amd64
31if "%ERRORLEVEL%"=="0" (
32  cl /D "GUI=0" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:x64 /SUBSYSTEM:CONSOLE /out:setuptools/cli-64.exe
33  cl /D "GUI=1" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:x64 /SUBSYSTEM:WINDOWS /out:setuptools/gui-64.exe
34) else (
35  echo Windows SDK 6.1 not found to build Windows 64-bit version
36)
37
38set PATH=%PATH_OLD%
39
40