systems.pas 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079
  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,en_big_endian);
  23. ttargetcpu=(i386,m68k,alpha);
  24. tprocessors = (
  25. {$ifdef i386}
  26. Class386,ClassP5,ClassP6
  27. {$endif}
  28. {$ifdef m68k}
  29. MC68000,MC68100,MC68020
  30. {$endif}
  31. );
  32. tasmmode= (
  33. {$ifdef i386}
  34. I386_ATT,I386_INTEL,I386_DIRECT
  35. {$endif}
  36. {$ifdef m68k}
  37. M68K_MOT
  38. {$endif}
  39. );
  40. ttarget = (
  41. {$ifdef i386}
  42. target_GO32V1,target_GO32V2,target_LINUX,target_OS2,target_WIN32
  43. {$endif i386}
  44. {$ifdef m68k}
  45. target_Amiga,target_Atari,target_Mac68k,target_Linux,target_PalmOS
  46. {$endif}
  47. );
  48. tasm = (
  49. {$ifdef i386}
  50. as_o,as_o_aout,as_asw,as_nasmcoff, as_nasmelf, as_nasmobj,
  51. as_tasm, as_masm
  52. {$endif}
  53. {$ifdef m68k}
  54. as_o,as_gas,as_mit,as_mot,as_mpw
  55. {$endif}
  56. );
  57. tlink = (
  58. {$ifdef i386}
  59. link_ld,link_ldgo32v1, link_ldgo32v2, link_ldw, link_ldos2
  60. {$endif i386}
  61. {$ifdef m68k}
  62. link_ld
  63. {$endif}
  64. );
  65. tar = (
  66. {$ifdef i386}
  67. ar_ar,ar_arw
  68. {$endif}
  69. {$ifdef m68k}
  70. ar_ar
  71. {$endif}
  72. );
  73. tos = (
  74. {$ifdef i386}
  75. os_GO32V1,os_GO32V2, os_Linux, os_OS2, os_WIN32
  76. {$endif i387}
  77. {$ifdef m68k}
  78. os_Amiga, os_Atari, os_Mac68k, os_Linux, os_PalmOS
  79. {$endif}
  80. );
  81. tosinfo = packed record
  82. name : string[30];
  83. sharedlibext,
  84. staticlibext,
  85. sourceext,
  86. pasext,
  87. exeext,
  88. scriptext : string[4];
  89. libprefix : string[3];
  90. Cprefix : string[2];
  91. newline : string[2];
  92. endian : tendian;
  93. use_function_relative_addresses : boolean;
  94. end;
  95. tasminfo = record
  96. id : tasm;
  97. idtxt : string[8];
  98. asmbin : string[8];
  99. asmcmd : string[50];
  100. externals : boolean;
  101. labelprefix : string[2];
  102. comment : string[2];
  103. end;
  104. tlinkinfo = record
  105. linkbin : string[8];
  106. linkcmd : string[50];
  107. bindbin : string[8];
  108. bindcmd : string[50];
  109. stripopt : string[2];
  110. libpathprefix : string[13];
  111. libpathsuffix : string[2];
  112. groupstart : string[8];
  113. groupend : string[2];
  114. inputstart : string[8];
  115. inputend : string[2];
  116. libprefix : string[2];
  117. end;
  118. tarinfo = record
  119. arbin : string[8];
  120. arcmd : string[50];
  121. end;
  122. ttargetinfo = record
  123. target : ttarget;
  124. short_name : string[8];
  125. unit_env : string[12];
  126. system_unit : string[8];
  127. smartext,
  128. unitext,
  129. unitlibext,
  130. asmext,
  131. objext,
  132. exeext : string[4];
  133. os : tos;
  134. link : tlink;
  135. assem : tasm;
  136. ar : tar;
  137. heapsize,
  138. maxheapsize,
  139. stacksize : longint;
  140. end;
  141. tasmmodeinfo=record
  142. id : tasmmode;
  143. idtxt : string[8];
  144. end;
  145. const
  146. {$ifdef i386}
  147. target_cpu = i386;
  148. {$endif i386}
  149. {$ifdef m68k}
  150. target_cpu = m68k;
  151. {$endif m68k}
  152. var
  153. target_info : ttargetinfo;
  154. target_os : tosinfo;
  155. target_asm : tasminfo;
  156. target_link : tlinkinfo;
  157. target_ar : tarinfo;
  158. source_os : tosinfo;
  159. function set_string_target(const s : string) : boolean;
  160. function set_string_asm(const s : string) : boolean;
  161. function set_string_asmmode(const s:string;var t:tasmmode):boolean;
  162. implementation
  163. const
  164. {****************************************************************************
  165. OS Info
  166. ****************************************************************************}
  167. os_infos : array[tos] of tosinfo = (
  168. {$ifdef i386}
  169. (
  170. name : 'GO32 V1 DOS extender';
  171. sharedlibext : '.dll';
  172. staticlibext : '.a';
  173. sourceext : '.pp';
  174. pasext : '.pas';
  175. exeext : ''; { No .exe, the linker only output a.out ! }
  176. scriptext : '.bat';
  177. libprefix : '';
  178. Cprefix : '_';
  179. newline : #13#10;
  180. endian : endian_little;
  181. use_function_relative_addresses : true
  182. ),
  183. (
  184. name : 'GO32 V2 DOS extender';
  185. sharedlibext : '.dll';
  186. staticlibext : '.a';
  187. sourceext : '.pp';
  188. pasext : '.pas';
  189. exeext : '.exe';
  190. scriptext : '.bat';
  191. libprefix : '';
  192. Cprefix : '_';
  193. newline : #13#10;
  194. endian : endian_little;
  195. use_function_relative_addresses : true
  196. ),
  197. (
  198. name : 'Linux-i386';
  199. sharedlibext : '.so';
  200. staticlibext : '.a';
  201. sourceext : '.pp';
  202. pasext : '.pas';
  203. exeext : '';
  204. scriptext : '.sh';
  205. libprefix : 'lib';
  206. Cprefix : '';
  207. newline : #10;
  208. endian : endian_little;
  209. use_function_relative_addresses : true
  210. ),
  211. (
  212. name : 'OS/2 via EMX';
  213. sharedlibext : '.ao2';
  214. staticlibext : '.ao2';
  215. sourceext : '.pas';
  216. pasext : '.pp';
  217. exeext : '.exe';
  218. scriptext : '.cmd';
  219. libprefix : '';
  220. Cprefix : '_';
  221. newline : #13#10;
  222. endian : endian_little;
  223. use_function_relative_addresses : false
  224. ),
  225. (
  226. name : 'Win32';
  227. sharedlibext : '.dll';
  228. staticlibext : '.aw';
  229. sourceext : '.pp';
  230. pasext : '.pas';
  231. exeext : '.exe';
  232. scriptext : '.bat';
  233. libprefix : 'lib';
  234. Cprefix : '_';
  235. newline : #13#10;
  236. endian : endian_little;
  237. use_function_relative_addresses : true
  238. )
  239. {$endif i386}
  240. {$ifdef m68k}
  241. (
  242. name : 'Commodore Amiga';
  243. sharedlibext : '.library';
  244. staticlibext : '.a';
  245. sourceext : '.pp';
  246. pasext : '.pas';
  247. exeext : '';
  248. scriptext : '';
  249. libprefix : '';
  250. Cprefix : '_';
  251. newline : #10;
  252. endian : en_big_endian;
  253. use_function_relative_addresses : false
  254. ),
  255. (
  256. name : 'Atari ST/STE';
  257. sharedlibext : '.dll';
  258. staticlibext : '.a';
  259. sourceext : '.pp';
  260. pasext : '.pas';
  261. exeext : '.tpp';
  262. scriptext : '';
  263. libprefix : '';
  264. Cprefix : '_';
  265. newline : #10;
  266. endian : en_big_endian;
  267. use_function_relative_addresses : false
  268. ),
  269. (
  270. name : 'Macintosh m68k';
  271. sharedlibext : '.dll';
  272. staticlibext : '.a';
  273. sourceext : '.pp';
  274. pasext : '.pas';
  275. exeext : '.tpp';
  276. scriptext : '';
  277. libprefix : '';
  278. Cprefix : '_';
  279. newline : #13;
  280. endian : en_big_endian;
  281. use_function_relative_addresses : false
  282. ),
  283. (
  284. name : 'Linux-m68k';
  285. sharedlibext : '.so';
  286. staticlibext : '.a';
  287. sourceext : '.pp';
  288. pasext : '.pas';
  289. exeext : '';
  290. scriptext : '.sh';
  291. libprefix : 'lib';
  292. Cprefix : '';
  293. newline : #10;
  294. endian : en_big_endian;
  295. use_function_relative_addresses : true
  296. ),
  297. (
  298. name : 'PalmOS';
  299. sharedlibext : '.so';
  300. staticlibext : '.a';
  301. sourceext : '.pp';
  302. pasext : '.pas';
  303. exeext : '';
  304. scriptext : '.sh';
  305. libprefix : 'lib';
  306. Cprefix : '_';
  307. newline : #10;
  308. endian : en_big_endian;
  309. use_function_relative_addresses : false
  310. )
  311. {$endif m68k}
  312. );
  313. {****************************************************************************
  314. Assembler Info
  315. ****************************************************************************}
  316. as_infos : array[tasm] of tasminfo = (
  317. {$ifdef i386}
  318. (
  319. id : as_o;
  320. idtxt : 'O';
  321. asmbin : 'as';
  322. asmcmd : '-o $OBJ $ASM';
  323. externals : false;
  324. labelprefix : '.L';
  325. comment : '# '
  326. )
  327. ,(
  328. id : as_o_aout;
  329. idtxt : 'O_AOUT';
  330. asmbin : 'as';
  331. asmcmd : '-o $OBJ $ASM';
  332. externals : false;
  333. labelprefix : 'L';
  334. comment : '# '
  335. )
  336. ,(
  337. id : as_asw;
  338. idtxt : 'ASW';
  339. asmbin : 'asw';
  340. asmcmd : '-o $OBJ $ASM';
  341. externals : false;
  342. labelprefix : '.L';
  343. comment : '# '
  344. )
  345. ,(
  346. id : as_nasmcoff;
  347. idtxt : 'NASMCOFF';
  348. asmbin : 'nasm';
  349. asmcmd : '-f coff -o $OBJ $ASM';
  350. externals : true;
  351. labelprefix : 'L';
  352. comment : '; '
  353. )
  354. ,(
  355. id : as_nasmelf;
  356. idtxt : 'NASMELF';
  357. asmbin : 'nasm';
  358. asmcmd : '-f elf -o $OBJ $ASM';
  359. externals : true;
  360. labelprefix : 'L';
  361. comment : '; '
  362. )
  363. ,(
  364. id : as_nasmobj;
  365. idtxt : 'NASMOBJ';
  366. asmbin : 'nasm';
  367. asmcmd : '-f obj -o $OBJ $ASM';
  368. externals : true;
  369. labelprefix : 'L';
  370. comment : '; '
  371. )
  372. ,(
  373. id : as_tasm;
  374. idtxt : 'TASM';
  375. asmbin : 'tasm';
  376. asmcmd : '/m2 $ASM $OBJ';
  377. externals : true;
  378. labelprefix : '.L';
  379. comment : '; '
  380. )
  381. ,(
  382. id : as_tasm;
  383. idtxt : 'MASM';
  384. asmbin : 'masm';
  385. asmcmd : '$ASM $OBJ';
  386. externals : true;
  387. labelprefix : '.L';
  388. comment : '; '
  389. )
  390. {$endif i386}
  391. {$ifdef m68k}
  392. (
  393. id : as_o;
  394. idtxt : 'O';
  395. asmbin : 'as';
  396. asmcmd : '-o $OBJ $ASM';
  397. externals : false;
  398. labelprefix : '.L';
  399. comment : '# '
  400. )
  401. ,(
  402. id : as_gas;
  403. idtxt : 'GAS';
  404. asmbin : 'as68k'; { Gas for the Amiga}
  405. asmcmd : '--register-prefix-optional -o $OBJ $ASM';
  406. externals : false;
  407. labelprefix : '.L';
  408. comment : '| '
  409. )
  410. ,(
  411. id : as_mit;
  412. idtxt : 'MIT';
  413. asmbin : '';
  414. asmcmd : '-o $OBJ $ASM';
  415. externals : false;
  416. labelprefix : '.L';
  417. comment : '| '
  418. )
  419. ,(
  420. id : as_mot;
  421. idtxt : 'MOT';
  422. asmbin : '';
  423. asmcmd : '-o $OBJ $ASM';
  424. externals : false;
  425. labelprefix : '__L';
  426. comment : '| '
  427. )
  428. ,(
  429. id : as_mpw;
  430. idtxt : 'MPW';
  431. asmbin : '';
  432. asmcmd : '-model far -o $OBJ $ASM';
  433. externals : false;
  434. labelprefix : '__L';
  435. comment : '| '
  436. )
  437. {$endif m68k}
  438. );
  439. {****************************************************************************
  440. Linker Info
  441. ****************************************************************************}
  442. link_infos : array[tlink] of tlinkinfo = (
  443. {$ifdef i386}
  444. (
  445. linkbin : 'ld';
  446. linkcmd : '$OPT -o $EXE $RES';
  447. bindbin : '';
  448. bindcmd : '';
  449. stripopt : '-s';
  450. libpathprefix : 'SEARCH_DIR(';
  451. libpathsuffix : ')';
  452. groupstart : 'GROUP(';
  453. groupend : ')';
  454. inputstart : 'INPUT(';
  455. inputend : ')';
  456. libprefix : '-l'
  457. )
  458. ,(
  459. linkbin : 'ld';
  460. linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
  461. bindbin : 'aout2exe';
  462. bindcmd : '$EXE';
  463. stripopt : '-s';
  464. libpathprefix : '-L';
  465. libpathsuffix : '';
  466. groupstart : '-(';
  467. groupend : '-)';
  468. inputstart : '';
  469. inputend : '';
  470. libprefix : '-l'
  471. )
  472. ,(
  473. linkbin : 'ld';
  474. linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
  475. bindbin : '';
  476. bindcmd : '';
  477. stripopt : '-s';
  478. libpathprefix : '-L';
  479. libpathsuffix : '';
  480. groupstart : '-(';
  481. groupend : '-)';
  482. inputstart : '';
  483. inputend : '';
  484. libprefix : '-l'
  485. )
  486. ,(
  487. linkbin : 'ldw';
  488. linkcmd : '$OPT -o $EXE $RES';
  489. bindbin : '';
  490. bindcmd : '';
  491. stripopt : '-s';
  492. libpathprefix : 'SEARCH_DIR(';
  493. libpathsuffix : ')';
  494. groupstart : 'GROUP(';
  495. groupend : ')';
  496. inputstart : 'INPUT(';
  497. inputend : ')';
  498. libprefix : '-l'
  499. )
  500. ,(
  501. linkbin : 'ld'; { Os/2 }
  502. linkcmd : '-o $EXE @$RES';
  503. bindbin : 'emxbind';
  504. bindcmd : '-b -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB';
  505. stripopt : '-s';
  506. libpathprefix : '-L';
  507. libpathsuffix : '';
  508. groupstart : ''; {Linker is too primitive...}
  509. groupend : '';
  510. inputstart : '';
  511. inputend : '';
  512. libprefix : '-l'
  513. )
  514. {$endif i386}
  515. {$ifdef m68k}
  516. (
  517. linkbin : 'ld';
  518. linkcmd : '$OPT -o $EXE $RES';
  519. bindbin : '';
  520. bindcmd : '';
  521. stripopt : '-s';
  522. libpathprefix : 'SEARCH_DIR(';
  523. libpathsuffix : ')';
  524. groupstart : 'GROUP(';
  525. groupend : ')';
  526. inputstart : 'INPUT(';
  527. inputend : ')';
  528. libprefix : '-l'
  529. )
  530. {$endif m68k}
  531. );
  532. {****************************************************************************
  533. Ar Info
  534. ****************************************************************************}
  535. ar_infos : array[tar] of tarinfo = (
  536. {$ifdef i386}
  537. (
  538. arbin : 'ar';
  539. arcmd : 'rs $LIB $FILES'
  540. ),
  541. (
  542. arbin : 'arw';
  543. arcmd : 'rs $LIB $FILES'
  544. )
  545. {$endif i386}
  546. {$ifdef m68k}
  547. (
  548. arbin : 'ar';
  549. arcmd : 'rs $LIB $FILES'
  550. )
  551. {$endif m68k}
  552. );
  553. {****************************************************************************
  554. Targets Info
  555. ****************************************************************************}
  556. target_infos : array[ttarget] of ttargetinfo = (
  557. {$ifdef i386}
  558. (
  559. target : target_GO32V1;
  560. short_name : 'GO32V1';
  561. unit_env : 'GO32V1UNITS';
  562. system_unit : 'SYSTEM';
  563. smartext : '.sl';
  564. unitext : '.pp1';
  565. unitlibext : '.ppl';
  566. asmext : '.s1';
  567. objext : '.o1';
  568. exeext : ''; { The linker produces a.out }
  569. os : os_GO32V1;
  570. link : link_ldgo32v1;
  571. assem : as_o;
  572. ar : ar_ar;
  573. heapsize : 2048*1024;
  574. maxheapsize : 32768*1024;
  575. stacksize : 16384
  576. ),
  577. (
  578. target : target_GO32V2;
  579. short_name : 'GO32V2';
  580. unit_env : 'GO32V2UNITS';
  581. system_unit : 'SYSTEM';
  582. smartext : '.sl';
  583. unitext : '.ppu';
  584. unitlibext : '.ppl';
  585. asmext : '.s';
  586. objext : '.o';
  587. exeext : '.exe';
  588. os : os_GO32V2;
  589. link : link_ldgo32v2;
  590. assem : as_o;
  591. ar : ar_ar;
  592. heapsize : 2048*1024;
  593. maxheapsize : 32768*1024;
  594. stacksize : 16384
  595. ),
  596. (
  597. target : target_LINUX;
  598. short_name : 'LINUX';
  599. unit_env : 'LINUXUNITS';
  600. system_unit : 'syslinux';
  601. smartext : '.sl';
  602. unitext : '.ppu';
  603. unitlibext : '.ppl';
  604. asmext : '.s';
  605. objext : '.o';
  606. exeext : '';
  607. os : os_Linux;
  608. link : link_ld;
  609. assem : as_o;
  610. ar : ar_ar;
  611. heapsize : 2048*1024;
  612. maxheapsize : 32768*1024;
  613. stacksize : 8192
  614. ),
  615. (
  616. target : target_OS2;
  617. short_name : 'OS2';
  618. unit_env : 'OS2UNITS';
  619. system_unit : 'SYSOS2';
  620. smartext : '.sl';
  621. unitext : '.ppo';
  622. unitlibext : '.ppl';
  623. asmext : '.so2';
  624. objext : '.oo2';
  625. exeext : ''; { The linker produces a.out }
  626. os : os_OS2;
  627. link : link_ldos2;
  628. assem : as_o_aout;
  629. ar : ar_ar;
  630. heapsize : 256*1024;
  631. maxheapsize : 32768*1024;
  632. stacksize : 32768
  633. ),
  634. (
  635. target : target_WIN32;
  636. short_name : 'WIN32';
  637. unit_env : 'WIN32UNITS';
  638. system_unit : 'SYSWIN32';
  639. smartext : '.slw';
  640. unitext : '.ppw';
  641. unitlibext : '.ppl';
  642. asmext : '.sw';
  643. objext : '.ow';
  644. exeext : '.exe';
  645. os : os_Win32;
  646. link : link_ldw;
  647. assem : as_asw;
  648. ar : ar_arw;
  649. heapsize : 8192*1024; { Until growing heap works !! (PFV) }
  650. maxheapsize : 32768*1024;
  651. stacksize : 32768
  652. )
  653. {$endif i386}
  654. {$ifdef m68k}
  655. (
  656. target : target_Amiga;
  657. short_name : 'AMIGA';
  658. unit_env : '';
  659. system_unit : 'sysamiga';
  660. smartext : '.sl';
  661. unitext : '.ppa';
  662. unitlibext : '.ppl';
  663. asmext : '.asm';
  664. objext : '.o';
  665. exeext : '';
  666. os : os_Amiga;
  667. link : link_ld;
  668. assem : as_o;
  669. ar : ar_ar;
  670. heapsize : 128*1024;
  671. maxheapsize : 32768*1024;
  672. stacksize : 8192
  673. ),
  674. (
  675. target : target_Atari;
  676. short_name : 'ATARI';
  677. unit_env : '';
  678. system_unit : 'SYSATARI';
  679. smartext : '.sl';
  680. unitext : '.ppt';
  681. unitlibext : '.ppl';
  682. asmext : '.s';
  683. objext : '.o';
  684. exeext : '.ttp';
  685. os : os_Atari;
  686. link : link_ld;
  687. assem : as_o;
  688. ar : ar_ar;
  689. heapsize : 16*1024;
  690. maxheapsize : 32768*1024;
  691. stacksize : 8192
  692. ),
  693. (
  694. target : target_Mac68k;
  695. short_name : 'MACOS';
  696. unit_env : '';
  697. system_unit : 'sysmac';
  698. smartext : '.sl';
  699. unitext : '.ppt';
  700. unitlibext : '.ppl';
  701. asmext : '.a';
  702. objext : '.o';
  703. exeext : '';
  704. os : os_Mac68k;
  705. link : link_ld;
  706. assem : as_mpw;
  707. ar : ar_ar;
  708. heapsize : 128*1024;
  709. maxheapsize : 32768*1024;
  710. stacksize : 8192
  711. ),
  712. (
  713. target : target_Linux;
  714. short_name : 'LINUX';
  715. unit_env : 'LINUXUNITS';
  716. system_unit : 'syslinux';
  717. smartext : '.sl';
  718. unitext : '.ppu';
  719. unitlibext : '.ppl';
  720. asmext : '.s';
  721. objext : '.o';
  722. exeext : '';
  723. os : os_Linux;
  724. link : link_ld;
  725. assem : as_o;
  726. ar : ar_ar;
  727. heapsize : 128*1024;
  728. maxheapsize : 32768*1024;
  729. stacksize : 8192
  730. ),
  731. (
  732. target : target_PalmOS;
  733. short_name : 'PALMOS';
  734. unit_env : 'PALMUNITS';
  735. system_unit : 'syspalm';
  736. smartext : '.sl';
  737. unitext : '.ppu';
  738. unitlibext : '.ppl';
  739. asmext : '.s';
  740. objext : '.o';
  741. exeext : '';
  742. os : os_PalmOS;
  743. link : link_ld;
  744. assem : as_o;
  745. ar : ar_ar;
  746. heapsize : 128*1024;
  747. maxheapsize : 32768*1024;
  748. stacksize : 8192
  749. )
  750. {$endif m68k}
  751. );
  752. {****************************************************************************
  753. AsmModeInfo
  754. ****************************************************************************}
  755. asmmodeinfos : array[tasmmode] of tasmmodeinfo = (
  756. {$ifdef i386}
  757. (
  758. id : I386_DIRECT;
  759. idtxt : 'DIRECT'
  760. ),
  761. (
  762. id : I386_INTEL;
  763. idtxt : 'INTEL'
  764. ),
  765. (
  766. id : I386_ATT;
  767. idtxt : 'ATT'
  768. )
  769. {$endif i386}
  770. {$ifdef m68k}
  771. (
  772. id : M68K_MOT;
  773. idtxt : 'MOT'
  774. )
  775. {$endif m68k}
  776. );
  777. {****************************************************************************
  778. Helpers
  779. ****************************************************************************}
  780. procedure set_target(t : ttarget);
  781. begin
  782. target_info:=target_infos[t];
  783. target_os:=os_infos[target_info.os];
  784. target_asm:=as_infos[target_info.assem];
  785. target_link:=link_infos[target_info.link];
  786. target_ar:=ar_infos[target_info.ar];
  787. end;
  788. {****************************************************************************
  789. Load from string
  790. ****************************************************************************}
  791. function set_string_target(const s : string) : boolean;
  792. var
  793. i : longint;
  794. begin
  795. set_string_target:=false;
  796. for i:=0 to (sizeof(target_infos) div sizeof(ttargetinfo))-1 do
  797. if target_infos[ttarget(i)].short_name=s then
  798. begin
  799. set_target(ttarget(i));
  800. set_string_target:=true;
  801. end;
  802. end;
  803. function set_string_asm(const s : string) : boolean;
  804. var
  805. i : longint;
  806. begin
  807. set_string_asm:=false;
  808. for i:=0 to (sizeof(as_infos) div sizeof(tasminfo))-1 do
  809. if as_infos[tasm(i)].idtxt=s then
  810. begin
  811. target_asm:=as_infos[tasm(i)];
  812. set_string_asm:=true;
  813. end;
  814. end;
  815. function set_string_asmmode(const s:string;var t:tasmmode):boolean;
  816. var
  817. i : longint;
  818. begin
  819. set_string_asmmode:=false;
  820. for i:=0 to (sizeof(asmmodeinfos) div sizeof(tasmmodeinfo))-1 do
  821. if asmmodeinfos[tasmmode(i)].idtxt=s then
  822. begin
  823. t:=asmmodeinfos[tasmmode(i)].id;
  824. set_string_asmmode:=true;
  825. end;
  826. end;
  827. {****************************************************************************
  828. Initialization of default target
  829. ****************************************************************************}
  830. procedure default_os(t:ttarget);
  831. begin
  832. set_target(t);
  833. source_os:=os_infos[target_info.os];
  834. end;
  835. begin
  836. {$ifdef i386}
  837. {$ifdef GO32V1}
  838. default_os(target_GO32V1);
  839. {$else}
  840. {$ifdef GO32V2}
  841. default_os(target_GO32V2);
  842. {$else}
  843. {$ifdef OS2}
  844. default_os(target_OS2);
  845. {$else}
  846. {$ifdef LINUX}
  847. default_os(target_LINUX);
  848. {$else}
  849. {$ifdef WIN32}
  850. default_os(target_WIN32);
  851. {$else}
  852. default_os(target_GO32V2);
  853. {$endif win32}
  854. {$endif linux}
  855. {$endif os2}
  856. {$endif go32v2}
  857. {$endif go32v1}
  858. {$endif i386}
  859. {$ifdef m68k}
  860. {$ifdef AMIGA}
  861. default_os(target_Amiga);
  862. {$else}
  863. {$ifdef ATARI}
  864. default_os(target_Atari);
  865. {$else}
  866. {$ifdef MACOS}
  867. default_os(target_MAC68k);
  868. {$else}
  869. default_os(target_Amiga);
  870. {$endif macos}
  871. {$endif atari}
  872. {$endif amiga}
  873. {$endif m68k}
  874. end.
  875. {
  876. $Log$
  877. Revision 1.38 1998-10-07 04:26:58 carl
  878. * bugfixes
  879. + added mpw support
  880. Revision 1.37 1998/10/06 20:40:58 peter
  881. * remove -D from assemblers
  882. Revision 1.36 1998/09/16 16:41:50 peter
  883. * merged fixes
  884. Revision 1.33.2.3 1998/09/16 16:13:13 peter
  885. * win32 .o -> .ow and .a -> .aw
  886. Revision 1.35 1998/09/11 17:35:33 peter
  887. * fixed tabs
  888. Revision 1.34 1998/09/11 12:27:55 pierre
  889. * restored m68k part
  890. Revision 1.33.2.2 1998/09/11 17:29:20 peter
  891. * fixed tabs
  892. Revision 1.33.2.1 1998/09/11 12:06:00 pierre
  893. * m68k part restored
  894. Revision 1.33 1998/09/10 15:25:39 daniel
  895. + Added maxheapsize.
  896. * Corrected semi-bug in calling the assembler and the linker
  897. Revision 1.31 1998/09/01 09:07:13 peter
  898. * m68k fixes, splitted cg68k like cgi386
  899. Revision 1.30 1998/08/31 12:26:34 peter
  900. * m68k and palmos updates from surebugfixes
  901. Revision 1.29 1998/08/26 10:09:21 peter
  902. * more lowercase extensions
  903. Revision 1.28 1998/08/25 12:42:47 pierre
  904. * CDECL changed to CVAR for variables
  905. specifications are read in structures also
  906. + started adding GPC compatibility mode ( option -Sp)
  907. * names changed to lowercase
  908. Revision 1.27 1998/08/21 15:16:57 peter
  909. * win32 compiles a bit better, no growheap crash
  910. Revision 1.26 1998/08/19 16:07:55 jonas
  911. * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
  912. Revision 1.25 1998/08/18 09:24:45 pierre
  913. * small warning position bug fixed
  914. * support_mmx switches splitting was missing
  915. * rhide error and warning output corrected
  916. Revision 1.24 1998/08/17 09:17:54 peter
  917. * static/shared linking updates
  918. Revision 1.23 1998/06/25 08:48:20 florian
  919. * first version of rtti support
  920. Revision 1.22 1998/06/17 14:10:21 peter
  921. * small os2 fixes
  922. * fixed interdependent units with newppu (remake3 under linux works now)
  923. Revision 1.20 1998/06/15 15:38:14 pierre
  924. * small bug in systems.pas corrected
  925. + operators in different units better hanlded
  926. Revision 1.19 1998/06/15 13:34:24 daniel
  927. * Fixed spelling mistakes in comments.
  928. * Fixed some OS/2 parameters.
  929. Revision 1.18 1998/06/08 22:59:54 peter
  930. * smartlinking works for win32
  931. * some defines to exclude some compiler parts
  932. Revision 1.17 1998/06/04 23:52:04 peter
  933. * m68k compiles
  934. + .def file creation moved to gendef.pas so it could also be used
  935. for win32
  936. Revision 1.16 1998/06/01 16:50:22 peter
  937. + boolean -> ord conversion
  938. * fixed ord -> boolean conversion
  939. Revision 1.15 1998/05/30 14:31:11 peter
  940. + $ASMMODE
  941. Revision 1.14 1998/05/29 13:24:45 peter
  942. + asw assembler
  943. Revision 1.13 1998/05/27 00:20:33 peter
  944. * some scanner optimizes
  945. * automaticly aout2exe for go32v1
  946. * fixed dynamiclinker option which was added at the wrong place
  947. Revision 1.12 1998/05/23 01:21:32 peter
  948. + aktasmmode, aktoptprocessor, aktoutputformat
  949. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  950. + $LIBNAME to set the library name where the unit will be put in
  951. * splitted cgi386 a bit (codeseg to large for bp7)
  952. * nasm, tasm works again. nasm moved to ag386nsm.pas
  953. Revision 1.11 1998/05/22 12:32:49 peter
  954. * fixed -L on the commandline, Dos commandline is only 128 bytes
  955. Revision 1.10 1998/05/11 13:07:58 peter
  956. + $ifdef NEWPPU for the new ppuformat
  957. + $define GDB not longer required
  958. * removed all warnings and stripped some log comments
  959. * no findfirst/findnext anymore to remove smartlink *.o files
  960. Revision 1.9 1998/05/06 08:38:49 pierre
  961. * better position info with UseTokenInfo
  962. UseTokenInfo greatly simplified
  963. + added check for changed tree after first time firstpass
  964. (if we could remove all the cases were it happen
  965. we could skip all firstpass if firstpasscount > 1)
  966. Only with ExtDebug
  967. Revision 1.8 1998/05/04 20:19:54 peter
  968. * small fix for go32v2
  969. Revision 1.7 1998/05/04 17:54:29 peter
  970. + smartlinking works (only case jumptable left todo)
  971. * redesign of systems.pas to support assemblers and linkers
  972. + Unitname is now also in the PPU-file, increased version to 14
  973. Revision 1.6 1998/05/01 07:43:57 florian
  974. + basics for rtti implemented
  975. + switch $m (generate rtti for published sections)
  976. Revision 1.5 1998/04/29 10:34:06 pierre
  977. + added some code for ansistring (not complete nor working yet)
  978. * corrected operator overloading
  979. * corrected nasm output
  980. + started inline procedures
  981. + added starstarn : use ** for exponentiation (^ gave problems)
  982. + started UseTokenInfo cond to get accurate positions
  983. Revision 1.4 1998/04/27 15:45:20 peter
  984. + -Xl for smartlink
  985. + target_info.arext = .a
  986. Revision 1.3 1998/04/16 10:50:45 daniel
  987. * Fixed some things that were broken for OS/2.
  988. }