Support LEXINPUT, thus `bind', contexts..
[s-mailx.git] / make.rc
blob4fab4fa18bf8742460c7f0fa0f27e794c42a26e8
1 #@ make.rc can be used adjust the set of features, paths, etc.
2 #@ You should have read INSTALL first.
3 #@ Notes:
4 #@ . Choosing a predefined CONFIG= disallows further option fine-tuning.
5 #@ . Features / options have an OPT_ prefix and need to be assigned
6 #@   a boolean value, as in OPT_SSL=yes.  Booleans are 1/0, y/n,
7 #@   true/false, yes/no and on/off (case doesn't matter).
8 #@   The value "require" is also a true boolean, but will in addition
9 #@   cause configuration to fail if the requested condition cannot be
10 #@   satisfied.  This value is only available for a subset of options.
11 #@ . Values use VAL_ instead, and are assigned strings.
12 #@   E.g., VAL_PREFIX=/usr/local.
13 #@   Variables which are only used during configuration, building,
14 #@   and / or installation have no prefix, e.g., DESTDIR, VERBOSE, awk.
15 #@ . Specifying settings on the command line will take precedence over
16 #@   the variables in here (correctly triggering build updates as
17 #@   necessary, too).
18 #@ . This file is parsed by the shell: it is in sh(1), not in make(1)
19 #@   syntax.  Evaluation occurs *after* it has been read, so command
20 #@   line overwrites take effect.  To use multiline values, escape the
21 #@   newlines on all lines but the last with a reverse solidus (back-
22 #@   slash), as in "LINE \".
23 #@   To embed a shell variable unexpanded, use two: "XY=\\${HOME}".
24 #@   The parsing is sequential top-to-bottom (nonetheless), so that
25 #@   shell snippets in a value can refer only to stuff yet defined.
26 #@ . You may NOT comment out anything in here -- if you want to disable
27 #@   a feature, set it to a false boolean.
29 ## IDENTITIES, PATHS AND PROGRAMS ##
31 # The user ID our small privilege-separated helper program will be
32 # SETUID to, shall it be included ($OPT_DOTLOCK).
33 # Installation will then require the chown(1) program (as below) and
34 # sufficient privileges to perform a SETUID to this user ID.
35 VAL_PRIVSEP_USER=root
37 # General prefix where S-nail should be installed.
38 VAL_PREFIX=/usr/local
40 # Fine tune individual locations, normally under $VAL_PREFIX.
41 # . the place of the S-nail program.
42 VAL_BINDIR="${VAL_PREFIX}/bin"
43 # . the place of the privilege-separated helper program, the name
44 #   of which is [$VAL_SID$VAL_NAIL]-privsep (see below for $VAL_SID &
45 #   $VAL_NAIL).
46 #   (Only with $OPT_DOTLOCK.)
47 VAL_LIBEXECDIR="${VAL_PREFIX}/libexec"
48 # . of the manual.
49 VAL_MANDIR="${VAL_PREFIX}/share/man"
50 # . of the exemplary resource file.
51 VAL_SYSCONFDIR="${VAL_PREFIX}/etc"
53 # The variable $DESTDIR is prepended to all the paths from above at
54 # installation time; this feature can be used for, e.g., package
55 # building: if $VAL_PREFIX is "/usr/local", but $DESTDIR is set to "here",
56 # then S-nail will still think its $VAL_PREFIX is "/usr/local" whereis the
57 # build system will instead use "here/usr/local".
58 # NOTE: it cannot be set in here, but must be given on the command line
59 # when invoking the "install" make(1) (directly or indirectly).
60 # (That is, if you uncomment it, it'll be update-tracked...)
61 #DESTDIR=
63 # Where the local mail system stores user $MAIL files.
64 VAL_MAIL=`\
65    if [ -d /var/spool/mail ]; then \
66       echo /var/spool/mail;\
67    else \
68       echo /var/mail;\
69    fi`
71 # Path to the local MTA (Mail-Transfer-Agent).
72 VAL_MTA=`\
73    if [ -x /usr/bin/sendmail ]; then \
74       echo /usr/bin/sendmail;\
75    elif [ -x /usr/lib/sendmail ]; then \
76       echo /usr/lib/sendmail;\
77    else \
78       echo /usr/sbin/sendmail;\
79    fi`
81 # Today a lot of systems no longer use sendmail(1), but a different MTA.
82 # To ensure compatibility with sendmail(1), a system called
83 # mailwrapper(8) is often used, which selects the required service by
84 # looking at the name by which the program actually has been invoked.
85 # This variable can be used to adjust this name as necessary.
86 VAL_MTA_ARGV0=sendmail
88 # Default *SHELL* (sh(1) path).
89 # Sometimes we simply invoke a command directly via execlp(2) instead of
90 # indirectly through *SHELL* -- in these cases execlp(2) may fallback to
91 # it's own builtin sh(1) path
92 VAL_SHELL=/bin/sh
94 # Some more default fallback values, some of which are standardized
95 # and (thus)/or documented in the manual (changes not reflected there!).
96 # Note that default paths are often not (shell) quoted when displayed
97 VAL_DEAD_BASENAME=dead.letter
98 VAL_DEAD="~/${VAL_DEAD_BASENAME}"
99 VAL_EDITOR=ed
100 VAL_LISTER=ls
101 VAL_MAILRC=~/.mailrc
102 VAL_MBOX=~/.mbox
103 VAL_NETRC=~/.netrc
104 VAL_PAGER=more
105 VAL_TMPDIR=/tmp
106 VAL_VISUAL=vi
108 # The following tools may be provided a.k.a. overwritten,
109 # `command -v NAME` is used to query the utility otherwise:
110 #  MAKE=, STRIP=, awk=, cat=, chmod=, cp=, cmp=, cksum=,
111 #     grep=, mkdir=, mv=, rm=, sed=, sort=, tee=, tr=
112 # Usually in administrator paths:
113 #  chown= [$OPT_DOTLOCK]
114 # Note that awk(1), rm(1) and tr(1) are needed before this file is read,
115 # all other utilities will be checked afterwards only.  For
116 # cross-compilation setting $MAKE and $STRIP may be necessary.  Due to
117 # the evaluation order of the build system all those programs are
118 # usually needed, but by setting any of the variables to true(1), as in
119 # chown=/usr/bin/true, availability of unneeded programs can be faked.
120 # We require uname(1) -s, command(1) -v, echo(1), etc.
121 # uname(1) can be circumvented by setting $OS.
123 ## FEATURE SET ##
125 # For cross-compilation purposes it may be useful to not actually run
126 # systemcall etc. tests (link and run the executable) but only to
127 # perform the link tests necessary to detect host environment.
128 OPT_CROSS_BUILD=no
130 # Shall S-nail try to automatically detect a compiler and provide a set
131 # of known-good compiler flags?  If so additions may still be provided
132 # by setting $EXTRA_CFLAGS and $EXTRA_LDFLAGS to whatever is desired.
133 # Thus: set this to false and use your normal $CC / $CFLAGS / $LDFLAGS,
134 # otherwise pass additional flags via $EXTRA_CFLAGS / $EXTRA_LDFLAGS:
135 #     $ make EXTRA_CFLAGS=-std=c99 tangerine
136 # Whatever you do, the configuration is fixated and updates will force
137 # rebuilds.  And far below in this file there is $OPT_FORCED_STACKPROT,
138 # too, which can be used to cause injection of stack protectors.
139 OPT_AUTOCC=yes
141 # It is possible to compile S-nail as a "single-source", meaning that
142 # all source files are injected into a single compilation unit, which is
143 # then compiled.  This allows the compiler to perform much more
144 # optimizations, and also reduces the management overhead that is used
145 # for / needed by the linker.
146 OPT_AMALGAMATION=no
148 # Character set conversion enables reading and sending of mails in
149 # multiple character sets through usage of the iconv(3) library.  Please
150 # read the manual section "Character sets" for the complete picture.
151 # This should usually be enabled; it can be "require"d.
152 OPT_ICONV=yes
154 # Major switch to toggle *all* network related protocols
155 # (POP3,SMTP) and related/dependent stuff (GSS-API,SSL);
156 # can be "require"d.
157 OPT_SOCKETS=yes
159 # If $OPT_SOCKETS: support for Secure Socket Layer (Transport Layer
160 # Security, TLS), i.e., encrypted socket connections; can be "require"d.
161 # This needs the OpenSSL libraries (<http://www.openssl.org>).
162 OPT_SSL=yes
164 # If $OPT_SSL: shall S-nail (try to) use mechanisms to support more
165 # digest and cipher algorithms than the few that are documented?  For
166 # S/MIME *smime-cipher* for example this will cause
167 # EVP_get_cipherbyname(3) to be tried shall the (S-nail-) builtin
168 # knowledge not suffice to understand the user request.  Will create
169 # a large statically linked binary; dynamically linked the costs only
170 # arise once the extended lookup is actually needed (the first time).
171 # This can be "require"d.
172 OPT_SSL_ALL_ALGORITHMS=yes
174 # If $OPT_SOCKETS: support for SMTP protocol?
175 # (Directly sending mails over the network)  Can be "require"d.
176 OPT_SMTP=yes
178 # If $OPT_SOCKETS: support for POP3 protocol?
179 # (Download of mails via POP protocol)  Can be "require"d.
180 OPT_POP3=yes
182 # If $OPT_SOCKETS: support for GSS-API (Generic Security Services
183 # Application Programming Interface) based authentication, e.g.,
184 # Kerberos v5?  Available for SMTP; can be "require"d.
185 OPT_GSSAPI=yes
187 # Enabling the MD5 message digest adds support for several
188 # authentication possibilities: POP3 (APOP), SMTP (CRAM-MD5).
189 # If you don't need those, you may turn them off by excluding MD5.
190 OPT_MD5=yes
192 # If $OPT_SOCKETS: support for parsing of user and password credentials
193 # from the ~/.netrc file ($NETRC; see *netrc-lookup* manual entry).
194 OPT_NETRC=yes
196 # If $OPT_SOCKETS: passwords can also be looked up through an external
197 # "agent" in order to allow for encrypted password storage (see
198 # *agent-shell-lookup*).
199 # [Obsolete] Even though marked *v15-compat* this feature has been
200 # obsoleted; please use an encrypted .netrc file (via *netrc-pipe*) or
201 # encrypt a complete resource file and load this like, e.g.,
202 #     source "gpg -qd ~/.mailprivate.gpg | "
203 OPT_AGENT=yes
205 # IDNA (internationalized domain names for applications) offers users
206 # the possibility to use domain names in their native language, i.e., to
207 # use non-US-ASCII content, as in, e.g., <www.räksmörgåsa.example>,
208 # which the IDNA algorithm would convert to
209 # <www.xn--rksmrgsa-0zap8p.example>.  :)  This either needs idnkit
210 # (<https://www.nic.ad.jp/ja/idn/idnkit/download/>) or the GNU Libidn
211 # library (<https://www.gnu.org/software/libidn/>).  It can be
212 # "require"d.
213 OPT_IDNA=yes
215 # IMAP-style SEARCH expressions can be supported.  This addressing mode
216 # is available with all types of folders; for folders not located on
217 # IMAP servers, or for servers unable to execute the SEARCH command, the
218 # search is performed locally.
219 OPT_IMAP_SEARCH=yes
221 # Regular expression (re_format(7)) support for searches, conditional
222 # expressions etc., we use the extended ones, then; can be "require"d.
223 OPT_REGEX=yes
225 # Line editing and -history (manual "On terminal and line editor").
226 # . OPT_MLE
227 #   If ISO C (ISO/IEC 9899:1990/Amendment 1:1995) is supported on the
228 #   system then our builtin MLE (Mailx-Line-Editor) version can be used.
229 #   An enabled & available OPT_TERMCAP may affect and improve the MLE.
230 #   Can be "require"d.
231 OPT_MLE=yes
232 # Add support for history management.
233 OPT_HISTORY=yes
234 # Add support for `(un)?bind'ing of key sequences
235 OPT_KEY_BINDINGS=yes
237 # Use termcap(5) for terminal control; can be "require"d.
238 # Today most environments ship a termcap(5) that in fact is part of
239 # terminfo(5), and acts as a converting wrapper for this library.
240 # To avoid this redundancy we also support terminfo(5), and use it
241 # instead if we find it (assuming that termcap(5) is a stub, then).
242 # Note that terminfo(5) offers access to more key sequences, e.g.,
243 # kLFT5, for which no termcap(5) entry exists.
244 # terminfo(5) support can (thus) be "require"d.
245 OPT_TERMCAP=yes
246 OPT_TERMCAP_PREFER_TERMINFO=yes
248 # Enable the `errors' command; S-nail is a console-based application and
249 # thus errors may fly by pretty fast as other operations are in
250 # progress; or $PAGERs are started and clear errors off the screen.  If
251 # enabled errors are duplicated as they happen and the `errors' command
252 # will show them when asked to.
253 OPT_ERRORS=yes
255 # Interaction with a spam email filter is possible.
256 # Refer to all commands and variables with a "spam" prefix, and
257 # see the manual example section "Handling spam".
258 # . OPT_SPAM_SPAMC:
259 #   Support for interaction with spamassassin(1)s spamc(1).
260 # . [Obsolete] OPT_SPAM_SPAMD:
261 #   Direct communication with spamassassin(1)s spamd(1).
262 #   Needs unix(4) domain sockets (checked).  Can be "require"d.
263 # . OPT_SPAM_FILTER:
264 #   Generic filter hook which can be used with e.g. bogofilter(1)
265 #   and sylfilter(1): see documentation for the *spam-filter-**
266 #   variables for expected application behaviour.
267 OPT_SPAM_SPAMC=no
268 OPT_SPAM_SPAMD=no
269 OPT_SPAM_FILTER=yes
271 # If given an optional argument the `help' command will print a help
272 # string only for the mentioned command; those strings take up space and
273 # so one may disable this feature.
274 OPT_DOCSTRINGS=yes
276 # A simple line-based quoting mechanism can be made available via the
277 # *quote-fold* mechanism.  This will be turned off automatically if the
278 # required character classification is not available on the host.
279 # Can be "require"d.
280 # TODO shouldn't wrap lines when only WS or a NL-escaping \ follows
281 OPT_QUOTE_FOLD=yes
283 # We do have a very primitive HTML tagsoup filter which can be used to
284 # convert HTML to plain text for display purposes.  If enabled it'll be
285 # used for all MIME types which have the @h@ or @H@ type markers (more
286 # on this in the manual section "The mime.types FILES").  And which
287 # don't have any user defined MIME type handler, of course.
288 OPT_FILTER_HTML_TAGSOUP=yes
290 # A simple form of coloured output can optionally be produced.
291 OPT_COLOUR=yes
293 # File dotlocking is performed for "system mailbox" (%[USER] and
294 # %:ANYFILE) MBOX files: when synchronizing any such FILE a FILE.lock
295 # file will be created in the directory of FILE, for the duration of the
296 # synchronization.
297 # Set $OPT_DOTLOCK to support this traditional mail spool file locking.
298 # $VAL_MAIL(s) where normal system mailboxes reside are usually not
299 # writable by normal users, except that a user may read and write his
300 # own mailbox.  But this means that a program run by the user cannot
301 # create a .lock file!  The solution is to install a privilege-separated
302 # mini-program that has the sole purpose and functionality of managing
303 # the dotlock file in such situations -- and only then, as a last
304 # ressort.  With it dotlock files can be created for any mailbox for
305 # which the invoking user has read (or read-write) permissions, and
306 # under the UID and GID of the mailbox itself!  We call it -privsep.
307 # $OPT_DOTLOCK can be "require"d.
308 OPT_DOTLOCK=yes
310 ##  --  >8  --  8<  --  ##
311 ## Normal users should not need to read any further
313 ## PATHS AND PROGRAMS, DEVELOPMENT ##
315 # To ease the life of forkers and packagers "our" name can be changed.
316 # The name is build by concatenating $VAL_SID and $VAL_NAIL, i.e.,
317 # $(VAL_SID)$(VAL_NAIL).  Note that the final string must be longer than
318 # tww characters and may not contain any whitespace.
319 VAL_SID=s-
320 VAL_NAIL=nail
322 # The name of the exemplary resource template.
323 # Note 1: not overwritten by "make install" if yet existent!
324 VAL_SYSCONFRC="${VAL_SID}${VAL_NAIL}.rc"
326 ## FEATURE SET, DEVELOPMENT ##
328 # Use debug compiler flags, enable some additional commands and code
329 # assertions.  Note that setting this also enables our own memory
330 # canaries, which require a rather large amount of runtime memory, and
331 # forcefully disables alloca(3) stack memory usage (see $OPT_NOALLOCA
332 # below), so as to be able to track usage of "stack memory" via our
333 # memory canaries.
334 OPT_DEBUG=no
336 # Experimental code etc.
337 # Note: this will be forcefully set (again) if $OPT_DEBUG=yes.
338 OPT_DEVEL=no
340 # We use the crypto libraries' MD5 implementation if possible, unless..
341 OPT_NOEXTMD5=no
343 # The codebase makes a lot of use of alloca(3), and this will remain
344 # since S-nail will continue to be compliant to ISO C89, which has no
345 # variable ("flexible", sigh) arrays, etc.  For testing purposes it is
346 # however nice to use the much slower normal S-nail heap memory
347 # allocator instead.
348 # Note: this will be forcefully set (again) if $OPT_DEBUG=yes.
349 OPT_NOALLOCA="${OPT_DEBUG}"
351 # If $OPT_DEBUG is true we'll use a simple memory wrapper with
352 # canaries.  This interferes with memory debuggers like valgrind(1) or
353 # the LLVM -fsanitize stuff.  Enable this to not use our wrapper.
354 OPT_NOMEMDBG=no
356 # Our functions are instrumented with Not-Yet-Dead chirps, which print
357 # a function call trace when the program crashes.  Whereas NYD will be
358 # used automatically when either of $OPT_DEBUG and $OPT_DEVEL is
359 # defined, an extended level of NYD is compiled in only on explicit
360 # request.
361 # TODO Separation in between NYD and NYD2 not yet fully done.
362 OPT_NYD2=no
364 # With $OPT_AUTOCC we will use stack protector guards shall the
365 # detected compiler support them; this goes in line with our own (heap)
366 # memory canaries and will detect buffer overflows.  It is usually only
367 # useful during development, i.e., in a debug environment that tests all
368 # aspects of a program.
369 OPT_FORCED_STACKPROT=`\
370    if feat_yes DEVEL || feat_yes DEBUG; then \
371       echo yes;\
372    else \
373       echo no;\
374    fi`
376 # vim:set tw=72: s-it-mode