systems.pas 53 KB

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