.mailmap: (sigh..)
[s-mailx.git] / mk-conf.sh
blob09add4262971593521ca5b6f82713b94cc25227e
1 #!/bin/sh -
2 #@ Please see `INSTALL' and `conf.rc' instead.
4 LC_ALL=C
5 export LC_ALL
7 # Predefined CONFIG= urations take precedence over anything else
8 if [ -n "${CONFIG}" ]; then
9 case ${CONFIG} in
10 MINIMAL)
11 WANT_SOCKETS=0
12 WANT_IDNA=0
13 WANT_READLINE=0 WANT_EDITLINE=0 WANT_NCL=0
14 WANT_IMAP_SEARCH=0
15 WANT_REGEX=0
16 WANT_SPAM=0
17 WANT_DOCSTRINGS=0
18 WANT_QUOTE_FOLD=0
19 WANT_COLOUR=0
21 MEDIUM)
22 WANT_SOCKETS=0
23 WANT_IDNA=0
24 WANT_READLINE=0 WANT_EDITLINE=0
25 WANT_IMAP_SEARCH=0
26 WANT_SPAM=0
27 WANT_QUOTE_FOLD=0
28 WANT_COLOUR=0
30 NETSEND)
31 WANT_IMAP=0
32 WANT_POP3=0
33 WANT_READLINE=0 WANT_EDITLINE=0
34 WANT_IMAP_SEARCH=0
35 WANT_SPAM=0
36 WANT_QUOTE_FOLD=0
37 WANT_COLOUR=0
40 echo >&2 "Unknown CONFIG= setting: ${CONFIG}"
41 echo >&2 'Possible values: MINIMAL, MEDIUM, NETSEND'
42 exit 1
43 esac
46 # Inter-relationships
47 option_update() {
48 if nwantfeat SOCKETS; then
49 WANT_IPV6=0 WANT_SSL=0
50 WANT_IMAP=0 WANT_GSSAPI=0 WANT_POP3=0 WANT_SMTP=0
52 if nwantfeat IMAP && nwantfeat POP3 && nwantfeat SMTP; then
53 WANT_SOCKETS=0 WANT_IPV6=0 WANT_SSL=0
55 if nwantfeat IMAP; then
56 WANT_GSSAPI=0
58 # If we don't need MD5 except for producing boundary and message-id strings,
59 # leave it off, plain old srand(3) should be enough for that purpose.
60 if nwantfeat SOCKETS; then
61 WANT_MD5=0
63 if wantfeat DEBUG; then
64 WANT_NOALLOCA=1
68 # Check out compiler ($CC) and -flags ($CFLAGS)
69 compiler_flags() {
70 i=`uname -s`
71 _CFLAGS=
73 # $CC is overwritten when empty or a default "cc", even without WANT_AUTOCC
74 optim= dbgoptim=
75 if [ -z "${CC}" ] || [ "${CC}" = cc ]; then
76 _CFLAGS=
77 if { CC="`command -v clang`"; }; then
79 elif { CC="`command -v gcc`"; }; then
81 elif { CC="`command -v c89`"; }; then
82 [ "${i}" = UnixWare ] && _CFLAGS=-v optim=-O dbgoptim=
83 elif { CC="`command -v c99`"; }; then
85 else
86 echo >&2 'ERROR'
87 echo >&2 ' I cannot find a compiler!'
88 echo >&2 ' Neither of clang(1), gcc(1), c89(1) and c99(1).'
89 echo >&2 ' Please set the CC environment variable, maybe CFLAGS also.'
90 exit 1
93 export CC
95 ccver=`${CC} --version 2>/dev/null`
96 stackprot=no
97 if { i=$ccver; echo "${i}"; } | ${grep} -q -i -e gcc -e clang; then
98 #if echo "${i}" | ${grep} -q -i -e gcc -e 'clang version 1'; then
99 optim=-O2 dbgoptim=-O
100 stackprot=yes
101 _CFLAGS='-std=c89'
102 _CFLAGS="${_CFLAGS} -Wall -Wextra -pedantic"
103 _CFLAGS="${_CFLAGS} -fno-unwind-tables -fno-asynchronous-unwind-tables"
104 _CFLAGS="${_CFLAGS} -fstrict-aliasing"
105 _CFLAGS="${_CFLAGS} -Wbad-function-cast -Wcast-align -Wcast-qual"
106 _CFLAGS="${_CFLAGS} -Winit-self -Wmissing-prototypes"
107 _CFLAGS="${_CFLAGS} -Wshadow -Wunused -Wwrite-strings"
108 if { i=$ccver; echo "${i}"; } | ${grep} -q -e 'clang version 1'; then
110 else
111 _CFLAGS="${_CFLAGS} -fstrict-overflow -Wstrict-overflow=5"
112 if wantfeat AMALGAMATION && nwantfeat DEBUG; then
113 _CFLAGS="${_CFLAGS} -Wno-unused-function"
115 if { i=$ccver; echo "${i}"; } | ${grep} -q -i -e clang; then
116 _CFLAGS="${_CFLAGS} -Wno-unused-result" # TODO handle the right way
119 if wantfeat AMALGAMATION; then
120 _CFLAGS="${_CFLAGS} -pipe"
122 _CFLAGS="${_CFLAGS} -Wno-long-long" # ISO C89 has no 'long long'...
123 # elif { i=$ccver; echo "${i}"; } | ${grep} -q -i -e clang; then
124 # stackprot=yes
125 # optim=-O3 dbgoptim=-O
126 # _CFLAGS='-std=c89 -g -Weverything -Wno-long-long'
127 # if wantfeat AMALGAMATION; then
128 # _CFLAGS="${_CFLAGS} -pipe"
129 # fi
130 elif [ -z "${optim}" ]; then
131 optim=-O1 dbgoptim=-O
134 if nwantfeat DEBUG; then
135 _CFLAGS="${optim} -DNDEBUG ${_CFLAGS}"
136 else
137 _CFLAGS="${dbgoptim} -g -ftrapv ${_CFLAGS}";
138 if [ "${stackprot}" = yes ]; then
139 _CFLAGS="${_CFLAGS} -fstack-protector-all "
140 _CFLAGS="${_CFLAGS} -Wstack-protector -D_FORTIFY_SOURCE=2"
143 _CFLAGS="${_CFLAGS} ${ADDCFLAGS}"
144 # XXX -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack: need detection
145 _LDFLAGS="${_LDFLAGS} ${ADDLDFLAGS}" # XXX -Wl,--sort-common,[-O1]
146 export _CFLAGS _LDFLAGS
148 # $CFLAGS and $LDFLAGS are only overwritten if explicitly wanted
149 if wantfeat AUTOCC; then
150 CFLAGS=$_CFLAGS
151 LDFLAGS=$_LDFLAGS
152 export CFLAGS LDFLAGS
156 ## -- >8 -- 8< -- ##
158 ## Notes:
159 ## - Heirloom sh(1) (and same origin) have problems with ': >' redirection,
160 ## so use "printf '' >" instead
161 ## - Heirloom sh(1) and maybe more execute loops with redirection in a subshell
162 ## (but don't export eval's from within), therefore we need to (re)include
163 ## variable assignments at toplevel instead (via reading temporary files)
165 ## First of all, create new configuration and check wether it changed ##
167 conf=./conf.rc
168 lst=./config.lst
169 h=./config.h
170 mk=./mk.mk
172 newlst=./config.lst-new
173 newmk=./config.mk-new
174 newh=./config.h-new
175 tmp0=___tmp
176 tmp=./${tmp0}1$$
178 # We need some standard utilities
179 unset -f command
180 check_tool() {
181 n=$1 i=$2 opt=${3:-0}
182 if type "${i}" >/dev/null 2>&1; then
183 eval ${n}=${i}
184 return 1
186 if [ ${opt} -eq 0 ]; then
187 echo >&2 "ERROR: no trace of the utility \`${n}'"
188 exit 1
190 return 0
193 # Check those tools right now that we need before including ${conf}
194 check_tool rm "${rm:-`command -v rm`}"
195 check_tool sed "${sed:-`command -v sed`}"
197 # Only incorporate what wasn't overwritten from command line / CONFIG
198 trap "${rm} -f ${tmp}; exit" 1 2 15
199 trap "${rm} -f ${tmp}" 0
200 ${rm} -f ${tmp}
202 < ${conf} ${sed} -e '/^[ \t]*#/d' -e '/^$/d' -e 's/[ \t]*$//' |
203 while read line; do
204 i=`echo ${line} | ${sed} -e 's/=.*$//'`
205 eval j=\$${i} jx=\${${i}+x}
206 if [ -n "${j}" ] || [ "${jx}" = x ]; then
207 line="${i}=\"${j}\""
209 echo ${line}
210 done > ${tmp}
211 . ./${tmp}
213 check_tool awk "${awk:-`command -v awk`}"
214 check_tool cat "${cat:-`command -v cat`}"
215 check_tool chmod "${chmod:-`command -v chmod`}"
216 check_tool cp "${cp:-`command -v cp`}"
217 check_tool cmp "${cmp:-`command -v cmp`}"
218 check_tool grep "${grep:-`command -v grep`}"
219 check_tool mkdir "${mkdir:-`command -v mkdir`}"
220 check_tool mv "${mv:-`command -v mv`}"
221 # rm(1), sed(1) above
222 check_tool tee "${tee:-`command -v tee`}"
224 check_tool make "${MAKE:-`command -v make`}"
225 check_tool strip "${STRIP:-`command -v strip`}" 1
226 HAVE_STRIP=${?}
228 wantfeat() {
229 eval i=\$WANT_${1}
230 [ "${i}" = "1" ]
232 nwantfeat() {
233 eval i=\$WANT_${1}
234 [ "${i}" != "1" ]
237 option_update
239 # (No function since some shells loose non-exported variables in traps)
240 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}; exit" 1 2 15
241 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}" 0
242 ${rm} -f ${newlst} ${newmk} ${newh}
244 # (Could: use FD redirection, add eval(1) and don't re-'. ./${newlst}')
245 while read line; do
246 i=`echo ${line} | ${sed} -e 's/=.*$//'`
247 eval j=\$${i}
248 if [ -z "${j}" ] || [ "${j}" = 0 ]; then
249 printf "/*#define ${i}*/\n" >> ${newh}
250 elif [ "${j}" = 1 ]; then
251 printf "#define ${i}\n" >> ${newh}
252 else
253 printf "#define ${i} \"${j}\"\n" >> ${newh}
255 printf "${i} = ${j}\n" >> ${newmk}
256 printf "${i}=\"${j}\"\n"
257 done < ${tmp} > ${newlst}
258 . ./${newlst}
260 printf "#define UAGENT \"${SID}${NAIL}\"\n" >> ${newh}
261 printf "UAGENT = ${SID}${NAIL}\n" >> ${newmk}
263 compiler_flags
265 printf "CC = ${CC}\n" >> ${newmk}
266 printf "_CFLAGS = ${_CFLAGS}\nCFLAGS = ${CFLAGS}\n" >> ${newmk}
267 printf "_LDFLAGS = ${_LDFLAGS}\nLDFLAGS = ${LDFLAGS}\n" >> ${newmk}
268 printf "AWK = ${awk}\nCMP = ${cmp}\nCHMOD = ${chmod}\nCP = ${cp}\n" >> ${newmk}
269 printf "GREP = ${grep}\nMKDIR = ${mkdir}\nRM = ${rm}\nSED = ${sed}\n" \
270 >> ${newmk}
271 printf "STRIP = ${strip}\nHAVE_STRIP = ${HAVE_STRIP}\n" >> ${newmk}
272 # (We include the cc(1)/ld(1) environment only for update detection..)
273 printf "CC=\"${CC}\"\n" >> ${newlst}
274 printf "_CFLAGS=\"${_CFLAGS}\"\nCFLAGS=\"${CFLAGS}\"\n" >> ${newlst}
275 printf "_LDFLAGS=\"${_LDFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n" >> ${newlst}
276 printf "AWK=${awk}\nCMP=${cmp}\nCHMOD=${chmod}\nCP=${cp}\n" >> ${newlst}
277 printf "GREP=${grep}\nMKDIR=${mkdir}\nRM=${rm}\nSED=${sed}\n" >> ${newlst}
278 printf "STRIP=${strip}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newlst}
280 if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
281 exit 0
283 [ -f ${lst} ] && echo 'configuration updated..' || echo 'shiny configuration..'
285 ${mv} -f ${newlst} ${lst}
286 ${mv} -f ${newh} ${h}
287 ${mv} -f ${newmk} ${mk}
289 ## Compile and link checking ##
291 tmp2=./${tmp0}2$$
292 tmp3=./${tmp0}3$$
293 log=./config.log
294 lib=./config.lib
295 inc=./config.inc
296 src=./config.c
297 makefile=./config.mk
299 # (No function since some shells loose non-exported variables in traps)
300 trap "${rm} -f ${lst} ${h} ${mk} ${lib} ${inc} ${src} ${makefile}; exit" 1 2 15
301 trap "${rm} -rf ${tmp0}.* ${tmp0}* ${makefile}" 0
303 exec 5>&2 > ${log} 2>&1
304 printf '' > ${lib}
305 printf '' > ${inc}
306 # ${src} is only created if WANT_AMALGAMATION
307 ${rm} -f ${src}
308 ${cat} > ${makefile} << \!
309 .SUFFIXES: .o .c .x .y
310 .c.o:
311 $(CC) $(XINCS) -c $<
312 .c.x:
313 $(CC) $(XINCS) -E $< >$@
315 $(CC) $(XINCS) -o $@ $< $(XLIBS)
316 .y: ;
319 msg() {
320 fmt=$1
322 shift
323 printf "*** ${fmt}\\n" "${@}"
324 printf "${fmt}" "${@}" >&5
327 _check_preface() {
328 variable=$1 topic=$2 define=$3
330 echo '**********'
331 msg "checking ${topic} ... "
332 echo "/* checked ${topic} */" >> ${h}
333 ${rm} -f ${tmp} ${tmp}.o
334 echo '*** test program is'
335 ${tee} ${tmp}.c
336 #echo '*** the preprocessor generates'
337 #${make} -f ${makefile} ${tmp}.x
338 #${cat} ${tmp}.x
339 echo '*** results are'
342 compile_check() {
343 variable=$1 topic=$2 define=$3
345 _check_preface "${variable}" "${topic}" "${define}"
347 if ${make} -f ${makefile} XINCS="${INCS}" ./${tmp}.o &&
348 [ -f ./${tmp}.o ]; then
349 msg "yes\\n"
350 echo "${define}" >> ${h}
351 eval have_${variable}=yes
352 return 0
353 else
354 echo "/* ${define} */" >> ${h}
355 msg "no\\n"
356 eval unset have_${variable}
357 return 1
361 _link_mayrun() {
362 run=$1 variable=$2 topic=$3 define=$4 libs=$5 incs=$6
364 _check_preface "${variable}" "${topic}" "${define}"
366 if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
367 XLIBS="${LIBS} ${libs}" ./${tmp} &&
368 [ -f ./${tmp} ] &&
369 { [ ${run} -eq 0 ] || ./${tmp}; }; then
370 echo "*** adding INCS<${incs}> LIBS<${libs}>"
371 msg "yes\\n"
372 echo "${define}" >> ${h}
373 LIBS="${LIBS} ${libs}"
374 echo "${libs}" >> ${lib}
375 INCS="${INCS} ${incs}"
376 echo "${incs}" >> ${inc}
377 eval have_${variable}=yes
378 return 0
379 else
380 msg "no\\n"
381 echo "/* ${define} */" >> ${h}
382 eval unset have_${variable}
383 return 1
387 link_check() {
388 _link_mayrun 0 "${1}" "${2}" "${3}" "${4}" "${5}"
391 run_check() {
392 _link_mayrun 1 "${1}" "${2}" "${3}" "${4}" "${5}"
395 # Build a basic set of INCS and LIBS according to user environment.
396 # On pkgsrc(7) systems automatically add /usr/pkg/*
397 if [ -n "${C_INCLUDE_PATH}" ]; then
398 i=${IFS}
399 IFS=:
400 set -- ${C_INCLUDE_PATH}
401 IFS=${i}
402 # for i; do -- new in POSIX Issue 7 + TC1
403 for i
405 [ "${i}" = '/usr/pkg/include' ] && continue
406 INCS="${INCS} -I${i}"
407 done
409 [ -d /usr/pkg/include ] && INCS="${INCS} -I/usr/pkg/include"
410 echo "${INCS}" >> ${inc}
412 if [ -n "${LD_LIBRARY_PATH}" ]; then
413 i=${IFS}
414 IFS=:
415 set -- ${LD_LIBRARY_PATH}
416 IFS=${i}
417 # for i; do -- new in POSIX Issue 7 + TC1
418 for i
420 [ "${i}" = '/usr/pkg/lib' ] && continue
421 LIBS="${LIBS} -L${i}"
422 done
424 [ -d /usr/pkg/lib ] && LIBS="${LIBS} -L/usr/pkg/lib"
425 echo "${LIBS}" >> ${lib}
429 # Better set _GNU_SOURCE (if we are on Linux only?); 'surprised it did without
430 echo '#define _GNU_SOURCE' >> ${h}
432 link_check hello 'if a hello world program can be built' << \! || {\
433 echo >&5 'This oooops is most certainly not related to me.';\
434 echo >&5 "Read the file ${log} and check your compiler environment.";\
435 ${rm} -f ${lst} ${h} ${mk};\
436 exit 1;\
438 #include <stdio.h>
440 int main(int argc, char *argv[])
442 (void)argc;
443 (void)argv;
444 puts("hello world");
445 return 0;
449 link_check termios 'for termios.h and tc*() family' << \! || {\
450 echo >&5 'We require termios.h and the tc*() family of functions.';\
451 echo >&5 "That much Unix we indulge ourselfs.";\
452 ${rm} -f ${lst} ${h} ${mk};\
453 exit 1;\
455 #include <termios.h>
456 int main(void)
458 struct termios tios;
459 tcgetattr(0, &tios);
460 tcsetattr(0, TCSADRAIN | TCSAFLUSH, &tios);
461 return 0;
465 link_check setenv 'for setenv()/unsetenv()' '#define HAVE_SETENV' << \!
466 #include <stdlib.h>
467 int main(void)
469 setenv("s-nail", "to be made nifty!", 1);
470 unsetenv("s-nail");
471 return 0;
475 link_check snprintf 'for snprintf()' '#define HAVE_SNPRINTF' << \!
476 #include <stdio.h>
477 int main(void)
479 char b[20];
480 snprintf(b, sizeof b, "%s", "string");
481 return 0;
485 link_check putc_unlocked 'for putc_unlocked()' '#define HAVE_PUTC_UNLOCKED' <<\!
486 #include <stdio.h>
487 int main(void)
489 putc_unlocked('@', stdout);
490 return 0;
494 link_check fchdir 'for fchdir()' '#define HAVE_FCHDIR' << \!
495 #include <unistd.h>
496 int main(void)
498 fchdir(0);
499 return 0;
503 link_check mmap 'for mmap()' '#define HAVE_MMAP' << \!
504 #include <sys/types.h>
505 #include <sys/mman.h>
506 int main(void)
508 mmap(0, 0, 0, 0, 0, 0);
509 return 0;
513 link_check mremap 'for mremap()' '#define HAVE_MREMAP' << \!
514 #include <sys/types.h>
515 #include <sys/mman.h>
516 int main(void)
518 mremap(0, 0, 0, MREMAP_MAYMOVE);
519 return 0;
523 link_check setlocale 'for setlocale()' '#define HAVE_SETLOCALE' << \!
524 #include <locale.h>
525 int main(void)
527 setlocale(LC_ALL, "");
528 return 0;
532 if [ "${have_setlocale}" = yes ]; then
533 link_check c90amend1 'for ISO/IEC 9899:1990/Amendment 1:1995' \
534 '#define HAVE_C90AMEND1' << \!
535 #include <limits.h>
536 #include <stdlib.h>
537 #include <wchar.h>
538 #include <wctype.h>
539 int main(void)
541 char mbb[MB_LEN_MAX + 1];
542 wchar_t wc;
543 iswprint(L'c');
544 towupper(L'c');
545 mbtowc(&wc, "x", 1);
546 mbrtowc(&wc, "x", 1, NULL);
547 (void)wctomb(mbb, wc);
548 return (mblen("\0", 1) == 0);
552 if [ "${have_c90amend1}" = yes ]; then
553 link_check wcwidth 'for wcwidth()' '#define HAVE_WCWIDTH' << \!
554 #include <wchar.h>
555 int main(void)
557 wcwidth(L'c');
558 return 0;
563 link_check nl_langinfo 'for nl_langinfo()' '#define HAVE_NL_LANGINFO' << \!
564 #include <langinfo.h>
565 #include <stdlib.h>
566 int main(void)
568 nl_langinfo(DAY_1);
569 return (nl_langinfo(CODESET) == NULL);
572 fi # have_setlocale
574 link_check mkstemp 'for mkstemp()' '#define HAVE_MKSTEMP' << \!
575 #include <stdlib.h>
576 int main(void)
578 mkstemp("x");
579 return 0;
583 # Note: run_check, thus we also get only the desired implementation...
584 run_check realpath 'for realpath()' '#define HAVE_REALPATH' << \!
585 #include <stdlib.h>
586 int main(void)
588 char *x = realpath(".", NULL), *y = realpath("/", NULL);
589 return (x != NULL && y != NULL) ? 0 : 1;
593 link_check wordexp 'for wordexp()' '#define HAVE_WORDEXP' << \!
594 #include <wordexp.h>
595 int main(void)
597 wordexp((char *)0, (wordexp_t *)0, 0);
598 return 0;
604 if wantfeat DEBUG; then
605 echo '#define HAVE_DEBUG' >> ${h}
608 if wantfeat AMALGAMATION; then
609 echo '#define HAVE_AMALGAMATION' >> ${h}
612 if nwantfeat NOALLOCA; then
613 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
614 # versions of alloca(3) since modern compilers just can't be trusted
615 # not to overoptimize and silently break some code
616 link_check alloca 'for __builtin_alloca()' \
617 '#define HAVE_ALLOCA __builtin_alloca' << \!
618 int main(void)
620 void *vp = __builtin_alloca(1);
621 return (!! vp);
626 if nwantfeat NOGETOPT; then
627 link_check getopt 'for getopt()' '#define HAVE_GETOPT' << \!
628 #include <unistd.h>
629 int main(int argc, char **argv)
631 #if defined __GLIBC__ || defined __linux__
632 Argument and option reordering is not a desired feature.
633 #else
634 getopt(argc, argv, "oPt");
635 #endif
636 return (((long)optarg + optind) & 0x7F);
643 if wantfeat ICONV; then
644 ${cat} > ${tmp2}.c << \!
645 #include <iconv.h>
646 int main(void)
648 iconv_t id;
650 id = iconv_open("foo", "bar");
651 return 0;
654 < ${tmp2}.c link_check iconv 'for iconv functionality' \
655 '#define HAVE_ICONV' ||
656 < ${tmp2}.c link_check iconv \
657 'for iconv functionality in libiconv' \
658 '#define HAVE_ICONV' '-liconv'
659 else
660 echo '/* WANT_ICONV=0 */' >> ${h}
661 fi # wantfeat ICONV
663 if wantfeat SOCKETS; then
664 compile_check arpa_inet_h 'for <arpa/inet.h>' \
665 '#define HAVE_ARPA_INET_H' << \!
666 #include "config.h"
667 #include <sys/types.h>
668 #include <sys/socket.h>
669 #include <netdb.h>
670 #include <netinet/in.h>
671 #include <arpa/inet.h>
674 ${cat} > ${tmp2}.c << \!
675 #include "config.h"
676 #include <sys/types.h>
677 #include <sys/socket.h>
678 #include <netdb.h>
679 #include <netinet/in.h>
680 #ifdef HAVE_ARPA_INET_H
681 #include <arpa/inet.h>
682 #endif
684 int main(void)
686 struct sockaddr s;
687 socket(AF_INET, SOCK_STREAM, 0);
688 connect(0, &s, 0);
689 gethostbyname("foo");
690 return 0;
694 < ${tmp2}.c link_check sockets 'for sockets in libc' \
695 '#define HAVE_SOCKETS' ||
696 < ${tmp2}.c link_check sockets 'for sockets in libnsl' \
697 '#define HAVE_SOCKETS' '-lnsl' ||
698 < ${tmp2}.c link_check sockets \
699 'for sockets in libsocket and libnsl' \
700 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
701 WANT_SOCKETS=0
703 # XXX Shouldn't it be a hard error if there is no socket support, then?
704 option_update
705 else
706 echo '/* WANT_SOCKETS=0 */' >> ${h}
707 fi # wantfeat SOCKETS
709 wantfeat SOCKETS &&
710 link_check setsockopt 'for setsockopt()' '#define HAVE_SETSOCKOPT' << \!
711 #include <sys/socket.h>
712 #include <stdlib.h>
713 int main(void)
715 int sockfd = 3;
716 setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0);
717 return 0;
721 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
722 link_check so_sndtimeo 'for SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
723 #include <sys/socket.h>
724 #include <stdlib.h>
725 int main(void)
727 struct timeval tv;
728 int sockfd = 3;
729 tv.tv_sec = 42;
730 tv.tv_usec = 21;
731 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
732 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
733 return 0;
737 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
738 link_check so_linger 'for SO_LINGER' '#define HAVE_SO_LINGER' << \!
739 #include <sys/socket.h>
740 #include <stdlib.h>
741 int main(void)
743 struct linger li;
744 int sockfd = 3;
745 li.l_onoff = 1;
746 li.l_linger = 42;
747 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
748 return 0;
752 if wantfeat IPV6; then
753 link_check ipv6 'for IPv6 functionality' '#define HAVE_IPV6' << \!
754 #include "config.h"
755 #include <sys/types.h>
756 #include <sys/socket.h>
757 #include <netdb.h>
758 #include <netinet/in.h>
759 #ifdef HAVE_ARPA_INET_H
760 #include <arpa/inet.h>
761 #endif
763 int main(void)
765 struct addrinfo a, *ap;
766 getaddrinfo("foo", "0", &a, &ap);
767 return 0;
770 else
771 echo '/* WANT_IPV6=0 */' >> ${h}
772 fi # wantfeat IPV6
774 if wantfeat IMAP; then
775 echo '#define HAVE_IMAP' >> ${h}
776 else
777 echo '/* WANT_IMAP=0 */' >> ${h}
780 if wantfeat POP3; then
781 echo '#define HAVE_POP3' >> ${h}
782 else
783 echo '/* WANT_POP3=0 */' >> ${h}
786 if wantfeat SMTP; then
787 echo '#define HAVE_SMTP' >> ${h}
788 else
789 echo '/* WANT_SMTP=0 */' >> ${h}
792 if wantfeat SSL; then
793 link_check openssl 'for sufficiently recent OpenSSL' \
794 '#define HAVE_SSL
795 #define HAVE_OPENSSL' '-lssl -lcrypto' << \!
796 #include <openssl/ssl.h>
797 #include <openssl/err.h>
798 #include <openssl/x509v3.h>
799 #include <openssl/x509.h>
800 #include <openssl/rand.h>
802 #if defined OPENSSL_NO_SSL2 && defined OPENSSL_NO_SSL3 &&\
803 defined OPENSSL_NO_TLS1
804 # error We need one of (SSLv2 and) SSLv3 and TLS1.
805 #endif
807 int main(void)
809 SSLv23_client_method();
810 #ifndef OPENSSL_NO_SSL3
811 SSLv3_client_method();
812 #endif
813 #ifndef OPENSSL_NO_TLS1
814 TLSv1_client_method();
815 # ifdef TLS1_1_VERSION
816 TLSv1_1_client_method();
817 # endif
818 # ifdef TLS1_2_VERSION
819 TLSv1_2_client_method();
820 # endif
821 #endif
822 PEM_read_PrivateKey(0, 0, 0, 0);
823 return 0;
827 if [ "${have_openssl}" = 'yes' ]; then
828 compile_check stack_of 'for OpenSSL STACK_OF()' \
829 '#define HAVE_STACK_OF' << \!
830 #include <openssl/ssl.h>
831 #include <openssl/err.h>
832 #include <openssl/x509v3.h>
833 #include <openssl/x509.h>
834 #include <openssl/rand.h>
836 int main(void)
838 STACK_OF(GENERAL_NAME) *gens = NULL;
839 printf("%p", gens); /* to make it used */
840 return 0;
844 if wantfeat MD5; then
845 run_check openssl_md5 'for MD5 digest in OpenSSL' \
846 '#define HAVE_OPENSSL_MD5' << \!
847 #include <string.h>
848 #include <openssl/md5.h>
850 int main(void)
852 char const dat[] = "abrakadabrafidibus";
853 char dig[16], hex[16 * 2];
854 MD5_CTX ctx;
855 size_t i, j;
857 memset(dig, 0, sizeof(dig));
858 memset(hex, 0, sizeof(hex));
859 MD5_Init(&ctx);
860 MD5_Update(&ctx, dat, sizeof(dat) - 1);
861 MD5_Final(dig, &ctx);
863 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
864 for (i = 0; i < sizeof(hex) / 2; i++) {
865 j = i << 1;
866 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
867 hex[++j] = hexchar(dig[i] & 0x0f);
869 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
872 fi # wantfeat MD5
874 else
875 echo '/* WANT_SSL=0 */' >> ${h}
876 fi # wantfeat SSL
878 if wantfeat GSSAPI; then
879 ${cat} > ${tmp2}.c << \!
880 #include <gssapi/gssapi.h>
882 int main(void)
884 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
885 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
886 return 0;
889 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
891 if command -v krb5-config >/dev/null 2>&1; then
892 i=`command -v krb5-config`
893 GSSAPI_LIBS="`CFLAGS= ${i} --libs gssapi`"
894 GSSAPI_INCS="`CFLAGS= ${i} --cflags`"
895 i='for GSSAPI via krb5-config(1)'
896 else
897 GSSAPI_LIBS='-lgssapi'
898 GSSAPI_INCS=
899 i='for GSSAPI in gssapi/gssapi.h, libgssapi'
901 < ${tmp2}.c link_check gssapi \
902 "${i}" '#define HAVE_GSSAPI' \
903 "${GSSAPI_LIBS}" "${GSSAPI_INCS}" ||\
904 < ${tmp3}.c link_check gssapi \
905 'for GSSAPI in gssapi.h, libgssapi' \
906 '#define HAVE_GSSAPI
907 #define GSSAPI_REG_INCLUDE' \
908 '-lgssapi' ||\
909 < ${tmp2}.c link_check gssapi 'for GSSAPI in libgssapi_krb5' \
910 '#define HAVE_GSSAPI' \
911 '-lgssapi_krb5' ||\
912 < ${tmp3}.c link_check gssapi \
913 'for GSSAPI in libgssapi, OpenBSD-style (pre 5.3)' \
914 '#define HAVE_GSSAPI
915 #define GSSAPI_REG_INCLUDE' \
916 '-lgssapi -lkrb5 -lcrypto' \
917 '-I/usr/include/kerberosV' ||\
918 < ${tmp2}.c link_check gssapi 'for GSSAPI in libgss' \
919 '#define HAVE_GSSAPI' \
920 '-lgss' ||\
921 link_check gssapi 'for GSSAPI in libgssapi_krb5, old-style' \
922 '#define HAVE_GSSAPI
923 #define GSSAPI_OLD_STYLE' \
924 '-lgssapi_krb5' << \!
925 #include <gssapi/gssapi.h>
926 #include <gssapi/gssapi_generic.h>
928 int main(void)
930 gss_import_name(0, 0, gss_nt_service_name, 0);
931 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
932 return 0;
935 else
936 echo '/* WANT_GSSAPI=0 */' >> ${h}
937 fi # wantfeat GSSAPI
939 if wantfeat IDNA; then
940 link_check idna 'for GNU Libidn' '#define HAVE_IDNA' '-lidn' << \!
941 #include <idna.h>
942 #include <idn-free.h>
943 #include <stringprep.h>
944 int main(void)
946 char *utf8, *idna_ascii, *idna_utf8;
947 utf8 = stringprep_locale_to_utf8("does.this.work");
948 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
949 != IDNA_SUCCESS)
950 return 1;
951 idn_free(idna_ascii);
952 /* (Rather link check only here) */
953 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
954 return 0;
957 else
958 echo '/* WANT_IDNA=0 */' >> ${h}
961 if wantfeat REGEX; then
962 link_check regex 'for regular expressions' '#define HAVE_REGEX' << \!
963 #include <regex.h>
964 #include <stdlib.h>
965 int main(void)
967 int status;
968 regex_t re;
969 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
970 return 1;
971 status = regexec(&re, "plan9", 0,NULL, 0);
972 regfree(&re);
973 return !(status == REG_NOMATCH);
976 else
977 echo '/* WANT_REGEX=0 */' >> ${h}
980 if wantfeat READLINE; then
981 __edrdlib() {
982 link_check readline "for readline(3) (${1})" \
983 '#define HAVE_READLINE' "${1}" << \!
984 #include <stdio.h>
985 #include <readline/history.h>
986 #include <readline/readline.h>
987 int main(void)
989 char *rl;
990 HISTORY_STATE *hs;
991 HIST_ENTRY **he;
992 int i;
993 using_history();
994 read_history("");
995 stifle_history(242);
996 rl = readline("Enter a line:");
997 if (rl && *rl)
998 add_history(rl);
999 write_history("");
1000 rl_extend_line_buffer(10);
1001 rl_point = rl_end = 10;
1002 rl_pre_input_hook = (rl_hook_func_t*)NULL;
1003 rl_forced_update_display();
1004 clear_history();
1005 hs = history_get_history_state();
1006 i = hs->length;
1007 he = history_list();
1008 if (i > 0)
1009 rl = he[0]->line;
1010 rl_free_line_state();
1011 rl_cleanup_after_signal();
1012 rl_reset_after_signal();
1013 return 0;
1018 __edrdlib -lreadline ||
1019 __edrdlib '-lreadline -ltermcap'
1020 [ -n "${have_readline}" ] && WANT_TABEXPAND=1
1023 if wantfeat EDITLINE && [ -z "${have_readline}" ]; then
1024 __edlib() {
1025 link_check editline "for editline(3) (${1})" \
1026 '#define HAVE_EDITLINE' "${1}" << \!
1027 #include <histedit.h>
1028 static char * getprompt(void) { return (char*)"ok"; }
1029 int main(void)
1031 EditLine *el_el = el_init("TEST", stdin, stdout, stderr);
1032 HistEvent he;
1033 History *el_hcom = history_init();
1034 history(el_hcom, &he, H_SETSIZE, 242);
1035 el_set(el_el, EL_SIGNAL, 0);
1036 el_set(el_el, EL_TERMINAL, NULL);
1037 el_set(el_el, EL_HIST, &history, el_hcom);
1038 el_set(el_el, EL_EDITOR, "emacs");
1039 el_set(el_el, EL_PROMPT, &getprompt);
1040 el_source(el_el, NULL);
1041 history(el_hcom, &he, H_GETSIZE);
1042 history(el_hcom, &he, H_CLEAR);
1043 el_end(el_el);
1044 /* TODO add loader and addfn checks */
1045 history_end(el_hcom);
1046 return 0;
1051 __edlib -ledit ||
1052 __edlib '-ledit -ltermcap'
1053 [ -n "${have_editline}" ] && WANT_TABEXPAND=0
1056 if wantfeat NCL && [ -z "${have_editline}" ] && [ -z "${have_readline}" ] &&\
1057 [ -n "${have_c90amend1}" ]; then
1058 have_ncl=1
1059 echo '#define HAVE_NCL' >> ${h}
1060 else
1061 echo '/* WANT_{READLINE,EDITLINE,NCL}=0 */' >> ${h}
1064 # Generic have-a-command-line-editor switch for those who need it below
1065 if [ -n "${have_ncl}" ] || [ -n "${have_editline}" ] ||\
1066 [ -n "${have_readline}" ]; then
1067 have_cle=1
1070 if [ -n "${have_cle}" ] && wantfeat TABEXPAND; then
1071 echo '#define HAVE_TABEXPAND' >> ${h}
1072 else
1073 echo '/* WANT_TABEXPAND=0 */' >> ${h}
1076 if [ -n "${have_cle}" ] && wantfeat HISTORY; then
1077 echo '#define HAVE_HISTORY' >> ${h}
1078 else
1079 echo '/* WANT_HISTORY=0 */' >> ${h}
1082 if wantfeat SPAM; then
1083 echo '#define HAVE_SPAM' >> ${h}
1084 if command -v spamc >/dev/null 2>&1; then
1085 echo "#define SPAMC_PATH \"`command -v spamc`\"" >> ${h}
1087 else
1088 echo '/* WANT_SPAM=0 */' >> ${h}
1091 if wantfeat DOCSTRINGS; then
1092 echo '#define HAVE_DOCSTRINGS' >> ${h}
1093 else
1094 echo '/* WANT_DOCSTRINGS=0 */' >> ${h}
1097 if wantfeat QUOTE_FOLD &&\
1098 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
1099 echo '#define HAVE_QUOTE_FOLD' >> ${h}
1100 else
1101 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
1104 if wantfeat COLOUR; then
1105 echo '#define HAVE_COLOUR' >> ${h}
1106 else
1107 echo '/* WANT_COLOUR=0 */' >> ${h}
1110 if wantfeat IMAP_SEARCH; then
1111 echo '#define HAVE_IMAP_SEARCH' >> ${h}
1112 else
1113 echo '/* WANT_IMAP_SEARCH=0 */' >> ${h}
1116 if wantfeat MD5; then
1117 echo '#define HAVE_MD5' >> ${h}
1118 else
1119 echo '/* WANT_MD5=0 */' >> ${h}
1122 ## Summarizing ##
1124 # Since we cat(1) the content of those to cc/"ld", convert them to single line
1125 squeeze_em() {
1126 < "${1}" > "${2}" ${awk} \
1127 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1129 ${rm} -f ${tmp}
1130 squeeze_em ${inc} ${tmp}
1131 ${mv} ${tmp} ${inc}
1132 squeeze_em ${lib} ${tmp}
1133 ${mv} ${tmp} ${lib}
1135 # config.h
1136 ${mv} ${h} ${tmp}
1137 printf '#ifndef _CONFIG_H\n# define _CONFIG_H\n' > ${h}
1138 ${cat} ${tmp} >> ${h}
1140 printf '\n/* The "feature string", for "simplicity" and lex.c */\n' >> ${h}
1141 printf '#ifdef _MAIN_SOURCE\n' >> ${h}
1142 printf '# ifdef HAVE_AMALGAMATION\nstatic\n# endif\n' >> ${h}
1143 printf 'char const features[] = "MIME"\n' >> ${h}
1144 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
1145 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
1146 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
1147 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
1148 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
1149 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
1150 printf '# ifdef HAVE_IPV6\n ",IPv6"\n# endif\n' >> ${h}
1151 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TSL"\n# endif\n' >> ${h}
1152 printf '# ifdef HAVE_IMAP\n ",IMAP"\n# endif\n' >> ${h}
1153 printf '# ifdef HAVE_GSSAPI\n ",GSSAPI"\n# endif\n' >> ${h}
1154 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
1155 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
1156 printf '# ifdef HAVE_SPAM\n ",SPAM"\n# endif\n' >> ${h}
1157 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
1158 printf '# ifdef HAVE_IMAP_SEARCH\n ",IMAP-searches"\n# endif\n' >> ${h}
1159 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
1160 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
1161 printf '# ifdef HAVE_EDITLINE\n ",EDITLINE"\n# endif\n' >> ${h}
1162 printf '# ifdef HAVE_NCL\n ",NCL"\n# endif\n' >> ${h}
1163 printf '# ifdef HAVE_TABEXPAND\n ",TABEXPAND"\n# endif\n' >> ${h}
1164 printf '# ifdef HAVE_HISTORY\n ",HISTORY MANAGEMENT"\n# endif\n' >> ${h}
1165 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
1166 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
1167 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
1168 printf ';\n#endif /* _MAIN_SOURCE */\n' >> ${h}
1170 printf '#endif /* _CONFIG_H */\n' >> ${h}
1171 ${rm} -f ${tmp}
1173 # Create the real mk.mk
1174 ${rm} -rf ${tmp0}.* ${tmp0}*
1175 printf 'OBJ_SRC = ' >> ${mk}
1176 if nwantfeat AMALGAMATION; then
1177 echo *.c >> ${mk}
1178 echo 'OBJ_DEP =' >> ${mk}
1179 else
1180 j=`echo "${src}" | sed 's/^.\///'`
1181 echo "${j}" >> ${mk}
1182 printf 'OBJ_DEP = main.c ' >> ${mk}
1183 printf '#define _MAIN_SOURCE\n' >> ${src}
1184 printf '#include "nail.h"\n#include "main.c"\n' >> ${src}
1185 for i in *.c; do
1186 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ]; then
1187 continue
1189 printf "${i} " >> ${mk}
1190 printf "#include \"${i}\"\n" >> ${src}
1191 done
1192 echo >> ${mk}
1195 echo "LIBS = `${cat} ${lib}`" >> ${mk}
1196 echo "INCLUDES = `${cat} ${inc}`" >> ${mk}
1197 echo >> ${mk}
1198 ${cat} ./mk-mk.in >> ${mk}
1200 ## Finished! ##
1202 ${cat} > ${tmp2}.c << \!
1203 #include "config.h"
1204 #ifdef HAVE_NL_LANGINFO
1205 # include <langinfo.h>
1206 #endif
1208 :The following optional features are enabled:
1209 #ifdef HAVE_ICONV
1210 : + Character set conversion using iconv()
1211 #endif
1212 #ifdef HAVE_SETLOCALE
1213 : + Locale support: Printable characters depend on the environment
1214 # ifdef HAVE_C90AMEND1
1215 : + Multibyte character support
1216 # endif
1217 # ifdef HAVE_NL_LANGINFO
1218 : + Automatic detection of terminal character set
1219 # endif
1220 #endif
1221 #ifdef HAVE_SOCKETS
1222 : + Network support
1223 #endif
1224 #ifdef HAVE_IPV6
1225 : + Support for Internet Protocol v6 (IPv6)
1226 #endif
1227 #ifdef HAVE_SSL
1228 # ifdef HAVE_OPENSSL
1229 : + S/MIME and SSL/TLS using OpenSSL
1230 # endif
1231 #endif
1232 #ifdef HAVE_IMAP
1233 : + IMAP protocol
1234 #endif
1235 #ifdef HAVE_GSSAPI
1236 : + IMAP GSSAPI authentication
1237 #endif
1238 #ifdef HAVE_POP3
1239 : + POP3 protocol
1240 #endif
1241 #ifdef HAVE_SMTP
1242 : + SMTP protocol
1243 #endif
1244 #ifdef HAVE_SPAM
1245 : + Interaction with spam filters
1246 #endif
1247 #ifdef HAVE_IDNA
1248 : + IDNA (internationalized domain names for applications) support
1249 #endif
1250 #ifdef HAVE_IMAP_SEARCH
1251 : + IMAP-style search expressions
1252 #endif
1253 #ifdef HAVE_REGEX
1254 : + Regular expression searches
1255 #endif
1256 #if defined HAVE_READLINE || defined HAVE_EDITLINE || defined HAVE_NCL
1257 : + Command line editing
1258 # ifdef HAVE_TABEXPAND
1259 : + + Tabulator expansion
1260 # endif
1261 # ifdef HAVE_HISTORY
1262 : + + History management
1263 # endif
1264 #endif
1265 #ifdef HAVE_QUOTE_FOLD
1266 : + Extended *quote-fold*ing
1267 #endif
1268 #ifdef HAVE_COLOUR
1269 : + Coloured message display (simple)
1270 #endif
1272 :The following optional features are disabled:
1273 #ifndef HAVE_ICONV
1274 : - Character set conversion using iconv()
1275 #endif
1276 #ifndef HAVE_SETLOCALE
1277 : - Locale support: Only ASCII characters are recognized
1278 #endif
1279 # ifndef HAVE_C90AMEND1
1280 : - Multibyte character support
1281 # endif
1282 # ifndef HAVE_NL_LANGINFO
1283 : - Automatic detection of terminal character set
1284 # endif
1285 #ifndef HAVE_SOCKETS
1286 : - Network support
1287 #endif
1288 #ifndef HAVE_IPV6
1289 : - Support for Internet Protocol v6 (IPv6)
1290 #endif
1291 #if !defined HAVE_SSL
1292 : - SSL/TLS (network transport authentication and encryption)
1293 #endif
1294 #ifndef HAVE_IMAP
1295 : - IMAP protocol
1296 #endif
1297 #ifndef HAVE_GSSAPI
1298 : - IMAP GSSAPI authentication
1299 #endif
1300 #ifndef HAVE_POP3
1301 : - POP3 protocol
1302 #endif
1303 #ifndef HAVE_SMTP
1304 : - SMTP protocol
1305 #endif
1306 #ifndef HAVE_SPAM
1307 : - Interaction with spam filters
1308 #endif
1309 #ifndef HAVE_IDNA
1310 : - IDNA (internationalized domain names for applications) support
1311 #endif
1312 #ifndef HAVE_IMAP_SEARCH
1313 : - IMAP-style search expressions
1314 #endif
1315 #ifndef HAVE_REGEX
1316 : - Regular expression searches
1317 #endif
1318 #if !defined HAVE_READLINE && !defined HAVE_EDITLINE && !defined HAVE_NCL
1319 : - Command line editing and history
1320 #endif
1321 #ifndef HAVE_QUOTE_FOLD
1322 : - Extended *quote-fold*ing
1323 #endif
1324 #ifndef HAVE_COLOUR
1325 : - Coloured message display (simple)
1326 #endif
1328 :Remarks:
1329 #ifndef HAVE_SNPRINTF
1330 : . The function snprintf() could not be found. mailx will be compiled to use
1331 : sprintf() instead. This might overflow buffers if input values are larger
1332 : than expected. Use the resulting binary with care or update your system
1333 : environment and start the configuration process again.
1334 #endif
1335 #ifndef HAVE_FCHDIR
1336 : . The function fchdir() could not be found. mailx will be compiled to use
1337 : chdir() instead. This is not a problem unless the current working
1338 : directory of mailx is moved while the IMAP cache is used.
1339 #endif
1340 #ifndef HAVE_GETOPT
1341 : . Using a minimal builtin POSIX-like getopt()
1342 #endif
1343 #ifdef HAVE_DEBUG
1344 : . Debug enabled binary: not meant to be used by end-users: THANKS!
1345 #endif
1349 ${make} -f ${makefile} ${tmp2}.x
1350 < ${tmp2}.x >&5 ${sed} -e '/^[^:]/d; /^$/d; s/^://'
1352 # vim:set fenc=utf-8:s-it-mode