systems.pas 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775
  1. {
  2. $Id$
  3. Copyright (C) 1995,97 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
  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
  39. );
  40. const
  41. {$ifdef i386} i386asmmodecnt=3; {$else} i386asmmodecnt=0; {$endif}
  42. {$ifdef m68k} m68kasmmodecnt=1; {$else} m68kasmmodecnt=0; {$endif}
  43. asmmodecnt=i386asmmodecnt+m68kasmmodecnt+1;
  44. type
  45. ttarget = (target_none
  46. ,target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
  47. target_i386_OS2,target_i386_Win32
  48. ,target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
  49. target_m68k_linux,target_m68k_PalmOS
  50. );
  51. ttargetflags = (tf_needs_isconsole,tf_supports_stack_checking);
  52. const
  53. {$ifdef i386} i386targetcnt=5; {$else} i386targetcnt=0; {$endif}
  54. {$ifdef m68k} m68ktargetcnt=5; {$else} m68ktargetcnt=0; {$endif}
  55. targetcnt=i386targetcnt+m68ktargetcnt+1;
  56. type
  57. tasm = (as_none
  58. ,as_i386_as,as_i386_as_aout,as_i386_asw,
  59. as_i386_nasmcoff,as_i386_nasmelf,as_i386_nasmobj,
  60. as_i386_tasm,as_i386_masm,
  61. as_i386_dbg,as_i386_coff,as_i386_pecoff
  62. ,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw
  63. );
  64. const
  65. {$ifdef i386} i386asmcnt=11; {$else} i386asmcnt=0; {$endif}
  66. {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
  67. asmcnt=i386asmcnt+m68kasmcnt+1;
  68. type
  69. tlink = (link_none
  70. ,link_i386_ld,link_i386_ldgo32v1,
  71. link_i386_ldgo32v2,link_i386_ldw,
  72. link_i386_ldos2
  73. ,link_m68k_ld
  74. );
  75. const
  76. {$ifdef i386} i386linkcnt=5; {$else} i386linkcnt=0; {$endif}
  77. {$ifdef m68k} m68klinkcnt=1; {$else} m68klinkcnt=0; {$endif}
  78. linkcnt=i386linkcnt+m68klinkcnt+1;
  79. type
  80. tar = (ar_none
  81. ,ar_i386_ar,ar_i386_arw
  82. ,ar_m68k_ar
  83. );
  84. const
  85. {$ifdef i386} i386arcnt=2; {$else} i386arcnt=0; {$endif}
  86. {$ifdef m68k} m68karcnt=1; {$else} m68karcnt=0; {$endif}
  87. arcnt=i386arcnt+m68karcnt+1;
  88. type
  89. tres = (res_none
  90. ,res_i386_windres
  91. );
  92. const
  93. {$ifdef i386} i386rescnt=1; {$else} i386rescnt=0; {$endif}
  94. {$ifdef m68k} m68krescnt=0; {$else} m68krescnt=0; {$endif}
  95. rescnt=i386rescnt+m68krescnt+1;
  96. type
  97. tos = ( os_none,
  98. os_i386_GO32V1,os_i386_GO32V2,os_i386_Linux,os_i386_OS2,
  99. os_i386_Win32,
  100. os_m68k_Amiga,os_m68k_Atari,os_m68k_Mac,os_m68k_Linux,
  101. os_m68k_PalmOS
  102. );
  103. const
  104. i386oscnt=5;
  105. m68koscnt=5;
  106. oscnt=i386oscnt+m68koscnt+1;
  107. type
  108. tosinfo = packed record
  109. id : tos;
  110. name : string[30];
  111. shortname : string[8];
  112. sharedlibext : string[10];
  113. staticlibext,
  114. sourceext,
  115. pasext,
  116. exeext,
  117. defext,
  118. scriptext : string[4];
  119. libprefix : string[3];
  120. Cprefix : string[2];
  121. newline : string[2];
  122. endian : tendian;
  123. stackalignment : {longint this is a little overkill no ?? }byte;
  124. size_of_pointer : byte;
  125. size_of_longint : byte;
  126. use_bound_instruction : boolean;
  127. use_function_relative_addresses : boolean;
  128. end;
  129. tasminfo = packed record
  130. id : tasm;
  131. idtxt : string[8];
  132. asmbin : string[8];
  133. asmcmd : string[50];
  134. allowdirect,
  135. externals,
  136. needar : boolean;
  137. labelprefix : string[2];
  138. comment : string[2];
  139. secnames : array[tsection] of string[20];
  140. end;
  141. tlinkinfo = packed record
  142. id : tlink;
  143. linkbin : string[8];
  144. linkcmd : string[127];
  145. binders : word;
  146. bindbin : array[1..2]of string[8];
  147. bindcmd : array[1..2]of string[127];
  148. stripopt : string[2];
  149. libpathprefix : string[13];
  150. libpathsuffix : string[2];
  151. groupstart : string[8];
  152. groupend : string[2];
  153. inputstart : string[8];
  154. inputend : string[2];
  155. libprefix : string[2];
  156. end;
  157. tarinfo = packed record
  158. id : tar;
  159. arbin : string[8];
  160. arcmd : string[50];
  161. end;
  162. tresinfo = packed record
  163. id : tres;
  164. resbin : string[8];
  165. rescmd : string[50];
  166. end;
  167. ttargetinfo = packed record
  168. target : ttarget;
  169. flags : set of ttargetflags;
  170. cpu : ttargetcpu;
  171. short_name : string[8];
  172. unit_env : string[12];
  173. system_unit : string[8];
  174. smartext,
  175. unitext,
  176. unitlibext,
  177. asmext,
  178. objext,
  179. resext,
  180. resobjext,
  181. exeext : string[4];
  182. os : tos;
  183. link : tlink;
  184. assem : tasm;
  185. ar : tar;
  186. res : tres;
  187. heapsize,
  188. maxheapsize,
  189. stacksize : longint;
  190. end;
  191. tasmmodeinfo=packed record
  192. id : tasmmode;
  193. idtxt : string[8];
  194. end;
  195. var
  196. target_cpu : ttargetcpu;
  197. target_info : ttargetinfo;
  198. target_os : tosinfo;
  199. target_asm : tasminfo;
  200. target_link : tlinkinfo;
  201. target_ar : tarinfo;
  202. target_res : tresinfo;
  203. source_os : tosinfo;
  204. function set_string_target(s : string) : boolean;
  205. function set_string_asm(s : string) : boolean;
  206. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  207. procedure InitSystems;
  208. implementation
  209. const
  210. {****************************************************************************
  211. OS Info
  212. ****************************************************************************}
  213. os_infos : array[1..oscnt] of tosinfo = (
  214. (
  215. id : os_none;
  216. name : 'No operating system';
  217. shortname : 'none'
  218. ),
  219. (
  220. id : os_i386_go32v1;
  221. name : 'GO32 V1 DOS extender';
  222. shortname : 'go32v1';
  223. sharedlibext : '.dll';
  224. staticlibext : '.a';
  225. sourceext : '.pp';
  226. pasext : '.pas';
  227. exeext : ''; { No .exe, the linker only output a.out ! }
  228. defext : '.def';
  229. scriptext : '.bat';
  230. libprefix : '';
  231. Cprefix : '_';
  232. newline : #13#10;
  233. endian : endian_little;
  234. stackalignment : 2;
  235. size_of_pointer : 4;
  236. size_of_longint : 4;
  237. use_bound_instruction : false;
  238. use_function_relative_addresses : true
  239. ),
  240. (
  241. id : os_i386_go32v2;
  242. name : 'GO32 V2 DOS extender';
  243. shortname : 'go32v2';
  244. sharedlibext : '.dll';
  245. staticlibext : '.a';
  246. sourceext : '.pp';
  247. pasext : '.pas';
  248. exeext : '.exe';
  249. defext : '.def';
  250. scriptext : '.bat';
  251. libprefix : '';
  252. Cprefix : '_';
  253. newline : #13#10;
  254. endian : endian_little;
  255. stackalignment : 2;
  256. size_of_pointer : 4;
  257. size_of_longint : 4;
  258. use_bound_instruction : false;
  259. use_function_relative_addresses : true
  260. ),
  261. (
  262. id : os_i386_linux;
  263. name : 'Linux for i386';
  264. shortname : 'linux';
  265. sharedlibext : '.so';
  266. staticlibext : '.a';
  267. sourceext : '.pp';
  268. pasext : '.pas';
  269. exeext : '';
  270. defext : '.def';
  271. scriptext : '.sh';
  272. libprefix : 'lib';
  273. Cprefix : '';
  274. newline : #10;
  275. endian : endian_little;
  276. stackalignment : 4;
  277. size_of_pointer : 4;
  278. size_of_longint : 4;
  279. use_bound_instruction : false;
  280. use_function_relative_addresses : true
  281. ),
  282. (
  283. id : os_i386_os2;
  284. name : 'OS/2 via EMX';
  285. shortname : 'os2';
  286. sharedlibext : '.ao2';
  287. staticlibext : '.ao2';
  288. sourceext : '.pas';
  289. pasext : '.pp';
  290. exeext : '.exe';
  291. defext : '.def';
  292. scriptext : '.cmd';
  293. libprefix : '';
  294. Cprefix : '_';
  295. newline : #13#10;
  296. endian : endian_little;
  297. stackalignment : 2;
  298. size_of_pointer : 4;
  299. size_of_longint : 4;
  300. use_bound_instruction : false;
  301. use_function_relative_addresses : false
  302. ),
  303. (
  304. id : os_i386_win32;
  305. name : 'Win32 for i386';
  306. shortname : 'win32';
  307. sharedlibext : '.dll';
  308. staticlibext : '.aw';
  309. sourceext : '.pp';
  310. pasext : '.pas';
  311. exeext : '.exe';
  312. defext : '.def';
  313. scriptext : '.bat';
  314. libprefix : 'lib';
  315. Cprefix : '_';
  316. newline : #13#10;
  317. endian : endian_little;
  318. stackalignment : 4;
  319. size_of_pointer : 4;
  320. size_of_longint : 4;
  321. use_bound_instruction : false;
  322. use_function_relative_addresses : true
  323. ),
  324. (
  325. id : os_m68k_amiga;
  326. name : 'Commodore Amiga';
  327. shortname : 'amiga';
  328. sharedlibext : '.library';
  329. staticlibext : '.a';
  330. sourceext : '.pp';
  331. pasext : '.pas';
  332. exeext : '';
  333. defext : '';
  334. scriptext : '';
  335. libprefix : '';
  336. Cprefix : '_';
  337. newline : #10;
  338. endian : endian_big;
  339. stackalignment : 2;
  340. size_of_pointer : 4;
  341. size_of_longint : 4;
  342. use_bound_instruction : false;
  343. use_function_relative_addresses : false
  344. ),
  345. (
  346. id : os_m68k_atari;
  347. name : 'Atari ST/STE';
  348. shortname : 'atari';
  349. sharedlibext : '.dll';
  350. staticlibext : '.a';
  351. sourceext : '.pp';
  352. pasext : '.pas';
  353. exeext : '.tpp';
  354. defext : '';
  355. scriptext : '';
  356. libprefix : '';
  357. Cprefix : '_';
  358. newline : #10;
  359. endian : endian_big;
  360. stackalignment : 2;
  361. size_of_pointer : 4;
  362. size_of_longint : 4;
  363. use_bound_instruction : false;
  364. use_function_relative_addresses : false
  365. ),
  366. (
  367. id : os_m68k_mac;
  368. name : 'Macintosh m68k';
  369. shortname : 'mac';
  370. sharedlibext : '.dll';
  371. staticlibext : '.a';
  372. sourceext : '.pp';
  373. pasext : '.pas';
  374. exeext : '.tpp';
  375. defext : '';
  376. scriptext : '';
  377. libprefix : '';
  378. Cprefix : '_';
  379. newline : #13;
  380. endian : endian_big;
  381. stackalignment : 2;
  382. size_of_pointer : 4;
  383. size_of_longint : 4;
  384. use_bound_instruction : false;
  385. use_function_relative_addresses : false
  386. ),
  387. (
  388. id : os_m68k_linux;
  389. name : 'Linux for m68k';
  390. shortname : 'linux';
  391. sharedlibext : '.so';
  392. staticlibext : '.a';
  393. sourceext : '.pp';
  394. pasext : '.pas';
  395. exeext : '';
  396. defext : '';
  397. scriptext : '.sh';
  398. libprefix : 'lib';
  399. Cprefix : '';
  400. newline : #10;
  401. endian : endian_big;
  402. stackalignment : 2;
  403. size_of_pointer : 4;
  404. size_of_longint : 4;
  405. use_bound_instruction : false;
  406. use_function_relative_addresses : true
  407. ),
  408. (
  409. id : os_m68k_palmos;
  410. name : 'PalmOS';
  411. shortname : 'palmos';
  412. sharedlibext : '.so';
  413. staticlibext : '.a';
  414. sourceext : '.pp';
  415. pasext : '.pas';
  416. exeext : '';
  417. defext : '';
  418. scriptext : '.sh';
  419. libprefix : 'lib';
  420. Cprefix : '_';
  421. newline : #10;
  422. endian : endian_big;
  423. stackalignment : 2;
  424. size_of_pointer : 4;
  425. size_of_longint : 4;
  426. use_bound_instruction : false;
  427. use_function_relative_addresses : false
  428. )
  429. );
  430. {****************************************************************************
  431. Assembler Info
  432. ****************************************************************************}
  433. as_infos : array[1..asmcnt] of tasminfo = (
  434. (
  435. id : as_none;
  436. idtxt : 'no'
  437. )
  438. {$ifdef i386}
  439. ,(
  440. id : as_i386_as;
  441. idtxt : 'AS';
  442. asmbin : 'as';
  443. asmcmd : '-o $OBJ $ASM';
  444. allowdirect : true;
  445. externals : false;
  446. needar : true;
  447. labelprefix : '.L';
  448. comment : '# ';
  449. secnames : ('',
  450. '.text','.data','.bss',
  451. '','','','','','',
  452. '.stab','.stabstr')
  453. )
  454. ,(
  455. id : as_i386_as_aout;
  456. idtxt : 'AS_AOUT';
  457. asmbin : 'as';
  458. asmcmd : '-o $OBJ $ASM';
  459. allowdirect : true;
  460. externals : false;
  461. needar : true;
  462. labelprefix : 'L';
  463. comment : '# ';
  464. secnames : ('',
  465. '.text','.data','.bss',
  466. '','','','','','',
  467. '.stab','.stabstr')
  468. )
  469. ,(
  470. id : as_i386_asw;
  471. idtxt : 'ASW';
  472. asmbin : 'asw';
  473. asmcmd : '-o $OBJ $ASM';
  474. allowdirect : true;
  475. externals : false;
  476. needar : true;
  477. labelprefix : '.L';
  478. comment : '# ';
  479. secnames : ('',
  480. '.text','.data','.section .bss',
  481. '.section .idata$2','.section .idata$4','.section .idata$5',
  482. '.section .idata$6','.section .idata$7','.section .edata',
  483. '.stab','.stabstr')
  484. )
  485. ,(
  486. id : as_i386_nasmcoff;
  487. idtxt : 'NASMCOFF';
  488. asmbin : 'nasm';
  489. asmcmd : '-f coff -o $OBJ $ASM';
  490. allowdirect : true;
  491. externals : true;
  492. needar : true;
  493. labelprefix : 'L';
  494. comment : '; ';
  495. secnames : ('',
  496. '.text','.data','.bss',
  497. '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
  498. '.stab','.stabstr')
  499. )
  500. ,(
  501. id : as_i386_nasmelf;
  502. idtxt : 'NASMELF';
  503. asmbin : 'nasm';
  504. asmcmd : '-f elf -o $OBJ $ASM';
  505. allowdirect : true;
  506. externals : true;
  507. needar : true;
  508. labelprefix : 'L';
  509. comment : '; ';
  510. secnames : ('',
  511. '.text','.data','.bss',
  512. '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
  513. '.stab','.stabstr')
  514. )
  515. ,(
  516. id : as_i386_nasmobj;
  517. idtxt : 'NASMOBJ';
  518. asmbin : 'nasm';
  519. asmcmd : '-f obj -o $OBJ $ASM';
  520. allowdirect : true;
  521. externals : true;
  522. needar : true;
  523. labelprefix : 'L';
  524. comment : '; ';
  525. secnames : ('',
  526. '.text','.data','.bss',
  527. '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
  528. '.stab','.stabstr')
  529. )
  530. ,(
  531. id : as_i386_tasm;
  532. idtxt : 'TASM';
  533. asmbin : 'tasm';
  534. asmcmd : '/m2 $ASM $OBJ';
  535. allowdirect : true;
  536. externals : true;
  537. needar : true;
  538. labelprefix : '@@';
  539. comment : '; ';
  540. secnames : ('',
  541. 'CODE','DATA','BSS',
  542. '','','','','','',
  543. '','')
  544. )
  545. ,(
  546. id : as_i386_masm;
  547. idtxt : 'MASM';
  548. asmbin : 'masm';
  549. asmcmd : '$ASM $OBJ';
  550. allowdirect : true;
  551. externals : true;
  552. needar : true;
  553. labelprefix : '.L';
  554. comment : '; ';
  555. secnames : ('',
  556. 'CODE','DATA','BSS',
  557. '','','','','','',
  558. '','')
  559. )
  560. ,(
  561. id : as_i386_dbg;
  562. idtxt : 'DBG';
  563. asmbin : '';
  564. asmcmd : '';
  565. allowdirect : false;
  566. externals : true;
  567. needar : false;
  568. labelprefix : 'L';
  569. comment : '';
  570. secnames : ('',
  571. '.text','.data','.bss',
  572. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  573. '.stab','.stabstr')
  574. )
  575. ,(
  576. id : as_i386_coff;
  577. idtxt : 'COFF';
  578. asmbin : '';
  579. asmcmd : '';
  580. allowdirect : false;
  581. externals : true;
  582. needar : false;
  583. labelprefix : '.L';
  584. comment : '';
  585. secnames : ('',
  586. '.text','.data','.bss',
  587. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  588. '.stab','.stabstr')
  589. )
  590. ,(
  591. id : as_i386_pecoff;
  592. idtxt : 'PECOFF';
  593. asmbin : '';
  594. asmcmd : '';
  595. allowdirect : false;
  596. externals : true;
  597. needar : false;
  598. labelprefix : '.L';
  599. comment : '';
  600. secnames : ('',
  601. '.text','.data','.bss',
  602. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  603. '.stab','.stabstr')
  604. )
  605. {$endif i386}
  606. {$ifdef m68k}
  607. ,(
  608. id : as_m68k_as;
  609. idtxt : 'AS';
  610. asmbin : 'as';
  611. asmcmd : '-o $OBJ $ASM';
  612. allowdirect : true;
  613. externals : false;
  614. needar : true;
  615. labelprefix : '.L';
  616. comment : '# ';
  617. secnames : ('',
  618. '.text','.data','.bss',
  619. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  620. '.stab','.stabstr')
  621. )
  622. ,(
  623. id : as_m68k_gas;
  624. idtxt : 'GAS';
  625. asmbin : 'as68k'; { Gas for the Amiga}
  626. asmcmd : '--register-prefix-optional -o $OBJ $ASM';
  627. allowdirect : true;
  628. externals : false;
  629. needar : true;
  630. labelprefix : '.L';
  631. comment : '| ';
  632. secnames : ('',
  633. '.text','.data','.bss',
  634. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  635. '.stab','.stabstr')
  636. )
  637. ,(
  638. id : as_m68k_mit;
  639. idtxt : 'MIT';
  640. asmbin : '';
  641. asmcmd : '-o $OBJ $ASM';
  642. allowdirect : true;
  643. externals : false;
  644. needar : true;
  645. labelprefix : '.L';
  646. comment : '| ';
  647. secnames : ('',
  648. '.text','.data','.bss',
  649. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  650. '.stab','.stabstr')
  651. )
  652. ,(
  653. id : as_m68k_mot;
  654. idtxt : 'MOT';
  655. asmbin : '';
  656. asmcmd : '-o $OBJ $ASM';
  657. allowdirect : true;
  658. externals : false;
  659. needar : true;
  660. labelprefix : '__L';
  661. comment : '| ';
  662. secnames : ('',
  663. '.text','.data','.bss',
  664. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  665. '.stab','.stabstr')
  666. )
  667. ,(
  668. id : as_m68k_mpw;
  669. idtxt : 'MPW';
  670. asmbin : '';
  671. asmcmd : '-model far -o $OBJ $ASM';
  672. allowdirect : true;
  673. externals : false;
  674. needar : true;
  675. labelprefix : '__L';
  676. comment : '| ';
  677. secnames : ('',
  678. '.text','.data','.bss',
  679. '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
  680. '.stab','.stabstr')
  681. )
  682. {$endif m68k}
  683. );
  684. {****************************************************************************
  685. Linker Info
  686. ****************************************************************************}
  687. link_infos : array[1..linkcnt] of tlinkinfo = (
  688. (
  689. id : link_none
  690. )
  691. {$ifdef i386}
  692. ,(
  693. id : link_i386_ld;
  694. linkbin : 'ld';
  695. linkcmd : '$OPT -o $EXE $RES';
  696. binders : 0;
  697. bindbin : ('','');
  698. bindcmd : ('','');
  699. stripopt : '-s';
  700. libpathprefix : 'SEARCH_DIR(';
  701. libpathsuffix : ')';
  702. groupstart : 'GROUP(';
  703. groupend : ')';
  704. inputstart : 'INPUT(';
  705. inputend : ')';
  706. libprefix : '-l'
  707. )
  708. ,(
  709. id : link_i386_ldgo32v1;
  710. linkbin : 'ld';
  711. linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
  712. binders : 1;
  713. bindbin : ('aout2exe','');
  714. bindcmd : ('$EXE','');
  715. stripopt : '-s';
  716. libpathprefix : '-L';
  717. libpathsuffix : '';
  718. groupstart : '-(';
  719. groupend : '-)';
  720. inputstart : '';
  721. inputend : '';
  722. libprefix : '-l'
  723. )
  724. ,(
  725. id : link_i386_ldgo32v2;
  726. linkbin : 'ld';
  727. linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
  728. binders:0;
  729. bindbin : ('','');
  730. bindcmd : ('','');
  731. stripopt : '-s';
  732. libpathprefix : '-L';
  733. libpathsuffix : '';
  734. groupstart : '-(';
  735. groupend : '-)';
  736. inputstart : '';
  737. inputend : '';
  738. libprefix : '-l'
  739. )
  740. ,(
  741. id : link_i386_ldw;
  742. linkbin : 'ldw';
  743. linkcmd : '$OPT -o $EXE $RES';
  744. binders : 0;
  745. bindbin : ('dlltool','ldw');
  746. bindcmd : ('--as asw.exe --dllname $EXE --output-exp exp.$$$',
  747. '-s $OPT -o $EXE $RES exp.$$$');
  748. stripopt : '-s';
  749. libpathprefix : 'SEARCH_DIR(';
  750. libpathsuffix : ')';
  751. groupstart : 'GROUP(';
  752. groupend : ')';
  753. inputstart : 'INPUT(';
  754. inputend : ')';
  755. libprefix : '-l'
  756. )
  757. ,(
  758. id : link_i386_ldos2;
  759. linkbin : 'ld'; { Os/2 }
  760. linkcmd : '-o $EXE @$RES';
  761. binders : 1;
  762. bindbin : ('emxbind','');
  763. bindcmd : ('-b -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB','');
  764. stripopt : '-s';
  765. libpathprefix : '-L';
  766. libpathsuffix : '';
  767. groupstart : ''; {Linker is too primitive...}
  768. groupend : '';
  769. inputstart : '';
  770. inputend : '';
  771. libprefix : '-l'
  772. )
  773. {$endif i386}
  774. {$ifdef m68k}
  775. ,(
  776. id : link_m68k_ld;
  777. linkbin : 'ld';
  778. linkcmd : '$OPT -o $EXE $RES';
  779. binders:0;
  780. bindbin : ('','');
  781. bindcmd : ('','');
  782. stripopt : '-s';
  783. libpathprefix : 'SEARCH_DIR(';
  784. libpathsuffix : ')';
  785. groupstart : 'GROUP(';
  786. groupend : ')';
  787. inputstart : 'INPUT(';
  788. inputend : ')';
  789. libprefix : '-l'
  790. )
  791. {$endif m68k}
  792. );
  793. {****************************************************************************
  794. Ar Info
  795. ****************************************************************************}
  796. ar_infos : array[1..arcnt] of tarinfo = (
  797. (
  798. id : ar_none
  799. )
  800. {$ifdef i386}
  801. ,(
  802. id : ar_i386_ar;
  803. arbin : 'ar';
  804. arcmd : 'rs $LIB $FILES'
  805. ),
  806. (
  807. id : ar_i386_arw;
  808. arbin : 'arw';
  809. arcmd : 'rs $LIB $FILES'
  810. )
  811. {$endif i386}
  812. {$ifdef m68k}
  813. ,(
  814. id : ar_m68k_ar;
  815. arbin : 'ar';
  816. arcmd : 'rs $LIB $FILES'
  817. )
  818. {$endif m68k}
  819. );
  820. {****************************************************************************
  821. Res Info
  822. ****************************************************************************}
  823. res_infos : array[1..rescnt] of tresinfo = (
  824. (
  825. id : res_none
  826. )
  827. {$ifdef i386}
  828. ,(
  829. id : res_i386_windres;
  830. resbin : 'windres';
  831. rescmd : '--include $INC -O coff -o $OBJ $RES'
  832. )
  833. {$endif i386}
  834. );
  835. {****************************************************************************
  836. Targets Info
  837. ****************************************************************************}
  838. target_infos : array[1..targetcnt] of ttargetinfo = (
  839. (
  840. target : target_none;
  841. flags : [];
  842. cpu : no_cpu;
  843. short_name : 'notarget'
  844. )
  845. {$ifdef i386}
  846. ,(
  847. target : target_i386_GO32V1;
  848. flags : [];
  849. cpu : i386;
  850. short_name : 'GO32V1';
  851. unit_env : 'GO32V1UNITS';
  852. system_unit : 'SYSTEM';
  853. smartext : '.sl';
  854. unitext : '.pp1';
  855. unitlibext : '.ppl';
  856. asmext : '.s1';
  857. objext : '.o1';
  858. resext : '.res';
  859. resobjext : '.o1r';
  860. exeext : ''; { The linker produces a.out }
  861. os : os_i386_GO32V1;
  862. link : link_i386_ldgo32v1;
  863. assem : as_i386_as;
  864. ar : ar_i386_ar;
  865. res : res_none;
  866. heapsize : 2048*1024;
  867. maxheapsize : 32768*1024;
  868. stacksize : 16384
  869. ),
  870. (
  871. target : target_i386_GO32V2;
  872. flags : [];
  873. cpu : i386;
  874. short_name : 'GO32V2';
  875. unit_env : 'GO32V2UNITS';
  876. system_unit : 'SYSTEM';
  877. smartext : '.sl';
  878. unitext : '.ppu';
  879. unitlibext : '.ppl';
  880. asmext : '.s';
  881. objext : '.o';
  882. resext : '.res';
  883. resobjext : '.or';
  884. exeext : '.exe';
  885. os : os_i386_GO32V2;
  886. link : link_i386_ldgo32v2;
  887. {$ifndef OLDASM}
  888. assem : as_i386_coff;
  889. {$else}
  890. assem : as_i386_as;
  891. {$endif}
  892. ar : ar_i386_ar;
  893. res : res_none;
  894. heapsize : 2048*1024;
  895. maxheapsize : 32768*1024;
  896. stacksize : 16384
  897. ),
  898. (
  899. target : target_i386_LINUX;
  900. flags : [];
  901. cpu : i386;
  902. short_name : 'LINUX';
  903. unit_env : 'LINUXUNITS';
  904. system_unit : 'syslinux';
  905. smartext : '.sl';
  906. unitext : '.ppu';
  907. unitlibext : '.ppl';
  908. asmext : '.s';
  909. objext : '.o';
  910. resext : '.res';
  911. resobjext : '.or';
  912. exeext : '';
  913. os : os_i386_Linux;
  914. link : link_i386_ld;
  915. assem : as_i386_as;
  916. ar : ar_i386_ar;
  917. res : res_none;
  918. heapsize : 2048*1024;
  919. maxheapsize : 32768*1024;
  920. stacksize : 8192
  921. ),
  922. (
  923. target : target_i386_OS2;
  924. flags : [];
  925. cpu : i386;
  926. short_name : 'OS2';
  927. unit_env : 'OS2UNITS';
  928. system_unit : 'SYSOS2';
  929. smartext : '.sl';
  930. unitext : '.ppo';
  931. unitlibext : '.ppl';
  932. asmext : '.so2';
  933. objext : '.oo2';
  934. resext : '.res';
  935. resobjext : '.oor';
  936. exeext : ''; { The linker produces a.out }
  937. os : os_i386_OS2;
  938. link : link_i386_ldos2;
  939. assem : as_i386_as_aout;
  940. ar : ar_i386_ar;
  941. res : res_none;
  942. heapsize : 256*1024;
  943. maxheapsize : 32768*1024;
  944. stacksize : 32768
  945. ),
  946. (
  947. target : target_i386_WIN32;
  948. flags : [];
  949. cpu : i386;
  950. short_name : 'WIN32';
  951. unit_env : 'WIN32UNITS';
  952. system_unit : 'SYSWIN32';
  953. smartext : '.slw';
  954. unitext : '.ppw';
  955. unitlibext : '.ppl';
  956. asmext : '.sw';
  957. objext : '.ow';
  958. resext : '.rc';
  959. resobjext : '.owr';
  960. exeext : '.exe';
  961. os : os_i386_Win32;
  962. link : link_i386_ldw;
  963. {$ifdef PECOFF}
  964. assem : as_i386_pecoff;
  965. {$else}
  966. assem : as_i386_asw;
  967. {$endif}
  968. ar : ar_i386_arw;
  969. res : res_i386_windres;
  970. heapsize : 2048*1024;
  971. maxheapsize : 32768*1024;
  972. stacksize : 32768
  973. )
  974. {$endif i386}
  975. {$ifdef m68k}
  976. ,(
  977. target : target_m68k_Amiga;
  978. flags : [];
  979. cpu : m68k;
  980. short_name : 'AMIGA';
  981. unit_env : '';
  982. system_unit : 'sysamiga';
  983. smartext : '.sl';
  984. unitext : '.ppa';
  985. unitlibext : '.ppl';
  986. asmext : '.asm';
  987. objext : '.o';
  988. resext : '.res';
  989. resobjext : '.or';
  990. exeext : '';
  991. os : os_m68k_Amiga;
  992. link : link_m68k_ld;
  993. assem : as_m68k_as;
  994. ar : ar_m68k_ar;
  995. res : res_none;
  996. heapsize : 128*1024;
  997. maxheapsize : 32768*1024;
  998. stacksize : 8192
  999. ),
  1000. (
  1001. target : target_m68k_Atari;
  1002. flags : [];
  1003. cpu : m68k;
  1004. short_name : 'ATARI';
  1005. unit_env : '';
  1006. system_unit : 'SYSATARI';
  1007. smartext : '.sl';
  1008. unitext : '.ppt';
  1009. unitlibext : '.ppl';
  1010. asmext : '.s';
  1011. objext : '.o';
  1012. resext : '.res';
  1013. resobjext : '.or';
  1014. exeext : '.ttp';
  1015. os : os_m68k_Atari;
  1016. link : link_m68k_ld;
  1017. assem : as_m68k_as;
  1018. ar : ar_m68k_ar;
  1019. res : res_none;
  1020. heapsize : 16*1024;
  1021. maxheapsize : 32768*1024;
  1022. stacksize : 8192
  1023. ),
  1024. (
  1025. target : target_m68k_Mac;
  1026. flags : [];
  1027. cpu : m68k;
  1028. short_name : 'MACOS';
  1029. unit_env : '';
  1030. system_unit : 'sysmac';
  1031. smartext : '.sl';
  1032. unitext : '.ppt';
  1033. unitlibext : '.ppl';
  1034. asmext : '.a';
  1035. objext : '.o';
  1036. resext : '.res';
  1037. resobjext : '.or';
  1038. exeext : '';
  1039. os : os_m68k_Mac;
  1040. link : link_m68k_ld;
  1041. assem : as_m68k_mpw;
  1042. ar : ar_m68k_ar;
  1043. res : res_none;
  1044. heapsize : 128*1024;
  1045. maxheapsize : 32768*1024;
  1046. stacksize : 8192
  1047. ),
  1048. (
  1049. target : target_m68k_linux;
  1050. flags : [];
  1051. cpu : m68k;
  1052. short_name : 'LINUX';
  1053. unit_env : 'LINUXUNITS';
  1054. system_unit : 'syslinux';
  1055. smartext : '.sl';
  1056. unitext : '.ppu';
  1057. unitlibext : '.ppl';
  1058. asmext : '.s';
  1059. objext : '.o';
  1060. resext : '.res';
  1061. resobjext : '.or';
  1062. exeext : '';
  1063. os : os_m68k_Linux;
  1064. link : link_m68k_ld;
  1065. assem : as_m68k_as;
  1066. ar : ar_m68k_ar;
  1067. res : res_none;
  1068. heapsize : 128*1024;
  1069. maxheapsize : 32768*1024;
  1070. stacksize : 8192
  1071. ),
  1072. (
  1073. target : target_m68k_PalmOS;
  1074. flags : [];
  1075. cpu : m68k;
  1076. short_name : 'PALMOS';
  1077. unit_env : 'PALMUNITS';
  1078. system_unit : 'syspalm';
  1079. smartext : '.sl';
  1080. unitext : '.ppu';
  1081. unitlibext : '.ppl';
  1082. asmext : '.s';
  1083. objext : '.o';
  1084. resext : '.res';
  1085. resobjext : '.or';
  1086. exeext : '';
  1087. os : os_m68k_PalmOS;
  1088. link : link_m68k_ld;
  1089. assem : as_m68k_as;
  1090. ar : ar_m68k_ar;
  1091. res : res_none;
  1092. heapsize : 128*1024;
  1093. maxheapsize : 32768*1024;
  1094. stacksize : 8192
  1095. )
  1096. {$endif m68k}
  1097. );
  1098. {****************************************************************************
  1099. AsmModeInfo
  1100. ****************************************************************************}
  1101. asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
  1102. (
  1103. id : asmmode_none;
  1104. idtxt : 'none'
  1105. )
  1106. {$ifdef i386}
  1107. ,(
  1108. id : asmmode_i386_direct;
  1109. idtxt : 'DIRECT'
  1110. ),
  1111. (
  1112. id : asmmode_i386_att;
  1113. idtxt : 'ATT'
  1114. ),
  1115. (
  1116. id : asmmode_i386_intel;
  1117. idtxt : 'INTEL'
  1118. )
  1119. {$endif i386}
  1120. {$ifdef m68k}
  1121. ,(
  1122. id : asmmode_m68k_mot;
  1123. idtxt : 'MOT'
  1124. )
  1125. {$endif m68k}
  1126. );
  1127. {****************************************************************************
  1128. Helpers
  1129. ****************************************************************************}
  1130. function upper(const s : string) : string;
  1131. var
  1132. i : longint;
  1133. begin
  1134. for i:=1 to length(s) do
  1135. if s[i] in ['a'..'z'] then
  1136. upper[i]:=char(byte(s[i])-32)
  1137. else
  1138. upper[i]:=s[i];
  1139. {$ifndef TP}
  1140. {$ifopt H+}
  1141. SetLength(upper,length(s));
  1142. {$else}
  1143. upper[0]:=s[0];
  1144. {$endif}
  1145. {$else}
  1146. upper[0]:=s[0];
  1147. {$endif}
  1148. end;
  1149. function set_target_os(t:tos):boolean;
  1150. var
  1151. i : longint;
  1152. begin
  1153. set_target_os:=false;
  1154. { target 1 is none }
  1155. for i:=2 to oscnt do
  1156. if os_infos[i].id=t then
  1157. begin
  1158. target_os:=os_infos[i];
  1159. set_target_os:=true;
  1160. exit;
  1161. end;
  1162. end;
  1163. function set_target_asm(t:tasm):boolean;
  1164. var
  1165. i : longint;
  1166. begin
  1167. set_target_asm:=false;
  1168. for i:=1 to asmcnt do
  1169. if as_infos[i].id=t then
  1170. begin
  1171. target_asm:=as_infos[i];
  1172. set_target_asm:=true;
  1173. exit;
  1174. end;
  1175. end;
  1176. function set_target_link(t:tlink):boolean;
  1177. var
  1178. i : longint;
  1179. begin
  1180. set_target_link:=false;
  1181. for i:=1 to linkcnt do
  1182. if link_infos[i].id=t then
  1183. begin
  1184. target_link:=link_infos[i];
  1185. set_target_link:=true;
  1186. exit;
  1187. end;
  1188. end;
  1189. function set_target_ar(t:tar):boolean;
  1190. var
  1191. i : longint;
  1192. begin
  1193. set_target_ar:=false;
  1194. for i:=1 to arcnt do
  1195. if ar_infos[i].id=t then
  1196. begin
  1197. target_ar:=ar_infos[i];
  1198. set_target_ar:=true;
  1199. exit;
  1200. end;
  1201. end;
  1202. function set_target_res(t:tres):boolean;
  1203. var
  1204. i : longint;
  1205. begin
  1206. set_target_res:=false;
  1207. for i:=1 to rescnt do
  1208. if res_infos[i].id=t then
  1209. begin
  1210. target_res:=res_infos[i];
  1211. set_target_res:=true;
  1212. exit;
  1213. end;
  1214. end;
  1215. function set_target_info(t:ttarget):boolean;
  1216. var
  1217. i : longint;
  1218. begin
  1219. set_target_info:=false;
  1220. for i:=1 to targetcnt do
  1221. if target_infos[i].target=t then
  1222. begin
  1223. target_info:=target_infos[i];
  1224. set_target_os(target_info.os);
  1225. set_target_asm(target_info.assem);
  1226. set_target_link(target_info.link);
  1227. set_target_ar(target_info.ar);
  1228. set_target_res(target_info.res);
  1229. target_cpu:=target_info.cpu;
  1230. set_target_info:=true;
  1231. exit;
  1232. end;
  1233. end;
  1234. {****************************************************************************
  1235. Load from string
  1236. ****************************************************************************}
  1237. function set_string_target(s : string) : boolean;
  1238. var
  1239. i : longint;
  1240. begin
  1241. set_string_target:=false;
  1242. { this should be case insensitive !! PM }
  1243. s:=upper(s);
  1244. for i:=1 to targetcnt do
  1245. if target_infos[i].short_name=s then
  1246. begin
  1247. target_info:=target_infos[i];
  1248. set_target_os(target_info.os);
  1249. set_target_asm(target_info.assem);
  1250. set_target_link(target_info.link);
  1251. set_target_ar(target_info.ar);
  1252. set_target_res(target_info.res);
  1253. target_cpu:=target_info.cpu;
  1254. set_string_target:=true;
  1255. exit;
  1256. end;
  1257. end;
  1258. function set_string_asm(s : string) : boolean;
  1259. var
  1260. i : longint;
  1261. begin
  1262. set_string_asm:=false;
  1263. { this should be case insensitive !! PM }
  1264. s:=upper(s);
  1265. for i:=1 to asmcnt do
  1266. if as_infos[i].idtxt=s then
  1267. begin
  1268. target_asm:=as_infos[i];
  1269. set_string_asm:=true;
  1270. end;
  1271. end;
  1272. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  1273. var
  1274. i : longint;
  1275. begin
  1276. set_string_asmmode:=false;
  1277. { this should be case insensitive !! PM }
  1278. s:=upper(s);
  1279. for i:=1 to asmmodecnt do
  1280. if asmmodeinfos[i].idtxt=s then
  1281. begin
  1282. t:=asmmodeinfos[i].id;
  1283. set_string_asmmode:=true;
  1284. end;
  1285. end;
  1286. {****************************************************************************
  1287. Initialization of default target
  1288. ****************************************************************************}
  1289. procedure default_os(t:ttarget);
  1290. begin
  1291. set_target_info(t);
  1292. if source_os.name='' then
  1293. source_os:=target_os;
  1294. end;
  1295. procedure set_source_os(t:tos);
  1296. var
  1297. i : longint;
  1298. begin
  1299. { can't use message() here (PFV) }
  1300. if source_os.name<>'' then
  1301. Writeln('Warning: Source OS Redefined!');
  1302. for i:=1 to oscnt do
  1303. if os_infos[i].id=t then
  1304. begin
  1305. source_os:=os_infos[i];
  1306. exit;
  1307. end;
  1308. end;
  1309. procedure InitSystems;
  1310. begin
  1311. { first get source OS }
  1312. source_os.name:='';
  1313. { please note then we use cpu86 and cpu68 here on purpose !! }
  1314. {$ifdef cpu86}
  1315. {$ifdef GO32V1}
  1316. set_source_os(os_i386_GO32V1);
  1317. {$else}
  1318. {$ifdef GO32V2}
  1319. set_source_os(os_i386_GO32V2);
  1320. {$else}
  1321. {$ifdef OS2}
  1322. set_source_os(os_i386_OS2);
  1323. {$else}
  1324. {$ifdef LINUX}
  1325. set_source_os(os_i386_LINUX);
  1326. {$else}
  1327. {$ifdef WIN32}
  1328. set_source_os(os_i386_WIN32);
  1329. {$endif win32}
  1330. {$endif linux}
  1331. {$endif os2}
  1332. {$endif go32v2}
  1333. {$endif go32v1}
  1334. {$endif cpu86}
  1335. {$ifdef cpu68}
  1336. {$ifdef AMIGA}
  1337. set_source_os(os_m68k_Amiga);
  1338. {$else}
  1339. {$ifdef ATARI}
  1340. set_source_os(os_m68k_Atari);
  1341. {$else}
  1342. {$ifdef MACOS}
  1343. set_source_os(os_m68k_MAC);
  1344. {$else}
  1345. {$ifdef LINUX}
  1346. set_source_os(os_m68k_linux);
  1347. {$endif linux}
  1348. {$endif macos}
  1349. {$endif atari}
  1350. {$endif amiga}
  1351. {$endif cpu68}
  1352. { Now default target !! }
  1353. {$ifdef i386}
  1354. {$ifdef GO32V1}
  1355. default_os(target_i386_GO32V1);
  1356. {$else}
  1357. {$ifdef GO32V2}
  1358. default_os(target_i386_GO32V2);
  1359. {$else}
  1360. {$ifdef OS2}
  1361. default_os(target_i386_OS2);
  1362. {$else}
  1363. {$ifdef LINUX}
  1364. default_os(target_i386_LINUX);
  1365. {$else}
  1366. {$ifdef WIN32}
  1367. default_os(target_i386_WIN32);
  1368. {$else}
  1369. default_os(target_i386_GO32V2);
  1370. {$endif win32}
  1371. {$endif linux}
  1372. {$endif os2}
  1373. {$endif go32v2}
  1374. {$endif go32v1}
  1375. {$endif i386}
  1376. {$ifdef m68k}
  1377. {$ifdef AMIGA}
  1378. default_os(target_m68k_Amiga);
  1379. {$else}
  1380. {$ifdef ATARI}
  1381. default_os(target_m68k_Atari);
  1382. {$else}
  1383. {$ifdef MACOS}
  1384. default_os(target_m68k_Mac);
  1385. {$else}
  1386. {$ifdef LINUX}
  1387. default_os(target_m68k_linux);
  1388. {$else}
  1389. default_os(target_m68k_Amiga);
  1390. {$endif linux}
  1391. {$endif macos}
  1392. {$endif atari}
  1393. {$endif amiga}
  1394. {$endif m68k}
  1395. end;
  1396. begin
  1397. InitSystems;
  1398. end.
  1399. {
  1400. $Log$
  1401. Revision 1.72 1999-05-05 22:22:05 peter
  1402. * updated messages
  1403. Revision 1.71 1999/05/05 17:34:33 peter
  1404. * output is more like as 2.9.1
  1405. * stabs really working for go32v2
  1406. Revision 1.70 1999/05/05 09:19:18 florian
  1407. * more fixes to get it with delphi running
  1408. Revision 1.69 1999/05/03 18:03:29 peter
  1409. * no ar.exe running field in target_asm
  1410. Revision 1.68 1999/05/02 22:41:59 peter
  1411. * moved section names to systems
  1412. * fixed nasm,intel writer
  1413. Revision 1.67 1999/05/01 14:18:12 peter
  1414. * win32 pecoff disabled because it's still not ok
  1415. Revision 1.66 1999/05/01 13:24:44 peter
  1416. * merged nasm compiler
  1417. * old asm moved to oldasm/
  1418. Revision 1.65 1999/03/26 00:05:47 peter
  1419. * released valintern
  1420. + deffile is now removed when compiling is finished
  1421. * ^( compiles now correct
  1422. + static directive
  1423. * shrd fixed
  1424. Revision 1.64 1999/03/24 23:17:33 peter
  1425. * fixed bugs 212,222,225,227,229,231,233
  1426. Revision 1.63 1999/03/09 11:54:09 pierre
  1427. * pecoff default assem for win32 with ag386bin
  1428. Revision 1.62 1999/03/04 13:55:48 pierre
  1429. * some m68k fixes (still not compilable !)
  1430. * new(tobj) does not give warning if tobj has no VMT !
  1431. Revision 1.61 1999/03/03 11:41:51 pierre
  1432. + stabs info corrected to give results near to GAS output
  1433. * local labels (with .L are not stored in object anymore)
  1434. so we get the same number of symbols as from GAS !
  1435. Revision 1.60 1999/02/26 00:48:25 peter
  1436. * assembler writers fixed for ag386bin
  1437. Revision 1.59 1999/02/25 21:02:53 peter
  1438. * ag386bin updates
  1439. + coff writer
  1440. Revision 1.58 1999/02/24 00:59:16 peter
  1441. * small updates for ag386bin
  1442. Revision 1.57 1999/02/22 02:15:42 peter
  1443. * updates for ag386bin
  1444. Revision 1.56 1999/01/10 15:38:01 peter
  1445. * moved some tables from ra386*.pas -> i386.pas
  1446. + start of coff writer
  1447. * renamed asmutils unit to rautils
  1448. Revision 1.55 1999/01/06 22:58:47 florian
  1449. + some stuff for the new code generator
  1450. Revision 1.54 1998/12/28 23:26:26 peter
  1451. + resource file handling ($R directive) for Win32
  1452. Revision 1.53 1998/12/15 10:23:30 peter
  1453. + -iSO, -iSP, -iTO, -iTP
  1454. Revision 1.52 1998/12/03 10:17:32 peter
  1455. * target_os.use_bound_instruction boolean
  1456. Revision 1.51 1998/11/30 09:43:23 pierre
  1457. * some range check bugs fixed (still not working !)
  1458. + added DLL writing support for win32 (also accepts variables)
  1459. + TempAnsi for code that could be used for Temporary ansi strings
  1460. handling
  1461. Revision 1.50 1998/11/16 15:41:45 peter
  1462. * tp7 didn't like my ifopt H+ :(
  1463. Revision 1.49 1998/11/16 10:17:09 peter
  1464. * fixed for H+ compilation
  1465. Revision 1.48 1998/10/26 14:19:30 pierre
  1466. + added options -lS and -lT for source and target os output
  1467. (to have a easier way to test OS_SOURCE abd OS_TARGET in makefiles)
  1468. * several problems with rtti data
  1469. (type of sym was not checked)
  1470. assumed to be varsym when they could be procsym or property syms !!
  1471. Revision 1.47 1998/10/20 08:07:04 pierre
  1472. * several memory corruptions due to double freemem solved
  1473. => never use p^.loc.location:=p^.left^.loc.location;
  1474. + finally I added now by default
  1475. that ra386dir translates global and unit symbols
  1476. + added a first field in tsymtable and
  1477. a nextsym field in tsym
  1478. (this allows to obtain ordered type info for
  1479. records and objects in gdb !)
  1480. Revision 1.46 1998/10/16 08:51:54 peter
  1481. + target_os.stackalignment
  1482. + stack can be aligned at 2 or 4 byte boundaries
  1483. Revision 1.45 1998/10/15 16:20:41 peter
  1484. * removed uses verbose which is not possible! this unit may not use
  1485. any other unit !
  1486. Revision 1.44 1998/10/14 11:28:25 florian
  1487. * emitpushreferenceaddress gets now the asmlist as parameter
  1488. * m68k version compiles with -duseansistrings
  1489. Revision 1.43 1998/10/14 08:08:56 pierre
  1490. * following Peters remark, removed all ifdef in
  1491. the systems unit enums
  1492. * last bugs of cg68k removed for sysamiga
  1493. (sysamiga assembles with as68k !!)
  1494. Revision 1.42 1998/10/13 16:50:23 pierre
  1495. * undid some changes of Peter that made the compiler wrong
  1496. for m68k (I had to reinsert some ifdefs)
  1497. * removed several memory leaks under m68k
  1498. * removed the meory leaks for assembler readers
  1499. * cross compiling shoud work again better
  1500. ( crosscompiling sysamiga works
  1501. but as68k still complain about some code !)
  1502. Revision 1.41 1998/10/13 13:10:31 peter
  1503. * new style for m68k/i386 infos and enums
  1504. Revision 1.40 1998/10/13 09:13:09 pierre
  1505. * assembler type output command line was case sensitive
  1506. Revision 1.39 1998/10/13 08:19:42 pierre
  1507. + source_os is now set correctly for cross-processor compilers
  1508. (tos contains all target_infos and
  1509. we use CPU86 and CPU68 conditionnals to
  1510. get the source operating system
  1511. this only works if you do not undefine
  1512. the source target !!)
  1513. * several cg68k memory leaks fixed
  1514. + started to change the code so that it should be possible to have
  1515. a complete compiler (both for m68k and i386 !!)
  1516. Revision 1.38 1998/10/07 04:26:58 carl
  1517. * bugfixes
  1518. + added mpw support
  1519. Revision 1.37 1998/10/06 20:40:58 peter
  1520. * remove -D from assemblers
  1521. Revision 1.36 1998/09/16 16:41:50 peter
  1522. * merged fixes
  1523. Revision 1.33.2.3 1998/09/16 16:13:13 peter
  1524. * win32 .o -> .ow and .a -> .aw
  1525. Revision 1.35 1998/09/11 17:35:33 peter
  1526. * fixed tabs
  1527. Revision 1.34 1998/09/11 12:27:55 pierre
  1528. * restored m68k part
  1529. Revision 1.33.2.2 1998/09/11 17:29:20 peter
  1530. * fixed tabs
  1531. Revision 1.33.2.1 1998/09/11 12:06:00 pierre
  1532. * m68k part restored
  1533. Revision 1.33 1998/09/10 15:25:39 daniel
  1534. + Added maxheapsize.
  1535. * Corrected semi-bug in calling the assembler and the linker
  1536. Revision 1.31 1998/09/01 09:07:13 peter
  1537. * m68k fixes, splitted cg68k like cgi386
  1538. Revision 1.30 1998/08/31 12:26:34 peter
  1539. * m68k and palmos updates from surebugfixes
  1540. Revision 1.29 1998/08/26 10:09:21 peter
  1541. * more lowercase extensions
  1542. Revision 1.28 1998/08/25 12:42:47 pierre
  1543. * CDECL changed to CVAR for variables
  1544. specifications are read in structures also
  1545. + started adding GPC compatibility mode ( option -Sp)
  1546. * names changed to lowercase
  1547. Revision 1.27 1998/08/21 15:16:57 peter
  1548. * win32 compiles a bit better, no growheap crash
  1549. Revision 1.26 1998/08/19 16:07:55 jonas
  1550. * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
  1551. Revision 1.25 1998/08/18 09:24:45 pierre
  1552. * small warning position bug fixed
  1553. * support_mmx switches splitting was missing
  1554. * rhide error and warning output corrected
  1555. Revision 1.24 1998/08/17 09:17:54 peter
  1556. * static/shared linking updates
  1557. Revision 1.23 1998/06/25 08:48:20 florian
  1558. * first version of rtti support
  1559. Revision 1.22 1998/06/17 14:10:21 peter
  1560. * small os2 fixes
  1561. * fixed interdependent units with newppu (remake3 under linux works now)
  1562. Revision 1.20 1998/06/15 15:38:14 pierre
  1563. * small bug in systems.pas corrected
  1564. + operators in different units better hanlded
  1565. Revision 1.19 1998/06/15 13:34:24 daniel
  1566. * Fixed spelling mistakes in comments.
  1567. * Fixed some OS/2 parameters.
  1568. Revision 1.18 1998/06/08 22:59:54 peter
  1569. * smartlinking works for win32
  1570. * some defines to exclude some compiler parts
  1571. Revision 1.17 1998/06/04 23:52:04 peter
  1572. * m68k compiles
  1573. + .def file creation moved to gendef.pas so it could also be used
  1574. for win32
  1575. Revision 1.16 1998/06/01 16:50:22 peter
  1576. + boolean -> ord conversion
  1577. * fixed ord -> boolean conversion
  1578. Revision 1.15 1998/05/30 14:31:11 peter
  1579. + $ASMMODE
  1580. Revision 1.14 1998/05/29 13:24:45 peter
  1581. + asw assembler
  1582. Revision 1.13 1998/05/27 00:20:33 peter
  1583. * some scanner optimizes
  1584. * automaticly aout2exe for go32v1
  1585. * fixed dynamiclinker option which was added at the wrong place
  1586. Revision 1.12 1998/05/23 01:21:32 peter
  1587. + aktasmmode, aktoptprocessor, aktoutputformat
  1588. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1589. + $LIBNAME to set the library name where the unit will be put in
  1590. * splitted cgi386 a bit (codeseg to large for bp7)
  1591. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1592. Revision 1.11 1998/05/22 12:32:49 peter
  1593. * fixed -L on the commandline, Dos commandline is only 128 bytes
  1594. Revision 1.10 1998/05/11 13:07:58 peter
  1595. + $ifdef NEWPPU for the new ppuformat
  1596. + $define GDB not longer required
  1597. * removed all warnings and stripped some log comments
  1598. * no findfirst/findnext anymore to remove smartlink *.o files
  1599. Revision 1.9 1998/05/06 08:38:49 pierre
  1600. * better position info with UseTokenInfo
  1601. UseTokenInfo greatly simplified
  1602. + added check for changed tree after first time firstpass
  1603. (if we could remove all the cases were it happen
  1604. we could skip all firstpass if firstpasscount > 1)
  1605. Only with ExtDebug
  1606. Revision 1.8 1998/05/04 20:19:54 peter
  1607. * small fix for go32v2
  1608. Revision 1.7 1998/05/04 17:54:29 peter
  1609. + smartlinking works (only case jumptable left todo)
  1610. * redesign of systems.pas to support assemblers and linkers
  1611. + Unitname is now also in the PPU-file, increased version to 14
  1612. Revision 1.6 1998/05/01 07:43:57 florian
  1613. + basics for rtti implemented
  1614. + switch $m (generate rtti for published sections)
  1615. Revision 1.5 1998/04/29 10:34:06 pierre
  1616. + added some code for ansistring (not complete nor working yet)
  1617. * corrected operator overloading
  1618. * corrected nasm output
  1619. + started inline procedures
  1620. + added starstarn : use ** for exponentiation (^ gave problems)
  1621. + started UseTokenInfo cond to get accurate positions
  1622. Revision 1.4 1998/04/27 15:45:20 peter
  1623. + -Xl for smartlink
  1624. + target_info.arext = .a
  1625. Revision 1.3 1998/04/16 10:50:45 daniel
  1626. * Fixed some things that were broken for OS/2.
  1627. }