1 | @echo off
|
---|
2 | rem
|
---|
3 | rem INTEL CORPORATION PROPRIETARY INFORMATION
|
---|
4 | rem This software is supplied under the terms of a license agreement or
|
---|
5 | rem nondisclosure agreement with Intel Corporation and may not be copied
|
---|
6 | rem or disclosed except in accordance with the terms of that agreement.
|
---|
7 | rem Copyright(c) 2007 Intel Corporation. All Rights Reserved.
|
---|
8 | rem
|
---|
9 |
|
---|
10 |
|
---|
11 | set _WIN32_WINNT=0x0501
|
---|
12 |
|
---|
13 | @if "%ARG%"=="" goto waterfall
|
---|
14 |
|
---|
15 | @if "%ARG%"=="icl101" @CALL :SET_INTEL_ENV 10.1
|
---|
16 | @if "%ARG%"=="icl10" @CALL :SET_INTEL_ENV 10.0
|
---|
17 | @if "%ARG%"=="icl91" @CALL :SET_INTEL_ENV 9.1
|
---|
18 | @if "%ARG%"=="cl9" @CALL :SET_VS9_ENV %vsdk_opt%
|
---|
19 | @if "%ARG%"=="cl8" @CALL :SET_VS8_ENV %vsdk_opt%
|
---|
20 | @if "%ARG%"=="cl7" @CALL :SET_VS7_ENV %sdk_opt%
|
---|
21 | @if "%ARG%"=="cl6" @CALL :SET_VS6_ENV %sdk_opt%
|
---|
22 | @if "%ARG%"=="ifort101" @CALL :SET_INTEL_FOR_ENV 10.1
|
---|
23 | @if "%ARG%"=="ifort10" @CALL :SET_INTEL_FOR_ENV 10.0
|
---|
24 | @if "%ARG%"=="ifort9" @CALL :SET_INTEL_FOR_ENV 9.1
|
---|
25 | @if "%ARG%"=="clarm" @CALL :SET_WCE500_TOOLS
|
---|
26 | @if "%ARG%"=="ecl" @CALL :SET_WCE500_TOOLS
|
---|
27 |
|
---|
28 | @if defined TOOL (set COMP=%ARG%&goto:eof)
|
---|
29 | @CALL :ERR "Compiler "%ARG%" environment is not found"
|
---|
30 | goto:eof
|
---|
31 |
|
---|
32 | :waterfall
|
---|
33 | if "%COMP_TYPE%" == "fortran" (
|
---|
34 | @CALL :SET_INTEL_FOR_ENV 10
|
---|
35 | @if not defined TOOL @CALL :SET_INTEL_FOR_ENV 9.1
|
---|
36 | @if not defined TOOL @CALL :ERR "Intel Fortran environment not found"
|
---|
37 | goto:eof
|
---|
38 | )
|
---|
39 |
|
---|
40 |
|
---|
41 | set COMP=cl6
|
---|
42 | @CALL :SET_VS6_ENV %sdk_opt%
|
---|
43 | @if not defined TOOL (
|
---|
44 | set COMP=icl10
|
---|
45 | @CALL :SET_INTEL_ENV 10
|
---|
46 | )
|
---|
47 | @if not defined TOOL (
|
---|
48 | set COMP=icl91
|
---|
49 | @CALL :SET_INTEL_ENV 9.1
|
---|
50 | )
|
---|
51 | @if not defined TOOL (
|
---|
52 | set COMP=cl9
|
---|
53 | @CALL :SET_VS9_ENV %sdk_opt%
|
---|
54 | )
|
---|
55 | @if not defined TOOL (
|
---|
56 | set COMP=cl8
|
---|
57 | @CALL :SET_VS8_ENV %vsdk_opt%
|
---|
58 | )
|
---|
59 | @if not defined TOOL (
|
---|
60 | set COMP=cl7
|
---|
61 | @CALL :SET_VS7_ENV %sdk_opt%
|
---|
62 | )
|
---|
63 | @if defined TOOL goto:eof
|
---|
64 | @CALL :ERR "No any valid compiler environment found"
|
---|
65 | goto:eof
|
---|
66 |
|
---|
67 | ::::::::::::::::::
|
---|
68 | :SET_INTEL_ENV
|
---|
69 | set COMPILER=icl.exe
|
---|
70 |
|
---|
71 | set ptn= dir /B /ON "%PrF%\Intel\Compiler\C++\%1.*"
|
---|
72 | @%ptn% 2>NUL 1>&2
|
---|
73 | if "%errorlevel%"=="0" for /F "usebackq" %%i in (`%ptn%`) do set LASTVERSION=%%i
|
---|
74 | set ENV="%PrF%\Intel\Compiler\C++\%LASTVERSION%\%AR%\Bin\iclvars.bat"
|
---|
75 | if exist %ENV% (
|
---|
76 | set TOOL=%ENV%
|
---|
77 | @echo +++ Intel C++ Compiler v.%LASTVERSION% for %AR% is taken
|
---|
78 | exit /b
|
---|
79 | )
|
---|
80 | echo --- Intel C++ Compiler %ARG% for %AR% environment is not found.
|
---|
81 | exit /b 1
|
---|
82 |
|
---|
83 | :SET_VS9_ENV
|
---|
84 | set COMPILER=cl.exe
|
---|
85 | set _WIN32_WINNT=0x0502
|
---|
86 | set ENV="%VS90COMNTOOLS%\..\..\vc\bin\%MSAR%"
|
---|
87 |
|
---|
88 | if exist %ENV% (
|
---|
89 | set TOOL=%ENV%
|
---|
90 | @echo +++ Microsoft Visual Studio 2008 compiler for %AR% is taken
|
---|
91 | exit /b
|
---|
92 | )
|
---|
93 | set ENV="%ProgramFiles%\Microsoft SDKs\windows\v6.0\bin\setenv.cmd"
|
---|
94 | if defined ProgramW6432 set ENV="%ProgramW6432%\Microsoft SDKs\windows\v6.0\bin\setenv.cmd"
|
---|
95 | if exist %ENV% (
|
---|
96 | @echo +++ Microsoft Vista SDK v6.0 is taken
|
---|
97 | set VistaSDK=yes
|
---|
98 | set TOOL=%ENV% %~1
|
---|
99 | exit /b
|
---|
100 | )
|
---|
101 | echo --- Microsoft Visual Studio 2008 environment is not found.
|
---|
102 | exit /b 1
|
---|
103 |
|
---|
104 |
|
---|
105 | :SET_VS6_ENV
|
---|
106 | set COMPILER=cl.exe
|
---|
107 | set _WIN32_WINNT=0x0501
|
---|
108 | set ENV="C:\Program Files\Microsoft Visual Studio\VC98\Bin\%MSAR%"
|
---|
109 |
|
---|
110 | if exist %ENV% (
|
---|
111 | set TOOL=%ENV%
|
---|
112 | @echo +++ Microsoft Visual Studio 6 compiler for %AR% is taken
|
---|
113 | exit /b
|
---|
114 | )
|
---|
115 | echo --- Microsoft Visual Studio 2006 environment is not found.
|
---|
116 | exit /b 1
|
---|
117 |
|
---|
118 |
|
---|
119 | :SET_VS8_ENV
|
---|
120 | set COMPILER=cl.exe
|
---|
121 |
|
---|
122 | set ENV="%VS80COMNTOOLS%\..\..\vc\bin\%MSAR%"
|
---|
123 | if exist %ENV% (
|
---|
124 | set TOOL=%ENV%
|
---|
125 | @echo +++ Microsoft Visual Studio 2005 compiler for %AR% is taken
|
---|
126 | exit /b
|
---|
127 | )
|
---|
128 | set ENV="%ProgramFiles%\Microsoft SDKs\windows\v6.0\bin\setenv.cmd"
|
---|
129 | if defined ProgramW6432 set ENV="%ProgramW6432%\Microsoft SDKs\windows\v6.0\bin\setenv.cmd"
|
---|
130 | if exist %ENV% (
|
---|
131 | @echo +++ Microsoft Vista SDK v6.0 is taken
|
---|
132 | set VistaSDK=yes
|
---|
133 | set TOOL=%ENV% %~1
|
---|
134 | exit /b
|
---|
135 | )
|
---|
136 | echo --- Microsoft Visual Studio 2005 environment is not found.
|
---|
137 | exit /b 1
|
---|
138 |
|
---|
139 | :SET_VS7_ENV
|
---|
140 | set COMPILER=cl.exe
|
---|
141 | if not "%AR%" == "IA32" goto sdk
|
---|
142 | set ENV="%VS71COMNTOOLS%\vsvars32.bat"
|
---|
143 | if exist %ENV% (
|
---|
144 | set TOOL=%ENV%
|
---|
145 | @echo +++ Microsoft Visual Studio 2003 compiler is taken
|
---|
146 | exit /b
|
---|
147 | )
|
---|
148 | echo --- Microsoft Visual Studio 2003 environment is not found.
|
---|
149 | exit /b 1
|
---|
150 |
|
---|
151 | :sdk
|
---|
152 | set ENV="%ProgramFiles%\Microsoft Platform SDK for Windows Server 2003 R2\setenv.cmd"
|
---|
153 | if exist %ENV% (
|
---|
154 | @echo +++ Microsoft Platform SDK for Windows Server 2003 R2 is taken
|
---|
155 | set TOOL=%ENV% %~1
|
---|
156 | exit /b
|
---|
157 | )
|
---|
158 |
|
---|
159 | set ENV="%ProgramFiles%\Microsoft Platform SDK\setenv.cmd"
|
---|
160 | if exist %ENV% (
|
---|
161 | @echo +++ Microsoft Platform SDK * is taken
|
---|
162 | set TOOL=%ENV% %~1
|
---|
163 | exit /b
|
---|
164 | )
|
---|
165 | set ENV="%ProgramFiles%\Microsoft Platform SDK\setenv.bat"
|
---|
166 | if exist %ENV% (
|
---|
167 | @echo +++ Microsoft Platform SDK is taken
|
---|
168 | set TOOL=%ENV% %~1
|
---|
169 | exit /b
|
---|
170 | )
|
---|
171 | @echo --- MS Platform SDK is not found.
|
---|
172 | exit /b 1
|
---|
173 |
|
---|
174 | :SET_INTEL_FOR_ENV
|
---|
175 | set COMPILER=ifort.exe
|
---|
176 | set ptn= dir /B /ON "%PrF%\Intel\Compiler\fortran\%1.*"
|
---|
177 | @%ptn% 2>NUL 1>&2
|
---|
178 | if "%errorlevel%"=="0" for /F "usebackq" %%i in (`%ptn%`) do set LASTVERSION=%%i
|
---|
179 | set ENV="%PrF%\Intel\Compiler\fortran\%LASTVERSION%\%AR%\Bin\ifortvars.bat"
|
---|
180 | if exist %ENV% (
|
---|
181 | set TOOL=%ENV%
|
---|
182 | @echo +++ Intel Fortran Compiler v.%LASTVERSION% for %AR% is taken
|
---|
183 | set COMP=f%LASTVERSION%
|
---|
184 | exit /b
|
---|
185 | )
|
---|
186 | exit /b 1
|
---|
187 |
|
---|
188 |
|
---|
189 | :SET_WCE500_TOOLS
|
---|
190 | set COMPILER=%ARG%
|
---|
191 | if exist %SDKROOT% goto pass_SDKROOT_SET
|
---|
192 | set __SDK_TOUCH="C:\Program Files\Windows CE Tools\wce500\"
|
---|
193 | if exist %__SDK_TOUCH% set SDKROOT=C:\Program Files\Windows CE Tools
|
---|
194 | :pass_SDKROOT_SET
|
---|
195 | set TOOL="%ProgramFiles%\Microsoft eMbedded C++ 4.0\EVC\wce500\bin\WCEARMV4I.BAT"
|
---|
196 | if "%ARG%"=="ecl" (
|
---|
197 | set TOOL="%ProgramFiles%\Microsoft eMbedded C++ 4.0\EVC\wce500\bin\WCEx86.BAT"
|
---|
198 | set COMPILER=cl
|
---|
199 | )
|
---|
200 | @echo +++ Microsoft eMbedded C++ 4.0 for %AR% is taken
|
---|
201 | exit /b
|
---|
202 |
|
---|
203 | :::::::::::::::::::::::
|
---|
204 | :ERR
|
---|
205 | @echo ---
|
---|
206 | @echo --- ERROR: %~1
|
---|
207 | @echo ---
|
---|
208 | exit /b -1
|
---|
209 |
|
---|