systems.pas 53 KB

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