systems.pas 28 KB

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