I downloaded a trial version of Raima's RDMe embedded database. It's
software designed for embedding a database within embedded devices. They
have a setup BAT file that sets up your build environment depending on
whether you're building for 32bit, 64bit, ia64, or WinCE.
The problem piece of code is (of course) in the FOR statement. You'll
notice the command is enclosed in both single quotes and double quotes.
Because of the double quotes, TCC attempts to execute "CL 2>&1" as a
command and fails. If I remove the double quotes, then the STDERR output
doesn't make it into the token variable.
-Scott
software designed for embedding a database within embedded devices. They
have a setup BAT file that sets up your build environment depending on
whether you're building for 32bit, 64bit, ia64, or WinCE.
The problem piece of code is (of course) in the FOR statement. You'll
notice the command is enclosed in both single quotes and double quotes.
Because of the double quotes, TCC attempts to execute "CL 2>&1" as a
command and fails. If I remove the double quotes, then the STDERR output
doesn't make it into the token variable.
Code:
:: Set the compiler information
::---------------------------------------------------------------------------
set NEXT set MSVC7 set MSVC8 set MSVC9
REM Parse the cl command - redirect stderr to stdout, that's where the
REM version number is. There is no '-v' option.
FOR /F "tokens=*" %%G IN ('"cl 2>&1"') DO call :parseit %%G
goto :END-COMPILER
REM parseit gets the whole line, loop through one word at a time.
REM Look for 'version'. When we find 'version', the next word is the
REM version number
:parseit
if {%1}=={'cl'} goto :ERROR_COMPILER
if {%1}=={} goto :END
REM echo %1
if defined NEXT call :parseversion %1
if defined NEXT goto :END
if /I %1==version set NEXT=1
shift /1
goto :parseit
goto :eof
REM The version number is like 14.00.22.33.44. The delims options
isn't
REM working so I'm just reading the first two characters
:parseversion
REM FOR /F "delims=. tokens=1" %%H IN ('echo %%1') do call :setvers %%H
set string=%1
REM Skip lines that aren't version numbers
IF NOT "%string:~0,1%"=="1" goto :eof
set COMPILER_VERSION=%string%
IF "%string:~0,2%"=="13" set MSVC7=1
IF "%string:~0,2%"=="14" set MSVC8=1
IF "%string:~0,2%"=="15" set MSVC9=1
goto :eof
:END-COMPILER
-Scott