fpmake.pp 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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,dragonfly];
  13. IPCOSes = UnixLikes-[aix,android,beos,haiku];
  14. IPCBSDs = [FreeBSD,NetBSD,OpenBSD,DragonFly];
  15. // IPCcdeclOSes = [Darwin,iphonesim];
  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]+UnixLikes+AllAmigaLikeOSes;
  19. MatrixOSes = [atari,embedded,emx,gba,go32v2,msdos,nativent,nds,netware,netwlibc,os2,symbian,watcom,wii,win32,win64,wince]+UnixLikes+AllAmigaLikeOSes;
  20. ObjectsOSes = [atari,embedded,emx,gba,go32v2,macos,msdos,nds,netware,netwlibc,os2,symbian,watcom,wii,win16,win32,win64,wince]+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]);
  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]);
  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. T:=P.Targets.AddUnit('ucomplex.pp',UComplexOSes);
  82. T:=P.Targets.AddUnit('objects.pp',ObjectsOSes);
  83. T:=P.Targets.AddUnit('printer.pp',PrinterOSes);
  84. T.Dependencies.AddInclude('printerh.inc',PrinterOSes);
  85. T.Dependencies.AddInclude('printer.inc',PrinterOSes);
  86. T:=P.Targets.AddUnit('matrix.pp',MatrixOSes);
  87. with T.Dependencies do
  88. begin
  89. AddInclude('mvecimp.inc');
  90. AddInclude('mmatimp.inc');
  91. end;
  92. T:=P.Targets.AddUnit('winsock.pp',WinSockOSes);
  93. with T.Dependencies do
  94. begin
  95. AddInclude('qos.inc',[netware,netwlibc]);
  96. AddInclude('netwsockh.inc',[netware,netwlibc]);
  97. end;
  98. T:=P.Targets.AddUnit('winsock2.pp',WinSock2OSes);
  99. T:=P.Targets.AddUnit('gpm.pp',gpmOSes);
  100. with T.Dependencies do
  101. AddUnit('sockets');
  102. T:=P.Targets.AddUnit('serial.pp',SerialOSes);
  103. T:=P.Targets.AddUnit('sockets.pp',SocketsOSes);
  104. with T.Dependencies do
  105. begin
  106. addinclude('osdefs.inc',AllUnixOSes);
  107. addinclude('socketsh.inc');
  108. addinclude('fpwinsockh.inc',AllWindowsOSes);
  109. addinclude('sockets.inc');
  110. addinclude('sockovl.inc');
  111. addinclude('unxsockh.inc',UnixLikes);
  112. addinclude('stdsock.inc',socklibc);
  113. addinclude('unixsock.inc',socksyscall);
  114. end;
  115. T:=P.Targets.AddUnit('ipc.pp',IPCOSes);
  116. with T.Dependencies do
  117. begin
  118. addinclude('osdefs.inc');
  119. addinclude('ipcbsd.inc',IPCBSDs);
  120. addinclude('ipcsys.inc',[Linux]);
  121. addinclude('ipccall.inc',[Linux]);
  122. // addinclude('ipccdecl.inc',IPCcdeclOSes); // not used?
  123. end;
  124. T:=P.Targets.AddUnit('src/unix/clocale.pp',CLocaleOSes);
  125. with T.Dependencies do
  126. begin
  127. addinclude('clocale.inc',clocaleincOSes);
  128. end;
  129. T:=P.Targets.AddUnit('sortalgs.pp');
  130. end
  131. end;
  132. {$ifndef ALLPACKAGES}
  133. begin
  134. add_rtl_extra('');
  135. Installer.Run;
  136. end.
  137. {$endif ALLPACKAGES}