run_editor(): also compare size when deciding "has changed"
[s-mailx.git] / mk-conf.sh
blobd781a1c91db1e7f9185d6530295c61ef681a85e8
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
39 MAXIMAL)
40 WANT_GSSAPI=1
43 echo >&2 "Unknown CONFIG= setting: ${CONFIG}"
44 echo >&2 'Possible values: MINIMAL, MEDIUM, NETSEND, MAXIMAL'
45 exit 1
46 esac
49 # Inter-relationships
50 option_update() {
51 if nwantfeat SOCKETS; then
52 WANT_IPV6=0 WANT_SSL=0
53 WANT_IMAP=0 WANT_POP3=0 WANT_SMTP=0 WANT_NETRC=0 WANT_GSSAPI=0
55 if nwantfeat IMAP && nwantfeat POP3 && nwantfeat SMTP; then
56 WANT_SOCKETS=0 WANT_IPV6=0 WANT_SSL=0 WANT_NETRC=0
58 if nwantfeat IMAP && nwantfeat SMTP; then
59 WANT_GSSAPI=0
61 # If we don't need MD5 except for producing boundary and message-id strings,
62 # leave it off, plain old srand(3) should be enough for that purpose.
63 if nwantfeat SOCKETS; then
64 WANT_MD5=0
66 if wantfeat DEBUG; then
67 WANT_NOALLOCA=1 WANT_DEVEL=1
71 # Check out compiler ($CC) and -flags ($CFLAGS)
72 compiler_flags() {
73 # $CC is overwritten when empty or a default "cc", even without WANT_AUTOCC
74 optim= dbgoptim= _CFLAGS=
75 if [ -z "${CC}" ] || [ "${CC}" = cc ]; then
76 if { CC="`command -v clang`"; }; then
78 elif { CC="`command -v gcc`"; }; then
80 elif { CC="`command -v c89`"; }; then
81 [ "`uname -s`" = UnixWare ] && _CFLAGS=-v optim=-O dbgoptim=
82 elif { CC="`command -v c99`"; }; then
84 else
85 echo >&2 'ERROR'
86 echo >&2 ' I cannot find a compiler!'
87 echo >&2 ' Neither of clang(1), gcc(1), c89(1) and c99(1).'
88 echo >&2 ' Please set the CC environment variable, maybe CFLAGS also.'
89 exit 1
92 export CC
94 ccver=`${CC} --version 2>/dev/null`
95 stackprot=no
96 if { i=${ccver}; echo "${i}"; } | ${grep} -q -i -e gcc -e clang; then
97 #if echo "${i}" | ${grep} -q -i -e gcc -e 'clang version 1'; then
98 optim=-O2 dbgoptim=-O
99 stackprot=yes
100 _CFLAGS="${_CFLAGS} -std=c89 -Wall -Wextra -pedantic"
101 _CFLAGS="${_CFLAGS} -fno-unwind-tables -fno-asynchronous-unwind-tables"
102 _CFLAGS="${_CFLAGS} -fstrict-aliasing"
103 _CFLAGS="${_CFLAGS} -Wbad-function-cast -Wcast-align -Wcast-qual"
104 _CFLAGS="${_CFLAGS} -Winit-self -Wmissing-prototypes"
105 _CFLAGS="${_CFLAGS} -Wshadow -Wunused -Wwrite-strings"
106 _CFLAGS="${_CFLAGS} -Wno-long-long" # ISO C89 has no 'long long'...
107 if { i=${ccver}; echo "${i}"; } | ${grep} -q -e 'clang version 1'; then
108 _CFLAGS="${_CFLAGS} -Wstrict-overflow=5"
109 else
110 _CFLAGS="${_CFLAGS} -fstrict-overflow -Wstrict-overflow=5"
111 if wantfeat AMALGAMATION && nwantfeat DEBUG; then
112 _CFLAGS="${_CFLAGS} -Wno-unused-function"
114 if { i=${ccver}; echo "${i}"; } | ${grep} -q -i -e clang; then
115 _CFLAGS="${_CFLAGS} -Wno-unused-result" # TODO handle the right way
118 if wantfeat AMALGAMATION; then
119 _CFLAGS="${_CFLAGS} -pipe"
121 # elif { i=${ccver}; echo "${i}"; } | ${grep} -q -i -e clang; then
122 # optim=-O3 dbgoptim=-O
123 # stackprot=yes
124 # _CFLAGS='-std=c89 -Weverything -Wno-long-long'
125 # if wantfeat AMALGAMATION; then
126 # _CFLAGS="${_CFLAGS} -pipe"
127 # fi
128 elif [ -z "${optim}" ]; then
129 optim=-O1 dbgoptim=-O
132 if nwantfeat DEBUG; then
133 _CFLAGS="${optim} -DNDEBUG ${_CFLAGS}"
134 else
135 _CFLAGS="${dbgoptim} -g ${_CFLAGS}";
136 if [ "${stackprot}" = yes ]; then
137 _CFLAGS="${_CFLAGS} -ftrapv -fstack-protector-all "
138 _CFLAGS="${_CFLAGS} -Wstack-protector -D_FORTIFY_SOURCE=2"
141 _CFLAGS="${_CFLAGS} ${ADDCFLAGS}"
142 # XXX -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack: need detection
143 _LDFLAGS="${_LDFLAGS} ${ADDLDFLAGS}" # XXX -Wl,--sort-common,[-O1]
144 export _CFLAGS _LDFLAGS
146 # $CFLAGS and $LDFLAGS are only overwritten if explicitly wanted
147 if wantfeat AUTOCC; then
148 CFLAGS=$_CFLAGS
149 LDFLAGS=$_LDFLAGS
150 export CFLAGS LDFLAGS
154 ## -- >8 -- 8< -- ##
156 ## Notes:
157 ## - Heirloom sh(1) (and same origin) have problems with ': >' redirection,
158 ## so use "printf '' >" instead
159 ## - Heirloom sh(1) and maybe more execute loops with redirection in a subshell
160 ## (but don't export eval's from within), therefore we need to (re)include
161 ## variable assignments at toplevel instead (via reading temporary files)
163 ## First of all, create new configuration and check wether it changed ##
165 conf=./conf.rc
166 lst=./config.lst
167 h=./config.h
168 mk=./mk.mk
170 newlst=./config.lst-new
171 newmk=./config.mk-new
172 newh=./config.h-new
173 tmp0=___tmp
174 tmp=./${tmp0}1$$
176 # We need some standard utilities
177 unset -f command
178 check_tool() {
179 n=$1 i=$2 opt=${3:-0}
180 if type "${i}" >/dev/null 2>&1; then
181 eval ${n}=${i}
182 return 1
184 if [ ${opt} -eq 0 ]; then
185 echo >&2 "ERROR: no trace of the utility \`${n}'"
186 exit 1
188 return 0
191 # Check those tools right now that we need before including ${conf}
192 check_tool rm "${rm:-`command -v rm`}"
193 check_tool sed "${sed:-`command -v sed`}"
195 # Only incorporate what wasn't overwritten from command line / CONFIG
196 trap "${rm} -f ${tmp}; exit" 1 2 15
197 trap "${rm} -f ${tmp}" 0
198 ${rm} -f ${tmp}
200 < ${conf} ${sed} -e '/^[ \t]*#/d' -e '/^$/d' -e 's/[ \t]*$//' |
201 while read line; do
202 i="`echo ${line} | ${sed} -e 's/=.*$//'`"
203 eval j="\$${i}" jx="\${${i}+x}"
204 if [ -n "${j}" ] || [ "${jx}" = x ]; then
205 line="${i}=\"${j}\""
207 echo ${line}
208 done > ${tmp}
209 . ./${tmp}
211 check_tool awk "${awk:-`command -v awk`}"
212 check_tool cat "${cat:-`command -v cat`}"
213 check_tool chmod "${chmod:-`command -v chmod`}"
214 check_tool cp "${cp:-`command -v cp`}"
215 check_tool cmp "${cmp:-`command -v cmp`}"
216 check_tool grep "${grep:-`command -v grep`}"
217 check_tool mkdir "${mkdir:-`command -v mkdir`}"
218 check_tool mv "${mv:-`command -v mv`}"
219 # rm(1), sed(1) above
220 check_tool tee "${tee:-`command -v tee`}"
222 check_tool make "${MAKE:-`command -v make`}"
223 check_tool strip "${STRIP:-`command -v strip`}" 1
224 HAVE_STRIP=${?}
226 wantfeat() {
227 eval i=\$WANT_${1}
228 [ "${i}" = "1" ]
230 nwantfeat() {
231 eval i=\$WANT_${1}
232 [ "${i}" != "1" ]
235 option_update
237 # (No function since some shells loose non-exported variables in traps)
238 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}; exit" 1 2 15
239 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}" 0
240 ${rm} -f ${newlst} ${newmk} ${newh}
242 # (Could: use FD redirection, add eval(1) and don't re-'. ./${newlst}')
243 while read line; do
244 i=`echo ${line} | ${sed} -e 's/=.*$//'`
245 eval j=\$${i}
246 if [ -z "${j}" ] || [ "${j}" = 0 ]; then
247 printf "/*#define ${i}*/\n" >> ${newh}
248 elif [ "${j}" = 1 ]; then
249 printf "#define ${i}\n" >> ${newh}
250 else
251 printf "#define ${i} \"${j}\"\n" >> ${newh}
253 printf "${i} = ${j}\n" >> ${newmk}
254 printf "${i}=\"${j}\"\n"
255 done < ${tmp} > ${newlst}
256 . ./${newlst}
258 printf "#define UAGENT \"${SID}${NAIL}\"\n" >> ${newh}
259 printf "UAGENT = ${SID}${NAIL}\n" >> ${newmk}
261 compiler_flags
263 printf "CC = ${CC}\n" >> ${newmk}
264 printf "_CFLAGS = ${_CFLAGS}\nCFLAGS = ${CFLAGS}\n" >> ${newmk}
265 printf "_LDFLAGS = ${_LDFLAGS}\nLDFLAGS = ${LDFLAGS}\n" >> ${newmk}
266 printf "AWK = ${awk}\nCMP = ${cmp}\nCHMOD = ${chmod}\nCP = ${cp}\n" >> ${newmk}
267 printf "GREP = ${grep}\nMKDIR = ${mkdir}\nRM = ${rm}\nSED = ${sed}\n" \
268 >> ${newmk}
269 printf "STRIP = ${strip}\nHAVE_STRIP = ${HAVE_STRIP}\n" >> ${newmk}
270 # (We include the cc(1)/ld(1) environment only for update detection..)
271 printf "CC=\"${CC}\"\n" >> ${newlst}
272 printf "_CFLAGS=\"${_CFLAGS}\"\nCFLAGS=\"${CFLAGS}\"\n" >> ${newlst}
273 printf "_LDFLAGS=\"${_LDFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n" >> ${newlst}
274 printf "AWK=${awk}\nCMP=${cmp}\nCHMOD=${chmod}\nCP=${cp}\n" >> ${newlst}
275 printf "GREP=${grep}\nMKDIR=${mkdir}\nRM=${rm}\nSED=${sed}\n" >> ${newlst}
276 printf "STRIP=${strip}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newlst}
278 if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
279 exit 0
281 [ -f ${lst} ] && echo 'configuration updated..' || echo 'shiny configuration..'
283 ${mv} -f ${newlst} ${lst}
284 ${mv} -f ${newh} ${h}
285 ${mv} -f ${newmk} ${mk}
287 ## Compile and link checking ##
289 tmp2=./${tmp0}2$$
290 tmp3=./${tmp0}3$$
291 log=./config.log
292 lib=./config.lib
293 inc=./config.inc
294 src=./config.c
295 makefile=./config.mk
297 # (No function since some shells loose non-exported variables in traps)
298 trap "${rm} -f ${lst} ${h} ${mk} ${lib} ${inc} ${src} ${makefile}; exit" 1 2 15
299 trap "${rm} -rf ${tmp0}.* ${tmp0}* ${makefile}" 0
301 exec 5>&2 > ${log} 2>&1
302 printf '' > ${lib}
303 printf '' > ${inc}
304 # ${src} is only created if WANT_AMALGAMATION
305 ${rm} -f ${src}
306 ${cat} > ${makefile} << \!
307 .SUFFIXES: .o .c .x .y
308 .c.o:
309 $(CC) $(XINCS) -c $<
310 .c.x:
311 $(CC) $(XINCS) -E $< >$@
313 $(CC) $(XINCS) -o $@ $< $(XLIBS)
314 .y: ;
317 msg() {
318 fmt=$1
320 shift
321 printf "*** ${fmt}\\n" "${@}"
322 printf "${fmt}" "${@}" >&5
325 _check_preface() {
326 variable=$1 topic=$2 define=$3
328 echo '**********'
329 msg "checking ${topic} ... "
330 echo "/* checked ${topic} */" >> ${h}
331 ${rm} -f ${tmp} ${tmp}.o
332 echo '*** test program is'
333 ${tee} ${tmp}.c
334 #echo '*** the preprocessor generates'
335 #${make} -f ${makefile} ${tmp}.x
336 #${cat} ${tmp}.x
337 echo '*** results are'
340 compile_check() {
341 variable=$1 topic=$2 define=$3
343 _check_preface "${variable}" "${topic}" "${define}"
345 if ${make} -f ${makefile} XINCS="${INCS}" ./${tmp}.o &&
346 [ -f ./${tmp}.o ]; then
347 msg "yes\\n"
348 echo "${define}" >> ${h}
349 eval have_${variable}=yes
350 return 0
351 else
352 echo "/* ${define} */" >> ${h}
353 msg "no\\n"
354 eval unset have_${variable}
355 return 1
359 _link_mayrun() {
360 run=$1 variable=$2 topic=$3 define=$4 libs=$5 incs=$6
362 _check_preface "${variable}" "${topic}" "${define}"
364 if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
365 XLIBS="${LIBS} ${libs}" ./${tmp} &&
366 [ -f ./${tmp} ] &&
367 { [ ${run} -eq 0 ] || ./${tmp}; }; then
368 echo "*** adding INCS<${incs}> LIBS<${libs}>"
369 msg "yes\\n"
370 echo "${define}" >> ${h}
371 LIBS="${LIBS} ${libs}"
372 echo "${libs}" >> ${lib}
373 INCS="${INCS} ${incs}"
374 echo "${incs}" >> ${inc}
375 eval have_${variable}=yes
376 return 0
377 else
378 msg "no\\n"
379 echo "/* ${define} */" >> ${h}
380 eval unset have_${variable}
381 return 1
385 link_check() {
386 _link_mayrun 0 "${1}" "${2}" "${3}" "${4}" "${5}"
389 run_check() {
390 _link_mayrun 1 "${1}" "${2}" "${3}" "${4}" "${5}"
393 # Build a basic set of INCS and LIBS according to user environment.
394 # On pkgsrc(7) systems automatically add /usr/pkg/*
395 if [ -n "${C_INCLUDE_PATH}" ]; then
396 i=${IFS}
397 IFS=:
398 set -- ${C_INCLUDE_PATH}
399 IFS=${i}
400 # for i; do -- new in POSIX Issue 7 + TC1
401 for i
403 [ "${i}" = '/usr/pkg/include' ] && continue
404 INCS="${INCS} -I${i}"
405 done
407 [ -d /usr/pkg/include ] && INCS="${INCS} -I/usr/pkg/include"
408 echo "${INCS}" >> ${inc}
410 if [ -n "${LD_LIBRARY_PATH}" ]; then
411 i=${IFS}
412 IFS=:
413 set -- ${LD_LIBRARY_PATH}
414 IFS=${i}
415 # for i; do -- new in POSIX Issue 7 + TC1
416 for i
418 [ "${i}" = '/usr/pkg/lib' ] && continue
419 LIBS="${LIBS} -L${i}"
420 done
422 [ -d /usr/pkg/lib ] && LIBS="${LIBS} -L/usr/pkg/lib"
423 echo "${LIBS}" >> ${lib}
427 # Better set _GNU_SOURCE (if we are on Linux only?); 'surprised it did without
428 echo '#define _GNU_SOURCE' >> ${h}
430 if link_check hello 'if a hello world program can be built' << \!
431 #include <stdio.h>
433 int main(int argc, char *argv[])
435 (void)argc;
436 (void)argv;
437 puts("hello world");
438 return 0;
441 then
443 else
444 echo >&5 'This oooops is most certainly not related to me.'
445 echo >&5 "Read the file ${log} and check your compiler environment."
446 ${rm} -f ${lst} ${h} ${mk}
447 exit 1
450 if link_check termios 'for termios.h and tc*() family' << \!
451 #include <termios.h>
452 int main(void)
454 struct termios tios;
455 tcgetattr(0, &tios);
456 tcsetattr(0, TCSADRAIN | TCSAFLUSH, &tios);
457 return 0;
460 then
462 else
463 echo >&5 'We require termios.h and the tc*() family of functions.'
464 echo >&5 "That much Unix we indulge ourselfs."
465 ${rm} -f ${lst} ${h} ${mk}
466 exit 1
469 link_check setenv 'for setenv()/unsetenv()' '#define HAVE_SETENV' << \!
470 #include <stdlib.h>
471 int main(void)
473 setenv("s-nail", "to be made nifty!", 1);
474 unsetenv("s-nail");
475 return 0;
479 link_check snprintf 'for snprintf()' '#define HAVE_SNPRINTF' << \!
480 #include <stdio.h>
481 int main(void)
483 char b[20];
484 snprintf(b, sizeof b, "%s", "string");
485 return 0;
489 link_check putc_unlocked 'for putc_unlocked()' '#define HAVE_PUTC_UNLOCKED' <<\!
490 #include <stdio.h>
491 int main(void)
493 putc_unlocked('@', stdout);
494 return 0;
498 link_check fchdir 'for fchdir()' '#define HAVE_FCHDIR' << \!
499 #include <unistd.h>
500 int main(void)
502 fchdir(0);
503 return 0;
507 link_check pipe2 'for pipe2()' '#define HAVE_PIPE2' << \!
508 #include <fcntl.h>
509 #include <unistd.h>
510 int main(void)
512 int fds[2];
513 pipe2(fds, O_CLOEXEC);
514 return 0;
518 link_check mmap 'for mmap()' '#define HAVE_MMAP' << \!
519 #include <sys/types.h>
520 #include <sys/mman.h>
521 int main(void)
523 mmap(0, 0, 0, 0, 0, 0);
524 return 0;
528 link_check mremap 'for mremap()' '#define HAVE_MREMAP' << \!
529 #include <sys/types.h>
530 #include <sys/mman.h>
531 int main(void)
533 mremap(0, 0, 0, MREMAP_MAYMOVE);
534 return 0;
538 link_check setlocale 'for setlocale()' '#define HAVE_SETLOCALE' << \!
539 #include <locale.h>
540 int main(void)
542 setlocale(LC_ALL, "");
543 return 0;
547 if [ "${have_setlocale}" = yes ]; then
548 link_check c90amend1 'for ISO/IEC 9899:1990/Amendment 1:1995' \
549 '#define HAVE_C90AMEND1' << \!
550 #include <limits.h>
551 #include <stdlib.h>
552 #include <wchar.h>
553 #include <wctype.h>
554 int main(void)
556 char mbb[MB_LEN_MAX + 1];
557 wchar_t wc;
558 iswprint(L'c');
559 towupper(L'c');
560 mbtowc(&wc, "x", 1);
561 mbrtowc(&wc, "x", 1, NULL);
562 (void)wctomb(mbb, wc);
563 return (mblen("\0", 1) == 0);
567 if [ "${have_c90amend1}" = yes ]; then
568 link_check wcwidth 'for wcwidth()' '#define HAVE_WCWIDTH' << \!
569 #include <wchar.h>
570 int main(void)
572 wcwidth(L'c');
573 return 0;
578 link_check nl_langinfo 'for nl_langinfo()' '#define HAVE_NL_LANGINFO' << \!
579 #include <langinfo.h>
580 #include <stdlib.h>
581 int main(void)
583 nl_langinfo(DAY_1);
584 return (nl_langinfo(CODESET) == NULL);
587 fi # have_setlocale
589 link_check mkstemp 'for mkstemp()' '#define HAVE_MKSTEMP' << \!
590 #include <stdlib.h>
591 int main(void)
593 mkstemp("x");
594 return 0;
598 # Note: run_check, thus we also get only the desired implementation...
599 run_check realpath 'for realpath()' '#define HAVE_REALPATH' << \!
600 #include <stdlib.h>
601 int main(void)
603 char *x = realpath(".", NULL), *y = realpath("/", NULL);
604 return (x != NULL && y != NULL) ? 0 : 1;
608 link_check wordexp 'for wordexp()' '#define HAVE_WORDEXP' << \!
609 #include <wordexp.h>
610 int main(void)
612 wordexp((char *)0, (wordexp_t *)0, 0);
613 return 0;
619 if wantfeat DEBUG; then
620 echo '#define HAVE_DEBUG' >> ${h}
623 if wantfeat AMALGAMATION; then
624 echo '#define HAVE_AMALGAMATION' >> ${h}
627 if nwantfeat NOALLOCA; then
628 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
629 # versions of alloca(3) since modern compilers just can't be trusted
630 # not to overoptimize and silently break some code
631 link_check alloca 'for __builtin_alloca()' \
632 '#define HAVE_ALLOCA __builtin_alloca' << \!
633 int main(void)
635 void *vp = __builtin_alloca(1);
636 return (!! vp);
641 if wantfeat DEVEL; then
642 echo '#define HAVE_DEVEL' >> ${h}
647 if wantfeat ICONV; then
648 ${cat} > ${tmp2}.c << \!
649 #include <iconv.h>
650 int main(void)
652 iconv_t id;
654 id = iconv_open("foo", "bar");
655 return 0;
658 < ${tmp2}.c link_check iconv 'for iconv functionality' \
659 '#define HAVE_ICONV' ||
660 < ${tmp2}.c link_check iconv \
661 'for iconv functionality in libiconv' \
662 '#define HAVE_ICONV' '-liconv'
663 else
664 echo '/* WANT_ICONV=0 */' >> ${h}
665 fi # wantfeat ICONV
667 if wantfeat SOCKETS; then
668 compile_check arpa_inet_h 'for <arpa/inet.h>' \
669 '#define HAVE_ARPA_INET_H' << \!
670 #include "config.h"
671 #include <sys/types.h>
672 #include <sys/socket.h>
673 #include <netdb.h>
674 #include <netinet/in.h>
675 #include <arpa/inet.h>
678 ${cat} > ${tmp2}.c << \!
679 #include "config.h"
680 #include <sys/types.h>
681 #include <sys/socket.h>
682 #include <netdb.h>
683 #include <netinet/in.h>
684 #ifdef HAVE_ARPA_INET_H
685 #include <arpa/inet.h>
686 #endif
688 int main(void)
690 struct sockaddr s;
691 socket(AF_INET, SOCK_STREAM, 0);
692 connect(0, &s, 0);
693 gethostbyname("foo");
694 return 0;
698 < ${tmp2}.c link_check sockets 'for sockets in libc' \
699 '#define HAVE_SOCKETS' ||
700 < ${tmp2}.c link_check sockets 'for sockets in libnsl' \
701 '#define HAVE_SOCKETS' '-lnsl' ||
702 < ${tmp2}.c link_check sockets \
703 'for sockets in libsocket and libnsl' \
704 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
705 WANT_SOCKETS=0
707 # XXX Shouldn't it be a hard error if there is no socket support, then?
708 option_update
709 else
710 echo '/* WANT_SOCKETS=0 */' >> ${h}
711 fi # wantfeat SOCKETS
713 wantfeat SOCKETS &&
714 link_check setsockopt 'for setsockopt()' '#define HAVE_SETSOCKOPT' << \!
715 #include <sys/socket.h>
716 #include <stdlib.h>
717 int main(void)
719 int sockfd = 3;
720 setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0);
721 return 0;
725 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
726 link_check so_sndtimeo 'for SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
727 #include <sys/socket.h>
728 #include <stdlib.h>
729 int main(void)
731 struct timeval tv;
732 int sockfd = 3;
733 tv.tv_sec = 42;
734 tv.tv_usec = 21;
735 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
736 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
737 return 0;
741 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
742 link_check so_linger 'for SO_LINGER' '#define HAVE_SO_LINGER' << \!
743 #include <sys/socket.h>
744 #include <stdlib.h>
745 int main(void)
747 struct linger li;
748 int sockfd = 3;
749 li.l_onoff = 1;
750 li.l_linger = 42;
751 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
752 return 0;
756 if wantfeat IPV6; then
757 link_check ipv6 'for IPv6 functionality' '#define HAVE_IPV6' << \!
758 #include "config.h"
759 #include <sys/types.h>
760 #include <sys/socket.h>
761 #include <netdb.h>
762 #include <netinet/in.h>
763 #ifdef HAVE_ARPA_INET_H
764 #include <arpa/inet.h>
765 #endif
767 int main(void)
769 struct addrinfo a, *ap;
770 getaddrinfo("foo", "0", &a, &ap);
771 return 0;
774 else
775 echo '/* WANT_IPV6=0 */' >> ${h}
776 fi # wantfeat IPV6
778 if wantfeat IMAP; then
779 echo '#define HAVE_IMAP' >> ${h}
780 else
781 echo '/* WANT_IMAP=0 */' >> ${h}
784 if wantfeat POP3; then
785 echo '#define HAVE_POP3' >> ${h}
786 else
787 echo '/* WANT_POP3=0 */' >> ${h}
790 if wantfeat SMTP; then
791 echo '#define HAVE_SMTP' >> ${h}
792 else
793 echo '/* WANT_SMTP=0 */' >> ${h}
796 if wantfeat SSL; then
797 link_check openssl 'for sufficiently recent OpenSSL' \
798 '#define HAVE_SSL
799 #define HAVE_OPENSSL' '-lssl -lcrypto' << \!
800 #include <openssl/ssl.h>
801 #include <openssl/err.h>
802 #include <openssl/x509v3.h>
803 #include <openssl/x509.h>
804 #include <openssl/rand.h>
806 #if defined OPENSSL_NO_SSL2 && defined OPENSSL_NO_SSL3 &&\
807 defined OPENSSL_NO_TLS1
808 # error We need one of (SSLv2 and) SSLv3 and TLS1.
809 #endif
811 int main(void)
813 SSLv23_client_method();
814 #ifndef OPENSSL_NO_SSL3
815 SSLv3_client_method();
816 #endif
817 #ifndef OPENSSL_NO_TLS1
818 TLSv1_client_method();
819 # ifdef TLS1_1_VERSION
820 TLSv1_1_client_method();
821 # endif
822 # ifdef TLS1_2_VERSION
823 TLSv1_2_client_method();
824 # endif
825 #endif
826 PEM_read_PrivateKey(0, 0, 0, 0);
827 return 0;
831 if [ "${have_openssl}" = 'yes' ]; then
832 compile_check stack_of 'for OpenSSL STACK_OF()' \
833 '#define HAVE_OPENSSL_STACK_OF' << \!
834 #include <openssl/ssl.h>
835 #include <openssl/err.h>
836 #include <openssl/x509v3.h>
837 #include <openssl/x509.h>
838 #include <openssl/rand.h>
840 int main(void)
842 STACK_OF(GENERAL_NAME) *gens = NULL;
843 printf("%p", gens); /* to make it used */
844 return 0;
848 link_check rand_egd 'for OpenSSL RAND_egd()' \
849 '#define HAVE_OPENSSL_RAND_EGD' '-lssl -lcrypto' << \!
850 #include <openssl/rand.h>
852 int main(void)
854 return RAND_egd("some.where") > 0;
858 if wantfeat MD5 && nwantfeat NOEXTMD5; then
859 run_check openssl_md5 'for MD5 digest in OpenSSL' \
860 '#define HAVE_OPENSSL_MD5' << \!
861 #include <string.h>
862 #include <openssl/md5.h>
864 int main(void)
866 char const dat[] = "abrakadabrafidibus";
867 char dig[16], hex[16 * 2];
868 MD5_CTX ctx;
869 size_t i, j;
871 memset(dig, 0, sizeof(dig));
872 memset(hex, 0, sizeof(hex));
873 MD5_Init(&ctx);
874 MD5_Update(&ctx, dat, sizeof(dat) - 1);
875 MD5_Final(dig, &ctx);
877 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
878 for (i = 0; i < sizeof(hex) / 2; i++) {
879 j = i << 1;
880 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
881 hex[++j] = hexchar(dig[i] & 0x0f);
883 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
886 fi # wantfeat MD5 && nwantfeat NOEXTMD5
888 else
889 echo '/* WANT_SSL=0 */' >> ${h}
890 fi # wantfeat SSL
892 if wantfeat NETRC; then
893 echo '#define HAVE_NETRC' >> ${h}
894 else
895 echo '/* WANT_NETRC=0 */' >> ${h}
898 if wantfeat GSSAPI; then
899 ${cat} > ${tmp2}.c << \!
900 #include <gssapi/gssapi.h>
902 int main(void)
904 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
905 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
906 return 0;
909 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
911 if command -v krb5-config >/dev/null 2>&1; then
912 i=`command -v krb5-config`
913 GSS_LIBS="`CFLAGS= ${i} --libs gssapi`"
914 GSS_INCS="`CFLAGS= ${i} --cflags`"
915 i='for GSS-API via krb5-config(1)'
916 else
917 GSS_LIBS='-lgssapi'
918 GSS_INCS=
919 i='for GSS-API in gssapi/gssapi.h, libgssapi'
921 < ${tmp2}.c link_check gss \
922 "${i}" '#define HAVE_GSSAPI' "${GSS_LIBS}" "${GSS_INCS}" ||\
923 < ${tmp3}.c link_check gss \
924 'for GSS-API in gssapi.h, libgssapi' \
925 '#define HAVE_GSSAPI
926 #define GSSAPI_REG_INCLUDE' \
927 '-lgssapi' ||\
928 < ${tmp2}.c link_check gss 'for GSS-API in libgssapi_krb5' \
929 '#define HAVE_GSSAPI' \
930 '-lgssapi_krb5' ||\
931 < ${tmp3}.c link_check gss \
932 'for GSS-API in libgssapi, OpenBSD-style (pre 5.3)' \
933 '#define HAVE_GSSAPI
934 #define GSS_REG_INCLUDE' \
935 '-lgssapi -lkrb5 -lcrypto' \
936 '-I/usr/include/kerberosV' ||\
937 < ${tmp2}.c link_check gss 'for GSS-API in libgss' \
938 '#define HAVE_GSSAPI' \
939 '-lgss' ||\
940 link_check gss 'for GSS-API in libgssapi_krb5, old-style' \
941 '#define HAVE_GSSAPI
942 #define GSSAPI_OLD_STYLE' \
943 '-lgssapi_krb5' << \!
944 #include <gssapi/gssapi.h>
945 #include <gssapi/gssapi_generic.h>
947 int main(void)
949 gss_import_name(0, 0, gss_nt_service_name, 0);
950 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
951 return 0;
954 else
955 echo '/* WANT_GSSAPI=0 */' >> ${h}
956 fi # wantfeat GSSAPI
958 if wantfeat IDNA; then
959 link_check idna 'for GNU Libidn' '#define HAVE_IDNA' '-lidn' << \!
960 #include <idna.h>
961 #include <idn-free.h>
962 #include <stringprep.h>
963 int main(void)
965 char *utf8, *idna_ascii, *idna_utf8;
966 utf8 = stringprep_locale_to_utf8("does.this.work");
967 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
968 != IDNA_SUCCESS)
969 return 1;
970 idn_free(idna_ascii);
971 /* (Rather link check only here) */
972 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
973 return 0;
976 else
977 echo '/* WANT_IDNA=0 */' >> ${h}
980 if wantfeat REGEX; then
981 link_check regex 'for regular expressions' '#define HAVE_REGEX' << \!
982 #include <regex.h>
983 #include <stdlib.h>
984 int main(void)
986 int status;
987 regex_t re;
988 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
989 return 1;
990 status = regexec(&re, "plan9", 0,NULL, 0);
991 regfree(&re);
992 return !(status == REG_NOMATCH);
995 else
996 echo '/* WANT_REGEX=0 */' >> ${h}
999 if wantfeat READLINE; then
1000 __edrdlib() {
1001 link_check readline "for readline(3) (${1})" \
1002 '#define HAVE_READLINE' "${1}" << \!
1003 #include <stdio.h>
1004 #include <readline/history.h>
1005 #include <readline/readline.h>
1006 int main(void)
1008 char *rl;
1009 HISTORY_STATE *hs;
1010 HIST_ENTRY **he;
1011 int i;
1012 using_history();
1013 read_history("");
1014 stifle_history(242);
1015 rl = readline("Enter a line:");
1016 if (rl && *rl)
1017 add_history(rl);
1018 write_history("");
1019 rl_extend_line_buffer(10);
1020 rl_point = rl_end = 10;
1021 rl_pre_input_hook = (rl_hook_func_t*)NULL;
1022 rl_forced_update_display();
1023 clear_history();
1024 hs = history_get_history_state();
1025 i = hs->length;
1026 he = history_list();
1027 if (i > 0)
1028 rl = he[0]->line;
1029 rl_free_line_state();
1030 rl_cleanup_after_signal();
1031 rl_reset_after_signal();
1032 return 0;
1037 __edrdlib -lreadline ||
1038 __edrdlib '-lreadline -ltermcap'
1039 [ -n "${have_readline}" ] && WANT_TABEXPAND=1
1042 if wantfeat EDITLINE && [ -z "${have_readline}" ]; then
1043 __edlib() {
1044 link_check editline "for editline(3) (${1})" \
1045 '#define HAVE_EDITLINE' "${1}" << \!
1046 #include <histedit.h>
1047 static char * getprompt(void) { return (char*)"ok"; }
1048 int main(void)
1050 EditLine *el_el = el_init("TEST", stdin, stdout, stderr);
1051 HistEvent he;
1052 History *el_hcom = history_init();
1053 history(el_hcom, &he, H_SETSIZE, 242);
1054 el_set(el_el, EL_SIGNAL, 0);
1055 el_set(el_el, EL_TERMINAL, NULL);
1056 el_set(el_el, EL_HIST, &history, el_hcom);
1057 el_set(el_el, EL_EDITOR, "emacs");
1058 el_set(el_el, EL_PROMPT, &getprompt);
1059 el_source(el_el, NULL);
1060 history(el_hcom, &he, H_GETSIZE);
1061 history(el_hcom, &he, H_CLEAR);
1062 el_end(el_el);
1063 /* TODO add loader and addfn checks */
1064 history_end(el_hcom);
1065 return 0;
1070 __edlib -ledit ||
1071 __edlib '-ledit -ltermcap'
1072 [ -n "${have_editline}" ] && WANT_TABEXPAND=0
1075 if wantfeat NCL && [ -z "${have_editline}" ] && [ -z "${have_readline}" ] &&\
1076 [ -n "${have_c90amend1}" ]; then
1077 have_ncl=1
1078 echo '#define HAVE_NCL' >> ${h}
1079 else
1080 echo '/* WANT_{READLINE,EDITLINE,NCL}=0 */' >> ${h}
1083 # Generic have-a-command-line-editor switch for those who need it below
1084 if [ -n "${have_ncl}" ] || [ -n "${have_editline}" ] ||\
1085 [ -n "${have_readline}" ]; then
1086 have_cle=1
1089 if [ -n "${have_cle}" ] && wantfeat TABEXPAND; then
1090 echo '#define HAVE_TABEXPAND' >> ${h}
1091 else
1092 echo '/* WANT_TABEXPAND=0 */' >> ${h}
1095 if [ -n "${have_cle}" ] && wantfeat HISTORY; then
1096 echo '#define HAVE_HISTORY' >> ${h}
1097 else
1098 echo '/* WANT_HISTORY=0 */' >> ${h}
1101 if wantfeat SPAM; then
1102 echo '#define HAVE_SPAM' >> ${h}
1103 if command -v spamc >/dev/null 2>&1; then
1104 echo "#define SPAMC_PATH \"`command -v spamc`\"" >> ${h}
1106 else
1107 echo '/* WANT_SPAM=0 */' >> ${h}
1110 if wantfeat DOCSTRINGS; then
1111 echo '#define HAVE_DOCSTRINGS' >> ${h}
1112 else
1113 echo '/* WANT_DOCSTRINGS=0 */' >> ${h}
1116 if wantfeat QUOTE_FOLD &&\
1117 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
1118 echo '#define HAVE_QUOTE_FOLD' >> ${h}
1119 else
1120 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
1123 if wantfeat COLOUR; then
1124 echo '#define HAVE_COLOUR' >> ${h}
1125 else
1126 echo '/* WANT_COLOUR=0 */' >> ${h}
1129 if wantfeat IMAP_SEARCH; then
1130 echo '#define HAVE_IMAP_SEARCH' >> ${h}
1131 else
1132 echo '/* WANT_IMAP_SEARCH=0 */' >> ${h}
1135 if wantfeat MD5; then
1136 echo '#define HAVE_MD5' >> ${h}
1137 else
1138 echo '/* WANT_MD5=0 */' >> ${h}
1141 ## Summarizing ##
1143 # Since we cat(1) the content of those to cc/"ld", convert them to single line
1144 squeeze_em() {
1145 < "${1}" > "${2}" ${awk} \
1146 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1148 ${rm} -f ${tmp}
1149 squeeze_em ${inc} ${tmp}
1150 ${mv} ${tmp} ${inc}
1151 squeeze_em ${lib} ${tmp}
1152 ${mv} ${tmp} ${lib}
1154 # config.h
1155 ${mv} ${h} ${tmp}
1156 printf '#ifndef _CONFIG_H\n# define _CONFIG_H\n' > ${h}
1157 ${cat} ${tmp} >> ${h}
1159 printf '\n/* The "feature string", for "simplicity" and lex.c */\n' >> ${h}
1160 printf '#ifdef _MAIN_SOURCE\n' >> ${h}
1161 printf '# ifdef HAVE_AMALGAMATION\nstatic\n# endif\n' >> ${h}
1162 printf 'char const features[] = "MIME"\n' >> ${h}
1163 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
1164 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
1165 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
1166 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
1167 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
1168 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
1169 printf '# ifdef HAVE_IPV6\n ",IPv6"\n# endif\n' >> ${h}
1170 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TLS"\n# endif\n' >> ${h}
1171 printf '# ifdef HAVE_IMAP\n ",IMAP"\n# endif\n' >> ${h}
1172 printf '# ifdef HAVE_GSSAPI\n ",GSS-API"\n# endif\n' >> ${h}
1173 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
1174 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
1175 printf '# ifdef HAVE_SPAM\n ",SPAM"\n# endif\n' >> ${h}
1176 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
1177 printf '# ifdef HAVE_IMAP_SEARCH\n ",IMAP-searches"\n# endif\n' >> ${h}
1178 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
1179 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
1180 printf '# ifdef HAVE_EDITLINE\n ",EDITLINE"\n# endif\n' >> ${h}
1181 printf '# ifdef HAVE_NCL\n ",NCL"\n# endif\n' >> ${h}
1182 printf '# ifdef HAVE_TABEXPAND\n ",TABEXPAND"\n# endif\n' >> ${h}
1183 printf '# ifdef HAVE_HISTORY\n ",HISTORY MANAGEMENT"\n# endif\n' >> ${h}
1184 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
1185 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
1186 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
1187 printf ';\n#endif /* _MAIN_SOURCE */\n' >> ${h}
1189 printf '#endif /* _CONFIG_H */\n' >> ${h}
1190 ${rm} -f ${tmp}
1192 # Create the real mk.mk
1193 ${rm} -rf ${tmp0}.* ${tmp0}*
1194 printf 'OBJ_SRC = ' >> ${mk}
1195 if nwantfeat AMALGAMATION; then
1196 echo *.c >> ${mk}
1197 echo 'OBJ_DEP =' >> ${mk}
1198 else
1199 j=`echo "${src}" | sed 's/^.\///'`
1200 echo "${j}" >> ${mk}
1201 printf 'OBJ_DEP = main.c ' >> ${mk}
1202 printf '#define _MAIN_SOURCE\n' >> ${src}
1203 printf '#include "nail.h"\n#include "main.c"\n' >> ${src}
1204 for i in *.c; do
1205 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ]; then
1206 continue
1208 printf "${i} " >> ${mk}
1209 printf "#include \"${i}\"\n" >> ${src}
1210 done
1211 echo >> ${mk}
1214 echo "LIBS = `${cat} ${lib}`" >> ${mk}
1215 echo "INCLUDES = `${cat} ${inc}`" >> ${mk}
1216 echo >> ${mk}
1217 ${cat} ./mk-mk.in >> ${mk}
1219 ## Finished! ##
1221 ${cat} > ${tmp2}.c << \!
1222 #include "config.h"
1223 #ifdef HAVE_NL_LANGINFO
1224 # include <langinfo.h>
1225 #endif
1227 :The following optional features are enabled:
1228 #ifdef HAVE_ICONV
1229 : + Character set conversion using iconv()
1230 #endif
1231 #ifdef HAVE_SETLOCALE
1232 : + Locale support: Printable characters depend on the environment
1233 # ifdef HAVE_C90AMEND1
1234 : + Multibyte character support
1235 # endif
1236 # ifdef HAVE_NL_LANGINFO
1237 : + Automatic detection of terminal character set
1238 # endif
1239 #endif
1240 #ifdef HAVE_SOCKETS
1241 : + Network support
1242 #endif
1243 #ifdef HAVE_IPV6
1244 : + Support for Internet Protocol v6 (IPv6)
1245 #endif
1246 #ifdef HAVE_SSL
1247 # ifdef HAVE_OPENSSL
1248 : + S/MIME and SSL/TLS using OpenSSL
1249 # endif
1250 #endif
1251 #ifdef HAVE_IMAP
1252 : + IMAP protocol
1253 #endif
1254 #ifdef HAVE_GSSAPI
1255 : + GSS-API authentication
1256 #endif
1257 #ifdef HAVE_POP3
1258 : + POP3 protocol
1259 #endif
1260 #ifdef HAVE_SMTP
1261 : + SMTP protocol
1262 #endif
1263 #ifdef HAVE_SPAM
1264 : + Interaction with spam filters
1265 #endif
1266 #ifdef HAVE_IDNA
1267 : + IDNA (internationalized domain names for applications) support
1268 #endif
1269 #ifdef HAVE_IMAP_SEARCH
1270 : + IMAP-style search expressions
1271 #endif
1272 #ifdef HAVE_REGEX
1273 : + Regular expression support (searches, conditional expressions etc.)
1274 #endif
1275 #if defined HAVE_READLINE || defined HAVE_EDITLINE || defined HAVE_NCL
1276 : + Command line editing
1277 # ifdef HAVE_TABEXPAND
1278 : + + Tabulator expansion
1279 # endif
1280 # ifdef HAVE_HISTORY
1281 : + + History management
1282 # endif
1283 #endif
1284 #ifdef HAVE_QUOTE_FOLD
1285 : + Extended *quote-fold*ing
1286 #endif
1287 #ifdef HAVE_COLOUR
1288 : + Coloured message display (simple)
1289 #endif
1291 :The following optional features are disabled:
1292 #ifndef HAVE_ICONV
1293 : - Character set conversion using iconv()
1294 #endif
1295 #ifndef HAVE_SETLOCALE
1296 : - Locale support: Only ASCII characters are recognized
1297 #endif
1298 # ifndef HAVE_C90AMEND1
1299 : - Multibyte character support
1300 # endif
1301 # ifndef HAVE_NL_LANGINFO
1302 : - Automatic detection of terminal character set
1303 # endif
1304 #ifndef HAVE_SOCKETS
1305 : - Network support
1306 #endif
1307 #ifndef HAVE_IPV6
1308 : - Support for Internet Protocol v6 (IPv6)
1309 #endif
1310 #if !defined HAVE_SSL
1311 : - SSL/TLS (network transport authentication and encryption)
1312 #endif
1313 #ifndef HAVE_IMAP
1314 : - IMAP protocol
1315 #endif
1316 #ifndef HAVE_GSSAPI
1317 : - GSS-API authentication
1318 #endif
1319 #ifndef HAVE_POP3
1320 : - POP3 protocol
1321 #endif
1322 #ifndef HAVE_SMTP
1323 : - SMTP protocol
1324 #endif
1325 #ifndef HAVE_SPAM
1326 : - Interaction with spam filters
1327 #endif
1328 #ifndef HAVE_IDNA
1329 : - IDNA (internationalized domain names for applications) support
1330 #endif
1331 #ifndef HAVE_IMAP_SEARCH
1332 : - IMAP-style search expressions
1333 #endif
1334 #ifndef HAVE_REGEX
1335 : - Regular expression support
1336 #endif
1337 #if !defined HAVE_READLINE && !defined HAVE_EDITLINE && !defined HAVE_NCL
1338 : - Command line editing and history
1339 #endif
1340 #ifndef HAVE_QUOTE_FOLD
1341 : - Extended *quote-fold*ing
1342 #endif
1343 #ifndef HAVE_COLOUR
1344 : - Coloured message display (simple)
1345 #endif
1347 :Remarks:
1348 #ifndef HAVE_SNPRINTF
1349 : . The function snprintf() could not be found. mailx will be compiled to use
1350 : sprintf() instead. This might overflow buffers if input values are larger
1351 : than expected. Use the resulting binary with care or update your system
1352 : environment and start the configuration process again.
1353 #endif
1354 #ifndef HAVE_FCHDIR
1355 : . The function fchdir() could not be found. mailx will be compiled to use
1356 : chdir() instead. This is not a problem unless the current working
1357 : directory of mailx is moved while the IMAP cache is used.
1358 #endif
1359 #ifdef HAVE_DEBUG
1360 : . Debug enabled binary: not meant to be used by end-users: THANKS!
1361 #endif
1365 ${make} -f ${makefile} ${tmp2}.x
1366 < ${tmp2}.x >&5 ${sed} -e '/^[^:]/d; /^$/d; s/^://'
1368 # vim:set fenc=utf-8:s-it-mode