fpmake.pp 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. {$ifndef ALLPACKAGES}
  2. {$mode objfpc}{$H+}
  3. program fpmake;
  4. uses {$ifdef unix}cthreads,{$endif} fpmkunit;
  5. {$endif ALLPACKAGES}
  6. procedure add_rtl_extra(const ADirectory: string);
  7. Const
  8. // All Unices have full set of KVM+Crt in unix/ except QNX which is not
  9. // in workable state atm.
  10. UnixLikes = AllUnixOSes -[QNX]; // qnx never was active in 2.x afaik
  11. ClocaleOSes = UnixLikes -[android];
  12. CLocaleIncOSes= [Aix,freebsd,netbsd,openbsd,solaris,darwin,iphonesim,ios,dragonfly];
  13. IPCOSes = UnixLikes-[aix,android,beos,haiku];
  14. IPCBSDs = [FreeBSD,NetBSD,OpenBSD,DragonFly];
  15. // IPCcdeclOSes = [Darwin,iphonesim,ios];
  16. PrinterOSes = [go32v2,msdos,os2,win32,win64,atari]+unixlikes-[beos,haiku,morphos];
  17. SerialOSes = [android,linux,netbsd,openbsd,win32,win64];
  18. UComplexOSes = [atari,embedded,emx,gba,go32v2,msdos,nativent,nds,netware,netwlibc,os2,sinclairql,human68k,symbian,watcom,wii,wince,win32,win64,freertos,wasip1,wasip1threads]+UnixLikes+AllAmigaLikeOSes;
  19. MatrixOSes = [atari,embedded,emx,gba,go32v2,msdos,nativent,nds,netware,netwlibc,os2,sinclairql,human68k,symbian,watcom,wii,win32,win64,wince,freertos,wasip1,wasip1threads]+UnixLikes+AllAmigaLikeOSes;
  20. ObjectsOSes = [atari,embedded,emx,gba,go32v2,macosclassic,msdos,nds,netware,netwlibc,os2,sinclairql,human68k,symbian,watcom,wii,win16,win32,win64,wince,freertos,wasip1,wasip1threads]+UnixLikes+AllAmigaLikeOSes;
  21. WinsockOSes = [win32,win64,wince,os2,emx,netware,netwlibc];
  22. WinSock2OSes = [win32,win64,wince];
  23. SocketsOSes = UnixLikes+AllAmigaLikeOSes+[netware,netwlibc,os2,emx,wince,win32,win64];
  24. gpmOSes = [Linux,Android];
  25. AllTargetsextra = ObjectsOSes + UComplexOSes + MatrixOSes+
  26. SerialOSes +PrinterOSes+SocketsOSes+gpmOSes;
  27. Var
  28. P : TPackage;
  29. T : TTarget;
  30. Socksyscall, Socklibc : set of Tos;
  31. begin
  32. With Installer do
  33. begin
  34. P:=AddPackage('rtl-extra');
  35. P.ShortName:='rtle';
  36. P.Directory:=ADirectory;
  37. P.Version:='3.3.1';
  38. P.Author := 'FPC core team';
  39. P.License := 'LGPL with modification, ';
  40. P.HomepageURL := 'www.freepascal.org';
  41. P.OSes:=AllTargetsextra;
  42. if Defaults.CPU=jvm then
  43. P.OSes := P.OSes - [java,android];
  44. Socksyscall := [beos,freebsd,haiku,linux,netbsd,dragonfly];
  45. Socklibc := unixlikes-socksyscall;
  46. {$ifdef FPC_USE_SYSCALL}
  47. if Defaults.OS=openbsd then
  48. begin
  49. system.include(Socksyscall,openbsd);
  50. system.exclude(Socklibc,openbsd);
  51. end;
  52. {$endif}
  53. P.Email := '';
  54. P.Description := 'Rtl-extra, RTL not needed for bootstrapping';
  55. P.NeedLibC:= false;
  56. P.Dependencies.Add('morphunits',[morphos]);
  57. P.Dependencies.Add('arosunits',[aros]);
  58. if Defaults.CPU=m68k then
  59. P.Dependencies.Add('amunits',[amiga]);
  60. if Defaults.CPU=powerpc then
  61. P.Dependencies.Add('os4units',[amiga]);
  62. P.SourcePath.Add('src/inc');
  63. P.SourcePath.Add('src/$(OS)');
  64. P.SourcePath.Add('src/darwin',[iphonesim,ios]);
  65. P.SourcePath.Add('src/unix',AllUnixOSes);
  66. P.SourcePath.Add('src/bsd',AllBSDOSes);
  67. P.SourcePath.Add('src/os2commn',[os2,emx]);
  68. P.SourcePath.Add('src/netwcomn',[netware,netwlibc]);
  69. // We also need the win/ directory for WinCE as this uses the sockets
  70. // unit from that directory. Maybe we should try to merge the WinSock(2)
  71. // units to remove the wince directory completely...
  72. P.SourcePath.Add('src/win',[win32,win64,wince]);
  73. P.SourcePath.Add('src/amiga',[morphos]);
  74. P.IncludePath.Add('src/bsd',AllBSDOSes);
  75. P.IncludePath.Add('src/inc');
  76. P.IncludePath.Add('src/os2commn',[os2,emx]);
  77. P.IncludePath.Add('../../rtl/os2',[os2,emx]);
  78. P.IncludePath.Add('src/netwcomn',[netware,netwlibc]);
  79. P.IncludePath.Add('src/unix',AllUnixOSes);
  80. P.IncludePath.Add('src/$(OS)');
  81. P.IncludePath.Add('src/darwin',[iphonesim,ios]);
  82. P.IncludePath.Add('src/win',AllWindowsOSes);
  83. // Add clocale for Android first in order to compile the source file
  84. // from the 'android' dir, not the 'unix' dir.
  85. T:=P.Targets.AddUnit('real48utils.pp',AllTargetsextra-[msdos,win16] { msdos,win16 excluded temporarily, until bitpacked records containing longints on 16-bit targets are fixed }
  86. -[wasip1,wasip1threads] { internal error on the WebAssembly target }
  87. -[embedded]); { at least avr has no floats }
  88. if Defaults.CPU<>jvm then
  89. T:=P.Targets.AddUnit('clocale.pp',[android]);
  90. { Ideally, we should check if rtl contains math unit,
  91. I do know how that can be checked. PM 2019/11/27 }
  92. if ((Defaults.CPU<>i8086) and (Defaults.CPU<>z80))
  93. or (Defaults.OS<>embedded) then
  94. begin
  95. T:=P.Targets.AddUnit('ucomplex.pp',UComplexOSes);
  96. T:=P.Targets.AddUnit('matrix.pp',MatrixOSes);
  97. with T.Dependencies do
  98. begin
  99. AddInclude('mvecimp.inc');
  100. AddInclude('mmatimp.inc');
  101. end;
  102. end;
  103. T:=P.Targets.AddUnit('objects.pp',ObjectsOSes);
  104. T:=P.Targets.AddUnit('printer.pp',PrinterOSes);
  105. T.Dependencies.AddInclude('printerh.inc',PrinterOSes);
  106. T.Dependencies.AddInclude('printer.inc',PrinterOSes);
  107. T:=P.Targets.AddUnit('winsock.pp',WinSockOSes);
  108. with T.Dependencies do
  109. begin
  110. AddInclude('qos.inc',[netware,netwlibc]);
  111. AddInclude('netwsockh.inc',[netware,netwlibc]);
  112. end;
  113. T:=P.Targets.AddUnit('winsock2.pp',WinSock2OSes);
  114. T:=P.Targets.AddUnit('gpm.pp',gpmOSes);
  115. with T.Dependencies do
  116. AddUnit('sockets');
  117. T:=P.Targets.AddUnit('serial.pp',SerialOSes);
  118. T:=P.Targets.AddUnit('sockets.pp',SocketsOSes);
  119. with T.Dependencies do
  120. begin
  121. addinclude('osdefs.inc',AllUnixOSes);
  122. addinclude('socketsh.inc');
  123. addinclude('fpwinsockh.inc',AllWindowsOSes);
  124. addinclude('sockets.inc');
  125. addinclude('sockovl.inc');
  126. addinclude('unxsockh.inc',UnixLikes);
  127. addinclude('stdsock.inc',socklibc);
  128. addinclude('unixsock.inc',socksyscall);
  129. end;
  130. T:=P.Targets.AddUnit('unixsockets.pp',[linux]);
  131. T:=P.Targets.AddUnit('ipc.pp',IPCOSes);
  132. with T.Dependencies do
  133. begin
  134. addinclude('osdefs.inc');
  135. addinclude('ipcbsd.inc',IPCBSDs);
  136. addinclude('ipcsys.inc',[Linux]);
  137. addinclude('ipccall.inc',[Linux]);
  138. // addinclude('ipccdecl.inc',IPCcdeclOSes); // not used?
  139. end;
  140. T:=P.Targets.AddUnit('src/unix/clocale.pp',CLocaleOSes);
  141. with T.Dependencies do
  142. begin
  143. addinclude('clocale.inc',clocaleincOSes);
  144. end;
  145. { sortalgs unit source code uses goto, which is not supported on wasm32 CPU }
  146. T:=P.Targets.AddUnit('sortalgs.pp',AllCPUs-[wasm32], AllTargetsextra);
  147. P.NamespaceMap:='namespaces.lst';
  148. end;
  149. end;
  150. {$ifndef ALLPACKAGES}
  151. begin
  152. add_rtl_extra('');
  153. Installer.Run;
  154. end.
  155. {$endif ALLPACKAGES}