systems.pas 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757
  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[3];
  134. Cprefix : string[2];
  135. newline : string[2];
  136. endian : tendian;
  137. {longint this is a little overkill no ?? but 256 is possible one day }
  138. stackalignment : word;
  139. maxCrecordalignment : word;
  140. size_of_pointer : byte;
  141. size_of_longint : byte;
  142. use_bound_instruction : boolean;
  143. use_function_relative_addresses : boolean;
  144. end;
  145. tasminfo = packed record
  146. id : tasm;
  147. idtxt : string[9];
  148. asmbin : string[8];
  149. asmcmd : string[50];
  150. supported_target : ttarget;
  151. allowdirect,
  152. externals,
  153. needar : boolean;
  154. labelprefix : string[2];
  155. comment : string[2];
  156. secnames : array[tsection] of string[20];
  157. end;
  158. tarinfo = packed record
  159. id : tar;
  160. arcmd : string[50];
  161. end;
  162. tresinfo = packed record
  163. id : tres;
  164. resbin : string[8];
  165. rescmd : string[50];
  166. end;
  167. ttargetinfo = packed record
  168. target : ttarget;
  169. flags : set of ttargetflags;
  170. cpu : ttargetcpu;
  171. short_name : string[8];
  172. unit_env : string[12];
  173. system_unit : string[8];
  174. smartext,
  175. unitext,
  176. unitlibext,
  177. asmext,
  178. objext,
  179. resext,
  180. resobjext,
  181. exeext : string[4];
  182. os : tos;
  183. 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 : 'lib';
  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 : 'lib';
  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 : 'lib';
  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 : 'lib';
  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 : 'lib';
  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 : 'lib';
  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 : 'lib';
  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 : 'L';
  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 : 'L';
  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 : 'L';
  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 : 'L';
  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 $ASM $OBJ';
  684. supported_target : target_any; { what should I write here ?? }
  685. allowdirect : true;
  686. externals : true;
  687. needar : true;
  688. labelprefix : '@@';
  689. comment : '; ';
  690. secnames : ('',
  691. 'CODE','DATA','BSS',
  692. '','','','','','',
  693. '','')
  694. )
  695. ,(
  696. id : as_i386_masm;
  697. idtxt : 'MASM';
  698. asmbin : 'masm';
  699. asmcmd : '$ASM $OBJ';
  700. supported_target : target_any; { what should I write here ?? }
  701. allowdirect : true;
  702. externals : true;
  703. needar : true;
  704. labelprefix : '.L';
  705. comment : '; ';
  706. secnames : ('',
  707. 'CODE','DATA','BSS',
  708. '','','','','','',
  709. '','')
  710. )
  711. ,(
  712. id : as_i386_dbg;
  713. idtxt : 'DBG';
  714. asmbin : '';
  715. asmcmd : '';
  716. supported_target : target_any;
  717. allowdirect : false;
  718. externals : true;
  719. needar : false;
  720. labelprefix : 'L';
  721. comment : '';
  722. secnames : ('',
  723. '.text','.data','.bss',
  724. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  725. '.stab','.stabstr')
  726. )
  727. ,(
  728. id : as_i386_coff;
  729. idtxt : 'COFF';
  730. asmbin : '';
  731. asmcmd : '';
  732. supported_target : target_i386_go32v2;
  733. allowdirect : false;
  734. externals : true;
  735. needar : false;
  736. labelprefix : '.L';
  737. comment : '';
  738. secnames : ('',
  739. '.text','.data','.bss',
  740. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  741. '.stab','.stabstr')
  742. )
  743. ,(
  744. id : as_i386_pecoff;
  745. idtxt : 'PECOFF';
  746. asmbin : '';
  747. asmcmd : '';
  748. supported_target : target_i386_win32;
  749. allowdirect : false;
  750. externals : true;
  751. needar : false;
  752. labelprefix : '.L';
  753. comment : '';
  754. secnames : ('',
  755. '.text','.data','.bss',
  756. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  757. '.stab','.stabstr')
  758. )
  759. ,(
  760. id : as_i386_elf;
  761. idtxt : 'ELF';
  762. asmbin : '';
  763. asmcmd : '';
  764. supported_target : target_any; //target_i386_linux;
  765. allowdirect : false;
  766. externals : true;
  767. needar : false;
  768. labelprefix : '.L';
  769. comment : '';
  770. secnames : ('',
  771. '.text','.data','.bss',
  772. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  773. '.stab','.stabstr')
  774. )
  775. {$endif i386}
  776. {$ifdef m68k}
  777. ,(
  778. id : as_m68k_as;
  779. idtxt : 'AS';
  780. asmbin : 'as';
  781. asmcmd : '-o $OBJ $ASM';
  782. supported_target : target_any;
  783. allowdirect : true;
  784. externals : false;
  785. needar : true;
  786. labelprefix : '.L';
  787. comment : '# ';
  788. secnames : ('',
  789. '.text','.data','.bss',
  790. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  791. '.stab','.stabstr')
  792. )
  793. ,(
  794. id : as_m68k_gas;
  795. idtxt : 'GAS';
  796. asmbin : 'as68k'; { Gas for the Amiga}
  797. asmcmd : '--register-prefix-optional -o $OBJ $ASM';
  798. supported_target : target_any;
  799. allowdirect : true;
  800. externals : false;
  801. needar : true;
  802. labelprefix : '.L';
  803. comment : '| ';
  804. secnames : ('',
  805. '.text','.data','.bss',
  806. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  807. '.stab','.stabstr')
  808. )
  809. ,(
  810. id : as_m68k_mit;
  811. idtxt : 'MIT';
  812. asmbin : '';
  813. asmcmd : '-o $OBJ $ASM';
  814. supported_target : target_any;
  815. allowdirect : true;
  816. externals : false;
  817. needar : true;
  818. labelprefix : '.L';
  819. comment : '| ';
  820. secnames : ('',
  821. '.text','.data','.bss',
  822. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  823. '.stab','.stabstr')
  824. )
  825. ,(
  826. id : as_m68k_mot;
  827. idtxt : 'MOT';
  828. asmbin : '';
  829. asmcmd : '-o $OBJ $ASM';
  830. supported_target : target_any;
  831. allowdirect : true;
  832. externals : false;
  833. needar : true;
  834. labelprefix : '__L';
  835. comment : '| ';
  836. secnames : ('',
  837. '.text','.data','.bss',
  838. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  839. '.stab','.stabstr')
  840. )
  841. ,(
  842. id : as_m68k_mpw;
  843. idtxt : 'MPW';
  844. asmbin : '';
  845. asmcmd : '-model far -o $OBJ $ASM';
  846. supported_target : target_any;
  847. allowdirect : true;
  848. externals : false;
  849. needar : true;
  850. labelprefix : '__L';
  851. comment : '* ';
  852. secnames : ('',
  853. '.text','.data','.bss',
  854. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  855. '.stab','.stabstr')
  856. )
  857. {$endif m68k}
  858. {$ifdef alpha}
  859. ,(
  860. id : as_alpha_as;
  861. idtxt : 'AS';
  862. asmbin : 'as';
  863. asmcmd : '-o $OBJ $ASM';
  864. supported_target : target_any;
  865. allowdirect : true;
  866. externals : false;
  867. needar : true;
  868. labelprefix : '.L';
  869. comment : '# ';
  870. secnames : ('',
  871. '.text','.data','.bss',
  872. '','','','','','',
  873. '.stab','.stabstr')
  874. )
  875. {$endif}
  876. {$ifdef powerpc}
  877. ,(
  878. id : as_powerpc_as;
  879. idtxt : 'AS';
  880. asmbin : 'as';
  881. asmcmd : '-o $OBJ $ASM';
  882. supported_target : target_any;
  883. allowdirect : true;
  884. externals : false;
  885. needar : true;
  886. labelprefix : '.L';
  887. comment : '# ';
  888. secnames : ('',
  889. '.text','.data','.bss',
  890. '','','','','','',
  891. '.stab','.stabstr')
  892. )
  893. ,(
  894. id : as_powerpc_mpw;
  895. idtxt : 'PPCAsm';
  896. asmbin : 'PPCAsm';
  897. asmcmd : '-o $OBJ $ASM';
  898. supported_target : target_any;
  899. allowdirect : true;
  900. externals : false;
  901. needar : true;
  902. labelprefix : '.L';
  903. comment : '; ';
  904. secnames : ('',
  905. '.text','.data','.bss',
  906. '','','','','','',
  907. '.stab','.stabstr')
  908. )
  909. {$endif}
  910. );
  911. {****************************************************************************
  912. Ar Info
  913. ****************************************************************************}
  914. ar_infos : array[1..arcnt] of tarinfo = (
  915. (
  916. id : ar_none
  917. )
  918. {$ifdef i386}
  919. ,(
  920. id : ar_i386_ar;
  921. arcmd : 'ar rs $LIB $FILES'
  922. ),
  923. (
  924. id : ar_i386_arw;
  925. arcmd : 'arw rs $LIB $FILES'
  926. )
  927. {$endif i386}
  928. {$ifdef m68k}
  929. ,(
  930. id : ar_m68k_ar;
  931. arcmd : 'ar rs $LIB $FILES'
  932. )
  933. {$endif m68k}
  934. {$ifdef alpha}
  935. ,(
  936. id : ar_alpha_ar;
  937. arcmd : 'ar rs $LIB $FILES'
  938. )
  939. {$endif}
  940. {$ifdef powerpc}
  941. ,(
  942. id : ar_powerpc_ar;
  943. arcmd : 'ar rs $LIB $FILES'
  944. )
  945. {$endif}
  946. );
  947. {****************************************************************************
  948. Res Info
  949. ****************************************************************************}
  950. res_infos : array[1..rescnt] of tresinfo = (
  951. (
  952. id : res_none
  953. )
  954. {$ifdef i386}
  955. ,(
  956. id : res_i386_windres;
  957. resbin : 'windres';
  958. rescmd : '--include $INC -O coff -o $OBJ $RES'
  959. )
  960. ,(
  961. id : res_i386_emx;
  962. resbin : 'emxbind';
  963. rescmd : '-b -r $RES $OBJ'
  964. (* Not really used - see TLinkeros2.SetDefaultInfo in t_os2.pas. *)
  965. )
  966. {$endif i386}
  967. {$ifdef m68k}
  968. ,(
  969. id : res_m68k_mpw;
  970. resbin : 'rez';
  971. rescmd : '-i $INC -o $OBJ $RES'
  972. )
  973. {$endif m68}
  974. {$ifdef powerpc}
  975. ,(
  976. id : res_powerpc_mpw;
  977. resbin : 'rez';
  978. rescmd : '-i $INC -o $OBJ $RES'
  979. )
  980. {$endif powerpc}
  981. );
  982. {****************************************************************************
  983. Targets Info
  984. ****************************************************************************}
  985. target_infos : array[1..targetcnt] of ttargetinfo = (
  986. (
  987. target : target_none;
  988. flags : [];
  989. cpu : no_cpu;
  990. short_name : 'notarget'
  991. )
  992. {$ifdef i386}
  993. ,(
  994. target : target_i386_GO32V1;
  995. flags : [];
  996. cpu : i386;
  997. short_name : 'GO32V1';
  998. unit_env : 'GO32V1UNITS';
  999. system_unit : 'SYSTEM';
  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. system_unit : 'SYSTEM';
  1024. smartext : '.sl';
  1025. unitext : '.ppu';
  1026. unitlibext : '.ppl';
  1027. asmext : '.s';
  1028. objext : '.o';
  1029. resext : '.res';
  1030. resobjext : '.or';
  1031. exeext : '.exe';
  1032. os : os_i386_GO32V2;
  1033. assem : as_i386_coff;
  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. ),
  1041. (
  1042. target : target_i386_LINUX;
  1043. flags : [];
  1044. cpu : i386;
  1045. short_name : 'LINUX';
  1046. unit_env : 'LINUXUNITS';
  1047. system_unit : 'syslinux';
  1048. smartext : '.sl';
  1049. unitext : '.ppu';
  1050. unitlibext : '.ppl';
  1051. asmext : '.s';
  1052. objext : '.o';
  1053. resext : '.res';
  1054. resobjext : '.or';
  1055. exeext : '';
  1056. os : os_i386_Linux;
  1057. assem : as_i386_elf;
  1058. assemsrc : as_i386_as;
  1059. ar : ar_i386_ar;
  1060. res : res_none;
  1061. heapsize : 256*1024;
  1062. maxheapsize : 32768*1024;
  1063. stacksize : 8192
  1064. ),
  1065. (
  1066. target : target_i386_FreeBSD;
  1067. flags : [];
  1068. cpu : i386;
  1069. short_name : 'FREEBSD';
  1070. unit_env : 'BSDUNITS';
  1071. system_unit : 'sysbsd';
  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_Freebsd;
  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. ),
  1089. (
  1090. target : target_i386_OS2;
  1091. flags : [tf_need_export];
  1092. cpu : i386;
  1093. short_name : 'OS2';
  1094. unit_env : 'OS2UNITS';
  1095. system_unit : 'SYSOS2';
  1096. smartext : '.sl';
  1097. unitext : '.ppo';
  1098. unitlibext : '.ppl';
  1099. asmext : '.so2';
  1100. objext : '.oo2';
  1101. resext : '.res';
  1102. resobjext : '.oor';
  1103. exeext : ''; { The linker produces a.out }
  1104. os : os_i386_OS2;
  1105. assem : as_i386_as_aout;
  1106. assemsrc : as_i386_as_aout;
  1107. ar : ar_i386_ar;
  1108. res : res_i386_emx;
  1109. heapsize : 256*1024;
  1110. maxheapsize : 32768*1024;
  1111. stacksize : 256*1024
  1112. ),
  1113. (
  1114. target : target_i386_WIN32;
  1115. flags : [];
  1116. cpu : i386;
  1117. short_name : 'WIN32';
  1118. unit_env : 'WIN32UNITS';
  1119. system_unit : 'SYSWIN32';
  1120. smartext : '.slw';
  1121. unitext : '.ppw';
  1122. unitlibext : '.ppl';
  1123. asmext : '.sw';
  1124. objext : '.ow';
  1125. resext : '.rc';
  1126. resobjext : '.owr';
  1127. exeext : '.exe';
  1128. os : os_i386_Win32;
  1129. assem : as_i386_pecoff;
  1130. assemsrc : as_i386_asw;
  1131. ar : ar_i386_arw;
  1132. res : res_i386_windres;
  1133. heapsize : 256*1024;
  1134. maxheapsize : 32*1024*1024;
  1135. stacksize : 32*1024*1024
  1136. ),
  1137. (
  1138. target : target_i386_NETWARE;
  1139. flags : [];
  1140. cpu : i386;
  1141. short_name : 'NETWARE';
  1142. unit_env : 'NETWAREUNITS';
  1143. system_unit : 'sysnetwa';
  1144. smartext : '.sl';
  1145. unitext : '.ppn';
  1146. unitlibext : '.ppl';
  1147. asmext : '.s';
  1148. objext : '.on';
  1149. resext : '.res';
  1150. resobjext : '.or';
  1151. exeext : '';
  1152. os : os_i386_Netware;
  1153. assem : as_i386_elf;
  1154. assemsrc : as_i386_as;
  1155. ar : ar_i386_ar;
  1156. res : res_none;
  1157. heapsize : 256*1024;
  1158. maxheapsize : 32768*1024;
  1159. stacksize : 8192
  1160. )
  1161. {$endif i386}
  1162. {$ifdef m68k}
  1163. ,(
  1164. target : target_m68k_Amiga;
  1165. flags : [];
  1166. cpu : m68k;
  1167. short_name : 'AMIGA';
  1168. unit_env : '';
  1169. system_unit : 'sysamiga';
  1170. smartext : '.sl';
  1171. unitext : '.ppa';
  1172. unitlibext : '.ppl';
  1173. asmext : '.asm';
  1174. objext : '.o';
  1175. resext : '.res';
  1176. resobjext : '.or';
  1177. exeext : '';
  1178. os : os_m68k_Amiga;
  1179. assem : as_m68k_as;
  1180. assemsrc : as_m68k_as;
  1181. ar : ar_m68k_ar;
  1182. res : res_none;
  1183. heapsize : 128*1024;
  1184. maxheapsize : 32768*1024;
  1185. stacksize : 8192
  1186. ),
  1187. (
  1188. target : target_m68k_Atari;
  1189. flags : [];
  1190. cpu : m68k;
  1191. short_name : 'ATARI';
  1192. unit_env : '';
  1193. system_unit : 'SYSATARI';
  1194. smartext : '.sl';
  1195. unitext : '.ppt';
  1196. unitlibext : '.ppl';
  1197. asmext : '.s';
  1198. objext : '.o';
  1199. resext : '.res';
  1200. resobjext : '.or';
  1201. exeext : '.ttp';
  1202. os : os_m68k_Atari;
  1203. assem : as_m68k_as;
  1204. assemsrc : as_m68k_as;
  1205. ar : ar_m68k_ar;
  1206. res : res_none;
  1207. heapsize : 16*1024;
  1208. maxheapsize : 32768*1024;
  1209. stacksize : 8192
  1210. ),
  1211. (
  1212. target : target_m68k_Mac;
  1213. flags : [];
  1214. cpu : m68k;
  1215. short_name : 'MACOS';
  1216. unit_env : '';
  1217. system_unit : 'sysmac';
  1218. smartext : '.sl';
  1219. unitext : '.ppt';
  1220. unitlibext : '.ppl';
  1221. asmext : '.a';
  1222. objext : '.o';
  1223. resext : '.res';
  1224. resobjext : '.or';
  1225. exeext : '';
  1226. os : os_m68k_Mac;
  1227. assem : as_m68k_mpw;
  1228. assemsrc : as_m68k_mpw;
  1229. ar : ar_m68k_ar;
  1230. res : res_none;
  1231. heapsize : 128*1024;
  1232. maxheapsize : 32768*1024;
  1233. stacksize : 8192
  1234. ),
  1235. (
  1236. target : target_m68k_linux;
  1237. flags : [];
  1238. cpu : m68k;
  1239. short_name : 'LINUX';
  1240. unit_env : 'LINUXUNITS';
  1241. system_unit : 'syslinux';
  1242. smartext : '.sl';
  1243. unitext : '.ppu';
  1244. unitlibext : '.ppl';
  1245. asmext : '.s';
  1246. objext : '.o';
  1247. resext : '.res';
  1248. resobjext : '.or';
  1249. exeext : '';
  1250. os : os_m68k_Linux;
  1251. assem : as_m68k_as;
  1252. assemsrc : as_m68k_as;
  1253. ar : ar_m68k_ar;
  1254. res : res_none;
  1255. heapsize : 128*1024;
  1256. maxheapsize : 32768*1024;
  1257. stacksize : 8192
  1258. ),
  1259. (
  1260. target : target_m68k_PalmOS;
  1261. flags : [];
  1262. cpu : m68k;
  1263. short_name : 'PALMOS';
  1264. unit_env : 'PALMUNITS';
  1265. system_unit : 'syspalm';
  1266. smartext : '.sl';
  1267. unitext : '.ppu';
  1268. unitlibext : '.ppl';
  1269. asmext : '.s';
  1270. objext : '.o';
  1271. resext : '.res';
  1272. resobjext : '.or';
  1273. exeext : '';
  1274. os : os_m68k_PalmOS;
  1275. assem : as_m68k_as;
  1276. assemsrc : as_m68k_as;
  1277. ar : ar_m68k_ar;
  1278. res : res_none;
  1279. heapsize : 128*1024;
  1280. maxheapsize : 32768*1024;
  1281. stacksize : 8192
  1282. )
  1283. {$endif m68k}
  1284. {$ifdef alpha}
  1285. ,(
  1286. target : target_alpha_LINUX;
  1287. flags : [];
  1288. cpu : alpha;
  1289. short_name : 'LINUX';
  1290. unit_env : 'LINUXUNITS';
  1291. system_unit : 'syslinux';
  1292. smartext : '.sl';
  1293. unitext : '.ppu';
  1294. unitlibext : '.ppl';
  1295. asmext : '.s';
  1296. objext : '.o';
  1297. resext : '.res';
  1298. resobjext : '.or';
  1299. exeext : '';
  1300. os : os_alpha_Linux;
  1301. assem : as_alpha_as;
  1302. assemsrc : as_alpha_as;
  1303. ar : ar_alpha_ar;
  1304. res : res_none;
  1305. heapsize : 256*1024;
  1306. maxheapsize : 32768*1024;
  1307. stacksize : 8192
  1308. )
  1309. {$endif}
  1310. {$ifdef powerpc}
  1311. ,(
  1312. target : target_powerpc_LINUX;
  1313. flags : [];
  1314. cpu : powerpc;
  1315. short_name : 'LINUX';
  1316. unit_env : '';
  1317. system_unit : 'syslinux';
  1318. smartext : '.sl';
  1319. unitext : '.ppu';
  1320. unitlibext : '.ppl';
  1321. asmext : '.s';
  1322. objext : '.o';
  1323. resext : '.res';
  1324. resobjext : '.or';
  1325. exeext : '';
  1326. os : os_powerpc_Linux;
  1327. assem : as_powerpc_as;
  1328. assemsrc : as_powerpc_as;
  1329. ar : ar_powerpc_ar;
  1330. res : res_none;
  1331. heapsize : 256*1024;
  1332. maxheapsize : 32768*1024;
  1333. stacksize : 8192
  1334. ),
  1335. (
  1336. target : target_powerpc_MACOS;
  1337. flags : [];
  1338. cpu : powerpc;
  1339. short_name : 'MACOS';
  1340. unit_env : '';
  1341. system_unit : 'sysmac';
  1342. smartext : '.sl';
  1343. unitext : '.ppt';
  1344. unitlibext : '.ppl';
  1345. asmext : '.a';
  1346. objext : '.o';
  1347. resext : '.res';
  1348. resobjext : '.or';
  1349. exeext : '';
  1350. os : os_powerpc_macos;
  1351. assem : as_powerpc_mpw;
  1352. assemsrc : as_powerpc_mpw;
  1353. ar : ar_powerpc_ar;
  1354. res : res_powerpc_mpw;
  1355. heapsize : 256*1024;
  1356. maxheapsize : 32768*1024;
  1357. stacksize : 8192
  1358. )
  1359. {$endif}
  1360. );
  1361. {****************************************************************************
  1362. AsmModeInfo
  1363. ****************************************************************************}
  1364. asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
  1365. (
  1366. id : asmmode_none;
  1367. idtxt : 'none'
  1368. )
  1369. {$ifdef i386}
  1370. ,(
  1371. id : asmmode_i386_direct;
  1372. idtxt : 'DIRECT'
  1373. ),
  1374. (
  1375. id : asmmode_i386_att;
  1376. idtxt : 'ATT'
  1377. ),
  1378. (
  1379. id : asmmode_i386_intel;
  1380. idtxt : 'INTEL'
  1381. )
  1382. {$endif i386}
  1383. {$ifdef m68k}
  1384. ,(
  1385. id : asmmode_m68k_mot;
  1386. idtxt : 'MOT'
  1387. )
  1388. {$endif m68k}
  1389. {$ifdef alpha}
  1390. ,(
  1391. id : asmmode_alpha_direct;
  1392. idtxt : 'DIRECT'
  1393. )
  1394. {$endif}
  1395. {$ifdef powerpc}
  1396. ,(
  1397. id : asmmode_powerpc_direct;
  1398. idtxt : 'DIRECT'
  1399. )
  1400. {$endif}
  1401. );
  1402. {****************************************************************************
  1403. Helpers
  1404. ****************************************************************************}
  1405. function set_target_os(t:tos):boolean;
  1406. var
  1407. i : longint;
  1408. begin
  1409. set_target_os:=false;
  1410. { target 1 is none }
  1411. for i:=2 to oscnt do
  1412. if os_infos[i].id=t then
  1413. begin
  1414. target_os:=os_infos[i];
  1415. set_target_os:=true;
  1416. exit;
  1417. end;
  1418. end;
  1419. function set_target_asm(t:tasm):boolean;
  1420. var
  1421. i : longint;
  1422. begin
  1423. set_target_asm:=false;
  1424. for i:=1 to asmcnt do
  1425. if as_infos[i].id=t then
  1426. begin
  1427. target_asm:=as_infos[i];
  1428. set_target_asm:=true;
  1429. exit;
  1430. end;
  1431. end;
  1432. function set_target_ar(t:tar):boolean;
  1433. var
  1434. i : longint;
  1435. begin
  1436. set_target_ar:=false;
  1437. for i:=1 to arcnt do
  1438. if ar_infos[i].id=t then
  1439. begin
  1440. target_ar:=ar_infos[i];
  1441. set_target_ar:=true;
  1442. exit;
  1443. end;
  1444. end;
  1445. function set_target_res(t:tres):boolean;
  1446. var
  1447. i : longint;
  1448. begin
  1449. set_target_res:=false;
  1450. for i:=1 to rescnt do
  1451. if res_infos[i].id=t then
  1452. begin
  1453. target_res:=res_infos[i];
  1454. set_target_res:=true;
  1455. exit;
  1456. end;
  1457. end;
  1458. function set_target_info(t:ttarget):boolean;
  1459. var
  1460. i : longint;
  1461. begin
  1462. set_target_info:=false;
  1463. for i:=1 to targetcnt do
  1464. if target_infos[i].target=t then
  1465. begin
  1466. target_info:=target_infos[i];
  1467. set_target_os(target_info.os);
  1468. set_target_asm(target_info.assem);
  1469. set_target_ar(target_info.ar);
  1470. set_target_res(target_info.res);
  1471. target_path:=lower(target_info.short_name);
  1472. target_cpu:=target_info.cpu;
  1473. set_target_info:=true;
  1474. exit;
  1475. end;
  1476. end;
  1477. {****************************************************************************
  1478. Load from string
  1479. ****************************************************************************}
  1480. function set_string_target(s : string) : boolean;
  1481. var
  1482. i : longint;
  1483. begin
  1484. set_string_target:=false;
  1485. { this should be case insensitive !! PM }
  1486. s:=upper(s);
  1487. for i:=1 to targetcnt do
  1488. if target_infos[i].short_name=s then
  1489. begin
  1490. set_target_info(target_infos[i].target);
  1491. set_string_target:=true;
  1492. exit;
  1493. end;
  1494. end;
  1495. function set_string_asm(s : string) : boolean;
  1496. var
  1497. i : longint;
  1498. begin
  1499. set_string_asm:=false;
  1500. { this should be case insensitive !! PM }
  1501. s:=upper(s);
  1502. for i:=1 to asmcnt do
  1503. if as_infos[i].idtxt=s then
  1504. begin
  1505. target_asm:=as_infos[i];
  1506. set_string_asm:=true;
  1507. end;
  1508. end;
  1509. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  1510. var
  1511. i : longint;
  1512. begin
  1513. set_string_asmmode:=false;
  1514. { this should be case insensitive !! PM }
  1515. s:=upper(s);
  1516. for i:=1 to asmmodecnt do
  1517. if asmmodeinfos[i].idtxt=s then
  1518. begin
  1519. t:=asmmodeinfos[i].id;
  1520. set_string_asmmode:=true;
  1521. end;
  1522. end;
  1523. {****************************************************************************
  1524. Initialization of default target
  1525. ****************************************************************************}
  1526. procedure default_os(t:ttarget);
  1527. begin
  1528. set_target_info(t);
  1529. if source_os.name='' then
  1530. source_os:=target_os;
  1531. end;
  1532. procedure set_source_os(t:tos);
  1533. var
  1534. i : longint;
  1535. begin
  1536. { can't use message() here (PFV) }
  1537. if source_os.name<>'' then
  1538. Writeln('Warning: Source OS Redefined!');
  1539. for i:=1 to oscnt do
  1540. if os_infos[i].id=t then
  1541. begin
  1542. source_os:=os_infos[i];
  1543. exit;
  1544. end;
  1545. end;
  1546. procedure InitSystems;
  1547. begin
  1548. { first get source OS }
  1549. source_os.name:='';
  1550. { please note then we use cpu86 and cpu68 here on purpose !! }
  1551. {$ifdef cpu86}
  1552. {$ifdef GO32V1}
  1553. set_source_os(os_i386_GO32V1);
  1554. {$else}
  1555. {$ifdef GO32V2}
  1556. set_source_os(os_i386_GO32V2);
  1557. {$else}
  1558. {$ifdef OS2}
  1559. set_source_os(os_i386_OS2);
  1560. if (OS_Mode = osDOS) or (OS_Mode = osDPMI)
  1561. then source_os.scriptext := '.bat';
  1562. {OS/2 via EMX can be run under DOS as well}
  1563. {$else}
  1564. {$ifdef LINUX}
  1565. {$Ifdef BSD}
  1566. set_source_os(os_i386_FreeBSD);
  1567. {$else}
  1568. set_source_os(os_i386_LINUX);
  1569. {$endif}
  1570. {$else}
  1571. {$ifdef WIN32}
  1572. set_source_os(os_i386_WIN32);
  1573. {$endif win32}
  1574. {$endif linux}
  1575. {$endif os2}
  1576. {$endif go32v2}
  1577. {$endif go32v1}
  1578. {$endif cpu86}
  1579. {$ifdef cpu68}
  1580. {$ifdef AMIGA}
  1581. set_source_os(os_m68k_Amiga);
  1582. {$else}
  1583. {$ifdef ATARI}
  1584. set_source_os(os_m68k_Atari);
  1585. {$else}
  1586. {$ifdef MACOS}
  1587. set_source_os(os_m68k_MAC);
  1588. {$else}
  1589. {$ifdef LINUX}
  1590. set_source_os(os_m68k_linux);
  1591. {$endif linux}
  1592. {$endif macos}
  1593. {$endif atari}
  1594. {$endif amiga}
  1595. {$endif cpu68}
  1596. { Now default target !! }
  1597. {$ifdef i386}
  1598. {$ifdef GO32V1}
  1599. default_os(target_i386_GO32V1);
  1600. {$else}
  1601. {$ifdef GO32V2}
  1602. default_os(target_i386_GO32V2);
  1603. {$else}
  1604. {$ifdef OS2}
  1605. default_os(target_i386_OS2);
  1606. {$else}
  1607. {$ifdef LINUX}
  1608. {$ifdef BSD}
  1609. default_os(target_i386_FreeBSD);
  1610. {$else}
  1611. default_os(target_i386_LINUX);
  1612. {$endif}
  1613. {$else}
  1614. {$ifdef WIN32}
  1615. default_os(target_i386_WIN32);
  1616. {$else}
  1617. default_os(target_i386_GO32V2);
  1618. {$endif win32}
  1619. {$endif linux}
  1620. {$endif os2}
  1621. {$endif go32v2}
  1622. {$endif go32v1}
  1623. {$endif i386}
  1624. {$ifdef m68k}
  1625. {$ifdef AMIGA}
  1626. default_os(target_m68k_Amiga);
  1627. {$else}
  1628. {$ifdef ATARI}
  1629. default_os(target_m68k_Atari);
  1630. {$else}
  1631. {$ifdef MACOS}
  1632. default_os(target_m68k_Mac);
  1633. {$else}
  1634. {$ifdef LINUX}
  1635. default_os(target_m68k_linux);
  1636. {$else}
  1637. default_os(target_m68k_Amiga);
  1638. {$endif linux}
  1639. {$endif macos}
  1640. {$endif atari}
  1641. {$endif amiga}
  1642. {$endif m68k}
  1643. {$ifdef alpha}
  1644. default_os(target_alpha_linux);
  1645. {$endif alpha}
  1646. {$ifdef powerpc}
  1647. default_os(target_powerpc_linux);
  1648. {$endif powerpc}
  1649. end;
  1650. begin
  1651. InitSystems;
  1652. end.
  1653. {
  1654. $Log$
  1655. Revision 1.10 2000-09-24 21:12:41 hajny
  1656. * OS/2 stack alignment corrected + default stack increased
  1657. Revision 1.9 2000/09/24 15:06:30 peter
  1658. * use defines.inc
  1659. Revision 1.8 2000/09/20 10:49:39 marco
  1660. * Set writer to elf. (Only a prob for smart with -OG3p3r)
  1661. Revision 1.7 2000/09/16 12:22:52 peter
  1662. * freebsd support merged
  1663. Revision 1.6 2000/09/11 17:00:23 florian
  1664. + first implementation of Netware Module support, thanks to
  1665. Armin Diehl ([email protected]) for providing the patches
  1666. Revision 1.5 2000/08/12 19:14:59 peter
  1667. * ELF writer works now also with -g
  1668. * ELF writer is default again for linux
  1669. Revision 1.4 2000/07/14 21:29:38 michael
  1670. * Back to external assembler till peter fixes gdb
  1671. Revision 1.3 2000/07/13 12:08:28 michael
  1672. + patched to 1.1.0 with former 1.09patch from peter
  1673. Revision 1.2 2000/07/13 11:32:50 michael
  1674. + removed logs
  1675. }