systems.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960
  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. smartext : '.SL';
  548. unitext : '.PPU';
  549. unitlibext : '.PPL';
  550. asmext : '.S';
  551. objext : '.O';
  552. exeext : '.EXE';
  553. os : os_GO32V2;
  554. link : link_ldgo32v2;
  555. assem : as_o;
  556. ar : ar_ar;
  557. heapsize : 2048*1024;
  558. stacksize : 16384
  559. ),
  560. (
  561. target : target_LINUX;
  562. short_name : 'LINUX';
  563. unit_env : 'LINUXUNITS';
  564. system_unit : 'syslinux';
  565. smartext : '.sl';
  566. unitext : '.ppu';
  567. unitlibext : '.ppl';
  568. asmext : '.s';
  569. objext : '.o';
  570. exeext : '';
  571. os : os_Linux;
  572. link : link_ld;
  573. assem : as_o;
  574. ar : ar_ar;
  575. heapsize : 2048*1024;
  576. stacksize : 8192
  577. ),
  578. (
  579. target : target_OS2;
  580. short_name : 'OS2';
  581. unit_env : 'OS2UNITS';
  582. system_unit : 'SYSOS2';
  583. smartext : '.sl';
  584. unitext : '.ppo';
  585. unitlibext : '.ppl';
  586. asmext : '.so2';
  587. objext : '.oo2';
  588. exeext : ''; { The linker produces a.out }
  589. os : os_OS2;
  590. link : link_ldos2;
  591. assem : as_o_aout;
  592. ar : ar_ar;
  593. heapsize : 256*1024;
  594. stacksize : 32768
  595. ),
  596. (
  597. target : target_WIN32;
  598. short_name : 'WIN32';
  599. unit_env : 'WIN32UNITS';
  600. system_unit : 'SYSWIN32';
  601. smartext : '.sl';
  602. unitext : '.ppw';
  603. unitlibext : '.ppl';
  604. asmext : '.s';
  605. objext : '.o';
  606. exeext : '.exe';
  607. os : os_Win32;
  608. link : link_ldw;
  609. assem : as_asw;
  610. ar : ar_arw;
  611. heapsize : 1024*1024;
  612. stacksize : 16384
  613. )
  614. {$endif i386}
  615. {$ifdef m68k}
  616. (
  617. target : target_Amiga;
  618. short_name : 'AMIGA';
  619. unit_env : '';
  620. system_unit : 'sysamiga';
  621. smartext : '.sl';
  622. unitext : '.ppa';
  623. unitlibext : '.ppl';
  624. asmext : '.asm';
  625. objext : '.o';
  626. exeext : '';
  627. os : os_Amiga;
  628. link : link_ld;
  629. assem : as_o;
  630. ar : ar_ar;
  631. heapsize : 512*1024;
  632. stacksize : 8192
  633. ),
  634. (
  635. target : target_Atari;
  636. short_name : 'ATARI';
  637. unit_env : '';
  638. system_unit : 'SYSATARI';
  639. smartext : '.sl';
  640. unitext : '.ppt';
  641. unitlibext : '.ppl';
  642. asmext : '.s';
  643. objext : '.o';
  644. exeext : '';
  645. os : os_Atari;
  646. link : link_ld;
  647. assem : as_o;
  648. ar : ar_ar;
  649. heapsize : 512*1024;
  650. stacksize : 8192
  651. ),
  652. (
  653. target : target_Mac68k;
  654. short_name : 'MACOS';
  655. unit_env : '';
  656. system_unit : 'sysmac';
  657. smartext : '.sl';
  658. unitext : '.ppt';
  659. unitlibext : '.ppl';
  660. asmext : '.s';
  661. objext : '.o';
  662. exeext : '';
  663. os : os_Mac68k;
  664. link : link_ld;
  665. assem : as_o;
  666. ar : ar_ar;
  667. heapsize : 512*1024;
  668. stacksize : 8192
  669. ),
  670. (
  671. target : target_Linux;
  672. short_name : 'LINUX';
  673. unit_env : 'LINUXUNITS';
  674. system_unit : 'syslinux';
  675. smartext : '.sl';
  676. unitext : '.ppu';
  677. unitlibext : '.ppl';
  678. asmext : '.s';
  679. objext : '.o';
  680. exeext : '';
  681. os : os_Linux;
  682. link : link_ld;
  683. assem : as_o;
  684. ar : ar_ar;
  685. heapsize : 512*1024;
  686. stacksize : 8192
  687. )
  688. {$endif m68k}
  689. );
  690. {****************************************************************************
  691. AsmModeInfo
  692. ****************************************************************************}
  693. asmmodeinfos : array[tasmmode] of tasmmodeinfo = (
  694. {$ifdef i386}
  695. (
  696. id : I386_DIRECT;
  697. idtxt : 'DIRECT'
  698. ),
  699. (
  700. id : I386_INTEL;
  701. idtxt : 'INTEL'
  702. ),
  703. (
  704. id : I386_ATT;
  705. idtxt : 'ATT'
  706. )
  707. {$endif i386}
  708. {$ifdef m68k}
  709. (
  710. id : M68K_MOT;
  711. idtxt : 'MOT'
  712. )
  713. {$endif m68k}
  714. );
  715. {****************************************************************************
  716. Helpers
  717. ****************************************************************************}
  718. procedure set_target(t : ttarget);
  719. begin
  720. target_info:=target_infos[t];
  721. target_os:=os_infos[target_info.os];
  722. target_asm:=as_infos[target_info.assem];
  723. target_link:=link_infos[target_info.link];
  724. target_ar:=ar_infos[target_info.ar];
  725. end;
  726. {****************************************************************************
  727. Load from string
  728. ****************************************************************************}
  729. function set_string_target(const s : string) : boolean;
  730. var
  731. i : longint;
  732. begin
  733. set_string_target:=false;
  734. for i:=0 to (sizeof(target_infos) div sizeof(ttargetinfo))-1 do
  735. if target_infos[ttarget(i)].short_name=s then
  736. begin
  737. set_target(ttarget(i));
  738. set_string_target:=true;
  739. end;
  740. end;
  741. function set_string_asm(const s : string) : boolean;
  742. var
  743. i : longint;
  744. begin
  745. set_string_asm:=false;
  746. for i:=0 to (sizeof(as_infos) div sizeof(tasminfo))-1 do
  747. if as_infos[tasm(i)].idtxt=s then
  748. begin
  749. target_asm:=as_infos[tasm(i)];
  750. set_string_asm:=true;
  751. end;
  752. end;
  753. function set_string_asmmode(const s:string;var t:tasmmode):boolean;
  754. var
  755. i : longint;
  756. begin
  757. set_string_asmmode:=false;
  758. for i:=0 to (sizeof(asmmodeinfos) div sizeof(tasmmodeinfo))-1 do
  759. if asmmodeinfos[tasmmode(i)].idtxt=s then
  760. begin
  761. t:=asmmodeinfos[tasmmode(i)].id;
  762. set_string_asmmode:=true;
  763. end;
  764. end;
  765. {****************************************************************************
  766. Initialization of default target
  767. ****************************************************************************}
  768. procedure default_os(t:ttarget);
  769. begin
  770. set_target(t);
  771. source_os:=os_infos[target_info.os];
  772. end;
  773. begin
  774. {$ifdef i386}
  775. {$ifdef GO32V1}
  776. default_os(target_GO32V1);
  777. {$else}
  778. {$ifdef GO32V2}
  779. default_os(target_GO32V2);
  780. {$else}
  781. {$ifdef OS2}
  782. default_os(target_OS2);
  783. {$else}
  784. {$ifdef LINUX}
  785. default_os(target_LINUX);
  786. {$else}
  787. {$ifdef WIN32}
  788. default_os(target_WIN32);
  789. {$else}
  790. default_os(target_GO32V2);
  791. {$endif win32}
  792. {$endif linux}
  793. {$endif os2}
  794. {$endif go32v2}
  795. {$endif go32v1}
  796. {$endif i386}
  797. {$ifdef m68k}
  798. {$ifdef AMIGA}
  799. default_os(target_Amiga);
  800. {$else}
  801. {$ifdef ATARI}
  802. default_os(target_Atari);
  803. {$else}
  804. {$ifdef MACOS}
  805. default_os(target_MAC68k);
  806. {$else}
  807. default_os(target_Amiga);
  808. {$endif macos}
  809. {$endif atari}
  810. {$endif amiga}
  811. {$endif m68k}
  812. end.
  813. {
  814. $Log$
  815. Revision 1.23 1998-06-25 08:48:20 florian
  816. * first version of rtti support
  817. Revision 1.22 1998/06/17 14:10:21 peter
  818. * small os2 fixes
  819. * fixed interdependent units with newppu (remake3 under linux works now)
  820. Revision 1.20 1998/06/15 15:38:14 pierre
  821. * small bug in systems.pas corrected
  822. + operators in different units better hanlded
  823. Revision 1.19 1998/06/15 13:34:24 daniel
  824. * Fixed spelling mistakes in comments.
  825. * Fixed some OS/2 parameters.
  826. Revision 1.18 1998/06/08 22:59:54 peter
  827. * smartlinking works for win32
  828. * some defines to exclude some compiler parts
  829. Revision 1.17 1998/06/04 23:52:04 peter
  830. * m68k compiles
  831. + .def file creation moved to gendef.pas so it could also be used
  832. for win32
  833. Revision 1.16 1998/06/01 16:50:22 peter
  834. + boolean -> ord conversion
  835. * fixed ord -> boolean conversion
  836. Revision 1.15 1998/05/30 14:31:11 peter
  837. + $ASMMODE
  838. Revision 1.14 1998/05/29 13:24:45 peter
  839. + asw assembler
  840. Revision 1.13 1998/05/27 00:20:33 peter
  841. * some scanner optimizes
  842. * automaticly aout2exe for go32v1
  843. * fixed dynamiclinker option which was added at the wrong place
  844. Revision 1.12 1998/05/23 01:21:32 peter
  845. + aktasmmode, aktoptprocessor, aktoutputformat
  846. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  847. + $LIBNAME to set the library name where the unit will be put in
  848. * splitted cgi386 a bit (codeseg to large for bp7)
  849. * nasm, tasm works again. nasm moved to ag386nsm.pas
  850. Revision 1.11 1998/05/22 12:32:49 peter
  851. * fixed -L on the commandline, Dos commandline is only 128 bytes
  852. Revision 1.10 1998/05/11 13:07:58 peter
  853. + $ifdef NEWPPU for the new ppuformat
  854. + $define GDB not longer required
  855. * removed all warnings and stripped some log comments
  856. * no findfirst/findnext anymore to remove smartlink *.o files
  857. Revision 1.9 1998/05/06 08:38:49 pierre
  858. * better position info with UseTokenInfo
  859. UseTokenInfo greatly simplified
  860. + added check for changed tree after first time firstpass
  861. (if we could remove all the cases were it happen
  862. we could skip all firstpass if firstpasscount > 1)
  863. Only with ExtDebug
  864. Revision 1.8 1998/05/04 20:19:54 peter
  865. * small fix for go32v2
  866. Revision 1.7 1998/05/04 17:54:29 peter
  867. + smartlinking works (only case jumptable left todo)
  868. * redesign of systems.pas to support assemblers and linkers
  869. + Unitname is now also in the PPU-file, increased version to 14
  870. Revision 1.6 1998/05/01 07:43:57 florian
  871. + basics for rtti implemented
  872. + switch $m (generate rtti for published sections)
  873. Revision 1.5 1998/04/29 10:34:06 pierre
  874. + added some code for ansistring (not complete nor working yet)
  875. * corrected operator overloading
  876. * corrected nasm output
  877. + started inline procedures
  878. + added starstarn : use ** for exponentiation (^ gave problems)
  879. + started UseTokenInfo cond to get accurate positions
  880. Revision 1.4 1998/04/27 15:45:20 peter
  881. + -Xl for smartlink
  882. + target_info.arext = .a
  883. Revision 1.3 1998/04/16 10:50:45 daniel
  884. * Fixed some things that were broken for OS/2.
  885. }