fpmake.pp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. // Android has a dummy clocale unit, while it also includes unix dir.
  12. ClocaleOSes = UnixLikes -[beos];
  13. CLocaleIncOSes= [Aix,freebsd,netbsd,openbsd,solaris,darwin,iphonesim,dragonfly];
  14. IPCOSes = UnixLikes-[aix,android,beos,haiku];
  15. IPCBSDs = [FreeBSD,NetBSD,OpenBSD,DragonFly];
  16. // IPCcdeclOSes = [Darwin,iphonesim];
  17. PrinterOSes = [go32v2,msdos,os2,win32,win64]+unixlikes-[beos,haiku,morphos];
  18. SerialOSes = [android,linux,netbsd,openbsd,win32,win64];
  19. UComplexOSes = [amiga,aros,emx,gba,go32v2,morphos,msdos,nativent,nds,netware,netwlibc,os2,watcom,wii,wince,win32,win64]+UnixLikes;
  20. MatrixOSes = [amiga,aros,emx,gba,go32v2,morphos,msdos,nativent,nds,netware,netwlibc,os2,wii,win32,win64,wince]+UnixLikes;
  21. ObjectsOSes = [amiga,aros,emx,gba,go32v2,morphos,msdos,nds,netware,netwlibc,os2,win32,win64,wince]+UnixLikes;
  22. WinsockOSes = [win32,win64,wince,os2,emx,netware,netwlibc];
  23. WinSock2OSes = [win32,win64,wince];
  24. SocketsOSes = UnixLikes+AllAmigaLikeOSes+[netware,netwlibc,os2,wince,win32,win64];
  25. Socksyscall = [beos,freebsd,haiku,linux,netbsd,openbsd,dragonfly];
  26. Socklibc = unixlikes-socksyscall;
  27. gpmOSes = [Linux,Android];
  28. AllTargetsextra = ObjectsOSes + UComplexOSes + MatrixOSes+
  29. SerialOSes +PrinterOSes+SocketsOSes+gpmOSes;
  30. Var
  31. P : TPackage;
  32. T : TTarget;
  33. begin
  34. With Installer do
  35. begin
  36. P:=AddPackage('rtl-extra');
  37. P.ShortName:='rtle';
  38. P.Directory:=ADirectory;
  39. P.Version:='3.1.1';
  40. P.Author := 'FPC core team';
  41. P.License := 'LGPL with modification, ';
  42. P.HomepageURL := 'www.freepascal.org';
  43. P.OSes:=AllTargetsextra;
  44. P.Email := '';
  45. P.Description := 'Rtl-extra, RTL not needed for bootstrapping';
  46. P.NeedLibC:= false;
  47. P.Dependencies.Add('morphunits',[morphos]);
  48. P.Dependencies.Add('arosunits',[aros]);
  49. P.Dependencies.Add('amunits',[amiga]);
  50. P.SourcePath.Add('src/inc');
  51. P.SourcePath.Add('src/$(OS)');
  52. P.SourcePath.Add('src/darwin',[iphonesim]);
  53. P.SourcePath.Add('src/unix',AllUnixOSes);
  54. P.SourcePath.Add('src/bsd',AllBSDOSes);
  55. P.SourcePath.Add('src/os2commn',[os2,emx]);
  56. P.SourcePath.Add('src/netwcomn',[netware,netwlibc]);
  57. // We also need the win/ directory for WinCE as this uses the sockets
  58. // unit from that directory. Maybe we should try to merge the WinSock(2)
  59. // units to remove the wince directory completely...
  60. P.SourcePath.Add('src/win',[win32,win64,wince]);
  61. P.SourcePath.Add('src/amiga',[morphos]);
  62. P.IncludePath.Add('src/bsd',AllBSDOSes);
  63. P.IncludePath.Add('src/inc');
  64. P.IncludePath.Add('src/os2commn',[os2,emx]);
  65. P.IncludePath.Add('../../rtl/os2',[os2,emx]);
  66. P.IncludePath.Add('src/netwcomn',[netware,netwlibc]);
  67. P.IncludePath.Add('src/unix',AllUnixOSes);
  68. P.IncludePath.Add('src/$(OS)');
  69. P.IncludePath.Add('src/darwin',[iphonesim]);
  70. T:=P.Targets.AddUnit('ucomplex.pp',UComplexOSes);
  71. T:=P.Targets.AddUnit('objects.pp',ObjectsOSes);
  72. T:=P.Targets.AddUnit('printer.pp',PrinterOSes);
  73. T:=P.Targets.AddUnit('matrix.pp',MatrixOSes);
  74. with T.Dependencies do
  75. begin
  76. AddInclude('mvecimp.inc');
  77. AddInclude('mmatimp.inc');
  78. end;
  79. T:=P.Targets.AddUnit('winsock.pp',WinSockOSes);
  80. with T.Dependencies do
  81. begin
  82. AddInclude('qos.inc',[netware,netwlibc]);
  83. AddInclude('netwsockh.inc',[netware,netwlibc]);
  84. end;
  85. T:=P.Targets.AddUnit('winsock2.pp',WinSock2OSes);
  86. T:=P.Targets.AddUnit('gpm.pp',gpmOSes);
  87. with T.Dependencies do
  88. AddUnit('sockets');
  89. T:=P.Targets.AddUnit('serial.pp',SerialOSes);
  90. T:=P.Targets.AddUnit('sockets.pp',SocketsOSes);
  91. with T.Dependencies do
  92. begin
  93. addinclude('socketsh.inc');
  94. addinclude('sockets.inc');
  95. addinclude('sockovl.inc');
  96. addinclude('unxsockh.inc',UnixLikes);
  97. addinclude('stdsock.inc',socklibc);
  98. addinclude('unixsock.inc',socksyscall);
  99. end;
  100. T:=P.Targets.AddUnit('ipc.pp',IPCOSes);
  101. with T.Dependencies do
  102. begin
  103. addinclude('ipcbsd.inc',IPCBSDs);
  104. addinclude('ipcsys.inc',[Linux]);
  105. addinclude('ipccall.inc',[Linux]);
  106. // addinclude('ipccdecl.inc',IPCcdeclOSes); // not used?
  107. end;
  108. T:=P.Targets.AddUnit('src/unix/clocale.pp',CLocaleOSes);
  109. with T.Dependencies do
  110. begin
  111. addinclude('clocale.inc',clocaleincOSes);
  112. end;
  113. end
  114. end;
  115. {$ifndef ALLPACKAGES}
  116. begin
  117. add_rtl_extra('');
  118. Installer.Run;
  119. end.
  120. {$endif ALLPACKAGES}