Rombobjörn

summaryrefslogtreecommitdiff
path: root/INSTALL
blob: 9d4e00246cd1479267ebf8e1e0d64acc7d55efa3 (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
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
Building and Installing Software Using Comfignat
================================================

These are generic installation instructions for programs and libraries whose
build systems are built around Comfignat. Developers are encouraged to edit
this file and adapt it to their project.


Requirements
------------

These instructions assume a Unix-like system with the GNAT tools and GNU Make.
The makefiles may not work with other clones and forks of Make. Use GNU Make if
possible; it is sometimes available as "gmake" on non-GNU systems. If you can't
use Make you will need to manually preprocess some GNAT project files with
Gnatprep. If you have another Ada compiler than GNAT, then the included build
system will probably not work and you should do whatever that compiler requires
you to do to compile the code.

GPRbuild is used by default but Gnatmake can be used instead if the software is
written in pure Ada. GPRbuild is required for mixed-language software.


Basic Installation
------------------

The simplest way to build and install the software is:

 1: Go to the directory that contains this file and the makefiles, and run
    "make" to build the software.

 2: Run "make install" to copy the files to the default locations. You will
    probably need root privileges if you install to the default locations.


Testing
-------

If there is an automated test suite, then the command to build and run it
should be "make check". Beyond that no generic instructions for testing can be
provided.


Installation Directories
------------------------

By default the files are installed in directories under /usr/local. You can
specify other locations by setting variables on the Make command line, or on
the Gnatprep command line if you can't use Make. The following Make variables
are relevant during the build:

 dirgpr
    The filename of the directories project, if your system has one and you
    want to install to the directories it specifies. A directories project is a
    GNAT project file that defines directory variables for use by other project
    files. Multiarch support requires a directories project that can refer to
    different directories depending on the target architecture. A directories
    project overrides the default values of some of the directory variables
    listed below, but if one of those variables is set explicitly, then it
    overrides the directories project.

 relocatable_package
    If relocatable_package is true and no directories project is provided, then
    the project file that will be installed with the library will be configured
    with relative pathnames so that the installed directory tree as a whole can
    be moved to another location in the filesystem without breaking the project
    file. Default: false

 prefix
    A prefix used in the default values of almost all of the directory
    variables listed below. Default: /usr/local

 exec_prefix
    A prefix used in the default locations for programs, binary libraries and
    other architecture-specific files. Default: <prefix>

 bindir
    The directory for programs that can be run from a command prompt; may be
    provided by a directories project. Default: <exec_prefix>/bin

 libexecdir
    The top-level directory for programs that are intended to be run by other
    programs rather than by users; may be provided by a directories project.
    Default: <exec_prefix>/libexec

 datarootdir
    The root of the directory tree for read-only architecture-independent data
    files. Default: <prefix>/share

 datadir
    The parent of the application-specific directory for idiosyncratic read-
    only architecture-independent data files for this software. This is usually
    the same place as datarootdir, but this variable is provided so that you
    can move these application-specific files without altering the location for
    GNAT project files, documentation et cetera. Default: <datarootdir>

 sysconfdir
    The top-level directory for host-specific configuration files.
    Default: <prefix>/etc

 localstatedir
    The root of the directory tree for data files that programs modify while
    they run. Default: <prefix>/var

 statedir
    The parent of the application-specific directory for idiosyncratic variable
    data files for this software. Default: <localstatedir>/lib

 cachedir
    The parent of the application-specific directory for cached data files that
    the application can regenerate if they are deleted.
    Default: <localstatedir>/cache

 logdir
    The top-level directory for log files. Default: <localstatedir>/log

 runstatedir
    The top-level directory for small files that describe the state of the
    system and that exist only while some subsystem is running, such as process
    identifier files and transient Unix-domain sockets. Default: /run

 lockdir
    The top-level directory for lock files that are used to prevent multiple
    programs from trying to access a device or other resource at the same time.
    Default: <runstatedir>/lock

 includedir
    The top-level directory for source files to be used in the compilation of
    software using libraries; may be provided by a directories project.
    Default: <prefix>/include

 archincludedir
    Like includedir but for architecture-specific source files, in case this
    library must install such files; may be provided by a directories project.
    Default: <includedir>

 libdir
    The directory for binary libraries to be used by other software, and the
    top-level directory for other architecture-specific files; may be provided
    by a directories project. Default: <exec_prefix>/lib

 alidir
    The parent of the library-specific directory for Ada library information
    files for this library; may be provided by a directories project.
    Default: <libdir>

 gprdir
    The directory for GNAT project files to be used in the building of software
    using libraries. If you set this to a directory that GPRbuild and Gnatmake
    don't search by default, then you will need to add it to the project search
    path when using this library, for example through the environment variable
    GPR_PROJECT_PATH. Default: <datarootdir>/gpr

 localedir
    The root of the directory tree for locale-specific message catalogs.
    Default: <datarootdir>/locale

 mandir
    The root of the directory tree for documentation in the Man format.
    Default: <datarootdir>/man

 infodir
    The directory for documentation in the Info format.
    Default: <datarootdir>/info

 miscdocdir
    The parent of the application-specific directory for miscellaneous
    documentation files. Default: <datarootdir>/doc

If you want to install to a staging directory from which the files will later
be copied to their final locations, then set DESTDIR to the staging directory.
All the other directory variables shall be the final locations. Unlike the
variables listed above, DESTDIR is effective in the installation step.

The following preprocessor symbols are used when the project files are
preprocessed. They are derived from the Make variables above when the makefiles
invoke Gnatprep. You may need to define them if you run Gnatprep manually.

 Directories_GPR
    The filename of the directories project, if any; corresponding to dirgpr.

 Directories_Project
    The name of the directories project, if any. This is supposed to be the
    filename without a path or a suffix.

 Prefix
 Exec_Prefix
 Bindir
 Libexecdir
 Datarootdir
 Datadir
 Sysconfdir
 Localstatedir
 Statedir
 Cachedir
 Logdir
 Includedir
 Archincludedir
 Libdir
 Alidir
 GPRdir
 Localedir
 Mandir
 Infodir
 Miscdocdir
 Runtimedir
 Lockdir
    These correspond to the like-named Make variables. The same defaults as
    above will be used if the symbols are undefined.


Building a Shared or Static Library
-----------------------------------

If the software is a library that can be built as either shared or static, then
the Make variable library_type controls which kind of library is built. The
valid values are "dynamic", "static", and "relocatable" which is an alias for
"dynamic". The default is to build a shared library, that is "dynamic".


Optional Features
-----------------

There may be options that can be used to enable or disable certain parts of the
software. This is done by setting certain variables to "true" or "false" on the
Make or Gnatprep command line.

The developers really should have listed those options here, or deleted this
section if there are none.


Build Tools and their Arguments
-------------------------------

The following variables, which may be set in the environment or on the Make
command line, control which programs are invoked to do the build and which
arguments are passed to them:

 GNATPREP
    The command for invoking Gnatprep, in case you want to use a nondefault
    version of Gnatprep or a wrapper for example. Default: gnatprep

 GNAT_BUILDER
    The command for invoking the builder, that is GPRbuild or Gnatmake.
    Default: gprbuild

 GNATPREPFLAGS
    A space-separated list of options to be passed to Gnatprep.

 GNATFLAGS
    A space-separated list with all of the optional parameters to be passed to
    the builder, including any options to be forwarded to the compiler, binder
    and linker. If GNATFLAGS is defined it overrides the options variables
    listed below.

 GNAT_BUILDER_FLAGS
    A space-separated list of options for the builder, used only if GNATFLAGS
    is undefined. This may include not only options for the builder itself but
    also command line separators (also called mode switches) followed by
    options to be forwarded to the compiler, binder or linker.

 ADAFLAGS
    A space-separated list of options to be passed to the compiler when
    compiling Ada code, used only if GNATFLAGS is undefined.

 CPPFLAGS
    A space-separated list of options to be passed to the C preprocessor when
    compiling C or C++ code, used only if GNATFLAGS is undefined.

 CFLAGS
    A space-separated list of options to be passed to the compiler when
    compiling C code, used only if GNATFLAGS is undefined.

 CXXFLAGS
    A space-separated list of options to be passed to the compiler when
    compiling C++ code, used only if GNATFLAGS is undefined.

 FFLAGS
    A space-separated list of options to be passed to the compiler when
    compiling Fortran code, used only if GNATFLAGS is undefined.

 GNATBINDFLAGS
    A space-separated list of options to be passed to Gnatbind, used only if
    GNATFLAGS is undefined and only when binding a program.

 GNATLINKFLAGS
    A space-separated list of options to be passed to Gnatlink, used only if
    GNATFLAGS is undefined, only if the builder is Gnatmake, and only when
    linking a program.

 LDFLAGS
    A space-separated list of options to be passed to the linker, used only if
    GNATFLAGS is undefined and only when linking a program.


Copyright of This File
----------------------

Copyright 2013 - 2016 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 documentation file
for any purpose, provided the above notices are retained on all copies.
Permission to modify the text and to distribute modified text is granted,
provided the above notices are retained, and a notice that the text was
modified is included with the above copyright notice.