-
Notifications
You must be signed in to change notification settings - Fork 15
/
setenv_base.cmd
405 lines (300 loc) · 9.79 KB
/
setenv_base.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
@echo off
set PORT_BUILD=
set NO_ADS_WRAPPER=
SET COMPILER_TOOL=
if NOT "%1"=="" GOTO :ARGSOK
if NOT "%2"=="" GOTO :ARGSOK
:ERROR
@echo.
@echo Error: Invalid Arguments!
@echo.
@echo Usage: setenv_base COMPILER_TOOL COMPILER_TOOL_VERSION
@echo where COMPILER_TOOL is BLACKFIN, GCC, GCCOP, ADS, RVDS, MDK, SHC, VS
@echo COMPILER_TOOL_VERSION is the version of the compiler
@echo
@echo e.g. setenv.cmd GCC 4.2.1
@echo.
GOTO :EOF
:ARGSOK
SET COMPILER_TOOL=%1
SET COMPILER_TOOL_VERSION_NUM=%2
SET COMPILER_TOOL_VERSION=%1%2
SET ARG3=%~3
SET TFSCONFIG=MFConfig.xml
IF /I NOT "%COMPILER_TOOL%"=="RVDS" IF /I NOT "%COMPILER_TOOL%"=="ADS" set NO_ADS_WRAPPER=1
@ECHO Compiler: %COMPILER_TOOL% %COMPILER_TOOL_VERSION_NUM% %ARG3%
SET CURRENTCD=%CD%
CALL "%~dp0\tools\scripts\init.cmd"
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
SET SPOCLIENT=%CLRROOT%
pushd %SPOCLIENT%\..
SET SPOROOT=%CD%
popd
set NetMfTargetsBaseDir=%SPOCLIENT%\Framework\IDE\Targets\
set _SDROOT_=%SPOROOT:current=%
if "%_SDROOT_:~-1%" == "\" set _SDROOT_=%_SDROOT_:~0,-1%
rem @ make sure we start with a clean path
if "%DOTNETMF_OLD_PATH%"=="" (
goto :save_current_path
) else (
goto :restore_path_from_old
)
:save_current_path
set DOTNETMF_OLD_PATH=%PATH%
goto :after_path_saved_or_restored
:restore_path_from_old
set PATH=%DOTNETMF_OLD_PATH%
:after_path_saved_or_restored
set PATH=%SPOROOT%\tools\NUnit;%SPOROOT%\tools\SDPack;%SPOROOT%\bin;%PATH%
set PATH=%SPOROOT%\tools\x86\perl\bin;%SPOROOT%\tools\x86\bin;%CLRROOT%\tools\bin;%PATH%;%CLRROOT%\tools\scripts
set PATH=%CLRROOT%\BuildOutput\Public\%FLAVOR_WIN%\Test\Server\dll;%PATH%
cd %CURRENTCD%
set CURRENTCD=
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
rem set tool-chains variables
IF /I NOT "%COMPILER_TOOL%" == "VS" (
IF NOT "%VS110COMNTOOLS%" == "" (
CALL "%VS110COMNTOOLS%vsvars32.bat"
) ELSE (
IF NOT "%VS100COMNTOOLS%" == "" (
CALL "%VS100COMNTOOLS%vsvars32.bat"
) ELSE (
IF NOT "%VS90COMNTOOLS%" == "" (
CALL "%VS90COMNTOOLS%vsvars32.bat"
) ELSE (
@ECHO WARNING: Could not find vsvars32.bat.
@ECHO WARNING: VISUAL C++ DOES NOT APPEAR TO BE INSTALLED ON THIS MACHINE
GOTO :EOF
)
)
)
)
set TINYCLR_USE_MSBUILD=1
Title MF %FLAVOR_WIN% (%COMPILER_TOOL% %COMPILER_TOOL_VERSION_NUM%)
IF /I "%COMPILER_TOOL%"=="VS" GOTO :SET_VS_VARS
IF /I "%COMPILER_TOOL%"=="ADI" GOTO :SET_BLACKFIN_VARS
IF /I "%COMPILER_TOOL%"=="GCC" GOTO :SET_GCC_VARS
IF /I "%COMPILER_TOOL%"=="GCCOP" GOTO :SET_GCC_VARS
IF /I "%COMPILER_TOOL%"=="MDK" GOTO :SET_MDK_VARS
IF /I "%COMPILER_TOOL%"=="SHC" GOTO :SET_SHC_VARS
IF /I "%COMPILER_TOOL%"=="ADS" GOTO :SET_RVDS_VARS
IF /I "%COMPILER_TOOL%"=="RVDS" GOTO :SET_RVDS_VARS
IF "%COMPILER_TOOL%"=="" GOTO :ERROR
GOTO :EOF
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:SET_RVDS_VARS
REM dotnetmf team internal setting
set DOTNETMF_COMPILER=%COMPILER_TOOL_VERSION%
SET RVDS_EXT=_v%COMPILER_TOOL_VERSION_NUM:.=_%
SET RVCT_EXT=%COMPILER_TOOL_VERSION_NUM:.=%
IF /I "%COMPILER_TOOL_VERSION_NUM%"=="1.2" (
SET RVDS_EXT=
SET DOTNETMF_COMPILER=ADS1.2
IF NOT "%ARMROOT%" == "%SPOCLIENT%\tools\ads" (
IF NOT "" == "%ARMHOME%" GOTO :SET_RVDS_V12_VARS
)
)
setlocal EnableDelayedExpansion
IF /I NOT "%COMPILER_TOOL_VERSION_NUM%"=="4.1" (
SET TMPBIN=!RVCT%RVCT_EXT%BIN!
SET TMPINC=!RVCT%RVCT_EXT%INC!
SET TMPLIB=!RVCT%RVCT_EXT%LIB!
) ELSE (
SET TMPBIN=%ARMCC41BIN%
SET TMPINC=%ARMCC41INC%
SET TMPLIB=%ARMCC41LIB%
)
endlocal && SET TMPBIN=%TMPBIN%&& SET TMPINC=%TMPINC%&& SET TMPLIB=%TMPLIB%
IF NOT EXIST "%SPOCLIENT%\tools\ads%RVDS_EXT%\BIN\ARMAR.exe" (
IF /I NOT "%ARMROOT%" == "%SPOCLIENT%\tools\ads%RVDS_EXT%" (
IF NOT "" == "%TMPBIN%" (
IF EXIST "%TMPBIN%\armar.exe" (
@echo Using Installed RVDS vars
SET NO_ADS_WRAPPER=1
SET ARMHOME=%ARMROOT%
SET ARMBIN=%TMPBIN%
SET ARMLIB=%TMPLIB%
SET ARMINC=%TMPINC%
SET ADS_TOOLS=%ARMROOT%
SET ADS_TOOLS_BIN=%TMPBIN%
SET RVDS_INSTALLED=TRUE
SET TMPBIN=
SET TMPINC=
SET TMPLIB=
GOTO :EOF
))))
@echo setting source depot RVDS vars
SET TMPBIN=
SET TMPINC=
SET TMPLIB=
set PATH=%CLRROOT%\tools\ads%RVDS_EXT%\bin;%PATH%
set ARMROOT=%SPOCLIENT%\tools\ads%RVDS_EXT%
set ARMHOME=%ARMROOT%
set ARMLMD_LICENSE_FILE=%ARMROOT%\licenses\license.dat
set ADS_TOOLS=%ARMROOT%
set ARMCONF=%ARMROOT%\BIN
set ARMINC=%ARMROOT%\INCLUDE
set ARMDLL=%ARMROOT%\BIN
set ARMLIB=%ARMROOT%\LIB
set ARMBIN=%ARMROOT%\BIN
set ADS_TOOLS_BIN=%ADS_TOOLS%\BIN
IF NOT "%RVCT_EXT%"=="" (
set RVCT%RVCT_EXT%BIN=%ARMBIN%
set RVCT%RVCT_EXT%INC=%ARMINC%
set RVCT%RVCT_EXT%LIB=%ARMLIB%
)
GOTO :EOF
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:SET_RVDS_V12_VARS
@echo setting vars for RVDS 1.2 compiler
SET COMPILER_TOOL=RVDS
set DOTNETMF_COMPILER=ADS%COMPILER_TOOL_VERSION_NUM%
set ARMROOT=%ARMHOME%
set ADS_TOOLS_BIN=%ARMDLL%
GOTO :EOF
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:SET_BLACKFIN_VARS
@ECHO Setting ADI env var and path
set NO_ADS_WRAPPER=1
set DOTNETMF_COMPILER=ADI%COMPILER_TOOL_VERSION_NUM%
IF NOT "%ARG%" == "" GOTO :DSP_INSTALLED
IF NOT "%ADI_DSP%" == "" GOTO :DSP_INSTALLED
set ADI_DSP=%CLRROOT%\tools\adi\
set ANALOGD_LECENSE_FILE=%ADI_DSP%\license.dat
echo adding HKLM\Software\Analog Devices\VisualDSP++ %COMPILER_TOOL_VERSION_NUM%\Install Path=%ADI_DSP%
call reg add "HKLM\Software\Analog Devices" /f
call reg add "HKLM\Software\Analog Devices\VisualDSP++ %COMPILER_TOOL_VERSION_NUM%" /f
call reg add "HKLM\Software\Analog Devices\VisualDSP++ %COMPILER_TOOL_VERSION_NUM%" /f /v "Install Path" /t REG_SZ /d %ADI_DSP%
echo adding HKLM\Software\Analog Devices\VisualDSP++ %COMPILER_TOOL_VERSION_NUM%\License Path=%ADI_DSP%
call reg add "HKLM\Software\Analog Devices\VisualDSP++ %COMPILER_TOOL_VERSION_NUM%" /f /v "License Path" /t REG_SZ /d %ADI_DSP%
:DSP_INSTALLED
IF "%ADI_DSP%"=="" set ADI_DSP=%ARG3%
set PATH=%ADI_DSP%;%PATH%
GOTO :EOF
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:SET_GCC_VARS
@echo setting vars for GCC compiler %COMPILER_TOOL_VERSION%
rem use a default for GCC
IF "%ARG3%"=="" SET ARG3=%SystemDrive%\gnu\gcc
IF NOT EXIST "%ARG3%" GOTO :BAD_GCC_ARG
set ARMROOT=
set ADS_TOOLS_BIN=
set NO_ADS_WRAPPER=1
set GNU_VERSION=%COMPILER_TOOL_VERSION_NUM%
SET COMPILER_TOOL_VERSION_NUM=%COMPILER_TOOL_VERSION_NUM:~0,3%
SET COMPILER_TOOL_VERSION=%COMPILER_TOOL%%COMPILER_TOOL_VERSION_NUM:~0,3%
set DOTNETMF_COMPILER=%COMPILER_TOOL_VERSION%
IF /I "%COMPILER_TOOL%"=="GCC" (
IF EXIST "%ARG3%\lib\gcc\arm-none-eabi\%GNU_VERSION%" (
set ARMINC=%ARG3%\lib\gcc\arm-none-eabi\%GNU_VERSION%\include
set ARMLIB=%ARG3%\lib\gcc\arm-none-eabi\%GNU_VERSION%
set GNU_TOOLS=%ARG3%
set GNU_TOOLS_BIN=%ARG3%\bin
set GNU_TARGET=arm-none-eabi
) ELSE (
@ECHO Could not find %ARG3%\lib\gcc\arm-none-eabi\%GNU_VERSION%
GOTO :BAD_GCC_ARG
))
IF /I "%COMPILER_TOOL%"=="GCCOP" (
IF EXIST "%ARG3%\include\elips_bs" (
set ARMINC=%ARG3%\include\elips_bs
set ARMLIB=%ARG3%\lib
set GNU_TOOLS=%ARG3%
set GNU_TOOLS_BIN=%ARG3%\bin
set GNU_TARGET=arm-elf
set COMPILER_PATH=%ARG3%
) ELSE (
@ECHO Could not find %ARG3%\include\elips_bs
GOTO :BAD_GCC_ARG
))
GOTO :EOF
:BAD_GCC_ARG
@ECHO.
@ECHO Error - Invalid argument (%ARG3%). Usage: setenv_GCC.cmd GCC_VERSION GCC_TOOL_PATH
@ECHO Example: setenv_gcc.cmd 4.2.1 c:\tools\gcc
@ECHO.
GOTO :EOF
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:SET_MDK_VARS
@ECHO Setting MDK env var and path for version %COMPILER_TOOL_VERSION%
rem use a default for MDK
set NO_ADS_WRAPPER=1
set DOTNETMF_COMPILER=%COMPILER_TOOL_VERSION%
IF "%ARG3%"=="" set ARG3=%SystemDrive%\Keil\ARM
IF NOT EXIST "%ARG3%" GOTO :BAD_MDK_ARG
SET MDK_TOOL_PATH=%ARG3%
SET PATH=%MDK_TOOL_PATH%;%PATH%
SET MDK_EXT=%COMPILER_TOOL_VERSION_NUM:~0,1%
SET MDK_SUB_EXT=%COMPILER_TOOL_VERSION_NUM:~2,2%
IF "%MDK_EXT%"=="3" SET MDK_EXT=31
IF "%MDK_EXT%"=="4" (
IF "%MDK_SUB_EXT%"=="54" (
SET MDK_EXT=40
) ELSE (
SET MDK_EXT=31
)
)
IF "%MDK_EXT%"=="" (
@echo Unsupported MDK version %COMPILER_TOOL_VERSION_NUM%
GOTO :BAD_MDK_ARG
)
SET RVCT%MDK_EXT%BIN=%MDK_TOOL_PATH%\ARM\BIN%MDK_EXT%
SET RVCT31LIB=%MDK_TOOL_PATH%\RV31\LIB
SET RVCT31INC=%MDK_TOOL_PATH%\RV31\INC
GOTO :EOF
:BAD_MDK_ARG
@ECHO.
@ECHO Error - Invalid argument. Could not find MDK path %ARG3%.
@ECHO.
GOTO :EOF
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:SET_VS_VARS
set NO_ADS_WRAPPER=1
set DOTNETMF_COMPILER=%COMPILER_TOOL_VERSION%
IF "%COMPILER_TOOL_VERSION_NUM%"=="9" (
IF "" == "%VS90COMNTOOLS%" GOTO BAD_VS_ARG
CALL "%VS90COMNTOOLS%vsvars32.bat"
GOTO :EOF
)
IF "%COMPILER_TOOL_VERSION_NUM%"=="10" (
IF "" == "%VS100COMNTOOLS%" GOTO BAD_VS_ARG
CALL "%VS100COMNTOOLS%vsvars32.bat"
GOTO :EOF
)
IF "%COMPILER_TOOL_VERSION_NUM%"=="11" (
IF "" == "%VS110COMNTOOLS%" GOTO BAD_VS_ARG
CALL "%VS110COMNTOOLS%vsvars32.bat"
GOTO :EOF
)
:BAD_VS_ARG
@ECHO.
@ECHO Error - Invalid argument. Could not find VSVARS32.bat for VS%COMPILER_TOOL_VERSION_NUM%
@ECHO.
GOTO :EOF
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
:SET_SHC_VARS
SET COMPILER_TOOL=SHC
set NO_ADS_WRAPPER=1
set DOTNETMF_COMPILER=%COMPILER_TOOL_VERSION%
SET SHC_VER_PATH=%COMPILER_TOOL_VERSION_NUM:.=_%
IF "%ARG3%"=="" (
SET SHC_TOOL_PATH=%SPOCLIENT%\tools\SH\%SHC_VER_PATH%
) ELSE (
SET SHC_TOOL_PATH=%ARG3:"=%
)
IF NOT EXIST "%SHC_TOOL_PATH%\BIN\SHCPP.exe" SET SHC_TOOL_PATH=%SHC_TOOL_ROOT%%SHC_VER_PATH%
IF NOT EXIST "%SHC_TOOL_PATH%\BIN\SHCPP.exe" GOTO :BAD_SHC_ARG
set PATH=%SHC_TOOL_PATH%\bin;%PATH%
set SHC_LIB=%SHC_TOOL_PATH%\bin
set SHC_INC=%SHC_TOOL_PATH%\include
set SHC_TMP=%SHC_TOOL_PATH%\CTemp
set SHC_TOOLS_BIN=%SHC_TOOL_PATH%\bin
GOTO :EOF
:BAD_SHC_ARG
SET SHC_TOOL_PATH=
@ECHO.
@ECHO Error - Invalid argument. Usage: setenv.cmd SHC_TOOL_PATH
@ECHO Example: setenv.cmd c:\sh\9_2_0
@ECHO.
GOTO :EOF
rem @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@