Opened 14 years ago

Closed 14 years ago

#2141 closed Bugs (fixed)

(Windows) in tools/jam/src "build.bat toolset" does not recognize toolset

Reported by: Arnaud Cheritat <cheritat@…> Owned by: René Rivera
Milestone: Boost.Jam 3.1.17 Component: bjam
Version: Boost.Jam 3.1.16 Severity: Problem
Keywords: building bjam windows Cc:

Description

In a Windows command prompt, when I type

build.bat mingw

The guy claims I want msvc.

Apparently, in the batch file, the subroutine that tries to determine whether a command line option is of the form "--option" fails.

I had to tweak the batch file to enforce BOOST_JAM_TOOLSET=%1

This had the drawback of forcing me to remove %args% on the very last instruction of the batch file.

Then bjam.exe was build.

gcc (GCC) 3.4.5 (mingw special)
OS: Windows Vista Family Premium 32bits SP1
Processor: AMD Athlon 64 X2 4000+, but you probably don't care.

Change History (4)

comment:1 by Marshall Clow, 14 years ago

Component: NoneBuilding Boost

comment:2 by Mateusz Czapliński <czapkofan@…>, 14 years ago

I have the same problem, with Boost 1.36. From what I've managed to debug, apparently the "set _error_=" idiom has ceased to work in Vista. I've created a following simple batch file to test it:

@echo off

call :v a
call :test1
call :v b
call :test2
call :v c
call :test1
call :v d
call :test2
call :v e
call :test3
call :v f
call :test2
call :v g

goto :eof

:v
if errorlevel 1 (
 echo %1=1
) else (
 echo %1=0
)
goto :eof


:test1
setlocal & endlocal
setlocal
echo in test 1...
set _error_=
endlocal
goto :eof

:test2
setlocal & endlocal
setlocal
echo in test 2...
endlocal
goto :eof

:test3
setlocal & endlocal
setlocal
echo in test 3...
color 00
endlocal
goto :eof

which results in the following output on Vista:

a=0
in test 1...
b=0
in test 2...
c=0
in test 1...
d=0
in test 2...
e=0
in test 3...
f=1
in test 2...
g=0

in comparison to XP's:

a=0
in test 1...
b=1
in test 2...
c=0
in test 1...
d=1
in test 2...
e=0
in test 3...
f=1
in test 2...
g=0

Therefore, I suggest to change the "set _error_=" idiom mentioned above to the "color 00" one (found on http://www.ss64.com/nt/if.html ), which seems to still work on Vista, or perhaps to a more explicit sequence of commands similar to that below:

setlocal
if fooblah set _error_=1
endlocal & set _Result=%_error_%
if %_Result%==1 ( blahblah )

comment:3 by René Rivera, 14 years ago

Component: Building Boostbjam
Milestone: Boost 1.36.0Boost.Jam 3.1.17
Owner: set to René Rivera
Version: Boost 1.35.0Boost.Jam 3.1.16

comment:4 by René Rivera, 14 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.