systems.pas 50 KB

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