systems.pas 28 KB

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