aboutsummaryrefslogtreecommitdiffstats
path: root/doc/info/librarian.texinfo
blob: 906d002fb54a625b1bc2ee49d32ed0cd49f4d3af (plain) (blame)
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
\input texinfo   @c -*-texinfo-*-

@c %**start of header
@setfilename librarian.info
@settitle librarian
@afourpaper
@documentencoding UTF-8
@documentlanguage en
@finalout
@c %**end of header


@dircategory Development
@direntry
* librarian: (librarian).           Library to compiler flags resolver
@end direntry


@copying
Copyright @copyright{} 2015 Mattias Andrée

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
``GNU Free Documentation License''.
@end quotation
@end copying

@ifnottex
@node Top
@top librarian -- Library to compiler flags resolver
@insertcopying
@end ifnottex

@titlepage
@title librarian
@subtitle Library to compiler flags resolver
@author by Mattias Andrée (maandree)

@page
@vskip 0pt plus 1filll
@insertcopying
@page
@end titlepage

@contents



@menu
* Overview::                        Brief overview of @command{librarian}.
* Invoking::                        Invocation of @command{librarian}.
* Files::                           @command{librarian} files.
* GNU Free Documentation License::  Copying and sharing this manual.
@end menu



@node Overview
@chapter Overview

@command{librarian} is used to print flags required
when compiling or linking, and want to use library
that requires non-trival flags@footnote{Just @option{-l}
and the library name sans `lib'}.



@node Invoking
@chapter Invoking

Synopsis:
@example
librarian [OPTION]... [--] [VARIABLE]... [LIBRARY]...
@end example

@command{librarian} shall output the flags, required
by the selected libraries, that are listed under the
selected variables.

@code{LIBRARY} can either be the name of the required
library, the name of the required library and a version
of said library, or the name of the required library
and an accepted version range of said library. If the
same library name is used more than once, the versions
and version ranges are unioned. Recognised formats are:
@table @code
@item NAME
Any version of the library @code{NAME} will do.
@item NAME=VERSION
Only version @code{VERSION} of the library @code{NAME}
is acceptable. (Multiple version can be used by
specifying more than once.)
@item NAME<=MAX
Any versions up to and including @code{MAX} of the
library @code{NAME} will do.
@item NAME<MAX
Any versions up to but excluding @code{MAX} of the
library @code{NAME} will do.
@item NAME>=MIN
At least version @code{MIN} of the library @code{NAME}
is required.
@item NAME>MIN
A greater version than version @code{MIN} of the
library @code{NAME} is required.
@item NAME>=MIN<=MAX
Combines, by intersection, @code{NAME>=MIN} and
@code{NAME<=MAX}.
@item NAME>=MIN<MAX
Combines, by intersection, @code{NAME>=MIN} and
@code{NAME<MAX}.
@item NAME>MIN<=MAX
Combines, by intersection, @code{NAME>MIN} and
@code{NAME<=MAX}.
@item NAME>MIN<MAX
Combines, by intersection, @code{NAME>MIN} and
@code{NAME<MAX}.
@end table

The are not predefined values for @code{VARIABLE},
but the standardised ones are:
@table @code
@item CFLAGS
Flags required by the compiler to compile the if
the library @code{LIBRARY} is used. The library
is a C library.
@item CPPFLAGS
Flags required by the C preprocessor to compile
the if the library @code{LIBRARY} is used.
@item LDFLAGS
Flags required by the linker to link the program
when the library @code{LIBRARY} is used.
@item CXXFLAGS
Flags required by the compiler to compile the if
the library @code{LIBRARY} is used. The library
is a C++ library.
@item deps
Libraries the library @code{LIBRARY} is dependent
on. Flags from these libraries should not appear
in the other variables unless the library
@code{LIBRARY} requires them directly.
@end table

If @code{VARIABLE} is omitted, the process will
exit with the value @code{0} if all listed libraries,
@code{LIBRARY}, are available, and otherwise exit
with the value @code{2}.

@command{librarian} recognises the following
options:
@table @option
@item -d
Add output for dependencies too. Should be used
for @code{LDFLAGS} when linking statically.
@item -l
Print the location of the files specified by
@code{LIBRARY}. Cannot be combined with @option{-d}.
@item -o
Prefer older libraries, when multiple versions
are available. This is useful if you are afraid
of new software.
@end table

@command{librarian} is affected by the following
environment variables:
@table @env
@item LIBRARIAN_PATH
Colon-separated list of directories to search
for @command{librarian} files.
@end table

@command{librarian} will exit with one of the
following exit statuses:
@table @code
@item 0
The program was successful.
@item 1
An error occurred.
@item 2
A library was not found.
@item 3
Usage error.
@end table



@node Files
@chapter Files

@command{librarian} files should be stored in
@file{PREFIX/share/librarian/}. Its filename should
be the name of the library, followed by an 
(equals-sign) and the version number. For example
@file{/usr/share/librarian/libmy=1.0}

Empty lines and lines starting with a @code{#} (she)
in a @command{librarian} files are ignored. Other
lines should begin with a variable name and be
followed by the required flags relevant to that
variable. For the variable deps, @command{libraries}
that the library requires should be listed in the
same format the @code{LIBRARY} argument uses,
in @ref{Invoking}.

All variables should be in upper case unless they are
reserved. In the latter case, the are lower cased.



@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include fdl.texinfo

@bye