systems.pas 51 KB

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