(BWDIC!) Allow `source' in `call'ed macros..
[s-mailx.git] / INSTALL
bloba339fb1726422038a96f7e6aafe373ecba041f58
1 I n s t a l l i n g  S - n a i l
2 ================================
4 1.  Compilation
5 1.1 What if configuration fails?
6 1.2 What if building fails?
7 1.3 How can i enable debugging?
8 2.  Special notes for the latest release
9 3.  Current codebase state
11 1. Compilation
12 --------------
14 System specific notes can be found in the next section.
15 All (optional) features are documented (and adjustable) in "make.rc".
16 Adjustments may also take place, and are usually done, from the command
17 line, overriding those made in "make.rc" (if any).
18 Without any adjustments all possible features which are not in
19 experimental state will be enabled but not "require"d, so that
20 configuration won't fail shall any of them not be usable due to the
21 given system environment.
23   $ make install
24   $ make uninstall          # Won't remove the system wide startup file!
25   $ make distclean          # *Completely* cleanup working directory
27 With adjustments:
29   $ make WANT_POP3=no WANT_SMTP=require install
30   $ make WANT_READLINE=true PREFIX=/some/nasty/prefix install
32 With utility program and feature adjustments:
34   $ make awk=/usr/bin/nawk WANT_SOCKETS=no DESTDIR=./zzz install
36 If WANT_DOTLOCK has been enabled to include the minimal privilege-
37 separated dotlock creation program that will be installed SETUID to the
38 defined PRIVSEP_USER (default is "root"), and therefore the installation
39 process needs to have the appropriate privileges.
40 You therefore possibly want to separate the configuration / building and
41 the installation tasks, and give the last step higher privileges via
42 super(1), sudo(1), su(1) or a similar mechanism, e.g.:
44   $ make PREFIX=/usr config build && super make doinstall
46 There are also some predefined restricted configuration sets available,
47 which take precedence over anything else (names are case-insensitive):
49 . CONFIG=NULL, CONFIG=NULLI
50   Anything that can be turned off is off.  MIME can't.
51   The latter adds and "require"s iconv(3), though.
53 . CONFIG=MINIMAL
54   This is the most plain mailx(1)-alike mode, but with MIME support and
55   (if available) character set conversion and regular expressions
56   builtin (here mostly ment for mailing list matching).  Dotlock files
57   and the privileged separated dotlock helper.  That's it.
59   "Require"s dotlocking and the privileged separated dotlock helper.
61 . CONFIG=MEDIUM
62   Like MINIMAL, but with documentation strings, the builtin line editor
63   (MLE) with history support (if possible), error tracking, basic colour
64   support and IDNA addresses.  Also adds in generic spam filter support.
66   Possibly what people want who need nothing but a MIME-capable mailx(1)
67   and don't regret improved usability for the rare interactive use
68   occasions.
70   "Require"s iconv(3), dotlocking and the privileged separated dotlock
71   helper.
73 . CONFIG=NETSEND
74   NETSEND also tries to add SSL/TLS, GSSAPI, .netrc file parsing as well
75   as external password *agent-lookup* on top of MEDIUM, on the other
76   hand spam filter support is removed.
78   Sending messages directly to the mail provider via the SMTP protocol,
79   instead of requiring a local mail-transfer-agent (MTA) who does.
81   "Require"s iconv(3), SSL/TLS, SMTP (sockets), dotlocking and the
82   privileged separated dotlock helper.
84 . CONFIG=MAXIMAL
85   Anything on, including experimental features.
86   "Require"s iconv(3), regex(3), the MLE as well as dotlocking and the
87   privileged separated dotlock helper.
89   S-nail(1) gains mail fetching capabilities and heads more toward being
90   a full-featured mail-user-agent (MUA) with this.
92 E.g.:
94   $ make CONFIG=MAXIMAL DESTDIR=./xtest install
96 would create a "s-nail" binary and install a "s-nail" manual etc.
97 under the prefix "/usr/local" but rooted under "[./]xtest", i.e., the
98 binary would be installed as "[./]xtest/usr/local/bin/s-nail".
99 The following make(1) target exists:
101 . all         Create / check and update configuration, build.
102 . install     Create / check and update configuration, build, install.
103 . clean       Remove anything which can be rebuild.
104 . distclean   Remove anything which can be rebuild or reconfigured.
105 . uninstall   Uninstall (if configured).
107 . config      Only create or check and update the configuration.
108 . build       Only build (using the existing configuration).
109 . test        Run "cc-test.sh" in --check-only mode on the built binary.
110 . doinstall or packager-install
111               Only install using the built files of the existing
112               configuration.  It is possible to overwrite DESTDIR= when
113               using this target nonetheless (a following `uninstall'
114               won't know about that overwritten value, however).
116 Setting the make(1) variable $VERBOSE to an arbitrary value, as in
117 "$ make VERBOSE=xy install", will change the output of the `build',
118 `install' etc. targets to a different, more verbose one.
119 If some libraries are missing that you know are installed on your
120 system, or if other errors occur due to missing files but which you know
121 exist, please ensure that the environment variable $C_INCLUDE_PATH
122 includes the necessary "include/" paths and the environment variable
123 $LD_LIBRARY_PATH includes the necessary "lib/"rary paths.
125 The S-nail make system will inspect these two environment variables and
126 *automatically* convert them to cc(1) (c99(1)) -I and -L options (since
127 these environment variables are, different to the command line options,
128 not part of the POSIX standard).
129 To set these environment variables, the following can be done in
130 a Bourne / Korn / POSIX compatible shell:
132   $ C_INCLUDE_PATH="${C_INCLUDE_PATH}:/usr/local/include"
133   $ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
134   $ export C_INCLUDE_PATH LD_LIBRARY_PATH
135   $ make install
137 The S-nail make system will also automatically integrate pkgsrc(7) paths
138 into this mechanism.  pkgsrc(7) is used to handle building (compilation),
139 installation and removal of software packages on a lot of operating
140 systems, including all BSD systems, Linux, Solaris etc.
141 And if all else fails you can also forcefully pass in include directives
142 and library paths by passing prefilled $INCS and $LIBS variables:
144   $ make INCS=-I/mypath/lib LIBS=-l/mypath/iconv install
146 1.1 What if configuration fails?
147 --------------------------------
149 The configuration process creates some files named "config":
151 . config.log  output generated by the configuration compile tests.
152 . config.lst  configuration (chosen option, programs, paths).
153 . config.h    C program header produced according to "config.lst".
155 Of special interest is "config.log" since the error usually manifests
156 here in textual output.  Maybe that makes it obvious what can be done
157 (header files could not be found because of missing entries in
158 $C_INCLUDE_PATH, libraries could not be linked because of incomplete
159 $LD_LIBRARY_PATH).
160 Otherwise it is getting complicated, and it would be appreciated if you
161 would contact s-nail-users@!
163 1.2 What if building fails?
164 ---------------------------
166 Even worse!  This should not happen if configuration succeeded!  It
167 would be very kind and highly appreciated if you would report this
168 to s-nail-users@.
170 1.3 How can i enable debugging?
171 -------------------------------
173 Please ensure WANT_DEBUG=yes is enabled during compilation, as in
175   $ make CONFIG=MAXIMAL WANT_DEBUG=yes
177 If $WANT_AUTOCC is enabled then the build system should automatically
178 adjust the compiler flags accordingly, please see "make.rc" for more.
179 There is also a `devel'opment target which does most of this by itself:
181   $ make devel
183 $WANT_DEBUG (`devel') will enable memory bound debug canaries and
184 Not-Yet-Dead function graph listings etc.  Whereas the latter will try
185 to write its listing into a file named after your favourite MUA in
186 your $TMPDIR (or "/tmp" or "./", in order), falling back to STDERR shall
187 creation of the file not be possible (we won't overwrite an existing
188 file), the debug facilities in general make their appearance on the
189 standard error channel; because this can be a quite long output, then,
190 it is possibly a good idea to redirect it to a file:
192   $ s-nail -dvv 2> error.log
194 Should you really discover any problems with S-nail it would be very
195 useful for development if you would contact s-nail-users@!
196 Thank you!
198 2. Special notes for the latest release
199 ---------------------------------------
201 S-nail(1) has been or is used regulary on these systems ("uname -srm").
202 Unless otherwise noted the following applies to saying "$ make" and
203 "$ make devel" followed by "$ make test".
205 . All systems:
206   - I've turned off -Wstrict-overflow warnings unless WANT_DEVEL is
207     defined (talking about WANT_AUTOCC=yes here).  With gcc 5.1 the
208     number of warnings exploded.  With gcc 5.2 that went down again,
209     but just keep it like that nonetheless.
210   - You may see warnings on unused returns from write(2), ftruncate(2)
211     and a few other I/O functions.  These will vanish after the large
212     I/O and MIME rewrite that comes next.  They mostly refer to debug
213     dumping, truncating a(n open) file to zero size and freopen(3)ing
214     one of the standard channels.  I refrained from adding abort(3)
215     calls as return value checks.
217 . All 32-bit systems:
218   - There _may_ be warnings about format strings, like, e.g.,
219       auxlily.c:1610:10: warning: format '%lu' expects type 'long
220       unsigned int', but argument 3 has type 'size_t'
221     The S-nail codebase is ISO C89, so we have no %z printf(3) format.
222     However, "nail.h" tries hard to detect the real type size and
223     defines the "PRI[du]Z" macros which end up with the correct size,
224     which is also compile-time asserted (see the "MCTA(sizeof(size_t) ==
225     XZ)" statements in "nail.h".
227     You can completely overcome this situation by forcing ISO C99 mode
228     when compiling, e.g., with gcc(1) and clang(1): if you use
229     $WANT_AUTOCC then also pass "ADDCFLAGS=-std=c99", otherwise ensure
230     -std=c99 is set in your $CFLAGS.
232 . ArchLinux <https://www.archlinux.org/>
233   Latest as of 2016-03-26, clang(1) and gcc(1).
235 . Void Linux <http://www.voidlinux.eu/>
236   Not tested for v14.8.8.
237   (My current working environment is restricted since i've lost
238   a machine in January.)
240 . CRUX Linux <http://www.crux.nu/>
241   CRUX 3.2 RC3, gcc(1).
243 . FreeBSD <https://www.freebsd.org/>
244   FreeBSD 10.2, clang(1) and gcc6(1).
245   Not tested for v14.8.8.
246   (My current working environment is restricted since i've lost
247   a machine in January.)
249 . OpenBSD <http://www.openbsd.org/>
250   Not tested for v14.8.8.
251   (My current working environment is restricted since i've lost
252   a machine in January.)
254 . DragonFly BSD <https://www.dragonflybsd.org/>
255   Not tested for v14.8.8.
256   (My current working environment is restricted since i've lost
257   a machine in January.)
259 . NetBSD <https://www.netbsd.org/>
260   + Show work.
262 . Solaris <http://opencsw.org/>
263   * First of all: thanks to OpenCSW.org for offering SSH access to
264     their Solaris build cluster!
265   - According to standards(5) we require the /usr/xpg4 environment, and
266     will bail if we cannot find it.
267   - With $WANT_AUTOCC: we try to use Sun cc(1) whenever we find it.
268     If your gcc(1) installation is doing alright you have to turn
269     $WANT_AUTOCC off and use $CC, $CFLAGS and $LDFLAGS.
270   - I will never get iconv(3) right for Solaris it seems.
271   - In order to be able to run the tests you will need a cksum(1) that
272     supports CRC-32 (POSIX).  We look into "/opt/csw/gnu/cksum", but if
273     that cannot be found you have to adjust the $cksum variable (see
274     above) to something that works.  (A future version of S-nail will
275     use different testing, but until then: Sorry!)
276   - I couldn't get us going on SunOS 5.9 Sparc: the build system had to
277     be extended to check for UINTPTR_MAX being defined as the empty
278     string and similar very special things.
279   - The OpenCSW build cluster consists of SunOS 5.9 - 5.11 machines
280     under SPARC and i386, and it looked good on 2016-03-25.
281     However, some notes:
282     + We may forcefully disable stack protectors on SunOS/gcc because of
283       linking errors seen on earlier tests:
284         Undefined                       first referenced
285          symbol                             in file
286         __stack_chk_fail                    accmacvar.o
287         __stack_chk_guard                   accmacvar.o
288         ld: fatal: symbol referencing errors
289     + If you get the compiler / system header installation error
290         Undefined                       first referenced
291          symbol                             in file
292         __builtin_stdarg_start              auxlily.o
293       then you have to overwrite this symbol with __builtin_va_start,
294       e.g., in conjunction with $WANT_AUTOCC add this:
295        ADDCFLAGS='-D__builtin_stdarg_start=__builtin_va_start'
297 . UnixWare 7.1.4.
298   + Note: it is no longer possible to use the `install' rule, because
299     we use shell functions to ease the task of directory creation etc.
300     (especially useful due to $VERBOSE), and that won't work due to bugs
301     (in the system make(1) program i presume).
302   + Not tested for v14.8.[567], but never seen any problems but some
303     harmless and ignorable compile warnings.
305 3. Current codebase state
306 -------------------------
308 I claim that we have reached a stable state that should enable users
309 a neatless mode of operation when running 24/7 (except for growing
310 memory usage from the OpenSSL side of the road, when used).
311 I'll hope to be able to release S-nail v20 on 2020-03-25, the 42th
312 anniversary of Berkeley Mail, as a good one.  Also see "TODO".
314 For S-nail, v15.0 (not before 2017) is dedicated to a Send- and
315 MIME-layer rewrite that will bring the possibility to access each
316 message part individually. Because the Berkeley codebase and its nail
317 fork have design flaws in respect to mailbox handling and non-local code
318 jumps (due to / and signals), whereas the (MIME capable) NetBSD and
319 OpenBSD forks have instead addressed this problem, more or less
320 complete, in one or the other way, v15.0 will also have to address
321 signal handling, because only like that we have the possibility to ever
322 reach a clean state from which we can actually think about re-extending
323 this MUA.
325 # s-ts-mode