Add n_iconv_name_is_ascii()
[s-mailx.git] / make.rc
blob66952c4c0eff13869588bf7afd4ed474040a7198
1 #@ make.rc defined 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 #@ - Values have a VAL_ prefix, and are assigned strings, for example
8 #@       VAL_PREFIX="/usr/local"
9 #@
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 is interpreted as a whitespace separated list of strings,
18 #@   like "idn2 idn idnkit", case is ignored, 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 rest of the 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
36 #@   necessary, too).
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.
60 VAL_PRIVSEP_USER=root
62 # General prefix where S-nail should be installed.
63 VAL_PREFIX=/usr/local
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 &
70 #   $VAL_MAILX).
71 #   (Only with $OPT_DOTLOCK.)
72 VAL_LIBEXECDIR="${VAL_PREFIX}/libexec"
73 # . of the manual.
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...)
86 #DESTDIR=
88 # Where the local mail system stores user $MAIL files.
89 VAL_MAIL=`\
90    if [ -d /var/spool/mail ]; then \
91       echo /var/spool/mail;\
92    else \
93       echo /var/mail;\
94    fi`
96 # Path to the local MTA (Mail-Transfer-Agent).
97 VAL_MTA=`\
98    if [ -x /usr/bin/sendmail ]; then \
99       echo /usr/bin/sendmail;\
100    elif [ -x /usr/lib/sendmail ]; then \
101       echo /usr/lib/sendmail;\
102    else \
103       echo /usr/sbin/sendmail;\
104    fi`
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.
117 VAL_SHELL=/bin/sh
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}"
124 VAL_EDITOR=ed
125 VAL_LISTER=ls
126 VAL_MAILRC=~/.mailrc
127 VAL_MBOX=~/mbox
128 VAL_NETRC=~/.netrc
129 VAL_PAGER=more
130 VAL_TMPDIR=/tmp
131 VAL_VISUAL=vi
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.
155 ## FEATURE SET ##
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 \
165       echo yes;\
166    else \
167       echo no;\
168    fi`
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.
173 OPT_CROSS_BUILD=no
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?
178 OPT_USE_PKGSYS=yes
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.)
193 OPT_AUTOCC=yes
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.
200 OPT_AMALGAMATION=no
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.
206 OPT_ICONV=yes
208 # Major switch to toggle *all* network related protocols
209 # (POP3,SMTP,IMAP) and related/dependent stuff (GSS-API,SSL);
210 # can be "require"d.
211 OPT_SOCKETS=yes
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.
219 OPT_SSL=yes
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.
234 OPT_SMTP=yes
236 # If $OPT_SOCKETS: support for POP3 protocol?
237 # (Download of mails via POP protocol)  Can be "require"d.
238 OPT_POP3=yes
240 # If $OPT_SOCKETS: support for IMAP protocol?
241 # Requires $OPT_ICONV unless $OPT_ALWAYS_UNICODE_LOCALE, in which case
242 #  it only warns.
243 # (Reading of mails directly on the server)  Can be "require"d.
244 OPT_IMAP=yes
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.
249 OPT_GSSAPI=yes
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.
254 OPT_MD5=yes
256 # If $OPT_SOCKETS: support for parsing of user and password credentials
257 # from the ~/.netrc file ($NETRC; see *netrc-lookup* manual entry).
258 OPT_NETRC=yes
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 | "
267 OPT_AGENT=yes
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 # . idn2 - GNU Libidn2 library (same),
276 # . idn - GNU Libidn library (https://www.gnu.org/software/libidn/),
277 # . idnkit - idnkit (https://www.nic.ad.jp/ja/idn/idnkit/download/).
278 # OPT_IDNA can be "require"d.
279 OPT_IDNA=yes
280 VAL_IDNA="idnkit idn2 idn"
282 # IMAP-style SEARCH expressions can be supported.  This addressing mode
283 # is available with all types of folders; for folders not located on
284 # IMAP servers, or for servers unable to execute the SEARCH command, the
285 # search is performed locally.
286 OPT_IMAP_SEARCH=yes
288 # Several different P(seudo) R(andom number) G(enerator) possibilities.
289 # No need for somewhat strong random is necessary.
290 # The following will be used as sole PRG implementations.
291 # . arc4 - we search for arc4random(3).
292 # . ssl - if OPT_SSL is available the PRG of the SSL library can be used.
293 # The following will only be used to seed our builtin ARC4 PRG.
294 # . libgetrandom - getrandom(3) via C library.
295 # . sysgetrandom - getrandom(2) via SYSCALL.
296 # . urandom - reading from /dev/urandom.
297 # . builtin - a builtin ARC4 implementation with unscientific seeding.
298 # . (error - bail out)
299 VAL_RANDOM="arc4 ssl libgetrandom sysgetrandom urandom builtin"
301 # Regular expression (re_format(7)) support for searches, conditional
302 # expressions etc., we use the extended ones, then; can be "require"d.
303 OPT_REGEX=yes
305 # Line editing and -history (manual "On terminal and line editor").
306 # . OPT_MLE
307 #   If ISO C (ISO/IEC 9899:1990/Amendment 1:1995) is supported on the
308 #   system then our built-in MLE (Mailx-Line-Editor) version can be used.
309 #   An enabled & available OPT_TERMCAP may affect and improve the MLE.
310 #   Can be "require"d.
311 OPT_MLE=yes
312 # Add support for history management.
313 OPT_HISTORY=yes
314 # Add support for `(un)?bind'ing of key sequences.
315 OPT_KEY_BINDINGS=yes
317 # Use termcap(5) for terminal control; can be "require"d.
318 # Today most environments ship a termcap(5) that in fact is part of
319 # terminfo(5), and acts as a converting wrapper for this library.
320 # To avoid this redundancy we also support terminfo(5), and use it
321 # instead if we find it (assuming that termcap(5) is a stub, then).
322 # Note that terminfo(5) offers access to more key sequences, e.g.,
323 # kLFT5, for which no termcap(5) entry exists.
324 # terminfo(5) support can (thus) be "require"d.
325 OPT_TERMCAP=yes
326 OPT_TERMCAP_VIA_TERMINFO=yes
328 # Enable the `errors' command; S-nail is a console-based application and
329 # thus errors may fly by pretty fast as other operations are in
330 # progress; or $PAGERs are started and clear errors off the screen.  If
331 # enabled errors are duplicated as they happen and the `errors' command
332 # will show them when asked to.
333 OPT_ERRORS=yes
335 # We may include `help' etc. strings for commands, increasing size a bit.
336 OPT_DOCSTRINGS=yes
338 # It is possible to strip out (almost) all user interface and error messages.
339 # This might be interesting for automated use cases (only).
340 OPT_UISTRINGS=yes
342 # Interaction with a spam email filter is possible.
343 # Refer to all commands and variables with a "spam" prefix, and
344 # see the manual example section "Handling spam".
345 # . OPT_SPAM_SPAMC:
346 #   Support for interaction with spamassassin(1)s spamc(1).
347 # . [Obsolete] OPT_SPAM_SPAMD:
348 #   Direct communication with spamassassin(1)s spamd(1).
349 #   Needs unix(4) domain sockets (checked).  Can be "require"d.
350 # . OPT_SPAM_FILTER:
351 #   Generic filter hook which can be used with e.g. bogofilter(1)
352 #   and sylfilter(1): see documentation for the *spam-filter-**
353 #   variables for expected application behaviour.
354 OPT_SPAM_SPAMC=no
355 OPT_SPAM_SPAMD=no
356 OPT_SPAM_FILTER=yes
358 # A simple line-based quoting mechanism can be made available via the
359 # *quote-fold* mechanism.  This will be turned off automatically if the
360 # required character classification is not available on the host.
361 # Can be "require"d.
362 # TODO shouldn't wrap lines when only WS or a NL-escaping \ follows
363 OPT_QUOTE_FOLD=yes
365 # We do have a very primitive HTML tagsoup filter which can be used to
366 # convert HTML to plain text for display purposes.  If enabled it will
367 # be used for all MIME types which have the @h@ or @H@ type markers
368 # (more on this in the manual section "The mime.types files").  And
369 # which do not have any user defined MIME type handler, of course.
370 OPT_FILTER_HTML_TAGSOUP=yes
372 # A simple form of coloured output can optionally be produced.
373 OPT_COLOUR=yes
375 # File dotlocking is performed for "system mailbox" (%[USER] and
376 # %:ANYFILE) MBOX files: when synchronizing any such FILE a FILE.lock
377 # file will be created in the directory of FILE, for the duration of the
378 # synchronization: set $OPT_DOTLOCK to support this traditional mail
379 # spool file locking.
380 # $VAL_MAIL(s) where normal system mailboxes reside are usually not
381 # writable by normal users, except that a user may read and write his
382 # own mailbox.  But this means that a program run by the user cannot
383 # create a .lock file!  The solution is to install a privilege-separated
384 # mini-program that has the sole purpose and functionality of managing
385 # the dotlock file in such situations -- and only then, as a last
386 # ressort.  With it dotlock files can be created for any mailbox for
387 # which the invoking user has read (or read-write) permissions, and
388 # under the UID and GID of the mailbox itself!  We call it -privsep.
389 # $OPT_DOTLOCK can be "require"d.
390 OPT_DOTLOCK=yes
392 ##  --  >8  --  8<  --  ##
393 ## Normal users should not need to read any further
395 ## PATHS AND PROGRAMS, DEVELOPMENT ##
397 # To ease the life of forkers and packagers "our" name can be changed.
398 # The name is build by concatenating $VAL_SID and $VAL_MAILX, i.e.,
399 # $(VAL_SID)$(VAL_MAILX).  Note that the final string must be longer
400 # than two characters and may not contain any whitespace.
401 VAL_SID=s-
402 VAL_MAILX=nail
404 # The name of the exemplary resource template.
405 # Note 1: not overwritten by "make install" if yet existent!
406 VAL_SYSCONFRC="${VAL_SID}${VAL_MAILX}.rc"
408 ## FEATURE SET, DEVELOPMENT ##
410 # Use debug compiler flags, enable some additional commands and code
411 # assertions.  Note that setting this also enables our own memory
412 # canaries, which require a rather large amount of runtime memory.
413 OPT_DEBUG=no
415 # Experimental code etc.
416 # Note: this forcefully enables OPT_DEBUG
417 OPT_DEVEL=no
419 # We use the crypto libraries' MD5 implementation if possible, unless..
420 OPT_NOEXTMD5=no
422 # With $OPT_AUTOCC we can make use of the ASan AddressSanitizer and ASan
423 # MemorySanitizer of Google
424 # (https://github.com/google/sanitizers/wiki/AddressSanitizer).
425 # These are definetely only useful for debugging.
426 # Also, external libraries are often problematic (e.g., ncursesw), and
427 # ASAN_MEMORY of the tried clang 4.0.0 (4.0.0-2 of ArchLinux) was faulty.
428 # Can be "require"d.
429 OPT_ASAN_ADDRESS=no
430 OPT_ASAN_MEMORY=no
432 # With $OPT_AUTOCC we will use stack protector guards shall the
433 # detected compiler support them; this goes in line with our own (heap)
434 # memory canaries and will detect buffer overflows.  It is usually only
435 # useful during development, i.e., in a debug environment that tests all
436 # aspects of a program.  But today it is often used even in shipout code.
437 OPT_FORCED_STACKPROT=`\
438    if feat_yes DEVEL || feat_yes DEBUG; then \
439       echo yes;\
440    else \
441       echo no;\
442    fi`
444 # If $OPT_DEBUG is true we'll use a simple memory wrapper with
445 # canaries.  This interferes with memory debuggers like valgrind(1) or
446 # the LLVM -fsanitize stuff.  Enable this to not use our wrapper.
447 OPT_NOMEMDBG=`\
448    if feat_yes ASAN_MEMORY || feat_yes ASAN_ADDRESS; then \
449       echo yes;\
450    else \
451       echo no;\
452    fi`
454 # Our functions are instrumented with Not-Yet-Dead chirps, which print
455 # a function call trace when the program crashes.  Whereas NYD will be
456 # used automatically when either of $OPT_DEBUG and $OPT_DEVEL is
457 # defined, an extended level of NYD is compiled in only on explicit
458 # request.
459 # TODO Separation in between NYD and NYD2 not yet fully done.
460 OPT_NYD2=no
462 # vim:set tw=72: s-it-mode