Intel_IPP_Codecs: search_compilers.bat

File search_compilers.bat, 5.7 KB (added by bennylp, 16 years ago)
Line 
1@echo off
2rem
3rem                  INTEL CORPORATION PROPRIETARY INFORMATION
4rem     This software is supplied under the terms of a license agreement or
5rem     nondisclosure agreement with Intel Corporation and may not be copied
6rem     or disclosed except in accordance with the terms of that agreement.
7rem          Copyright(c) 2007 Intel Corporation. All Rights Reserved.
8rem
9
10
11set _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"
30goto:eof
31
32:waterfall
33if "%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
41set 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"
65goto:eof
66
67::::::::::::::::::
68:SET_INTEL_ENV
69set COMPILER=icl.exe
70
71set ptn= dir /B /ON "%PrF%\Intel\Compiler\C++\%1.*"
72@%ptn% 2>NUL 1>&2
73if "%errorlevel%"=="0" for /F "usebackq" %%i in (`%ptn%`) do set LASTVERSION=%%i
74set ENV="%PrF%\Intel\Compiler\C++\%LASTVERSION%\%AR%\Bin\iclvars.bat"
75if 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
84set COMPILER=cl.exe
85set _WIN32_WINNT=0x0502
86set ENV="%VS90COMNTOOLS%\..\..\vc\bin\%MSAR%"
87
88if exist %ENV% (
89  set TOOL=%ENV%
90  @echo +++ Microsoft Visual Studio 2008 compiler for %AR% is taken
91  exit /b
92)
93set ENV="%ProgramFiles%\Microsoft SDKs\windows\v6.0\bin\setenv.cmd"
94if defined ProgramW6432 set ENV="%ProgramW6432%\Microsoft SDKs\windows\v6.0\bin\setenv.cmd"
95if exist %ENV% (
96  @echo +++ Microsoft Vista SDK v6.0 is taken
97  set VistaSDK=yes
98  set TOOL=%ENV% %~1
99  exit /b
100)
101echo --- Microsoft Visual Studio 2008 environment is not found.
102exit /b 1 
103 
104 
105:SET_VS6_ENV
106set COMPILER=cl.exe
107set _WIN32_WINNT=0x0501
108set ENV="C:\Program Files\Microsoft Visual Studio\VC98\Bin\%MSAR%"
109
110if exist %ENV% (
111  set TOOL=%ENV%
112  @echo +++ Microsoft Visual Studio 6 compiler for %AR% is taken
113  exit /b
114)
115echo --- Microsoft Visual Studio 2006 environment is not found.
116exit /b 1 
117 
118 
119:SET_VS8_ENV
120set COMPILER=cl.exe
121
122set ENV="%VS80COMNTOOLS%\..\..\vc\bin\%MSAR%"
123if exist %ENV% (
124  set TOOL=%ENV%
125  @echo +++ Microsoft Visual Studio 2005 compiler for %AR% is taken
126  exit /b
127)
128set ENV="%ProgramFiles%\Microsoft SDKs\windows\v6.0\bin\setenv.cmd"
129if defined ProgramW6432 set ENV="%ProgramW6432%\Microsoft SDKs\windows\v6.0\bin\setenv.cmd"
130if exist %ENV% (
131  @echo +++ Microsoft Vista SDK v6.0 is taken
132  set VistaSDK=yes
133  set TOOL=%ENV% %~1
134  exit /b
135)
136echo --- Microsoft Visual Studio 2005 environment is not found.
137exit /b 1
138
139:SET_VS7_ENV
140set COMPILER=cl.exe
141if not "%AR%" == "IA32" goto sdk
142set ENV="%VS71COMNTOOLS%\vsvars32.bat"
143if exist %ENV% (
144  set TOOL=%ENV%
145  @echo +++ Microsoft Visual Studio 2003 compiler is taken
146  exit /b
147)
148echo --- Microsoft Visual Studio 2003 environment is not found.
149exit /b 1
150
151:sdk
152set ENV="%ProgramFiles%\Microsoft Platform SDK for Windows Server 2003 R2\setenv.cmd"
153if exist %ENV% (
154  @echo +++ Microsoft Platform SDK for Windows Server 2003 R2 is taken
155  set TOOL=%ENV% %~1
156  exit /b
157)
158
159set ENV="%ProgramFiles%\Microsoft Platform SDK\setenv.cmd"
160if exist %ENV% (
161  @echo +++ Microsoft Platform SDK * is taken
162  set TOOL=%ENV% %~1
163  exit /b
164)
165set ENV="%ProgramFiles%\Microsoft Platform SDK\setenv.bat"
166if 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.
172exit /b 1
173
174:SET_INTEL_FOR_ENV
175set COMPILER=ifort.exe
176set ptn= dir /B /ON "%PrF%\Intel\Compiler\fortran\%1.*"
177@%ptn% 2>NUL 1>&2
178if "%errorlevel%"=="0" for /F "usebackq" %%i in (`%ptn%`) do set LASTVERSION=%%i
179set ENV="%PrF%\Intel\Compiler\fortran\%LASTVERSION%\%AR%\Bin\ifortvars.bat"
180if 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)
186exit /b 1
187
188
189:SET_WCE500_TOOLS
190set COMPILER=%ARG%
191if exist %SDKROOT% goto pass_SDKROOT_SET
192set __SDK_TOUCH="C:\Program Files\Windows CE Tools\wce500\"
193if exist %__SDK_TOUCH%  set SDKROOT=C:\Program Files\Windows CE Tools
194:pass_SDKROOT_SET
195set TOOL="%ProgramFiles%\Microsoft eMbedded C++ 4.0\EVC\wce500\bin\WCEARMV4I.BAT"
196if  "%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
201exit /b
202
203:::::::::::::::::::::::
204:ERR     
205@echo ---
206@echo --- ERROR: %~1
207@echo ---
208exit /b -1
209