2
0

os2snap.cmd 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. @echo off
  2. rem *** $Id$
  3. rem *** Batch file for creating of FPC snapshot for OS/2.
  4. rem *** FPCDIR variable must be set to your base FPC directory and
  5. rem *** must _not_ contain forward slashes (only backslashes allowed).
  6. rem *** Your compiler (PPOS2.EXE per default) and AS.EXE must be somewhere
  7. rem *** on PATH (unless you set path to them explicitly using FPCTOOLS
  8. rem *** variable, which must end with \ if present). However, be sure which
  9. rem *** version of AS.EXE, etc. gets called if several such files exist.
  10. rem *** One of the following parameters may be specified: rtl, compiler,
  11. rem *** both, cycle and snapshot ("snapshot" being the default), optionally
  12. rem *** followed by parameters "debug" (causing debugging symbols not to be
  13. rem *** stripped from the created compiler), "release" (code optimization,
  14. rem *** debug info stripped out), and "verbose" (compiler messages are
  15. rem *** shown; the same can be accomplished with setting environment
  16. rem *** variable DOVERBOSE to 1). Parameters "debug" and "release" are
  17. rem *** mutually exclusive (the later is used if both are present).
  18. rem *** Parameters _must_ be in lowercase to be recognized correctly,
  19. rem *** unless running under 4os2 or compatible.
  20. rem *** Meaning of parameters:
  21. rem *** rtl .......... RTL only, _no_ snapshot created
  22. rem *** compiler ..... compiler only, _no_ snapshot created
  23. rem *** both ......... both RTL and compiler, _no_ snapshot created
  24. rem *** snapshot ..... both RTL and compiler, snapshot _is_ created
  25. rem *** cycle ........ RTL and compiler compiled, the resulting compiler
  26. rem *** is then copied to %FPCTOOLS% (BIN\OS2 by default)
  27. rem *** backing up possible previous version to ppos2.x),
  28. rem *** the whole procedure is started again (RTL is compiled
  29. rem *** with the new compiler version this time) and after
  30. rem *** another cycle (to make sure the new compiler works
  31. rem *** correctly) the snapshot is finally created
  32. rem *** PPOS2.EXE is used for the compilation, unless a different compiler name
  33. rem *** is specified in FPCCOMPILER variable. In any case, the compiler should
  34. rem *** reside in the same directory as the other required tools (AS.EXE,
  35. rem *** LD.EXE, etc.).
  36. rem *** Environment variable OTHEROPTS may be used to specify additional
  37. rem *** switches (e.g. setting level of verbosity, etc.).
  38. rem *** Environment variable FPCERRLOG can specify a file for error logging
  39. rem *** (full path needed). Please, note, that the previous contents of
  40. rem *** file will be overwritten each time the batch file is run.
  41. rem *** Environment variable VERBOSEOPT may be used to specify level of
  42. rem *** verbosity used with "verbose" parameter (-va by default, i.e. show
  43. rem *** everything). Another way would be specifying this in OTHEROPTS
  44. rem *** variable (see above) and not using "verbose" at all.
  45. if .%FPCERRLOG% == . set FPCERRLOG=CON
  46. echo *"Makefile" for OS/2: > %FPCERRLOG%
  47. echo *Setting up environment ... >> %FPCERRLOG%
  48. rem Check whether FPCDIR exists
  49. if %FPCDIR%. == . goto ErrorDir
  50. if exist %FPCDIR% goto DirOK
  51. if exist %FPCDIR%\. goto DirOK
  52. if exist %FPCDIR%\makefile goto DirOK
  53. if exist %FPCDIR%\COMPILER\pp.pas goto DirOK
  54. if exist %FPCDIR%\SOURCE\makefile goto DirOK
  55. if exist %FPCDIR%\SOURCE\COMPILER\pp.pas goto DirOK
  56. goto ErrorDir
  57. :DirOK
  58. rem Set path to the source files
  59. if exist %FPCDIR%\SOURCE goto SrcExists
  60. if exist %FPCDIR%\SOURCE\. goto SrcExists
  61. if exist %FPCDIR%\SOURCE\makefile goto SrcExists
  62. if exist %FPCDIR%\SOURCE\COMPILER\pp.pas goto SrcExists
  63. set FPCSRC=%FPCDIR%
  64. goto SetOpts
  65. :SrcExists
  66. set FPCSRC=%FPCDIR%\SOURCE
  67. :SetOpts
  68. rem Path to file with options
  69. set OS2OPTF=%FPCSRC%\OS2SNAP.OPT
  70. rem Path for the OS/2 RTL
  71. set OS2RTL=%FPCSRC%\RTL\OS2
  72. rem Path for OS/2 RTL parts compiled from common sources
  73. set OS2RTLC=%FPCSRC%\RTL\INC
  74. rem Path for OS/2 RTL parts compiled from processor dependent sources
  75. set OS2RTLP=%FPCSRC%\RTL\I386
  76. rem Path for OS/2 RTL parts for Object Pascal extensions
  77. set OS2RTLO=%FPCSRC%\RTL\OBJPAS
  78. rem Path to the compiler source
  79. set COMPSPATH=%FPCSRC%\COMPILER
  80. rem Option to skip the default configuration file
  81. set SKIPCFG=-n
  82. rem Common options for OS/2 target
  83. set OS2OPT1=-TOS2
  84. set OS2OPT2=-dGDB
  85. set OS2OPT3=-dI386
  86. set OS2OPT4=-Sg
  87. rem "Release" options (optimizations, strip debug symbols)
  88. set RELEASEOPT1=-Og2p1
  89. set RELEASEOPT2=-Xs
  90. rem "Debug" options (add debug symbols, do all code generation checks)
  91. set DEBUGOPT1=-g
  92. set DEBUGOPT2=-Crtoi
  93. rem "Verbose" options
  94. if .%VERBOSEOPT% == . set VERBOSEOPT=-va
  95. set DOVERBOSE=
  96. rem Place for debug or release options, empty by default
  97. set CURRENTOPT1=
  98. set CURRENTOPT2=
  99. rem Stack size for the compiler
  100. set STACKOPT=-Cs64500
  101. rem Path to object files
  102. set OS2OBJP=-Fo%OS2RTL%
  103. rem Path to units
  104. set OS2UNITP=-Fu%OS2RTL%
  105. rem Path to compiler units
  106. set COMPUNITP=-Fu%COMPSPATH%
  107. rem Path to compiler include files
  108. set COMPINCP=-Fi%COMPSPATH%
  109. rem Path to compiler object files
  110. set COMPOBJP=-Fo%COMPSPATH%
  111. rem Target path for units
  112. set OS2UNITT=-FU%OS2RTL%
  113. rem Target path for executables
  114. set OS2EXET=-FE%COMPSPATH%
  115. rem Path to include files
  116. set OS2INCP=-Fi%OS2RTL%;%OS2RTLC%;%OS2RTLO%;%OS2RTLP%
  117. rem Default compiler for the first compilation
  118. set CYCLE=0
  119. set COMPILER=%FPCCOMPILER%
  120. if .%FPCCOMPILER% == . goto SetCompiler
  121. goto PrgFound
  122. :SetCompiler
  123. set COMPILER=PPOS2.EXE
  124. :PrgFound
  125. echo *Searching for tools ... >> %FPCERRLOG%
  126. set REALTOOLS=%FPCTOOLS%
  127. if %FPCTOOLS%. == . goto SetupTools
  128. goto ToolsOK
  129. :SetupTools
  130. if exist %FPCDIR%\BIN\OS2\%COMPILER% goto Tools1
  131. if exist %FPCDIR%\BIN\OS2\%COMPILER%.EXE goto Tools1
  132. goto NoTools1
  133. :Tools1
  134. if exist %FPCDIR%\BIN\OS2\AS.EXE goto Tools1OK
  135. echo *Warning: %COMPILER% found, but AS.EXE isn't in the same directory! >> %FPCERRLOG%
  136. goto NoTools1
  137. :Tools1OK
  138. set REALTOOLS=%FPCDIR%\BIN\OS2\
  139. goto ToolsOK
  140. :NoTools1
  141. if exist %FPCDIR%\BIN\%COMPILER% goto Tools2
  142. if exist %FPCDIR%\BIN\%COMPILER%.EXE goto Tools2
  143. goto NoTools2
  144. :Tools2
  145. if exist %FPCDIR%\BIN\AS.EXE goto Tools2OK
  146. echo *Warning: %COMPILER% found, but AS.EXE isn't in the same directory! >> %FPCERRLOG%
  147. goto NoTools2
  148. :Tools2OK
  149. set REALTOOLS=%FPCDIR%\BIN\
  150. goto ToolsOK
  151. :NoTools2
  152. echo *Warning: Cannot locate your %COMPILER% and AS.EXE, make sure they're on PATH! >> %FPCERRLOG%
  153. :ToolsOK
  154. echo *Checking parameters >> %FPCERRLOG%
  155. set PARAMS=%1
  156. if .%PARAMS% == . set PARAMS=snapshot
  157. :ParLoop
  158. shift
  159. if %1. == . goto NoPars
  160. if %@EVAL[0] == 0 goto Shl1
  161. if %1 == debug set CURRENTOPT1=%DEBUGOPT1%
  162. if %1 == debug set CURRENTOPT2=%DEBUGOPT2%
  163. if %1 == release set CURRENTOPT1=%RELEASEOPT1%
  164. if %1 == release set CURRENTOPT2=%RELEASEOPT2%
  165. if %1 == verbose set DOVERBOSE=1
  166. goto ParLoop
  167. :Shl1
  168. set PARAMS=%@LOWER[%PARAMS%]
  169. if %@LOWER[%1] == debug set CURRENTOPT1=%DEBUGOPT1%
  170. if %@LOWER[%1] == debug set CURRENTOPT2=%DEBUGOPT2%
  171. if %@LOWER[%1] == release set CURRENTOPT1=%RELEASEOPT1%
  172. if %@LOWER[%1] == release set CURRENTOPT2=%RELEASEOPT2%
  173. if %@LOWER[%1] == verbose set DOVERBOSE=1
  174. goto ParLoop
  175. :NoPars
  176. if %PARAMS% == clean goto CleanRTL
  177. if %PARAMS% == both goto CleanRTL
  178. if %PARAMS% == snapshot goto CleanRTL
  179. if %PARAMS% == rtl goto CleanRTL
  180. if %PARAMS% == cycle goto CleanRTL
  181. if %PARAMS% == compiler goto CleanCompiler
  182. echo *Error: Unknown parameter - %PARAMS% >> %FPCERRLOG%
  183. goto End
  184. :CleanRTL
  185. if %@eval[0] == 0 goto JPCleanRTL
  186. echo *Cleaning up the RTL (error messages are OK here) ... >> %FPCERRLOG%
  187. del %OS2OPTF% >> %FPCERRLOG%
  188. del %OS2RTL%\*.ppo >> %FPCERRLOG%
  189. del %OS2RTL%\*.oo2 >> %FPCERRLOG%
  190. del %OS2RTL%\ppas.bat >> %FPCERRLOG%
  191. del %OS2RTL%\ppas.cmd >> %FPCERRLOG%
  192. del %OS2RTL%\link.res >> %FPCERRLOG%
  193. goto ContCleanRTL
  194. :JPCleanRTL
  195. echo *Cleaning up the RTL ... >> %FPCERRLOG%
  196. del %OS2OPTF% >& nul >> %FPCERRLOG%
  197. del %OS2RTL%\*.ppo >& nul >> %FPCERRLOG%
  198. del %OS2RTL%\*.oo2 >& nul >> %FPCERRLOG%
  199. del %OS2RTL%\ppas.bat >& nul >> %FPCERRLOG%
  200. del %OS2RTL%\ppas.cmd >& nul >> %FPCERRLOG%
  201. del %OS2RTL%\link.res >& nul >> %FPCERRLOG%
  202. :ContCleanRTL
  203. if %PARAMS% == rtl goto Branches
  204. :CleanCompiler
  205. if %@eval[0] == 0 goto JPCleanComp
  206. echo *Cleaning up the compiler (error messages are OK here) ... >> %FPCERRLOG%
  207. del %OS2OPTF% >> %FPCERRLOG%
  208. del %COMPSPATH%\*.ppo >> %FPCERRLOG%
  209. del %COMPSPATH%\*.oo2 >> %FPCERRLOG%
  210. del %COMPSPATH%\pp >> %FPCERRLOG%
  211. del %COMPSPATH%\pp.exe >> %FPCERRLOG%
  212. del %COMPSPATH%\ppos2.exe >> %FPCERRLOG%
  213. del %COMPSPATH%\ppas.bat >> %FPCERRLOG%
  214. del %COMPSPATH%\ppas.cmd >> %FPCERRLOG%
  215. del %COMPSPATH%\link.res >> %FPCERRLOG%
  216. goto ContCleanComp
  217. :JPCleanComp
  218. echo *Cleaning up the compiler ... >> %FPCERRLOG%
  219. del %OS2OPTF% >& nul >> %FPCERRLOG%
  220. del %COMPSPATH%\*.ppo >& nul >> %FPCERRLOG%
  221. del %COMPSPATH%\*.oo2 >& nul >> %FPCERRLOG%
  222. del %COMPSPATH%\pp >& nul >> %FPCERRLOG%
  223. del %COMPSPATH%\pp.exe >& nul >> %FPCERRLOG%
  224. del %COMPSPATH%\ppos2.exe >& nul >> %FPCERRLOG%
  225. del %COMPSPATH%\ppas.bat >& nul >> %FPCERRLOG%
  226. del %COMPSPATH%\ppas.cmd >& nul >> %FPCERRLOG%
  227. del %COMPSPATH%\link.res >& nul >> %FPCERRLOG%
  228. :ContCleanComp
  229. if %PARAMS% == compiler goto Branches
  230. if %PARAMS% == both goto Branches
  231. :CleanSnapshot
  232. if %@eval[0] == 0 goto JPCleanSnap
  233. echo *Deleting the old snapshot (error messages are OK here) ... >> %FPCERRLOG%
  234. del %FPCSRC%\snap-os2.zip >> %FPCERRLOG%
  235. goto ContCleanSnap
  236. :JPCleanSnap
  237. echo *Deleting the old snapshot ... >> %FPCERRLOG%
  238. del %FPCSRC%\snap-os2.zip >& nul >> %FPCERRLOG%
  239. :ContCleanSnap
  240. if %PARAMS% == clean goto End
  241. :Branches
  242. if %PARAMS% == both goto RTL1
  243. if %PARAMS% == snapshot goto RTL1
  244. if %PARAMS% == compiler goto Compiler
  245. if %PARAMS% == rtl goto RTL1
  246. if %PARAMS% == cycle goto RTL1
  247. echo *Error: Unknown parameter - %PARAMS% >> %FPCERRLOG%
  248. goto End
  249. :RTL1
  250. echo *Creating file with all the needed options and paths for RTL ... >> %FPCERRLOG%
  251. echo %SKIPCFG% > %OS2OPTF%
  252. echo %OS2OPT1% >> %OS2OPTF%
  253. echo %OS2OPT2% >> %OS2OPTF%
  254. echo %OS2OPT3% >> %OS2OPTF%
  255. echo %OS2OPT4% >> %OS2OPTF%
  256. echo %OS2OBJP% >> %OS2OPTF%
  257. echo %OS2UNITP% >> %OS2OPTF%
  258. echo %OS2INCP% >> %OS2OPTF%
  259. echo %OS2UNITT% >> %OS2OPTF%
  260. echo -FD%REALTOOLS% >> %OS2OPTF%
  261. if not .%CURRENTOPT1% == . echo %CURRENTOPT1% >> %OS2OPTF%
  262. if not .%CURRENTOPT2% == . echo %CURRENTOPT2% >> %OS2OPTF%
  263. if not .%FPCERRLOG% == . echo -Fe%FPCERRLOG% >> %OS2OPTF%
  264. if .%DOVERBOSE% == .1 echo %VERBOSEOPT% >> %OS2OPTF%
  265. if not .%DOVERBOSE% == .1 goto CompStart1
  266. echo *Start of options used for compilation >> %FPCERRLOG%
  267. type %OS2OPTF% >> %FPCERRLOG%
  268. echo *End of options used for compilation >> %FPCERRLOG%
  269. :CompStart1
  270. echo *Assembling the helpers ... >> %FPCERRLOG%
  271. %REALTOOLS%\as -o %OS2RTL%\prt0.oo2 %OS2RTL%\prt0.as
  272. %REALTOOLS%\as -o %OS2RTL%\prt1.oo2 %OS2RTL%\prt1.as
  273. %REALTOOLS%\as -o %OS2RTL%\code2.oo2 %OS2RTL%\code2.as
  274. %REALTOOLS%\as -o %OS2RTL%\code3.oo2 %OS2RTL%\code3.as
  275. echo *Compiling the system unit ... >> %FPCERRLOG%
  276. %REALTOOLS%%COMPILER% @%OS2OPTF% -Us %OTHEROPTS% %OS2RTL%\SYSOS2.PAS
  277. echo *Compiling unit Objects ... >> %FPCERRLOG%
  278. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\OBJECTS.PP
  279. echo *Compiling unit Strings ... >> %FPCERRLOG%
  280. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\STRINGS.PP
  281. echo *Compiling unit HeapTrace ... >> %FPCERRLOG%
  282. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\HEAPTRC.PP
  283. echo *Compiling unit CPU ... >> %FPCERRLOG%
  284. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLP%\CPU.PP
  285. echo *Compiling unit MMX ... >> %FPCERRLOG%
  286. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLP%\MMX.PP
  287. echo *Compiling unit TypInfo ... >> %FPCERRLOG%
  288. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLO%\TYPINFO.PP
  289. echo *Compiling unit DosCalls ... >> %FPCERRLOG%
  290. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\DOSCALLS.PAS
  291. echo *Compiling unit DOS ... >> %FPCERRLOG%
  292. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\DOS.PAS
  293. echo *Compiling unit CRT ... >> %FPCERRLOG%
  294. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\CRT.PAS
  295. echo *Compiling unit Printer ... >> %FPCERRLOG%
  296. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PRINTER.PAS
  297. echo *Compiling unit SysUtils ... >> %FPCERRLOG%
  298. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLO%\SYSUTILS.PP
  299. echo *Compiling unit Math ... >> %FPCERRLOG%
  300. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLO%\MATH.PP
  301. echo *Compiling unit UComplex ... >> %FPCERRLOG%
  302. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\UCOMPLEX.PP
  303. echo *Compiling unit GetOpts ... >> %FPCERRLOG%
  304. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\GETOPTS.PP
  305. echo *Compiling unit KbdCalls ... >> %FPCERRLOG%
  306. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\KBDCALLS.PAS
  307. echo *Compiling unit MouCalls ... >> %FPCERRLOG%
  308. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\MOUCALLS.PAS
  309. echo *Compiling unit VioCalls ... >> %FPCERRLOG%
  310. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\VIOCALLS.PAS
  311. echo *Compiling unit MonCalls ... >> %FPCERRLOG%
  312. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\MONCALLS.PAS
  313. echo *Compiling unit Ports ... >> %FPCERRLOG%
  314. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PORTS.PAS
  315. echo *Compiling PM units ... >> %FPCERRLOG%
  316. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PMWIN.PAS
  317. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PMBITMAP.PAS
  318. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PMGPI.PAS
  319. echo *Compiling MMOS2 units ... >> %FPCERRLOG%
  320. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\DIVE.PAS
  321. if %PARAMS% == rtl goto End
  322. :Compiler
  323. echo *Creating file with all the needed options and paths for the compiler ... >> %FPCERRLOG%
  324. echo %SKIPCFG% > %OS2OPTF%
  325. echo %OS2OPT1% >> %OS2OPTF%
  326. echo %OS2OPT2% >> %OS2OPTF%
  327. echo %OS2OPT3% >> %OS2OPTF%
  328. echo %OS2OPT4% >> %OS2OPTF%
  329. echo %OS2OBJP% >> %OS2OPTF%
  330. echo %OS2UNITP% >> %OS2OPTF%
  331. echo -FD%REALTOOLS% >> %OS2OPTF%
  332. echo %COMPUNITP% >> %OS2OPTF%
  333. echo %COMPINCP% >> %OS2OPTF%
  334. echo %COMPOBJP% >> %OS2OPTF%
  335. echo %STACKOPT% >> %OS2OPTF%
  336. echo %OS2EXET% >> %OS2OPTF%
  337. if not .%CURRENTOPT1% == . echo %CURRENTOPT1% >> %OS2OPTF%
  338. if not .%CURRENTOPT2% == . echo %CURRENTOPT2% >> %OS2OPTF%
  339. if not .%FPCERRLOG% == . echo -Fe%FPCERRLOG% >> %OS2OPTF%
  340. if .%DOVERBOSE% == .1 echo %VERBOSEOPT% >> %OS2OPTF%
  341. if not .%DOVERBOSE% == .1 goto CompStart2
  342. echo *Start of options used for compilation >> %FPCERRLOG%
  343. type %OS2OPTF% >> %FPCERRLOG%
  344. echo *End of options used for compilation >> %FPCERRLOG%
  345. :CompStart2
  346. echo *Compiling the compiler ... >> %FPCERRLOG%
  347. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %COMPSPATH%\PP.PAS
  348. :Comp2
  349. ren %COMPSPATH%\pp.exe ppos2.exe >> %FPCERRLOG%
  350. if exist %COMPSPATH%\ppos2.exe goto OKCompiler
  351. if not exist %COMPSPATH%\pp goto C2Cont
  352. if exist %COMPSPATH%\ppas.bat goto PPasBat
  353. if exist %COMPSPATH%\ppas.cmd goto PPasCmd
  354. :C2Cont
  355. echo *Error: The compiler wasn't compiled!! >> %FPCERRLOG%
  356. goto End
  357. :PPasBat
  358. echo *Automatic binding failed, trying again ... >> %FPCERRLOG%
  359. call %COMPSPATH%\ppas.bat
  360. del %COMPSPATH%\ppas.bat >> %FPCERRLOG%
  361. goto Comp2
  362. :PPasCmd
  363. echo *Automatic binding failed, trying again ... >> %FPCERRLOG%
  364. call %COMPSPATH%\ppas.cmd
  365. del %COMPSPATH%\ppas.cmd >> %FPCERRLOG%
  366. goto Comp2
  367. :OKCompiler
  368. if %PARAMS% == compiler goto End
  369. if %PARAMS% == both goto End
  370. if %PARAMS% == cycle goto Cycle
  371. goto CheckEnv
  372. :Cycle
  373. rem Another loop?
  374. if %CYCLE% == 2 goto CheckEnv
  375. echo *Backing up previous compiler version ... >> %FPCERRLOG%
  376. copy %REALTOOLS%ppos2.exe %REALTOOLS%ppos2.%CYCLE% >> %FPCERRLOG%
  377. echo *Copying the newly created compiler to %REALTOOLS% ... >> %FPCERRLOG%
  378. copy %COMPSPATH%\ppos2.exe %REALTOOLS%. >> %FPCERRLOG%
  379. if %CYCLE% == 1 goto Cycle2
  380. set COMPILER=PPOS2.EXE
  381. set CYCLE=1
  382. goto NoPars
  383. :Cycle2
  384. set CYCLE=2
  385. goto NoPars
  386. :CheckEnv
  387. if %@EVAL[0] == 0 goto Pack
  388. echo *Warning: Packing in this environment might fail. >> %FPCERRLOG%
  389. echo *You should press Ctrl-Break now if the current drive is different from that >> %FPCERRLOG%
  390. echo *of %FPCDIR%; otherwise press any key to continue. >> %FPCERRLOG%
  391. if not %FPCERRLOG% == CON echo *Warning: Packing in this environment might fail.
  392. if not %FPCERRLOG% == CON echo *You should press Ctrl-Break now if the current drive is different from that
  393. if not %FPCERRLOG% == CON echo *of %FPCDIR%; otherwise press any key to continue.
  394. pause>nul
  395. cd %FPCSRC%
  396. :Pack
  397. echo *Packing the snapshot ... >> %FPCERRLOG%
  398. if %@EVAL[0] == 0 goto SHL2
  399. goto Cmd2
  400. :Shl2
  401. pushd
  402. cdd %FPCSRC%
  403. :Cmd2
  404. rem ZIP.EXE must be on the PATH
  405. zip -9 -r snap-os2.zip compiler\ppos2.exe rtl\os2\*.ppo rtl\os2\*.oo2 rtl\os2\*.ao2 >> %FPCERRLOG%
  406. if exist snap-os2.zip goto ZipOK
  407. echo *Error: The ZIP file hasn't been created!! >> %FPCERRLOG%
  408. :ZipOK
  409. if %@EVAL[0] == 0 popd
  410. echo *Done. >> %FPCERRLOG%
  411. goto End
  412. :ErrorDir
  413. echo *Error: Environment variable FPCDIR must point to your base FPC directory!!! >> %FPCERRLOG%
  414. goto End
  415. $Log$
  416. Revision 1.8 2000-01-29 16:24:01 hajny
  417. * logging enhanced, verbose support, error for non-4dos fixed
  418. Revision 1.7 2000/01/26 22:34:36 hajny
  419. * support for error logging added
  420. Revision 1.6 2000/01/16 18:44:21 hajny
  421. * got rid of PPC386.CFG dependency
  422. Revision 1.3 1999/10/01 09:00:21 hajny
  423. + PMGPI and DIVE added
  424. Revision 1.2 1999/09/15 07:31:49 hajny
  425. + some units added, OTHEROPTS variable support
  426. :End