systems.pas 26 KB

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