systems.pas 51 KB

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