systems.pas 53 KB

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