systems.pas 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  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. type
  31. tasmmode= (asmmode_none
  32. ,asmmode_i386_direct,asmmode_i386_att,asmmode_i386_intel
  33. ,asmmode_m68k_mot
  34. );
  35. const
  36. {$ifdef i386} i386asmmodecnt=3; {$else} i386asmmodecnt=0; {$endif}
  37. {$ifdef m68k} m68kasmmodecnt=1; {$else} m68kasmmodecnt=0; {$endif}
  38. asmmodecnt=i386asmmodecnt+m68kasmmodecnt+1;
  39. type
  40. ttarget = (target_none
  41. ,target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
  42. target_i386_OS2,target_i386_Win32
  43. ,target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
  44. target_m68k_linux,target_m68k_PalmOS
  45. );
  46. const
  47. {$ifdef i386} i386targetcnt=5; {$else} i386targetcnt=0; {$endif}
  48. {$ifdef m68k} m68ktargetcnt=5; {$else} m68ktargetcnt=0; {$endif}
  49. targetcnt=i386targetcnt+m68ktargetcnt+1;
  50. type
  51. tasm = (as_none
  52. ,as_i386_o,as_i386_o_aout,as_i386_asw,
  53. as_i386_nasmcoff,as_i386_nasmelf,as_i386_nasmobj,
  54. as_i386_tasm,as_i386_masm
  55. ,as_m68k_o,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw
  56. );
  57. const
  58. {$ifdef i386} i386asmcnt=8; {$else} i386asmcnt=0; {$endif}
  59. {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
  60. asmcnt=i386asmcnt+m68kasmcnt+1;
  61. type
  62. tlink = (link_none
  63. ,link_i386_ld,link_i386_ldgo32v1,
  64. link_i386_ldgo32v2,link_i386_ldw,
  65. link_i386_ldos2
  66. ,link_m68k_ld
  67. );
  68. const
  69. {$ifdef i386} i386linkcnt=5; {$else} i386linkcnt=0; {$endif}
  70. {$ifdef m68k} m68klinkcnt=1; {$else} m68klinkcnt=0; {$endif}
  71. linkcnt=i386linkcnt+m68klinkcnt+1;
  72. type
  73. tar = (ar_none
  74. ,ar_i386_ar,ar_i386_arw
  75. ,ar_m68k_ar
  76. );
  77. const
  78. {$ifdef i386} i386arcnt=2; {$else} i386arcnt=0; {$endif}
  79. {$ifdef m68k} m68karcnt=1; {$else} m68karcnt=0; {$endif}
  80. arcnt=i386arcnt+m68karcnt+1;
  81. type
  82. tos = ( os_none,
  83. os_i386_GO32V1,os_i386_GO32V2,os_i386_Linux,os_i386_OS2,
  84. os_i386_Win32,
  85. os_m68k_Amiga,os_m68k_Atari,os_m68k_Mac,os_m68k_Linux,
  86. os_m68k_PalmOS
  87. );
  88. const
  89. i386oscnt=5;
  90. m68koscnt=5;
  91. oscnt=i386oscnt+m68koscnt+1;
  92. type
  93. tosinfo = packed record
  94. id : tos;
  95. name : string[30];
  96. shortname : string[8];
  97. sharedlibext,
  98. staticlibext,
  99. sourceext,
  100. pasext,
  101. exeext,
  102. scriptext : string[4];
  103. libprefix : string[3];
  104. Cprefix : string[2];
  105. newline : string[2];
  106. endian : tendian;
  107. stackalignment : {longint this is a little overkill no ?? }byte;
  108. size_of_pointer : byte;
  109. size_of_longint : byte;
  110. use_bound_instruction : boolean;
  111. use_function_relative_addresses : boolean;
  112. end;
  113. tasminfo = packed record
  114. id : tasm;
  115. idtxt : string[8];
  116. asmbin : string[8];
  117. asmcmd : string[50];
  118. externals : boolean;
  119. labelprefix : string[2];
  120. comment : string[2];
  121. end;
  122. tlinkinfo = packed record
  123. id : tlink;
  124. linkbin : string[8];
  125. linkcmd : string[127];
  126. binders : word;
  127. bindbin : array[1..2]of string[8];
  128. bindcmd : array[1..2]of string[127];
  129. stripopt : string[2];
  130. libpathprefix : string[13];
  131. libpathsuffix : string[2];
  132. groupstart : string[8];
  133. groupend : string[2];
  134. inputstart : string[8];
  135. inputend : string[2];
  136. libprefix : string[2];
  137. end;
  138. tarinfo = packed record
  139. id : tar;
  140. arbin : string[8];
  141. arcmd : string[50];
  142. end;
  143. ttargetinfo = packed record
  144. target : ttarget;
  145. cpu : ttargetcpu;
  146. short_name : string[8];
  147. unit_env : string[12];
  148. system_unit : string[8];
  149. smartext,
  150. unitext,
  151. unitlibext,
  152. asmext,
  153. objext,
  154. exeext : string[4];
  155. os : tos;
  156. link : tlink;
  157. assem : tasm;
  158. ar : tar;
  159. heapsize,
  160. maxheapsize,
  161. stacksize : longint;
  162. end;
  163. tasmmodeinfo=packed record
  164. id : tasmmode;
  165. idtxt : string[8];
  166. end;
  167. var
  168. target_cpu : ttargetcpu;
  169. target_info : ttargetinfo;
  170. target_os : tosinfo;
  171. target_asm : tasminfo;
  172. target_link : tlinkinfo;
  173. target_ar : tarinfo;
  174. source_os : tosinfo;
  175. function set_string_target(s : string) : boolean;
  176. function set_string_asm(s : string) : boolean;
  177. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  178. implementation
  179. const
  180. {****************************************************************************
  181. OS Info
  182. ****************************************************************************}
  183. os_infos : array[1..oscnt] of tosinfo = (
  184. (
  185. id : os_none;
  186. name : 'No operating system';
  187. shortname : 'none'
  188. ),
  189. (
  190. id : os_i386_go32v1;
  191. name : 'GO32 V1 DOS extender';
  192. shortname : 'go32v1';
  193. sharedlibext : '.dll';
  194. staticlibext : '.a';
  195. sourceext : '.pp';
  196. pasext : '.pas';
  197. exeext : ''; { No .exe, the linker only output a.out ! }
  198. scriptext : '.bat';
  199. libprefix : '';
  200. Cprefix : '_';
  201. newline : #13#10;
  202. endian : endian_little;
  203. stackalignment : 2;
  204. size_of_pointer : 4;
  205. size_of_longint : 4;
  206. use_bound_instruction : false;
  207. use_function_relative_addresses : true
  208. ),
  209. (
  210. id : os_i386_go32v2;
  211. name : 'GO32 V2 DOS extender';
  212. shortname : 'go32v2';
  213. sharedlibext : '.dll';
  214. staticlibext : '.a';
  215. sourceext : '.pp';
  216. pasext : '.pas';
  217. exeext : '.exe';
  218. scriptext : '.bat';
  219. libprefix : '';
  220. Cprefix : '_';
  221. newline : #13#10;
  222. endian : endian_little;
  223. stackalignment : 2;
  224. size_of_pointer : 4;
  225. size_of_longint : 4;
  226. use_bound_instruction : true;
  227. use_function_relative_addresses : true
  228. ),
  229. (
  230. id : os_i386_linux;
  231. name : 'Linux for i386';
  232. shortname : 'linux';
  233. sharedlibext : '.so';
  234. staticlibext : '.a';
  235. sourceext : '.pp';
  236. pasext : '.pas';
  237. exeext : '';
  238. scriptext : '.sh';
  239. libprefix : 'lib';
  240. Cprefix : '';
  241. newline : #10;
  242. endian : endian_little;
  243. stackalignment : 4;
  244. size_of_pointer : 4;
  245. size_of_longint : 4;
  246. use_bound_instruction : false;
  247. use_function_relative_addresses : true
  248. ),
  249. (
  250. id : os_i386_os2;
  251. name : 'OS/2 via EMX';
  252. shortname : 'os2';
  253. sharedlibext : '.ao2';
  254. staticlibext : '.ao2';
  255. sourceext : '.pas';
  256. pasext : '.pp';
  257. exeext : '.exe';
  258. scriptext : '.cmd';
  259. libprefix : '';
  260. Cprefix : '_';
  261. newline : #13#10;
  262. endian : endian_little;
  263. stackalignment : 2;
  264. size_of_pointer : 4;
  265. size_of_longint : 4;
  266. use_bound_instruction : false;
  267. use_function_relative_addresses : false
  268. ),
  269. (
  270. id : os_i386_win32;
  271. name : 'Win32 for i386';
  272. shortname : 'win32';
  273. sharedlibext : '.dll';
  274. staticlibext : '.aw';
  275. sourceext : '.pp';
  276. pasext : '.pas';
  277. exeext : '.exe';
  278. scriptext : '.bat';
  279. libprefix : 'lib';
  280. Cprefix : '_';
  281. newline : #13#10;
  282. endian : endian_little;
  283. stackalignment : 4;
  284. size_of_pointer : 4;
  285. size_of_longint : 4;
  286. use_bound_instruction : true;
  287. use_function_relative_addresses : true
  288. ),
  289. (
  290. id : os_m68k_amiga;
  291. name : 'Commodore Amiga';
  292. shortname : 'amiga';
  293. sharedlibext : '.library';
  294. staticlibext : '.a';
  295. sourceext : '.pp';
  296. pasext : '.pas';
  297. exeext : '';
  298. scriptext : '';
  299. libprefix : '';
  300. Cprefix : '_';
  301. newline : #10;
  302. endian : endian_big;
  303. stackalignment : 2;
  304. size_of_pointer : 4;
  305. size_of_longint : 4;
  306. use_bound_instruction : false;
  307. use_function_relative_addresses : false
  308. ),
  309. (
  310. id : os_m68k_atari;
  311. name : 'Atari ST/STE';
  312. shortname : 'atari';
  313. sharedlibext : '.dll';
  314. staticlibext : '.a';
  315. sourceext : '.pp';
  316. pasext : '.pas';
  317. exeext : '.tpp';
  318. scriptext : '';
  319. libprefix : '';
  320. Cprefix : '_';
  321. newline : #10;
  322. endian : endian_big;
  323. stackalignment : 2;
  324. size_of_pointer : 4;
  325. size_of_longint : 4;
  326. use_bound_instruction : false;
  327. use_function_relative_addresses : false
  328. ),
  329. (
  330. id : os_m68k_mac;
  331. name : 'Macintosh m68k';
  332. shortname : 'mac';
  333. sharedlibext : '.dll';
  334. staticlibext : '.a';
  335. sourceext : '.pp';
  336. pasext : '.pas';
  337. exeext : '.tpp';
  338. scriptext : '';
  339. libprefix : '';
  340. Cprefix : '_';
  341. newline : #13;
  342. endian : endian_big;
  343. stackalignment : 2;
  344. size_of_pointer : 4;
  345. size_of_longint : 4;
  346. use_bound_instruction : false;
  347. use_function_relative_addresses : false
  348. ),
  349. (
  350. id : os_m68k_linux;
  351. name : 'Linux for m68k';
  352. shortname : 'linux';
  353. sharedlibext : '.so';
  354. staticlibext : '.a';
  355. sourceext : '.pp';
  356. pasext : '.pas';
  357. exeext : '';
  358. scriptext : '.sh';
  359. libprefix : 'lib';
  360. Cprefix : '';
  361. newline : #10;
  362. endian : endian_big;
  363. stackalignment : 2;
  364. size_of_pointer : 4;
  365. size_of_longint : 4;
  366. use_bound_instruction : false;
  367. use_function_relative_addresses : true
  368. ),
  369. (
  370. id : os_m68k_palmos;
  371. name : 'PalmOS';
  372. shortname : 'palmos';
  373. sharedlibext : '.so';
  374. staticlibext : '.a';
  375. sourceext : '.pp';
  376. pasext : '.pas';
  377. exeext : '';
  378. scriptext : '.sh';
  379. libprefix : 'lib';
  380. Cprefix : '_';
  381. newline : #10;
  382. endian : endian_big;
  383. stackalignment : 2;
  384. size_of_pointer : 4;
  385. size_of_longint : 4;
  386. use_bound_instruction : false;
  387. use_function_relative_addresses : false
  388. )
  389. );
  390. {****************************************************************************
  391. Assembler Info
  392. ****************************************************************************}
  393. as_infos : array[1..asmcnt] of tasminfo = (
  394. (
  395. id : as_none;
  396. idtxt : 'no'
  397. )
  398. {$ifdef i386}
  399. ,(
  400. id : as_i386_o;
  401. idtxt : 'O';
  402. asmbin : 'as';
  403. asmcmd : '-o $OBJ $ASM';
  404. externals : false;
  405. labelprefix : '.L';
  406. comment : '# '
  407. )
  408. ,(
  409. id : as_i386_o_aout;
  410. idtxt : 'O_AOUT';
  411. asmbin : 'as';
  412. asmcmd : '-o $OBJ $ASM';
  413. externals : false;
  414. labelprefix : 'L';
  415. comment : '# '
  416. )
  417. ,(
  418. id : as_i386_asw;
  419. idtxt : 'ASW';
  420. asmbin : 'asw';
  421. asmcmd : '-o $OBJ $ASM';
  422. externals : false;
  423. labelprefix : '.L';
  424. comment : '# '
  425. )
  426. ,(
  427. id : as_i386_nasmcoff;
  428. idtxt : 'NASMCOFF';
  429. asmbin : 'nasm';
  430. asmcmd : '-f coff -o $OBJ $ASM';
  431. externals : true;
  432. labelprefix : 'L';
  433. comment : '; '
  434. )
  435. ,(
  436. id : as_i386_nasmelf;
  437. idtxt : 'NASMELF';
  438. asmbin : 'nasm';
  439. asmcmd : '-f elf -o $OBJ $ASM';
  440. externals : true;
  441. labelprefix : 'L';
  442. comment : '; '
  443. )
  444. ,(
  445. id : as_i386_nasmobj;
  446. idtxt : 'NASMOBJ';
  447. asmbin : 'nasm';
  448. asmcmd : '-f obj -o $OBJ $ASM';
  449. externals : true;
  450. labelprefix : 'L';
  451. comment : '; '
  452. )
  453. ,(
  454. id : as_i386_tasm;
  455. idtxt : 'TASM';
  456. asmbin : 'tasm';
  457. asmcmd : '/m2 $ASM $OBJ';
  458. externals : true;
  459. labelprefix : '.L';
  460. comment : '; '
  461. )
  462. ,(
  463. id : as_i386_masm;
  464. idtxt : 'MASM';
  465. asmbin : 'masm';
  466. asmcmd : '$ASM $OBJ';
  467. externals : true;
  468. labelprefix : '.L';
  469. comment : '; '
  470. )
  471. {$endif i386}
  472. {$ifdef m68k}
  473. ,(
  474. id : as_m68k_o;
  475. idtxt : 'O';
  476. asmbin : 'as';
  477. asmcmd : '-o $OBJ $ASM';
  478. externals : false;
  479. labelprefix : '.L';
  480. comment : '# '
  481. )
  482. ,(
  483. id : as_m68k_gas;
  484. idtxt : 'GAS';
  485. asmbin : 'as68k'; { Gas for the Amiga}
  486. asmcmd : '--register-prefix-optional -o $OBJ $ASM';
  487. externals : false;
  488. labelprefix : '.L';
  489. comment : '| '
  490. )
  491. ,(
  492. id : as_m68k_mit;
  493. idtxt : 'MIT';
  494. asmbin : '';
  495. asmcmd : '-o $OBJ $ASM';
  496. externals : false;
  497. labelprefix : '.L';
  498. comment : '| '
  499. )
  500. ,(
  501. id : as_m68k_mot;
  502. idtxt : 'MOT';
  503. asmbin : '';
  504. asmcmd : '-o $OBJ $ASM';
  505. externals : false;
  506. labelprefix : '__L';
  507. comment : '| '
  508. )
  509. ,(
  510. id : as_m68k_mpw;
  511. idtxt : 'MPW';
  512. asmbin : '';
  513. asmcmd : '-model far -o $OBJ $ASM';
  514. externals : false;
  515. labelprefix : '__L';
  516. comment : '| '
  517. )
  518. {$endif m68k}
  519. );
  520. {****************************************************************************
  521. Linker Info
  522. ****************************************************************************}
  523. link_infos : array[1..linkcnt] of tlinkinfo = (
  524. (
  525. id : link_none
  526. )
  527. {$ifdef i386}
  528. ,(
  529. id : link_i386_ld;
  530. linkbin : 'ld';
  531. linkcmd : '$OPT -o $EXE $RES';
  532. {* Changes made by Ozerski 23.10.1998}
  533. binders:0;
  534. bindbin : ('','');
  535. bindcmd : ('','');
  536. {* End changes}
  537. stripopt : '-s';
  538. libpathprefix : 'SEARCH_DIR(';
  539. libpathsuffix : ')';
  540. groupstart : 'GROUP(';
  541. groupend : ')';
  542. inputstart : 'INPUT(';
  543. inputend : ')';
  544. libprefix : '-l'
  545. )
  546. ,(
  547. id : link_i386_ldgo32v1;
  548. linkbin : 'ld';
  549. linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
  550. {* Changes made by Ozerski 23.10.1998}
  551. binders:1;
  552. bindbin : ('aout2exe','');
  553. bindcmd : ('$EXE','');
  554. {* End changes}
  555. stripopt : '-s';
  556. libpathprefix : '-L';
  557. libpathsuffix : '';
  558. groupstart : '-(';
  559. groupend : '-)';
  560. inputstart : '';
  561. inputend : '';
  562. libprefix : '-l'
  563. )
  564. ,(
  565. id : link_i386_ldgo32v2;
  566. linkbin : 'ld';
  567. linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
  568. {* Changes made by Ozerski 23.10.1998}
  569. binders:0;
  570. bindbin : ('','');
  571. bindcmd : ('','');
  572. {* End changes}
  573. stripopt : '-s';
  574. libpathprefix : '-L';
  575. libpathsuffix : '';
  576. groupstart : '-(';
  577. groupend : '-)';
  578. inputstart : '';
  579. inputend : '';
  580. libprefix : '-l'
  581. )
  582. ,(
  583. id : link_i386_ldw;
  584. linkbin : 'ldw';
  585. linkcmd : '$OPT -o $EXE $RES';
  586. {* Changes made by Ozerski 23.10.1998}
  587. binders:0;
  588. bindbin : ('dlltool','ldw');
  589. bindcmd : ('--as asw.exe --dllname $EXE --output-exp exp.$$$',
  590. '-s $OPT -o $EXE $RES exp.$$$');
  591. {* End changes}
  592. stripopt : '-s';
  593. libpathprefix : 'SEARCH_DIR(';
  594. libpathsuffix : ')';
  595. groupstart : 'GROUP(';
  596. groupend : ')';
  597. inputstart : 'INPUT(';
  598. inputend : ')';
  599. libprefix : '-l'
  600. )
  601. ,(
  602. id : link_i386_ldos2;
  603. linkbin : 'ld'; { Os/2 }
  604. linkcmd : '-o $EXE @$RES';
  605. {* Changes made by Ozerski 23.10.1998}
  606. binders:1;
  607. bindbin : ('emxbind','');
  608. bindcmd : ('-b -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB','');
  609. {* End changes}
  610. stripopt : '-s';
  611. libpathprefix : '-L';
  612. libpathsuffix : '';
  613. groupstart : ''; {Linker is too primitive...}
  614. groupend : '';
  615. inputstart : '';
  616. inputend : '';
  617. libprefix : '-l'
  618. )
  619. {$endif i386}
  620. {$ifdef m68k}
  621. ,(
  622. id : link_m68k_ld;
  623. linkbin : 'ld';
  624. linkcmd : '$OPT -o $EXE $RES';
  625. {* Changes made by Ozerski 23.10.1998}
  626. binders:0;
  627. bindbin : ('','');
  628. bindcmd : ('','');
  629. {* End changes}
  630. stripopt : '-s';
  631. libpathprefix : 'SEARCH_DIR(';
  632. libpathsuffix : ')';
  633. groupstart : 'GROUP(';
  634. groupend : ')';
  635. inputstart : 'INPUT(';
  636. inputend : ')';
  637. libprefix : '-l'
  638. )
  639. {$endif m68k}
  640. );
  641. {****************************************************************************
  642. Ar Info
  643. ****************************************************************************}
  644. ar_infos : array[1..arcnt] of tarinfo = (
  645. (
  646. id : ar_none
  647. )
  648. {$ifdef i386}
  649. ,(
  650. id : ar_i386_ar;
  651. arbin : 'ar';
  652. arcmd : 'rs $LIB $FILES'
  653. ),
  654. (
  655. id : ar_i386_arw;
  656. arbin : 'arw';
  657. arcmd : 'rs $LIB $FILES'
  658. )
  659. {$endif i386}
  660. {$ifdef m68k}
  661. ,(
  662. id : ar_m68k_ar;
  663. arbin : 'ar';
  664. arcmd : 'rs $LIB $FILES'
  665. )
  666. {$endif m68k}
  667. );
  668. {****************************************************************************
  669. Targets Info
  670. ****************************************************************************}
  671. target_infos : array[1..targetcnt] of ttargetinfo = (
  672. (
  673. target : target_none;
  674. cpu : no_cpu;
  675. short_name : 'notarget'
  676. )
  677. {$ifdef i386}
  678. ,(
  679. target : target_i386_GO32V1;
  680. cpu : i386;
  681. short_name : 'GO32V1';
  682. unit_env : 'GO32V1UNITS';
  683. system_unit : 'SYSTEM';
  684. smartext : '.sl';
  685. unitext : '.pp1';
  686. unitlibext : '.ppl';
  687. asmext : '.s1';
  688. objext : '.o1';
  689. exeext : ''; { The linker produces a.out }
  690. os : os_i386_GO32V1;
  691. link : link_i386_ldgo32v1;
  692. assem : as_i386_o;
  693. ar : ar_i386_ar;
  694. heapsize : 2048*1024;
  695. maxheapsize : 32768*1024;
  696. stacksize : 16384
  697. ),
  698. (
  699. target : target_i386_GO32V2;
  700. cpu : i386;
  701. short_name : 'GO32V2';
  702. unit_env : 'GO32V2UNITS';
  703. system_unit : 'SYSTEM';
  704. smartext : '.sl';
  705. unitext : '.ppu';
  706. unitlibext : '.ppl';
  707. asmext : '.s';
  708. objext : '.o';
  709. exeext : '.exe';
  710. os : os_i386_GO32V2;
  711. link : link_i386_ldgo32v2;
  712. assem : as_i386_o;
  713. ar : ar_i386_ar;
  714. heapsize : 2048*1024;
  715. maxheapsize : 32768*1024;
  716. stacksize : 16384
  717. ),
  718. (
  719. target : target_i386_LINUX;
  720. cpu : i386;
  721. short_name : 'LINUX';
  722. unit_env : 'LINUXUNITS';
  723. system_unit : 'syslinux';
  724. smartext : '.sl';
  725. unitext : '.ppu';
  726. unitlibext : '.ppl';
  727. asmext : '.s';
  728. objext : '.o';
  729. exeext : '';
  730. os : os_i386_Linux;
  731. link : link_i386_ld;
  732. assem : as_i386_o;
  733. ar : ar_i386_ar;
  734. heapsize : 2048*1024;
  735. maxheapsize : 32768*1024;
  736. stacksize : 8192
  737. ),
  738. (
  739. target : target_i386_OS2;
  740. cpu : i386;
  741. short_name : 'OS2';
  742. unit_env : 'OS2UNITS';
  743. system_unit : 'SYSOS2';
  744. smartext : '.sl';
  745. unitext : '.ppo';
  746. unitlibext : '.ppl';
  747. asmext : '.so2';
  748. objext : '.oo2';
  749. exeext : ''; { The linker produces a.out }
  750. os : os_i386_OS2;
  751. link : link_i386_ldos2;
  752. assem : as_i386_o_aout;
  753. ar : ar_i386_ar;
  754. heapsize : 256*1024;
  755. maxheapsize : 32768*1024;
  756. stacksize : 32768
  757. ),
  758. (
  759. target : target_i386_WIN32;
  760. cpu : i386;
  761. short_name : 'WIN32';
  762. unit_env : 'WIN32UNITS';
  763. system_unit : 'SYSWIN32';
  764. smartext : '.slw';
  765. unitext : '.ppw';
  766. unitlibext : '.ppl';
  767. asmext : '.sw';
  768. objext : '.ow';
  769. exeext : '.exe';
  770. os : os_i386_Win32;
  771. link : link_i386_ldw;
  772. assem : as_i386_asw;
  773. ar : ar_i386_arw;
  774. heapsize : 2048*1024;
  775. maxheapsize : 32768*1024;
  776. stacksize : 32768
  777. )
  778. {$endif i386}
  779. {$ifdef m68k}
  780. ,(
  781. target : target_m68k_Amiga;
  782. cpu : m68k;
  783. short_name : 'AMIGA';
  784. unit_env : '';
  785. system_unit : 'sysamiga';
  786. smartext : '.sl';
  787. unitext : '.ppa';
  788. unitlibext : '.ppl';
  789. asmext : '.asm';
  790. objext : '.o';
  791. exeext : '';
  792. os : os_m68k_Amiga;
  793. link : link_m68k_ld;
  794. assem : as_m68k_o;
  795. ar : ar_m68k_ar;
  796. heapsize : 128*1024;
  797. maxheapsize : 32768*1024;
  798. stacksize : 8192
  799. ),
  800. (
  801. target : target_m68k_Atari;
  802. cpu : m68k;
  803. short_name : 'ATARI';
  804. unit_env : '';
  805. system_unit : 'SYSATARI';
  806. smartext : '.sl';
  807. unitext : '.ppt';
  808. unitlibext : '.ppl';
  809. asmext : '.s';
  810. objext : '.o';
  811. exeext : '.ttp';
  812. os : os_m68k_Atari;
  813. link : link_m68k_ld;
  814. assem : as_m68k_o;
  815. ar : ar_m68k_ar;
  816. heapsize : 16*1024;
  817. maxheapsize : 32768*1024;
  818. stacksize : 8192
  819. ),
  820. (
  821. target : target_m68k_Mac;
  822. cpu : m68k;
  823. short_name : 'MACOS';
  824. unit_env : '';
  825. system_unit : 'sysmac';
  826. smartext : '.sl';
  827. unitext : '.ppt';
  828. unitlibext : '.ppl';
  829. asmext : '.a';
  830. objext : '.o';
  831. exeext : '';
  832. os : os_m68k_Mac;
  833. link : link_m68k_ld;
  834. assem : as_m68k_mpw;
  835. ar : ar_m68k_ar;
  836. heapsize : 128*1024;
  837. maxheapsize : 32768*1024;
  838. stacksize : 8192
  839. ),
  840. (
  841. target : target_m68k_linux;
  842. cpu : m68k;
  843. short_name : 'LINUX';
  844. unit_env : 'LINUXUNITS';
  845. system_unit : 'syslinux';
  846. smartext : '.sl';
  847. unitext : '.ppu';
  848. unitlibext : '.ppl';
  849. asmext : '.s';
  850. objext : '.o';
  851. exeext : '';
  852. os : os_m68k_Linux;
  853. link : link_m68k_ld;
  854. assem : as_m68k_o;
  855. ar : ar_m68k_ar;
  856. heapsize : 128*1024;
  857. maxheapsize : 32768*1024;
  858. stacksize : 8192
  859. ),
  860. (
  861. target : target_m68k_PalmOS;
  862. cpu : m68k;
  863. short_name : 'PALMOS';
  864. unit_env : 'PALMUNITS';
  865. system_unit : 'syspalm';
  866. smartext : '.sl';
  867. unitext : '.ppu';
  868. unitlibext : '.ppl';
  869. asmext : '.s';
  870. objext : '.o';
  871. exeext : '';
  872. os : os_m68k_PalmOS;
  873. link : link_m68k_ld;
  874. assem : as_m68k_o;
  875. ar : ar_m68k_ar;
  876. heapsize : 128*1024;
  877. maxheapsize : 32768*1024;
  878. stacksize : 8192
  879. )
  880. {$endif m68k}
  881. );
  882. {****************************************************************************
  883. AsmModeInfo
  884. ****************************************************************************}
  885. asmmodeinfos : array[1..asmmodecnt] of tasmmodeinfo = (
  886. (
  887. id : asmmode_none;
  888. idtxt : 'none'
  889. )
  890. {$ifdef i386}
  891. ,(
  892. id : asmmode_i386_direct;
  893. idtxt : 'DIRECT'
  894. ),
  895. (
  896. id : asmmode_i386_att;
  897. idtxt : 'ATT'
  898. ),
  899. (
  900. id : asmmode_i386_intel;
  901. idtxt : 'INTEL'
  902. )
  903. {$endif i386}
  904. {$ifdef m68k}
  905. ,(
  906. id : asmmode_m68k_mot;
  907. idtxt : 'MOT'
  908. )
  909. {$endif m68k}
  910. );
  911. {****************************************************************************
  912. Helpers
  913. ****************************************************************************}
  914. function upper(const s : string) : string;
  915. var
  916. i : longint;
  917. begin
  918. for i:=1 to length(s) do
  919. if s[i] in ['a'..'z'] then
  920. upper[i]:=char(byte(s[i])-32)
  921. else
  922. upper[i]:=s[i];
  923. {$ifndef TP}
  924. {$ifopt H+}
  925. SetLength(upper,length(s));
  926. {$else}
  927. upper[0]:=s[0];
  928. {$endif}
  929. {$else}
  930. upper[0]:=s[0];
  931. {$endif}
  932. end;
  933. function set_target_os(t:tos):boolean;
  934. var
  935. i : longint;
  936. begin
  937. set_target_os:=false;
  938. { target 1 is none }
  939. for i:=2 to oscnt do
  940. if os_infos[i].id=t then
  941. begin
  942. target_os:=os_infos[i];
  943. set_target_os:=true;
  944. exit;
  945. end;
  946. end;
  947. function set_target_asm(t:tasm):boolean;
  948. var
  949. i : longint;
  950. begin
  951. set_target_asm:=false;
  952. for i:=1 to asmcnt do
  953. if as_infos[i].id=t then
  954. begin
  955. target_asm:=as_infos[i];
  956. set_target_asm:=true;
  957. exit;
  958. end;
  959. end;
  960. function set_target_link(t:tlink):boolean;
  961. var
  962. i : longint;
  963. begin
  964. set_target_link:=false;
  965. for i:=1 to linkcnt do
  966. if link_infos[i].id=t then
  967. begin
  968. target_link:=link_infos[i];
  969. set_target_link:=true;
  970. exit;
  971. end;
  972. end;
  973. function set_target_ar(t:tar):boolean;
  974. var
  975. i : longint;
  976. begin
  977. set_target_ar:=false;
  978. for i:=1 to arcnt do
  979. if ar_infos[i].id=t then
  980. begin
  981. target_ar:=ar_infos[i];
  982. set_target_ar:=true;
  983. exit;
  984. end;
  985. end;
  986. function set_target_info(t:ttarget):boolean;
  987. var
  988. i : longint;
  989. begin
  990. set_target_info:=false;
  991. for i:=1 to targetcnt do
  992. if target_infos[i].target=t then
  993. begin
  994. target_info:=target_infos[i];
  995. set_target_os(target_info.os);
  996. set_target_asm(target_info.assem);
  997. set_target_link(target_info.link);
  998. set_target_ar(target_info.ar);
  999. target_cpu:=target_info.cpu;
  1000. set_target_info:=true;
  1001. exit;
  1002. end;
  1003. end;
  1004. {****************************************************************************
  1005. Load from string
  1006. ****************************************************************************}
  1007. function set_string_target(s : string) : boolean;
  1008. var
  1009. i : longint;
  1010. begin
  1011. set_string_target:=false;
  1012. { this should be case insensitive !! PM }
  1013. s:=upper(s);
  1014. for i:=1 to targetcnt do
  1015. if target_infos[i].short_name=s then
  1016. begin
  1017. target_info:=target_infos[i];
  1018. set_target_os(target_info.os);
  1019. set_target_asm(target_info.assem);
  1020. set_target_link(target_info.link);
  1021. set_target_ar(target_info.ar);
  1022. target_cpu:=target_info.cpu;
  1023. set_string_target:=true;
  1024. exit;
  1025. end;
  1026. end;
  1027. function set_string_asm(s : string) : boolean;
  1028. var
  1029. i : longint;
  1030. begin
  1031. set_string_asm:=false;
  1032. { this should be case insensitive !! PM }
  1033. s:=upper(s);
  1034. for i:=1 to asmcnt do
  1035. if as_infos[i].idtxt=s then
  1036. begin
  1037. target_asm:=as_infos[i];
  1038. set_string_asm:=true;
  1039. end;
  1040. end;
  1041. function set_string_asmmode(s:string;var t:tasmmode):boolean;
  1042. var
  1043. i : longint;
  1044. begin
  1045. set_string_asmmode:=false;
  1046. { this should be case insensitive !! PM }
  1047. s:=upper(s);
  1048. for i:=1 to asmmodecnt do
  1049. if asmmodeinfos[i].idtxt=s then
  1050. begin
  1051. t:=asmmodeinfos[i].id;
  1052. set_string_asmmode:=true;
  1053. end;
  1054. end;
  1055. {****************************************************************************
  1056. Initialization of default target
  1057. ****************************************************************************}
  1058. procedure default_os(t:ttarget);
  1059. begin
  1060. set_target_info(t);
  1061. if source_os.name='' then
  1062. source_os:=target_os;
  1063. end;
  1064. procedure set_source_os(t:tos);
  1065. var
  1066. i : longint;
  1067. begin
  1068. { can't use message() here (PFV) }
  1069. if source_os.name<>'' then
  1070. Writeln('Warning: Source OS Redefined!');
  1071. for i:=1 to oscnt do
  1072. if os_infos[i].id=t then
  1073. begin
  1074. source_os:=os_infos[i];
  1075. exit;
  1076. end;
  1077. end;
  1078. begin
  1079. { first get source OS }
  1080. source_os.name:='';
  1081. { please note then we use cpu86 and cpu68 here on purpose !! }
  1082. {$ifdef cpu86}
  1083. {$ifdef GO32V1}
  1084. set_source_os(os_i386_GO32V1);
  1085. {$else}
  1086. {$ifdef GO32V2}
  1087. set_source_os(os_i386_GO32V2);
  1088. {$else}
  1089. {$ifdef OS2}
  1090. set_source_os(os_i386_OS2);
  1091. {$else}
  1092. {$ifdef LINUX}
  1093. set_source_os(os_i386_LINUX);
  1094. {$else}
  1095. {$ifdef WIN32}
  1096. set_source_os(os_i386_WIN32);
  1097. {$endif win32}
  1098. {$endif linux}
  1099. {$endif os2}
  1100. {$endif go32v2}
  1101. {$endif go32v1}
  1102. {$endif cpu86}
  1103. {$ifdef cpu68}
  1104. {$ifdef AMIGA}
  1105. set_source_os(os_m68k_Amiga);
  1106. {$else}
  1107. {$ifdef ATARI}
  1108. set_source_os(os_m68k_Atari);
  1109. {$else}
  1110. {$ifdef MACOS}
  1111. set_source_os(os_m68k_MAC);
  1112. {$else}
  1113. {$ifdef LINUX}
  1114. set_source_os(os_m68k_linux);
  1115. {$endif linux}
  1116. {$endif macos}
  1117. {$endif atari}
  1118. {$endif amiga}
  1119. {$endif cpu68}
  1120. { Now default target !! }
  1121. {$ifdef i386}
  1122. {$ifdef GO32V1}
  1123. default_os(target_i386_GO32V1);
  1124. {$else}
  1125. {$ifdef GO32V2}
  1126. default_os(target_i386_GO32V2);
  1127. {$else}
  1128. {$ifdef OS2}
  1129. default_os(target_i386_OS2);
  1130. {$else}
  1131. {$ifdef LINUX}
  1132. default_os(target_i386_LINUX);
  1133. {$else}
  1134. {$ifdef WIN32}
  1135. default_os(target_i386_WIN32);
  1136. {$else}
  1137. default_os(target_i386_GO32V2);
  1138. {$endif win32}
  1139. {$endif linux}
  1140. {$endif os2}
  1141. {$endif go32v2}
  1142. {$endif go32v1}
  1143. {$endif i386}
  1144. {$ifdef m68k}
  1145. {$ifdef AMIGA}
  1146. default_os(target_m68k_Amiga);
  1147. {$else}
  1148. {$ifdef ATARI}
  1149. default_os(target_m68k_Atari);
  1150. {$else}
  1151. {$ifdef MACOS}
  1152. default_os(target_m68k_Mac);
  1153. {$else}
  1154. {$ifdef LINUX}
  1155. default_os(target_m68k_linux);
  1156. {$else}
  1157. default_os(target_m68k_Amiga);
  1158. {$endif linux}
  1159. {$endif macos}
  1160. {$endif atari}
  1161. {$endif amiga}
  1162. {$endif m68k}
  1163. end.
  1164. {
  1165. $Log$
  1166. Revision 1.1 1999-01-28 19:56:12 peter
  1167. * moved to include compiler/gdb independent of each other
  1168. Revision 1.1 1998/12/22 14:27:54 peter
  1169. * moved
  1170. Revision 1.2 1998/12/18 17:17:05 peter
  1171. * updated with new versions from compiler
  1172. Revision 1.1 1998/12/10 23:54:28 peter
  1173. * initial version of the FV IDE
  1174. * initial version of a fake compiler
  1175. }