systems.pas 55 KB

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