os2snap.cmd 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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. rem *** Environment variable FPCSNAPPATH may be used to specify path, where
  46. rem *** the compiled files should be placed and possibly the ZIP file
  47. rem *** created.
  48. if .%FPCERRLOG% == . set FPCERRLOG=CON
  49. echo *"Makefile" for OS/2: > %FPCERRLOG%
  50. echo *Setting up environment ... >> %FPCERRLOG%
  51. rem Check whether FPCDIR exists
  52. if .%FPCDIR% == . goto ErrorDir
  53. if exist %FPCDIR% goto DirOK
  54. if exist %FPCDIR%\. goto DirOK
  55. if exist %FPCDIR%\makefile goto DirOK
  56. if exist %FPCDIR%\COMPILER\pp.pas goto DirOK
  57. if exist %FPCDIR%\SOURCE\makefile goto DirOK
  58. if exist %FPCDIR%\SOURCE\COMPILER\pp.pas goto DirOK
  59. goto ErrorDir
  60. :DirOK
  61. rem Set path to the source files
  62. if exist %FPCDIR%\SOURCE goto SrcExists
  63. if exist %FPCDIR%\SOURCE\. goto SrcExists
  64. if exist %FPCDIR%\SOURCE\makefile goto SrcExists
  65. if exist %FPCDIR%\SOURCE\COMPILER\pp.pas goto SrcExists
  66. set FPCSRC=%FPCDIR%
  67. goto SnapDir
  68. :SrcExists
  69. set FPCSRC=%FPCDIR%\SOURCE
  70. :SnapDir
  71. set FPCSNAP=%FPCSNAPPATH%
  72. if .%FPCSNAP% == . set FPCSNAP=%FPCSRC%\SNAPSHOT
  73. if exist %FPCSNAP% goto SnapExists
  74. echo *Creating directories for the snapshot ... >> %FPCERRLOG%
  75. mkdir %FPCSNAP% >> %FPCERRLOG%
  76. if exist %FPCSNAP% goto SnapExists
  77. echo *Error: Cannot create the directory %FPCSNAP%!!
  78. goto End
  79. :SnapExists
  80. if exist %FPCSNAP%\BIN goto BinExists
  81. echo *Creating directories for the snapshot (binaries) ... >> %FPCERRLOG%
  82. mkdir %FPCSNAP%\BIN >> %FPCERRLOG%
  83. if exist %FPCSNAP%\BIN goto BinExists
  84. echo *Error: Cannot create the directory %FPCSNAP%\BIN!!
  85. goto End
  86. :BinExists
  87. set FPCSNAPBIN=%FPCSNAP%\BIN\OS2
  88. if exist %FPCSNAPBIN% goto BinOS2Exists
  89. echo *Creating directories for the snapshot (binaries for OS/2) ... >> %FPCERRLOG%
  90. mkdir %FPCSNAPBIN% >> %FPCERRLOG%
  91. if exist %FPCSNAPBIN% goto BinOS2Exists
  92. echo *Error: Cannot create the directory %FPCSNAPBIN%!!
  93. goto End
  94. :BinOS2Exists
  95. set FPCSNAPMSG=%FPCSNAP%\MSG
  96. if exist %FPCSNAPMSG% goto MsgExists
  97. echo *Creating directories for the snapshot (messages) ... >> %FPCERRLOG%
  98. mkdir %FPCSNAPMSG% >> %FPCERRLOG%
  99. if exist %FPCSNAPMSG% goto MsgExists
  100. echo *Error: Cannot create the directory %FPCSNAPMSG%!!
  101. goto End
  102. :MsgExists
  103. if exist %FPCSNAP%\UNITS goto UnitsExists
  104. echo *Creating directories for the snapshot (units) ... >> %FPCERRLOG%
  105. mkdir %FPCSNAP%\UNITS >> %FPCERRLOG%
  106. if exist %FPCSNAP%\UNITS goto UnitsExists
  107. echo *Error: Cannot create the directory %FPCSNAP%\UNITS!!
  108. goto End
  109. :UnitsExists
  110. if exist %FPCSNAP%\UNITS\OS2 goto UnitsOS2Exists
  111. echo *Creating directories for the snapshot (units for OS/2) ... >> %FPCERRLOG%
  112. mkdir %FPCSNAP%\UNITS\OS2 >> %FPCERRLOG%
  113. if exist %FPCSNAP%\UNITS\OS2 goto UnitsOS2Exists
  114. echo *Error: Cannot create the directory %FPCSNAP%\UNITS\OS2!!
  115. goto End
  116. :UnitsOS2Exists
  117. set FPCSNAPRTL=%FPCSNAP%\UNITS\OS2\RTL
  118. if exist %FPCSNAPRTL% goto OS2RTLExists
  119. echo *Creating directories for the snapshot (units for OS/2 RTL) ... >> %FPCERRLOG%
  120. mkdir %FPCSNAPRTL% >> %FPCERRLOG%
  121. if exist %FPCSNAPRTL% goto OS2RTLExists
  122. echo *Error: Cannot create the directory %FPCSNAPRTL%!!
  123. goto End
  124. :OS2RTLExists
  125. set FPCSNAPDOC=%FPCSNAP%\DOC
  126. if exist %FPCSNAPDOC% goto SetOpts
  127. echo *Creating directories for the snapshot (documentation) ... >> %FPCERRLOG%
  128. mkdir %FPCSNAPDOC% >> %FPCERRLOG%
  129. if exist %FPCSNAPDOC% goto SetOpts
  130. echo *Error: Cannot create the directory %FPCSNAPDOC%!!
  131. goto End
  132. :SetOpts
  133. rem Path to file with options
  134. set OS2OPTF=%FPCSRC%\OS2SNAP.OPT
  135. rem Path for the OS/2 RTL
  136. set OS2RTL=%FPCSRC%\RTL\OS2
  137. rem Path for OS/2 RTL parts compiled from common sources
  138. set OS2RTLC=%FPCSRC%\RTL\INC
  139. rem Path for OS/2 RTL parts compiled from processor dependent sources
  140. set OS2RTLP=%FPCSRC%\RTL\I386
  141. rem Path for OS/2 RTL parts for Object Pascal extensions
  142. set OS2RTLO=%FPCSRC%\RTL\OBJPAS
  143. rem Path to the compiler source
  144. set COMPSPATH=%FPCSRC%\COMPILER
  145. rem Option to skip the default configuration file
  146. set SKIPCFG=-n
  147. rem Common options for OS/2 target
  148. set OS2OPT1=-TOS2
  149. set OS2OPT2=-dGDB
  150. set OS2OPT3=-dI386
  151. set OS2OPT4=-Sg
  152. rem "Release" options (optimizations, strip debug symbols)
  153. set RELEASEOPT1=-Og2p1
  154. set RELEASEOPT2=-Xs
  155. rem "Debug" options (add debug symbols, do all code generation checks)
  156. set DEBUGOPT1=-g
  157. set DEBUGOPT2=-Crtoi
  158. rem "Verbose" options
  159. if .%VERBOSEOPT% == . set VERBOSEOPT=-va
  160. set DOVERBOSE=
  161. rem Place for debug or release options, empty by default
  162. set CURRENTOPT1=
  163. set CURRENTOPT2=
  164. rem Stack size for the compiler
  165. set STACKOPT=-Cs64500
  166. rem Path to object files
  167. set OS2OBJP=-Fo%OS2RTL%
  168. rem Path to units
  169. set OS2UNITP=-Fu%FPCSNAPRTL%;%OS2RTL%
  170. rem Path to compiler units
  171. set COMPUNITP=-Fu%COMPSPATH%
  172. rem Path to compiler include files
  173. set COMPINCP=-Fi%COMPSPATH%
  174. rem Path to compiler object files
  175. set COMPOBJP=-Fo%COMPSPATH%
  176. rem Target path for RTL units
  177. set OS2UNITT=-FU%FPCSNAPRTL%
  178. rem Target path for executables
  179. set OS2EXET=-FE%FPCSNAPBIN%
  180. rem Path to include files
  181. set OS2INCP=-Fi%OS2RTL%;%OS2RTLC%;%OS2RTLO%;%OS2RTLP%
  182. rem Default compiler for the first compilation
  183. set CYCLE=0
  184. set COMPILER=%FPCCOMPILER%
  185. if .%FPCCOMPILER% == . goto SetCompiler
  186. goto PrgFound
  187. :SetCompiler
  188. set COMPILER=PPOS2.EXE
  189. :PrgFound
  190. echo *Searching for tools ... >> %FPCERRLOG%
  191. set REALTOOLS=%FPCTOOLS%
  192. if %FPCTOOLS%. == . goto SetupTools
  193. goto ToolsOK
  194. :SetupTools
  195. if exist %FPCDIR%\BIN\OS2\%COMPILER% goto Tools1
  196. if exist %FPCDIR%\BIN\OS2\%COMPILER%.EXE goto Tools1
  197. goto NoTools1
  198. :Tools1
  199. if exist %FPCDIR%\BIN\OS2\AS.EXE goto Tools1OK
  200. echo *Warning: %COMPILER% found, but AS.EXE isn't in the same directory! >> %FPCERRLOG%
  201. goto NoTools1
  202. :Tools1OK
  203. set REALTOOLS=%FPCDIR%\BIN\OS2\
  204. goto ToolsOK
  205. :NoTools1
  206. if exist %FPCDIR%\BIN\%COMPILER% goto Tools2
  207. if exist %FPCDIR%\BIN\%COMPILER%.EXE goto Tools2
  208. goto NoTools2
  209. :Tools2
  210. if exist %FPCDIR%\BIN\AS.EXE goto Tools2OK
  211. echo *Warning: %COMPILER% found, but AS.EXE isn't in the same directory! >> %FPCERRLOG%
  212. goto NoTools2
  213. :Tools2OK
  214. set REALTOOLS=%FPCDIR%\BIN\
  215. goto ToolsOK
  216. :NoTools2
  217. echo *Warning: Cannot locate your %COMPILER% and AS.EXE, make sure they're on PATH! >> %FPCERRLOG%
  218. :ToolsOK
  219. echo *Checking parameters >> %FPCERRLOG%
  220. set PARAMS=%1
  221. if .%PARAMS% == . set PARAMS=snapshot
  222. :ParLoop
  223. shift
  224. if %1. == . goto NoPars
  225. if %@EVAL[0] == 0 goto Shl1
  226. if %1 == debug set CURRENTOPT1=%DEBUGOPT1%
  227. if %1 == debug set CURRENTOPT2=%DEBUGOPT2%
  228. if %1 == release set CURRENTOPT1=%RELEASEOPT1%
  229. if %1 == release set CURRENTOPT2=%RELEASEOPT2%
  230. if %1 == verbose set DOVERBOSE=1
  231. goto ParLoop
  232. :Shl1
  233. set PARAMS=%@LOWER[%PARAMS%]
  234. if %@LOWER[%1] == debug set CURRENTOPT1=%DEBUGOPT1%
  235. if %@LOWER[%1] == debug set CURRENTOPT2=%DEBUGOPT2%
  236. if %@LOWER[%1] == release set CURRENTOPT1=%RELEASEOPT1%
  237. if %@LOWER[%1] == release set CURRENTOPT2=%RELEASEOPT2%
  238. if %@LOWER[%1] == verbose set DOVERBOSE=1
  239. goto ParLoop
  240. :NoPars
  241. if %PARAMS% == clean goto CleanRTL
  242. if %PARAMS% == both goto CleanRTL
  243. if %PARAMS% == snapshot goto CleanRTL
  244. if %PARAMS% == rtl goto CleanRTL
  245. if %PARAMS% == cycle goto CleanRTL
  246. if %PARAMS% == compiler goto CleanCompiler
  247. echo *Error: Unknown parameter - %PARAMS% >> %FPCERRLOG%
  248. goto End
  249. :CleanRTL
  250. if %@eval[0] == 0 goto JPCleanRTL
  251. echo *Cleaning up the RTL (error messages are OK here) ... >> %FPCERRLOG%
  252. del %OS2OPTF% >> %FPCERRLOG%
  253. del %OS2RTL%\*.ppo >> %FPCERRLOG%
  254. del %OS2RTL%\*.oo2 >> %FPCERRLOG%
  255. del %OS2RTL%\ppas.bat >> %FPCERRLOG%
  256. del %OS2RTL%\ppas.cmd >> %FPCERRLOG%
  257. del %OS2RTL%\link.res >> %FPCERRLOG%
  258. del %FPCSNAPRTL%\*.ppo >> %FPCERRLOG%
  259. del %FPCSNAPRTL%\*.oo2 >> %FPCERRLOG%
  260. del %FPCSNAPRTL%\ppas.bat >> %FPCERRLOG%
  261. del %FPCSNAPRTL%\ppas.cmd >> %FPCERRLOG%
  262. del %FPCSNAPRTL%\link.res >> %FPCERRLOG%
  263. goto ContCleanRTL
  264. :JPCleanRTL
  265. echo *Cleaning up the RTL ... >> %FPCERRLOG%
  266. del %OS2OPTF% >& nul >> %FPCERRLOG%
  267. del %OS2RTL%\*.ppo >& nul >> %FPCERRLOG%
  268. del %OS2RTL%\*.oo2 >& nul >> %FPCERRLOG%
  269. del %OS2RTL%\ppas.bat >& nul >> %FPCERRLOG%
  270. del %OS2RTL%\ppas.cmd >& nul >> %FPCERRLOG%
  271. del %OS2RTL%\link.res >& nul >> %FPCERRLOG%
  272. del %FPCSNAPRTL%\*.ppo >& nul >> %FPCERRLOG%
  273. del %FPCSNAPRTL%\*.oo2 >& nul >> %FPCERRLOG%
  274. del %FPCSNAPRTL%\ppas.bat >& nul >> %FPCERRLOG%
  275. del %FPCSNAPRTL%\ppas.cmd >& nul >> %FPCERRLOG%
  276. del %FPCSNAPRTL%\link.res >& nul >> %FPCERRLOG%
  277. :ContCleanRTL
  278. if %PARAMS% == rtl goto Branches
  279. :CleanCompiler
  280. if %@eval[0] == 0 goto JPCleanComp
  281. echo *Cleaning up the compiler (error messages are OK here) ... >> %FPCERRLOG%
  282. del %OS2OPTF% >> %FPCERRLOG%
  283. del %COMPSPATH%\*.ppo >> %FPCERRLOG%
  284. del %COMPSPATH%\*.oo2 >> %FPCERRLOG%
  285. del %COMPSPATH%\pp >> %FPCERRLOG%
  286. del %COMPSPATH%\pp.exe >> %FPCERRLOG%
  287. del %COMPSPATH%\ppos2.exe >> %FPCERRLOG%
  288. del %COMPSPATH%\ppas.bat >> %FPCERRLOG%
  289. del %COMPSPATH%\ppas.cmd >> %FPCERRLOG%
  290. del %COMPSPATH%\link.res >> %FPCERRLOG%
  291. del %FPCSNAPBIN%\*.ppo >> %FPCERRLOG%
  292. del %FPCSNAPBIN%\*.oo2 >> %FPCERRLOG%
  293. del %FPCSNAPBIN%\pp >> %FPCERRLOG%
  294. del %FPCSNAPBIN%\pp.exe >> %FPCERRLOG%
  295. del %FPCSNAPBIN%\ppos2.exe >> %FPCERRLOG%
  296. del %FPCSNAPBIN%\ppas.bat >> %FPCERRLOG%
  297. del %FPCSNAPBIN%\ppas.cmd >> %FPCERRLOG%
  298. del %FPCSNAPBIN%\link.res >> %FPCERRLOG%
  299. goto ContCleanComp
  300. :JPCleanComp
  301. echo *Cleaning up the compiler ... >> %FPCERRLOG%
  302. del %OS2OPTF% >& nul >> %FPCERRLOG%
  303. del %COMPSPATH%\*.ppo >& nul >> %FPCERRLOG%
  304. del %COMPSPATH%\*.oo2 >& nul >> %FPCERRLOG%
  305. del %COMPSPATH%\pp >& nul >> %FPCERRLOG%
  306. del %COMPSPATH%\pp.exe >& nul >> %FPCERRLOG%
  307. del %COMPSPATH%\ppos2.exe >& nul >> %FPCERRLOG%
  308. del %COMPSPATH%\ppas.bat >& nul >> %FPCERRLOG%
  309. del %COMPSPATH%\ppas.cmd >& nul >> %FPCERRLOG%
  310. del %COMPSPATH%\link.res >& nul >> %FPCERRLOG%
  311. del %FPCSNAPBIN%\*.ppo >& nul >> %FPCERRLOG%
  312. del %FPCSNAPBIN%\*.oo2 >& nul >> %FPCERRLOG%
  313. del %FPCSNAPBIN%\pp >& nul >> %FPCERRLOG%
  314. del %FPCSNAPBIN%\pp.exe >& nul >> %FPCERRLOG%
  315. del %FPCSNAPBIN%\ppos2.exe >& nul >> %FPCERRLOG%
  316. del %FPCSNAPBIN%\ppas.bat >& nul >> %FPCERRLOG%
  317. del %FPCSNAPBIN%\ppas.cmd >& nul >> %FPCERRLOG%
  318. del %FPCSNAPBIN%\link.res >& nul >> %FPCERRLOG%
  319. :ContCleanComp
  320. if %PARAMS% == compiler goto Branches
  321. if %PARAMS% == both goto Branches
  322. :CleanSnapshot
  323. if %@eval[0] == 0 goto JPCleanSnap
  324. echo *Deleting the old snapshot (error messages are OK here) ... >> %FPCERRLOG%
  325. del %FPCSNAPDOC%\*.txt >> %FPCERRLOG%
  326. del %FPCSNAPDOC%\*.htm* >> %FPCERRLOG%
  327. del %FPCSNAPDOC%\copying.* >> %FPCERRLOG%
  328. del %FPCSNAPMSG%\*.msg >> %FPCERRLOG%
  329. del %FPCSNAP%\baseemx.zip >> %FPCERRLOG%
  330. goto ContCleanSnap
  331. :JPCleanSnap
  332. echo *Deleting the old snapshot ... >> %FPCERRLOG%
  333. del %FPCSNAP%\baseemx.zip >& nul >> %FPCERRLOG%
  334. del %FPCSNAPDOC%\*.txt >& nul >> %FPCERRLOG%
  335. del %FPCSNAPDOC%\*.htm* >& nul >> %FPCERRLOG%
  336. del %FPCSNAPDOC%\copying.* >& nul >> %FPCERRLOG%
  337. del %FPCSNAPMSG%\*.msg >& nul >> %FPCERRLOG%
  338. :ContCleanSnap
  339. if %PARAMS% == clean goto End
  340. :Branches
  341. if %PARAMS% == both goto RTL1
  342. if %PARAMS% == snapshot goto RTL1
  343. if %PARAMS% == compiler goto Compiler
  344. if %PARAMS% == rtl goto RTL1
  345. if %PARAMS% == cycle goto RTL1
  346. echo *Error: Unknown parameter - %PARAMS% >> %FPCERRLOG%
  347. goto End
  348. :RTL1
  349. echo *Creating file with all the needed options and paths for RTL ... >> %FPCERRLOG%
  350. echo %SKIPCFG% > %OS2OPTF%
  351. echo %OS2OPT1% >> %OS2OPTF%
  352. echo %OS2OPT2% >> %OS2OPTF%
  353. echo %OS2OPT3% >> %OS2OPTF%
  354. echo %OS2OPT4% >> %OS2OPTF%
  355. echo %OS2OBJP% >> %OS2OPTF%
  356. echo %OS2UNITP% >> %OS2OPTF%
  357. echo %OS2INCP% >> %OS2OPTF%
  358. echo %OS2UNITT% >> %OS2OPTF%
  359. echo -FD%REALTOOLS% >> %OS2OPTF%
  360. if not .%CURRENTOPT1% == . echo %CURRENTOPT1% >> %OS2OPTF%
  361. if not .%CURRENTOPT2% == . echo %CURRENTOPT2% >> %OS2OPTF%
  362. if not .%FPCERRLOG% == . echo -Fe%FPCERRLOG% >> %OS2OPTF%
  363. if .%DOVERBOSE% == .1 echo %VERBOSEOPT% >> %OS2OPTF%
  364. if not .%DOVERBOSE% == .1 goto CompStart1
  365. echo *Start of options used for compilation >> %FPCERRLOG%
  366. type %OS2OPTF% >> %FPCERRLOG%
  367. echo *End of options used for compilation >> %FPCERRLOG%
  368. :CompStart1
  369. echo *Assembling the helpers ... >> %FPCERRLOG%
  370. %REALTOOLS%\as -o %FPCSNAPRTL%\prt0.oo2 %OS2RTL%\prt0.as
  371. %REALTOOLS%\as -o %FPCSNAPRTL%\prt1.oo2 %OS2RTL%\prt1.as
  372. %REALTOOLS%\as -o %FPCSNAPRTL%\code2.oo2 %OS2RTL%\code2.as
  373. %REALTOOLS%\as -o %FPCSNAPRTL%\code3.oo2 %OS2RTL%\code3.as
  374. echo *Compiling the system unit ... >> %FPCERRLOG%
  375. %REALTOOLS%%COMPILER% @%OS2OPTF% -Us %OTHEROPTS% %OS2RTL%\SYSOS2.PAS
  376. echo *Compiling unit Objects ... >> %FPCERRLOG%
  377. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\OBJECTS.PP
  378. echo *Compiling unit Strings ... >> %FPCERRLOG%
  379. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\STRINGS.PP
  380. echo *Compiling unit HeapTrace ... >> %FPCERRLOG%
  381. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\HEAPTRC.PP
  382. echo *Compiling unit CPU ... >> %FPCERRLOG%
  383. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLP%\CPU.PP
  384. echo *Compiling unit MMX ... >> %FPCERRLOG%
  385. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLP%\MMX.PP
  386. echo *Compiling unit TypInfo ... >> %FPCERRLOG%
  387. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLO%\TYPINFO.PP
  388. echo *Compiling unit DosCalls ... >> %FPCERRLOG%
  389. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\DOSCALLS.PAS
  390. echo *Compiling unit DOS ... >> %FPCERRLOG%
  391. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\DOS.PAS
  392. echo *Compiling unit CRT ... >> %FPCERRLOG%
  393. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\CRT.PAS
  394. echo *Compiling unit Printer ... >> %FPCERRLOG%
  395. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PRINTER.PAS
  396. echo *Compiling unit SysUtils ... >> %FPCERRLOG%
  397. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLO%\SYSUTILS.PP
  398. echo *Compiling unit Math ... >> %FPCERRLOG%
  399. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLO%\MATH.PP
  400. echo *Compiling unit UComplex ... >> %FPCERRLOG%
  401. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\UCOMPLEX.PP
  402. echo *Compiling unit GetOpts ... >> %FPCERRLOG%
  403. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTLC%\GETOPTS.PP
  404. echo *Compiling unit KbdCalls ... >> %FPCERRLOG%
  405. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\KBDCALLS.PAS
  406. echo *Compiling unit MouCalls ... >> %FPCERRLOG%
  407. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\MOUCALLS.PAS
  408. echo *Compiling unit VioCalls ... >> %FPCERRLOG%
  409. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\VIOCALLS.PAS
  410. echo *Compiling unit MonCalls ... >> %FPCERRLOG%
  411. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\MONCALLS.PAS
  412. echo *Compiling unit Ports ... >> %FPCERRLOG%
  413. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PORTS.PAS
  414. echo *Compiling PM units ... >> %FPCERRLOG%
  415. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PMWIN.PAS
  416. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PMBITMAP.PAS
  417. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\PMGPI.PAS
  418. echo *Compiling MMOS2 units ... >> %FPCERRLOG%
  419. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %OS2RTL%\DIVE.PAS
  420. if %PARAMS% == rtl goto End
  421. :Compiler
  422. echo *Creating file with all the needed options and paths for the compiler ... >> %FPCERRLOG%
  423. echo %SKIPCFG% > %OS2OPTF%
  424. echo %OS2OPT1% >> %OS2OPTF%
  425. echo %OS2OPT2% >> %OS2OPTF%
  426. echo %OS2OPT3% >> %OS2OPTF%
  427. echo %OS2OPT4% >> %OS2OPTF%
  428. echo %OS2OBJP% >> %OS2OPTF%
  429. echo %OS2UNITP% >> %OS2OPTF%
  430. echo -FD%REALTOOLS% >> %OS2OPTF%
  431. echo %COMPUNITP% >> %OS2OPTF%
  432. echo %COMPINCP% >> %OS2OPTF%
  433. echo %COMPOBJP% >> %OS2OPTF%
  434. echo %STACKOPT% >> %OS2OPTF%
  435. echo %OS2EXET% >> %OS2OPTF%
  436. if not .%CURRENTOPT1% == . echo %CURRENTOPT1% >> %OS2OPTF%
  437. if not .%CURRENTOPT2% == . echo %CURRENTOPT2% >> %OS2OPTF%
  438. if not .%FPCERRLOG% == . echo -Fe%FPCERRLOG% >> %OS2OPTF%
  439. if .%DOVERBOSE% == .1 echo %VERBOSEOPT% >> %OS2OPTF%
  440. if not .%DOVERBOSE% == .1 goto CompStart2
  441. echo *Start of options used for compilation >> %FPCERRLOG%
  442. type %OS2OPTF% >> %FPCERRLOG%
  443. echo *End of options used for compilation >> %FPCERRLOG%
  444. :CompStart2
  445. echo *Compiling the compiler ... >> %FPCERRLOG%
  446. %REALTOOLS%%COMPILER% @%OS2OPTF% %OTHEROPTS% %COMPSPATH%\PP.PAS
  447. :Comp2
  448. ren %FPCSNAPBIN%\pp.exe ppos2.exe >> %FPCERRLOG%
  449. if exist %FPCSNAPBIN%\ppos2.exe goto OKCompiler
  450. if not exist %FPCSNAPBIN%\pp goto C2Cont
  451. if exist %FPCSNAPBIN%\ppas.bat goto PPasBat
  452. if exist %FPCSNAPBIN%\ppas.cmd goto PPasCmd
  453. :C2Cont
  454. echo *Error: The compiler wasn't compiled!! >> %FPCERRLOG%
  455. goto End
  456. :PPasBat
  457. echo *Automatic binding failed, trying again ... >> %FPCERRLOG%
  458. call %FPCSNAPBIN%\ppas.bat
  459. del %FPCSNAPBIN%\ppas.bat >> %FPCERRLOG%
  460. goto Comp2
  461. :PPasCmd
  462. echo *Automatic binding failed, trying again ... >> %FPCERRLOG%
  463. call %FPCSNAPBIN%\ppas.cmd
  464. del %FPCSNAPBIN%\ppas.cmd >> %FPCERRLOG%
  465. goto Comp2
  466. :OKCompiler
  467. if %PARAMS% == compiler goto End
  468. if %PARAMS% == both goto End
  469. if %PARAMS% == cycle goto Cycle
  470. goto CopyFiles
  471. :Cycle
  472. rem Another loop?
  473. if %CYCLE% == 2 goto CopyFiles
  474. echo *Backing up previous compiler version to ppos2.%CYCLE% ... >> %FPCERRLOG%
  475. copy %REALTOOLS%ppos2.exe %REALTOOLS%ppos2.%CYCLE% >> %FPCERRLOG%
  476. echo *Copying the newly created compiler to %REALTOOLS% ... >> %FPCERRLOG%
  477. copy %FPCSNAPBIN%\ppos2.exe %REALTOOLS%. >> %FPCERRLOG%
  478. if %CYCLE% == 1 goto Cycle2
  479. set COMPILER=PPOS2.EXE
  480. set CYCLE=1
  481. goto NoPars
  482. :Cycle2
  483. set CYCLE=2
  484. goto NoPars
  485. :CopyFiles
  486. set FPCSNAPTXT=%FPCSNAPDOC%\snapshot.txt
  487. echo *Copying the documentation ... >> %FPCERRLOG%
  488. copy %FPCSRC%\INSTALL\DOC\*.txt %FPCSNAPDOC% >> %FPCERRLOG%
  489. copy %FPCSRC%\INSTALL\DOC\*.htm* %FPCSNAPDOC% >> %FPCERRLOG%
  490. copy %FPCSRC%\INSTALL\DOC\copying.* %FPCSNAPDOC% >> %FPCERRLOG%
  491. echo *Creating the snapshot readme file ... >> %FPCERRLOG%
  492. echo This is a FPC snapshot for OS/2. It contains compilation of the most current >> %FPCSNAPTXT%
  493. echo developers' sources as of time of its creation. It contains the latest fixes >> %FPCSNAPTXT%
  494. echo but might contain some new bugs as well, since it's less tested than regular >> %FPCSNAPTXT%
  495. echo releases. Please, send your error reports to [email protected] >> %FPCSNAPTXT%
  496. echo mailing list (and don't forget to mention the fact you're not subscribed to >> %FPCSNAPTXT%
  497. echo the list in your e-mail, if it's the case). >> %FPCSNAPTXT%
  498. echo The snapshot has the same structure as the release ZIP files, so it may be >> %FPCSNAPTXT%
  499. echo installed using the normal installer (INSTALL.EXE and INSTALL.DAT must be >> %FPCSNAPTXT%
  500. echo in the same directory) or directly unzipped into your FPC tree. >> %FPCSNAPTXT%
  501. echo *Copying the message files ... >> %FPCERRLOG%
  502. copy %COMPSPATH%\*.msg %FPCSNAPMSG% >> %FPCERRLOG%
  503. if %@EVAL[0] == 0 goto Pack
  504. echo *Warning: Packing in this environment might fail. >> %FPCERRLOG%
  505. echo *You should press Ctrl-Break now if the current drive is different from that >> %FPCERRLOG%
  506. echo *of %FPCSNAP%; otherwise press any key to continue. >> %FPCERRLOG%
  507. if not %FPCERRLOG% == CON echo *Warning: Packing in this environment might fail.
  508. if not %FPCERRLOG% == CON echo *You should press Ctrl-Break now if the current drive is different from that
  509. if not %FPCERRLOG% == CON echo *of %FPCDIR%; otherwise press any key to continue.
  510. pause>nul
  511. cd %FPCSNAP%
  512. :Pack
  513. echo *Packing the snapshot ... >> %FPCERRLOG%
  514. if %@EVAL[0] == 0 goto SHL2
  515. goto Cmd2
  516. :Shl2
  517. pushd
  518. cdd %FPCSNAP%
  519. :Cmd2
  520. rem ZIP.EXE must be on the PATH
  521. zip -9 -r baseemx.zip bin\os2\ppos2.exe doc\* msg\* units\os2\rtl\*.ppo units\os2\rtl\*.oo2 units\os2\rtl\*.ao2 >> %FPCERRLOG%
  522. if exist baseemx.zip goto ZipOK
  523. echo *Error: The ZIP file hasn't been created!! >> %FPCERRLOG%
  524. :ZipOK
  525. if %@EVAL[0] == 0 popd
  526. echo *Done. >> %FPCERRLOG%
  527. goto End
  528. :ErrorDir
  529. echo *Error: Environment variable FPCDIR must point to your base FPC directory!!! >> %FPCERRLOG%
  530. goto End
  531. $Log$
  532. Revision 1.9 2000-03-05 19:13:25 hajny
  533. * new snapshot structure
  534. Revision 1.8 2000/01/29 16:24:01 hajny
  535. * logging enhanced, verbose support, error for non-4dos fixed
  536. Revision 1.7 2000/01/26 22:34:36 hajny
  537. * support for error logging added
  538. Revision 1.6 2000/01/16 18:44:21 hajny
  539. * got rid of PPC386.CFG dependency
  540. Revision 1.3 1999/10/01 09:00:21 hajny
  541. + PMGPI and DIVE added
  542. Revision 1.2 1999/09/15 07:31:49 hajny
  543. + some units added, OTHEROPTS variable support
  544. :End