@echo Off

If "%1%" == "alternate" goto alter

:normal
REM In the case SaturnOrbit is installer in C:\SaturnOrbit directory (DEFAULT).

REM http://vberthelot.free.fr/SX/satdev/SaturnOrbit_r1_setup.exe + http://www.rockin-b.de/windows/saturnorbit/SaturnOrbit_r1_patch.7z
SET LGCC_PATH=C:/SaturnOrbit/SH_elf/sh-elf/lib/gcc/sh-elf/3.4-GNUSH_v0501/

REM http://vberthelot.free.fr/SaturnOrbit/saturn-orbit-r1-patch2.rar
REM  *** Requires to changes -m2 to -m1 in the following line ?!?
REM  *** set flags=-Wall -Werror -m2 %scflags%
set tmp=C:/SaturnOrbit/SH_elf/sh-elf/lib/gcc/sh-elf/4.3-GNUSH_v0803/
if exist %tmp%libgcc.a SET LGCC_PATH=%tmp%

REM Lastest (4.5-GNUSH_v11.01): http://www.kpitgnutools.com/latestToolchain.php
set tmp=C:/SaturnOrbit/SH_elf/sh-elf/lib/gcc/sh-elf/4.5-GNUSH_v11.01/
if exist %tmp%libgcc.a SET LGCC_PATH=%tmp%

goto end


:alter
REM In the case SaturnOrbit is installer in D:\dev\SaturnOrbit directory.

REM http://vberthelot.free.fr/SX/satdev/SaturnOrbit_r1_setup.exe + http://www.rockin-b.de/windows/saturnorbit/SaturnOrbit_r1_patch.7z
SET LGCC_PATH=D:/dev/SaturnOrbit/SH_elf/sh-elf/lib/gcc/sh-elf/3.4-GNUSH_v0501/

REM http://vberthelot.free.fr/SaturnOrbit/saturn-orbit-r1-patch2.rar
REM  *** Requires to changes -m2 to -m1 in the following line ?!?
REM  *** set flags=-Wall -Werror -m2 %scflags%
set tmp=D:/dev/SaturnOrbit/SH_elf/sh-elf/lib/gcc/sh-elf/4.3-GNUSH_v0803/
if exist %tmp%libgcc.a SET LGCC_PATH=%tmp%

REM Lastest (4.5-GNUSH_v11.01): http://www.kpitgnutools.com/latestToolchain.php
set tmp=D:/dev/SaturnOrbit/SH_elf/sh-elf/lib/gcc/sh-elf/4.5-GNUSH_v11.01/
if exist %tmp%libgcc.a SET LGCC_PATH=%tmp%

goto end


:end
echo Path to libgcc.a: %LGCC_PATH%
