-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetupbuild.cmd
156 lines (125 loc) · 4.42 KB
/
setupbuild.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
rem @echo off
for /F "tokens=2* delims= " %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.1\WinSDKWin32Tools" /v InstallationFolder') do (
set PSDKDir=%%B
)
if "%PSDKDir%"=="" (
for /F "tokens=2* delims= " %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0\WinSDKWin32Tools" /v InstallationFolder') do (
set PSDKDir=%%B
)
)
if "%PSDKDir%"=="" (
set PSDKDir=!PROGRAMFILES!\Microsoft SDKs\Windows\v7.0\
)
if exist "%PSDKDir%bin\SetEnvVS8.Cmd" (
call "%PSDKDir%bin\SetEnvVS8.Cmd" %1 %2 %3 %4
) else if exist "%PSDKDir%bin\SetEnv.Cmd" (
call "%PSDKDir%bin\SetEnv.Cmd" %1 %2 %3 %4
) else if exist "%PSDKDir%SetEnv.Cmd" (
echo foo
call "%PSDKDir%SetEnv.Cmd" %1 %2 %3 %4
)
cl.exe 2> "%TEMP%\clver.txt" 1> NUL
for /F "tokens=7,8* delims=. " %%A in (%TEMP%\clver.txt) do (
if "%%A"=="Version" (
if "%KH_CLVER%"=="" (
if "%%B"=="14" set KH_CLVER=vc8
if "%%B"=="15" set KH_CLVER=vc9
if "%%B"=="16" set KH_CLVER=vc10
)
) else (
if "%KH_CLVER%"=="" (
if "%%A"=="14" set KH_CLVER=vc8
if "%%A"=="15" set KH_CLVER=vc9
if "%%A"=="16" set KH_CLVER=vc10
)
)
)
if "%KH_CLVER%"=="" (
echo Can't determine Visual C compiler version. Please set KH_CLVER manually to vc8, vc9 or vc10.
exit /b 1
)
del /q "%TEMP%\clver.txt"
set KH_ROOT=%CD%
set NODOCBUILD=1
if "%NODEBUG%"=="1" (
set KH_BUILD=RETAIL
) else (
set KH_BUILD=DEBUG
)
set KH_NO_W2K=1
set KH_RELEASE=PRIVATE
set KH_AUXCFLAGS=/wd4512 /wd4267 /wd4389 /wd4245 /wd4311 /wd4127 /wd4115 /wd4100 /wd4996 /wd4244
rem Try to figure out runtime merge module location
if "%CommonProgramFiles(x86)%"=="" set mmdir=%CommonProgramFiles%\Merge Modules
if not "%CommonProgramFiles(x86)%"=="" set mmdir=%CommonProgramFiles(x86)%\Merge Modules
if exist "%mmdir%" goto runtime-%KH_CLVER%-%KH_BUILD%-%CPU%
:runtime-PSDK
rem We don't have a merge module directory. Perhaps, we have a redist directory?
if exist "%PSDKDir%\Redist\VC" (
set mmdir=%PSDKDir%\Redist\VC
)
if exist "%PSDKDir%\..\Redist\VC" (
set mmdir=%PSDKDir%\..\Redist\VC
)
if "%CPU%"=="AMD64" set KH_RUNTIME_MSM=%mmdir%\microsoft.vcxx.crt.x64_msm.msm
if "%CPU%"=="i386" set KH_RUNTIME_MSM=%mmdir%\microsoft.vcxx.crt.x86_msm.msm
goto done-runtime
:runtime-vc8-DEBUG-AMD64
set KH_RUNTIME_MSM=%mmdir%\Microsoft_VC80_DebugCRT_x86_x64.msm
goto done-runtime
:runtime-vc8-RETAIL-AMD64
set KH_RUNTIME_MSM=%mmdir%\Microsoft_VC80_CRT_x86_x64.msm
goto done-runtime
:runtime-vc8-DEBUG-i386
set KH_RUNTIME_MSM=%mmdir%\Microsoft_VC80_DebugCRT_x86.msm
goto done-runtime
:runtime-vc8-RETAIL-i386
set KH_RUNTIME_MSM=%mmdir%\Microsoft_VC80_CRT_x86.msm
goto done-runtime
:runtime-vc9-DEBUG-AMD64
set KH_RUNTIME_MSM=%mmdir%\Microsoft_VC90_DebugCRT_x86_x64.msm
goto done-runtime
:runtime-vc9-RETAIL-AMD64
set KH_RUNTIME_MSM=%mmdir%\Microsoft_VC90_CRT_x86_x64.msm
goto done-runtime
:runtime-vc9-DEBUG-i386
set KH_RUNTIME_MSM=%mmdir%\Microsoft_VC90_DebugCRT_x86.msm
goto done-runtime
:runtime-vc9-RETAIL-i386
set KH_RUNTIME_MSM=%mmdir%\Microsoft_VC90_CRT_x86.msm
goto done-runtime
:done-runtime
if not exist "%KH_RUNTIME_MSM%" (
echo Error: Can't determine Visual C++ runtime merge module
set KH_RUNTIME_MSM=
exit /b 1
)
set mmdir=
rem ------------------------------------------------------
rem setupbuild.local.cmd
rem ------------------------------------------------------
if exist setupbuild.local.cmd (
call setupbuild.local.cmd
) else (
@echo off
echo Use a setupbuild.local.cmd file to setup variables
echo that are specific for your build environment.
echo The following are required:
echo.
echo - perl.exe should on the system path
echo - KH_DOXYFULLPATH should be the full path to doxygen.exe
echo - KH_HHCFULLPATH should be the full path to hhc.exe
echo - WIXDIR should be the directory containing WiX 3.x
echo - 7ZIP should be the full path to 7-Zip command line executable
echo - KERBEROSCOMPATSDKROOT should the directory containing the Kerberos Compatibility SDK
echo - SIGNTOOL Can be set to the command used to sign binaries
)
@echo off
echo. Warning! If the mkdir being used is not what ships with Windows
echo clean builds will fail due to Cygwin mkdir not supporting
echo recursive directory creation.
echo.
echo Also, the compiler may generate lots of warnings. To suppress some
echo of them, the KH_AUXCFLAGS environment variable was specified with
echo a number of /wdxxxx flags.
title NetIDMgr %CPU% %KH_BUILD% %KH_RELEASE%