fpmake.pp 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. 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. -[embedded]); { at least avr has no floats }
  87. if Defaults.CPU<>jvm then
  88. T:=P.Targets.AddUnit('clocale.pp',[android]);
  89. { Ideally, we should check if rtl contains math unit,
  90. I do know how that can be checked. PM 2019/11/27 }
  91. if ((Defaults.CPU<>i8086) and (Defaults.CPU<>z80))
  92. or (Defaults.OS<>embedded) then
  93. begin
  94. T:=P.Targets.AddUnit('ucomplex.pp',UComplexOSes);
  95. T:=P.Targets.AddUnit('matrix.pp',MatrixOSes);
  96. with T.Dependencies do
  97. begin
  98. AddInclude('mvecimp.inc');
  99. AddInclude('mmatimp.inc');
  100. end;
  101. end;
  102. T:=P.Targets.AddUnit('objects.pp',ObjectsOSes);
  103. T:=P.Targets.AddUnit('printer.pp',PrinterOSes);
  104. T.Dependencies.AddInclude('printerh.inc',PrinterOSes);
  105. T.Dependencies.AddInclude('printer.inc',PrinterOSes);
  106. T:=P.Targets.AddUnit('winsock.pp',WinSockOSes);
  107. with T.Dependencies do
  108. begin
  109. AddInclude('qos.inc',[netware,netwlibc]);
  110. AddInclude('netwsockh.inc',[netware,netwlibc]);
  111. end;
  112. T:=P.Targets.AddUnit('winsock2.pp',WinSock2OSes);
  113. T:=P.Targets.AddUnit('gpm.pp',gpmOSes);
  114. with T.Dependencies do
  115. AddUnit('sockets');
  116. T:=P.Targets.AddUnit('serial.pp',SerialOSes);
  117. T:=P.Targets.AddUnit('sockets.pp',SocketsOSes);
  118. with T.Dependencies do
  119. begin
  120. addinclude('osdefs.inc',AllUnixOSes);
  121. addinclude('socketsh.inc');
  122. addinclude('fpwinsockh.inc',AllWindowsOSes);
  123. addinclude('sockets.inc');
  124. addinclude('sockovl.inc');
  125. addinclude('unxsockh.inc',UnixLikes);
  126. addinclude('stdsock.inc',socklibc);
  127. addinclude('unixsock.inc',socksyscall);
  128. end;
  129. T:=P.Targets.AddUnit('ipc.pp',IPCOSes);
  130. with T.Dependencies do
  131. begin
  132. addinclude('osdefs.inc');
  133. addinclude('ipcbsd.inc',IPCBSDs);
  134. addinclude('ipcsys.inc',[Linux]);
  135. addinclude('ipccall.inc',[Linux]);
  136. // addinclude('ipccdecl.inc',IPCcdeclOSes); // not used?
  137. end;
  138. T:=P.Targets.AddUnit('src/unix/clocale.pp',CLocaleOSes);
  139. with T.Dependencies do
  140. begin
  141. addinclude('clocale.inc',clocaleincOSes);
  142. end;
  143. T:=P.Targets.AddUnit('sortalgs.pp');
  144. end
  145. end;
  146. {$ifndef ALLPACKAGES}
  147. begin
  148. add_rtl_extra('');
  149. Installer.Run;
  150. end.
  151. {$endif ALLPACKAGES}