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