systems.pas 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  1. {
  2. $Id$
  3. Copyright (C) 1995,97 by Florian Klaempfl
  4. This unit contains information about the target systems supported
  5. (these are not processor specific)
  6. This progsam is free software; you can redistribute it and/or modify
  7. iu under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 3 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge- MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit systems;
  20. interface
  21. type
  22. tendian = (endian_little,endian_big);
  23. ttargetcpu=(no_cpu
  24. ,i386,m68k,alpha
  25. );
  26. tprocessors = (no_processor
  27. ,Class386,ClassP5,ClassP6
  28. ,MC68000,MC68100,MC68020
  29. );
  30. type
  31. tasmmode= (asmmode_none
  32. ,asmmode_i386_direct,asmmode_i386_att,asmmode_i386_intel
  33. ,asmmode_m68k_mot
  34. );
  35. const
  36. {$ifdef i386} i386asmmodecnt=3; {$else} i386asmmodecnt=0; {$endif}
  37. {$ifdef m68k} m68kasmmodecnt=1; {$else} m68kasmmodecnt=0; {$endif}
  38. asmmodecnt=i386asmmodecnt+m68kasmmodecnt+1;
  39. type
  40. ttarget = (target_none
  41. ,target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
  42. target_i386_OS2,target_i386_Win32
  43. ,target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
  44. target_m68k_linux,target_m68k_PalmOS
  45. );
  46. const
  47. {$ifdef i386} i386targetcnt=5; {$else} i386targetcnt=0; {$endif}
  48. {$ifdef m68k} m68ktargetcnt=5; {$else} m68ktargetcnt=0; {$endif}
  49. targetcnt=i386targetcnt+m68ktargetcnt+1;
  50. type
  51. tasm = (as_none
  52. ,as_i386_o,as_i386_o_aout,as_i386_asw,
  53. as_i386_nasmcoff,as_i386_nasmelf,as_i386_nasmobj,
  54. as_i386_tasm,as_i386_masm
  55. ,as_m68k_o,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw
  56. );
  57. const
  58. {$ifdef i386} i386asmcnt=8; {$else} i386asmcnt=0; {$endif}
  59. {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
  60. asmcnt=i386asmcnt+m68kasmcnt+1;
  61. type
  62. tlink = (link_none
  63. ,link_i386_ld,link_i386_ldgo32v1,
  64. link_i386_ldgo32v2,link_i386_ldw,
  65. link_i386_ldos2
  66. ,link_m68k_ld
  67. );
  68. const
  69. {$ifdef i386} i386linkcnt=5; {$else} i386linkcnt=0; {$endif}
  70. {$ifdef m68k} m68klinkcnt=1; {$else} m68klinkcnt=0; {$endif}
  71. linkcnt=i386linkcnt+m68klinkcnt+1;
  72. type
  73. tar = (ar_none
  74. ,ar_i386_ar,ar_i386_arw
  75. ,ar_m68k_ar
  76. );
  77. const
  78. {$ifdef i386} i386arcnt=2; {$else} i386arcnt=0; {$endif}
  79. {$ifdef m68k} m68karcnt=1; {$else} m68karcnt=0; {$endif}
  80. arcnt=i386arcnt+m68karcnt+1;
  81. type
  82. tos = ( os_none,
  83. os_i386_GO32V1,os_i386_GO32V2,os_i386_Linux,os_i386_OS2,
  84. os_i386_Win32,
  85. os_m68k_Amiga,os_m68k_Atari,os_m68k_Mac,os_m68k_Linux,
  86. os_m68k_PalmOS
  87. );
  88. const
  89. i386oscnt=5;
  90. m68koscnt=5;
  91. oscnt=i386oscnt+m68koscnt+1;
  92. type
  93. tosinfo = packed record
  94. id : tos;
  95. name : string[30];
  96. sharedlibext,
  97. staticlibext,
  98. sourceext,
  99. pasext,
  100. exeext,
  101. scriptext : string[4];
  102. libprefix : string[3];
  103. Cprefix : string[2];
  104. newline : string[2];
  105. endian : tendian;
  106. stackalignment : {longint this is a little overkill no ?? }byte;
  107. size_of_pointer : byte;
  108. size_of_longint : byte;
  109. use_function_relative_addresses : boolean;
  110. end;
  111. tasminfo = packed record
  112. id : tasm;
  113. idtxt : string[8];
  114. asmbin : string[8];
  115. asmcmd : string[50];
  116. externals : boolean;
  117. labelprefix : string[2];
  118. comment : string[2];
  119. end;
  120. tlinkinfo = packed record
  121. id : tlink;
  122. linkbin : string[8];
  123. linkcmd : string[50];
  124. bindbin : string[8];
  125. bindcmd : string[50];
  126. stripopt : string[2];
  127. libpathprefix : string[13];
  128. libpathsuffix : string[2];
  129. groupstart : string[8];
  130. groupend : string[2];
  131. inputstart : string[8];
  132. inputend : string[2];
  133. libprefix : string[2];
  134. end;
  135. tarinfo = packed record
  136. id : tar;
  137. arbin : string[8];
  138. arcmd : string[50];
  139. end;
  140. ttargetinfo = packed record
  141. target : ttarget;
  142. cpu : ttargetcpu;
  143. short_name : string[8];
  144. unit_env : string[12];
  145. system_unit : string[8];
  146. smartext,
  147. unitext,
  148. unitlibext,
  149. asmext,
  150. objext,
  151. exeext : string[4];
  152. os : tos;
  153. link : tlink;
  154. assem : tasm;
  155. ar : tar;
  156. heapsize,
  157. maxheapsize,
  158. stacksize : longint;
  159. end;
  160. tasmmodeinfo=packed record
  161. id : tasmmode;
  162. idtxt : string[8];
  163. end;
  164. var
  165. target_cpu : ttargetcpu;
  166. target_info : ttargetinfo;
  167. target_os : tosinfo;
  168. target_asm : tasminfo;
  169. target_link : tlinkinfo;
  170. target_ar : tarinfo;
  171. source_os : tosinfo;
  172. function set_string_target(s : string) : boolean;
  173. function set_string_asm(s : string) : boolean;
  174. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  175. implementation
  176. const
  177. {****************************************************************************
  178. OS Info
  179. ****************************************************************************}
  180. os_infos : array[1..oscnt] of tosinfo = (
  181. (
  182. id : os_none;
  183. name : 'No operating system'
  184. ),
  185. (
  186. id : os_i386_go32v1;
  187. name : 'GO32 V1 DOS extender';
  188. sharedlibext : '.dll';
  189. staticlibext : '.a';
  190. sourceext : '.pp';
  191. pasext : '.pas';
  192. exeext : ''; { No .exe, the linker only output a.out ! }
  193. scriptext : '.bat';
  194. libprefix : '';
  195. Cprefix : '_';
  196. newline : #13#10;
  197. endian : endian_little;
  198. stackalignment : 2;
  199. size_of_pointer : 4;
  200. size_of_longint : 4;
  201. use_function_relative_addresses : true
  202. ),
  203. (
  204. id : os_i386_go32v2;
  205. name : 'GO32 V2 DOS extender';
  206. sharedlibext : '.dll';
  207. staticlibext : '.a';
  208. sourceext : '.pp';
  209. pasext : '.pas';
  210. exeext : '.exe';
  211. scriptext : '.bat';
  212. libprefix : '';
  213. Cprefix : '_';
  214. newline : #13#10;
  215. endian : endian_little;
  216. stackalignment : 2;
  217. size_of_pointer : 4;
  218. size_of_longint : 4;
  219. use_function_relative_addresses : true
  220. ),
  221. (
  222. id : os_i386_linux;
  223. name : 'Linux for i386';
  224. sharedlibext : '.so';
  225. staticlibext : '.a';
  226. sourceext : '.pp';
  227. pasext : '.pas';
  228. exeext : '';
  229. scriptext : '.sh';
  230. libprefix : 'lib';
  231. Cprefix : '';
  232. newline : #10;
  233. endian : endian_little;
  234. stackalignment : 4;
  235. size_of_pointer : 4;
  236. size_of_longint : 4;
  237. use_function_relative_addresses : true
  238. ),
  239. (
  240. id : os_i386_os2;
  241. name : 'OS/2 via EMX';
  242. sharedlibext : '.ao2';
  243. staticlibext : '.ao2';
  244. sourceext : '.pas';
  245. pasext : '.pp';
  246. exeext : '.exe';
  247. scriptext : '.cmd';
  248. libprefix : '';
  249. Cprefix : '_';
  250. newline : #13#10;
  251. endian : endian_little;
  252. stackalignment : 2;
  253. size_of_pointer : 4;
  254. size_of_longint : 4;
  255. use_function_relative_addresses : false
  256. ),
  257. (
  258. id : os_i386_win32;
  259. name : 'Win32 for i386';
  260. sharedlibext : '.dll';
  261. staticlibext : '.aw';
  262. sourceext : '.pp';
  263. pasext : '.pas';
  264. exeext : '.exe';
  265. scriptext : '.bat';
  266. libprefix : 'lib';
  267. Cprefix : '_';
  268. newline : #13#10;
  269. endian : endian_little;
  270. stackalignment : 4;
  271. size_of_pointer : 4;
  272. size_of_longint : 4;
  273. use_function_relative_addresses : true
  274. ),
  275. (
  276. id : os_m68k_amiga;
  277. name : 'Commodore Amiga';
  278. sharedlibext : '.library';
  279. staticlibext : '.a';
  280. sourceext : '.pp';
  281. pasext : '.pas';
  282. exeext : '';
  283. scriptext : '';
  284. libprefix : '';
  285. Cprefix : '_';
  286. newline : #10;
  287. endian : endian_big;
  288. stackalignment : 2;
  289. size_of_pointer : 4;
  290. size_of_longint : 4;
  291. use_function_relative_addresses : false
  292. ),
  293. (
  294. id : os_m68k_atari;
  295. name : 'Atari ST/STE';
  296. sharedlibext : '.dll';
  297. staticlibext : '.a';
  298. sourceext : '.pp';
  299. pasext : '.pas';
  300. exeext : '.tpp';
  301. scriptext : '';
  302. libprefix : '';
  303. Cprefix : '_';
  304. newline : #10;
  305. endian : endian_big;
  306. stackalignment : 2;
  307. size_of_pointer : 4;
  308. size_of_longint : 4;
  309. use_function_relative_addresses : false
  310. ),
  311. (
  312. id : os_m68k_mac;
  313. name : 'Macintosh m68k';
  314. sharedlibext : '.dll';
  315. staticlibext : '.a';
  316. sourceext : '.pp';
  317. pasext : '.pas';
  318. exeext : '.tpp';
  319. scriptext : '';
  320. libprefix : '';
  321. Cprefix : '_';
  322. newline : #13;
  323. endian : endian_big;
  324. stackalignment : 2;
  325. size_of_pointer : 4;
  326. size_of_longint : 4;
  327. use_function_relative_addresses : false
  328. ),
  329. (
  330. id : os_m68k_linux;
  331. name : 'Linux for m68k';
  332. sharedlibext : '.so';
  333. staticlibext : '.a';
  334. sourceext : '.pp';
  335. pasext : '.pas';
  336. exeext : '';
  337. scriptext : '.sh';
  338. libprefix : 'lib';
  339. Cprefix : '';
  340. newline : #10;
  341. endian : endian_big;
  342. stackalignment : 2;
  343. size_of_pointer : 4;
  344. size_of_longint : 4;
  345. use_function_relative_addresses : true
  346. ),
  347. (
  348. id : os_m68k_palmos;
  349. name : 'PalmOS';
  350. sharedlibext : '.so';
  351. staticlibext : '.a';
  352. sourceext : '.pp';
  353. pasext : '.pas';
  354. exeext : '';
  355. scriptext : '.sh';
  356. libprefix : 'lib';
  357. Cprefix : '_';
  358. newline : #10;
  359. endian : endian_big;
  360. stackalignment : 2;
  361. size_of_pointer : 4;
  362. size_of_longint : 4;
  363. use_function_relative_addresses : false
  364. )
  365. );
  366. {****************************************************************************
  367. Assembler Info
  368. ****************************************************************************}
  369. as_infos : array[1..asmcnt] of tasminfo = (
  370. (
  371. id : as_none;
  372. idtxt : 'no'
  373. )
  374. {$ifdef i386}
  375. ,(
  376. id : as_i386_o;
  377. idtxt : 'O';
  378. asmbin : 'as';
  379. asmcmd : '-o $OBJ $ASM';
  380. externals : false;
  381. labelprefix : '.L';
  382. comment : '# '
  383. )
  384. ,(
  385. id : as_i386_o_aout;
  386. idtxt : 'O_AOUT';
  387. asmbin : 'as';
  388. asmcmd : '-o $OBJ $ASM';
  389. externals : false;
  390. labelprefix : 'L';
  391. comment : '# '
  392. )
  393. ,(
  394. id : as_i386_asw;
  395. idtxt : 'ASW';
  396. asmbin : 'asw';
  397. asmcmd : '-o $OBJ $ASM';
  398. externals : false;
  399. labelprefix : '.L';
  400. comment : '# '
  401. )
  402. ,(
  403. id : as_i386_nasmcoff;
  404. idtxt : 'NASMCOFF';
  405. asmbin : 'nasm';
  406. asmcmd : '-f coff -o $OBJ $ASM';
  407. externals : true;
  408. labelprefix : 'L';
  409. comment : '; '
  410. )
  411. ,(
  412. id : as_i386_nasmelf;
  413. idtxt : 'NASMELF';
  414. asmbin : 'nasm';
  415. asmcmd : '-f elf -o $OBJ $ASM';
  416. externals : true;
  417. labelprefix : 'L';
  418. comment : '; '
  419. )
  420. ,(
  421. id : as_i386_nasmobj;
  422. idtxt : 'NASMOBJ';
  423. asmbin : 'nasm';
  424. asmcmd : '-f obj -o $OBJ $ASM';
  425. externals : true;
  426. labelprefix : 'L';
  427. comment : '; '
  428. )
  429. ,(
  430. id : as_i386_tasm;
  431. idtxt : 'TASM';
  432. asmbin : 'tasm';
  433. asmcmd : '/m2 $ASM $OBJ';
  434. externals : true;
  435. labelprefix : '.L';
  436. comment : '; '
  437. )
  438. ,(
  439. id : as_i386_masm;
  440. idtxt : 'MASM';
  441. asmbin : 'masm';
  442. asmcmd : '$ASM $OBJ';
  443. externals : true;
  444. labelprefix : '.L';
  445. comment : '; '
  446. )
  447. {$endif i386}
  448. {$ifdef m68k}
  449. ,(
  450. id : as_m68k_o;
  451. idtxt : 'O';
  452. asmbin : 'as';
  453. asmcmd : '-o $OBJ $ASM';
  454. externals : false;
  455. labelprefix : '.L';
  456. comment : '# '
  457. )
  458. ,(
  459. id : as_m68k_gas;
  460. idtxt : 'GAS';
  461. asmbin : 'as68k'; { Gas for the Amiga}
  462. asmcmd : '--register-prefix-optional -o $OBJ $ASM';
  463. externals : false;
  464. labelprefix : '.L';
  465. comment : '| '
  466. )
  467. ,(
  468. id : as_m68k_mit;
  469. idtxt : 'MIT';
  470. asmbin : '';
  471. asmcmd : '-o $OBJ $ASM';
  472. externals : false;
  473. labelprefix : '.L';
  474. comment : '| '
  475. )
  476. ,(
  477. id : as_m68k_mot;
  478. idtxt : 'MOT';
  479. asmbin : '';
  480. asmcmd : '-o $OBJ $ASM';
  481. externals : false;
  482. labelprefix : '__L';
  483. comment : '| '
  484. )
  485. ,(
  486. id : as_m68k_mpw;
  487. idtxt : 'MPW';
  488. asmbin : '';
  489. asmcmd : '-model far -o $OBJ $ASM';
  490. externals : false;
  491. labelprefix : '__L';
  492. comment : '| '
  493. )
  494. {$endif m68k}
  495. );
  496. {****************************************************************************
  497. Linker Info
  498. ****************************************************************************}
  499. link_infos : array[1..linkcnt] of tlinkinfo = (
  500. (
  501. id : link_none
  502. )
  503. {$ifdef i386}
  504. ,(
  505. id : link_i386_ld;
  506. linkbin : 'ld';
  507. linkcmd : '$OPT -o $EXE $RES';
  508. bindbin : '';
  509. bindcmd : '';
  510. stripopt : '-s';
  511. libpathprefix : 'SEARCH_DIR(';
  512. libpathsuffix : ')';
  513. groupstart : 'GROUP(';
  514. groupend : ')';
  515. inputstart : 'INPUT(';
  516. inputend : ')';
  517. libprefix : '-l'
  518. )
  519. ,(
  520. id : link_i386_ldgo32v1;
  521. linkbin : 'ld';
  522. linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
  523. bindbin : 'aout2exe';
  524. bindcmd : '$EXE';
  525. stripopt : '-s';
  526. libpathprefix : '-L';
  527. libpathsuffix : '';
  528. groupstart : '-(';
  529. groupend : '-)';
  530. inputstart : '';
  531. inputend : '';
  532. libprefix : '-l'
  533. )
  534. ,(
  535. id : link_i386_ldgo32v2;
  536. linkbin : 'ld';
  537. linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
  538. bindbin : '';
  539. bindcmd : '';
  540. stripopt : '-s';
  541. libpathprefix : '-L';
  542. libpathsuffix : '';
  543. groupstart : '-(';
  544. groupend : '-)';
  545. inputstart : '';
  546. inputend : '';
  547. libprefix : '-l'
  548. )
  549. ,(
  550. id : link_i386_ldw;
  551. linkbin : 'ldw';
  552. linkcmd : '$OPT -o $EXE $RES';
  553. bindbin : '';
  554. bindcmd : '';
  555. stripopt : '-s';
  556. libpathprefix : 'SEARCH_DIR(';
  557. libpathsuffix : ')';
  558. groupstart : 'GROUP(';
  559. groupend : ')';
  560. inputstart : 'INPUT(';
  561. inputend : ')';
  562. libprefix : '-l'
  563. )
  564. ,(
  565. id : link_i386_ldos2;
  566. linkbin : 'ld'; { Os/2 }
  567. linkcmd : '-o $EXE @$RES';
  568. bindbin : 'emxbind';
  569. bindcmd : '-b -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB';
  570. stripopt : '-s';
  571. libpathprefix : '-L';
  572. libpathsuffix : '';
  573. groupstart : ''; {Linker is too primitive...}
  574. groupend : '';
  575. inputstart : '';
  576. inputend : '';
  577. libprefix : '-l'
  578. )
  579. {$endif i386}
  580. {$ifdef m68k}
  581. ,(
  582. id : link_m68k_ld;
  583. linkbin : 'ld';
  584. linkcmd : '$OPT -o $EXE $RES';
  585. bindbin : '';
  586. bindcmd : '';
  587. stripopt : '-s';
  588. libpathprefix : 'SEARCH_DIR(';
  589. libpathsuffix : ')';
  590. groupstart : 'GROUP(';
  591. groupend : ')';
  592. inputstart : 'INPUT(';
  593. inputend : ')';
  594. libprefix : '-l'
  595. )
  596. {$endif m68k}
  597. );
  598. {****************************************************************************
  599. Ar Info
  600. ****************************************************************************}
  601. ar_infos : array[1..arcnt] of tarinfo = (
  602. (
  603. id : ar_none
  604. )
  605. {$ifdef i386}
  606. ,(
  607. id : ar_i386_ar;
  608. arbin : 'ar';
  609. arcmd : 'rs $LIB $FILES'
  610. ),
  611. (
  612. id : ar_i386_arw;
  613. arbin : 'arw';
  614. arcmd : 'rs $LIB $FILES'
  615. )
  616. {$endif i386}
  617. {$ifdef m68k}
  618. ,(
  619. id : ar_m68k_ar;
  620. arbin : 'ar';
  621. arcmd : 'rs $LIB $FILES'
  622. )
  623. {$endif m68k}
  624. );
  625. {****************************************************************************
  626. Targets Info
  627. ****************************************************************************}
  628. target_infos : array[1..targetcnt] of ttargetinfo = (
  629. (
  630. target : target_none;
  631. cpu : no_cpu;
  632. short_name : 'notarget'
  633. )
  634. {$ifdef i386}
  635. ,(
  636. target : target_i386_GO32V1;
  637. cpu : i386;
  638. short_name : 'GO32V1';
  639. unit_env : 'GO32V1UNITS';
  640. system_unit : 'SYSTEM';
  641. smartext : '.sl';
  642. unitext : '.pp1';
  643. unitlibext : '.ppl';
  644. asmext : '.s1';
  645. objext : '.o1';
  646. exeext : ''; { The linker produces a.out }
  647. os : os_i386_GO32V1;
  648. link : link_i386_ldgo32v1;
  649. assem : as_i386_o;
  650. ar : ar_i386_ar;
  651. heapsize : 2048*1024;
  652. maxheapsize : 32768*1024;
  653. stacksize : 16384
  654. ),
  655. (
  656. target : target_i386_GO32V2;
  657. cpu : i386;
  658. short_name : 'GO32V2';
  659. unit_env : 'GO32V2UNITS';
  660. system_unit : 'SYSTEM';
  661. smartext : '.sl';
  662. unitext : '.ppu';
  663. unitlibext : '.ppl';
  664. asmext : '.s';
  665. objext : '.o';
  666. exeext : '.exe';
  667. os : os_i386_GO32V2;
  668. link : link_i386_ldgo32v2;
  669. assem : as_i386_o;
  670. ar : ar_i386_ar;
  671. heapsize : 2048*1024;
  672. maxheapsize : 32768*1024;
  673. stacksize : 16384
  674. ),
  675. (
  676. target : target_i386_LINUX;
  677. cpu : i386;
  678. short_name : 'LINUX';
  679. unit_env : 'LINUXUNITS';
  680. system_unit : 'syslinux';
  681. smartext : '.sl';
  682. unitext : '.ppu';
  683. unitlibext : '.ppl';
  684. asmext : '.s';
  685. objext : '.o';
  686. exeext : '';
  687. os : os_i386_Linux;
  688. link : link_i386_ld;
  689. assem : as_i386_o;
  690. ar : ar_i386_ar;
  691. heapsize : 2048*1024;
  692. maxheapsize : 32768*1024;
  693. stacksize : 8192
  694. ),
  695. (
  696. target : target_i386_OS2;
  697. cpu : i386;
  698. short_name : 'OS2';
  699. unit_env : 'OS2UNITS';
  700. system_unit : 'SYSOS2';
  701. smartext : '.sl';
  702. unitext : '.ppo';
  703. unitlibext : '.ppl';
  704. asmext : '.so2';
  705. objext : '.oo2';
  706. exeext : ''; { The linker produces a.out }
  707. os : os_i386_OS2;
  708. link : link_i386_ldos2;
  709. assem : as_i386_o_aout;
  710. ar : ar_i386_ar;
  711. heapsize : 256*1024;
  712. maxheapsize : 32768*1024;
  713. stacksize : 32768
  714. ),
  715. (
  716. target : target_i386_WIN32;
  717. cpu : i386;
  718. short_name : 'WIN32';
  719. unit_env : 'WIN32UNITS';
  720. system_unit : 'SYSWIN32';
  721. smartext : '.slw';
  722. unitext : '.ppw';
  723. unitlibext : '.ppl';
  724. asmext : '.sw';
  725. objext : '.ow';
  726. exeext : '.exe';
  727. os : os_i386_Win32;
  728. link : link_i386_ldw;
  729. assem : as_i386_asw;
  730. ar : ar_i386_arw;
  731. heapsize : 2048*1024;
  732. maxheapsize : 32768*1024;
  733. stacksize : 32768
  734. )
  735. {$endif i386}
  736. {$ifdef m68k}
  737. ,(
  738. target : target_m68k_Amiga;
  739. cpu : m68k;
  740. short_name : 'AMIGA';
  741. unit_env : '';
  742. system_unit : 'sysamiga';
  743. smartext : '.sl';
  744. unitext : '.ppa';
  745. unitlibext : '.ppl';
  746. asmext : '.asm';
  747. objext : '.o';
  748. exeext : '';
  749. os : os_m68k_Amiga;
  750. link : link_m68k_ld;
  751. assem : as_m68k_o;
  752. ar : ar_m68k_ar;
  753. heapsize : 128*1024;
  754. maxheapsize : 32768*1024;
  755. stacksize : 8192
  756. ),
  757. (
  758. target : target_m68k_Atari;
  759. cpu : m68k;
  760. short_name : 'ATARI';
  761. unit_env : '';
  762. system_unit : 'SYSATARI';
  763. smartext : '.sl';
  764. unitext : '.ppt';
  765. unitlibext : '.ppl';
  766. asmext : '.s';
  767. objext : '.o';
  768. exeext : '.ttp';
  769. os : os_m68k_Atari;
  770. link : link_m68k_ld;
  771. assem : as_m68k_o;
  772. ar : ar_m68k_ar;
  773. heapsize : 16*1024;
  774. maxheapsize : 32768*1024;
  775. stacksize : 8192
  776. ),
  777. (
  778. target : target_m68k_Mac;
  779. cpu : m68k;
  780. short_name : 'MACOS';
  781. unit_env : '';
  782. system_unit : 'sysmac';
  783. smartext : '.sl';
  784. unitext : '.ppt';
  785. unitlibext : '.ppl';
  786. asmext : '.a';
  787. objext : '.o';
  788. exeext : '';
  789. os : os_m68k_Mac;
  790. link : link_m68k_ld;
  791. assem : as_m68k_mpw;
  792. ar : ar_m68k_ar;
  793. heapsize : 128*1024;
  794. maxheapsize : 32768*1024;
  795. stacksize : 8192
  796. ),
  797. (
  798. target : target_m68k_linux;
  799. cpu : m68k;
  800. short_name : 'LINUX';
  801. unit_env : 'LINUXUNITS';
  802. system_unit : 'syslinux';
  803. smartext : '.sl';
  804. unitext : '.ppu';
  805. unitlibext : '.ppl';
  806. asmext : '.s';
  807. objext : '.o';
  808. exeext : '';
  809. os : os_m68k_Linux;
  810. link : link_m68k_ld;
  811. assem : as_m68k_o;
  812. ar : ar_m68k_ar;
  813. heapsize : 128*1024;
  814. maxheapsize : 32768*1024;
  815. stacksize : 8192
  816. ),
  817. (
  818. target : target_m68k_PalmOS;
  819. cpu : m68k;
  820. short_name : 'PALMOS';
  821. unit_env : 'PALMUNITS';
  822. system_unit : 'syspalm';
  823. smartext : '.sl';
  824. unitext : '.ppu';
  825. unitlibext : '.ppl';
  826. asmext : '.s';
  827. objext : '.o';
  828. exeext : '';
  829. os : os_m68k_PalmOS;
  830. link : link_m68k_ld;
  831. assem : as_m68k_o;
  832. ar : ar_m68k_ar;
  833. heapsize : 128*1024;
  834. maxheapsize : 32768*1024;
  835. stacksize : 8192
  836. )
  837. {$endif m68k}
  838. );
  839. {****************************************************************************
  840. AsmModeInfo
  841. ****************************************************************************}
  842. asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
  843. (
  844. id : asmmode_none;
  845. idtxt : 'none'
  846. )
  847. {$ifdef i386}
  848. ,(
  849. id : asmmode_i386_direct;
  850. idtxt : 'DIRECT'
  851. ),
  852. (
  853. id : asmmode_i386_att;
  854. idtxt : 'ATT'
  855. ),
  856. (
  857. id : asmmode_i386_intel;
  858. idtxt : 'INTEL'
  859. )
  860. {$endif i386}
  861. {$ifdef m68k}
  862. ,(
  863. id : asmmode_m68k_mot;
  864. idtxt : 'MOT'
  865. )
  866. {$endif m68k}
  867. );
  868. {****************************************************************************
  869. Helpers
  870. ****************************************************************************}
  871. function upper(const s : string) : string;
  872. var
  873. i : longint;
  874. begin
  875. for i:=1 to length(s) do
  876. if s[i] in ['a'..'z'] then
  877. upper[i]:=char(byte(s[i])-32)
  878. else
  879. upper[i]:=s[i];
  880. {$ifndef TP}
  881. {$ifopt H+}
  882. SetLength(upper,length(s));
  883. {$else}
  884. upper[0]:=s[0];
  885. {$endif}
  886. {$else}
  887. upper[0]:=s[0];
  888. {$endif}
  889. end;
  890. function set_target_os(t:tos):boolean;
  891. var
  892. i : longint;
  893. begin
  894. set_target_os:=false;
  895. { target 1 is none }
  896. for i:=2 to oscnt do
  897. if os_infos[i].id=t then
  898. begin
  899. target_os:=os_infos[i];
  900. set_target_os:=true;
  901. exit;
  902. end;
  903. end;
  904. function set_target_asm(t:tasm):boolean;
  905. var
  906. i : longint;
  907. begin
  908. set_target_asm:=false;
  909. for i:=1 to asmcnt do
  910. if as_infos[i].id=t then
  911. begin
  912. target_asm:=as_infos[i];
  913. set_target_asm:=true;
  914. exit;
  915. end;
  916. end;
  917. function set_target_link(t:tlink):boolean;
  918. var
  919. i : longint;
  920. begin
  921. set_target_link:=false;
  922. for i:=1 to linkcnt do
  923. if link_infos[i].id=t then
  924. begin
  925. target_link:=link_infos[i];
  926. set_target_link:=true;
  927. exit;
  928. end;
  929. end;
  930. function set_target_ar(t:tar):boolean;
  931. var
  932. i : longint;
  933. begin
  934. set_target_ar:=false;
  935. for i:=1 to arcnt do
  936. if ar_infos[i].id=t then
  937. begin
  938. target_ar:=ar_infos[i];
  939. set_target_ar:=true;
  940. exit;
  941. end;
  942. end;
  943. function set_target_info(t:ttarget):boolean;
  944. var
  945. i : longint;
  946. begin
  947. set_target_info:=false;
  948. for i:=1 to targetcnt do
  949. if target_infos[i].target=t then
  950. begin
  951. target_info:=target_infos[i];
  952. set_target_os(target_info.os);
  953. set_target_asm(target_info.assem);
  954. set_target_link(target_info.link);
  955. set_target_ar(target_info.ar);
  956. target_cpu:=target_info.cpu;
  957. set_target_info:=true;
  958. exit;
  959. end;
  960. end;
  961. {****************************************************************************
  962. Load from string
  963. ****************************************************************************}
  964. function set_string_target(s : string) : boolean;
  965. var
  966. i : longint;
  967. begin
  968. set_string_target:=false;
  969. { this should be case insensitive !! PM }
  970. s:=upper(s);
  971. for i:=1 to targetcnt do
  972. if target_infos[i].short_name=s then
  973. begin
  974. target_info:=target_infos[i];
  975. set_target_os(target_info.os);
  976. set_target_asm(target_info.assem);
  977. set_target_link(target_info.link);
  978. set_target_ar(target_info.ar);
  979. target_cpu:=target_info.cpu;
  980. set_string_target:=true;
  981. exit;
  982. end;
  983. end;
  984. function set_string_asm(s : string) : boolean;
  985. var
  986. i : longint;
  987. begin
  988. set_string_asm:=false;
  989. { this should be case insensitive !! PM }
  990. s:=upper(s);
  991. for i:=1 to asmcnt do
  992. if as_infos[i].idtxt=s then
  993. begin
  994. target_asm:=as_infos[i];
  995. set_string_asm:=true;
  996. end;
  997. end;
  998. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  999. var
  1000. i : longint;
  1001. begin
  1002. set_string_asmmode:=false;
  1003. { this should be case insensitive !! PM }
  1004. s:=upper(s);
  1005. for i:=1 to asmmodecnt do
  1006. if asmmodeinfos[i].idtxt=s then
  1007. begin
  1008. t:=asmmodeinfos[i].id;
  1009. set_string_asmmode:=true;
  1010. end;
  1011. end;
  1012. {****************************************************************************
  1013. Initialization of default target
  1014. ****************************************************************************}
  1015. procedure default_os(t:ttarget);
  1016. begin
  1017. set_target_info(t);
  1018. if source_os.name='' then
  1019. source_os:=target_os;
  1020. end;
  1021. procedure set_source_os(t:tos);
  1022. var
  1023. i : longint;
  1024. begin
  1025. { can't use message() here (PFV) }
  1026. if source_os.name<>'' then
  1027. Writeln('Warning: Source OS Redefined!');
  1028. for i:=1 to oscnt do
  1029. if os_infos[i].id=t then
  1030. begin
  1031. source_os:=os_infos[i];
  1032. exit;
  1033. end;
  1034. end;
  1035. begin
  1036. { first get source OS }
  1037. source_os.name:='';
  1038. { please note then we use cpu86 and cpu68 here on purpose !! }
  1039. {$ifdef cpu86}
  1040. {$ifdef GO32V1}
  1041. set_source_os(os_i386_GO32V1);
  1042. {$else}
  1043. {$ifdef GO32V2}
  1044. set_source_os(os_i386_GO32V2);
  1045. {$else}
  1046. {$ifdef OS2}
  1047. set_source_os(os_i386_OS2);
  1048. {$else}
  1049. {$ifdef LINUX}
  1050. set_source_os(os_i386_LINUX);
  1051. {$else}
  1052. {$ifdef WIN32}
  1053. set_source_os(os_i386_WIN32);
  1054. {$endif win32}
  1055. {$endif linux}
  1056. {$endif os2}
  1057. {$endif go32v2}
  1058. {$endif go32v1}
  1059. {$endif cpu86}
  1060. {$ifdef cpu68}
  1061. {$ifdef AMIGA}
  1062. set_source_os(os_m68k_Amiga);
  1063. {$else}
  1064. {$ifdef ATARI}
  1065. set_source_os(os_m68k_Atari);
  1066. {$else}
  1067. {$ifdef MACOS}
  1068. set_source_os(os_m68k_MAC);
  1069. {$else}
  1070. {$ifdef LINUX}
  1071. set_source_os(os_m68k_linux);
  1072. {$endif linux}
  1073. {$endif macos}
  1074. {$endif atari}
  1075. {$endif amiga}
  1076. {$endif cpu68}
  1077. { Now default target !! }
  1078. {$ifdef i386}
  1079. {$ifdef GO32V1}
  1080. default_os(target_i386_GO32V1);
  1081. {$else}
  1082. {$ifdef GO32V2}
  1083. default_os(target_i386_GO32V2);
  1084. {$else}
  1085. {$ifdef OS2}
  1086. default_os(target_i386_OS2);
  1087. {$else}
  1088. {$ifdef LINUX}
  1089. default_os(target_i386_LINUX);
  1090. {$else}
  1091. {$ifdef WIN32}
  1092. default_os(target_i386_WIN32);
  1093. {$else}
  1094. default_os(target_i386_GO32V2);
  1095. {$endif win32}
  1096. {$endif linux}
  1097. {$endif os2}
  1098. {$endif go32v2}
  1099. {$endif go32v1}
  1100. {$endif i386}
  1101. {$ifdef m68k}
  1102. {$ifdef AMIGA}
  1103. default_os(target_m68k_Amiga);
  1104. {$else}
  1105. {$ifdef ATARI}
  1106. default_os(target_m68k_Atari);
  1107. {$else}
  1108. {$ifdef MACOS}
  1109. default_os(target_m68k_Mac);
  1110. {$else}
  1111. {$ifdef LINUX}
  1112. default_os(target_m68k_linux);
  1113. {$else}
  1114. default_os(target_m68k_Amiga);
  1115. {$endif linux}
  1116. {$endif macos}
  1117. {$endif atari}
  1118. {$endif amiga}
  1119. {$endif m68k}
  1120. end.
  1121. {
  1122. $Log$
  1123. Revision 1.50 1998-11-16 15:41:45 peter
  1124. * tp7 didn't like my ifopt H+ :(
  1125. Revision 1.49 1998/11/16 10:17:09 peter
  1126. * fixed for H+ compilation
  1127. Revision 1.48 1998/10/26 14:19:30 pierre
  1128. + added options -lS and -lT for source and target os output
  1129. (to have a easier way to test OS_SOURCE abd OS_TARGET in makefiles)
  1130. * several problems with rtti data
  1131. (type of sym was not checked)
  1132. assumed to be varsym when they could be procsym or property syms !!
  1133. Revision 1.47 1998/10/20 08:07:04 pierre
  1134. * several memory corruptions due to double freemem solved
  1135. => never use p^.loc.location:=p^.left^.loc.location;
  1136. + finally I added now by default
  1137. that ra386dir translates global and unit symbols
  1138. + added a first field in tsymtable and
  1139. a nextsym field in tsym
  1140. (this allows to obtain ordered type info for
  1141. records and objects in gdb !)
  1142. Revision 1.46 1998/10/16 08:51:54 peter
  1143. + target_os.stackalignment
  1144. + stack can be aligned at 2 or 4 byte boundaries
  1145. Revision 1.45 1998/10/15 16:20:41 peter
  1146. * removed uses verbose which is not possible! this unit may not use
  1147. any other unit !
  1148. Revision 1.44 1998/10/14 11:28:25 florian
  1149. * emitpushreferenceaddress gets now the asmlist as parameter
  1150. * m68k version compiles with -duseansistrings
  1151. Revision 1.43 1998/10/14 08:08:56 pierre
  1152. * following Peters remark, removed all ifdef in
  1153. the systems unit enums
  1154. * last bugs of cg68k removed for sysamiga
  1155. (sysamiga assembles with as68k !!)
  1156. Revision 1.42 1998/10/13 16:50:23 pierre
  1157. * undid some changes of Peter that made the compiler wrong
  1158. for m68k (I had to reinsert some ifdefs)
  1159. * removed several memory leaks under m68k
  1160. * removed the meory leaks for assembler readers
  1161. * cross compiling shoud work again better
  1162. ( crosscompiling sysamiga works
  1163. but as68k still complain about some code !)
  1164. Revision 1.41 1998/10/13 13:10:31 peter
  1165. * new style for m68k/i386 infos and enums
  1166. Revision 1.40 1998/10/13 09:13:09 pierre
  1167. * assembler type output command line was case sensitive
  1168. Revision 1.39 1998/10/13 08:19:42 pierre
  1169. + source_os is now set correctly for cross-processor compilers
  1170. (tos contains all target_infos and
  1171. we use CPU86 and CPU68 conditionnals to
  1172. get the source operating system
  1173. this only works if you do not undefine
  1174. the source target !!)
  1175. * several cg68k memory leaks fixed
  1176. + started to change the code so that it should be possible to have
  1177. a complete compiler (both for m68k and i386 !!)
  1178. Revision 1.38 1998/10/07 04:26:58 carl
  1179. * bugfixes
  1180. + added mpw support
  1181. Revision 1.37 1998/10/06 20:40:58 peter
  1182. * remove -D from assemblers
  1183. Revision 1.36 1998/09/16 16:41:50 peter
  1184. * merged fixes
  1185. Revision 1.33.2.3 1998/09/16 16:13:13 peter
  1186. * win32 .o -> .ow and .a -> .aw
  1187. Revision 1.35 1998/09/11 17:35:33 peter
  1188. * fixed tabs
  1189. Revision 1.34 1998/09/11 12:27:55 pierre
  1190. * restored m68k part
  1191. Revision 1.33.2.2 1998/09/11 17:29:20 peter
  1192. * fixed tabs
  1193. Revision 1.33.2.1 1998/09/11 12:06:00 pierre
  1194. * m68k part restored
  1195. Revision 1.33 1998/09/10 15:25:39 daniel
  1196. + Added maxheapsize.
  1197. * Corrected semi-bug in calling the assembler and the linker
  1198. Revision 1.31 1998/09/01 09:07:13 peter
  1199. * m68k fixes, splitted cg68k like cgi386
  1200. Revision 1.30 1998/08/31 12:26:34 peter
  1201. * m68k and palmos updates from surebugfixes
  1202. Revision 1.29 1998/08/26 10:09:21 peter
  1203. * more lowercase extensions
  1204. Revision 1.28 1998/08/25 12:42:47 pierre
  1205. * CDECL changed to CVAR for variables
  1206. specifications are read in structures also
  1207. + started adding GPC compatibility mode ( option -Sp)
  1208. * names changed to lowercase
  1209. Revision 1.27 1998/08/21 15:16:57 peter
  1210. * win32 compiles a bit better, no growheap crash
  1211. Revision 1.26 1998/08/19 16:07:55 jonas
  1212. * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
  1213. Revision 1.25 1998/08/18 09:24:45 pierre
  1214. * small warning position bug fixed
  1215. * support_mmx switches splitting was missing
  1216. * rhide error and warning output corrected
  1217. Revision 1.24 1998/08/17 09:17:54 peter
  1218. * static/shared linking updates
  1219. Revision 1.23 1998/06/25 08:48:20 florian
  1220. * first version of rtti support
  1221. Revision 1.22 1998/06/17 14:10:21 peter
  1222. * small os2 fixes
  1223. * fixed interdependent units with newppu (remake3 under linux works now)
  1224. Revision 1.20 1998/06/15 15:38:14 pierre
  1225. * small bug in systems.pas corrected
  1226. + operators in different units better hanlded
  1227. Revision 1.19 1998/06/15 13:34:24 daniel
  1228. * Fixed spelling mistakes in comments.
  1229. * Fixed some OS/2 parameters.
  1230. Revision 1.18 1998/06/08 22:59:54 peter
  1231. * smartlinking works for win32
  1232. * some defines to exclude some compiler parts
  1233. Revision 1.17 1998/06/04 23:52:04 peter
  1234. * m68k compiles
  1235. + .def file creation moved to gendef.pas so it could also be used
  1236. for win32
  1237. Revision 1.16 1998/06/01 16:50:22 peter
  1238. + boolean -> ord conversion
  1239. * fixed ord -> boolean conversion
  1240. Revision 1.15 1998/05/30 14:31:11 peter
  1241. + $ASMMODE
  1242. Revision 1.14 1998/05/29 13:24:45 peter
  1243. + asw assembler
  1244. Revision 1.13 1998/05/27 00:20:33 peter
  1245. * some scanner optimizes
  1246. * automaticly aout2exe for go32v1
  1247. * fixed dynamiclinker option which was added at the wrong place
  1248. Revision 1.12 1998/05/23 01:21:32 peter
  1249. + aktasmmode, aktoptprocessor, aktoutputformat
  1250. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1251. + $LIBNAME to set the library name where the unit will be put in
  1252. * splitted cgi386 a bit (codeseg to large for bp7)
  1253. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1254. Revision 1.11 1998/05/22 12:32:49 peter
  1255. * fixed -L on the commandline, Dos commandline is only 128 bytes
  1256. Revision 1.10 1998/05/11 13:07:58 peter
  1257. + $ifdef NEWPPU for the new ppuformat
  1258. + $define GDB not longer required
  1259. * removed all warnings and stripped some log comments
  1260. * no findfirst/findnext anymore to remove smartlink *.o files
  1261. Revision 1.9 1998/05/06 08:38:49 pierre
  1262. * better position info with UseTokenInfo
  1263. UseTokenInfo greatly simplified
  1264. + added check for changed tree after first time firstpass
  1265. (if we could remove all the cases were it happen
  1266. we could skip all firstpass if firstpasscount > 1)
  1267. Only with ExtDebug
  1268. Revision 1.8 1998/05/04 20:19:54 peter
  1269. * small fix for go32v2
  1270. Revision 1.7 1998/05/04 17:54:29 peter
  1271. + smartlinking works (only case jumptable left todo)
  1272. * redesign of systems.pas to support assemblers and linkers
  1273. + Unitname is now also in the PPU-file, increased version to 14
  1274. Revision 1.6 1998/05/01 07:43:57 florian
  1275. + basics for rtti implemented
  1276. + switch $m (generate rtti for published sections)
  1277. Revision 1.5 1998/04/29 10:34:06 pierre
  1278. + added some code for ansistring (not complete nor working yet)
  1279. * corrected operator overloading
  1280. * corrected nasm output
  1281. + started inline procedures
  1282. + added starstarn : use ** for exponentiation (^ gave problems)
  1283. + started UseTokenInfo cond to get accurate positions
  1284. Revision 1.4 1998/04/27 15:45:20 peter
  1285. + -Xl for smartlink
  1286. + target_info.arext = .a
  1287. Revision 1.3 1998/04/16 10:50:45 daniel
  1288. * Fixed some things that were broken for OS/2.
  1289. }