2
0

systems.pas 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  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
  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. {$endif m68k}
  429. );
  430. {****************************************************************************
  431. Linker Info
  432. ****************************************************************************}
  433. link_infos : array[tlink] of tlinkinfo = (
  434. {$ifdef i386}
  435. (
  436. linkbin : 'ld';
  437. linkcmd : '$OPT -o $EXE $RES';
  438. bindbin : '';
  439. bindcmd : '';
  440. stripopt : '-s';
  441. libpathprefix : 'SEARCH_DIR(';
  442. libpathsuffix : ')';
  443. groupstart : 'GROUP(';
  444. groupend : ')';
  445. inputstart : 'INPUT(';
  446. inputend : ')';
  447. libprefix : '-l'
  448. )
  449. ,(
  450. linkbin : 'ld';
  451. linkcmd : '-oformat coff-go32 $OPT -o $EXE @$RES';
  452. bindbin : 'aout2exe';
  453. bindcmd : '$EXE';
  454. stripopt : '-s';
  455. libpathprefix : '-L';
  456. libpathsuffix : '';
  457. groupstart : '-(';
  458. groupend : '-)';
  459. inputstart : '';
  460. inputend : '';
  461. libprefix : '-l'
  462. )
  463. ,(
  464. linkbin : 'ld';
  465. linkcmd : '-oformat coff-go32-exe $OPT -o $EXE @$RES';
  466. bindbin : '';
  467. bindcmd : '';
  468. stripopt : '-s';
  469. libpathprefix : '-L';
  470. libpathsuffix : '';
  471. groupstart : '-(';
  472. groupend : '-)';
  473. inputstart : '';
  474. inputend : '';
  475. libprefix : '-l'
  476. )
  477. ,(
  478. linkbin : 'ldw';
  479. linkcmd : '$OPT -o $EXE $RES';
  480. bindbin : '';
  481. bindcmd : '';
  482. stripopt : '-s';
  483. libpathprefix : 'SEARCH_DIR(';
  484. libpathsuffix : ')';
  485. groupstart : 'GROUP(';
  486. groupend : ')';
  487. inputstart : 'INPUT(';
  488. inputend : ')';
  489. libprefix : '-l'
  490. )
  491. ,(
  492. linkbin : 'ld'; { Os/2 }
  493. linkcmd : '-o $EXE @$RES';
  494. bindbin : 'emxbind';
  495. bindcmd : '-b -k$STACKKB -h$HEAPMB -o $EXE.exe $EXE -aim -s$DOSHEAPKB';
  496. stripopt : '-s';
  497. libpathprefix : '-L';
  498. libpathsuffix : '';
  499. groupstart : ''; {Linker is too primitive...}
  500. groupend : '';
  501. inputstart : '';
  502. inputend : '';
  503. libprefix : '-l'
  504. )
  505. {$endif i386}
  506. {$ifdef m68k}
  507. (
  508. linkbin : 'ld';
  509. linkcmd : '$OPT -o $EXE $RES';
  510. bindbin : '';
  511. bindcmd : '';
  512. stripopt : '-s';
  513. libpathprefix : 'SEARCH_DIR(';
  514. libpathsuffix : ')';
  515. groupstart : 'GROUP(';
  516. groupend : ')';
  517. inputstart : 'INPUT(';
  518. inputend : ')';
  519. libprefix : '-l'
  520. )
  521. {$endif m68k}
  522. );
  523. {****************************************************************************
  524. Ar Info
  525. ****************************************************************************}
  526. ar_infos : array[tar] of tarinfo = (
  527. {$ifdef i386}
  528. (
  529. arbin : 'ar';
  530. arcmd : 'rs $LIB $FILES'
  531. ),
  532. (
  533. arbin : 'arw';
  534. arcmd : 'rs $LIB $FILES'
  535. )
  536. {$endif i386}
  537. {$ifdef m68k}
  538. (
  539. arbin : 'ar';
  540. arcmd : 'rs $LIB $FILES'
  541. )
  542. {$endif m68k}
  543. );
  544. {****************************************************************************
  545. Targets Info
  546. ****************************************************************************}
  547. target_infos : array[ttarget] of ttargetinfo = (
  548. {$ifdef i386}
  549. (
  550. target : target_GO32V1;
  551. short_name : 'GO32V1';
  552. unit_env : 'GO32V1UNITS';
  553. system_unit : 'SYSTEM';
  554. smartext : '.sl';
  555. unitext : '.pp1';
  556. unitlibext : '.ppl';
  557. asmext : '.s1';
  558. objext : '.o1';
  559. exeext : ''; { The linker produces a.out }
  560. os : os_GO32V1;
  561. link : link_ldgo32v1;
  562. assem : as_o;
  563. ar : ar_ar;
  564. heapsize : 2048*1024;
  565. maxheapsize : 32768*1024;
  566. stacksize : 16384
  567. ),
  568. (
  569. target : target_GO32V2;
  570. short_name : 'GO32V2';
  571. unit_env : 'GO32V2UNITS';
  572. system_unit : 'SYSTEM';
  573. smartext : '.sl';
  574. unitext : '.ppu';
  575. unitlibext : '.ppl';
  576. asmext : '.s';
  577. objext : '.o';
  578. exeext : '.exe';
  579. os : os_GO32V2;
  580. link : link_ldgo32v2;
  581. assem : as_o;
  582. ar : ar_ar;
  583. heapsize : 2048*1024;
  584. maxheapsize : 32768*1024;
  585. stacksize : 16384
  586. ),
  587. (
  588. target : target_LINUX;
  589. short_name : 'LINUX';
  590. unit_env : 'LINUXUNITS';
  591. system_unit : 'syslinux';
  592. smartext : '.sl';
  593. unitext : '.ppu';
  594. unitlibext : '.ppl';
  595. asmext : '.s';
  596. objext : '.o';
  597. exeext : '';
  598. os : os_Linux;
  599. link : link_ld;
  600. assem : as_o;
  601. ar : ar_ar;
  602. heapsize : 2048*1024;
  603. maxheapsize : 32768*1024;
  604. stacksize : 8192
  605. ),
  606. (
  607. target : target_OS2;
  608. short_name : 'OS2';
  609. unit_env : 'OS2UNITS';
  610. system_unit : 'SYSOS2';
  611. smartext : '.sl';
  612. unitext : '.ppo';
  613. unitlibext : '.ppl';
  614. asmext : '.so2';
  615. objext : '.oo2';
  616. exeext : ''; { The linker produces a.out }
  617. os : os_OS2;
  618. link : link_ldos2;
  619. assem : as_o_aout;
  620. ar : ar_ar;
  621. heapsize : 256*1024;
  622. maxheapsize : 32768*1024;
  623. stacksize : 32768
  624. ),
  625. (
  626. target : target_WIN32;
  627. short_name : 'WIN32';
  628. unit_env : 'WIN32UNITS';
  629. system_unit : 'SYSWIN32';
  630. smartext : '.slw';
  631. unitext : '.ppw';
  632. unitlibext : '.ppl';
  633. asmext : '.sw';
  634. objext : '.ow';
  635. exeext : '.exe';
  636. os : os_Win32;
  637. link : link_ldw;
  638. assem : as_asw;
  639. ar : ar_arw;
  640. heapsize : 8192*1024; { Until growing heap works !! (PFV) }
  641. maxheapsize : 32768*1024;
  642. stacksize : 32768
  643. )
  644. {$endif i386}
  645. {$ifdef m68k}
  646. (
  647. target : target_Amiga;
  648. short_name : 'AMIGA';
  649. unit_env : '';
  650. system_unit : 'sysamiga';
  651. smartext : '.sl';
  652. unitext : '.ppa';
  653. unitlibext : '.ppl';
  654. asmext : '.asm';
  655. objext : '.o';
  656. exeext : '';
  657. os : os_Amiga;
  658. link : link_ld;
  659. assem : as_o;
  660. ar : ar_ar;
  661. heapsize : 128*1024;
  662. maxheapsize : 32768*1024;
  663. stacksize : 8192
  664. ),
  665. (
  666. target : target_Atari;
  667. short_name : 'ATARI';
  668. unit_env : '';
  669. system_unit : 'SYSATARI';
  670. smartext : '.sl';
  671. unitext : '.ppt';
  672. unitlibext : '.ppl';
  673. asmext : '.s';
  674. objext : '.o';
  675. exeext : '';
  676. os : os_Atari;
  677. link : link_ld;
  678. assem : as_o;
  679. ar : ar_ar;
  680. heapsize : 16*1024;
  681. maxheapsize : 32768*1024;
  682. stacksize : 8192
  683. ),
  684. (
  685. target : target_Mac68k;
  686. short_name : 'MACOS';
  687. unit_env : '';
  688. system_unit : 'sysmac';
  689. smartext : '.sl';
  690. unitext : '.ppt';
  691. unitlibext : '.ppl';
  692. asmext : '.s';
  693. objext : '.o';
  694. exeext : '';
  695. os : os_Mac68k;
  696. link : link_ld;
  697. assem : as_o;
  698. ar : ar_ar;
  699. heapsize : 128*1024;
  700. maxheapsize : 32768*1024;
  701. stacksize : 8192
  702. ),
  703. (
  704. target : target_Linux;
  705. short_name : 'LINUX';
  706. unit_env : 'LINUXUNITS';
  707. system_unit : 'syslinux';
  708. smartext : '.sl';
  709. unitext : '.ppu';
  710. unitlibext : '.ppl';
  711. asmext : '.s';
  712. objext : '.o';
  713. exeext : '';
  714. os : os_Linux;
  715. link : link_ld;
  716. assem : as_o;
  717. ar : ar_ar;
  718. heapsize : 128*1024;
  719. maxheapsize : 32768*1024;
  720. stacksize : 8192
  721. ),
  722. (
  723. target : target_PalmOS;
  724. short_name : 'PALMOS';
  725. unit_env : 'PALMUNITS';
  726. system_unit : 'syspalm';
  727. smartext : '.sl';
  728. unitext : '.ppu';
  729. unitlibext : '.ppl';
  730. asmext : '.s';
  731. objext : '.o';
  732. exeext : '';
  733. os : os_PalmOS;
  734. link : link_ld;
  735. assem : as_o;
  736. ar : ar_ar;
  737. heapsize : 128*1024;
  738. maxheapsize : 32768*1024;
  739. stacksize : 8192
  740. )
  741. {$endif m68k}
  742. );
  743. {****************************************************************************
  744. AsmModeInfo
  745. ****************************************************************************}
  746. asmmodeinfos : array[tasmmode] of tasmmodeinfo = (
  747. {$ifdef i386}
  748. (
  749. id : I386_DIRECT;
  750. idtxt : 'DIRECT'
  751. ),
  752. (
  753. id : I386_INTEL;
  754. idtxt : 'INTEL'
  755. ),
  756. (
  757. id : I386_ATT;
  758. idtxt : 'ATT'
  759. )
  760. {$endif i386}
  761. {$ifdef m68k}
  762. (
  763. id : M68K_MOT;
  764. idtxt : 'MOT'
  765. )
  766. {$endif m68k}
  767. );
  768. {****************************************************************************
  769. Helpers
  770. ****************************************************************************}
  771. procedure set_target(t : ttarget);
  772. begin
  773. target_info:=target_infos[t];
  774. target_os:=os_infos[target_info.os];
  775. target_asm:=as_infos[target_info.assem];
  776. target_link:=link_infos[target_info.link];
  777. target_ar:=ar_infos[target_info.ar];
  778. end;
  779. {****************************************************************************
  780. Load from string
  781. ****************************************************************************}
  782. function set_string_target(const s : string) : boolean;
  783. var
  784. i : longint;
  785. begin
  786. set_string_target:=false;
  787. for i:=0 to (sizeof(target_infos) div sizeof(ttargetinfo))-1 do
  788. if target_infos[ttarget(i)].short_name=s then
  789. begin
  790. set_target(ttarget(i));
  791. set_string_target:=true;
  792. end;
  793. end;
  794. function set_string_asm(const s : string) : boolean;
  795. var
  796. i : longint;
  797. begin
  798. set_string_asm:=false;
  799. for i:=0 to (sizeof(as_infos) div sizeof(tasminfo))-1 do
  800. if as_infos[tasm(i)].idtxt=s then
  801. begin
  802. target_asm:=as_infos[tasm(i)];
  803. set_string_asm:=true;
  804. end;
  805. end;
  806. function set_string_asmmode(const s:string;var t:tasmmode):boolean;
  807. var
  808. i : longint;
  809. begin
  810. set_string_asmmode:=false;
  811. for i:=0 to (sizeof(asmmodeinfos) div sizeof(tasmmodeinfo))-1 do
  812. if asmmodeinfos[tasmmode(i)].idtxt=s then
  813. begin
  814. t:=asmmodeinfos[tasmmode(i)].id;
  815. set_string_asmmode:=true;
  816. end;
  817. end;
  818. {****************************************************************************
  819. Initialization of default target
  820. ****************************************************************************}
  821. procedure default_os(t:ttarget);
  822. begin
  823. set_target(t);
  824. source_os:=os_infos[target_info.os];
  825. end;
  826. begin
  827. {$ifdef i386}
  828. {$ifdef GO32V1}
  829. default_os(target_GO32V1);
  830. {$else}
  831. {$ifdef GO32V2}
  832. default_os(target_GO32V2);
  833. {$else}
  834. {$ifdef OS2}
  835. default_os(target_OS2);
  836. {$else}
  837. {$ifdef LINUX}
  838. default_os(target_LINUX);
  839. {$else}
  840. {$ifdef WIN32}
  841. default_os(target_WIN32);
  842. {$else}
  843. default_os(target_GO32V2);
  844. {$endif win32}
  845. {$endif linux}
  846. {$endif os2}
  847. {$endif go32v2}
  848. {$endif go32v1}
  849. {$endif i386}
  850. {$ifdef m68k}
  851. {$ifdef AMIGA}
  852. default_os(target_Amiga);
  853. {$else}
  854. {$ifdef ATARI}
  855. default_os(target_Atari);
  856. {$else}
  857. {$ifdef MACOS}
  858. default_os(target_MAC68k);
  859. {$else}
  860. default_os(target_Amiga);
  861. {$endif macos}
  862. {$endif atari}
  863. {$endif amiga}
  864. {$endif m68k}
  865. end.
  866. {
  867. $Log$
  868. Revision 1.37 1998-10-06 20:40:58 peter
  869. * remove -D from assemblers
  870. Revision 1.36 1998/09/16 16:41:50 peter
  871. * merged fixes
  872. Revision 1.33.2.3 1998/09/16 16:13:13 peter
  873. * win32 .o -> .ow and .a -> .aw
  874. Revision 1.35 1998/09/11 17:35:33 peter
  875. * fixed tabs
  876. Revision 1.34 1998/09/11 12:27:55 pierre
  877. * restored m68k part
  878. Revision 1.33.2.2 1998/09/11 17:29:20 peter
  879. * fixed tabs
  880. Revision 1.33.2.1 1998/09/11 12:06:00 pierre
  881. * m68k part restored
  882. Revision 1.33 1998/09/10 15:25:39 daniel
  883. + Added maxheapsize.
  884. * Corrected semi-bug in calling the assembler and the linker
  885. Revision 1.31 1998/09/01 09:07:13 peter
  886. * m68k fixes, splitted cg68k like cgi386
  887. Revision 1.30 1998/08/31 12:26:34 peter
  888. * m68k and palmos updates from surebugfixes
  889. Revision 1.29 1998/08/26 10:09:21 peter
  890. * more lowercase extensions
  891. Revision 1.28 1998/08/25 12:42:47 pierre
  892. * CDECL changed to CVAR for variables
  893. specifications are read in structures also
  894. + started adding GPC compatibility mode ( option -Sp)
  895. * names changed to lowercase
  896. Revision 1.27 1998/08/21 15:16:57 peter
  897. * win32 compiles a bit better, no growheap crash
  898. Revision 1.26 1998/08/19 16:07:55 jonas
  899. * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
  900. Revision 1.25 1998/08/18 09:24:45 pierre
  901. * small warning position bug fixed
  902. * support_mmx switches splitting was missing
  903. * rhide error and warning output corrected
  904. Revision 1.24 1998/08/17 09:17:54 peter
  905. * static/shared linking updates
  906. Revision 1.23 1998/06/25 08:48:20 florian
  907. * first version of rtti support
  908. Revision 1.22 1998/06/17 14:10:21 peter
  909. * small os2 fixes
  910. * fixed interdependent units with newppu (remake3 under linux works now)
  911. Revision 1.20 1998/06/15 15:38:14 pierre
  912. * small bug in systems.pas corrected
  913. + operators in different units better hanlded
  914. Revision 1.19 1998/06/15 13:34:24 daniel
  915. * Fixed spelling mistakes in comments.
  916. * Fixed some OS/2 parameters.
  917. Revision 1.18 1998/06/08 22:59:54 peter
  918. * smartlinking works for win32
  919. * some defines to exclude some compiler parts
  920. Revision 1.17 1998/06/04 23:52:04 peter
  921. * m68k compiles
  922. + .def file creation moved to gendef.pas so it could also be used
  923. for win32
  924. Revision 1.16 1998/06/01 16:50:22 peter
  925. + boolean -> ord conversion
  926. * fixed ord -> boolean conversion
  927. Revision 1.15 1998/05/30 14:31:11 peter
  928. + $ASMMODE
  929. Revision 1.14 1998/05/29 13:24:45 peter
  930. + asw assembler
  931. Revision 1.13 1998/05/27 00:20:33 peter
  932. * some scanner optimizes
  933. * automaticly aout2exe for go32v1
  934. * fixed dynamiclinker option which was added at the wrong place
  935. Revision 1.12 1998/05/23 01:21:32 peter
  936. + aktasmmode, aktoptprocessor, aktoutputformat
  937. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  938. + $LIBNAME to set the library name where the unit will be put in
  939. * splitted cgi386 a bit (codeseg to large for bp7)
  940. * nasm, tasm works again. nasm moved to ag386nsm.pas
  941. Revision 1.11 1998/05/22 12:32:49 peter
  942. * fixed -L on the commandline, Dos commandline is only 128 bytes
  943. Revision 1.10 1998/05/11 13:07:58 peter
  944. + $ifdef NEWPPU for the new ppuformat
  945. + $define GDB not longer required
  946. * removed all warnings and stripped some log comments
  947. * no findfirst/findnext anymore to remove smartlink *.o files
  948. Revision 1.9 1998/05/06 08:38:49 pierre
  949. * better position info with UseTokenInfo
  950. UseTokenInfo greatly simplified
  951. + added check for changed tree after first time firstpass
  952. (if we could remove all the cases were it happen
  953. we could skip all firstpass if firstpasscount > 1)
  954. Only with ExtDebug
  955. Revision 1.8 1998/05/04 20:19:54 peter
  956. * small fix for go32v2
  957. Revision 1.7 1998/05/04 17:54:29 peter
  958. + smartlinking works (only case jumptable left todo)
  959. * redesign of systems.pas to support assemblers and linkers
  960. + Unitname is now also in the PPU-file, increased version to 14
  961. Revision 1.6 1998/05/01 07:43:57 florian
  962. + basics for rtti implemented
  963. + switch $m (generate rtti for published sections)
  964. Revision 1.5 1998/04/29 10:34:06 pierre
  965. + added some code for ansistring (not complete nor working yet)
  966. * corrected operator overloading
  967. * corrected nasm output
  968. + started inline procedures
  969. + added starstarn : use ** for exponentiation (^ gave problems)
  970. + started UseTokenInfo cond to get accurate positions
  971. Revision 1.4 1998/04/27 15:45:20 peter
  972. + -Xl for smartlink
  973. + target_info.arext = .a
  974. Revision 1.3 1998/04/16 10:50:45 daniel
  975. * Fixed some things that were broken for OS/2.
  976. }