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