@echo off

echo Configuring GCC-2.95.2...
redir -eo ./djbuild1.sh config >djconfig.log
if errorlevel 1 goto Err

echo Building stage 1 compiler...
redir -eo ./djbuild1.sh gcc1 >stage1.log
if errorlevel 1 goto Err

echo Building stage 2 compiler...
redir -eo ./djbuild1.sh gcc2 >stage2.log
if errorlevel 1 goto Err

echo Building stage 3 compiler...
redir -eo ./djbuild1.sh gcc3 >stage3.log
if errorlevel 1 goto Err

echo Comparing stage2 and stage3...
redir -eo ./djbuild1.sh compare >compare.log
if errorlevel 1 goto Err

echo Building libio, libiberty, libstdcxx and libgpp...
redir -eo ./djbuild1.sh libs1 >libs1.log
if errorlevel 1 goto Err

echo Building Fortran runtime library...
redir -eo ./djbuild1.sh libs2 >libf2c.log
if errorlevel 1 goto Err

echo Building CHILL and Objective C runtime libraries...
redir -eo ./djbuild1.sh libs3 >libs3.log
if errorlevel 1 goto Err

echo Installing gcc-2.95.2 into temporary directory...
redir -eo ./djbuild1.sh install >inst.log
if errorlevel 1 goto Err

echo Craeting binary distribution archives...
redir -eo ./djbuild1.sh mkdist >mkdist.log
if errorlevel 1 goto Err

goto Done

:Err
echo Build failed

:Done

