*asksend*: indicate that envelope is pre-refinement (Geoff Clare)
[s-mailx.git] / make.rc
blob352b9333e41f7bbc6afe44b73bf7d96d62471d4f
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 OPT_ERRORS=yes
245 # We do have a very primitive HTML tagsoup filter which can be used to
246 # convert HTML to plain text for display purposes.  If enabled it will
247 # be used for all MIME types which have the corresponding type marker
248 # (more on this in the manual section "The mime.types files").  And
249 # which do not have any user defined MIME type handler, of course.
250 OPT_FILTER_HTML_TAGSOUP=yes
252 # A simple line-based quoting mechanism can be made available via the
253 # *quote-fold* mechanism.  This will be turned off automatically if the
254 # required character classification is not available on the host.
255 # Can be "require"d.
256 # TODO should not wrap lines when only WS or a NL-escaping \ follows
257 OPT_FILTER_QUOTE_FOLD=yes
259 # Character set conversion enables reading and sending of mails in
260 # multiple character sets through usage of the iconv(3) library.  Please
261 # read the manual section "Character sets" for the complete picture.
262 # This should usually be enabled; it can be "require"d.
263 OPT_ICONV=yes
265 # IDNA (internationalized domain names for applications) offers users
266 # the possibility to use domain names in their native language, i.e., to
267 # use non-US-ASCII content, as in, e.g., <www.räksmörgåsa.example>,
268 # which the IDNA algorithm would convert to
269 # <www.xn--rksmrgsa-0zap8p.example>.  :)
270 # Multiple implementations are supported:
271 # . idnkit - idnkit, https://www.nic.ad.jp/ja/idn/idnkit/download,
272 #     either of version 1 for IDNA 2003 or version 2 for IDNA 2008.
273 # . idn2 - GNU Libidn2 for IDNA 2008, https://www.gnu.org/software/libidn/,
274 # . idn - GNU Libidn for IDNA 2003, same,
275 # OPT_IDNA can be "require"d.
276 OPT_IDNA=yes
277 VAL_IDNA=idnkit,idn2,idn
279 # IMAP-style SEARCH expressions can be supported.  This addressing mode
280 # is available with all types of folders; for folders not located on
281 # IMAP servers, or for servers unable to execute the SEARCH command, the
282 # search is performed locally.
283 OPT_IMAP_SEARCH=yes
285 # Support for RFC 1524 a.k.a mailcap files can be made available.
286 # The search order when looking up MIME type handlers for display /
287 # quoting purposes is then *pipe-EXTENSION*, *pipe-TYPE/SUBTYPE*,
288 # mailcap entry, `mimetype's type-marker extension.
289 # For other purposes mailcap entries are used exclusively.
290 # RFC 1524 specifies the default $VAL_MAILCAPS path search as follows,
291 # and it specifies the $MAILCAPS environment variable to override it.
292 OPT_MAILCAP=yes
293 VAL_MAILCAPS=~/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
295 # Whether support for Maildir email directories shall be enabled.
296 OPT_MAILDIR=yes
298 # Line editing and -history (manual "On terminal and line editor").
299 # If ISO C (ISO/IEC 9899:1990/Amendment 1:1995) is supported on the
300 # system then our built-in MLE (Mailx-Line-Editor) version can be used.
301 # An enabled & available OPT_TERMCAP may affect and improve the MLE.
302 # Can be "require"d.
303 OPT_MLE=yes
305    # Add support for `history' management.
306    OPT_HISTORY=yes
308    # Add support for `(un)?bind'ing of key sequences.
309    OPT_KEY_BINDINGS=yes
311    # Use termcap(5) for MLE terminal control; can be "require"d.
312    # Today most environments ship a termcap(5) that in fact is part of
313    # terminfo(5), and acts as a converting wrapper for this library.
314    # To avoid this redundancy we also support terminfo(5), and use it
315    # instead if we find it (assuming that termcap(5) is a stub, then).
316    # Note that terminfo(5) offers access to more key sequences, e.g.,
317    # kLFT5, for which no termcap(5) entry exists.
318    # terminfo(5) support can (thus) be "require"d.
319    OPT_TERMCAP=yes
320       OPT_TERMCAP_VIA_TERMINFO=yes
322 # Whether support for MTA aliases(5) shall be included.
323 # With it, and if *mta-aliases* is set to a file, MTA aliases will be
324 # expanded as a last step before messages are sent.
325 # Note this only supports text-, no database files.
326 OPT_MTA_ALIASES=yes
328 # Several different P(seudo) R(andom number) G(enerator) possibilities.
329 # No need for somewhat strong random is necessary.
330 # The following will be used as sole PRG implementations.
331 # . arc4 - we search for arc4random(3).
332 # . tls - if OPT_TLS is available that libraries' PRNG can be used.
333 # The following will only be used to seed our builtin ARC4 PRNG.
334 # . libgetrandom - getrandom(3) via C library.
335 # . sysgetrandom - getrandom(2) via SYSCALL.
336 # . urandom - reading from /dev/urandom.
337 # . builtin - unscientific seeding for our builtin ARC4 implementation.
338 # . (error - bail out)
339 VAL_RANDOM=arc4,tls,libgetrandom,sysgetrandom,urandom,builtin
341 # Regular expression (re_format(7)) support for searches, conditional
342 # expressions etc., we use the extended ones, then; can be "require"d.
343 OPT_REGEX=yes
345 # Major switch to toggle *all* network related protocols
346 # (POP3,SMTP,IMAP) and related/dependent stuff (GSS-API,TLS);
347 # can be "require"d.
348 OPT_NET=yes
350    # Detect support for GSS-API (Generic Security Services Application
351    # Programming Interface) based authentication, e.g., Kerberos v5?
352    # Available for IMAP and SMTP; can be "require"d.
353    OPT_GSSAPI=yes
355    # Add support for IMAP protocol.
356    # Reading of mails directly on the server.
357    # Requires $OPT_ICONV unless $OPT_ALWAYS_UNICODE_LOCALE, in which
358    # case it only warns.  Can be "require"d.
359    OPT_IMAP=yes
361    # The MD5 message digest (RFC 1321) enables several authentication
362    # possibilities for POP3 (APOP), IMAP and SMTP (CRAM-MD5).
363    OPT_MD5=yes
365    # Support for parsing of user and password credentials from the
366    # ~/.netrc file ($NETRC; see *netrc-lookup* manual entry).
367    OPT_NETRC=yes
369    # Add support for POP3 protocol.
370    # Download of mails via POP protocol.  Can be "require"d.
371    OPT_POP3=yes
373    # Add support for SMTP (and SUBMISSION) protocol.
374    # Sending mails directly over the network.  Can be "require"d.
375    OPT_SMTP=yes
377    # Detect support for Secure Socket Layer (Transport Layer Security,
378    # TLS), i.e., encrypted socket connections; can be "require"d.
379    # It also automatically enables support for S/MIME message signing,
380    # verification, en- and decryption.
381    # Supported are the OpenSSL (https://www.openssl.org) and LibreSSL
382    # (http://www.libressl.org) libraries.
383    OPT_TLS=yes
385       # If $OPT_TLS: shall mechanisms to support more digest and cipher
386       # algorithms than the few that are documented be used?
387       # For S/MIME *smime-cipher* for example this will cause
388       # EVP_get_cipherbyname(3) to be tried shall the built-in knowledge
389       # not suffice to understand the user request.
390       # Will create a large statically linked binary; dynamically linked
391       # the costs only arise once the extended lookup is actually needed
392       # (the first time).  Some TLS libraries will always support all
393       # algorithms.  This can be "require"d.
394       OPT_TLS_ALL_ALGORITHMS=yes
396 # Interaction with a spam email filter is possible.
397 # Refer to all commands and variables with a "spam" prefix, and
398 # see the manual example section "Handling spam".
399 # . OPT_SPAM_FILTER:
400 #   Generic filter hook which can be used with e.g. bogofilter(1)
401 #   and sylfilter(1): see documentation for the *spam-filter-**
402 #   variables for expected application behaviour.
403 # . OPT_SPAM_SPAMC:
404 #   Support for interaction with spamassassin(1)s spamc(1).
405 OPT_SPAM_FILTER=yes
406 OPT_SPAM_SPAMC=no
408 # Removing (almost) all user interface and error messages is possible.
409 # This might be interesting for automated use cases (only).
410 OPT_UISTRINGS=yes
412 # Whether package system, for example pkgsrc(7) on NetBSD and more,
413 # OpenCSW on SunOS/Solaris, etc., specific paths shall be automatically
414 # included in $C_INCLUDE_PATH and $LD_LIBRARY_PATH when seen?
415 OPT_USE_PKGSYS=yes
417 ##  --  >8  --  8<  --  ##
418 ## Normal users should not need to read any further
420 ## PATHS AND PROGRAMS, DEVELOPMENT ##
422 # To ease the life of forkers and packagers "our" name can be changed.
423 # The name is built by concatenating $VAL_SID and $VAL_MAILX:
424 # $(VAL_SID)$(VAL_MAILX).  Note that the final string must be longer
425 # than two characters, must fit _easily_ in NAME_MAX-1, must not contain
426 # any whitespace, and must not contain multibyte sequences.
427 VAL_SID=s-
428 VAL_MAILX=nail
430 # The name of the exemplary resource template.
431 # Note 1: not overwritten by "make install" if yet exists!
432 VAL_SYSCONFRC=${VAL_SID}${VAL_MAILX}.rc
434 ## FEATURE SET, DEVELOPMENT ##
436 # With $OPT_AUTOCC we can make use of the ASan AddressSanitizer and ASan
437 # MemorySanitizer of Google
438 # (https://github.com/google/sanitizers/wiki/AddressSanitizer).
439 # Also USAN (https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html).
440 # These are definitily only useful for debugging.
441 # Also, external libraries are often problematic (e.g., ncursesw), and
442 # ASAN_MEMORY of the tried clang 4.0.0 (4.0.0-2 of ArchLinux) was faulty.
443 # Can be "require"d.
444 OPT_ASAN_ADDRESS=no
445 OPT_ASAN_MEMORY=no
446 OPT_USAN=no
448 # Use debug compiler flags, enable code assertions and memory canaries,
449 # which require a rather large amount of runtime memory.
450 OPT_DEBUG=no
452 # Development only.
453 OPT_DEVEL=no
455 # We use the crypto libraries' MD5 implementation if possible, unless..
456 OPT_NOEXTMD5=no
458 # If $OPT_DEBUG is true we will use a simple memory wrapper with
459 # canaries.  This interferes with memory debuggers like valgrind(1) or
460 # the LLVM -fsanitize stuff.  Enable this to not use our wrapper.
461 OPT_NOMEMDBG=`\
462    if feat_yes ASAN_MEMORY || feat_yes ASAN_ADDRESS; then \
463       echo yes;\
464    else \
465       echo no;\
466    fi`
468 # vim:set tw=72: s-it-mode