forked from AdaCore/aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared.gpr
210 lines (160 loc) · 6.47 KB
/
shared.gpr
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2003-2014, AdaCore --
-- --
-- This is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This software is distributed in the hope that it will --
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty --
-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public License --
-- distributed with this software; see file COPYING3. If not, go --
-- to http://www.gnu.org/licenses for a complete copy of the license. --
------------------------------------------------------------------------------
abstract project Shared is
for Source_Dirs use ();
type Build_Type is ("Debug", "Release");
Build : Build_Type := external ("PRJ_BUILD", "Debug");
type Install_Status is ("Installed", "Disabled");
Processors := External ("PROCESSORS", "0");
-------------
-- SOCKLIB --
-------------
type SOCKLIB_Type is ("gnat", "ipv6", "ipv4");
SOCKLIB : SOCKLIB_Type := external ("PRJ_SOCKLIB", "gnat");
------------
-- SOCKET --
------------
type Socket_Type is ("std", "ssl", "openssl", "gnutls");
Socket : Socket_Type := external ("SOCKET", "std");
--------------------------
-- Static / Relocatable --
--------------------------
type Library_Kind is ("relocatable", "static");
Library_Type : Library_Kind := external ("LIBRARY_TYPE", "static");
---------------------
-- Target to build --
---------------------
Target := external ("TARGET", "i686-pc-mingw32");
type S_Target_type is ("Windows_NT", "UNIX", "Darwin", "vxworks", "freebsd");
S_Target : S_Target_Type := external ("PRJ_TARGET");
-----------------------
-- Build directories --
-----------------------
Root_Dir := ".build";
Target_Dir := Root_Dir & "/" & Target;
for Exec_Dir use Target_Dir;
case Build is
when "Debug" =>
for Exec_Dir use Project'Exec_Dir & "/debug/" & Library_Type;
when "Release" =>
for Exec_Dir use Project'Exec_Dir & "/release/" & Library_Type;
end case;
for Object_Dir use Project'Exec_Dir & "/obj";
for Library_Dir use Project'Exec_Dir & "/lib";
------------------------
-- External Libraries --
------------------------
XMLAda : Install_Status := external ("PRJ_XMLADA", "Installed");
ASIS : Install_Status := external ("PRJ_ASIS", "Installed");
LDAP : Install_Status := external ("PRJ_LDAP", "Installed");
--------------------
-- External flags --
--------------------
Adaflags := External_As_List ("ADAFLAGS", " ");
Cflags := External_As_List ("CFLAGS", " ");
Ldflags := External_As_List ("LDFLAGS", " ");
---------
-- Ide --
---------
type VCS_Type is ("Subversion", "Git");
VCS_Kind : VCS_Type := external ("PRJ_VCS", "Git");
package Ide is
for VCS_Kind use VCS_Kind;
for VCS_Log_Check
use "style_checker -l70 -H";
for VCS_File_Check
use "style_checker -ign out -ign tmplt -ign sed -ign txt"
& " -lang Ada -cp -cy -sp -gnat2012"
& " -lang XML -l256";
end Ide;
--------------
-- Compiler --
--------------
Global_Options := ();
-- Options used for all Ada units in both Debug and Release modes
Common_Options :=
("-gnat2012", "-gnatwcfijkmruv", "-gnaty3abBcdefhiIklmnoOprstx")
& Global_Options;
-- Common options used for the Debug and Release modes
Debug_Options :=
("-g", "-gnata", "-gnatVa", "-gnatQ", "-gnato", "-gnatwe", "-Wall");
Release_Options :=
("-O2", "-gnatn");
package Compiler is
for Driver ("Makefile") use "";
case Build is
when "Debug" =>
for Default_Switches ("Ada") use Common_Options & Debug_Options;
for Default_Switches ("C")
use ("-g", "-Wno-implicit-function-declaration");
when "Release" =>
for Default_Switches ("Ada") use Common_Options & Release_Options;
for Default_Switches ("C")
use ("-O2", "-Wno-implicit-function-declaration");
end case;
case S_Target is
when "Darwin" =>
for Default_Switches ("Ada")
use Compiler'Default_Switches ("Ada") & ("-fno-common");
when others =>
null;
end case;
for Switches ("aws-attachments.adb")
use Common_Options & Debug_Options & ("-gnatVn");
for Switches ("aws-session.adb")
use Common_Options & Debug_Options & ("-gnatVn");
for Switches ("templates_parser.adb")
use Common_Options & Debug_Options & ("-gnatVn");
-- Disable validity check on this unit to work-around N728-028
-- ADAFLAGS and CFLAGS should come last so that command line
-- settings override the ones in this project.
for Default_Switches ("Ada") use
Compiler'Default_Switches ("Ada") & Adaflags;
for Default_Switches ("C") use
Compiler'Default_Switches ("C") & Cflags;
end Compiler;
------------
-- Binder --
------------
package Binder is
for Default_Switches ("Ada") use ("-E");
end Binder;
-------------
-- Builder --
-------------
package Builder is
for Switches (others) use ("-m", "-j" & Processors);
end Builder;
------------
-- Linker --
------------
package Linker is
for Default_Switches ("Ada") use Ldflags;
end Linker;
-- LDFLAGS should come first so that command line settings
-- influence the way -l options are handled afterwards.
-- For library projects, use Leading_Library_Options instead.
Leading_Library_Options := Ldflags;
------------
-- Naming --
------------
package Naming is
for Implementation_Suffix ("Makefile") use ".txt";
for Implementation_Exceptions ("Makefile") use ("Makefile");
end Naming;
end Shared;