1 #@ make.rc defines the set of features and values used.
2 #@ Reading INSTALL first is beneficial.
4 #@ - Choosing a predefined CONFIG= disallows further option fine-tuning.
5 #@ (With some exceptions, e.g., OPT_DEBUG.)
7 #@ - Values have a VAL_ prefix, and are assigned strings, for example
8 #@ VAL_PREFIX="/usr/local"
10 #@ Values which are only used during configuration, building, and / or
11 #@ installation have no prefix, e.g., DESTDIR, VERBOSE, awk, sed;
13 #@ Some values exist which offer "multiple choice", e.g., VAL_RANDOM
14 #@ (without accompanying feature option) and VAL_IDNA (with OPT_IDNA).
15 #@ This is used if different implementations exist, and can then be
16 #@ used to choose the desired one(s).
17 #@ The value must be a comma separated list of strings, for example
18 #@ "idn2,idn,idnkit", the case is ignored, but the order is important.
19 #@ The special strings "all" and "any" as well as the empty value
20 #@ are wildcard matches; if any entry in the list is a wildcard match,
21 #@ the entire list is ignored.
22 #@ The special string "error" will abort configuration once its list
23 #@ position is reached; this is only supported if documented, and not
24 #@ with an accompanying OPT_ (which then offers "require", as below).
26 #@ - Features / options have an OPT_ prefix and usually need to be
27 #@ assigned a boolean value, as in OPT_IDNA=yes. Booleans are 1/0,
28 #@ y/n, true/false, yes/no and on/off (case doesn't matter).
30 #@ The value "require" is also a true boolean, but will in addition
31 #@ cause configuration to fail if the requested condition cannot be
32 #@ satisfied. This functionality is available where documented.
34 #@ - Specifying settings on the command line will take precedence over
35 #@ the variables in here (correctly triggering build updates as
38 #@ - This file is parsed by the shell: it is in sh(1), not in make(1)
39 #@ syntax. Evaluation occurs *after* it has been read, so command
40 #@ line overwrites take effect. To use multiline values, escape the
41 #@ newlines on all lines but the last with a reverse solidus (back-
42 #@ slash), as in "LINE \".
43 #@ To embed a shell variable unexpanded, use two: "XY=\\${HOME}".
44 #@ The parsing is sequential top-to-bottom (nonetheless), so that
45 #@ shell snippets in a value can refer only to stuff yet defined.
47 #@ - You may NOT comment out anything in here -- if you want to disable
48 #@ a feature, set it to a false boolean.
50 ## IDENTITIES, PATHS AND PROGRAMS ##
52 # Contact info (*contact-mail* and *contact-web*, respectively).
53 VAL_CONTACT_MAIL=s-mailx@lists.sdaoden.eu
54 VAL_CONTACT_WEB=https://www.sdaoden.eu/code.html
56 # The user ID our small privilege-separated helper program will be
57 # SETUID to, shall it be included ($OPT_DOTLOCK).
58 # Installation will then require the chown(1) program (as below) and
59 # sufficient privileges to perform a SETUID to this user ID.
62 # General prefix where S-nail should be installed.
65 # Fine tune individual locations, normally under $VAL_PREFIX.
66 # . the place of the S-nail program.
67 VAL_BINDIR="${VAL_PREFIX}/bin"
68 # . the place of the privilege-separated helper program, the name
69 # of which is [$VAL_SID$VAL_MAILX]-privsep (see below for $VAL_SID &
71 # (Only with $OPT_DOTLOCK.)
72 VAL_LIBEXECDIR="${VAL_PREFIX}/libexec"
74 VAL_MANDIR="${VAL_PREFIX}/share/man"
75 # . of the exemplary resource file.
76 VAL_SYSCONFDIR="${VAL_PREFIX}/etc"
78 # The variable $DESTDIR is prepended to all the paths from above at
79 # installation time; this feature can be used for, e.g., package
80 # building: if $VAL_PREFIX is "/usr/local", but $DESTDIR is set to "here",
81 # then S-nail will still think its $VAL_PREFIX is "/usr/local" whereas the
82 # build system will instead use "here/usr/local".
83 # NOTE: it cannot be set in here, but must be given on the command line
84 # when invoking the "install" make(1) (directly or indirectly).
85 # (That is, if you uncomment it, it'll be update-tracked...)
88 # Where the local mail system stores user $MAIL files.
90 if [ -d /var/spool/mail ]; then \
91 echo /var/spool/mail;\
96 # Path to the local MTA (Mail-Transfer-Agent).
98 if [ -x /usr/bin/sendmail ]; then \
99 echo /usr/bin/sendmail;\
100 elif [ -x /usr/lib/sendmail ]; then \
101 echo /usr/lib/sendmail;\
103 echo /usr/sbin/sendmail;\
106 # Today a lot of systems no longer use sendmail(1), but a different MTA.
107 # To ensure compatibility with sendmail(1), a system called
108 # mailwrapper(8) is often used, which selects the required service by
109 # looking at the name by which the program actually has been invoked.
110 # This variable can be used to adjust this name as necessary.
111 VAL_MTA_ARGV0=sendmail
113 # Default $SHELL (sh(1) path).
114 # Sometimes we simply invoke a command directly via execlp(2) instead of
115 # indirectly through *SHELL* -- in these cases execlp(2) may fallback to
116 # it's own built-in sh(1) path.
119 # Some more default fallback values, some of which are standardized
120 # and (thus)/or documented in the manual (changes not reflected there!).
121 # Note that default paths are often not (shell) quoted when displayed.
122 VAL_DEAD_BASENAME=dead.letter
123 VAL_DEAD="~/${VAL_DEAD_BASENAME}"
133 # Default locations of mime.types(5).
134 VAL_MIME_TYPES_USR=~/.mime.types
135 VAL_MIME_TYPES_SYS=/etc/mime.types
137 # The following tools may be provided a.k.a. overwritten,
138 # `command -v NAME` is used to query the utility otherwise:
139 # MAKE=, STRIP=, awk=, basename=, cat=, chmod=, cp=, cmp=, cksum=,
140 # grep=, mkdir=, mv=, rm=, sed=, sort=, tee=, tr=, uname=
141 # Usually in administrator paths:
142 # chown= [$OPT_DOTLOCK]
143 # Note that awk(1), rm(1), tr(1) and uname(1) are needed before this
144 # file is read, all other utilities will be checked afterwards only.
145 # uname(1) is in fact needed before the initial OS setup and thus no OS
146 # specific adjustments (e.g., $PATH) have been performed yet, but its
147 # use can be circumvented by setting $OS (uname -s), $OSENV (uname
148 # -sm) and $OSFULLSPEC (uname -a: this is not baked into the binary, it
149 # is only used to recognize build environment changes).
150 # $OS must be all-lowercase.
151 # Due to the evaluation order of the build system all those programs are
152 # usually needed, but by setting any of the variables to true(1), as in
153 # chown=/usr/bin/true, availability of unneeded programs can be faked.
157 # Some operating systems only support the C/POSIX (7-bit, but eight bit
158 # bytes are passed through unchanged) and UTF-8 based locales, e.g.,
159 # Plan9, Musl based Linux variants and newer OpenBSD. For such
160 # environments we can avoid a lot of tests and may enable support for
161 # features which would otherwise not be available.
162 # Note: $OS is available as normalized all-lowercase upon evaluation.
163 OPT_ALWAYS_UNICODE_LOCALE=`\
164 if [ "${OS}" = openbsd ] || [ -f /lib/ld-musl-x86_64.so.1 ]; then \
170 # For cross-compilation purposes it may be useful to not actually run
171 # systemcall etc. tests (link and run the executable) but only to
172 # perform the link tests necessary to detect host environment.
175 # Whether package system, for example pkgsrc(7) on NetBSD and more,
176 # OpenCSW on SunOS/Solaris, etc., specific paths shall be automatically
177 # included in $C_INCLUDE_PATH and $LD_LIBRARY_PATH when seen?
180 # Shall S-nail try to automatically detect a compiler and detect and
181 # provide a set of known-good compiler flags? It will use $CC if this
182 # variable is set, otherwise a compiler is actively searched for.
183 # If this option is chosen additions to flags may still be provided
184 # by setting $EXTRA_CFLAGS and $EXTRA_LDFLAGS to whatever is desired.
185 # Thus: set this to false and use your normal $CC / $CFLAGS / $LDFLAGS,
186 # otherwise pass additional flags via $EXTRA_CFLAGS / $EXTRA_LDFLAGS:
187 # $ make EXTRA_CFLAGS=-std=c99 tangerine
188 # Whatever you do, the configuration is fixated and updates will force
189 # rebuilds. And far below in this file there is $OPT_FORCED_STACKPROT,
190 # too, which can be used to cause injection of stack protectors, but
191 # which normally happens for development and debug builds only.
192 # (Remember, file is parsed from top to bottom, sorry.)
195 # It is possible to compile S-nail as a "single-source", meaning that
196 # all source files are injected into a single compilation unit, which is
197 # then compiled. This allows the compiler to perform much more
198 # optimizations, and also reduces the management overhead that is used
199 # for / needed by the linker.
202 # Character set conversion enables reading and sending of mails in
203 # multiple character sets through usage of the iconv(3) library. Please
204 # read the manual section "Character sets" for the complete picture.
205 # This should usually be enabled; it can be "require"d.
208 # Major switch to toggle *all* network related protocols
209 # (POP3,SMTP,IMAP) and related/dependent stuff (GSS-API,SSL);
213 # If $OPT_SOCKETS: support for Secure Socket Layer (Transport Layer
214 # Security, TLS), i.e., encrypted socket connections; can be "require"d.
215 # It also automatically enables support for S/MIME message signing,
216 # verification, en- and decryption.
217 # This needs the OpenSSL (https://www.openssl.org) or LibreSSL
218 # (http://www.libressl.org) libraries.
221 # If $OPT_SSL: shall S-nail (try to) use mechanisms to support more
222 # digest and cipher algorithms than the few that are documented? For
223 # S/MIME *smime-cipher* for example this will cause
224 # EVP_get_cipherbyname(3) to be tried shall the (S-nail-) built-in
225 # knowledge not suffice to understand the user request. Will create
226 # a large statically linked binary; dynamically linked the costs only
227 # arise once the extended lookup is actually needed (the first time).
228 # Some SSL libraries will always support all algorithms.
229 # This can be "require"d.
230 OPT_SSL_ALL_ALGORITHMS=yes
232 # If $OPT_SOCKETS: support for SMTP protocol?
233 # (Directly sending mails over the network) Can be "require"d.
236 # If $OPT_SOCKETS: support for POP3 protocol?
237 # (Download of mails via POP protocol) Can be "require"d.
240 # If $OPT_SOCKETS: support for IMAP protocol?
241 # Requires $OPT_ICONV unless $OPT_ALWAYS_UNICODE_LOCALE, in which case
243 # (Reading of mails directly on the server) Can be "require"d.
246 # If $OPT_SOCKETS: support for GSS-API (Generic Security Services
247 # Application Programming Interface) based authentication, e.g.,
248 # Kerberos v5? Available for IMAP and SMTP; can be "require"d.
251 # Enabling the MD5 message digest adds support for several
252 # authentication possibilities: POP3 (APOP), IMAP and SMTP (CRAM-MD5).
253 # If you don't need those, you may turn them off by excluding MD5.
256 # If $OPT_SOCKETS: support for parsing of user and password credentials
257 # from the ~/.netrc file ($NETRC; see *netrc-lookup* manual entry).
260 # If $OPT_SOCKETS: passwords can also be looked up through an external
261 # "agent" in order to allow for encrypted password storage (see
262 # *agent-shell-lookup*).
263 # [Obsolete] Even though marked *v15-compat* this feature has been
264 # obsoleted; please use an encrypted .netrc file (via *netrc-pipe*) or
265 # encrypt a complete resource file and load this like, e.g.,
266 # source "gpg -qd ~/.mailprivate.gpg | "
269 # IDNA (internationalized domain names for applications) offers users
270 # the possibility to use domain names in their native language, i.e., to
271 # use non-US-ASCII content, as in, e.g., <www.räksmörgåsa.example>,
272 # which the IDNA algorithm would convert to
273 # <www.xn--rksmrgsa-0zap8p.example>. :)
274 # Multiple implementations are supported:
275 # . idnkit - idnkit, https://www.nic.ad.jp/ja/idn/idnkit/download,
276 # either of version 1 for IDNA 2003 or version 2 for IDNA 2008.
277 # . idn2 - GNU Libidn2 for IDNA 2008, https://www.gnu.org/software/libidn/,
278 # . idn - GNU Libidn for IDNA 2003, same,
279 # OPT_IDNA can be "require"d.
281 VAL_IDNA="idnkit,idn2,idn"
283 # IMAP-style SEARCH expressions can be supported. This addressing mode
284 # is available with all types of folders; for folders not located on
285 # IMAP servers, or for servers unable to execute the SEARCH command, the
286 # search is performed locally.
289 # Several different P(seudo) R(andom number) G(enerator) possibilities.
290 # No need for somewhat strong random is necessary.
291 # The following will be used as sole PRG implementations.
292 # . arc4 - we search for arc4random(3).
293 # . ssl - if OPT_SSL is available the PRG of the SSL library can be used.
294 # The following will only be used to seed our builtin ARC4 PRG.
295 # . libgetrandom - getrandom(3) via C library.
296 # . sysgetrandom - getrandom(2) via SYSCALL.
297 # . urandom - reading from /dev/urandom.
298 # . builtin - a builtin ARC4 implementation with unscientific seeding.
299 # . (error - bail out)
300 VAL_RANDOM="arc4,ssl,libgetrandom,sysgetrandom,urandom,builtin"
302 # Regular expression (re_format(7)) support for searches, conditional
303 # expressions etc., we use the extended ones, then; can be "require"d.
306 # Line editing and -history (manual "On terminal and line editor").
308 # If ISO C (ISO/IEC 9899:1990/Amendment 1:1995) is supported on the
309 # system then our built-in MLE (Mailx-Line-Editor) version can be used.
310 # An enabled & available OPT_TERMCAP may affect and improve the MLE.
313 # Add support for history management.
315 # Add support for `(un)?bind'ing of key sequences.
318 # Use termcap(5) for terminal control; can be "require"d.
319 # Today most environments ship a termcap(5) that in fact is part of
320 # terminfo(5), and acts as a converting wrapper for this library.
321 # To avoid this redundancy we also support terminfo(5), and use it
322 # instead if we find it (assuming that termcap(5) is a stub, then).
323 # Note that terminfo(5) offers access to more key sequences, e.g.,
324 # kLFT5, for which no termcap(5) entry exists.
325 # terminfo(5) support can (thus) be "require"d.
327 OPT_TERMCAP_VIA_TERMINFO=yes
329 # Enable the `errors' command; S-nail is a console-based application and
330 # thus errors may fly by pretty fast as other operations are in
331 # progress; or $PAGERs are started and clear errors off the screen. If
332 # enabled errors are duplicated as they happen and the `errors' command
333 # will show them when asked to.
336 # We may include `help' etc. strings for commands, increasing size a bit.
339 # It is possible to strip out (almost) all user interface and error messages.
340 # This might be interesting for automated use cases (only).
343 # Interaction with a spam email filter is possible.
344 # Refer to all commands and variables with a "spam" prefix, and
345 # see the manual example section "Handling spam".
347 # Support for interaction with spamassassin(1)s spamc(1).
348 # . [Obsolete] OPT_SPAM_SPAMD:
349 # Direct communication with spamassassin(1)s spamd(1).
350 # Needs unix(4) domain sockets (checked). Can be "require"d.
352 # Generic filter hook which can be used with e.g. bogofilter(1)
353 # and sylfilter(1): see documentation for the *spam-filter-**
354 # variables for expected application behaviour.
359 # A simple line-based quoting mechanism can be made available via the
360 # *quote-fold* mechanism. This will be turned off automatically if the
361 # required character classification is not available on the host.
363 # TODO shouldn't wrap lines when only WS or a NL-escaping \ follows
366 # We do have a very primitive HTML tagsoup filter which can be used to
367 # convert HTML to plain text for display purposes. If enabled it will
368 # be used for all MIME types which have the @h@ or @H@ type markers
369 # (more on this in the manual section "The mime.types files"). And
370 # which do not have any user defined MIME type handler, of course.
371 OPT_FILTER_HTML_TAGSOUP=yes
373 # A simple form of coloured output can optionally be produced.
376 # File dotlocking is performed for "system mailbox" (%[USER] and
377 # %:ANYFILE) MBOX files: when synchronizing any such FILE a FILE.lock
378 # file will be created in the directory of FILE, for the duration of the
379 # synchronization: set $OPT_DOTLOCK to support this traditional mail
380 # spool file locking.
381 # $VAL_MAIL(s) where normal system mailboxes reside are usually not
382 # writable by normal users, except that a user may read and write his
383 # own mailbox. But this means that a program run by the user cannot
384 # create a .lock file! The solution is to install a privilege-separated
385 # mini-program that has the sole purpose and functionality of managing
386 # the dotlock file in such situations -- and only then, as a last
387 # ressort. With it dotlock files can be created for any mailbox for
388 # which the invoking user has read (or read-write) permissions, and
389 # under the UID and GID of the mailbox itself! We call it -privsep.
390 # $OPT_DOTLOCK can be "require"d.
394 ## Normal users should not need to read any further
396 ## PATHS AND PROGRAMS, DEVELOPMENT ##
398 # To ease the life of forkers and packagers "our" name can be changed.
399 # The name is build by concatenating $VAL_SID and $VAL_MAILX, i.e.,
400 # $(VAL_SID)$(VAL_MAILX). Note that the final string must be longer
401 # than two characters and may not contain any whitespace.
405 # The name of the exemplary resource template.
406 # Note 1: not overwritten by "make install" if yet existent!
407 VAL_SYSCONFRC="${VAL_SID}${VAL_MAILX}.rc"
409 ## FEATURE SET, DEVELOPMENT ##
411 # Use debug compiler flags, enable some additional commands and code
412 # assertions. Note that setting this also enables our own memory
413 # canaries, which require a rather large amount of runtime memory.
416 # Experimental code etc.
417 # Note: this forcefully enables OPT_DEBUG
420 # We use the crypto libraries' MD5 implementation if possible, unless..
423 # With $OPT_AUTOCC we can make use of the ASan AddressSanitizer and ASan
424 # MemorySanitizer of Google
425 # (https://github.com/google/sanitizers/wiki/AddressSanitizer).
426 # These are definetely only useful for debugging.
427 # Also, external libraries are often problematic (e.g., ncursesw), and
428 # ASAN_MEMORY of the tried clang 4.0.0 (4.0.0-2 of ArchLinux) was faulty.
433 # With $OPT_AUTOCC we will use stack protector guards shall the
434 # detected compiler support them; this goes in line with our own (heap)
435 # memory canaries and will detect buffer overflows. It is usually only
436 # useful during development, i.e., in a debug environment that tests all
437 # aspects of a program. But today it is often used even in shipout code.
438 OPT_FORCED_STACKPROT=`\
439 if feat_yes DEVEL || feat_yes DEBUG; then \
445 # If $OPT_DEBUG is true we'll use a simple memory wrapper with
446 # canaries. This interferes with memory debuggers like valgrind(1) or
447 # the LLVM -fsanitize stuff. Enable this to not use our wrapper.
449 if feat_yes ASAN_MEMORY || feat_yes ASAN_ADDRESS; then \
455 # Our functions are instrumented with Not-Yet-Dead chirps, which print
456 # a function call trace when the program crashes. Whereas NYD will be
457 # used automatically when either of $OPT_DEBUG and $OPT_DEVEL is
458 # defined, an extended level of NYD is compiled in only on explicit
460 # TODO Separation in between NYD and NYD2 not yet fully done.
463 # vim:set tw=72: s-it-mode