fpmake.pp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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];
  14. IPCOSes = UnixLikes-[aix,android,beos,haiku,solaris];
  15. IPCBSDs = [FreeBSD,NetBSD,OpenBSD];
  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,netware,netwlibc,os2,win32,win64,wince]+UnixLikes;
  22. WinsockOSes = [win32,win64,wince,os2,emx,netware,netwlibc];
  23. WinSock2OSes = [win32,win64,wince];
  24. // sockets of morphos is implemented, but not active
  25. SocketsOSes = UnixLikes+[amiga,aros,netware,netwlibc,os2,wince,win32,win64];
  26. Socksyscall = [beos,freebsd,haiku,linux,netbsd,openbsd];
  27. Socklibc = unixlikes-socksyscall;
  28. gpmOSes = [Linux,Android];
  29. AllTargetsextra = ObjectsOSes + UComplexOSes + MatrixOSes+
  30. SerialOSes +PrinterOSes+SocketsOSes+gpmOSes;
  31. Var
  32. P : TPackage;
  33. T : TTarget;
  34. begin
  35. With Installer do
  36. begin
  37. P:=AddPackage('rtl-extra');
  38. P.Directory:=ADirectory;
  39. P.Version:='2.7.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.IncludePath.Add('src/bsd',AllBSDOSes);
  62. P.IncludePath.Add('src/inc');
  63. P.IncludePath.Add('src/os2commn',[os2,emx]);
  64. P.IncludePath.Add('../../rtl/os2',[os2,emx]);
  65. P.IncludePath.Add('src/netwcomn',[netware,netwlibc]);
  66. P.IncludePath.Add('src/unix',AllUnixOSes);
  67. P.IncludePath.Add('src/$(OS)');
  68. P.IncludePath.Add('src/darwin',[iphonesim]);
  69. T:=P.Targets.AddUnit('ucomplex.pp',UComplexOSes);
  70. T:=P.Targets.AddUnit('objects.pp',ObjectsOSes);
  71. T:=P.Targets.AddUnit('printer.pp',PrinterOSes);
  72. T:=P.Targets.AddUnit('matrix.pp',MatrixOSes);
  73. with T.Dependencies do
  74. begin
  75. AddInclude('mvecimp.inc');
  76. AddInclude('mmatimp.inc');
  77. end;
  78. T:=P.Targets.AddUnit('winsock.pp',WinSockOSes);
  79. with T.Dependencies do
  80. begin
  81. AddInclude('qos.inc',[netware,netwlibc]);
  82. AddInclude('netwsockh.inc',[netware,netwlibc]);
  83. end;
  84. T:=P.Targets.AddUnit('winsock2.pp',WinSock2OSes);
  85. T:=P.Targets.AddUnit('gpm.pp',gpmOSes);
  86. with T.Dependencies do
  87. AddUnit('sockets');
  88. T:=P.Targets.AddUnit('serial.pp',SerialOSes);
  89. T:=P.Targets.AddUnit('sockets.pp',SocketsOSes);
  90. with T.Dependencies do
  91. begin
  92. addinclude('socketsh.inc');
  93. addinclude('sockets.inc');
  94. addinclude('sockovl.inc');
  95. addinclude('unxsockh.inc',UnixLikes);
  96. addinclude('stdsock.inc',socklibc);
  97. addinclude('unixsock.inc',socksyscall);
  98. end;
  99. T:=P.Targets.AddUnit('ipc.pp',IPCOSes);
  100. with T.Dependencies do
  101. begin
  102. addinclude('ipcbsd.inc',IPCBSDs);
  103. addinclude('ipcsys.inc',[Linux]);
  104. addinclude('ipccall.inc',[Linux]);
  105. // addinclude('ipccdecl.inc',IPCcdeclOSes); // not used?
  106. end;
  107. T:=P.Targets.AddUnit('src/unix/clocale.pp',CLocaleOSes);
  108. with T.Dependencies do
  109. begin
  110. addinclude('clocale.inc',clocaleincOSes);
  111. end;
  112. end
  113. end;
  114. {$ifndef ALLPACKAGES}
  115. begin
  116. add_rtl_extra('');
  117. Installer.Run;
  118. end.
  119. {$endif ALLPACKAGES}