systems.pas 30 KB

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