-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathINSTALL
350 lines (269 loc) · 14.4 KB
/
INSTALL
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
I n s t a l l i n g S - n a i l / S - m a i l x
================================================
1.0 Compilation
1.1 Configuration failed!
1.2 Building failed!
1.3 Tests failed!
1.4 How can i enable debugging?
2.0 Notes on building the latest release
1.0 Compilation
---------------
System specific notes can be found in the next section.
All (optional) features are documented (and adjustable) in make.rc.
Adjustments may also take place, and are usually done, from the command
line, overriding those made in make.rc (if any).
The set of builtin MIME types could be adjusted in ./mime.types.
Experts could find it valuable to adjust C code in ./mx-config.h.
Without any adjustments all non-experimental features will be enabled,
except some which provide redundant functionality (e.g., OPT_SPAM_SPAMC
is disabled because the generic OPT_SPAM_FILTER can do the same).
None of the features are "require"d by default, so that configuration
will not fail shall any of them not be available or usable.
The generated configuration is tracked: changes will be recognized
and cause automatic cleanups and rebuilds as necessary.
$ make -j2 tangerine # equals "$ make config build test install"
$ make citron # equals "$ make config build install"
$ make distclean # *Completely* cleanup working directory
With feature adjustments:
$ make OPT_POP3=no OPT_SMTP=require tangerine
$ make OPT_CROSS_BUILD=y VAL_PREFIX=/some/nasty/prefix citron
With utility program, build and feature adjustments:
$ make awk=/usr/bin/nawk VERBOSE=yes OBJDIR=/tmpfs/mx OPT_NET=no tangerine
If OPT_DOTLOCK has been enabled then the minimal privilege-separated
SETUID (to VAL_DOTLOCK_USER, default "root") helper program will be build
and installed, and therefore the installation process needs to have the
appropriate privileges. In this case it may be useful to separate the
configuration / building and the installation tasks and give the last
step higher privileges via super(1), sudo(1), su(1) or a similar
mechanism, e.g.:
$ make VAL_PREFIX=/usr config && make -j4 &&
super make DESTDIR=./xy install
would create a "s-nail" binary and install a "s-nail" manual etc. under
the prefix "/usr" but rooted under "[./]xy", i.e., the binary would be
installed as "[./]xy/usr/bin/s-nail".
Out-of-tree compilation is supported; to use it, create the target
directory of desire, change into it and run the make-emerge.sh script
shipped with S-nail, then proceed as with normal in-tree building.
Generated configuration files, objects and test output will be located
in the directory .obj/ (or what $OBJDIR defines), in- or off-tree.
The following make(1) targets exist, the default being `build':
- tangerine Shorthand for "$ make config build test install": create
or check and update configuration, build, test, and install.
The variable $DESTDIR will be honoured (see make.rc),
but not be tracked in the configuration.
- citron Shorthand for "$ make config build install".
- all Shorthand for "$ make config build".
- config Only create or check and update the configuration.
- build Only build (using the existing configuration).
- install Only install using the built files of the existing
configuration.
The variable $DESTDIR will be honoured (see make.rc),
but not be tracked in the configuration.
An uninstall script ${VAL_SID}${VAL_MAILX}-uninstall.sh
will be created but *not* be installed if $DESTDIR is set
non-empty -- within $DESTDIR, that is: it needs to be
copied manually from $OBJDIR into $DESTDIR as necessary.
- clean Remove anything which can be rebuild.
- distclean Remove anything which can be rebuild or reconfigured.
- test Run mx-test.sh in --check mode on the built binary.
Tests to be skipped can be passed via SKIPTEST="t1 t2".
- testnj Likewise, but add --no-jobs to avoid spawning multiple
tests in parallel.
Setting the make(1) variable $VERBOSE to an arbitrary value during
`config' time, as in "$ make VERBOSE=xy tangerine", will change the
output of the `all', `install' etc. targets to a more verbose one.
There are also some predefined configuration sets available.
It is possible to apply manual adjustments on top of those.
- CONFIG=NULL, CONFIG=NULLI
Anything that can be turned off is off. MIME cannot.
The latter adds and "require"s iconv(3) and adds the user interface
strings.
- CONFIG=MINIMAL
Possibly what people want who need nothing but a MIME-capable mailx(1)
and do not regret improved usability for the rare interactive use
occasions. Adds documentation strings, the built-in line editor (MLE)
with history support and key bindings, error tracking, basic colour
support and IDNA addresses, as well as generic spam filter support.
"Require"s iconv(3), regex(3) and the dotlock helper.
- CONFIG=NETSEND
Sending messages directly to the mail provider via the SMTP protocol,
instead of requiring a local mail-transfer-agent (MTA) who does.
Adds SSL/TLS, SMTP, GSSAPI and .netrc file parsing on top of MINIMAL.
"Require"s iconv(3), SSL/TLS, SMTP (sockets) and the dotlock helper.
- CONFIG=MAXIMAL
Like MINIMAL, but turns on all (other) options, also obsolete or
redundant ones, but none of them required.
If during configuration or building some libraries seem to be missing
that you know are installed on your system, or if other errors occur
due to missing files but which you know exist, please ensure that the
environment variable $C_INCLUDE_PATH includes the necessary "include/"
paths and the environment variable $LD_LIBRARY_PATH includes the
necessary "lib/"rary paths.
The build system will inspect these two environment variables and
automatically convert them to cc(1) (c99(1)) -I and -L options (since
these environment variables are, different to the command line options,
not part of the POSIX standard).
To set these environment variables, the following can be done in
a Bourne / Korn / POSIX compatible shell:
$ C_INCLUDE_PATH="${C_INCLUDE_PATH}:/usr/local/include"
$ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
$ export C_INCLUDE_PATH LD_LIBRARY_PATH
$ make tangerine CONFIG=MINIMAL
Other than the standard paths /usr/{bin,include,lib} and /usr/local/[.]
should possibly be placed first instead, presuming that they are meant
to override things which usually exist in standard locations.
If all else fails you can also forcefully pass in include directives and
library paths via prefilled $INCS and $LIBS variables:
$ make INCS=-I/mypath/include LIBS="-L/mypath/lib -lmylib" tangerine
1.1 Configuration failed!
-------------------------
Please see the section "Notes on building the latest release" below
first, maybe it has an item for the failing platform, or even gives an
answer on how to proceed nonetheless.
The configuration process creates a directory ./.obj (or $OBJDIR, if
set) to store some files of interest (it is also here where the build
and the tests take place):
- mk-config.log Any output generated during the configuration process.
- mk-config.h C program header representing the configuration.
- mk-config.env sh(1) environment representing the configuration.
Of special interest is mk-config.log since the error usually manifests
here in textual form. Maybe that makes it obvious what can be done
(header files could not be found because of missing entries in
$C_INCLUDE_PATH, libraries could not be linked because of incomplete
$LD_LIBRARY_PATH, etc.).
If things went wrong so completely that even "$ make distclean" is not
possible, simply removing .obj ($OBJDIR) will do: "$ rm -rf ./.obj".
In any case it would be appreciated if you could report the problem,
so that problems can be fixed!
1.2 Building failed!
--------------------
Terrible! This should not happen if configuration succeeded!
Again, it would be appreciated if you could report the problem, so that
problems can be fixed!
1.3 Tests failed!
-----------------
Please see the section "Notes on building the latest release" below
first: sometimes it is known that certain tests fail on a specific
target platform, and there is no applicable fix on application level.
For example, it is not uncommon that Unicode tests fail because the
platform uses old or incomplete character information.
These tests can be excluded by passing SKIPTEST="t1 t2 ..".
It could also be a miscompilation, caused by excessive optimization
and/or a compiler bug. If OPT_AUTOCC had been used in conjunction with
a non-debug target (the defaults), an additional cc_maxopt=1 (or an
EXTRA_CFLAGS=-O1 etc.) on the command line and a successive
reconfiguration and -compilation could turn the green testing light on.
In order to inspect the error more thoroughly, the mx-test.sh script
can be used in --run-test mode to invoke the failing tests (testing
echoes the actual test names in brackets), for example
$ ./mx-test.sh --run-test ./s-nail localopts mbox
would run the tests "localopts" and "mbox". If not an absolute path
the binary (./s-nail) is expected relative to $OBJDIR. There also the
test output files, named like t.TESTNAME-XY, reside.
(If the build and test is done in a repository checkout, and if the
branch "test-out" exists, then in addition to the failing test output
the expected as well as -- optionally -- the file difference of these
two is generated automatically, too. And these outputs are also
generated for normal "$ make test" runs, then.)
It might make sense to send the output files of the failing tests to
the mailing-list. Because of ML message size restrictions, creating
a compressed tar(1) archive of the files would be appreciated:
$ rm -f .obj/t.*.old #.obj/t.*.diff # (In repository checkout only)
$ tar -cf - .obj/t.* | (xz/gzip/zstd -T0 -19) > tlogs.tar.(xz/gz/zst)
Thank you!
1.4 How can i enable debugging?
-------------------------------
Enable OPT_DEBUG=yes during compilation
$ make CONFIG=MAXIMAL OPT_DEBUG=yes
to gain compiler debug flags, memory bound canaries and Not-Yet-Dead
function graph listings in case of crashes etc.
For sanitizers plus special options exist, please read make.rc for more.
In case of errors using the -d (*debug*) and -v (*verbose*[=VALUE])
options (variables) is always good idea:
$ s-nail -dvv
or
$ s-nail -Sdebug -Sverbose=3
Should you really discover any problems with S-nail it would be very
useful for development if you would contact the mailing-list!
Thank you!
2.0 Notes on building the latest release
----------------------------------------
- All systems:
* Running tests on a NFS filesystem may cause false negatives.
(Seen on the SunOS 5.11 OpenCSW machines, in [pipe_handlers]
failure due to hard link count mismatch since NFS also links the
file to some other name and that lingers too long, reproducibly).
* Various warnings for diverse compiler versions etc. This is a race
which cannot be won, so i make the software compile and test under
each compiler version i get my fingers at, and of course i fix bugs
when i see them.
The warnings on unused returns from some I/O functions will vanish
after the large v15 I/O and MIME rewrite.
- All 32-bit systems:
* There _may_ be warnings about format strings, like, e.g.,
auxlily.c:1610:10: warning: format '%lu' expects type 'long
unsigned int', but argument 3 has type 'size_t'
The codebase is ISO C89 which has no %z printf(3) format.
However we try hard to detect the real type size and define the
"PRI[du]Z" macros which end up with the correct size, which is
also compile-time asserted (via "MCTA(sizeof(size_t) == XZ)").
By forcing ISO C99 mode these warnings vanish, for example gcc(1):
with OPT_AUTOCC pass "EXTRA_CFLAGS=-std=c99", otherwise ensure that
-std=c99 is defined in $CFLAGS.
Development:
. CRUX Linux <https://www.crux.nu/>.
+ x86-64: head.
Frequently:
. AlpineLinux <https://www.alpinelinux.org>.
+ x86-64: "2020", edge.
. ArchLinux <https://www.archlinux.org/>.
+ current.
. FreeBSD <https://www.freebsd.org/>.
+ x86: 11.2; amd64: 12.2.
- v11. series test errors: see DragonFly.
. OpenBSD <https://www.openbsd.org/>.
+ x86: latest (6.{4,6,8,9}).
Pre-release, and other landmarks:
. DragonFly BSD <https://www.dragonflybsd.org/>.
+ 5.6.1, 5.8.0.
- The tests [iconv_mbyte_base64]-{4,8} fail because the C function
iswprint(3) falsely claims that U+FF08 and U+FF09 (FULLWIDTH
LEFT and RIGHT PARENTHESIS, respectively) are not printable,
causing replacements. This is a known bug, see
<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225692>
. NetBSD <https://www.netbsd.org/>.
+ amd64: 9.0.
. OSUKISS Linux <https://osukiss.safe.ca/> (boing-boom-tschak)
@ Thanks to Jean-Marc Pigeon for generously providing access to
a VZGOT on the most "beefy" machine i have ever worked on! ^_^
+ Not tested for v14.9.23. Sorry Jean-Marc, you're ok??
. Solaris <http://opencsw.org/>
@ First of all: thanks to OpenCSW.org for offering SSH access to
their Solaris build cluster!
(Sparc and x86 machines with SunOS 5.9, 5.10 and 5.11.)
* We yet favoured Sun's compiler, but now use the default algorithm
which goes for $CC/$CFLAGS if set, then searches open-source
compilers, only if that fails we go for traditional SUN.
* The original Sun roff (aka AT&T ditroff) is not capable to display
the manual. We offer preformatted manual pages, please see the
release announcement for details.
* Some notes collected on earlier trials:
+ We may forcefully disable stack protectors on SunOS/gcc because
of link errors seen in earlier tests.
+ If you get the compiler / system header installation error
Undefined first referenced
symbol in file
__builtin_stdarg_start auxlily.o
you have to overwrite the symbol with __builtin_va_start,
EXTRA_CFLAGS='-D__builtin_stdarg_start=__builtin_va_start'
- You may see failures in Unicode-related tests due to outdated or
false Unicode tables on elder releases (as in NetBSD).
. SunOS schillix 5.11 schillix-on.
@ Thank you and good bye, dear Jörg.
+ i86pc i386 i86pc
- reply-21 fails with iconv(3) error "Cannot convert from utf-8 to
646", which is an iconv(3) error (should just do it).
. Void Linux <https://www.voidlinux.org/> (x86)
- Still not have setup all my environment after having lost all,
so not tested recently.
# s-ts-mode