summaryrefslogtreecommitdiff
path: root/packages/rtl-extra/fpmake.pp
blob: c1897f293145826f3c4fd264c1a014b49d983ed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{$ifndef ALLPACKAGES}
{$mode objfpc}{$H+}
program fpmake;

uses fpmkunit;
{$endif ALLPACKAGES}

procedure add_rtl_extra(const ADirectory: string);

Const 
  // All Unices have full set of KVM+Crt in unix/ except QNX which is not
  // in workable state atm.
  UnixLikes = AllUnixOSes -[QNX]; // qnx never was active in 2.x afaik
 
  // Android has a dummy clocale unit, while it also includes unix dir.
  ClocaleOSes   = UnixLikes -[beos];
  CLocaleIncOSes= [Aix,freebsd,netbsd,openbsd,solaris,darwin,iphonesim,dragonfly];

  IPCOSes       = UnixLikes-[aix,android,beos,haiku,solaris];
  IPCBSDs       = [FreeBSD,NetBSD,OpenBSD,DragonFly];
//  IPCcdeclOSes  = [Darwin,iphonesim];

  PrinterOSes   = [go32v2,msdos,os2,win32,win64]+unixlikes-[beos,haiku,morphos];
  SerialOSes    = [android,linux,netbsd,openbsd,win32,win64];
  UComplexOSes  = [amiga,aros,emx,gba,go32v2,morphos,msdos,nativent,nds,netware,netwlibc,os2,watcom,wii,wince,win32,win64]+UnixLikes;
  MatrixOSes	= [amiga,aros,emx,gba,go32v2,morphos,msdos,nativent,nds,netware,netwlibc,os2,wii,win32,win64,wince]+UnixLikes;
  ObjectsOSes   = [amiga,aros,emx,gba,go32v2,morphos,msdos,netware,netwlibc,os2,win32,win64,wince]+UnixLikes;
  WinsockOSes   = [win32,win64,wince,os2,emx,netware,netwlibc];
  WinSock2OSes  = [win32,win64,wince];
  // sockets of  morphos is implemented, but not active
  SocketsOSes   = UnixLikes+[amiga,aros,netware,netwlibc,os2,wince,win32,win64];
  Socksyscall   = [beos,freebsd,haiku,linux,netbsd,openbsd,dragonfly];
  Socklibc	= unixlikes-socksyscall;
  gpmOSes	= [Linux,Android];
  AllTargetsextra = ObjectsOSes + UComplexOSes + MatrixOSes+
                      SerialOSes +PrinterOSes+SocketsOSes+gpmOSes;

Var
  P : TPackage;
  T : TTarget;

begin
  With Installer do
    begin
    P:=AddPackage('rtl-extra');
    P.ShortName:='rtle';
    P.Directory:=ADirectory;
    P.Version:='2.7.1';
    P.Author := 'FPC core team';
    P.License := 'LGPL with modification, ';
    P.HomepageURL := 'www.freepascal.org';
    P.OSes:=AllTargetsextra;
    P.Email := '';
    P.Description := 'Rtl-extra, RTL not needed for bootstrapping';
    P.NeedLibC:= false;
    P.Dependencies.Add('morphunits',[morphos]);
    P.Dependencies.Add('arosunits',[aros]);
    P.Dependencies.Add('amunits',[amiga]);

    P.SourcePath.Add('src/inc');
    P.SourcePath.Add('src/$(OS)');
    P.SourcePath.Add('src/darwin',[iphonesim]);
    P.SourcePath.Add('src/unix',AllUnixOSes);
    P.SourcePath.Add('src/bsd',AllBSDOSes);
    P.SourcePath.Add('src/os2commn',[os2,emx]);
    P.SourcePath.Add('src/netwcomn',[netware,netwlibc]);
    // We also need the win/ directory for WinCE as this uses the sockets
    // unit from that directory. Maybe we should try to merge the WinSock(2)
    // units to remove the wince directory completely...
    P.SourcePath.Add('src/win',[win32,win64,wince]);

    P.IncludePath.Add('src/bsd',AllBSDOSes);
    P.IncludePath.Add('src/inc');
    P.IncludePath.Add('src/os2commn',[os2,emx]);
    P.IncludePath.Add('../../rtl/os2',[os2,emx]);
    P.IncludePath.Add('src/netwcomn',[netware,netwlibc]);
    P.IncludePath.Add('src/unix',AllUnixOSes);
    P.IncludePath.Add('src/$(OS)');
    P.IncludePath.Add('src/darwin',[iphonesim]);

    T:=P.Targets.AddUnit('ucomplex.pp',UComplexOSes);

    T:=P.Targets.AddUnit('objects.pp',ObjectsOSes);

    T:=P.Targets.AddUnit('printer.pp',PrinterOSes);

    T:=P.Targets.AddUnit('matrix.pp',MatrixOSes);
    with T.Dependencies do
     begin
       AddInclude('mvecimp.inc');
       AddInclude('mmatimp.inc');
     end;
    T:=P.Targets.AddUnit('winsock.pp',WinSockOSes);
    with T.Dependencies do
     begin
       AddInclude('qos.inc',[netware,netwlibc]);
       AddInclude('netwsockh.inc',[netware,netwlibc]);
     end;
    T:=P.Targets.AddUnit('winsock2.pp',WinSock2OSes);
    T:=P.Targets.AddUnit('gpm.pp',gpmOSes);
    with T.Dependencies do
      AddUnit('sockets');

    T:=P.Targets.AddUnit('serial.pp',SerialOSes);
    T:=P.Targets.AddUnit('sockets.pp',SocketsOSes);
    with T.Dependencies do
     begin
       addinclude('socketsh.inc');
       addinclude('sockets.inc');
       addinclude('sockovl.inc');
       addinclude('unxsockh.inc',UnixLikes);
       addinclude('stdsock.inc',socklibc);
       addinclude('unixsock.inc',socksyscall);
     end; 

    T:=P.Targets.AddUnit('ipc.pp',IPCOSes);
    with T.Dependencies do
     begin
       addinclude('ipcbsd.inc',IPCBSDs);
       addinclude('ipcsys.inc',[Linux]);
       addinclude('ipccall.inc',[Linux]);
//       addinclude('ipccdecl.inc',IPCcdeclOSes); // not used?
     end;
    T:=P.Targets.AddUnit('src/unix/clocale.pp',CLocaleOSes);
    with T.Dependencies do
     begin
       addinclude('clocale.inc',clocaleincOSes);
     end;
  end
end;
 
{$ifndef ALLPACKAGES}
begin
  add_rtl_extra('');
  Installer.Run;
end.
{$endif ALLPACKAGES}