systems.pas 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730
  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
  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=12; {$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
  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. {$endif i386}
  712. {$ifdef m68k}
  713. ,(
  714. id : as_m68k_as;
  715. idtxt : 'AS';
  716. asmbin : 'as';
  717. asmcmd : '-o $OBJ $ASM';
  718. supported_target : target_any;
  719. allowdirect : true;
  720. externals : false;
  721. needar : true;
  722. labelprefix : '.L';
  723. comment : '# ';
  724. secnames : ('',
  725. '.text','.data','.bss',
  726. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  727. '.stab','.stabstr')
  728. )
  729. ,(
  730. id : as_m68k_gas;
  731. idtxt : 'GAS';
  732. asmbin : 'as68k'; { Gas for the Amiga}
  733. asmcmd : '--register-prefix-optional -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_mit;
  747. idtxt : 'MIT';
  748. asmbin : '';
  749. asmcmd : '-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_mot;
  763. idtxt : 'MOT';
  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_mpw;
  779. idtxt : 'MPW';
  780. asmbin : '';
  781. asmcmd : '-model far -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. {$endif m68k}
  794. {$ifdef alpha}
  795. ,(
  796. id : as_alpha_as;
  797. idtxt : 'AS';
  798. asmbin : 'as';
  799. asmcmd : '-o $OBJ $ASM';
  800. supported_target : target_any;
  801. allowdirect : true;
  802. externals : false;
  803. needar : true;
  804. labelprefix : '.L';
  805. comment : '# ';
  806. secnames : ('',
  807. '.text','.data','.bss',
  808. '','','','','','',
  809. '.stab','.stabstr')
  810. )
  811. {$endif}
  812. {$ifdef powerpc}
  813. ,(
  814. id : as_powerpc_as;
  815. idtxt : 'AS';
  816. asmbin : 'as';
  817. asmcmd : '-o $OBJ $ASM';
  818. supported_target : target_any;
  819. allowdirect : true;
  820. externals : false;
  821. needar : true;
  822. labelprefix : '.L';
  823. comment : '# ';
  824. secnames : ('',
  825. '.text','.data','.bss',
  826. '','','','','','',
  827. '.stab','.stabstr')
  828. )
  829. ,(
  830. id : as_powerpc_mpw;
  831. idtxt : 'PPCAsm';
  832. asmbin : 'PPCAsm';
  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. {$endif}
  846. );
  847. {****************************************************************************
  848. Ar Info
  849. ****************************************************************************}
  850. ar_infos : array[1..arcnt] of tarinfo = (
  851. (
  852. id : ar_none
  853. )
  854. {$ifdef i386}
  855. ,(
  856. id : ar_i386_ar;
  857. arcmd : 'ar rs $LIB $FILES'
  858. ),
  859. (
  860. id : ar_i386_arw;
  861. arcmd : 'arw rs $LIB $FILES'
  862. )
  863. {$endif i386}
  864. {$ifdef m68k}
  865. ,(
  866. id : ar_m68k_ar;
  867. arcmd : 'ar rs $LIB $FILES'
  868. )
  869. {$endif m68k}
  870. {$ifdef alpha}
  871. ,(
  872. id : ar_alpha_ar;
  873. arcmd : 'ar rs $LIB $FILES'
  874. )
  875. {$endif}
  876. {$ifdef powerpc}
  877. ,(
  878. id : ar_powerpc_ar;
  879. arcmd : 'ar rs $LIB $FILES'
  880. )
  881. {$endif}
  882. );
  883. {****************************************************************************
  884. Res Info
  885. ****************************************************************************}
  886. res_infos : array[1..rescnt] of tresinfo = (
  887. (
  888. id : res_none
  889. )
  890. {$ifdef i386}
  891. ,(
  892. id : res_i386_windres;
  893. resbin : 'windres';
  894. rescmd : '--include $INC -O coff -o $OBJ $RES'
  895. )
  896. ,(
  897. id : res_i386_emx;
  898. resbin : 'emxbind';
  899. rescmd : '-b -r $RES $OBJ'
  900. (* Not really used - see TLinkeros2.SetDefaultInfo in t_os2.pas. *)
  901. )
  902. {$endif i386}
  903. {$ifdef m68k}
  904. ,(
  905. id : res_m68k_mpw;
  906. resbin : 'rez';
  907. rescmd : '-i $INC -o $OBJ $RES'
  908. )
  909. {$endif m68}
  910. {$ifdef powerpc}
  911. ,(
  912. id : res_powerpc_mpw;
  913. resbin : 'rez';
  914. rescmd : '-i $INC -o $OBJ $RES'
  915. )
  916. {$endif powerpc}
  917. );
  918. {****************************************************************************
  919. Targets Info
  920. ****************************************************************************}
  921. target_infos : array[1..targetcnt] of ttargetinfo = (
  922. (
  923. target : target_none;
  924. flags : [];
  925. cpu : no_cpu;
  926. short_name : 'notarget'
  927. )
  928. {$ifdef i386}
  929. ,(
  930. target : target_i386_GO32V1;
  931. flags : [];
  932. cpu : i386;
  933. short_name : 'GO32V1';
  934. unit_env : 'GO32V1UNITS';
  935. system_unit : 'SYSTEM';
  936. smartext : '.sl';
  937. unitext : '.pp1';
  938. unitlibext : '.ppl';
  939. asmext : '.s1';
  940. objext : '.o1';
  941. resext : '.res';
  942. resobjext : '.o1r';
  943. exeext : ''; { The linker produces a.out }
  944. os : os_i386_GO32V1;
  945. assem : as_i386_as;
  946. assemsrc : as_i386_as;
  947. ar : ar_i386_ar;
  948. res : res_none;
  949. heapsize : 2048*1024;
  950. maxheapsize : 32768*1024;
  951. stacksize : 16384
  952. ),
  953. (
  954. target : target_i386_GO32V2;
  955. flags : [];
  956. cpu : i386;
  957. short_name : 'GO32V2';
  958. unit_env : 'GO32V2UNITS';
  959. system_unit : 'SYSTEM';
  960. smartext : '.sl';
  961. unitext : '.ppu';
  962. unitlibext : '.ppl';
  963. asmext : '.s';
  964. objext : '.o';
  965. resext : '.res';
  966. resobjext : '.or';
  967. exeext : '.exe';
  968. os : os_i386_GO32V2;
  969. assem : as_i386_coff;
  970. assemsrc : as_i386_as;
  971. ar : ar_i386_ar;
  972. res : res_none;
  973. heapsize : 2048*1024;
  974. maxheapsize : 32768*1024;
  975. stacksize : 16384
  976. ),
  977. (
  978. target : target_i386_LINUX;
  979. flags : [];
  980. cpu : i386;
  981. short_name : 'LINUX';
  982. unit_env : 'LINUXUNITS';
  983. system_unit : 'syslinux';
  984. smartext : '.sl';
  985. unitext : '.ppu';
  986. unitlibext : '.ppl';
  987. asmext : '.s';
  988. objext : '.o';
  989. resext : '.res';
  990. resobjext : '.or';
  991. exeext : '';
  992. os : os_i386_Linux;
  993. assem : as_i386_as;
  994. assemsrc : as_i386_as;
  995. ar : ar_i386_ar;
  996. res : res_none;
  997. heapsize : 256*1024;
  998. maxheapsize : 32768*1024;
  999. stacksize : 8192
  1000. ),
  1001. (
  1002. target : target_i386_OS2;
  1003. flags : [tf_need_export];
  1004. cpu : i386;
  1005. short_name : 'OS2';
  1006. unit_env : 'OS2UNITS';
  1007. system_unit : 'SYSOS2';
  1008. smartext : '.sl';
  1009. unitext : '.ppo';
  1010. unitlibext : '.ppl';
  1011. asmext : '.so2';
  1012. objext : '.oo2';
  1013. resext : '.res';
  1014. resobjext : '.oor';
  1015. exeext : ''; { The linker produces a.out }
  1016. os : os_i386_OS2;
  1017. assem : as_i386_as_aout;
  1018. assemsrc : as_i386_as_aout;
  1019. ar : ar_i386_ar;
  1020. res : res_i386_emx;
  1021. heapsize : 256*1024;
  1022. maxheapsize : 32768*1024;
  1023. stacksize : 32768
  1024. ),
  1025. (
  1026. target : target_i386_WIN32;
  1027. flags : [];
  1028. cpu : i386;
  1029. short_name : 'WIN32';
  1030. unit_env : 'WIN32UNITS';
  1031. system_unit : 'SYSWIN32';
  1032. smartext : '.slw';
  1033. unitext : '.ppw';
  1034. unitlibext : '.ppl';
  1035. asmext : '.sw';
  1036. objext : '.ow';
  1037. resext : '.rc';
  1038. resobjext : '.owr';
  1039. exeext : '.exe';
  1040. os : os_i386_Win32;
  1041. assem : as_i386_pecoff;
  1042. assemsrc : as_i386_asw;
  1043. ar : ar_i386_arw;
  1044. res : res_i386_windres;
  1045. heapsize : 256*1024;
  1046. maxheapsize : 32*1024*1024;
  1047. stacksize : 32*1024*1024
  1048. )
  1049. {$endif i386}
  1050. {$ifdef m68k}
  1051. ,(
  1052. target : target_m68k_Amiga;
  1053. flags : [];
  1054. cpu : m68k;
  1055. short_name : 'AMIGA';
  1056. unit_env : '';
  1057. system_unit : 'sysamiga';
  1058. smartext : '.sl';
  1059. unitext : '.ppa';
  1060. unitlibext : '.ppl';
  1061. asmext : '.asm';
  1062. objext : '.o';
  1063. resext : '.res';
  1064. resobjext : '.or';
  1065. exeext : '';
  1066. os : os_m68k_Amiga;
  1067. assem : as_m68k_as;
  1068. assemsrc : as_m68k_as;
  1069. ar : ar_m68k_ar;
  1070. res : res_none;
  1071. heapsize : 128*1024;
  1072. maxheapsize : 32768*1024;
  1073. stacksize : 8192
  1074. ),
  1075. (
  1076. target : target_m68k_Atari;
  1077. flags : [];
  1078. cpu : m68k;
  1079. short_name : 'ATARI';
  1080. unit_env : '';
  1081. system_unit : 'SYSATARI';
  1082. smartext : '.sl';
  1083. unitext : '.ppt';
  1084. unitlibext : '.ppl';
  1085. asmext : '.s';
  1086. objext : '.o';
  1087. resext : '.res';
  1088. resobjext : '.or';
  1089. exeext : '.ttp';
  1090. os : os_m68k_Atari;
  1091. assem : as_m68k_as;
  1092. assemsrc : as_m68k_as;
  1093. ar : ar_m68k_ar;
  1094. res : res_none;
  1095. heapsize : 16*1024;
  1096. maxheapsize : 32768*1024;
  1097. stacksize : 8192
  1098. ),
  1099. (
  1100. target : target_m68k_Mac;
  1101. flags : [];
  1102. cpu : m68k;
  1103. short_name : 'MACOS';
  1104. unit_env : '';
  1105. system_unit : 'sysmac';
  1106. smartext : '.sl';
  1107. unitext : '.ppt';
  1108. unitlibext : '.ppl';
  1109. asmext : '.a';
  1110. objext : '.o';
  1111. resext : '.res';
  1112. resobjext : '.or';
  1113. exeext : '';
  1114. os : os_m68k_Mac;
  1115. assem : as_m68k_mpw;
  1116. assemsrc : as_m68k_mpw;
  1117. ar : ar_m68k_ar;
  1118. res : res_none;
  1119. heapsize : 128*1024;
  1120. maxheapsize : 32768*1024;
  1121. stacksize : 8192
  1122. ),
  1123. (
  1124. target : target_m68k_linux;
  1125. flags : [];
  1126. cpu : m68k;
  1127. short_name : 'LINUX';
  1128. unit_env : 'LINUXUNITS';
  1129. system_unit : 'syslinux';
  1130. smartext : '.sl';
  1131. unitext : '.ppu';
  1132. unitlibext : '.ppl';
  1133. asmext : '.s';
  1134. objext : '.o';
  1135. resext : '.res';
  1136. resobjext : '.or';
  1137. exeext : '';
  1138. os : os_m68k_Linux;
  1139. assem : as_m68k_as;
  1140. assemsrc : as_m68k_as;
  1141. ar : ar_m68k_ar;
  1142. res : res_none;
  1143. heapsize : 128*1024;
  1144. maxheapsize : 32768*1024;
  1145. stacksize : 8192
  1146. ),
  1147. (
  1148. target : target_m68k_PalmOS;
  1149. flags : [];
  1150. cpu : m68k;
  1151. short_name : 'PALMOS';
  1152. unit_env : 'PALMUNITS';
  1153. system_unit : 'syspalm';
  1154. smartext : '.sl';
  1155. unitext : '.ppu';
  1156. unitlibext : '.ppl';
  1157. asmext : '.s';
  1158. objext : '.o';
  1159. resext : '.res';
  1160. resobjext : '.or';
  1161. exeext : '';
  1162. os : os_m68k_PalmOS;
  1163. assem : as_m68k_as;
  1164. assemsrc : as_m68k_as;
  1165. ar : ar_m68k_ar;
  1166. res : res_none;
  1167. heapsize : 128*1024;
  1168. maxheapsize : 32768*1024;
  1169. stacksize : 8192
  1170. )
  1171. {$endif m68k}
  1172. {$ifdef alpha}
  1173. ,(
  1174. target : target_alpha_LINUX;
  1175. flags : [];
  1176. cpu : alpha;
  1177. short_name : 'LINUX';
  1178. unit_env : 'LINUXUNITS';
  1179. system_unit : 'syslinux';
  1180. smartext : '.sl';
  1181. unitext : '.ppu';
  1182. unitlibext : '.ppl';
  1183. asmext : '.s';
  1184. objext : '.o';
  1185. resext : '.res';
  1186. resobjext : '.or';
  1187. exeext : '';
  1188. os : os_alpha_Linux;
  1189. assem : as_alpha_as;
  1190. assemsrc : as_alpha_as;
  1191. ar : ar_alpha_ar;
  1192. res : res_none;
  1193. heapsize : 256*1024;
  1194. maxheapsize : 32768*1024;
  1195. stacksize : 8192
  1196. )
  1197. {$endif}
  1198. {$ifdef powerpc}
  1199. ,(
  1200. target : target_powerpc_LINUX;
  1201. flags : [];
  1202. cpu : powerpc;
  1203. short_name : 'LINUX';
  1204. unit_env : '';
  1205. system_unit : 'syslinux';
  1206. smartext : '.sl';
  1207. unitext : '.ppu';
  1208. unitlibext : '.ppl';
  1209. asmext : '.s';
  1210. objext : '.o';
  1211. resext : '.res';
  1212. resobjext : '.or';
  1213. exeext : '';
  1214. os : os_powerpc_Linux;
  1215. assem : as_powerpc_as;
  1216. assemsrc : as_powerpc_as;
  1217. ar : ar_powerpc_ar;
  1218. res : res_none;
  1219. heapsize : 256*1024;
  1220. maxheapsize : 32768*1024;
  1221. stacksize : 8192
  1222. ),
  1223. (
  1224. target : target_powerpc_MACOS;
  1225. flags : [];
  1226. cpu : powerpc;
  1227. short_name : 'MACOS';
  1228. unit_env : '';
  1229. system_unit : 'sysmac';
  1230. smartext : '.sl';
  1231. unitext : '.ppt';
  1232. unitlibext : '.ppl';
  1233. asmext : '.a';
  1234. objext : '.o';
  1235. resext : '.res';
  1236. resobjext : '.or';
  1237. exeext : '';
  1238. os : os_powerpc_macos;
  1239. assem : as_powerpc_mpw;
  1240. assemsrc : as_powerpc_mpw;
  1241. ar : ar_powerpc_ar;
  1242. res : res_powerpc_mpw;
  1243. heapsize : 256*1024;
  1244. maxheapsize : 32768*1024;
  1245. stacksize : 8192
  1246. )
  1247. {$endif}
  1248. );
  1249. {****************************************************************************
  1250. AsmModeInfo
  1251. ****************************************************************************}
  1252. asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
  1253. (
  1254. id : asmmode_none;
  1255. idtxt : 'none'
  1256. )
  1257. {$ifdef i386}
  1258. ,(
  1259. id : asmmode_i386_direct;
  1260. idtxt : 'DIRECT'
  1261. ),
  1262. (
  1263. id : asmmode_i386_att;
  1264. idtxt : 'ATT'
  1265. ),
  1266. (
  1267. id : asmmode_i386_intel;
  1268. idtxt : 'INTEL'
  1269. )
  1270. {$endif i386}
  1271. {$ifdef m68k}
  1272. ,(
  1273. id : asmmode_m68k_mot;
  1274. idtxt : 'MOT'
  1275. )
  1276. {$endif m68k}
  1277. {$ifdef alpha}
  1278. ,(
  1279. id : asmmode_alpha_direct;
  1280. idtxt : 'DIRECT'
  1281. )
  1282. {$endif}
  1283. {$ifdef powerpc}
  1284. ,(
  1285. id : asmmode_powerpc_direct;
  1286. idtxt : 'DIRECT'
  1287. )
  1288. {$endif}
  1289. );
  1290. {****************************************************************************
  1291. Helpers
  1292. ****************************************************************************}
  1293. function upper(const s : string) : string;
  1294. var
  1295. i : longint;
  1296. begin
  1297. for i:=1 to length(s) do
  1298. if s[i] in ['a'..'z'] then
  1299. upper[i]:=char(byte(s[i])-32)
  1300. else
  1301. upper[i]:=s[i];
  1302. {$ifndef TP}
  1303. {$ifopt H+}
  1304. SetLength(upper,length(s));
  1305. {$else}
  1306. upper[0]:=s[0];
  1307. {$endif}
  1308. {$else}
  1309. upper[0]:=s[0];
  1310. {$endif}
  1311. end;
  1312. function lower(const s : string) : string;
  1313. var
  1314. i : longint;
  1315. begin
  1316. for i:=1 to length(s) do
  1317. if s[i] in ['A'..'Z'] then
  1318. lower[i]:=char(byte(s[i])+32)
  1319. else
  1320. lower[i]:=s[i];
  1321. {$ifndef TP}
  1322. {$ifopt H+}
  1323. setlength(lower,length(s));
  1324. {$else}
  1325. lower[0]:=s[0];
  1326. {$endif}
  1327. {$else}
  1328. lower[0]:=s[0];
  1329. {$endif}
  1330. end;
  1331. function set_target_os(t:tos):boolean;
  1332. var
  1333. i : longint;
  1334. begin
  1335. set_target_os:=false;
  1336. { target 1 is none }
  1337. for i:=2 to oscnt do
  1338. if os_infos[i].id=t then
  1339. begin
  1340. target_os:=os_infos[i];
  1341. set_target_os:=true;
  1342. exit;
  1343. end;
  1344. end;
  1345. function set_target_asm(t:tasm):boolean;
  1346. var
  1347. i : longint;
  1348. begin
  1349. set_target_asm:=false;
  1350. for i:=1 to asmcnt do
  1351. if as_infos[i].id=t then
  1352. begin
  1353. target_asm:=as_infos[i];
  1354. set_target_asm:=true;
  1355. exit;
  1356. end;
  1357. end;
  1358. function set_target_ar(t:tar):boolean;
  1359. var
  1360. i : longint;
  1361. begin
  1362. set_target_ar:=false;
  1363. for i:=1 to arcnt do
  1364. if ar_infos[i].id=t then
  1365. begin
  1366. target_ar:=ar_infos[i];
  1367. set_target_ar:=true;
  1368. exit;
  1369. end;
  1370. end;
  1371. function set_target_res(t:tres):boolean;
  1372. var
  1373. i : longint;
  1374. begin
  1375. set_target_res:=false;
  1376. for i:=1 to rescnt do
  1377. if res_infos[i].id=t then
  1378. begin
  1379. target_res:=res_infos[i];
  1380. set_target_res:=true;
  1381. exit;
  1382. end;
  1383. end;
  1384. function set_target_info(t:ttarget):boolean;
  1385. var
  1386. i : longint;
  1387. begin
  1388. set_target_info:=false;
  1389. for i:=1 to targetcnt do
  1390. if target_infos[i].target=t then
  1391. begin
  1392. target_info:=target_infos[i];
  1393. set_target_os(target_info.os);
  1394. set_target_asm(target_info.assem);
  1395. set_target_ar(target_info.ar);
  1396. set_target_res(target_info.res);
  1397. target_path:=lower(target_info.short_name);
  1398. target_cpu:=target_info.cpu;
  1399. set_target_info:=true;
  1400. exit;
  1401. end;
  1402. end;
  1403. {****************************************************************************
  1404. Load from string
  1405. ****************************************************************************}
  1406. function set_string_target(s : string) : boolean;
  1407. var
  1408. i : longint;
  1409. begin
  1410. set_string_target:=false;
  1411. { this should be case insensitive !! PM }
  1412. s:=upper(s);
  1413. for i:=1 to targetcnt do
  1414. if target_infos[i].short_name=s then
  1415. begin
  1416. set_target_info(target_infos[i].target);
  1417. set_string_target:=true;
  1418. exit;
  1419. end;
  1420. end;
  1421. function set_string_asm(s : string) : boolean;
  1422. var
  1423. i : longint;
  1424. begin
  1425. set_string_asm:=false;
  1426. { this should be case insensitive !! PM }
  1427. s:=upper(s);
  1428. for i:=1 to asmcnt do
  1429. if as_infos[i].idtxt=s then
  1430. begin
  1431. target_asm:=as_infos[i];
  1432. set_string_asm:=true;
  1433. end;
  1434. end;
  1435. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  1436. var
  1437. i : longint;
  1438. begin
  1439. set_string_asmmode:=false;
  1440. { this should be case insensitive !! PM }
  1441. s:=upper(s);
  1442. for i:=1 to asmmodecnt do
  1443. if asmmodeinfos[i].idtxt=s then
  1444. begin
  1445. t:=asmmodeinfos[i].id;
  1446. set_string_asmmode:=true;
  1447. end;
  1448. end;
  1449. {****************************************************************************
  1450. Initialization of default target
  1451. ****************************************************************************}
  1452. procedure default_os(t:ttarget);
  1453. begin
  1454. set_target_info(t);
  1455. if source_os.name='' then
  1456. source_os:=target_os;
  1457. end;
  1458. procedure set_source_os(t:tos);
  1459. var
  1460. i : longint;
  1461. begin
  1462. { can't use message() here (PFV) }
  1463. if source_os.name<>'' then
  1464. Writeln('Warning: Source OS Redefined!');
  1465. for i:=1 to oscnt do
  1466. if os_infos[i].id=t then
  1467. begin
  1468. source_os:=os_infos[i];
  1469. exit;
  1470. end;
  1471. end;
  1472. procedure InitSystems;
  1473. begin
  1474. { first get source OS }
  1475. source_os.name:='';
  1476. { please note then we use cpu86 and cpu68 here on purpose !! }
  1477. {$ifdef cpu86}
  1478. {$ifdef GO32V1}
  1479. set_source_os(os_i386_GO32V1);
  1480. {$else}
  1481. {$ifdef GO32V2}
  1482. set_source_os(os_i386_GO32V2);
  1483. {$else}
  1484. {$ifdef OS2}
  1485. set_source_os(os_i386_OS2);
  1486. if (OS_Mode = osDOS) or (OS_Mode = osDPMI)
  1487. then source_os.scriptext := '.bat';
  1488. {OS/2 via EMX can be run under DOS as well}
  1489. {$else}
  1490. {$ifdef LINUX}
  1491. set_source_os(os_i386_LINUX);
  1492. {$else}
  1493. {$ifdef WIN32}
  1494. set_source_os(os_i386_WIN32);
  1495. {$endif win32}
  1496. {$endif linux}
  1497. {$endif os2}
  1498. {$endif go32v2}
  1499. {$endif go32v1}
  1500. {$endif cpu86}
  1501. {$ifdef cpu68}
  1502. {$ifdef AMIGA}
  1503. set_source_os(os_m68k_Amiga);
  1504. {$else}
  1505. {$ifdef ATARI}
  1506. set_source_os(os_m68k_Atari);
  1507. {$else}
  1508. {$ifdef MACOS}
  1509. set_source_os(os_m68k_MAC);
  1510. {$else}
  1511. {$ifdef LINUX}
  1512. set_source_os(os_m68k_linux);
  1513. {$endif linux}
  1514. {$endif macos}
  1515. {$endif atari}
  1516. {$endif amiga}
  1517. {$endif cpu68}
  1518. { Now default target !! }
  1519. {$ifdef i386}
  1520. {$ifdef GO32V1}
  1521. default_os(target_i386_GO32V1);
  1522. {$else}
  1523. {$ifdef GO32V2}
  1524. default_os(target_i386_GO32V2);
  1525. {$else}
  1526. {$ifdef OS2}
  1527. default_os(target_i386_OS2);
  1528. {$else}
  1529. {$ifdef LINUX}
  1530. default_os(target_i386_LINUX);
  1531. {$else}
  1532. {$ifdef WIN32}
  1533. default_os(target_i386_WIN32);
  1534. {$else}
  1535. default_os(target_i386_GO32V2);
  1536. {$endif win32}
  1537. {$endif linux}
  1538. {$endif os2}
  1539. {$endif go32v2}
  1540. {$endif go32v1}
  1541. {$endif i386}
  1542. {$ifdef m68k}
  1543. {$ifdef AMIGA}
  1544. default_os(target_m68k_Amiga);
  1545. {$else}
  1546. {$ifdef ATARI}
  1547. default_os(target_m68k_Atari);
  1548. {$else}
  1549. {$ifdef MACOS}
  1550. default_os(target_m68k_Mac);
  1551. {$else}
  1552. {$ifdef LINUX}
  1553. default_os(target_m68k_linux);
  1554. {$else}
  1555. default_os(target_m68k_Amiga);
  1556. {$endif linux}
  1557. {$endif macos}
  1558. {$endif atari}
  1559. {$endif amiga}
  1560. {$endif m68k}
  1561. {$ifdef alpha}
  1562. default_os(target_alpha_linux);
  1563. {$endif alpha}
  1564. {$ifdef powerpc}
  1565. default_os(target_powerpc_linux);
  1566. {$endif powerpc}
  1567. end;
  1568. begin
  1569. InitSystems;
  1570. end.
  1571. {
  1572. $Log$
  1573. Revision 1.106 2000-06-25 19:08:28 hajny
  1574. + $R support for OS/2 (EMX) added
  1575. Revision 1.105 2000/06/23 21:31:18 pierre
  1576. + new target_os field: maxCstructalignment
  1577. Revision 1.104 2000/05/23 21:26:52 pierre
  1578. + added supported_target fiedl to tasminfo record
  1579. to disregard wrong assembler settings
  1580. Revision 1.103 2000/05/11 09:07:45 pierre
  1581. * change tosinfo.shortname length, reported by Kovacs Attila Zoltan
  1582. Revision 1.102 2000/04/22 14:25:03 jonas
  1583. * aasm.pas: pai_align instead of pai_align_abstract if cpu <> i386
  1584. + systems.pas: info for macos/ppc
  1585. * new/cgobj.pas: compiles again without newst define
  1586. * new/powerpc/cgcpu: generate different entry/exit code depending on
  1587. whether target_os is MacOs or Linux
  1588. Revision 1.101 2000/04/04 14:18:15 pierre
  1589. * nasmwin32 is 9 chars long, idtxt changed accordingly
  1590. Revision 1.100 2000/04/04 13:54:58 pierre
  1591. + nasmwin32 for win32 object output with nasm assembler
  1592. Revision 1.99 2000/02/09 13:23:06 peter
  1593. * log truncated
  1594. Revision 1.98 2000/01/07 01:14:42 peter
  1595. * updated copyright to 2000
  1596. Revision 1.97 1999/11/06 14:34:28 peter
  1597. * truncated log to 20 revs
  1598. Revision 1.96 1999/11/03 23:43:45 peter
  1599. * fixed ar commands
  1600. Revision 1.95 1999/10/21 14:29:37 peter
  1601. * redesigned linker object
  1602. + library support for linux (only procedures can be exported)
  1603. Revision 1.94 1999/09/15 22:09:27 florian
  1604. + rtti is now automatically generated for published classes, i.e.
  1605. they are handled like an implicit property
  1606. Revision 1.93 1999/09/15 20:24:56 daniel
  1607. + Dw switch now does something.
  1608. Revision 1.92 1999/09/07 15:02:41 pierre
  1609. * powerpc default was alpha !!
  1610. Revision 1.91 1999/08/16 15:35:29 pierre
  1611. * fix for DLL relocation problems
  1612. * external bss vars had wrong stabs for pecoff
  1613. + -WB11000000 to specify default image base, allows to
  1614. load several DLLs with debugging info included
  1615. (relocatable DLL are stripped because the relocation
  1616. of the .Stab section is misplaced by ldw)
  1617. Revision 1.90 1999/08/04 13:03:11 jonas
  1618. * all tokens now start with an underscore
  1619. * PowerPC compiles!!
  1620. Revision 1.89 1999/08/04 00:23:32 florian
  1621. * renamed i386asm and i386base to cpuasm and cpubase
  1622. Revision 1.88 1999/08/03 22:03:23 peter
  1623. * moved bitmask constants to sets
  1624. * some other type/const renamings
  1625. Revision 1.87 1999/08/03 17:09:43 florian
  1626. * the alpha compiler can be compiled now
  1627. Revision 1.86 1999/08/03 15:52:00 michael
  1628. * changed shortname for linux alpha
  1629. Revision 1.85 1999/08/03 13:50:19 michael
  1630. + Changes for alpha
  1631. Revision 1.84 1999/08/02 23:56:51 michael
  1632. + Added alpha cpu and linux for alpha os
  1633. }