systems.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. This unit contains information about the target systems supported
  4. (these are not processor specific)
  5. This program is free software; you can redistribute it and/or modify
  6. iu under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge- MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit systems;
  19. {$i fpcdefs.inc}
  20. interface
  21. type
  22. tendian = (endian_little,endian_big);
  23. (*
  24. IMPORTANT NOTE:
  25. The value of this enumeration is stored in PPU files.
  26. Therefore adding new CPU targets should not change the
  27. values of the pre-existing targets. (CEC)
  28. FURTHERMORE : Make sure that this branch values, are
  29. consistant with the main branch version always.
  30. *)
  31. tsystemcpu=
  32. (
  33. cpu_no, { 0 }
  34. cpu_i386, { 1 }
  35. cpu_m68k, { 2 }
  36. cpu_alpha, { 3 }
  37. cpu_powerpc, { 4 }
  38. cpu_sparc, { 5 }
  39. cpu_vm, { 6 }
  40. cpu_iA64, { 7 }
  41. cpu_x86_64, { 8 }
  42. cpu_mips, { 9 }
  43. cpu_arm, { 10 }
  44. cpu_powerpc64 { 11 }
  45. );
  46. tasmmode= (asmmode_none
  47. { standard assembler (cpu dependant) with full parsing }
  48. ,asmmode_standard
  49. ,asmmode_i386_att
  50. ,asmmode_i386_intel
  51. ,asmmode_ppc_gas
  52. ,asmmode_ppc_motorola
  53. ,asmmode_arm_gas
  54. ,asmmode_sparc_gas
  55. ,asmmode_x86_64_gas
  56. ,asmmode_m68k_mot
  57. );
  58. (* IMPORTANT NOTE:
  59. the integer value of this enum is stored in PPU
  60. files to recognize the target, so if you add new targets
  61. allways add them at end PM
  62. FURTHERMORE : Make sure that this branch values are
  63. consistant with the main branch version always. (CEC)
  64. *)
  65. type
  66. tsystem =
  67. (
  68. system_none, { 0 }
  69. obsolete_system_i386_GO32V1,{ 1 }
  70. system_i386_GO32V2, { 2 }
  71. system_i386_linux, { 3 }
  72. system_i386_OS2, { 4 }
  73. system_i386_Win32, { 5 }
  74. system_i386_freebsd, { 6 }
  75. system_m68k_Amiga, { 7 }
  76. system_m68k_Atari, { 8 }
  77. system_m68k_Mac, { 9 }
  78. system_m68k_linux, { 10 }
  79. system_m68k_PalmOS, { 11 }
  80. system_alpha_linux, { 12 }
  81. system_powerpc_linux, { 13 }
  82. system_powerpc_macos, { 14 }
  83. system_i386_solaris, { 15 }
  84. system_i386_beos, { 16 }
  85. system_i386_netbsd, { 17 }
  86. system_m68k_netbsd, { 18 }
  87. system_i386_Netware, { 19 }
  88. system_i386_qnx, { 20 }
  89. system_i386_wdosx, { 21 }
  90. system_sparc_solaris, { 22 }
  91. system_sparc_linux, { 23 }
  92. system_i386_openbsd, { 24 }
  93. system_m68k_openbsd, { 25 }
  94. system_x86_64_linux, { 26 }
  95. system_powerpc_darwin, { 27 }
  96. system_i386_EMX, { 28 }
  97. system_powerpc_netbsd, { 29 }
  98. system_powerpc_openbsd, { 30 }
  99. system_arm_linux, { 31 }
  100. system_i386_watcom, { 32 }
  101. system_powerpc_MorphOS, { 33 }
  102. system_x86_64_freebsd, { 34 }
  103. system_i386_netwlibc, { 35 }
  104. system_powerpc_Amiga, { 36 }
  105. system_x86_64_win64, { 37 }
  106. system_arm_wince, { 38 }
  107. system_ia64_win64, { 39 }
  108. system_i386_wince, { 40 }
  109. system_x86_6432_linux, { 41 }
  110. system_arm_gba, { 42 }
  111. system_powerpc64_linux, { 43 }
  112. system_i386_darwin { 44 }
  113. );
  114. tasm = (as_none
  115. ,as_gas { standard gnu assembler }
  116. ,as_i386_as_aout
  117. ,as_i386_nasmcoff
  118. ,as_i386_nasmwin32
  119. ,as_i386_nasmwdosx
  120. ,as_i386_nasmelf
  121. ,as_i386_nasmobj
  122. ,as_i386_nasmbeos
  123. ,as_i386_tasm
  124. ,as_i386_masm
  125. ,as_i386_wasm
  126. ,as_i386_coff
  127. ,as_i386_pecoff
  128. ,as_i386_elf32
  129. ,as_i386_pecoffwdosx
  130. ,as_m68k_mit
  131. ,as_powerpc_mpw
  132. ,as_darwin
  133. ,as_x86_64_masm
  134. ,as_x86_64_pecoff
  135. ,as_i386_pecoffwince
  136. ,as_arm_pecoffwince
  137. );
  138. tar = (ar_none
  139. ,ar_gnu_ar,ar_mpw_ar
  140. );
  141. tres = (res_none
  142. ,res_gnu_windres,res_emxbind
  143. ,res_m68k_palmos,res_m68k_mpw
  144. ,res_powerpc_mpw,res_elf
  145. );
  146. tscripttype = (script_none
  147. ,script_dos,script_unix,script_amiga,
  148. script_mpw
  149. );
  150. tabi = (abi_default
  151. ,abi_powerpc_sysv,abi_powerpc_aix
  152. );
  153. {*****************************************************************************
  154. Structures
  155. *****************************************************************************}
  156. type
  157. { Abstract linker class which is implemented in link module }
  158. TAbstractLinker = class
  159. end;
  160. TAbstractLinkerClass = class of TAbstractLinker;
  161. { Abstract assembler class which is implemented in assemble module }
  162. TAbstractAssembler = class
  163. end;
  164. TAbstractAssemblerClass = class of TAbstractAssembler;
  165. palignmentinfo = ^talignmentinfo;
  166. talignmentinfo = record
  167. procalign,
  168. loopalign,
  169. jumpalign,
  170. constalignmin,
  171. constalignmax,
  172. varalignmin,
  173. varalignmax,
  174. localalignmin,
  175. localalignmax,
  176. recordalignmin,
  177. recordalignmax,
  178. maxCrecordalign : longint;
  179. end;
  180. tasmflags = (af_none,
  181. af_outputbinary,af_allowdirect,
  182. af_needar,af_smartlink_sections,
  183. af_labelprefix_only_inside_procedure,
  184. af_supports_dwarf
  185. );
  186. pasminfo = ^tasminfo;
  187. tasminfo = record
  188. id : tasm;
  189. idtxt : string[12];
  190. asmbin : string[8];
  191. asmcmd : string[50];
  192. supported_target : tsystem;
  193. flags : set of tasmflags;
  194. labelprefix : string[3];
  195. comment : string[3];
  196. end;
  197. parinfo = ^tarinfo;
  198. tarinfo = record
  199. id : tar;
  200. arcmd : string[50];
  201. end;
  202. presinfo = ^tresinfo;
  203. tresinfo = record
  204. id : tres;
  205. resbin : string[8];
  206. rescmd : string[50];
  207. end;
  208. tsystemflags = (tf_none,
  209. tf_under_development,
  210. tf_need_export,tf_needs_isconsole,
  211. tf_code_small,tf_static_reg_based,
  212. tf_needs_symbol_size,
  213. tf_smartlink_sections,
  214. tf_needs_dwarf_cfi,
  215. tf_use_8_3,
  216. tf_pic_uses_got,
  217. tf_library_needs_pic,
  218. tf_needs_symbol_type
  219. );
  220. psysteminfo = ^tsysteminfo;
  221. { using packed causes bus errors on processors which require alignment }
  222. tsysteminfo = record
  223. system : tsystem;
  224. name : string[34];
  225. shortname : string[9];
  226. flags : set of tsystemflags;
  227. cpu : tsystemcpu;
  228. unit_env : string[16];
  229. extradefines : string[40];
  230. exeext,
  231. defext,
  232. scriptext,
  233. smartext,
  234. unitext,
  235. unitlibext,
  236. asmext,
  237. objext,
  238. resext,
  239. resobjext : string[4];
  240. sharedlibext : string[10];
  241. staticlibext,
  242. staticlibprefix : string[4];
  243. sharedlibprefix : string[4];
  244. sharedClibext : string[10];
  245. staticClibext,
  246. staticClibprefix : string[4];
  247. sharedClibprefix : string[4];
  248. p_ext_support:Boolean; {Whether extension .p is supported by default}
  249. Cprefix : string[2];
  250. newline : string[2];
  251. dirsep : char;
  252. files_case_relevent : boolean;
  253. assem : tasm;
  254. assemextern : tasm; { external assembler, used by -a }
  255. link : tabstractlinkerclass;
  256. linkextern : tabstractlinkerclass; { external linker, used by -s }
  257. ar : tar;
  258. res : tres;
  259. script : tscripttype;
  260. endian : tendian;
  261. alignment : talignmentinfo;
  262. {
  263. Offset from the argument pointer register to the first
  264. argument's address. On some machines it may depend on
  265. the data type of the function.
  266. (see also FIRST_PARM_OFFSET in GCC source)
  267. }
  268. first_parm_offset : longint;
  269. stacksize : longint;
  270. DllScanSupported : boolean;
  271. use_function_relative_addresses : boolean;
  272. abi : tabi;
  273. end;
  274. const
  275. { alias for supported_target field in tasminfo }
  276. system_any = system_none;
  277. system_wince : set of tsystem = [system_arm_wince,system_i386_wince];
  278. system_linux = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,
  279. system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
  280. system_x86_6432_linux];
  281. { all real windows systems, no cripple ones like wince, wdosx et. al. }
  282. system_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64];
  283. { all windows systems }
  284. system_all_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64,
  285. system_arm_wince,system_i386_wince];
  286. { all systems supporting exports from programs or units }
  287. system_unit_program_exports : set of tsystem = [system_i386_win32,
  288. system_i386_wdosx,
  289. system_i386_Netware,
  290. system_i386_netwlibc,
  291. system_arm_wince,
  292. system_x86_64_win64,
  293. system_ia64_win64]+system_linux;
  294. cpu2str : array[TSystemCpu] of string =
  295. ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
  296. 'mips','arm', 'powerpc64');
  297. var
  298. targetinfos : array[tsystem] of psysteminfo;
  299. arinfos : array[tar] of parinfo;
  300. resinfos : array[tres] of presinfo;
  301. asminfos : array[tasm] of pasminfo;
  302. source_info : tsysteminfo;
  303. target_cpu : tsystemcpu;
  304. target_info : tsysteminfo;
  305. target_asm : tasminfo;
  306. target_ar : tarinfo;
  307. target_res : tresinfo;
  308. target_cpu_string,
  309. target_os_string : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
  310. target_full_string : string[24];
  311. function set_target(t:tsystem):boolean;
  312. function set_target_asm(t:tasm):boolean;
  313. function set_target_ar(t:tar):boolean;
  314. function set_target_res(t:tres):boolean;
  315. function set_target_by_string(const s : string) : boolean;
  316. function set_target_asm_by_string(const s : string) : boolean;
  317. procedure set_source_info(const ti : tsysteminfo);
  318. procedure UpdateAlignment(var d:talignmentinfo;const s:talignmentinfo);
  319. procedure RegisterTarget(const r:tsysteminfo);
  320. procedure RegisterRes(const r:tresinfo);
  321. procedure RegisterAr(const r:tarinfo);
  322. { Register the external linker. This routine is called to setup the
  323. class to use for the linker. It returns the tsysteminfo structure
  324. updated with the correct linker class for external linking.
  325. }
  326. procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
  327. { Register the internal linker. This routine is called to setup the
  328. class to use for the linker. It returns the tsysteminfo structure
  329. updated with the correct linker class for internal linking.
  330. If internal linking is not supported, this class can be set
  331. to nil.
  332. }
  333. procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
  334. procedure InitSystems;
  335. {$ifdef FreeBSD}
  336. function GetOSRelDate:Longint;
  337. {$endif}
  338. implementation
  339. uses
  340. cutils{$ifdef FreeBSD},SysCtl,BaseUnix{$endif};
  341. {****************************************************************************
  342. OS runtime version detection utility routine
  343. ****************************************************************************}
  344. {$ifdef FreeBSD}
  345. function GetOSRelDate:Longint;
  346. var
  347. mib : array[0..1] of cint;
  348. rval : cint;
  349. len : size_t;
  350. i : longint;
  351. v : longint;
  352. oerrno : cint;
  353. S : AnsiString;
  354. Begin
  355. s:='ab';
  356. SetLength(S,50);
  357. mib[0] := CTL_KERN;
  358. mib[1] := KERN_OSRELDATE;
  359. len := 4;
  360. oerrno:= fpgeterrno;
  361. if (FPsysctl(@mib, 2, pchar(@v), @len, NIL, 0) = -1) Then
  362. Begin
  363. if (fpgeterrno = ESysENOMEM) Then
  364. fpseterrno(oerrno);
  365. GetOSRelDate:=0;
  366. End
  367. else
  368. GetOSRelDate:=v;
  369. End;
  370. {$endif}
  371. {****************************************************************************
  372. Target setting
  373. ****************************************************************************}
  374. function set_target(t:tsystem):boolean;
  375. begin
  376. set_target:=false;
  377. if assigned(targetinfos[t]) then
  378. begin
  379. target_info:=targetinfos[t]^;
  380. set_target_asm(target_info.assem);
  381. set_target_ar(target_info.ar);
  382. set_target_res(target_info.res);
  383. target_cpu:=target_info.cpu;
  384. target_os_string:=lower(target_info.shortname);
  385. target_cpu_string:=cpu2str[target_cpu];
  386. target_full_string:=target_cpu_string+'-'+target_os_string;
  387. set_target:=true;
  388. exit;
  389. end;
  390. end;
  391. function set_target_asm(t:tasm):boolean;
  392. begin
  393. set_target_asm:=false;
  394. if assigned(asminfos[t]) and
  395. ((asminfos[t]^.supported_target=target_info.system) or
  396. (asminfos[t]^.supported_target=system_any)) then
  397. begin
  398. target_asm:=asminfos[t]^;
  399. set_target_asm:=true;
  400. exit;
  401. end;
  402. end;
  403. function set_target_ar(t:tar):boolean;
  404. begin
  405. set_target_ar:=false;
  406. if assigned(arinfos[t]) then
  407. begin
  408. target_ar:=arinfos[t]^;
  409. set_target_ar:=true;
  410. exit;
  411. end;
  412. end;
  413. function set_target_res(t:tres):boolean;
  414. begin
  415. set_target_res:=false;
  416. if assigned(resinfos[t]) then
  417. begin
  418. target_res:=resinfos[t]^;
  419. set_target_res:=true;
  420. exit;
  421. end;
  422. end;
  423. function set_target_by_string(const s : string) : boolean;
  424. var
  425. hs : string;
  426. t : tsystem;
  427. begin
  428. set_target_by_string:=false;
  429. { this should be case insensitive !! PM }
  430. hs:=upper(s);
  431. for t:=low(tsystem) to high(tsystem) do
  432. if assigned(targetinfos[t]) and
  433. (upper(targetinfos[t]^.shortname)=hs) then
  434. begin
  435. set_target_by_string:=set_target(t);
  436. exit;
  437. end;
  438. end;
  439. function set_target_asm_by_string(const s : string) : boolean;
  440. var
  441. hs : string;
  442. t : tasm;
  443. begin
  444. set_target_asm_by_string:=false;
  445. { this should be case insensitive !! PM }
  446. hs:=upper(s);
  447. for t:=low(tasm) to high(tasm) do
  448. if assigned(asminfos[t]) and
  449. (asminfos[t]^.idtxt=hs) then
  450. begin
  451. set_target_asm_by_string:=set_target_asm(t);
  452. exit;
  453. end;
  454. end;
  455. procedure UpdateAlignment(var d:talignmentinfo;const s:talignmentinfo);
  456. begin
  457. with d do
  458. begin
  459. { general update rules:
  460. minimum: if higher then update
  461. maximum: if lower then update or if undefined then update }
  462. if s.procalign>procalign then
  463. procalign:=s.procalign;
  464. if s.loopalign>loopalign then
  465. loopalign:=s.loopalign;
  466. if s.jumpalign>jumpalign then
  467. jumpalign:=s.jumpalign;
  468. if s.constalignmin>constalignmin then
  469. constalignmin:=s.constalignmin;
  470. if (constalignmax=0) or
  471. ((s.constalignmax>0) and (s.constalignmax<constalignmax)) then
  472. constalignmax:=s.constalignmax;
  473. if s.varalignmin>varalignmin then
  474. varalignmin:=s.varalignmin;
  475. if (varalignmax=0) or
  476. ((s.varalignmax>0) and (s.varalignmax<varalignmax)) then
  477. varalignmax:=s.varalignmax;
  478. if s.localalignmin>localalignmin then
  479. localalignmin:=s.localalignmin;
  480. if (localalignmax=0) or
  481. ((s.localalignmax>0) and (s.localalignmax<localalignmax)) then
  482. localalignmax:=s.localalignmax;
  483. if s.recordalignmin>recordalignmin then
  484. recordalignmin:=s.recordalignmin;
  485. if (recordalignmax=0) or
  486. ((s.recordalignmax>0) and (s.recordalignmax<recordalignmax)) then
  487. recordalignmax:=s.recordalignmax;
  488. if (maxCrecordalign=0) or
  489. ((s.maxCrecordalign>0) and (s.maxCrecordalign<maxCrecordalign)) then
  490. maxCrecordalign:=s.maxCrecordalign;
  491. end;
  492. end;
  493. {****************************************************************************
  494. Target registration
  495. ****************************************************************************}
  496. procedure RegisterTarget(const r:tsysteminfo);
  497. var
  498. t : tsystem;
  499. begin
  500. t:=r.system;
  501. if assigned(targetinfos[t]) then
  502. writeln('Warning: Target is already registered!')
  503. else
  504. Getmem(targetinfos[t],sizeof(tsysteminfo));
  505. targetinfos[t]^:=r;
  506. end;
  507. procedure RegisterRes(const r:tresinfo);
  508. var
  509. t : tres;
  510. begin
  511. t:=r.id;
  512. if assigned(resinfos[t]) then
  513. writeln('Warning: resourcecompiler is already registered!')
  514. else
  515. Getmem(resinfos[t],sizeof(tresinfo));
  516. resinfos[t]^:=r;
  517. end;
  518. procedure RegisterAr(const r:tarinfo);
  519. var
  520. t : tar;
  521. begin
  522. t:=r.id;
  523. if assigned(arinfos[t]) then
  524. writeln('Warning: ar is already registered!')
  525. else
  526. Getmem(arinfos[t],sizeof(tarinfo));
  527. arinfos[t]^:=r;
  528. end;
  529. procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
  530. begin
  531. system_info.linkextern := c;
  532. end;
  533. procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
  534. begin
  535. system_info.link := c;
  536. end;
  537. procedure DeregisterInfos;
  538. var
  539. assem : tasm;
  540. target : tsystem;
  541. ar : tar;
  542. res : tres;
  543. begin
  544. for target:=low(tsystem) to high(tsystem) do
  545. if assigned(targetinfos[target]) then
  546. begin
  547. freemem(targetinfos[target],sizeof(tsysteminfo));
  548. targetinfos[target]:=nil;
  549. end;
  550. for assem:=low(tasm) to high(tasm) do
  551. if assigned(asminfos[assem]) then
  552. begin
  553. freemem(asminfos[assem],sizeof(tasminfo));
  554. asminfos[assem]:=nil;
  555. end;
  556. for ar:=low(tar) to high(tar) do
  557. if assigned(arinfos[ar]) then
  558. begin
  559. freemem(arinfos[ar],sizeof(tarinfo));
  560. arinfos[ar]:=nil;
  561. end;
  562. for res:=low(tres) to high(tres) do
  563. if assigned(resinfos[res]) then
  564. begin
  565. freemem(resinfos[res],sizeof(tresinfo));
  566. resinfos[res]:=nil;
  567. end;
  568. end;
  569. {****************************************************************************
  570. Initialization of default target
  571. ****************************************************************************}
  572. procedure default_target(t:tsystem);
  573. begin
  574. set_target(t);
  575. if source_info.name='' then
  576. source_info:=target_info;
  577. end;
  578. procedure set_source_info(const ti : tsysteminfo);
  579. begin
  580. { can't use message() here (PFV) }
  581. if source_info.name<>'' then
  582. Writeln('Warning: Source OS Redefined!');
  583. source_info:=ti;
  584. end;
  585. procedure InitSystems;
  586. begin
  587. { Now default target, this is dependent on the target cpu define,
  588. when the define is the same as the source cpu then we use the source
  589. os, else we pick a default }
  590. {$ifdef i386}
  591. {$ifdef cpu86}
  592. default_target(source_info.system);
  593. {$else cpu86}
  594. {$ifdef linux}
  595. default_target(system_i386_linux);
  596. {$endif}
  597. {$ifdef freebsd}
  598. default_target(system_i386_freebsd);
  599. {$endif}
  600. {$endif cpu86}
  601. {$endif i386}
  602. {$ifdef x86_64}
  603. {$ifdef cpux86_64}
  604. default_target(source_info.system);
  605. {$define source_system_set}
  606. {$else cpux86_64}
  607. {$ifdef linux}
  608. default_target(system_x86_64_linux);
  609. {$define source_system_set}
  610. {$endif}
  611. {$ifdef freebsd}
  612. default_target(system_x86_64_freebsd);
  613. {$define source_system_set}
  614. {$endif}
  615. { default is linux }
  616. {$ifndef source_system_set}
  617. default_target(system_x86_64_linux);
  618. {$endif source_system_set}
  619. {$endif cpux86_64}
  620. {$endif x86_64}
  621. {$ifdef m68k}
  622. {$ifdef cpu68}
  623. default_target(source_info.target);
  624. {$else cpu68}
  625. default_target(system_m68k_linux);
  626. {$endif cpu68}
  627. {$endif m68k}
  628. {$ifdef alpha}
  629. {$ifdef cpualpha}
  630. default_target(source_info.system);
  631. {$else cpualpha}
  632. default_target(system_alpha_linux);
  633. {$endif cpualpha}
  634. {$endif alpha}
  635. {$ifdef powerpc}
  636. {$ifdef cpupowerpc}
  637. default_target(source_info.system);
  638. {$else cpupowerpc}
  639. default_target(system_powerpc_linux);
  640. {$endif cpupowerpc}
  641. {$endif powerpc}
  642. {$ifdef sparc}
  643. {$ifdef cpusparc}
  644. default_target(source_info.system);
  645. {$else cpusparc}
  646. default_target(system_sparc_linux);
  647. {$endif cpusparc}
  648. {$endif sparc}
  649. {$ifdef arm}
  650. {$ifdef cpuarm}
  651. default_target(source_info.system);
  652. {$else cpuarm}
  653. default_target(system_arm_linux);
  654. {$endif cpuarm}
  655. {$endif arm}
  656. end;
  657. initialization
  658. source_info.name:='';
  659. finalization
  660. DeregisterInfos;
  661. end.