@echo off
rem
rem  Script to compile GNU Pascal for EMX on an OS/2 system.
rem
setlocal
set emxopt=-t %emxopt%
echo Compiling necessary components of the GNU C Compiler...
cd ..
call dostage1.cmd
set emxopt=-t %emxopt%
echo Configuring ...
copy config\emx\Makefile . > nul
copy config\emx\gpc-conf.h . > nul
copy config\emx\Makefile.RTS rts\Makefile > nul
copy config\emx\rts-conf.h rts > nul
copy config\emx\gcc_bcmp.c rts >nul 
echo Patching GCC source ...
copy config\emx\specs.h .. > nul
copy config\emx\options.h .. > nul
echo Compiling the GNU Pascal Compiler ...
dmake >compile.out 2>&1
emxbind \emx\bin\emxl ..\gpc > nul
emxbind \emx\bin\emxl ..\gpc-cpp > nul
emxbind \emx\bin\emxl ..\gpc1 > nul
echo Compiling GPC Run-Time System ...
cd rts
dmake >compile.out 2>&1
cd ..
copy rts\libgpc.a ..\gpc.a > nul
echo Done.
endlocal
