a_termios_onsig(): move up freelist queue to avoid memleak on re-raise
[s-mailx.git] / make.rc
blob98bd968c0ec2cfe839728b6ae1ab1aa2c924ddb1
1 #@ make.rc defines the set of features and values used.
2 #@ Reading INSTALL (first) is beneficial.
3 #@
4 #@ - Choosing a predefined CONFIG= disallows further option fine-tuning.
5 #@   (With some exceptions, e.g., OPT_DEBUG.)
6 #@
7 #@ - Specifying settings on the command line will take precedence over
8 #@   the variables in here (correctly triggering build updates as
9 #@   necessary, too).
11 #@ - Features / options have an OPT_ prefix and usually need to be
12 #@   assigned a boolean value, as in OPT_IDNA=yes.  Booleans are 1/0,
13 #@   y/n, true/false, yes/no and on/off (case does not matter).
15 #@   The value "require" is also a true boolean, but will in addition
16 #@   cause configuration to fail if the requested condition cannot be
17 #@   satisfied.  "require" is available where documented only.
19 #@ - Values have a VAL_ prefix, and are assigned strings, for example
20 #@       VAL_PREFIX="/usr/local"
22 #@   Values which are only used during configuration, building, and / or
23 #@   installation have no prefix, e.g., DESTDIR, VERBOSE, awk, sed etc.
24 #@   Strings which contain whitespace need to be quoted.
26 #@   Some values offer "multiple choice" values, e.g., VAL_RANDOM
27 #@   (without accompanying feature option) and VAL_IDNA (with OPT_IDNA).
28 #@   They address the case of different implementations, and can then be
29 #@   used to choose the desired one(s).
30 #@   The value must be a comma-separated list of strings, for example
31 #@   "idn2,idn,idnkit", the case is ignored, but the order is important.
32 #@   The special strings "all" and "any" as well as the empty value
33 #@   are wildcard matches; if any entry in the list is a wildcard match,
34 #@   the entire list is ignored.
35 #@   The special string "error" will abort configuration once its list
36 #@   position is reached; this is only supported if documented, and not
37 #@   with an accompanying OPT_ (which then offers "require", as above).
39 #@ - This file is parsed by the shell: it is in sh(1), not in make(1)
40 #@   syntax.  Evaluation occurs *after* it has been read, so command
41 #@   line overwrites take effect.  To use multiline values, escape the
42 #@   newlines on all lines but the last with a reverse solidus (back-
43 #@   slash), as in "LINE \".
44 #@   To embed a shell variable unexpanded, use two: "XY=\\${HOME}".
45 #@   The parsing is sequential top-to-bottom (nonetheless), so that
46 #@   shell snippets in a value can refer only to stuff yet defined.
48 #@ - You may NOT comment out anything in here -- if you want to disable
49 #@   a feature, set it to a false boolean.
51 ## IDENTITIES, PATHS AND PROGRAMS ##
53 # Contact info (end up as the INTERNAL VARIABLES *contact-mail* and
54 # *contact-web*, respectively).
55 VAL_CONTACT_MAIL=s-mailx@lists.sdaoden.eu
56 VAL_CONTACT_WEB=https://www.sdaoden.eu/code.html
58 # The user ID our small privilege-separated dotlock helper program will
59 # be SETUID to, shall it be included ($OPT_DOTLOCK).
60 # Installation will then require the chown(1) program (as below) and
61 # sufficient privileges to perform a SETUID to this user ID.
62 VAL_PS_DOTLOCK_USER=root
64 # General prefix of installation.
65 VAL_PREFIX=/usr/local
67 # Fine tune individual locations, normally under $VAL_PREFIX.
68 # . the place of normal binaries.
69 VAL_BINDIR=${VAL_PREFIX}/bin
70 # . the place of privilege-separated binaries, names of which are
71 #   ${VAL_SID}${VAL_MAILX}-foo ($VAL_SID and $VAL_MAILX are below).
72 #   (Only with: $OPT_DOTLOCK.)
73 VAL_LIBEXECDIR=${VAL_PREFIX}/libexec
74 # . of the manual.
75 VAL_MANDIR=${VAL_PREFIX}/share/man
76 # . of the exemplary resource file.
77 VAL_SYSCONFDIR=${VAL_PREFIX}/etc
79 # The variable $DESTDIR is prepended to all the paths from above at
80 # installation time; this feature can be used for, e.g., package
81 # building: if $VAL_PREFIX is "/usr/local", but $DESTDIR is "here",
82 # then $VAL_PREFIX is still "/usr/local" whereas the build system
83 # will instead use "here/usr/local".
84 # NOTE: it cannot be set in here, but must be given on the command
85 # line when running the "install" make(1) rule.
86 # (That is, if you uncomment it, it will be update-tracked.)
87 #DESTDIR=
89 # Where the local mail system stores user $MAIL files.
90 VAL_MAIL=`\
91    if [ -d /var/spool/mail ]; then \
92       echo /var/spool/mail;\
93    else \
94       echo /var/mail;\
95    fi`
97 # Path to the local MTA (Mail-Transfer-Agent).
98 # MTA aliases (aliases(5)) are optionally supported via OPT_MTA_ALIASES.
99 VAL_MTA=`\
100    if [ -x /usr/bin/sendmail ]; then \
101       echo /usr/bin/sendmail;\
102    elif [ -x /usr/lib/sendmail ]; then \
103       echo /usr/lib/sendmail;\
104    else \
105       echo /usr/sbin/sendmail;\
106    fi`
108 # Today a lot of systems no longer use sendmail(1), but a different MTA.
109 # To ensure compatibility with sendmail(1), a system called
110 # mailwrapper(8) is often used, which selects the required service by
111 # looking at the name by which the program actually has been invoked.
112 # This variable can be used to adjust this name as necessary.
113 VAL_MTA_ARGV0=sendmail
115 # Default $SHELL (sh(1) path).
116 # (Sometimes however we simply invoke a command directly via execlp(3)
117 # instead of indirectly through $SHELL -- in these cases execlp(3) may
118 # fallback to it's own built-in sh(1) path.)
119 VAL_SHELL=/bin/sh
121 # Some more default fallback values, some of which are standardized
122 # and (thus)/or documented in the manual (changes not reflected there!).
123 # Note that default paths are often not (shell) quoted when displayed.
124 VAL_DEAD_BASENAME=dead.letter
125 VAL_DEAD=~/${VAL_DEAD_BASENAME}
126 VAL_EDITOR=ed
127 VAL_LISTER=ls
128 VAL_MAILRC=~/.mailrc
129 VAL_MBOX=~/mbox
130 VAL_NETRC=~/.netrc
131 VAL_PAGER=more
132 VAL_TMPDIR=/tmp
133 VAL_VISUAL=vi
135 # Default locations of mime.types(5).
136 VAL_MIME_TYPES_USR=~/.mime.types
137 VAL_MIME_TYPES_SYS=/etc/mime.types
139 # Default screen width.  The width is reduced by 1 for compatibility
140 # with some old terminals; if termcap/terminfo support is available then
141 # we will use the full width if possible.
142 # Values must be decimal numbers, SHOULD > 10, MUST < 1000.
143 VAL_HEIGHT=24
144 VAL_WIDTH=80
146 # The following tools may be provided a.k.a. overwritten,
147 # `command -v NAME` is used to query the utility otherwise:
148 #  STRIP=, awk=, basename=, cat=, chmod=, cp=, cmp=, cksum=, getconf=
149 #     grep=, ln=, mkdir=, mv=, pwd=, rm=, sed=, sort=, tee=, tr=, uname=
150 # Usually in administrator paths:
151 #  chown= [$OPT_DOTLOCK]
152 # Note that awk(1), rm(1), tr(1) and uname(1) are needed before this
153 # file is read, all other utilities will be checked afterwards only.
154 # uname(1) is in fact needed before the initial OS setup and thus no OS
155 # specific adjustments (e.g., $PATH) have been performed yet, but its
156 # use can be circumvented by setting $OS (uname -s) and $OSFULLSPEC
157 # (uname -a: this is not baked into the binary, it is only used to
158 # recognize build environment changes).
159 # Due to the evaluation order of the build system all those programs are
160 # usually needed, but by setting any of the variables to true(1), as in
161 # chown=/usr/bin/true, availability of unneeded programs can be faked.
163 ## FEATURE SET ##
165 # Some operating systems only support the C/POSIX (7-bit, but eight bit
166 # bytes are passed through unchanged) and UTF-8 based locales, e.g.,
167 # Plan9, Musl based Linux variants and newer OpenBSD.  For such
168 # environments we can avoid a lot of tests and may enable support for
169 # features which would otherwise not be available.
170 # Note: $OS is available as normalized all-lowercase upon evaluation.
171 OPT_ALWAYS_UNICODE_LOCALE=`\
172    if [ "${OS}" = openbsd ] || [ -f /lib/ld-musl-x86_64.so.1 ]; then \
173       echo yes;\
174    else \
175       echo no;\
176    fi`
178 # It is possible to compile as "single-source", meaning that all source
179 # files are injected into a single compilation unit.
180 # This allows the compiler to perform more optimizations, and also
181 # reduces the management overhead of the runtime linker.  In theory.
182 # (Note this meant as a pure optimization, the make(1)file system will
183 # offer no source dependency tracking in this mode.)
184 OPT_AMALGAMATION=no
186 # Shall the build try to automatically detect a compiler and detect and
187 # provide a set of known-good compiler flags?  It will use $CC if this
188 # variable is set, otherwise a compiler is actively searched for.
189 # If this option is chosen additions to flags may still be provided
190 # by setting $EXTRA_CFLAGS and $EXTRA_LDFLAGS to whatever is desired.
191 # Thus: set this to false and use your normal $CC / $CFLAGS / $LDFLAGS,
192 # otherwise pass additional flags via $EXTRA_CFLAGS / $EXTRA_LDFLAGS:
193 #     $ make EXTRA_CFLAGS=-std=c99 tangerine
194 # Whatever you do, the configuration is fixated and updates will force
195 # rebuilds.
196 OPT_AUTOCC=yes
198    # With $OPT_AUTOCC we will use stack protector guards shall the
199    # detected compiler support them; this goes in line with our own
200    # (heap) memory canaries and will detect buffer overflows.  Usually
201    # only useful during development, but often always enabled today.
202    OPT_AUTOCC_STACKPROT=yes
204 # Whether the commands `csop', `vexpr' .. shall be included.
205 # v15compat: until v15 VEXPR needs CSOP.
206 OPT_CMD_CSOP=yes
207 OPT_CMD_VEXPR=yes
209 # A simple form of coloured output can optionally be produced.
210 OPT_COLOUR=yes
212 # For cross-compilation purposes it may be useful to not actually run
213 # systemcall etc. tests (link and run the executable) but only to
214 # perform the link tests necessary to detect host environment.
215 OPT_CROSS_BUILD=no
217 # We may include `help' etc. strings for commands, increasing size a bit.
218 OPT_DOCSTRINGS=yes
220 # File dotlocking is performed for "system mailbox" (%[USER] and
221 # %:ANYFILE) MBOX files: when synchronizing any such FILE a FILE.lock
222 # file will be created in the directory of FILE, for the duration of the
223 # synchronization: set $OPT_DOTLOCK to support this traditional mail
224 # spool file locking.
225 # $VAL_MAIL(s) where normal system mailboxes reside are usually not
226 # writable by normal users, except that a user may read and write his
227 # own mailbox.  But this means that a program run by the user cannot
228 # create a .lock file!  The solution is to install a privilege-separated
229 # mini-program that has the sole purpose and functionality of managing
230 # the dotlock file in such situations -- and only then, as a last
231 # ressort.  With it dotlock files can be created for any mailbox for
232 # which the invoking user has read (or read-write) permissions, and
233 # under the UID and GID of the mailbox itself!  We call it -dotlock.
234 # It will be SETUID to VAL_PS_DOTLOCK_USER, as above.
235 # $OPT_DOTLOCK can be "require"d.
236 OPT_DOTLOCK=yes
238 # Enable the `errors' command; as a console-based application errors
239 # may fly by pretty fast as other operations are in progress;
240 # or $PAGERs are started and clear errors off the screen.
241 # If enabled errors will be duplicated to an error queue as they happen
242 # and the `errors' command will show them when asked to.
243 # VAL_ERRORS_LIMIT will be the default value of *errors-limit*.
244 OPT_ERRORS=yes
245 VAL_ERRORS_LIMIT=8000
247 # We do have a very primitive HTML tagsoup filter which can be used to
248 # convert HTML to plain text for display purposes.  If enabled it will
249 # be used for all MIME types which have the corresponding type marker
250 # (more on this in the manual section "The mime.types files").  And
251 # which do not have any user defined MIME type handler, of course.
252 OPT_FILTER_HTML_TAGSOUP=yes
254 # A simple line-based quoting mechanism can be made available via the
255 # *quote-fold* mechanism.  This will be turned off automatically if the
256 # required character classification is not available on the host.
257 # Can be "require"d.
258 # TODO should not wrap lines when only WS or a NL-escaping \ follows
259 OPT_FILTER_QUOTE_FOLD=yes
261 # Character set conversion enables reading and sending of mails in
262 # multiple character sets through usage of the iconv(3) library.  Please
263 # read the manual section "Character sets" for the complete picture.
264 # Multiple implementations are supported:
265 # . libc (whether iconv(3) available in C library).
266 # . iconv (via external iconv library, for example GNU libiconv,
267 #     https://www.gnu.org/software/libiconv).
268 # This should usually be enabled; it can be "require"d.
269 OPT_ICONV=yes
270 VAL_ICONV=libc,iconv
272 # IDNA (internationalized domain names for applications) offers users
273 # the possibility to use domain names in their native language, i.e., to
274 # use non-US-ASCII content, as in, e.g., <www.räksmörgåsa.example>,
275 # which the IDNA algorithm would convert to
276 # <www.xn--rksmrgsa-0zap8p.example>.  :)
277 # Multiple implementations are supported:
278 # . idnkit - idnkit, https://www.nic.ad.jp/ja/idn/idnkit/download,
279 #     either of version 1 for IDNA 2003 or version 2 for IDNA 2008.
280 # . idn2 - GNU Libidn2 for IDNA 2008, https://www.gnu.org/software/libidn/,
281 # . idn - GNU Libidn for IDNA 2003, same,
282 # OPT_IDNA can be "require"d.
283 OPT_IDNA=yes
284 VAL_IDNA=idnkit,idn2,idn
286 # IMAP-style SEARCH expressions can be supported.  This addressing mode
287 # is available with all types of folders; for folders not located on
288 # IMAP servers, or for servers unable to execute the SEARCH command, the
289 # search is performed locally.
290 OPT_IMAP_SEARCH=yes
292 # Support for RFC 1524 a.k.a mailcap files can be made available.
293 # The search order when looking up MIME type handlers for display /
294 # quoting purposes is then *pipe-EXTENSION*, *pipe-TYPE/SUBTYPE*,
295 # mailcap entry, `mimetype's type-marker extension.
296 # For other purposes mailcap entries are used exclusively.
297 # RFC 1524 specifies the default $VAL_MAILCAPS path search as follows,
298 # and it specifies the $MAILCAPS environment variable to override it.
299 OPT_MAILCAP=yes
300 VAL_MAILCAPS=~/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
302 # Whether support for Maildir email directories shall be enabled.
303 OPT_MAILDIR=yes
305 # Line editing and -history (manual "On terminal and line editor").
306 # If ISO C (ISO/IEC 9899:1990/Amendment 1:1995) is supported on the
307 # system then our built-in MLE (Mailx-Line-Editor) version can be used.
308 # An enabled & available OPT_TERMCAP may affect and improve the MLE.
309 # Can be "require"d.
310 OPT_MLE=yes
312    # Add support for `history' management.
313    OPT_HISTORY=yes
315    # Add support for `(un)?bind'ing of key sequences.
316    OPT_KEY_BINDINGS=yes
318    # Use termcap(5) for MLE 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.
326    OPT_TERMCAP=yes
327       OPT_TERMCAP_VIA_TERMINFO=yes
329 # Whether support for MTA aliases(5) shall be included.
330 # With it, and if *mta-aliases* is set to a file, MTA aliases will be
331 # expanded as a last step before messages are sent.
332 # Note this only supports text-, no database files.
333 OPT_MTA_ALIASES=yes
335 # Several different P(seudo) R(andom number) G(enerator) possibilities.
336 # No need for somewhat strong random is necessary.
337 # The following will be used as sole PRG implementations.
338 # . arc4 - we search for arc4random(3).
339 # . tls - if OPT_TLS is available that libraries' PRNG can be used.
340 # The following will only be used to seed our builtin ARC4 PRNG.
341 # . libgetrandom - getrandom(3) via C library.
342 # . sysgetrandom - getrandom(2) via SYSCALL.
343 # . getentropy - getentropy(3) (a la POSIX: with GETENTROPY_MAX).
344 # . urandom - reading from /dev/urandom.
345 # . builtin - unscientific seeding for our builtin ARC4 implementation.
346 # . (error - bail out)
347 VAL_RANDOM=arc4,tls,libgetrandom,sysgetrandom,getentropy,urandom,builtin
349 # Regular expression (re_format(7)) support for searches, conditional
350 # expressions etc., we use the extended ones, then; can be "require"d.
351 OPT_REGEX=yes
353 # Major switch to toggle *all* network related protocols
354 # (POP3,SMTP,IMAP) and related/dependent stuff (GSS-API,TLS);
355 # can be "require"d.
356 OPT_NET=yes
358    # Detect support for GSS-API (Generic Security Services Application
359    # Programming Interface) based authentication, e.g., Kerberos v5?
360    # Available for IMAP and SMTP; can be "require"d.
361    OPT_GSSAPI=yes
363    # Add support for IMAP protocol.
364    # Reading of mails directly on the server.
365    # Requires $OPT_ICONV unless $OPT_ALWAYS_UNICODE_LOCALE, in which
366    # case it only warns.  Can be "require"d.
367    OPT_IMAP=yes
369    # The MD5 message digest (RFC 1321) enables several authentication
370    # possibilities for POP3 (APOP), IMAP and SMTP (CRAM-MD5).
371    OPT_MD5=yes
373    # Support for parsing of user and password credentials from the
374    # ~/.netrc file ($NETRC; see *netrc-lookup* manual entry).
375    OPT_NETRC=yes
377    # Add support for POP3 protocol.
378    # Download of mails via POP protocol.  Can be "require"d.
379    OPT_POP3=yes
381    # Add support for SMTP (and SUBMISSION) protocol.
382    # Sending mails directly over the network.  Can be "require"d.
383    OPT_SMTP=yes
385    # Detect support for Secure Socket Layer (Transport Layer Security,
386    # TLS), i.e., encrypted socket connections; can be "require"d.
387    # It also automatically enables support for S/MIME message signing,
388    # verification, en- and decryption.
389    # Supported are the OpenSSL (https://www.openssl.org) and LibreSSL
390    # (http://www.libressl.org) libraries.
391    OPT_TLS=yes
393       # If $OPT_TLS: shall mechanisms to support more digest and cipher
394       # algorithms than the few that are documented be used?
395       # For S/MIME *smime-cipher* for example this will cause
396       # EVP_get_cipherbyname(3) to be tried shall the built-in knowledge
397       # not suffice to understand the user request.
398       # Will create a large statically linked binary; dynamically linked
399       # the costs only arise once the extended lookup is actually needed
400       # (the first time).  Some TLS libraries will always support all
401       # algorithms.  This can be "require"d.
402       OPT_TLS_ALL_ALGORITHMS=yes
404 # Interaction with a spam email filter is possible.
405 # Refer to all commands and variables with a "spam" prefix, and
406 # see the manual example section "Handling spam".
407 # . OPT_SPAM_FILTER:
408 #   Generic filter hook which can be used with e.g. bogofilter(1)
409 #   and sylfilter(1): see documentation for the *spam-filter-**
410 #   variables for expected application behaviour.
411 # . OPT_SPAM_SPAMC:
412 #   Support for interaction with spamassassin(1)s spamc(1).
413 OPT_SPAM_FILTER=yes
414 OPT_SPAM_SPAMC=no
416 # Removing (almost) all user interface and error messages is possible.
417 # This might be interesting for automated use cases (only).
418 OPT_UISTRINGS=yes
420 # Whether package system, for example pkgsrc(7) on NetBSD and more,
421 # OpenCSW on SunOS/Solaris, etc., specific paths shall be automatically
422 # included in $C_INCLUDE_PATH and $LD_LIBRARY_PATH when seen?
423 OPT_USE_PKGSYS=yes
425 ##  --  >8  --  8<  --  ##
426 ## Normal users should not need to read any further
428 ## PATHS AND PROGRAMS, DEVELOPMENT ##
430 # To ease the life of forkers and packagers "our" name can be changed.
431 # The name is built by concatenating $VAL_SID and $VAL_MAILX:
432 # $(VAL_SID)$(VAL_MAILX).  Note that the final string must be longer
433 # than two characters, must fit _easily_ in NAME_MAX-1, must not contain
434 # any whitespace, and must not contain multibyte sequences.
435 VAL_SID=s-
436 VAL_MAILX=nail
438 # The name of the exemplary resource template.
439 # Note 1: not overwritten by "make install" if yet exists!
440 VAL_SYSCONFRC=${VAL_SID}${VAL_MAILX}.rc
442 ## FEATURE SET, DEVELOPMENT ##
444 # With $OPT_AUTOCC we can make use of the ASan AddressSanitizer and ASan
445 # MemorySanitizer of Google
446 # (https://github.com/google/sanitizers/wiki/AddressSanitizer).
447 # Also USAN (https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html).
448 # These are definitily only useful for debugging.
449 # Also, external libraries are often problematic (e.g., ncursesw), and
450 # ASAN_MEMORY of the tried clang 4.0.0 (4.0.0-2 of ArchLinux) was faulty.
451 # Can be "require"d.
452 OPT_ASAN_ADDRESS=no
453 OPT_ASAN_MEMORY=no
454 OPT_USAN=no
456 # Use debug compiler flags, enable code assertions and memory canaries,
457 # which require a rather large amount of runtime memory.
458 OPT_DEBUG=no
460 # Development only.
461 OPT_DEVEL=no
463 # We use the crypto libraries' MD5 implementation if possible, unless..
464 OPT_NOEXTMD5=no
466 # If $OPT_DEBUG is true we will use a simple memory wrapper with
467 # canaries.  This interferes with memory debuggers like valgrind(1) or
468 # the LLVM -fsanitize stuff.  Enable this to not use our wrapper.
469 OPT_NOMEMDBG=`\
470    if feat_yes ASAN_MEMORY || feat_yes ASAN_ADDRESS; then \
471       echo yes;\
472    else \
473       echo no;\
474    fi`
476 # vim:set tw=72: s-it-mode