systems.pas 52 KB

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