systems.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  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. );
  45. tasmmode= (asmmode_none
  46. { standard assembler (cpu dependant) with full parsing }
  47. ,asmmode_standard
  48. ,asmmode_i386_att
  49. ,asmmode_i386_intel
  50. ,asmmode_ppc_gas
  51. ,asmmode_ppc_motorola
  52. ,asmmode_arm_gas
  53. ,asmmode_sparc_gas
  54. ,asmmode_x86_64_gas
  55. ,asmmode_m68k_mot
  56. );
  57. (* IMPORTANT NOTE:
  58. the integer value of this enum is stored in PPU
  59. files to recognize the target, so if you add new targets
  60. allways add them at end PM
  61. FURTHERMORE : Make sure that this branch values are
  62. consistant with the main branch version always. (CEC)
  63. *)
  64. type
  65. tsystem =
  66. (
  67. system_none, { 0 }
  68. obsolete_system_i386_GO32V1,{ 1 }
  69. system_i386_GO32V2, { 2 }
  70. system_i386_linux, { 3 }
  71. system_i386_OS2, { 4 }
  72. system_i386_Win32, { 5 }
  73. system_i386_freebsd, { 6 }
  74. system_m68k_Amiga, { 7 }
  75. system_m68k_Atari, { 8 }
  76. system_m68k_Mac, { 9 }
  77. system_m68k_linux, { 10 }
  78. system_m68k_PalmOS, { 11 }
  79. system_alpha_linux, { 12 }
  80. system_powerpc_linux, { 13 }
  81. system_powerpc_macos, { 14 }
  82. system_i386_solaris, { 15 }
  83. system_i386_beos, { 16 }
  84. system_i386_netbsd, { 17 }
  85. system_m68k_netbsd, { 18 }
  86. system_i386_Netware, { 19 }
  87. system_i386_qnx, { 20 }
  88. system_i386_wdosx, { 21 }
  89. system_sparc_solaris, { 22 }
  90. system_sparc_linux, { 23 }
  91. system_i386_openbsd, { 24 }
  92. system_m68k_openbsd, { 25 }
  93. system_x86_64_linux, { 26 }
  94. system_powerpc_darwin, { 27 }
  95. system_i386_EMX, { 28 }
  96. system_powerpc_netbsd, { 29 }
  97. system_powerpc_openbsd, { 30 }
  98. system_arm_linux, { 31 }
  99. system_i386_watcom, { 32 }
  100. system_powerpc_MorphOS, { 33 }
  101. system_x86_64_freebsd, { 34 }
  102. system_i386_netwlibc, { 35 }
  103. system_powerpc_Amiga, { 36 }
  104. system_x86_64_win64, { 37 }
  105. system_arm_wince, { 38 }
  106. system_ia64_win64, { 39 }
  107. system_i386_wince, { 40 }
  108. system_x86_6432_linux, { 41 }
  109. system_arm_gba { 42 }
  110. );
  111. tasm = (as_none
  112. ,as_gas { standard gnu assembler }
  113. ,as_i386_as_aout
  114. ,as_i386_nasmcoff
  115. ,as_i386_nasmwin32
  116. ,as_i386_nasmwdosx
  117. ,as_i386_nasmelf
  118. ,as_i386_nasmobj
  119. ,as_i386_nasmbeos
  120. ,as_i386_tasm
  121. ,as_i386_masm
  122. ,as_i386_wasm
  123. ,as_i386_coff
  124. ,as_i386_pecoff
  125. ,as_i386_elf32
  126. ,as_i386_pecoffwdosx
  127. ,as_m68k_mit
  128. ,as_powerpc_mpw
  129. ,as_darwin
  130. ,as_x86_64_masm
  131. ,as_x86_64_pecoff
  132. ,as_i386_pecoffwince
  133. ,as_arm_pecoffwince
  134. );
  135. tar = (ar_none
  136. ,ar_gnu_ar,ar_mpw_ar
  137. );
  138. tres = (res_none
  139. ,res_gnu_windres,res_emxbind
  140. ,res_m68k_palmos,res_m68k_mpw
  141. ,res_powerpc_mpw,res_elf
  142. ,res_gnu_wince_windres
  143. );
  144. tdbg = (dbg_none
  145. ,dbg_stabs,dbg_dwarf
  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. pdbginfo = ^tdbginfo;
  210. tdbginfo = record
  211. id : tdbg;
  212. idtxt : string[12];
  213. end;
  214. tsystemflags = (tf_none,
  215. tf_under_development,
  216. tf_need_export,tf_needs_isconsole,
  217. tf_code_small,tf_static_reg_based,
  218. tf_needs_symbol_size,
  219. tf_smartlink_sections,
  220. tf_needs_dwarf_cfi,
  221. tf_use_8_3,
  222. tf_pic_uses_got,
  223. tf_library_needs_pic
  224. );
  225. psysteminfo = ^tsysteminfo;
  226. { using packed causes bus errors on processors which require alignment }
  227. tsysteminfo = record
  228. system : tsystem;
  229. name : string[34];
  230. shortname : string[9];
  231. flags : set of tsystemflags;
  232. cpu : tsystemcpu;
  233. unit_env : string[16];
  234. extradefines : string[40];
  235. exeext,
  236. defext,
  237. scriptext,
  238. smartext,
  239. unitext,
  240. unitlibext,
  241. asmext,
  242. objext,
  243. resext,
  244. resobjext : string[4];
  245. sharedlibext : string[10];
  246. staticlibext,
  247. staticlibprefix : string[4];
  248. sharedlibprefix : string[4];
  249. sharedClibext : string[10];
  250. staticClibext,
  251. staticClibprefix : string[4];
  252. sharedClibprefix : string[4];
  253. p_ext_support:Boolean; {Whether extension .p is supported by default}
  254. Cprefix : string[2];
  255. newline : string[2];
  256. dirsep : char;
  257. files_case_relevent : boolean;
  258. assem : tasm;
  259. assemextern : tasm; { external assembler, used by -a }
  260. link : tabstractlinkerclass;
  261. linkextern : tabstractlinkerclass; { external linker, used by -s }
  262. ar : tar;
  263. res : tres;
  264. dbg : tdbg;
  265. script : tscripttype;
  266. endian : tendian;
  267. alignment : talignmentinfo;
  268. {
  269. Offset from the argument pointer register to the first
  270. argument's address. On some machines it may depend on
  271. the data type of the function.
  272. (see also FIRST_PARM_OFFSET in GCC source)
  273. }
  274. first_parm_offset : longint;
  275. stacksize : longint;
  276. DllScanSupported : boolean;
  277. use_function_relative_addresses : boolean;
  278. abi : tabi;
  279. end;
  280. const
  281. { alias for supported_target field in tasminfo }
  282. system_any = system_none;
  283. system_wince : set of tsystem = [system_arm_wince,system_i386_wince];
  284. system_linux : set of tsystem = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,
  285. system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
  286. system_x86_6432_linux];
  287. { all real windows systems, no cripple ones like wince, wdosx et. al. }
  288. system_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64];
  289. cpu2str : array[TSystemCpu] of string =
  290. ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
  291. 'mips','arm');
  292. var
  293. targetinfos : array[tsystem] of psysteminfo;
  294. arinfos : array[tar] of parinfo;
  295. resinfos : array[tres] of presinfo;
  296. asminfos : array[tasm] of pasminfo;
  297. dbginfos : array[tdbg] of pdbginfo;
  298. source_info : tsysteminfo;
  299. target_cpu : tsystemcpu;
  300. target_info : tsysteminfo;
  301. target_asm : tasminfo;
  302. target_ar : tarinfo;
  303. target_res : tresinfo;
  304. target_dbg : tdbginfo;
  305. target_cpu_string,
  306. target_os_string : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
  307. target_full_string : string[24];
  308. function set_target(t:tsystem):boolean;
  309. function set_target_asm(t:tasm):boolean;
  310. function set_target_ar(t:tar):boolean;
  311. function set_target_res(t:tres):boolean;
  312. function set_target_dbg(t:tdbg):boolean;
  313. function set_target_by_string(const s : string) : boolean;
  314. function set_target_asm_by_string(const s : string) : boolean;
  315. function set_target_dbg_by_string(const s : string) : boolean;
  316. procedure set_source_info(const ti : tsysteminfo);
  317. procedure UpdateAlignment(var d:talignmentinfo;const s:talignmentinfo);
  318. procedure RegisterTarget(const r:tsysteminfo);
  319. procedure RegisterRes(const r:tresinfo);
  320. procedure RegisterAr(const r:tarinfo);
  321. { Register the external linker. This routine is called to setup the
  322. class to use for the linker. It returns the tsysteminfo structure
  323. updated with the correct linker class for external linking.
  324. }
  325. procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
  326. { Register the internal linker. This routine is called to setup the
  327. class to use for the linker. It returns the tsysteminfo structure
  328. updated with the correct linker class for internal linking.
  329. If internal linking is not supported, this class can be set
  330. to nil.
  331. }
  332. procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
  333. procedure InitSystems;
  334. {$ifdef FreeBSD}
  335. function GetOSRelDate:Longint;
  336. {$endif}
  337. implementation
  338. uses
  339. cutils{$ifdef FreeBSD},SysCtl,BaseUnix{$endif};
  340. {****************************************************************************
  341. OS runtime version detection utility routine
  342. ****************************************************************************}
  343. {$ifdef FreeBSD}
  344. function GetOSRelDate:Longint;
  345. var
  346. mib : array[0..1] of cint;
  347. rval : cint;
  348. len : size_t;
  349. i : longint;
  350. v : longint;
  351. oerrno : cint;
  352. S : AnsiString;
  353. Begin
  354. s:='ab';
  355. SetLength(S,50);
  356. mib[0] := CTL_KERN;
  357. mib[1] := KERN_OSRELDATE;
  358. len := 4;
  359. oerrno:= fpgeterrno;
  360. if (FPsysctl(@mib, 2, pchar(@v), @len, NIL, 0) = -1) Then
  361. Begin
  362. if (fpgeterrno = ESysENOMEM) Then
  363. fpseterrno(oerrno);
  364. GetOSRelDate:=0;
  365. End
  366. else
  367. GetOSRelDate:=v;
  368. End;
  369. {$endif}
  370. {****************************************************************************
  371. Target setting
  372. ****************************************************************************}
  373. function set_target(t:tsystem):boolean;
  374. begin
  375. set_target:=false;
  376. if assigned(targetinfos[t]) then
  377. begin
  378. target_info:=targetinfos[t]^;
  379. set_target_asm(target_info.assem);
  380. set_target_ar(target_info.ar);
  381. set_target_res(target_info.res);
  382. set_target_dbg(target_info.dbg);
  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. result:=false;
  406. if assigned(arinfos[t]) then
  407. begin
  408. target_ar:=arinfos[t]^;
  409. result:=true;
  410. exit;
  411. end;
  412. end;
  413. function set_target_res(t:tres):boolean;
  414. begin
  415. result:=false;
  416. if assigned(resinfos[t]) then
  417. begin
  418. target_res:=resinfos[t]^;
  419. result:=true;
  420. exit;
  421. end;
  422. end;
  423. function set_target_dbg(t:tdbg):boolean;
  424. begin
  425. result:=false;
  426. if assigned(dbginfos[t]) then
  427. begin
  428. target_dbg:=dbginfos[t]^;
  429. result:=true;
  430. exit;
  431. end;
  432. end;
  433. function set_target_by_string(const s : string) : boolean;
  434. var
  435. hs : string;
  436. t : tsystem;
  437. begin
  438. result:=false;
  439. hs:=upper(s);
  440. for t:=low(tsystem) to high(tsystem) do
  441. if assigned(targetinfos[t]) and
  442. (upper(targetinfos[t]^.shortname)=hs) then
  443. begin
  444. result:=set_target(t);
  445. exit;
  446. end;
  447. end;
  448. function set_target_asm_by_string(const s : string) : boolean;
  449. var
  450. hs : string;
  451. t : tasm;
  452. begin
  453. result:=false;
  454. hs:=upper(s);
  455. for t:=low(tasm) to high(tasm) do
  456. if assigned(asminfos[t]) and
  457. (asminfos[t]^.idtxt=hs) then
  458. begin
  459. result:=set_target_asm(t);
  460. exit;
  461. end;
  462. end;
  463. function set_target_dbg_by_string(const s : string) : boolean;
  464. var
  465. hs : string;
  466. t : tdbg;
  467. begin
  468. result:=false;
  469. hs:=upper(s);
  470. for t:=low(tdbg) to high(tdbg) do
  471. if assigned(dbginfos[t]) and
  472. (dbginfos[t]^.idtxt=hs) then
  473. begin
  474. result:=set_target_dbg(t);
  475. exit;
  476. end;
  477. end;
  478. procedure UpdateAlignment(var d:talignmentinfo;const s:talignmentinfo);
  479. begin
  480. with d do
  481. begin
  482. { general update rules:
  483. minimum: if higher then update
  484. maximum: if lower then update or if undefined then update }
  485. if s.procalign>procalign then
  486. procalign:=s.procalign;
  487. if s.loopalign>loopalign then
  488. loopalign:=s.loopalign;
  489. if s.jumpalign>jumpalign then
  490. jumpalign:=s.jumpalign;
  491. if s.constalignmin>constalignmin then
  492. constalignmin:=s.constalignmin;
  493. if (constalignmax=0) or
  494. ((s.constalignmax>0) and (s.constalignmax<constalignmax)) then
  495. constalignmax:=s.constalignmax;
  496. if s.varalignmin>varalignmin then
  497. varalignmin:=s.varalignmin;
  498. if (varalignmax=0) or
  499. ((s.varalignmax>0) and (s.varalignmax<varalignmax)) then
  500. varalignmax:=s.varalignmax;
  501. if s.localalignmin>localalignmin then
  502. localalignmin:=s.localalignmin;
  503. if (localalignmax=0) or
  504. ((s.localalignmax>0) and (s.localalignmax<localalignmax)) then
  505. localalignmax:=s.localalignmax;
  506. if s.recordalignmin>recordalignmin then
  507. recordalignmin:=s.recordalignmin;
  508. if (recordalignmax=0) or
  509. ((s.recordalignmax>0) and (s.recordalignmax<recordalignmax)) then
  510. recordalignmax:=s.recordalignmax;
  511. if (maxCrecordalign=0) or
  512. ((s.maxCrecordalign>0) and (s.maxCrecordalign<maxCrecordalign)) then
  513. maxCrecordalign:=s.maxCrecordalign;
  514. end;
  515. end;
  516. {****************************************************************************
  517. Target registration
  518. ****************************************************************************}
  519. procedure RegisterTarget(const r:tsysteminfo);
  520. var
  521. t : tsystem;
  522. begin
  523. t:=r.system;
  524. if assigned(targetinfos[t]) then
  525. writeln('Warning: Target is already registered!')
  526. else
  527. Getmem(targetinfos[t],sizeof(tsysteminfo));
  528. targetinfos[t]^:=r;
  529. end;
  530. procedure RegisterRes(const r:tresinfo);
  531. var
  532. t : tres;
  533. begin
  534. t:=r.id;
  535. if assigned(resinfos[t]) then
  536. writeln('Warning: resourcecompiler is already registered!')
  537. else
  538. Getmem(resinfos[t],sizeof(tresinfo));
  539. resinfos[t]^:=r;
  540. end;
  541. procedure RegisterAr(const r:tarinfo);
  542. var
  543. t : tar;
  544. begin
  545. t:=r.id;
  546. if assigned(arinfos[t]) then
  547. writeln('Warning: ar is already registered!')
  548. else
  549. Getmem(arinfos[t],sizeof(tarinfo));
  550. arinfos[t]^:=r;
  551. end;
  552. procedure RegisterExternalLinker(var system_info: tsysteminfo; c:TAbstractLinkerClass);
  553. begin
  554. system_info.linkextern := c;
  555. end;
  556. procedure RegisterInternalLinker(var system_info : tsysteminfo; c:TAbstractLinkerClass);
  557. begin
  558. system_info.link := c;
  559. end;
  560. procedure DeregisterInfos;
  561. var
  562. assem : tasm;
  563. target : tsystem;
  564. ar : tar;
  565. res : tres;
  566. begin
  567. for target:=low(tsystem) to high(tsystem) do
  568. if assigned(targetinfos[target]) then
  569. begin
  570. freemem(targetinfos[target],sizeof(tsysteminfo));
  571. targetinfos[target]:=nil;
  572. end;
  573. for assem:=low(tasm) to high(tasm) do
  574. if assigned(asminfos[assem]) then
  575. begin
  576. freemem(asminfos[assem],sizeof(tasminfo));
  577. asminfos[assem]:=nil;
  578. end;
  579. for ar:=low(tar) to high(tar) do
  580. if assigned(arinfos[ar]) then
  581. begin
  582. freemem(arinfos[ar],sizeof(tarinfo));
  583. arinfos[ar]:=nil;
  584. end;
  585. for res:=low(tres) to high(tres) do
  586. if assigned(resinfos[res]) then
  587. begin
  588. freemem(resinfos[res],sizeof(tresinfo));
  589. resinfos[res]:=nil;
  590. end;
  591. end;
  592. {****************************************************************************
  593. Initialization of default target
  594. ****************************************************************************}
  595. procedure default_target(t:tsystem);
  596. begin
  597. set_target(t);
  598. if source_info.name='' then
  599. source_info:=target_info;
  600. end;
  601. procedure set_source_info(const ti : tsysteminfo);
  602. begin
  603. { can't use message() here (PFV) }
  604. if source_info.name<>'' then
  605. Writeln('Warning: Source OS Redefined!');
  606. source_info:=ti;
  607. end;
  608. procedure InitSystems;
  609. begin
  610. { Now default target, this is dependent on the target cpu define,
  611. when the define is the same as the source cpu then we use the source
  612. os, else we pick a default }
  613. {$ifdef i386}
  614. {$ifdef cpu86}
  615. default_target(source_info.system);
  616. {$else cpu86}
  617. {$ifdef linux}
  618. default_target(system_i386_linux);
  619. {$endif}
  620. {$ifdef freebsd}
  621. default_target(system_i386_freebsd);
  622. {$endif}
  623. {$endif cpu86}
  624. {$endif i386}
  625. {$ifdef x86_64}
  626. {$ifdef cpux86_64}
  627. default_target(source_info.system);
  628. {$define source_system_set}
  629. {$else cpux86_64}
  630. {$ifdef linux}
  631. default_target(system_x86_64_linux);
  632. {$define source_system_set}
  633. {$endif}
  634. {$ifdef freebsd}
  635. default_target(system_x86_64_freebsd);
  636. {$define source_system_set}
  637. {$endif}
  638. { default is linux }
  639. {$ifndef source_system_set}
  640. default_target(system_x86_64_linux);
  641. {$endif source_system_set}
  642. {$endif cpux86_64}
  643. {$endif x86_64}
  644. {$ifdef m68k}
  645. {$ifdef cpu68}
  646. default_target(source_info.target);
  647. {$else cpu68}
  648. default_target(system_m68k_linux);
  649. {$endif cpu68}
  650. {$endif m68k}
  651. {$ifdef alpha}
  652. {$ifdef cpualpha}
  653. default_target(source_info.system);
  654. {$else cpualpha}
  655. default_target(system_alpha_linux);
  656. {$endif cpualpha}
  657. {$endif alpha}
  658. {$ifdef powerpc}
  659. {$ifdef cpupowerpc}
  660. default_target(source_info.system);
  661. {$else cpupowerpc}
  662. default_target(system_powerpc_linux);
  663. {$endif cpupowerpc}
  664. {$endif powerpc}
  665. {$ifdef sparc}
  666. {$ifdef cpusparc}
  667. default_target(source_info.system);
  668. {$else cpusparc}
  669. default_target(system_sparc_linux);
  670. {$endif cpusparc}
  671. {$endif sparc}
  672. {$ifdef arm}
  673. {$ifdef cpuarm}
  674. default_target(source_info.system);
  675. {$else cpuarm}
  676. default_target(system_arm_linux);
  677. {$endif cpuarm}
  678. {$endif arm}
  679. end;
  680. initialization
  681. source_info.name:='';
  682. finalization
  683. DeregisterInfos;
  684. end.