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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
-- Comfignat configuration variables for GNAT project files
-- Copyright 2013 - 2014 B. Persson, Bjorn@Rombobeorn.se
--
-- This material is provided as is, with absolutely no warranty expressed
-- or implied. Any use is at your own risk.
--
-- Permission is hereby granted to use or copy this project file
-- for any purpose, provided the above notices are retained on all copies.
-- Permission to modify the code and to distribute modified code is granted,
-- provided the above notices are retained, and a notice that the code was
-- modified is included with the above copyright notice.
-- This file is part of Comfignat 1.3 – common, convenient, command-line-
-- controlled compile-time configuration of software built with the GNAT tools.
-- For information about Comfignat, see http://www.Rombobeorn.se/Comfignat/.
-- This project file defines directory variables for use in build-controlling
-- project files. It is not to be installed on the target system.
--
-- Normally the preprocessing of this file will be controlled by comfignat.mk,
-- which will make it import the directories project if one is provided. It can
-- also be preprocessed manually if Make cannot be used for some reason. There
-- are defaults that will be used if no preprocessor symbols are defined.
#if Directories_GPR'Defined then
with $Directories_GPR;
#end if;
abstract project Comfignat is
#if not Invoked_By_Makefile'Defined then
--
-- These variables are used in constructing the default values of the
-- directory variables below. They're only needed when this file is
-- preprocessed manually.
--
#if Prefix'Defined then
Prefix := $Prefix;
#else
Prefix := "/usr/local";
#end if;
-- Prefix is used in the default locations for almost all files.
#if Exec_Prefix'Defined then
Exec_Prefix := $Exec_Prefix;
#else
Exec_Prefix := Prefix;
#end if;
-- Exec_Prefix is used in the default locations for programs, binary
-- libraries and other architecture-specific files.
#if Datarootdir'Defined then
Datarootdir := $Datarootdir;
#else
Datarootdir := Prefix & "/share";
#end if;
-- Datarootdir is the root of the directory tree for read-only
-- architecture-independent data files.
#if Localstatedir'Defined then
Localstatedir := $Localstatedir;
#else
Localstatedir := Prefix & "/var";
#end if;
-- Localstatedir is the root of the directory tree for data files that
-- programs modify while they run.
#end if;
--
-- The following variables may be compiled into programs or libraries to
-- tell them where to find or write different kinds of files at run time.
-- Most of the directory names are relative to Bindir if the software was
-- configured as a relocatable package. Otherwise they are absolute
-- pathnames. Bindir is relative to Libexecdir when the package is
-- relocatable.
--
-- Programs that can be run from a command prompt are in Bindir. This is
-- usually the same directory that the program itself is in, so this
-- variable is probably useful only to programs in Libexecdir.
#if Bindir'Defined then
Bindir := $Bindir;
#else
Bindir := Exec_Prefix & "/bin";
#end if;
-- Programs that are intended to be run by other programs rather than by
-- users are under Libexecdir.
#if Libexecdir'Defined then
Libexecdir := $Libexecdir;
#else
Libexecdir := Exec_Prefix & "/libexec";
#end if;
-- Idiosyncratic read-only architecture-independent data files are under an
-- application-specific subdirectory of Datadir.
#if Datadir'Defined then
Datadir := $Datadir;
#else
Datadir := Datarootdir;
#end if;
-- Host-specific configuration files are under Sysconfdir.
#if Sysconfdir'Defined then
Sysconfdir := $Sysconfdir;
#else
Sysconfdir := Prefix & "/etc";
#end if;
-- Idiosyncratic variable data files shall be kept under an application-
-- specific subdirectory of Statedir.
#if Statedir'Defined then
Statedir := $Statedir;
#else
Statedir := Localstatedir & "/lib";
#end if;
-- Cached data files that the application can regenerate if they are deleted
-- shall be kept under an application-specific subdirectory of Cachedir.
#if Cachedir'Defined then
Cachedir := $Cachedir;
#else
Cachedir := Localstatedir & "/cache";
#end if;
-- Log files shall be written under Logdir.
#if Logdir'Defined then
Logdir := $Logdir;
#else
Logdir := Localstatedir & "/log";
#end if;
-- Small files that take part in describing the state of the system and that
-- exist only while the program is running, such as process identifier files
-- and transient Unix-domain sockets, shall be sought and created under
-- Runstatedir. (This is NOT the place for temporary files in general.)
#if Runstatedir'Defined then
Runstatedir := $Runstatedir;
#else
Runstatedir := "/run";
#end if;
-- Lock files that are used to prevent multiple programs from trying to
-- access a device or other resource at the same time shall be sought and
-- created under Lockdir.
#if Lockdir'Defined then
Lockdir := $Lockdir;
#else
Lockdir := Runstatedir & "/lock";
#end if;
-- Source files to be used in the compilation of software using libraries
-- are under Includedir.
#if Includedir'Defined then
Includedir := $Includedir;
#else
Includedir := Prefix & "/include";
#end if;
-- If a library has installed architecture-specific source files to be used
-- in compilation, then those files may also be under a library-specific
-- subdirectory of Archincludedir.
#if Archincludedir'Defined then
Archincludedir := $Archincludedir;
#else
Archincludedir := Includedir;
#end if;
-- Binary libraries and other architecture-specific files are under Libdir.
#if Libdir'Defined then
Libdir := $Libdir;
#else
Libdir := Exec_Prefix & "/lib";
#end if;
-- ALI files are under a library-specific subdirectory of Alidir.
#if Alidir'Defined then
Alidir := $Alidir;
#else
Alidir := Libdir;
#end if;
-- A program or library that has Archincludedir, Libdir and/or Alidir
-- compiled-in will in those directories find only libraries compiled for
-- the same architecture as itself.
-- GNAT project files are under GPRdir.
#if GPRdir'Defined then
GPRdir := $GPRdir;
#else
GPRdir := Datarootdir & "/gpr";
#end if;
-- Locale-specific message catalogs are under Localedir.
#if Localedir'Defined then
Localedir := $Localedir;
#else
Localedir := Datarootdir & "/locale";
#end if;
-- Documentation in the Man format is under Mandir.
#if Mandir'Defined then
Mandir := $Mandir;
#else
Mandir := Datarootdir & "/man";
#end if;
-- Documentation in the Info format is in Infodir.
#if Infodir'Defined then
Infodir := $Infodir;
#else
Infodir := Datarootdir & "/info";
#end if;
-- Other documentation files are under an application-specific subdirectory
-- of Miscdocdir.
#if Miscdocdir'Defined then
Miscdocdir := $Miscdocdir;
#else
Miscdocdir := Datarootdir & "/doc";
#end if;
--
-- The following variables are for use in attributes to control where
-- generated files are placed.
--
-- Various generated files are kept in Builddir.
#if Builddir'Defined then
Builddir := $Builddir;
#else
Builddir := ".";
#end if;
-- Intermediate files produced during the build shall be kept in Objdir.
#if Objdir'Defined then
Objdir := $Objdir;
#else
Objdir := Builddir & "/obj";
#end if;
#if Directories_Project'Defined then
-- Put intermediate files for different architectures in subdirectories
-- where they won't conflict with each other. (This is useful especially
-- with binder files when they are packaged in debug information packages
-- for multiarch systems.)
Objdir := Objdir & "/" & $Directories_Project.Hardware_Platform;
#end if;
-- Files to be installed shall be placed under Stagedir instead of the root
-- directory. (This variable is unused by Comfignat when Make is used and no
-- directories project is provided.)
#if Stagedir'Defined then
Stagedir := $Stagedir;
#else
Stagedir := external("DESTDIR", "");
#end if;
-- Programs that can be run from a command prompt shall be installed in
-- Stage_Bindir.
#if Stage_Bindir'Defined then
Stage_Bindir := $Stage_Bindir;
#else
Stage_Bindir := Stagedir & Bindir;
#end if;
-- Programs that are only to be run by other programs, not by users, shall
-- be installed under Stage_Libexecdir.
#if Stage_Libexecdir'Defined then
Stage_Libexecdir := $Stage_Libexecdir;
#else
Stage_Libexecdir := Stagedir & Libexecdir;
#end if;
-- Source files needed for compiling code that uses a library shall be
-- installed under Stage_Includedir.
#if Stage_Includedir'Defined then
Stage_Includedir := $Stage_Includedir;
#else
Stage_Includedir := Stagedir & Includedir;
#end if;
-- If architecture-specific source files absolutely must be installed, then
-- those files may be placed under a library-specific subdirectory of
-- Stage_Archincludedir.
#if Stage_Archincludedir'Defined then
Stage_Archincludedir := $Stage_Archincludedir;
#else
Stage_Archincludedir := Stagedir & Archincludedir;
#end if;
-- Binary libraries shall be installed in Stage_Libdir.
#if Stage_Libdir'Defined then
Stage_Libdir := $Stage_Libdir;
#else
Stage_Libdir := Stagedir & Libdir;
#end if;
-- ALI files shall be installed under a library-specific subdirectory of
-- Stage_Alidir.
#if Stage_Alidir'Defined then
Stage_Alidir := $Stage_Alidir;
#else
Stage_Alidir := Stagedir & Alidir;
#end if;
end Comfignat;
|