systems.pas 52 KB

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