systems.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  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. system_arm_palmos { 45 }
  114. );
  115. tasm = (as_none
  116. ,as_gas { standard gnu assembler }
  117. ,as_i386_as_aout
  118. ,as_i386_nasmcoff
  119. ,as_i386_nasmwin32
  120. ,as_i386_nasmwdosx
  121. ,as_i386_nasmelf
  122. ,as_i386_nasmobj
  123. ,as_i386_nasmbeos
  124. ,as_i386_tasm
  125. ,as_i386_masm
  126. ,as_i386_wasm
  127. ,as_i386_coff
  128. ,as_i386_pecoff
  129. ,as_i386_elf32
  130. ,as_i386_pecoffwdosx
  131. ,as_m68k_mit
  132. ,as_powerpc_mpw
  133. ,as_darwin
  134. ,as_x86_64_masm
  135. ,as_x86_64_pecoff
  136. ,as_i386_pecoffwince
  137. ,as_arm_pecoffwince
  138. );
  139. tar = (ar_none
  140. ,ar_gnu_ar,ar_mpw_ar
  141. );
  142. tres = (res_none
  143. ,res_gnu_windres,res_emxbind
  144. ,res_m68k_palmos,res_m68k_mpw
  145. ,res_powerpc_mpw,res_elf
  146. );
  147. tscripttype = (script_none
  148. ,script_dos,script_unix,script_amiga,
  149. script_mpw
  150. );
  151. tabi = (abi_default
  152. ,abi_powerpc_sysv,abi_powerpc_aix
  153. );
  154. {*****************************************************************************
  155. Structures
  156. *****************************************************************************}
  157. type
  158. { Abstract linker class which is implemented in link module }
  159. TAbstractLinker = class
  160. end;
  161. TAbstractLinkerClass = class of TAbstractLinker;
  162. { Abstract assembler class which is implemented in assemble module }
  163. TAbstractAssembler = class
  164. end;
  165. TAbstractAssemblerClass = class of TAbstractAssembler;
  166. palignmentinfo = ^talignmentinfo;
  167. talignmentinfo = record
  168. procalign,
  169. loopalign,
  170. jumpalign,
  171. constalignmin,
  172. constalignmax,
  173. varalignmin,
  174. varalignmax,
  175. localalignmin,
  176. localalignmax,
  177. recordalignmin,
  178. recordalignmax,
  179. maxCrecordalign : longint;
  180. end;
  181. tasmflags = (af_none,
  182. af_outputbinary,af_allowdirect,
  183. af_needar,af_smartlink_sections,
  184. af_labelprefix_only_inside_procedure,
  185. af_supports_dwarf
  186. );
  187. pasminfo = ^tasminfo;
  188. tasminfo = record
  189. id : tasm;
  190. idtxt : string[12];
  191. asmbin : string[8];
  192. asmcmd : string[50];
  193. supported_target : tsystem;
  194. flags : set of tasmflags;
  195. labelprefix : string[3];
  196. comment : string[3];
  197. end;
  198. parinfo = ^tarinfo;
  199. tarinfo = record
  200. id : tar;
  201. arcmd : string[50];
  202. end;
  203. presinfo = ^tresinfo;
  204. tresinfo = record
  205. id : tres;
  206. resbin : string[8];
  207. rescmd : string[50];
  208. end;
  209. tsystemflags = (tf_none,
  210. tf_under_development,
  211. tf_need_export,tf_needs_isconsole,
  212. tf_code_small,tf_static_reg_based,
  213. tf_needs_symbol_size,
  214. tf_smartlink_sections,
  215. tf_needs_dwarf_cfi,
  216. tf_use_8_3,
  217. tf_pic_uses_got,
  218. tf_library_needs_pic,
  219. tf_needs_symbol_type
  220. );
  221. psysteminfo = ^tsysteminfo;
  222. { using packed causes bus errors on processors which require alignment }
  223. tsysteminfo = record
  224. system : tsystem;
  225. name : string[34];
  226. shortname : string[9];
  227. flags : set of tsystemflags;
  228. cpu : tsystemcpu;
  229. unit_env : string[16];
  230. extradefines : string[40];
  231. exeext,
  232. defext,
  233. scriptext,
  234. smartext,
  235. unitext,
  236. unitlibext,
  237. asmext,
  238. objext,
  239. resext,
  240. resobjext : string[4];
  241. sharedlibext : string[10];
  242. staticlibext,
  243. staticlibprefix : string[4];
  244. sharedlibprefix : string[4];
  245. sharedClibext : string[10];
  246. staticClibext,
  247. staticClibprefix : string[4];
  248. sharedClibprefix : string[4];
  249. p_ext_support:Boolean; {Whether extension .p is supported by default}
  250. Cprefix : string[2];
  251. newline : string[2];
  252. dirsep : char;
  253. files_case_relevent : boolean;
  254. assem : tasm;
  255. assemextern : tasm; { external assembler, used by -a }
  256. link : tabstractlinkerclass;
  257. linkextern : tabstractlinkerclass; { external linker, used by -s }
  258. ar : tar;
  259. res : tres;
  260. script : tscripttype;
  261. endian : tendian;
  262. alignment : talignmentinfo;
  263. {
  264. Offset from the argument pointer register to the first
  265. argument's address. On some machines it may depend on
  266. the data type of the function.
  267. (see also FIRST_PARM_OFFSET in GCC source)
  268. }
  269. first_parm_offset : longint;
  270. stacksize : longint;
  271. DllScanSupported : boolean;
  272. use_function_relative_addresses : boolean;
  273. abi : tabi;
  274. end;
  275. const
  276. { alias for supported_target field in tasminfo }
  277. system_any = system_none;
  278. system_wince : set of tsystem = [system_arm_wince,system_i386_wince];
  279. system_linux = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,
  280. system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
  281. system_x86_6432_linux];
  282. { all real windows systems, no cripple ones like wince, wdosx et. al. }
  283. system_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64];
  284. { all windows systems }
  285. system_all_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64,
  286. system_arm_wince,system_i386_wince];
  287. { all systems supporting exports from programs or units }
  288. system_unit_program_exports : set of tsystem = [system_i386_win32,
  289. system_i386_wdosx,
  290. system_i386_Netware,
  291. system_i386_netwlibc,
  292. system_arm_wince,
  293. system_x86_64_win64,
  294. system_ia64_win64]+system_linux;
  295. cpu2str : array[TSystemCpu] of string =
  296. ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
  297. 'mips','arm', 'powerpc64');
  298. var
  299. targetinfos : array[tsystem] of psysteminfo;
  300. arinfos : array[tar] of parinfo;
  301. resinfos : array[tres] of presinfo;
  302. asminfos : array[tasm] of pasminfo;
  303. source_info : tsysteminfo;
  304. target_cpu : tsystemcpu;
  305. target_info : tsysteminfo;
  306. target_asm : tasminfo;
  307. target_ar : tarinfo;
  308. target_res : tresinfo;
  309. target_cpu_string,
  310. target_os_string : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
  311. target_full_string : string[24];
  312. function set_target(t:tsystem):boolean;
  313. function set_target_asm(t:tasm):boolean;
  314. function set_target_ar(t:tar):boolean;
  315. function set_target_res(t:tres):boolean;
  316. function set_target_by_string(const s : string) : boolean;
  317. function set_target_asm_by_string(const s : string) : boolean;
  318. procedure set_source_info(const ti : tsysteminfo);
  319. procedure UpdateAlignment(var d:talignmentinfo;const s:talignmentinfo);
  320. procedure RegisterTarget(const r:tsysteminfo);
  321. procedure RegisterRes(const r:tresinfo);
  322. procedure RegisterAr(const r:tarinfo);
  323. { Register the external linker. This routine is called to setup the
  324. class to use for the linker. It returns the tsysteminfo structure
  325. updated with the correct linker class for external linking.
  326. }
  327. procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
  328. { Register the internal linker. This routine is called to setup the
  329. class to use for the linker. It returns the tsysteminfo structure
  330. updated with the correct linker class for internal linking.
  331. If internal linking is not supported, this class can be set
  332. to nil.
  333. }
  334. procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
  335. procedure InitSystems;
  336. {$ifdef FreeBSD}
  337. function GetOSRelDate:Longint;
  338. {$endif}
  339. implementation
  340. uses
  341. cutils{$ifdef FreeBSD},SysCtl,BaseUnix{$endif};
  342. {****************************************************************************
  343. OS runtime version detection utility routine
  344. ****************************************************************************}
  345. {$ifdef FreeBSD}
  346. function GetOSRelDate:Longint;
  347. var
  348. mib : array[0..1] of cint;
  349. rval : cint;
  350. len : size_t;
  351. i : longint;
  352. v : longint;
  353. oerrno : cint;
  354. S : AnsiString;
  355. Begin
  356. s:='ab';
  357. SetLength(S,50);
  358. mib[0] := CTL_KERN;
  359. mib[1] := KERN_OSRELDATE;
  360. len := 4;
  361. oerrno:= fpgeterrno;
  362. if (FPsysctl(@mib, 2, pchar(@v), @len, NIL, 0) = -1) Then
  363. Begin
  364. if (fpgeterrno = ESysENOMEM) Then
  365. fpseterrno(oerrno);
  366. GetOSRelDate:=0;
  367. End
  368. else
  369. GetOSRelDate:=v;
  370. End;
  371. {$endif}
  372. {****************************************************************************
  373. Target setting
  374. ****************************************************************************}
  375. function set_target(t:tsystem):boolean;
  376. begin
  377. set_target:=false;
  378. if assigned(targetinfos[t]) then
  379. begin
  380. target_info:=targetinfos[t]^;
  381. set_target_asm(target_info.assem);
  382. set_target_ar(target_info.ar);
  383. set_target_res(target_info.res);
  384. target_cpu:=target_info.cpu;
  385. target_os_string:=lower(target_info.shortname);
  386. target_cpu_string:=cpu2str[target_cpu];
  387. target_full_string:=target_cpu_string+'-'+target_os_string;
  388. set_target:=true;
  389. exit;
  390. end;
  391. end;
  392. function set_target_asm(t:tasm):boolean;
  393. begin
  394. set_target_asm:=false;
  395. if assigned(asminfos[t]) and
  396. ((asminfos[t]^.supported_target=target_info.system) or
  397. (asminfos[t]^.supported_target=system_any)) then
  398. begin
  399. target_asm:=asminfos[t]^;
  400. set_target_asm:=true;
  401. exit;
  402. end;
  403. end;
  404. function set_target_ar(t:tar):boolean;
  405. begin
  406. set_target_ar:=false;
  407. if assigned(arinfos[t]) then
  408. begin
  409. target_ar:=arinfos[t]^;
  410. set_target_ar:=true;
  411. exit;
  412. end;
  413. end;
  414. function set_target_res(t:tres):boolean;
  415. begin
  416. set_target_res:=false;
  417. if assigned(resinfos[t]) then
  418. begin
  419. target_res:=resinfos[t]^;
  420. set_target_res:=true;
  421. exit;
  422. end;
  423. end;
  424. function set_target_by_string(const s : string) : boolean;
  425. var
  426. hs : string;
  427. t : tsystem;
  428. begin
  429. set_target_by_string:=false;
  430. { this should be case insensitive !! PM }
  431. hs:=upper(s);
  432. for t:=low(tsystem) to high(tsystem) do
  433. if assigned(targetinfos[t]) and
  434. (upper(targetinfos[t]^.shortname)=hs) then
  435. begin
  436. set_target_by_string:=set_target(t);
  437. exit;
  438. end;
  439. end;
  440. function set_target_asm_by_string(const s : string) : boolean;
  441. var
  442. hs : string;
  443. t : tasm;
  444. begin
  445. set_target_asm_by_string:=false;
  446. { this should be case insensitive !! PM }
  447. hs:=upper(s);
  448. for t:=low(tasm) to high(tasm) do
  449. if assigned(asminfos[t]) and
  450. (asminfos[t]^.idtxt=hs) then
  451. begin
  452. set_target_asm_by_string:=set_target_asm(t);
  453. exit;
  454. end;
  455. end;
  456. procedure UpdateAlignment(var d:talignmentinfo;const s:talignmentinfo);
  457. begin
  458. with d do
  459. begin
  460. { general update rules:
  461. minimum: if higher then update
  462. maximum: if lower then update or if undefined then update }
  463. if s.procalign>procalign then
  464. procalign:=s.procalign;
  465. if s.loopalign>loopalign then
  466. loopalign:=s.loopalign;
  467. if s.jumpalign>jumpalign then
  468. jumpalign:=s.jumpalign;
  469. if s.constalignmin>constalignmin then
  470. constalignmin:=s.constalignmin;
  471. if (constalignmax=0) or
  472. ((s.constalignmax>0) and (s.constalignmax<constalignmax)) then
  473. constalignmax:=s.constalignmax;
  474. if s.varalignmin>varalignmin then
  475. varalignmin:=s.varalignmin;
  476. if (varalignmax=0) or
  477. ((s.varalignmax>0) and (s.varalignmax<varalignmax)) then
  478. varalignmax:=s.varalignmax;
  479. if s.localalignmin>localalignmin then
  480. localalignmin:=s.localalignmin;
  481. if (localalignmax=0) or
  482. ((s.localalignmax>0) and (s.localalignmax<localalignmax)) then
  483. localalignmax:=s.localalignmax;
  484. if s.recordalignmin>recordalignmin then
  485. recordalignmin:=s.recordalignmin;
  486. if (recordalignmax=0) or
  487. ((s.recordalignmax>0) and (s.recordalignmax<recordalignmax)) then
  488. recordalignmax:=s.recordalignmax;
  489. if (maxCrecordalign=0) or
  490. ((s.maxCrecordalign>0) and (s.maxCrecordalign<maxCrecordalign)) then
  491. maxCrecordalign:=s.maxCrecordalign;
  492. end;
  493. end;
  494. {****************************************************************************
  495. Target registration
  496. ****************************************************************************}
  497. procedure RegisterTarget(const r:tsysteminfo);
  498. var
  499. t : tsystem;
  500. begin
  501. t:=r.system;
  502. if assigned(targetinfos[t]) then
  503. writeln('Warning: Target is already registered!')
  504. else
  505. Getmem(targetinfos[t],sizeof(tsysteminfo));
  506. targetinfos[t]^:=r;
  507. end;
  508. procedure RegisterRes(const r:tresinfo);
  509. var
  510. t : tres;
  511. begin
  512. t:=r.id;
  513. if assigned(resinfos[t]) then
  514. writeln('Warning: resourcecompiler is already registered!')
  515. else
  516. Getmem(resinfos[t],sizeof(tresinfo));
  517. resinfos[t]^:=r;
  518. end;
  519. procedure RegisterAr(const r:tarinfo);
  520. var
  521. t : tar;
  522. begin
  523. t:=r.id;
  524. if assigned(arinfos[t]) then
  525. writeln('Warning: ar is already registered!')
  526. else
  527. Getmem(arinfos[t],sizeof(tarinfo));
  528. arinfos[t]^:=r;
  529. end;
  530. procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
  531. begin
  532. system_info.linkextern := c;
  533. end;
  534. procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
  535. begin
  536. system_info.link := c;
  537. end;
  538. procedure DeregisterInfos;
  539. var
  540. assem : tasm;
  541. target : tsystem;
  542. ar : tar;
  543. res : tres;
  544. begin
  545. for target:=low(tsystem) to high(tsystem) do
  546. if assigned(targetinfos[target]) then
  547. begin
  548. freemem(targetinfos[target],sizeof(tsysteminfo));
  549. targetinfos[target]:=nil;
  550. end;
  551. for assem:=low(tasm) to high(tasm) do
  552. if assigned(asminfos[assem]) then
  553. begin
  554. freemem(asminfos[assem],sizeof(tasminfo));
  555. asminfos[assem]:=nil;
  556. end;
  557. for ar:=low(tar) to high(tar) do
  558. if assigned(arinfos[ar]) then
  559. begin
  560. freemem(arinfos[ar],sizeof(tarinfo));
  561. arinfos[ar]:=nil;
  562. end;
  563. for res:=low(tres) to high(tres) do
  564. if assigned(resinfos[res]) then
  565. begin
  566. freemem(resinfos[res],sizeof(tresinfo));
  567. resinfos[res]:=nil;
  568. end;
  569. end;
  570. {****************************************************************************
  571. Initialization of default target
  572. ****************************************************************************}
  573. procedure default_target(t:tsystem);
  574. begin
  575. set_target(t);
  576. if source_info.name='' then
  577. source_info:=target_info;
  578. end;
  579. procedure set_source_info(const ti : tsysteminfo);
  580. begin
  581. { can't use message() here (PFV) }
  582. if source_info.name<>'' then
  583. Writeln('Warning: Source OS Redefined!');
  584. source_info:=ti;
  585. end;
  586. procedure InitSystems;
  587. begin
  588. { Now default target, this is dependent on the target cpu define,
  589. when the define is the same as the source cpu then we use the source
  590. os, else we pick a default }
  591. {$ifdef i386}
  592. {$ifdef cpu86}
  593. default_target(source_info.system);
  594. {$else cpu86}
  595. {$ifdef linux}
  596. default_target(system_i386_linux);
  597. {$endif}
  598. {$ifdef freebsd}
  599. default_target(system_i386_freebsd);
  600. {$endif}
  601. {$endif cpu86}
  602. {$endif i386}
  603. {$ifdef x86_64}
  604. {$ifdef cpux86_64}
  605. default_target(source_info.system);
  606. {$define source_system_set}
  607. {$else cpux86_64}
  608. {$ifdef linux}
  609. default_target(system_x86_64_linux);
  610. {$define source_system_set}
  611. {$endif}
  612. {$ifdef freebsd}
  613. default_target(system_x86_64_freebsd);
  614. {$define source_system_set}
  615. {$endif}
  616. { default is linux }
  617. {$ifndef source_system_set}
  618. default_target(system_x86_64_linux);
  619. {$endif source_system_set}
  620. {$endif cpux86_64}
  621. {$endif x86_64}
  622. {$ifdef m68k}
  623. {$ifdef cpu68}
  624. default_target(source_info.target);
  625. {$else cpu68}
  626. default_target(system_m68k_linux);
  627. {$endif cpu68}
  628. {$endif m68k}
  629. {$ifdef alpha}
  630. {$ifdef cpualpha}
  631. default_target(source_info.system);
  632. {$else cpualpha}
  633. default_target(system_alpha_linux);
  634. {$endif cpualpha}
  635. {$endif alpha}
  636. {$ifdef powerpc}
  637. {$ifdef cpupowerpc}
  638. default_target(source_info.system);
  639. {$else cpupowerpc}
  640. default_target(system_powerpc_linux);
  641. {$endif cpupowerpc}
  642. {$endif powerpc}
  643. {$ifdef sparc}
  644. {$ifdef cpusparc}
  645. default_target(source_info.system);
  646. {$else cpusparc}
  647. default_target(system_sparc_linux);
  648. {$endif cpusparc}
  649. {$endif sparc}
  650. {$ifdef arm}
  651. {$ifdef cpuarm}
  652. default_target(source_info.system);
  653. {$else cpuarm}
  654. default_target(system_arm_linux);
  655. {$endif cpuarm}
  656. {$endif arm}
  657. end;
  658. initialization
  659. source_info.name:='';
  660. finalization
  661. DeregisterInfos;
  662. end.