systems.pas 48 KB

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