systems.pas 53 KB

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