fpmake.pp 6.0 KB

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