Review: thread.c
[s-mailx.git] / mk-conf.sh
bloba1467edcb34a9e9f96a6d4802dc82af92f2f972a
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="${_CFLAGS} -Wall -Wextra -pedantic"
102 _CFLAGS="${_CFLAGS} -fno-unwind-tables -fno-asynchronous-unwind-tables"
103 _CFLAGS="${_CFLAGS} -fstrict-aliasing"
104 _CFLAGS="${_CFLAGS} -Wbad-function-cast -Wcast-align -Wcast-qual"
105 _CFLAGS="${_CFLAGS} -Winit-self -Wmissing-prototypes"
106 _CFLAGS="${_CFLAGS} -Wshadow -Wunused -Wwrite-strings"
107 if { i=${ccver}; echo "${i}"; } | ${grep} -q -e 'clang version 1'; then
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 if wantfeat DEBUG; then
122 _CFLAGS="${_CFLAGS} -std=c89"
123 _CFLAGS="${_CFLAGS} -Wno-long-long" # ISO C89 has no 'long long'...
125 # elif { i=${ccver}; echo "${i}"; } | ${grep} -q -i -e clang; then
126 # stackprot=yes
127 # optim=-O3 dbgoptim=-O
128 # _CFLAGS='-std=c89 -g -Weverything -Wno-long-long'
129 # if wantfeat AMALGAMATION; then
130 # _CFLAGS="${_CFLAGS} -pipe"
131 # fi
132 # if wantfeat DEBUG; then
133 # _CFLAGS="${_CFLAGS} -std=c89"
134 # _CFLAGS="${_CFLAGS} -Wno-long-long" # ISO C89 has no 'long long'...
135 # fi
136 elif [ -z "${optim}" ]; then
137 optim=-O1 dbgoptim=-O
140 if nwantfeat DEBUG; then
141 _CFLAGS="${optim} -DNDEBUG ${_CFLAGS}"
142 else
143 _CFLAGS="${dbgoptim} -g -ftrapv ${_CFLAGS}";
144 if [ "${stackprot}" = yes ]; then
145 _CFLAGS="${_CFLAGS} -fstack-protector-all "
146 _CFLAGS="${_CFLAGS} -Wstack-protector -D_FORTIFY_SOURCE=2"
149 _CFLAGS="${_CFLAGS} ${ADDCFLAGS}"
150 # XXX -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack: need detection
151 _LDFLAGS="${_LDFLAGS} ${ADDLDFLAGS}" # XXX -Wl,--sort-common,[-O1]
152 export _CFLAGS _LDFLAGS
154 # $CFLAGS and $LDFLAGS are only overwritten if explicitly wanted
155 if wantfeat AUTOCC; then
156 CFLAGS=$_CFLAGS
157 LDFLAGS=$_LDFLAGS
158 export CFLAGS LDFLAGS
162 ## -- >8 -- 8< -- ##
164 ## Notes:
165 ## - Heirloom sh(1) (and same origin) have problems with ': >' redirection,
166 ## so use "printf '' >" instead
167 ## - Heirloom sh(1) and maybe more execute loops with redirection in a subshell
168 ## (but don't export eval's from within), therefore we need to (re)include
169 ## variable assignments at toplevel instead (via reading temporary files)
171 ## First of all, create new configuration and check wether it changed ##
173 conf=./conf.rc
174 lst=./config.lst
175 h=./config.h
176 mk=./mk.mk
178 newlst=./config.lst-new
179 newmk=./config.mk-new
180 newh=./config.h-new
181 tmp0=___tmp
182 tmp=./${tmp0}1$$
184 # We need some standard utilities
185 unset -f command
186 check_tool() {
187 n=$1 i=$2 opt=${3:-0}
188 if type "${i}" >/dev/null 2>&1; then
189 eval ${n}=${i}
190 return 1
192 if [ ${opt} -eq 0 ]; then
193 echo >&2 "ERROR: no trace of the utility \`${n}'"
194 exit 1
196 return 0
199 # Check those tools right now that we need before including ${conf}
200 check_tool rm "${rm:-`command -v rm`}"
201 check_tool sed "${sed:-`command -v sed`}"
203 # Only incorporate what wasn't overwritten from command line / CONFIG
204 trap "${rm} -f ${tmp}; exit" 1 2 15
205 trap "${rm} -f ${tmp}" 0
206 ${rm} -f ${tmp}
208 < ${conf} ${sed} -e '/^[ \t]*#/d' -e '/^$/d' -e 's/[ \t]*$//' |
209 while read line; do
210 i=`echo ${line} | ${sed} -e 's/=.*$//'`
211 eval j=\$${i} jx=\${${i}+x}
212 if [ -n "${j}" ] || [ "${jx}" = x ]; then
213 line="${i}=\"${j}\""
215 echo ${line}
216 done > ${tmp}
217 . ./${tmp}
219 check_tool awk "${awk:-`command -v awk`}"
220 check_tool cat "${cat:-`command -v cat`}"
221 check_tool chmod "${chmod:-`command -v chmod`}"
222 check_tool cp "${cp:-`command -v cp`}"
223 check_tool cmp "${cmp:-`command -v cmp`}"
224 check_tool grep "${grep:-`command -v grep`}"
225 check_tool mkdir "${mkdir:-`command -v mkdir`}"
226 check_tool mv "${mv:-`command -v mv`}"
227 # rm(1), sed(1) above
228 check_tool tee "${tee:-`command -v tee`}"
230 check_tool make "${MAKE:-`command -v make`}"
231 check_tool strip "${STRIP:-`command -v strip`}" 1
232 HAVE_STRIP=${?}
234 wantfeat() {
235 eval i=\$WANT_${1}
236 [ "${i}" = "1" ]
238 nwantfeat() {
239 eval i=\$WANT_${1}
240 [ "${i}" != "1" ]
243 option_update
245 # (No function since some shells loose non-exported variables in traps)
246 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}; exit" 1 2 15
247 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}" 0
248 ${rm} -f ${newlst} ${newmk} ${newh}
250 # (Could: use FD redirection, add eval(1) and don't re-'. ./${newlst}')
251 while read line; do
252 i=`echo ${line} | ${sed} -e 's/=.*$//'`
253 eval j=\$${i}
254 if [ -z "${j}" ] || [ "${j}" = 0 ]; then
255 printf "/*#define ${i}*/\n" >> ${newh}
256 elif [ "${j}" = 1 ]; then
257 printf "#define ${i}\n" >> ${newh}
258 else
259 printf "#define ${i} \"${j}\"\n" >> ${newh}
261 printf "${i} = ${j}\n" >> ${newmk}
262 printf "${i}=\"${j}\"\n"
263 done < ${tmp} > ${newlst}
264 . ./${newlst}
266 printf "#define UAGENT \"${SID}${NAIL}\"\n" >> ${newh}
267 printf "UAGENT = ${SID}${NAIL}\n" >> ${newmk}
269 compiler_flags
271 printf "CC = ${CC}\n" >> ${newmk}
272 printf "_CFLAGS = ${_CFLAGS}\nCFLAGS = ${CFLAGS}\n" >> ${newmk}
273 printf "_LDFLAGS = ${_LDFLAGS}\nLDFLAGS = ${LDFLAGS}\n" >> ${newmk}
274 printf "AWK = ${awk}\nCMP = ${cmp}\nCHMOD = ${chmod}\nCP = ${cp}\n" >> ${newmk}
275 printf "GREP = ${grep}\nMKDIR = ${mkdir}\nRM = ${rm}\nSED = ${sed}\n" \
276 >> ${newmk}
277 printf "STRIP = ${strip}\nHAVE_STRIP = ${HAVE_STRIP}\n" >> ${newmk}
278 # (We include the cc(1)/ld(1) environment only for update detection..)
279 printf "CC=\"${CC}\"\n" >> ${newlst}
280 printf "_CFLAGS=\"${_CFLAGS}\"\nCFLAGS=\"${CFLAGS}\"\n" >> ${newlst}
281 printf "_LDFLAGS=\"${_LDFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n" >> ${newlst}
282 printf "AWK=${awk}\nCMP=${cmp}\nCHMOD=${chmod}\nCP=${cp}\n" >> ${newlst}
283 printf "GREP=${grep}\nMKDIR=${mkdir}\nRM=${rm}\nSED=${sed}\n" >> ${newlst}
284 printf "STRIP=${strip}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newlst}
286 if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
287 exit 0
289 [ -f ${lst} ] && echo 'configuration updated..' || echo 'shiny configuration..'
291 ${mv} -f ${newlst} ${lst}
292 ${mv} -f ${newh} ${h}
293 ${mv} -f ${newmk} ${mk}
295 ## Compile and link checking ##
297 tmp2=./${tmp0}2$$
298 tmp3=./${tmp0}3$$
299 log=./config.log
300 lib=./config.lib
301 inc=./config.inc
302 src=./config.c
303 makefile=./config.mk
305 # (No function since some shells loose non-exported variables in traps)
306 trap "${rm} -f ${lst} ${h} ${mk} ${lib} ${inc} ${src} ${makefile}; exit" 1 2 15
307 trap "${rm} -rf ${tmp0}.* ${tmp0}* ${makefile}" 0
309 exec 5>&2 > ${log} 2>&1
310 printf '' > ${lib}
311 printf '' > ${inc}
312 # ${src} is only created if WANT_AMALGAMATION
313 ${rm} -f ${src}
314 ${cat} > ${makefile} << \!
315 .SUFFIXES: .o .c .x .y
316 .c.o:
317 $(CC) $(XINCS) -c $<
318 .c.x:
319 $(CC) $(XINCS) -E $< >$@
321 $(CC) $(XINCS) -o $@ $< $(XLIBS)
322 .y: ;
325 msg() {
326 fmt=$1
328 shift
329 printf "*** ${fmt}\\n" "${@}"
330 printf "${fmt}" "${@}" >&5
333 _check_preface() {
334 variable=$1 topic=$2 define=$3
336 echo '**********'
337 msg "checking ${topic} ... "
338 echo "/* checked ${topic} */" >> ${h}
339 ${rm} -f ${tmp} ${tmp}.o
340 echo '*** test program is'
341 ${tee} ${tmp}.c
342 #echo '*** the preprocessor generates'
343 #${make} -f ${makefile} ${tmp}.x
344 #${cat} ${tmp}.x
345 echo '*** results are'
348 compile_check() {
349 variable=$1 topic=$2 define=$3
351 _check_preface "${variable}" "${topic}" "${define}"
353 if ${make} -f ${makefile} XINCS="${INCS}" ./${tmp}.o &&
354 [ -f ./${tmp}.o ]; then
355 msg "yes\\n"
356 echo "${define}" >> ${h}
357 eval have_${variable}=yes
358 return 0
359 else
360 echo "/* ${define} */" >> ${h}
361 msg "no\\n"
362 eval unset have_${variable}
363 return 1
367 _link_mayrun() {
368 run=$1 variable=$2 topic=$3 define=$4 libs=$5 incs=$6
370 _check_preface "${variable}" "${topic}" "${define}"
372 if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
373 XLIBS="${LIBS} ${libs}" ./${tmp} &&
374 [ -f ./${tmp} ] &&
375 { [ ${run} -eq 0 ] || ./${tmp}; }; then
376 echo "*** adding INCS<${incs}> LIBS<${libs}>"
377 msg "yes\\n"
378 echo "${define}" >> ${h}
379 LIBS="${LIBS} ${libs}"
380 echo "${libs}" >> ${lib}
381 INCS="${INCS} ${incs}"
382 echo "${incs}" >> ${inc}
383 eval have_${variable}=yes
384 return 0
385 else
386 msg "no\\n"
387 echo "/* ${define} */" >> ${h}
388 eval unset have_${variable}
389 return 1
393 link_check() {
394 _link_mayrun 0 "${1}" "${2}" "${3}" "${4}" "${5}"
397 run_check() {
398 _link_mayrun 1 "${1}" "${2}" "${3}" "${4}" "${5}"
401 # Build a basic set of INCS and LIBS according to user environment.
402 # On pkgsrc(7) systems automatically add /usr/pkg/*
403 if [ -n "${C_INCLUDE_PATH}" ]; then
404 i=${IFS}
405 IFS=:
406 set -- ${C_INCLUDE_PATH}
407 IFS=${i}
408 # for i; do -- new in POSIX Issue 7 + TC1
409 for i
411 [ "${i}" = '/usr/pkg/include' ] && continue
412 INCS="${INCS} -I${i}"
413 done
415 [ -d /usr/pkg/include ] && INCS="${INCS} -I/usr/pkg/include"
416 echo "${INCS}" >> ${inc}
418 if [ -n "${LD_LIBRARY_PATH}" ]; then
419 i=${IFS}
420 IFS=:
421 set -- ${LD_LIBRARY_PATH}
422 IFS=${i}
423 # for i; do -- new in POSIX Issue 7 + TC1
424 for i
426 [ "${i}" = '/usr/pkg/lib' ] && continue
427 LIBS="${LIBS} -L${i}"
428 done
430 [ -d /usr/pkg/lib ] && LIBS="${LIBS} -L/usr/pkg/lib"
431 echo "${LIBS}" >> ${lib}
435 # Better set _GNU_SOURCE (if we are on Linux only?); 'surprised it did without
436 echo '#define _GNU_SOURCE' >> ${h}
438 link_check hello 'if a hello world program can be built' << \! || {\
439 echo >&5 'This oooops is most certainly not related to me.';\
440 echo >&5 "Read the file ${log} and check your compiler environment.";\
441 ${rm} -f ${lst} ${h} ${mk};\
442 exit 1;\
444 #include <stdio.h>
446 int main(int argc, char *argv[])
448 (void)argc;
449 (void)argv;
450 puts("hello world");
451 return 0;
455 link_check termios 'for termios.h and tc*() family' << \! || {\
456 echo >&5 'We require termios.h and the tc*() family of functions.';\
457 echo >&5 "That much Unix we indulge ourselfs.";\
458 ${rm} -f ${lst} ${h} ${mk};\
459 exit 1;\
461 #include <termios.h>
462 int main(void)
464 struct termios tios;
465 tcgetattr(0, &tios);
466 tcsetattr(0, TCSADRAIN | TCSAFLUSH, &tios);
467 return 0;
471 link_check setenv 'for setenv()/unsetenv()' '#define HAVE_SETENV' << \!
472 #include <stdlib.h>
473 int main(void)
475 setenv("s-nail", "to be made nifty!", 1);
476 unsetenv("s-nail");
477 return 0;
481 link_check snprintf 'for snprintf()' '#define HAVE_SNPRINTF' << \!
482 #include <stdio.h>
483 int main(void)
485 char b[20];
486 snprintf(b, sizeof b, "%s", "string");
487 return 0;
491 link_check putc_unlocked 'for putc_unlocked()' '#define HAVE_PUTC_UNLOCKED' <<\!
492 #include <stdio.h>
493 int main(void)
495 putc_unlocked('@', stdout);
496 return 0;
500 link_check fchdir 'for fchdir()' '#define HAVE_FCHDIR' << \!
501 #include <unistd.h>
502 int main(void)
504 fchdir(0);
505 return 0;
509 link_check pipe2 'for pipe2()' '#define HAVE_PIPE2' << \!
510 #include <fcntl.h>
511 #include <unistd.h>
512 int main(void)
514 int fds[2];
515 pipe2(fds, O_CLOEXEC);
516 return 0;
520 link_check mmap 'for mmap()' '#define HAVE_MMAP' << \!
521 #include <sys/types.h>
522 #include <sys/mman.h>
523 int main(void)
525 mmap(0, 0, 0, 0, 0, 0);
526 return 0;
530 link_check mremap 'for mremap()' '#define HAVE_MREMAP' << \!
531 #include <sys/types.h>
532 #include <sys/mman.h>
533 int main(void)
535 mremap(0, 0, 0, MREMAP_MAYMOVE);
536 return 0;
540 link_check setlocale 'for setlocale()' '#define HAVE_SETLOCALE' << \!
541 #include <locale.h>
542 int main(void)
544 setlocale(LC_ALL, "");
545 return 0;
549 if [ "${have_setlocale}" = yes ]; then
550 link_check c90amend1 'for ISO/IEC 9899:1990/Amendment 1:1995' \
551 '#define HAVE_C90AMEND1' << \!
552 #include <limits.h>
553 #include <stdlib.h>
554 #include <wchar.h>
555 #include <wctype.h>
556 int main(void)
558 char mbb[MB_LEN_MAX + 1];
559 wchar_t wc;
560 iswprint(L'c');
561 towupper(L'c');
562 mbtowc(&wc, "x", 1);
563 mbrtowc(&wc, "x", 1, NULL);
564 (void)wctomb(mbb, wc);
565 return (mblen("\0", 1) == 0);
569 if [ "${have_c90amend1}" = yes ]; then
570 link_check wcwidth 'for wcwidth()' '#define HAVE_WCWIDTH' << \!
571 #include <wchar.h>
572 int main(void)
574 wcwidth(L'c');
575 return 0;
580 link_check nl_langinfo 'for nl_langinfo()' '#define HAVE_NL_LANGINFO' << \!
581 #include <langinfo.h>
582 #include <stdlib.h>
583 int main(void)
585 nl_langinfo(DAY_1);
586 return (nl_langinfo(CODESET) == NULL);
589 fi # have_setlocale
591 link_check mkstemp 'for mkstemp()' '#define HAVE_MKSTEMP' << \!
592 #include <stdlib.h>
593 int main(void)
595 mkstemp("x");
596 return 0;
600 # Note: run_check, thus we also get only the desired implementation...
601 run_check realpath 'for realpath()' '#define HAVE_REALPATH' << \!
602 #include <stdlib.h>
603 int main(void)
605 char *x = realpath(".", NULL), *y = realpath("/", NULL);
606 return (x != NULL && y != NULL) ? 0 : 1;
610 link_check wordexp 'for wordexp()' '#define HAVE_WORDEXP' << \!
611 #include <wordexp.h>
612 int main(void)
614 wordexp((char *)0, (wordexp_t *)0, 0);
615 return 0;
621 if wantfeat DEBUG; then
622 echo '#define HAVE_DEBUG' >> ${h}
625 if wantfeat AMALGAMATION; then
626 echo '#define HAVE_AMALGAMATION' >> ${h}
629 if nwantfeat NOALLOCA; then
630 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
631 # versions of alloca(3) since modern compilers just can't be trusted
632 # not to overoptimize and silently break some code
633 link_check alloca 'for __builtin_alloca()' \
634 '#define HAVE_ALLOCA __builtin_alloca' << \!
635 int main(void)
637 void *vp = __builtin_alloca(1);
638 return (!! vp);
643 if nwantfeat NOGETOPT; then
644 link_check getopt 'for getopt()' '#define HAVE_GETOPT' << \!
645 #include <unistd.h>
646 int main(int argc, char **argv)
648 #if defined __GLIBC__ || defined __linux__
649 Argument and option reordering is not a desired feature.
650 #else
651 getopt(argc, argv, "oPt");
652 #endif
653 return (((long)optarg + optind) & 0x7F);
660 if wantfeat ICONV; then
661 ${cat} > ${tmp2}.c << \!
662 #include <iconv.h>
663 int main(void)
665 iconv_t id;
667 id = iconv_open("foo", "bar");
668 return 0;
671 < ${tmp2}.c link_check iconv 'for iconv functionality' \
672 '#define HAVE_ICONV' ||
673 < ${tmp2}.c link_check iconv \
674 'for iconv functionality in libiconv' \
675 '#define HAVE_ICONV' '-liconv'
676 else
677 echo '/* WANT_ICONV=0 */' >> ${h}
678 fi # wantfeat ICONV
680 if wantfeat SOCKETS; then
681 compile_check arpa_inet_h 'for <arpa/inet.h>' \
682 '#define HAVE_ARPA_INET_H' << \!
683 #include "config.h"
684 #include <sys/types.h>
685 #include <sys/socket.h>
686 #include <netdb.h>
687 #include <netinet/in.h>
688 #include <arpa/inet.h>
691 ${cat} > ${tmp2}.c << \!
692 #include "config.h"
693 #include <sys/types.h>
694 #include <sys/socket.h>
695 #include <netdb.h>
696 #include <netinet/in.h>
697 #ifdef HAVE_ARPA_INET_H
698 #include <arpa/inet.h>
699 #endif
701 int main(void)
703 struct sockaddr s;
704 socket(AF_INET, SOCK_STREAM, 0);
705 connect(0, &s, 0);
706 gethostbyname("foo");
707 return 0;
711 < ${tmp2}.c link_check sockets 'for sockets in libc' \
712 '#define HAVE_SOCKETS' ||
713 < ${tmp2}.c link_check sockets 'for sockets in libnsl' \
714 '#define HAVE_SOCKETS' '-lnsl' ||
715 < ${tmp2}.c link_check sockets \
716 'for sockets in libsocket and libnsl' \
717 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
718 WANT_SOCKETS=0
720 # XXX Shouldn't it be a hard error if there is no socket support, then?
721 option_update
722 else
723 echo '/* WANT_SOCKETS=0 */' >> ${h}
724 fi # wantfeat SOCKETS
726 wantfeat SOCKETS &&
727 link_check setsockopt 'for setsockopt()' '#define HAVE_SETSOCKOPT' << \!
728 #include <sys/socket.h>
729 #include <stdlib.h>
730 int main(void)
732 int sockfd = 3;
733 setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0);
734 return 0;
738 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
739 link_check so_sndtimeo 'for SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
740 #include <sys/socket.h>
741 #include <stdlib.h>
742 int main(void)
744 struct timeval tv;
745 int sockfd = 3;
746 tv.tv_sec = 42;
747 tv.tv_usec = 21;
748 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
749 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
750 return 0;
754 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
755 link_check so_linger 'for SO_LINGER' '#define HAVE_SO_LINGER' << \!
756 #include <sys/socket.h>
757 #include <stdlib.h>
758 int main(void)
760 struct linger li;
761 int sockfd = 3;
762 li.l_onoff = 1;
763 li.l_linger = 42;
764 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
765 return 0;
769 if wantfeat IPV6; then
770 link_check ipv6 'for IPv6 functionality' '#define HAVE_IPV6' << \!
771 #include "config.h"
772 #include <sys/types.h>
773 #include <sys/socket.h>
774 #include <netdb.h>
775 #include <netinet/in.h>
776 #ifdef HAVE_ARPA_INET_H
777 #include <arpa/inet.h>
778 #endif
780 int main(void)
782 struct addrinfo a, *ap;
783 getaddrinfo("foo", "0", &a, &ap);
784 return 0;
787 else
788 echo '/* WANT_IPV6=0 */' >> ${h}
789 fi # wantfeat IPV6
791 if wantfeat IMAP; then
792 echo '#define HAVE_IMAP' >> ${h}
793 else
794 echo '/* WANT_IMAP=0 */' >> ${h}
797 if wantfeat POP3; then
798 echo '#define HAVE_POP3' >> ${h}
799 else
800 echo '/* WANT_POP3=0 */' >> ${h}
803 if wantfeat SMTP; then
804 echo '#define HAVE_SMTP' >> ${h}
805 else
806 echo '/* WANT_SMTP=0 */' >> ${h}
809 if wantfeat SSL; then
810 link_check openssl 'for sufficiently recent OpenSSL' \
811 '#define HAVE_SSL
812 #define HAVE_OPENSSL' '-lssl -lcrypto' << \!
813 #include <openssl/ssl.h>
814 #include <openssl/err.h>
815 #include <openssl/x509v3.h>
816 #include <openssl/x509.h>
817 #include <openssl/rand.h>
819 #if defined OPENSSL_NO_SSL2 && defined OPENSSL_NO_SSL3 &&\
820 defined OPENSSL_NO_TLS1
821 # error We need one of (SSLv2 and) SSLv3 and TLS1.
822 #endif
824 int main(void)
826 SSLv23_client_method();
827 #ifndef OPENSSL_NO_SSL3
828 SSLv3_client_method();
829 #endif
830 #ifndef OPENSSL_NO_TLS1
831 TLSv1_client_method();
832 # ifdef TLS1_1_VERSION
833 TLSv1_1_client_method();
834 # endif
835 # ifdef TLS1_2_VERSION
836 TLSv1_2_client_method();
837 # endif
838 #endif
839 PEM_read_PrivateKey(0, 0, 0, 0);
840 return 0;
844 if [ "${have_openssl}" = 'yes' ]; then
845 compile_check stack_of 'for OpenSSL STACK_OF()' \
846 '#define HAVE_STACK_OF' << \!
847 #include <openssl/ssl.h>
848 #include <openssl/err.h>
849 #include <openssl/x509v3.h>
850 #include <openssl/x509.h>
851 #include <openssl/rand.h>
853 int main(void)
855 STACK_OF(GENERAL_NAME) *gens = NULL;
856 printf("%p", gens); /* to make it used */
857 return 0;
861 if wantfeat MD5; then
862 run_check openssl_md5 'for MD5 digest in OpenSSL' \
863 '#define HAVE_OPENSSL_MD5' << \!
864 #include <string.h>
865 #include <openssl/md5.h>
867 int main(void)
869 char const dat[] = "abrakadabrafidibus";
870 char dig[16], hex[16 * 2];
871 MD5_CTX ctx;
872 size_t i, j;
874 memset(dig, 0, sizeof(dig));
875 memset(hex, 0, sizeof(hex));
876 MD5_Init(&ctx);
877 MD5_Update(&ctx, dat, sizeof(dat) - 1);
878 MD5_Final(dig, &ctx);
880 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
881 for (i = 0; i < sizeof(hex) / 2; i++) {
882 j = i << 1;
883 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
884 hex[++j] = hexchar(dig[i] & 0x0f);
886 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
889 fi # wantfeat MD5
891 else
892 echo '/* WANT_SSL=0 */' >> ${h}
893 fi # wantfeat SSL
895 if wantfeat GSSAPI; then
896 ${cat} > ${tmp2}.c << \!
897 #include <gssapi/gssapi.h>
899 int main(void)
901 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
902 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
903 return 0;
906 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
908 if command -v krb5-config >/dev/null 2>&1; then
909 i=`command -v krb5-config`
910 GSSAPI_LIBS="`CFLAGS= ${i} --libs gssapi`"
911 GSSAPI_INCS="`CFLAGS= ${i} --cflags`"
912 i='for GSSAPI via krb5-config(1)'
913 else
914 GSSAPI_LIBS='-lgssapi'
915 GSSAPI_INCS=
916 i='for GSSAPI in gssapi/gssapi.h, libgssapi'
918 < ${tmp2}.c link_check gssapi \
919 "${i}" '#define HAVE_GSSAPI' \
920 "${GSSAPI_LIBS}" "${GSSAPI_INCS}" ||\
921 < ${tmp3}.c link_check gssapi \
922 'for GSSAPI in gssapi.h, libgssapi' \
923 '#define HAVE_GSSAPI
924 #define GSSAPI_REG_INCLUDE' \
925 '-lgssapi' ||\
926 < ${tmp2}.c link_check gssapi 'for GSSAPI in libgssapi_krb5' \
927 '#define HAVE_GSSAPI' \
928 '-lgssapi_krb5' ||\
929 < ${tmp3}.c link_check gssapi \
930 'for GSSAPI in libgssapi, OpenBSD-style (pre 5.3)' \
931 '#define HAVE_GSSAPI
932 #define GSSAPI_REG_INCLUDE' \
933 '-lgssapi -lkrb5 -lcrypto' \
934 '-I/usr/include/kerberosV' ||\
935 < ${tmp2}.c link_check gssapi 'for GSSAPI in libgss' \
936 '#define HAVE_GSSAPI' \
937 '-lgss' ||\
938 link_check gssapi 'for GSSAPI in libgssapi_krb5, old-style' \
939 '#define HAVE_GSSAPI
940 #define GSSAPI_OLD_STYLE' \
941 '-lgssapi_krb5' << \!
942 #include <gssapi/gssapi.h>
943 #include <gssapi/gssapi_generic.h>
945 int main(void)
947 gss_import_name(0, 0, gss_nt_service_name, 0);
948 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
949 return 0;
952 else
953 echo '/* WANT_GSSAPI=0 */' >> ${h}
954 fi # wantfeat GSSAPI
956 if wantfeat IDNA; then
957 link_check idna 'for GNU Libidn' '#define HAVE_IDNA' '-lidn' << \!
958 #include <idna.h>
959 #include <idn-free.h>
960 #include <stringprep.h>
961 int main(void)
963 char *utf8, *idna_ascii, *idna_utf8;
964 utf8 = stringprep_locale_to_utf8("does.this.work");
965 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
966 != IDNA_SUCCESS)
967 return 1;
968 idn_free(idna_ascii);
969 /* (Rather link check only here) */
970 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
971 return 0;
974 else
975 echo '/* WANT_IDNA=0 */' >> ${h}
978 if wantfeat REGEX; then
979 link_check regex 'for regular expressions' '#define HAVE_REGEX' << \!
980 #include <regex.h>
981 #include <stdlib.h>
982 int main(void)
984 int status;
985 regex_t re;
986 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
987 return 1;
988 status = regexec(&re, "plan9", 0,NULL, 0);
989 regfree(&re);
990 return !(status == REG_NOMATCH);
993 else
994 echo '/* WANT_REGEX=0 */' >> ${h}
997 if wantfeat READLINE; then
998 __edrdlib() {
999 link_check readline "for readline(3) (${1})" \
1000 '#define HAVE_READLINE' "${1}" << \!
1001 #include <stdio.h>
1002 #include <readline/history.h>
1003 #include <readline/readline.h>
1004 int main(void)
1006 char *rl;
1007 HISTORY_STATE *hs;
1008 HIST_ENTRY **he;
1009 int i;
1010 using_history();
1011 read_history("");
1012 stifle_history(242);
1013 rl = readline("Enter a line:");
1014 if (rl && *rl)
1015 add_history(rl);
1016 write_history("");
1017 rl_extend_line_buffer(10);
1018 rl_point = rl_end = 10;
1019 rl_pre_input_hook = (rl_hook_func_t*)NULL;
1020 rl_forced_update_display();
1021 clear_history();
1022 hs = history_get_history_state();
1023 i = hs->length;
1024 he = history_list();
1025 if (i > 0)
1026 rl = he[0]->line;
1027 rl_free_line_state();
1028 rl_cleanup_after_signal();
1029 rl_reset_after_signal();
1030 return 0;
1035 __edrdlib -lreadline ||
1036 __edrdlib '-lreadline -ltermcap'
1037 [ -n "${have_readline}" ] && WANT_TABEXPAND=1
1040 if wantfeat EDITLINE && [ -z "${have_readline}" ]; then
1041 __edlib() {
1042 link_check editline "for editline(3) (${1})" \
1043 '#define HAVE_EDITLINE' "${1}" << \!
1044 #include <histedit.h>
1045 static char * getprompt(void) { return (char*)"ok"; }
1046 int main(void)
1048 EditLine *el_el = el_init("TEST", stdin, stdout, stderr);
1049 HistEvent he;
1050 History *el_hcom = history_init();
1051 history(el_hcom, &he, H_SETSIZE, 242);
1052 el_set(el_el, EL_SIGNAL, 0);
1053 el_set(el_el, EL_TERMINAL, NULL);
1054 el_set(el_el, EL_HIST, &history, el_hcom);
1055 el_set(el_el, EL_EDITOR, "emacs");
1056 el_set(el_el, EL_PROMPT, &getprompt);
1057 el_source(el_el, NULL);
1058 history(el_hcom, &he, H_GETSIZE);
1059 history(el_hcom, &he, H_CLEAR);
1060 el_end(el_el);
1061 /* TODO add loader and addfn checks */
1062 history_end(el_hcom);
1063 return 0;
1068 __edlib -ledit ||
1069 __edlib '-ledit -ltermcap'
1070 [ -n "${have_editline}" ] && WANT_TABEXPAND=0
1073 if wantfeat NCL && [ -z "${have_editline}" ] && [ -z "${have_readline}" ] &&\
1074 [ -n "${have_c90amend1}" ]; then
1075 have_ncl=1
1076 echo '#define HAVE_NCL' >> ${h}
1077 else
1078 echo '/* WANT_{READLINE,EDITLINE,NCL}=0 */' >> ${h}
1081 # Generic have-a-command-line-editor switch for those who need it below
1082 if [ -n "${have_ncl}" ] || [ -n "${have_editline}" ] ||\
1083 [ -n "${have_readline}" ]; then
1084 have_cle=1
1087 if [ -n "${have_cle}" ] && wantfeat TABEXPAND; then
1088 echo '#define HAVE_TABEXPAND' >> ${h}
1089 else
1090 echo '/* WANT_TABEXPAND=0 */' >> ${h}
1093 if [ -n "${have_cle}" ] && wantfeat HISTORY; then
1094 echo '#define HAVE_HISTORY' >> ${h}
1095 else
1096 echo '/* WANT_HISTORY=0 */' >> ${h}
1099 if wantfeat SPAM; then
1100 echo '#define HAVE_SPAM' >> ${h}
1101 if command -v spamc >/dev/null 2>&1; then
1102 echo "#define SPAMC_PATH \"`command -v spamc`\"" >> ${h}
1104 else
1105 echo '/* WANT_SPAM=0 */' >> ${h}
1108 if wantfeat DOCSTRINGS; then
1109 echo '#define HAVE_DOCSTRINGS' >> ${h}
1110 else
1111 echo '/* WANT_DOCSTRINGS=0 */' >> ${h}
1114 if wantfeat QUOTE_FOLD &&\
1115 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
1116 echo '#define HAVE_QUOTE_FOLD' >> ${h}
1117 else
1118 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
1121 if wantfeat COLOUR; then
1122 echo '#define HAVE_COLOUR' >> ${h}
1123 else
1124 echo '/* WANT_COLOUR=0 */' >> ${h}
1127 if wantfeat IMAP_SEARCH; then
1128 echo '#define HAVE_IMAP_SEARCH' >> ${h}
1129 else
1130 echo '/* WANT_IMAP_SEARCH=0 */' >> ${h}
1133 if wantfeat MD5; then
1134 echo '#define HAVE_MD5' >> ${h}
1135 else
1136 echo '/* WANT_MD5=0 */' >> ${h}
1139 ## Summarizing ##
1141 # Since we cat(1) the content of those to cc/"ld", convert them to single line
1142 squeeze_em() {
1143 < "${1}" > "${2}" ${awk} \
1144 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1146 ${rm} -f ${tmp}
1147 squeeze_em ${inc} ${tmp}
1148 ${mv} ${tmp} ${inc}
1149 squeeze_em ${lib} ${tmp}
1150 ${mv} ${tmp} ${lib}
1152 # config.h
1153 ${mv} ${h} ${tmp}
1154 printf '#ifndef _CONFIG_H\n# define _CONFIG_H\n' > ${h}
1155 ${cat} ${tmp} >> ${h}
1157 printf '\n/* The "feature string", for "simplicity" and lex.c */\n' >> ${h}
1158 printf '#ifdef _MAIN_SOURCE\n' >> ${h}
1159 printf '# ifdef HAVE_AMALGAMATION\nstatic\n# endif\n' >> ${h}
1160 printf 'char const features[] = "MIME"\n' >> ${h}
1161 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
1162 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
1163 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
1164 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
1165 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
1166 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
1167 printf '# ifdef HAVE_IPV6\n ",IPv6"\n# endif\n' >> ${h}
1168 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TLS"\n# endif\n' >> ${h}
1169 printf '# ifdef HAVE_IMAP\n ",IMAP"\n# endif\n' >> ${h}
1170 printf '# ifdef HAVE_GSSAPI\n ",GSSAPI"\n# endif\n' >> ${h}
1171 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
1172 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
1173 printf '# ifdef HAVE_SPAM\n ",SPAM"\n# endif\n' >> ${h}
1174 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
1175 printf '# ifdef HAVE_IMAP_SEARCH\n ",IMAP-searches"\n# endif\n' >> ${h}
1176 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
1177 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
1178 printf '# ifdef HAVE_EDITLINE\n ",EDITLINE"\n# endif\n' >> ${h}
1179 printf '# ifdef HAVE_NCL\n ",NCL"\n# endif\n' >> ${h}
1180 printf '# ifdef HAVE_TABEXPAND\n ",TABEXPAND"\n# endif\n' >> ${h}
1181 printf '# ifdef HAVE_HISTORY\n ",HISTORY MANAGEMENT"\n# endif\n' >> ${h}
1182 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
1183 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
1184 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
1185 printf ';\n#endif /* _MAIN_SOURCE */\n' >> ${h}
1187 printf '#endif /* _CONFIG_H */\n' >> ${h}
1188 ${rm} -f ${tmp}
1190 # Create the real mk.mk
1191 ${rm} -rf ${tmp0}.* ${tmp0}*
1192 printf 'OBJ_SRC = ' >> ${mk}
1193 if nwantfeat AMALGAMATION; then
1194 echo *.c >> ${mk}
1195 echo 'OBJ_DEP =' >> ${mk}
1196 else
1197 j=`echo "${src}" | sed 's/^.\///'`
1198 echo "${j}" >> ${mk}
1199 printf 'OBJ_DEP = main.c ' >> ${mk}
1200 printf '#define _MAIN_SOURCE\n' >> ${src}
1201 printf '#include "nail.h"\n#include "main.c"\n' >> ${src}
1202 for i in *.c; do
1203 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ]; then
1204 continue
1206 printf "${i} " >> ${mk}
1207 printf "#include \"${i}\"\n" >> ${src}
1208 done
1209 echo >> ${mk}
1212 echo "LIBS = `${cat} ${lib}`" >> ${mk}
1213 echo "INCLUDES = `${cat} ${inc}`" >> ${mk}
1214 echo >> ${mk}
1215 ${cat} ./mk-mk.in >> ${mk}
1217 ## Finished! ##
1219 ${cat} > ${tmp2}.c << \!
1220 #include "config.h"
1221 #ifdef HAVE_NL_LANGINFO
1222 # include <langinfo.h>
1223 #endif
1225 :The following optional features are enabled:
1226 #ifdef HAVE_ICONV
1227 : + Character set conversion using iconv()
1228 #endif
1229 #ifdef HAVE_SETLOCALE
1230 : + Locale support: Printable characters depend on the environment
1231 # ifdef HAVE_C90AMEND1
1232 : + Multibyte character support
1233 # endif
1234 # ifdef HAVE_NL_LANGINFO
1235 : + Automatic detection of terminal character set
1236 # endif
1237 #endif
1238 #ifdef HAVE_SOCKETS
1239 : + Network support
1240 #endif
1241 #ifdef HAVE_IPV6
1242 : + Support for Internet Protocol v6 (IPv6)
1243 #endif
1244 #ifdef HAVE_SSL
1245 # ifdef HAVE_OPENSSL
1246 : + S/MIME and SSL/TLS using OpenSSL
1247 # endif
1248 #endif
1249 #ifdef HAVE_IMAP
1250 : + IMAP protocol
1251 #endif
1252 #ifdef HAVE_GSSAPI
1253 : + IMAP GSSAPI authentication
1254 #endif
1255 #ifdef HAVE_POP3
1256 : + POP3 protocol
1257 #endif
1258 #ifdef HAVE_SMTP
1259 : + SMTP protocol
1260 #endif
1261 #ifdef HAVE_SPAM
1262 : + Interaction with spam filters
1263 #endif
1264 #ifdef HAVE_IDNA
1265 : + IDNA (internationalized domain names for applications) support
1266 #endif
1267 #ifdef HAVE_IMAP_SEARCH
1268 : + IMAP-style search expressions
1269 #endif
1270 #ifdef HAVE_REGEX
1271 : + Regular expression searches
1272 #endif
1273 #if defined HAVE_READLINE || defined HAVE_EDITLINE || defined HAVE_NCL
1274 : + Command line editing
1275 # ifdef HAVE_TABEXPAND
1276 : + + Tabulator expansion
1277 # endif
1278 # ifdef HAVE_HISTORY
1279 : + + History management
1280 # endif
1281 #endif
1282 #ifdef HAVE_QUOTE_FOLD
1283 : + Extended *quote-fold*ing
1284 #endif
1285 #ifdef HAVE_COLOUR
1286 : + Coloured message display (simple)
1287 #endif
1289 :The following optional features are disabled:
1290 #ifndef HAVE_ICONV
1291 : - Character set conversion using iconv()
1292 #endif
1293 #ifndef HAVE_SETLOCALE
1294 : - Locale support: Only ASCII characters are recognized
1295 #endif
1296 # ifndef HAVE_C90AMEND1
1297 : - Multibyte character support
1298 # endif
1299 # ifndef HAVE_NL_LANGINFO
1300 : - Automatic detection of terminal character set
1301 # endif
1302 #ifndef HAVE_SOCKETS
1303 : - Network support
1304 #endif
1305 #ifndef HAVE_IPV6
1306 : - Support for Internet Protocol v6 (IPv6)
1307 #endif
1308 #if !defined HAVE_SSL
1309 : - SSL/TLS (network transport authentication and encryption)
1310 #endif
1311 #ifndef HAVE_IMAP
1312 : - IMAP protocol
1313 #endif
1314 #ifndef HAVE_GSSAPI
1315 : - IMAP GSSAPI authentication
1316 #endif
1317 #ifndef HAVE_POP3
1318 : - POP3 protocol
1319 #endif
1320 #ifndef HAVE_SMTP
1321 : - SMTP protocol
1322 #endif
1323 #ifndef HAVE_SPAM
1324 : - Interaction with spam filters
1325 #endif
1326 #ifndef HAVE_IDNA
1327 : - IDNA (internationalized domain names for applications) support
1328 #endif
1329 #ifndef HAVE_IMAP_SEARCH
1330 : - IMAP-style search expressions
1331 #endif
1332 #ifndef HAVE_REGEX
1333 : - Regular expression searches
1334 #endif
1335 #if !defined HAVE_READLINE && !defined HAVE_EDITLINE && !defined HAVE_NCL
1336 : - Command line editing and history
1337 #endif
1338 #ifndef HAVE_QUOTE_FOLD
1339 : - Extended *quote-fold*ing
1340 #endif
1341 #ifndef HAVE_COLOUR
1342 : - Coloured message display (simple)
1343 #endif
1345 :Remarks:
1346 #ifndef HAVE_SNPRINTF
1347 : . The function snprintf() could not be found. mailx will be compiled to use
1348 : sprintf() instead. This might overflow buffers if input values are larger
1349 : than expected. Use the resulting binary with care or update your system
1350 : environment and start the configuration process again.
1351 #endif
1352 #ifndef HAVE_FCHDIR
1353 : . The function fchdir() could not be found. mailx will be compiled to use
1354 : chdir() instead. This is not a problem unless the current working
1355 : directory of mailx is moved while the IMAP cache is used.
1356 #endif
1357 #ifndef HAVE_GETOPT
1358 : . Using a minimal builtin POSIX-like getopt()
1359 #endif
1360 #ifdef HAVE_DEBUG
1361 : . Debug enabled binary: not meant to be used by end-users: THANKS!
1362 #endif
1366 ${make} -f ${makefile} ${tmp2}.x
1367 < ${tmp2}.x >&5 ${sed} -e '/^[^:]/d; /^$/d; s/^://'
1369 # vim:set fenc=utf-8:s-it-mode