systems.pas 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807
  1. {
  2. $Id$
  3. Copyright (C) 1998-2000 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. {$i defines.inc}
  21. interface
  22. type
  23. tendian = (endian_little,endian_big);
  24. ttargetcpu=(no_cpu
  25. ,i386,m68k,alpha,powerpc
  26. );
  27. tprocessors = (no_processor
  28. ,Class386,ClassP5,ClassP6
  29. ,MC68000,MC68100,MC68020
  30. );
  31. tsection=(sec_none,
  32. sec_code,sec_data,sec_bss,
  33. sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_edata,
  34. sec_stab,sec_stabstr
  35. );
  36. type
  37. tasmmode= (asmmode_none
  38. ,asmmode_i386_direct,asmmode_i386_att,asmmode_i386_intel
  39. ,asmmode_m68k_mot,asmmode_alpha_direct,asmmode_powerpc_direct
  40. );
  41. const
  42. {$ifdef i386} i386asmmodecnt=3; {$else} i386asmmodecnt=0; {$endif}
  43. {$ifdef m68k} m68kasmmodecnt=1; {$else} m68kasmmodecnt=0; {$endif}
  44. {$ifdef alpha} alphaasmmodecnt=1; {$else} alphaasmmodecnt=0; {$endif}
  45. {$ifdef powerpc} powerpcasmmodecnt=1; {$else} powerpcasmmodecnt=0; {$endif}
  46. asmmodecnt=i386asmmodecnt+m68kasmmodecnt+Alphaasmmodecnt+powerpcasmmodecnt+1;
  47. type
  48. ttarget = (target_none,
  49. target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
  50. target_i386_OS2,target_i386_Win32,target_i386_freebsd,
  51. target_i386_Netware,target_i386_sunos,
  52. target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
  53. target_m68k_linux,target_m68k_PalmOS,
  54. target_alpha_linux,
  55. target_powerpc_linux,target_powerpc_macos
  56. );
  57. ttargetflags = (tf_none,
  58. tf_supports_stack_checking,tf_need_export,tf_needs_isconsole
  59. );
  60. const
  61. { alias for supported_target field in tasminfo }
  62. target_any = target_none;
  63. {$ifdef i386} i386targetcnt=8; {$else} i386targetcnt=0; {$endif}
  64. {$ifdef m68k} m68ktargetcnt=5; {$else} m68ktargetcnt=0; {$endif}
  65. {$ifdef alpha} alphatargetcnt=1; {$else} alphatargetcnt=0; {$endif}
  66. {$ifdef powerpc} powerpctargetcnt=2; {$else} powerpctargetcnt=0; {$endif}
  67. targetcnt=i386targetcnt+m68ktargetcnt+alphatargetcnt+powerpctargetcnt+1;
  68. type
  69. tasm = (as_none
  70. ,as_i386_as,as_i386_as_aout,as_i386_asw,
  71. as_i386_nasmcoff,as_i386_nasmwin32,
  72. as_i386_nasmelf,as_i386_nasmobj,
  73. as_i386_tasm,as_i386_masm,
  74. as_i386_dbg,as_i386_coff,as_i386_pecoff,as_i386_elf
  75. ,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw,
  76. as_alpha_as,as_powerpc_as,as_powerpc_mpw
  77. );
  78. { binary assembler writers, needed to test for -a }
  79. const
  80. {$ifdef i386} i386asmcnt=13; {$else} i386asmcnt=0; {$endif}
  81. {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
  82. {$ifdef alpha} alphaasmcnt=1; {$else} alphaasmcnt=0; {$endif}
  83. {$ifdef powerpc} powerpcasmcnt=2; {$else} powerpcasmcnt=0; {$endif}
  84. asmcnt=i386asmcnt+m68kasmcnt+alphaasmcnt+powerpcasmcnt+1;
  85. binassem : set of tasm = [
  86. as_i386_dbg,as_i386_coff,as_i386_pecoff,as_i386_elf
  87. ];
  88. type
  89. tar = (ar_none
  90. ,ar_i386_ar,ar_i386_arw
  91. ,ar_m68k_ar,ar_alpha_ar,ar_powerpc_ar
  92. );
  93. const
  94. {$ifdef i386} i386arcnt=2; {$else} i386arcnt=0; {$endif}
  95. {$ifdef m68k} m68karcnt=1; {$else} m68karcnt=0; {$endif}
  96. {$ifdef alpha} alphaarcnt=1; {$else} alphaarcnt=0; {$endif}
  97. {$ifdef powerpc} powerpcarcnt=1; {$else} powerpcarcnt=0; {$endif}
  98. arcnt=i386arcnt+m68karcnt+alphaarcnt+powerpcarcnt+1;
  99. type
  100. tres = (res_none
  101. ,res_i386_windres,res_m68k_mpw,res_powerpc_mpw, res_i386_emx
  102. );
  103. const
  104. {$ifdef i386} i386rescnt=2; {$else} i386rescnt=0; {$endif}
  105. {$ifdef m68k} m68krescnt=1; {$else} m68krescnt=0; {$endif}
  106. {$ifdef alpha} alpharescnt=0; {$else} alpharescnt=0; {$endif}
  107. {$ifdef powerpc} powerpcrescnt=1; {$else} powerpcrescnt=0; {$endif}
  108. rescnt=i386rescnt+m68krescnt+alpharescnt+powerpcrescnt+1;
  109. type
  110. tos = ( os_none,
  111. os_i386_GO32V1,os_i386_GO32V2,os_i386_Linux,os_i386_OS2,
  112. os_i386_Win32,os_i386_freeBSD,os_i386_Netware,os_i386_sunos,
  113. os_m68k_Amiga,os_m68k_Atari,os_m68k_Mac,os_m68k_Linux,
  114. os_m68k_PalmOS,os_alpha_linux,os_powerpc_linux,os_powerpc_macos
  115. );
  116. const
  117. i386oscnt=8;
  118. m68koscnt=5;
  119. alphaoscnt=1;
  120. powerpcoscnt=2;
  121. oscnt=i386oscnt+m68koscnt+alphaoscnt+powerpcoscnt+1;
  122. type
  123. tosinfo = packed record
  124. id : tos;
  125. name : string[30];
  126. shortname : string[9];
  127. sharedlibext : string[10];
  128. staticlibext,
  129. sourceext,
  130. pasext,
  131. exeext,
  132. defext,
  133. scriptext : string[4];
  134. libprefix : string[4];
  135. Cprefix : string[2];
  136. newline : string[2];
  137. endian : tendian;
  138. {longint this is a little overkill no ?? but 256 is possible one day }
  139. stackalignment : word;
  140. maxCrecordalignment : word;
  141. size_of_pointer : byte;
  142. size_of_longint : byte;
  143. use_bound_instruction : boolean;
  144. use_function_relative_addresses : boolean;
  145. end;
  146. tasminfo = packed record
  147. id : tasm;
  148. idtxt : string[9];
  149. asmbin : string[8];
  150. asmcmd : string[50];
  151. supported_target : ttarget;
  152. allowdirect,
  153. externals,
  154. needar,
  155. labelprefix_only_inside_procedure : boolean;
  156. labelprefix : string[3];
  157. comment : string[2];
  158. secnames : array[tsection] of string[20];
  159. end;
  160. tarinfo = packed record
  161. id : tar;
  162. arcmd : string[50];
  163. end;
  164. tresinfo = packed record
  165. id : tres;
  166. resbin : string[8];
  167. rescmd : string[50];
  168. end;
  169. ttargetinfo = packed record
  170. target : ttarget;
  171. flags : set of ttargetflags;
  172. cpu : ttargetcpu;
  173. short_name : string[8];
  174. unit_env : string[12];
  175. smartext,
  176. unitext,
  177. unitlibext,
  178. asmext,
  179. objext,
  180. resext,
  181. resobjext,
  182. exeext : string[4];
  183. os : tos;
  184. assem : tasm;
  185. assemsrc : tasm; { default source writing assembler }
  186. ar : tar;
  187. res : tres;
  188. heapsize,
  189. maxheapsize,
  190. stacksize : longint;
  191. end;
  192. tasmmodeinfo=packed record
  193. id : tasmmode;
  194. idtxt : string[8];
  195. end;
  196. var
  197. target_cpu : ttargetcpu;
  198. target_info : ttargetinfo;
  199. target_os : tosinfo;
  200. target_asm : tasminfo;
  201. target_ar : tarinfo;
  202. target_res : tresinfo;
  203. target_path : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
  204. source_os : tosinfo;
  205. function set_target_os(t:tos):boolean;
  206. function set_target_asm(t:tasm):boolean;
  207. function set_target_ar(t:tar):boolean;
  208. function set_target_res(t:tres):boolean;
  209. function set_target_info(t:ttarget):boolean;
  210. function set_string_target(s : string) : boolean;
  211. function set_string_asm(s : string) : boolean;
  212. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  213. procedure InitSystems;
  214. implementation
  215. uses
  216. cutils;
  217. const
  218. {****************************************************************************
  219. OS Info
  220. ****************************************************************************}
  221. os_infos : array[1..oscnt] of tosinfo = (
  222. (
  223. id : os_none;
  224. name : 'No operating system';
  225. shortname : 'none'
  226. ),
  227. (
  228. id : os_i386_go32v1;
  229. name : 'GO32 V1 DOS extender';
  230. shortname : 'go32v1';
  231. sharedlibext : '.dll';
  232. staticlibext : '.a';
  233. sourceext : '.pp';
  234. pasext : '.pas';
  235. exeext : ''; { No .exe, the linker only output a.out ! }
  236. defext : '.def';
  237. scriptext : '.bat';
  238. libprefix : '';
  239. Cprefix : '_';
  240. newline : #13#10;
  241. endian : endian_little;
  242. stackalignment : 2;
  243. maxCrecordalignment : 4;
  244. size_of_pointer : 4;
  245. size_of_longint : 4;
  246. use_bound_instruction : false;
  247. use_function_relative_addresses : true
  248. ),
  249. (
  250. id : os_i386_go32v2;
  251. name : 'GO32 V2 DOS extender';
  252. shortname : 'go32v2';
  253. sharedlibext : '.dll';
  254. staticlibext : '.a';
  255. sourceext : '.pp';
  256. pasext : '.pas';
  257. exeext : '.exe';
  258. defext : '.def';
  259. scriptext : '.bat';
  260. libprefix : '';
  261. Cprefix : '_';
  262. newline : #13#10;
  263. endian : endian_little;
  264. stackalignment : 2;
  265. maxCrecordalignment : 4;
  266. size_of_pointer : 4;
  267. size_of_longint : 4;
  268. use_bound_instruction : false;
  269. use_function_relative_addresses : true
  270. ),
  271. (
  272. id : os_i386_linux;
  273. name : 'Linux for i386';
  274. shortname : 'linux';
  275. sharedlibext : '.so';
  276. staticlibext : '.a';
  277. sourceext : '.pp';
  278. pasext : '.pas';
  279. exeext : '';
  280. defext : '.def';
  281. scriptext : '.sh';
  282. libprefix : 'libp';
  283. Cprefix : '';
  284. newline : #10;
  285. endian : endian_little;
  286. stackalignment : 4;
  287. maxCrecordalignment : 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_FreeBSD;
  295. name : 'FreeBSD/ELF for i386';
  296. shortname : 'freebsd';
  297. sharedlibext : '.so';
  298. staticlibext : '.a';
  299. sourceext : '.pp';
  300. pasext : '.pas';
  301. exeext : '';
  302. defext : '.def';
  303. scriptext : '.sh';
  304. libprefix : 'libp';
  305. Cprefix : '';
  306. newline : #10;
  307. endian : endian_little;
  308. stackalignment : 4;
  309. maxCrecordalignment : 4;
  310. size_of_pointer : 4;
  311. size_of_longint : 4;
  312. use_bound_instruction : false;
  313. use_function_relative_addresses : true
  314. ),
  315. (
  316. id : os_i386_os2;
  317. name : 'OS/2 via EMX';
  318. shortname : 'os2';
  319. sharedlibext : '.ao2';
  320. staticlibext : '.ao2';
  321. sourceext : '.pas';
  322. pasext : '.pp';
  323. exeext : '.exe';
  324. defext : '.def';
  325. scriptext : '.cmd';
  326. libprefix : '';
  327. Cprefix : '_';
  328. newline : #13#10;
  329. endian : endian_little;
  330. stackalignment : 4;
  331. maxCrecordalignment : 4;
  332. size_of_pointer : 4;
  333. size_of_longint : 4;
  334. use_bound_instruction : false;
  335. use_function_relative_addresses : false
  336. ),
  337. (
  338. id : os_i386_win32;
  339. name : 'Win32 for i386';
  340. shortname : 'win32';
  341. sharedlibext : '.dll';
  342. staticlibext : '.aw';
  343. sourceext : '.pp';
  344. pasext : '.pas';
  345. exeext : '.exe';
  346. defext : '.def';
  347. scriptext : '.bat';
  348. libprefix : 'libp';
  349. Cprefix : '_';
  350. newline : #13#10;
  351. endian : endian_little;
  352. stackalignment : 4;
  353. maxCrecordalignment : 16;
  354. size_of_pointer : 4;
  355. size_of_longint : 4;
  356. use_bound_instruction : false;
  357. use_function_relative_addresses : true
  358. ),
  359. (
  360. id : os_i386_Netware;
  361. name : 'Netware for i386';
  362. shortname : 'netware';
  363. sharedlibext : '.nlm';
  364. staticlibext : '.a';
  365. sourceext : '.pp';
  366. pasext : '.pas';
  367. exeext : '.nlm';
  368. defext : '.def';
  369. scriptext : '.sh';
  370. libprefix : '';
  371. Cprefix : '';
  372. newline : #13#10;
  373. endian : endian_little;
  374. stackalignment : 4;
  375. maxCrecordalignment : 4;
  376. size_of_pointer : 4;
  377. size_of_longint : 4;
  378. use_bound_instruction : false;
  379. use_function_relative_addresses : true
  380. ),
  381. (
  382. id : os_i386_sunos;
  383. name : 'sunOS/ELF for i386';
  384. shortname : 'sunos';
  385. sharedlibext : '.so';
  386. staticlibext : '.a';
  387. sourceext : '.pp';
  388. pasext : '.pas';
  389. exeext : '';
  390. defext : '.def';
  391. scriptext : '.sh';
  392. libprefix : 'lib';
  393. Cprefix : '';
  394. newline : #10;
  395. endian : endian_little;
  396. stackalignment : 4;
  397. maxCrecordalignment : 4;
  398. size_of_pointer : 4;
  399. size_of_longint : 4;
  400. use_bound_instruction : false;
  401. use_function_relative_addresses : true
  402. ),
  403. (
  404. id : os_m68k_amiga;
  405. name : 'Commodore Amiga';
  406. shortname : 'amiga';
  407. sharedlibext : '.library';
  408. staticlibext : '.a';
  409. sourceext : '.pp';
  410. pasext : '.pas';
  411. exeext : '';
  412. defext : '';
  413. scriptext : '';
  414. libprefix : '';
  415. Cprefix : '_';
  416. newline : #10;
  417. endian : endian_big;
  418. stackalignment : 2;
  419. maxCrecordalignment : 4;
  420. size_of_pointer : 4;
  421. size_of_longint : 4;
  422. use_bound_instruction : false;
  423. use_function_relative_addresses : false
  424. ),
  425. (
  426. id : os_m68k_atari;
  427. name : 'Atari ST/STE';
  428. shortname : 'atari';
  429. sharedlibext : '.dll';
  430. staticlibext : '.a';
  431. sourceext : '.pp';
  432. pasext : '.pas';
  433. exeext : '.tpp';
  434. defext : '';
  435. scriptext : '';
  436. libprefix : '';
  437. Cprefix : '_';
  438. newline : #10;
  439. endian : endian_big;
  440. stackalignment : 2;
  441. maxCrecordalignment : 4;
  442. size_of_pointer : 4;
  443. size_of_longint : 4;
  444. use_bound_instruction : false;
  445. use_function_relative_addresses : false
  446. ),
  447. (
  448. id : os_m68k_mac;
  449. name : 'Macintosh m68k';
  450. shortname : 'mac';
  451. sharedlibext : 'Lib';
  452. staticlibext : 'Lib';
  453. sourceext : '.pp';
  454. pasext : '.pas';
  455. exeext : '';
  456. defext : '';
  457. scriptext : '';
  458. libprefix : '';
  459. Cprefix : '_';
  460. newline : #13;
  461. endian : endian_big;
  462. stackalignment : 2;
  463. maxCrecordalignment : 4;
  464. size_of_pointer : 4;
  465. size_of_longint : 4;
  466. use_bound_instruction : false;
  467. use_function_relative_addresses : false
  468. ),
  469. (
  470. id : os_m68k_linux;
  471. name : 'Linux for m68k';
  472. shortname : 'linux';
  473. sharedlibext : '.so';
  474. staticlibext : '.a';
  475. sourceext : '.pp';
  476. pasext : '.pas';
  477. exeext : '';
  478. defext : '';
  479. scriptext : '.sh';
  480. libprefix : 'libp';
  481. Cprefix : '';
  482. newline : #10;
  483. endian : endian_big;
  484. stackalignment : 2;
  485. maxCrecordalignment : 32;
  486. size_of_pointer : 4;
  487. size_of_longint : 4;
  488. use_bound_instruction : false;
  489. use_function_relative_addresses : true
  490. ),
  491. (
  492. id : os_m68k_palmos;
  493. name : 'PalmOS';
  494. shortname : 'palmos';
  495. sharedlibext : '.so';
  496. staticlibext : '.a';
  497. sourceext : '.pp';
  498. pasext : '.pas';
  499. exeext : '';
  500. defext : '';
  501. scriptext : '.sh';
  502. libprefix : 'libp';
  503. Cprefix : '_';
  504. newline : #10;
  505. endian : endian_big;
  506. stackalignment : 2;
  507. maxCrecordalignment : 32;
  508. size_of_pointer : 4;
  509. size_of_longint : 4;
  510. use_bound_instruction : false;
  511. use_function_relative_addresses : false
  512. ),
  513. (
  514. id : os_alpha_linux;
  515. name : 'Linux for Alpha';
  516. shortname : 'axplinux';
  517. sharedlibext : '.so';
  518. staticlibext : '.a';
  519. sourceext : '.pp';
  520. pasext : '.pas';
  521. exeext : '';
  522. defext : '.def';
  523. scriptext : '.sh';
  524. libprefix : 'libp';
  525. Cprefix : '';
  526. newline : #10;
  527. endian : endian_little;
  528. stackalignment : 8;
  529. maxCrecordalignment : 32;
  530. size_of_pointer : 8;
  531. size_of_longint : 4;
  532. use_bound_instruction : false;
  533. use_function_relative_addresses : true
  534. ),
  535. (
  536. id : os_powerpc_linux;
  537. name : 'Linux for PowerPC';
  538. shortname : 'linuxppc';
  539. sharedlibext : '.so';
  540. staticlibext : '.s';
  541. sourceext : '.pp';
  542. pasext : '.pas';
  543. exeext : '';
  544. defext : '.def';
  545. scriptext : '.sh';
  546. libprefix : 'libp';
  547. Cprefix : '';
  548. newline : #10;
  549. endian : endian_big;
  550. stackalignment : 8;
  551. maxCrecordalignment : 32;
  552. size_of_pointer : 4;
  553. size_of_longint : 4;
  554. use_bound_instruction : false;
  555. use_function_relative_addresses : true
  556. ),
  557. (
  558. id : os_powerpc_macos;
  559. name : 'MacOs (PowerPC)';
  560. shortname : 'MacOs/PPC';
  561. sharedlibext : 'Lib';
  562. staticlibext : 'Lib';
  563. sourceext : '.pp';
  564. pasext : '.pas';
  565. exeext : '';
  566. defext : '';
  567. scriptext : '';
  568. libprefix : '';
  569. Cprefix : '';
  570. newline : #13;
  571. endian : endian_big;
  572. stackalignment : 8;
  573. maxCrecordalignment : 32;
  574. size_of_pointer : 4;
  575. size_of_longint : 4;
  576. use_bound_instruction : false;
  577. use_function_relative_addresses : true
  578. )
  579. );
  580. {****************************************************************************
  581. Assembler Info
  582. ****************************************************************************}
  583. as_infos : array[1..asmcnt] of tasminfo = (
  584. (
  585. id : as_none;
  586. idtxt : 'no'
  587. )
  588. {$ifdef i386}
  589. ,(
  590. id : as_i386_as;
  591. idtxt : 'AS';
  592. asmbin : 'as';
  593. asmcmd : '-o $OBJ $ASM';
  594. supported_target : target_any;
  595. allowdirect : true;
  596. externals : false;
  597. needar : true;
  598. labelprefix : '.L';
  599. comment : '# ';
  600. secnames : ('',
  601. '.text','.data','.bss',
  602. '','','','','','',
  603. '.stab','.stabstr')
  604. )
  605. ,(
  606. id : as_i386_as_aout;
  607. idtxt : 'AS_AOUT';
  608. asmbin : 'as';
  609. asmcmd : '-o $OBJ $ASM';
  610. supported_target : target_i386_os2;
  611. allowdirect : true;
  612. externals : false;
  613. needar : true;
  614. labelprefix : 'L';
  615. comment : '# ';
  616. secnames : ('',
  617. '.text','.data','.bss',
  618. '','','','','','',
  619. '.stab','.stabstr')
  620. )
  621. ,(
  622. id : as_i386_asw;
  623. idtxt : 'ASW';
  624. asmbin : 'asw';
  625. asmcmd : '-o $OBJ $ASM';
  626. supported_target : target_i386_win32;
  627. allowdirect : true;
  628. externals : false;
  629. needar : true;
  630. labelprefix : '.L';
  631. comment : '# ';
  632. secnames : ('',
  633. '.text','.data','.section .bss',
  634. '.section .idata$2','.section .idata$4','.section .idata$5',
  635. '.section .idata$6','.section .idata$7','.section .edata',
  636. '.stab','.stabstr')
  637. )
  638. ,(
  639. id : as_i386_nasmcoff;
  640. idtxt : 'NASMCOFF';
  641. asmbin : 'nasm';
  642. asmcmd : '-f coff -o $OBJ $ASM';
  643. supported_target : target_i386_go32v2;
  644. allowdirect : true;
  645. externals : true;
  646. needar : true;
  647. labelprefix : '..@';
  648. comment : '; ';
  649. secnames : ('',
  650. '.text','.data','.bss',
  651. '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
  652. '.stab','.stabstr')
  653. )
  654. ,(
  655. id : as_i386_nasmwin32;
  656. idtxt : 'NASMWIN32';
  657. asmbin : 'nasm';
  658. asmcmd : '-f win32 -o $OBJ $ASM';
  659. supported_target : target_i386_win32;
  660. allowdirect : true;
  661. externals : true;
  662. needar : true;
  663. labelprefix : '..@';
  664. comment : '; ';
  665. secnames : ('',
  666. '.text','.data','.bss',
  667. '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
  668. '.stab','.stabstr')
  669. )
  670. ,(
  671. id : as_i386_nasmelf;
  672. idtxt : 'NASMELF';
  673. asmbin : 'nasm';
  674. asmcmd : '-f elf -o $OBJ $ASM';
  675. supported_target : target_i386_linux;
  676. allowdirect : true;
  677. externals : true;
  678. needar : true;
  679. labelprefix : '..@';
  680. comment : '; ';
  681. secnames : ('',
  682. '.text','.data','.bss',
  683. '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
  684. '.stab','.stabstr')
  685. )
  686. ,(
  687. id : as_i386_nasmobj;
  688. idtxt : 'NASMOBJ';
  689. asmbin : 'nasm';
  690. asmcmd : '-f obj -o $OBJ $ASM';
  691. supported_target : target_any; { what should I write here ?? }
  692. allowdirect : true;
  693. externals : true;
  694. needar : true;
  695. labelprefix : '..@';
  696. comment : '; ';
  697. secnames : ('',
  698. '.text','.data','.bss',
  699. '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
  700. '.stab','.stabstr')
  701. )
  702. ,(
  703. id : as_i386_tasm;
  704. idtxt : 'TASM';
  705. asmbin : 'tasm';
  706. asmcmd : '/m2 /ml $ASM $OBJ';
  707. supported_target : target_any; { what should I write here ?? }
  708. allowdirect : true;
  709. externals : true;
  710. needar : true;
  711. labelprefix_only_inside_procedure : true;
  712. labelprefix : '@@';
  713. comment : '; ';
  714. secnames : ('',
  715. 'CODE','DATA','BSS',
  716. '','','','','','',
  717. '','')
  718. )
  719. ,(
  720. id : as_i386_masm;
  721. idtxt : 'MASM';
  722. asmbin : 'masm';
  723. asmcmd : '/c $ASM /Fo$OBJ';
  724. supported_target : target_any; { what should I write here ?? }
  725. allowdirect : true;
  726. externals : true;
  727. needar : true;
  728. labelprefix : '@@';
  729. comment : '; ';
  730. secnames : ('',
  731. 'CODE','DATA','BSS',
  732. '','','','','','',
  733. '','')
  734. )
  735. ,(
  736. id : as_i386_dbg;
  737. idtxt : 'DBG';
  738. asmbin : '';
  739. asmcmd : '';
  740. supported_target : target_any;
  741. allowdirect : false;
  742. externals : true;
  743. needar : false;
  744. labelprefix : 'L';
  745. comment : '';
  746. secnames : ('',
  747. '.text','.data','.bss',
  748. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  749. '.stab','.stabstr')
  750. )
  751. ,(
  752. id : as_i386_coff;
  753. idtxt : 'COFF';
  754. asmbin : '';
  755. asmcmd : '';
  756. supported_target : target_i386_go32v2;
  757. allowdirect : false;
  758. externals : true;
  759. needar : false;
  760. labelprefix : '.L';
  761. comment : '';
  762. secnames : ('',
  763. '.text','.data','.bss',
  764. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  765. '.stab','.stabstr')
  766. )
  767. ,(
  768. id : as_i386_pecoff;
  769. idtxt : 'PECOFF';
  770. asmbin : '';
  771. asmcmd : '';
  772. supported_target : target_i386_win32;
  773. allowdirect : false;
  774. externals : true;
  775. needar : false;
  776. labelprefix : '.L';
  777. comment : '';
  778. secnames : ('',
  779. '.text','.data','.bss',
  780. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  781. '.stab','.stabstr')
  782. )
  783. ,(
  784. id : as_i386_elf;
  785. idtxt : 'ELF';
  786. asmbin : '';
  787. asmcmd : '';
  788. supported_target : target_any; //target_i386_linux;
  789. allowdirect : false;
  790. externals : true;
  791. needar : false;
  792. labelprefix : '.L';
  793. comment : '';
  794. secnames : ('',
  795. '.text','.data','.bss',
  796. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  797. '.stab','.stabstr')
  798. )
  799. {$endif i386}
  800. {$ifdef m68k}
  801. ,(
  802. id : as_m68k_as;
  803. idtxt : 'AS';
  804. asmbin : 'as';
  805. asmcmd : '-o $OBJ $ASM';
  806. supported_target : target_any;
  807. allowdirect : true;
  808. externals : false;
  809. needar : true;
  810. labelprefix : '.L';
  811. comment : '# ';
  812. secnames : ('',
  813. '.text','.data','.bss',
  814. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  815. '.stab','.stabstr')
  816. )
  817. ,(
  818. id : as_m68k_gas;
  819. idtxt : 'GAS';
  820. asmbin : 'as68k'; { Gas for the Amiga}
  821. asmcmd : '--register-prefix-optional -o $OBJ $ASM';
  822. supported_target : target_any;
  823. allowdirect : true;
  824. externals : false;
  825. needar : true;
  826. labelprefix : '.L';
  827. comment : '| ';
  828. secnames : ('',
  829. '.text','.data','.bss',
  830. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  831. '.stab','.stabstr')
  832. )
  833. ,(
  834. id : as_m68k_mit;
  835. idtxt : 'MIT';
  836. asmbin : '';
  837. asmcmd : '-o $OBJ $ASM';
  838. supported_target : target_any;
  839. allowdirect : true;
  840. externals : false;
  841. needar : true;
  842. labelprefix : '.L';
  843. comment : '| ';
  844. secnames : ('',
  845. '.text','.data','.bss',
  846. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  847. '.stab','.stabstr')
  848. )
  849. ,(
  850. id : as_m68k_mot;
  851. idtxt : 'MOT';
  852. asmbin : '';
  853. asmcmd : '-o $OBJ $ASM';
  854. supported_target : target_any;
  855. allowdirect : true;
  856. externals : false;
  857. needar : true;
  858. labelprefix : '__L';
  859. comment : '| ';
  860. secnames : ('',
  861. '.text','.data','.bss',
  862. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  863. '.stab','.stabstr')
  864. )
  865. ,(
  866. id : as_m68k_mpw;
  867. idtxt : 'MPW';
  868. asmbin : '';
  869. asmcmd : '-model far -o $OBJ $ASM';
  870. supported_target : target_any;
  871. allowdirect : true;
  872. externals : false;
  873. needar : true;
  874. labelprefix : '__L';
  875. comment : '* ';
  876. secnames : ('',
  877. '.text','.data','.bss',
  878. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  879. '.stab','.stabstr')
  880. )
  881. {$endif m68k}
  882. {$ifdef alpha}
  883. ,(
  884. id : as_alpha_as;
  885. idtxt : 'AS';
  886. asmbin : 'as';
  887. asmcmd : '-o $OBJ $ASM';
  888. supported_target : target_any;
  889. allowdirect : true;
  890. externals : false;
  891. needar : true;
  892. labelprefix : '.L';
  893. comment : '# ';
  894. secnames : ('',
  895. '.text','.data','.bss',
  896. '','','','','','',
  897. '.stab','.stabstr')
  898. )
  899. {$endif}
  900. {$ifdef powerpc}
  901. ,(
  902. id : as_powerpc_as;
  903. idtxt : 'AS';
  904. asmbin : 'as';
  905. asmcmd : '-o $OBJ $ASM';
  906. supported_target : target_any;
  907. allowdirect : true;
  908. externals : false;
  909. needar : true;
  910. labelprefix : '.L';
  911. comment : '# ';
  912. secnames : ('',
  913. '.text','.data','.bss',
  914. '','','','','','',
  915. '.stab','.stabstr')
  916. )
  917. ,(
  918. id : as_powerpc_mpw;
  919. idtxt : 'PPCAsm';
  920. asmbin : 'PPCAsm';
  921. asmcmd : '-o $OBJ $ASM';
  922. supported_target : target_any;
  923. allowdirect : true;
  924. externals : false;
  925. needar : true;
  926. labelprefix : '.L';
  927. comment : '; ';
  928. secnames : ('',
  929. '.text','.data','.bss',
  930. '','','','','','',
  931. '.stab','.stabstr')
  932. )
  933. {$endif}
  934. );
  935. {****************************************************************************
  936. Ar Info
  937. ****************************************************************************}
  938. ar_infos : array[1..arcnt] of tarinfo = (
  939. (
  940. id : ar_none
  941. )
  942. {$ifdef i386}
  943. ,(
  944. id : ar_i386_ar;
  945. arcmd : 'ar rs $LIB $FILES'
  946. ),
  947. (
  948. id : ar_i386_arw;
  949. arcmd : 'arw rs $LIB $FILES'
  950. )
  951. {$endif i386}
  952. {$ifdef m68k}
  953. ,(
  954. id : ar_m68k_ar;
  955. arcmd : 'ar rs $LIB $FILES'
  956. )
  957. {$endif m68k}
  958. {$ifdef alpha}
  959. ,(
  960. id : ar_alpha_ar;
  961. arcmd : 'ar rs $LIB $FILES'
  962. )
  963. {$endif}
  964. {$ifdef powerpc}
  965. ,(
  966. id : ar_powerpc_ar;
  967. arcmd : 'ar rs $LIB $FILES'
  968. )
  969. {$endif}
  970. );
  971. {****************************************************************************
  972. Res Info
  973. ****************************************************************************}
  974. res_infos : array[1..rescnt] of tresinfo = (
  975. (
  976. id : res_none
  977. )
  978. {$ifdef i386}
  979. ,(
  980. id : res_i386_windres;
  981. resbin : 'windres';
  982. rescmd : '--include $INC -O coff -o $OBJ $RES'
  983. )
  984. ,(
  985. id : res_i386_emx;
  986. resbin : 'emxbind';
  987. rescmd : '-b -r $RES $OBJ'
  988. (* Not really used - see TLinkeros2.SetDefaultInfo in t_os2.pas. *)
  989. )
  990. {$endif i386}
  991. {$ifdef m68k}
  992. ,(
  993. id : res_m68k_mpw;
  994. resbin : 'rez';
  995. rescmd : '-i $INC -o $OBJ $RES'
  996. )
  997. {$endif m68}
  998. {$ifdef powerpc}
  999. ,(
  1000. id : res_powerpc_mpw;
  1001. resbin : 'rez';
  1002. rescmd : '-i $INC -o $OBJ $RES'
  1003. )
  1004. {$endif powerpc}
  1005. );
  1006. {****************************************************************************
  1007. Targets Info
  1008. ****************************************************************************}
  1009. target_infos : array[1..targetcnt] of ttargetinfo = (
  1010. (
  1011. target : target_none;
  1012. flags : [];
  1013. cpu : no_cpu;
  1014. short_name : 'notarget'
  1015. )
  1016. {$ifdef i386}
  1017. ,(
  1018. target : target_i386_GO32V1;
  1019. flags : [];
  1020. cpu : i386;
  1021. short_name : 'GO32V1';
  1022. unit_env : 'GO32V1UNITS';
  1023. smartext : '.sl';
  1024. unitext : '.pp1';
  1025. unitlibext : '.ppl';
  1026. asmext : '.s1';
  1027. objext : '.o1';
  1028. resext : '.res';
  1029. resobjext : '.o1r';
  1030. exeext : ''; { The linker produces a.out }
  1031. os : os_i386_GO32V1;
  1032. assem : as_i386_as;
  1033. assemsrc : as_i386_as;
  1034. ar : ar_i386_ar;
  1035. res : res_none;
  1036. heapsize : 2048*1024;
  1037. maxheapsize : 32768*1024;
  1038. stacksize : 16384
  1039. ),
  1040. (
  1041. target : target_i386_GO32V2;
  1042. flags : [];
  1043. cpu : i386;
  1044. short_name : 'GO32V2';
  1045. unit_env : 'GO32V2UNITS';
  1046. smartext : '.sl';
  1047. unitext : '.ppu';
  1048. unitlibext : '.ppl';
  1049. asmext : '.s';
  1050. objext : '.o';
  1051. resext : '.res';
  1052. resobjext : '.or';
  1053. exeext : '.exe';
  1054. os : os_i386_GO32V2;
  1055. assem : as_i386_coff;
  1056. assemsrc : as_i386_as;
  1057. ar : ar_i386_ar;
  1058. res : res_none;
  1059. heapsize : 2048*1024;
  1060. maxheapsize : 32768*1024;
  1061. stacksize : 16384
  1062. ),
  1063. (
  1064. target : target_i386_LINUX;
  1065. flags : [];
  1066. cpu : i386;
  1067. short_name : 'LINUX';
  1068. unit_env : 'LINUXUNITS';
  1069. smartext : '.sl';
  1070. unitext : '.ppu';
  1071. unitlibext : '.ppl';
  1072. asmext : '.s';
  1073. objext : '.o';
  1074. resext : '.res';
  1075. resobjext : '.or';
  1076. exeext : '';
  1077. os : os_i386_Linux;
  1078. assem : as_i386_elf;
  1079. assemsrc : as_i386_as;
  1080. ar : ar_i386_ar;
  1081. res : res_none;
  1082. heapsize : 256*1024;
  1083. maxheapsize : 32768*1024;
  1084. stacksize : 8192
  1085. ),
  1086. (
  1087. target : target_i386_FreeBSD;
  1088. flags : [];
  1089. cpu : i386;
  1090. short_name : 'FREEBSD';
  1091. unit_env : 'BSDUNITS';
  1092. smartext : '.sl';
  1093. unitext : '.ppu';
  1094. unitlibext : '.ppl';
  1095. asmext : '.s';
  1096. objext : '.o';
  1097. resext : '.res';
  1098. resobjext : '.or';
  1099. exeext : '';
  1100. os : os_i386_Freebsd;
  1101. assem : as_i386_elf;
  1102. assemsrc : as_i386_as;
  1103. ar : ar_i386_ar;
  1104. res : res_none;
  1105. heapsize : 256*1024;
  1106. maxheapsize : 32768*1024;
  1107. stacksize : 8192
  1108. ),
  1109. (
  1110. target : target_i386_OS2;
  1111. flags : [tf_need_export];
  1112. cpu : i386;
  1113. short_name : 'OS2';
  1114. unit_env : 'OS2UNITS';
  1115. smartext : '.sl';
  1116. unitext : '.ppo';
  1117. unitlibext : '.ppl';
  1118. asmext : '.so2';
  1119. objext : '.oo2';
  1120. resext : '.res';
  1121. resobjext : '.oor';
  1122. exeext : ''; { The linker produces a.out }
  1123. os : os_i386_OS2;
  1124. assem : as_i386_as_aout;
  1125. assemsrc : as_i386_as_aout;
  1126. ar : ar_i386_ar;
  1127. res : res_i386_emx;
  1128. heapsize : 256*1024;
  1129. maxheapsize : 32768*1024;
  1130. stacksize : 256*1024
  1131. ),
  1132. (
  1133. target : target_i386_WIN32;
  1134. flags : [];
  1135. cpu : i386;
  1136. short_name : 'WIN32';
  1137. unit_env : 'WIN32UNITS';
  1138. smartext : '.slw';
  1139. unitext : '.ppw';
  1140. unitlibext : '.ppl';
  1141. asmext : '.sw';
  1142. objext : '.ow';
  1143. resext : '.rc';
  1144. resobjext : '.owr';
  1145. exeext : '.exe';
  1146. os : os_i386_Win32;
  1147. assem : as_i386_pecoff;
  1148. assemsrc : as_i386_asw;
  1149. ar : ar_i386_arw;
  1150. res : res_i386_windres;
  1151. heapsize : 256*1024;
  1152. maxheapsize : 32*1024*1024;
  1153. stacksize : 32*1024*1024
  1154. ),
  1155. (
  1156. target : target_i386_NETWARE;
  1157. flags : [];
  1158. cpu : i386;
  1159. short_name : 'NETWARE';
  1160. unit_env : 'NETWAREUNITS';
  1161. smartext : '.sl';
  1162. unitext : '.ppn';
  1163. unitlibext : '.ppl';
  1164. asmext : '.s';
  1165. objext : '.on';
  1166. resext : '.res';
  1167. resobjext : '.or';
  1168. exeext : '';
  1169. os : os_i386_Netware;
  1170. assem : as_i386_elf;
  1171. assemsrc : as_i386_as;
  1172. ar : ar_i386_ar;
  1173. res : res_none;
  1174. heapsize : 256*1024;
  1175. maxheapsize : 32768*1024;
  1176. stacksize : 8192
  1177. ),
  1178. (
  1179. target : target_i386_sunos;
  1180. flags : [];
  1181. cpu : i386;
  1182. short_name : 'SUNOS';
  1183. unit_env : 'SUNOSUNITS';
  1184. smartext : '.sl';
  1185. unitext : '.ppu';
  1186. unitlibext : '.ppl';
  1187. asmext : '.s';
  1188. objext : '.o';
  1189. resext : '.res';
  1190. resobjext : '.or';
  1191. exeext : '';
  1192. os : os_i386_sunos;
  1193. assem : as_i386_as;
  1194. assemsrc : as_i386_as;
  1195. ar : ar_i386_ar;
  1196. res : res_none;
  1197. heapsize : 256*1024;
  1198. maxheapsize : 32768*1024;
  1199. stacksize : 8192
  1200. )
  1201. {$endif i386}
  1202. {$ifdef m68k}
  1203. ,(
  1204. target : target_m68k_Amiga;
  1205. flags : [];
  1206. cpu : m68k;
  1207. short_name : 'AMIGA';
  1208. unit_env : '';
  1209. smartext : '.sl';
  1210. unitext : '.ppa';
  1211. unitlibext : '.ppl';
  1212. asmext : '.asm';
  1213. objext : '.o';
  1214. resext : '.res';
  1215. resobjext : '.or';
  1216. exeext : '';
  1217. os : os_m68k_Amiga;
  1218. assem : as_m68k_as;
  1219. assemsrc : as_m68k_as;
  1220. ar : ar_m68k_ar;
  1221. res : res_none;
  1222. heapsize : 128*1024;
  1223. maxheapsize : 32768*1024;
  1224. stacksize : 8192
  1225. ),
  1226. (
  1227. target : target_m68k_Atari;
  1228. flags : [];
  1229. cpu : m68k;
  1230. short_name : 'ATARI';
  1231. unit_env : '';
  1232. smartext : '.sl';
  1233. unitext : '.ppt';
  1234. unitlibext : '.ppl';
  1235. asmext : '.s';
  1236. objext : '.o';
  1237. resext : '.res';
  1238. resobjext : '.or';
  1239. exeext : '.ttp';
  1240. os : os_m68k_Atari;
  1241. assem : as_m68k_as;
  1242. assemsrc : as_m68k_as;
  1243. ar : ar_m68k_ar;
  1244. res : res_none;
  1245. heapsize : 16*1024;
  1246. maxheapsize : 32768*1024;
  1247. stacksize : 8192
  1248. ),
  1249. (
  1250. target : target_m68k_Mac;
  1251. flags : [];
  1252. cpu : m68k;
  1253. short_name : 'MACOS';
  1254. unit_env : '';
  1255. smartext : '.sl';
  1256. unitext : '.ppt';
  1257. unitlibext : '.ppl';
  1258. asmext : '.a';
  1259. objext : '.o';
  1260. resext : '.res';
  1261. resobjext : '.or';
  1262. exeext : '';
  1263. os : os_m68k_Mac;
  1264. assem : as_m68k_mpw;
  1265. assemsrc : as_m68k_mpw;
  1266. ar : ar_m68k_ar;
  1267. res : res_none;
  1268. heapsize : 128*1024;
  1269. maxheapsize : 32768*1024;
  1270. stacksize : 8192
  1271. ),
  1272. (
  1273. target : target_m68k_linux;
  1274. flags : [];
  1275. cpu : m68k;
  1276. short_name : 'LINUX';
  1277. unit_env : 'LINUXUNITS';
  1278. smartext : '.sl';
  1279. unitext : '.ppu';
  1280. unitlibext : '.ppl';
  1281. asmext : '.s';
  1282. objext : '.o';
  1283. resext : '.res';
  1284. resobjext : '.or';
  1285. exeext : '';
  1286. os : os_m68k_Linux;
  1287. assem : as_m68k_as;
  1288. assemsrc : as_m68k_as;
  1289. ar : ar_m68k_ar;
  1290. res : res_none;
  1291. heapsize : 128*1024;
  1292. maxheapsize : 32768*1024;
  1293. stacksize : 8192
  1294. ),
  1295. (
  1296. target : target_m68k_PalmOS;
  1297. flags : [];
  1298. cpu : m68k;
  1299. short_name : 'PALMOS';
  1300. unit_env : 'PALMUNITS';
  1301. smartext : '.sl';
  1302. unitext : '.ppu';
  1303. unitlibext : '.ppl';
  1304. asmext : '.s';
  1305. objext : '.o';
  1306. resext : '.res';
  1307. resobjext : '.or';
  1308. exeext : '';
  1309. os : os_m68k_PalmOS;
  1310. assem : as_m68k_as;
  1311. assemsrc : as_m68k_as;
  1312. ar : ar_m68k_ar;
  1313. res : res_none;
  1314. heapsize : 128*1024;
  1315. maxheapsize : 32768*1024;
  1316. stacksize : 8192
  1317. )
  1318. {$endif m68k}
  1319. {$ifdef alpha}
  1320. ,(
  1321. target : target_alpha_LINUX;
  1322. flags : [];
  1323. cpu : alpha;
  1324. short_name : 'LINUX';
  1325. unit_env : 'LINUXUNITS';
  1326. smartext : '.sl';
  1327. unitext : '.ppu';
  1328. unitlibext : '.ppl';
  1329. asmext : '.s';
  1330. objext : '.o';
  1331. resext : '.res';
  1332. resobjext : '.or';
  1333. exeext : '';
  1334. os : os_alpha_Linux;
  1335. assem : as_alpha_as;
  1336. assemsrc : as_alpha_as;
  1337. ar : ar_alpha_ar;
  1338. res : res_none;
  1339. heapsize : 256*1024;
  1340. maxheapsize : 32768*1024;
  1341. stacksize : 8192
  1342. )
  1343. {$endif}
  1344. {$ifdef powerpc}
  1345. ,(
  1346. target : target_powerpc_LINUX;
  1347. flags : [];
  1348. cpu : powerpc;
  1349. short_name : 'LINUX';
  1350. unit_env : '';
  1351. smartext : '.sl';
  1352. unitext : '.ppu';
  1353. unitlibext : '.ppl';
  1354. asmext : '.s';
  1355. objext : '.o';
  1356. resext : '.res';
  1357. resobjext : '.or';
  1358. exeext : '';
  1359. os : os_powerpc_Linux;
  1360. assem : as_powerpc_as;
  1361. assemsrc : as_powerpc_as;
  1362. ar : ar_powerpc_ar;
  1363. res : res_none;
  1364. heapsize : 256*1024;
  1365. maxheapsize : 32768*1024;
  1366. stacksize : 8192
  1367. ),
  1368. (
  1369. target : target_powerpc_MACOS;
  1370. flags : [];
  1371. cpu : powerpc;
  1372. short_name : 'MACOS';
  1373. unit_env : '';
  1374. smartext : '.sl';
  1375. unitext : '.ppt';
  1376. unitlibext : '.ppl';
  1377. asmext : '.a';
  1378. objext : '.o';
  1379. resext : '.res';
  1380. resobjext : '.or';
  1381. exeext : '';
  1382. os : os_powerpc_macos;
  1383. assem : as_powerpc_mpw;
  1384. assemsrc : as_powerpc_mpw;
  1385. ar : ar_powerpc_ar;
  1386. res : res_powerpc_mpw;
  1387. heapsize : 256*1024;
  1388. maxheapsize : 32768*1024;
  1389. stacksize : 8192
  1390. )
  1391. {$endif}
  1392. );
  1393. {****************************************************************************
  1394. AsmModeInfo
  1395. ****************************************************************************}
  1396. asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
  1397. (
  1398. id : asmmode_none;
  1399. idtxt : 'none'
  1400. )
  1401. {$ifdef i386}
  1402. ,(
  1403. id : asmmode_i386_direct;
  1404. idtxt : 'DIRECT'
  1405. ),
  1406. (
  1407. id : asmmode_i386_att;
  1408. idtxt : 'ATT'
  1409. ),
  1410. (
  1411. id : asmmode_i386_intel;
  1412. idtxt : 'INTEL'
  1413. )
  1414. {$endif i386}
  1415. {$ifdef m68k}
  1416. ,(
  1417. id : asmmode_m68k_mot;
  1418. idtxt : 'MOT'
  1419. )
  1420. {$endif m68k}
  1421. {$ifdef alpha}
  1422. ,(
  1423. id : asmmode_alpha_direct;
  1424. idtxt : 'DIRECT'
  1425. )
  1426. {$endif}
  1427. {$ifdef powerpc}
  1428. ,(
  1429. id : asmmode_powerpc_direct;
  1430. idtxt : 'DIRECT'
  1431. )
  1432. {$endif}
  1433. );
  1434. {****************************************************************************
  1435. Helpers
  1436. ****************************************************************************}
  1437. function set_target_os(t:tos):boolean;
  1438. var
  1439. i : longint;
  1440. begin
  1441. set_target_os:=false;
  1442. { target 1 is none }
  1443. for i:=2 to oscnt do
  1444. if os_infos[i].id=t then
  1445. begin
  1446. target_os:=os_infos[i];
  1447. set_target_os:=true;
  1448. exit;
  1449. end;
  1450. end;
  1451. function set_target_asm(t:tasm):boolean;
  1452. var
  1453. i : longint;
  1454. begin
  1455. set_target_asm:=false;
  1456. for i:=1 to asmcnt do
  1457. if as_infos[i].id=t then
  1458. begin
  1459. target_asm:=as_infos[i];
  1460. set_target_asm:=true;
  1461. exit;
  1462. end;
  1463. end;
  1464. function set_target_ar(t:tar):boolean;
  1465. var
  1466. i : longint;
  1467. begin
  1468. set_target_ar:=false;
  1469. for i:=1 to arcnt do
  1470. if ar_infos[i].id=t then
  1471. begin
  1472. target_ar:=ar_infos[i];
  1473. set_target_ar:=true;
  1474. exit;
  1475. end;
  1476. end;
  1477. function set_target_res(t:tres):boolean;
  1478. var
  1479. i : longint;
  1480. begin
  1481. set_target_res:=false;
  1482. for i:=1 to rescnt do
  1483. if res_infos[i].id=t then
  1484. begin
  1485. target_res:=res_infos[i];
  1486. set_target_res:=true;
  1487. exit;
  1488. end;
  1489. end;
  1490. function set_target_info(t:ttarget):boolean;
  1491. var
  1492. i : longint;
  1493. begin
  1494. set_target_info:=false;
  1495. for i:=1 to targetcnt do
  1496. if target_infos[i].target=t then
  1497. begin
  1498. target_info:=target_infos[i];
  1499. set_target_os(target_info.os);
  1500. set_target_asm(target_info.assem);
  1501. set_target_ar(target_info.ar);
  1502. set_target_res(target_info.res);
  1503. target_path:=lower(target_info.short_name);
  1504. target_cpu:=target_info.cpu;
  1505. set_target_info:=true;
  1506. exit;
  1507. end;
  1508. end;
  1509. {****************************************************************************
  1510. Load from string
  1511. ****************************************************************************}
  1512. function set_string_target(s : string) : boolean;
  1513. var
  1514. i : longint;
  1515. begin
  1516. set_string_target:=false;
  1517. { this should be case insensitive !! PM }
  1518. s:=upper(s);
  1519. for i:=1 to targetcnt do
  1520. if target_infos[i].short_name=s then
  1521. begin
  1522. set_target_info(target_infos[i].target);
  1523. set_string_target:=true;
  1524. exit;
  1525. end;
  1526. end;
  1527. function set_string_asm(s : string) : boolean;
  1528. var
  1529. i : longint;
  1530. begin
  1531. set_string_asm:=false;
  1532. { this should be case insensitive !! PM }
  1533. s:=upper(s);
  1534. for i:=1 to asmcnt do
  1535. if as_infos[i].idtxt=s then
  1536. begin
  1537. target_asm:=as_infos[i];
  1538. set_string_asm:=true;
  1539. end;
  1540. end;
  1541. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  1542. var
  1543. i : longint;
  1544. begin
  1545. set_string_asmmode:=false;
  1546. { this should be case insensitive !! PM }
  1547. s:=upper(s);
  1548. for i:=1 to asmmodecnt do
  1549. if asmmodeinfos[i].idtxt=s then
  1550. begin
  1551. t:=asmmodeinfos[i].id;
  1552. set_string_asmmode:=true;
  1553. end;
  1554. end;
  1555. {****************************************************************************
  1556. Initialization of default target
  1557. ****************************************************************************}
  1558. procedure default_os(t:ttarget);
  1559. begin
  1560. set_target_info(t);
  1561. if source_os.name='' then
  1562. source_os:=target_os;
  1563. end;
  1564. procedure set_source_os(t:tos);
  1565. var
  1566. i : longint;
  1567. begin
  1568. { can't use message() here (PFV) }
  1569. if source_os.name<>'' then
  1570. Writeln('Warning: Source OS Redefined!');
  1571. for i:=1 to oscnt do
  1572. if os_infos[i].id=t then
  1573. begin
  1574. source_os:=os_infos[i];
  1575. exit;
  1576. end;
  1577. end;
  1578. procedure InitSystems;
  1579. begin
  1580. { first get source OS }
  1581. source_os.name:='';
  1582. { please note then we use cpu86 and cpu68 here on purpose !! }
  1583. {$ifdef cpu86}
  1584. {$ifdef GO32V1}
  1585. set_source_os(os_i386_GO32V1);
  1586. {$else}
  1587. {$ifdef GO32V2}
  1588. set_source_os(os_i386_GO32V2);
  1589. {$else}
  1590. {$ifdef OS2}
  1591. set_source_os(os_i386_OS2);
  1592. if (OS_Mode = osDOS) or (OS_Mode = osDPMI) then
  1593. source_os.scriptext := '.bat';
  1594. { OS/2 via EMX can be run under DOS as well }
  1595. {$else}
  1596. {$ifdef WIN32}
  1597. set_source_os(os_i386_WIN32);
  1598. {$else}
  1599. {$Ifdef BSD}
  1600. set_source_os(os_i386_FreeBSD);
  1601. {$else}
  1602. {$ifdef sunos}
  1603. set_source_os(os_i386_sunos);
  1604. {$else}
  1605. { Must be the last as some freebsd also
  1606. defined linux }
  1607. {$ifdef Linux}
  1608. set_source_os(os_i386_LINUX);
  1609. {$endif linux}
  1610. {$endif sunos}
  1611. {$endif bsd}
  1612. {$endif win32}
  1613. {$endif os2}
  1614. {$endif go32v2}
  1615. {$endif go32v1}
  1616. {$endif cpu86}
  1617. {$ifdef cpu68}
  1618. {$ifdef AMIGA}
  1619. set_source_os(os_m68k_Amiga);
  1620. {$else}
  1621. {$ifdef ATARI}
  1622. set_source_os(os_m68k_Atari);
  1623. {$else}
  1624. {$ifdef MACOS}
  1625. set_source_os(os_m68k_MAC);
  1626. {$else}
  1627. {$ifdef LINUX}
  1628. set_source_os(os_m68k_linux);
  1629. {$endif linux}
  1630. {$endif macos}
  1631. {$endif atari}
  1632. {$endif amiga}
  1633. {$endif cpu68}
  1634. { Now default target !! }
  1635. {$ifdef i386}
  1636. {$ifdef GO32V1}
  1637. default_os(target_i386_GO32V1);
  1638. {$else}
  1639. {$ifdef GO32V2}
  1640. default_os(target_i386_GO32V2);
  1641. {$else}
  1642. {$ifdef OS2}
  1643. default_os(target_i386_OS2);
  1644. {$else}
  1645. {$ifdef LINUX}
  1646. {$ifdef BSD}
  1647. default_os(target_i386_FreeBSD);
  1648. {$else}
  1649. default_os(target_i386_LINUX);
  1650. {$endif}
  1651. {$else}
  1652. {$ifdef WIN32}
  1653. default_os(target_i386_WIN32);
  1654. {$else}
  1655. default_os(target_i386_GO32V2);
  1656. {$endif win32}
  1657. {$endif linux}
  1658. {$endif os2}
  1659. {$endif go32v2}
  1660. {$endif go32v1}
  1661. {$endif i386}
  1662. {$ifdef m68k}
  1663. {$ifdef AMIGA}
  1664. default_os(target_m68k_Amiga);
  1665. {$else}
  1666. {$ifdef ATARI}
  1667. default_os(target_m68k_Atari);
  1668. {$else}
  1669. {$ifdef MACOS}
  1670. default_os(target_m68k_Mac);
  1671. {$else}
  1672. {$ifdef LINUX}
  1673. default_os(target_m68k_linux);
  1674. {$else}
  1675. default_os(target_m68k_Amiga);
  1676. {$endif linux}
  1677. {$endif macos}
  1678. {$endif atari}
  1679. {$endif amiga}
  1680. {$endif m68k}
  1681. {$ifdef alpha}
  1682. default_os(target_alpha_linux);
  1683. {$endif alpha}
  1684. {$ifdef powerpc}
  1685. default_os(target_powerpc_linux);
  1686. {$endif powerpc}
  1687. end;
  1688. begin
  1689. InitSystems;
  1690. end.
  1691. {
  1692. $Log$
  1693. Revision 1.14 2001-02-26 19:44:55 peter
  1694. * merged generic m68k updates from fixes branch
  1695. Revision 1.13 2001/02/20 21:36:40 peter
  1696. * tasm/masm fixes merged
  1697. Revision 1.12 2001/01/06 20:15:43 peter
  1698. * merged libp library prefix
  1699. Revision 1.11 2000/10/15 09:08:58 peter
  1700. * use System for the systemunit instead of target dependent
  1701. Revision 1.10 2000/09/24 21:12:41 hajny
  1702. * OS/2 stack alignment corrected + default stack increased
  1703. Revision 1.9 2000/09/24 15:06:30 peter
  1704. * use defines.inc
  1705. Revision 1.8 2000/09/20 10:49:39 marco
  1706. * Set writer to elf. (Only a prob for smart with -OG3p3r)
  1707. Revision 1.7 2000/09/16 12:22:52 peter
  1708. * freebsd support merged
  1709. Revision 1.6 2000/09/11 17:00:23 florian
  1710. + first implementation of Netware Module support, thanks to
  1711. Armin Diehl ([email protected]) for providing the patches
  1712. Revision 1.5 2000/08/12 19:14:59 peter
  1713. * ELF writer works now also with -g
  1714. * ELF writer is default again for linux
  1715. Revision 1.4 2000/07/14 21:29:38 michael
  1716. * Back to external assembler till peter fixes gdb
  1717. Revision 1.3 2000/07/13 12:08:28 michael
  1718. + patched to 1.1.0 with former 1.09patch from peter
  1719. Revision 1.2 2000/07/13 11:32:50 michael
  1720. + removed logs
  1721. }