Bump S-nail v14.7.6
[s-mailx.git] / mk-conf.sh
blob04e528b07d0e9d8bc86ef7fe662d53a918d813f5
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_POP3=0
32 WANT_IMAP=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_SMTP=0 WANT_POP3=0 WANT_IMAP=0 WANT_GSSAPI=0
54 WANT_NETRC=0 WANT_AGENT=0
56 if nwantfeat SMTP && nwantfeat POP3 && nwantfeat IMAP; then
57 WANT_SOCKETS=0 WANT_IPV6=0 WANT_SSL=0 WANT_NETRC=0 WANT_AGENT=0
59 if nwantfeat SMTP && nwantfeat IMAP; then
60 WANT_GSSAPI=0
62 # If we don't need MD5 except for producing boundary and message-id strings,
63 # leave it off, plain old srand(3) should be enough for that purpose.
64 if nwantfeat SOCKETS; then
65 WANT_MD5=0
67 if wantfeat DEBUG; then
68 WANT_NOALLOCA=1 WANT_DEVEL=1
72 # Check out compiler ($CC) and -flags ($CFLAGS)
73 compiler_flags() {
74 # $CC is overwritten when empty or a default "cc", even without WANT_AUTOCC
75 optim= dbgoptim= _CFLAGS=
76 if [ -z "${CC}" ] || [ "${CC}" = cc ]; then
77 if { CC="`command -v clang`"; }; then
79 elif { CC="`command -v gcc`"; }; then
81 elif { CC="`command -v c89`"; }; then
82 [ "`uname -s`" = 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} -std=c89 -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 _CFLAGS="${_CFLAGS} -Wno-long-long" # ISO C89 has no 'long long'...
108 if { i=${ccver}; echo "${i}"; } | ${grep} -q -e 'clang version 1'; then
109 _CFLAGS="${_CFLAGS} -Wstrict-overflow=5"
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 # elif { i=${ccver}; echo "${i}"; } | ${grep} -q -i -e clang; then
123 # optim=-O3 dbgoptim=-O
124 # stackprot=yes
125 # _CFLAGS='-std=c89 -Weverything -Wno-long-long'
126 # if wantfeat AMALGAMATION; then
127 # _CFLAGS="${_CFLAGS} -pipe"
128 # fi
129 elif [ -z "${optim}" ]; then
130 optim=-O1 dbgoptim=-O
133 if nwantfeat DEBUG; then
134 _CFLAGS="${optim} -DNDEBUG ${_CFLAGS}"
135 else
136 _CFLAGS="${dbgoptim} -g ${_CFLAGS}";
137 if [ "${stackprot}" = yes ]; then
138 _CFLAGS="${_CFLAGS} -ftrapv -fstack-protector-all "
139 _CFLAGS="${_CFLAGS} -Wstack-protector -D_FORTIFY_SOURCE=2"
142 _CFLAGS="${_CFLAGS} ${ADDCFLAGS}"
143 # XXX -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack: need detection
144 _LDFLAGS="${_LDFLAGS} ${ADDLDFLAGS}" # XXX -Wl,--sort-common,[-O1]
145 export _CFLAGS _LDFLAGS
147 # $CFLAGS and $LDFLAGS are only overwritten if explicitly wanted
148 if wantfeat AUTOCC; then
149 CFLAGS=$_CFLAGS
150 LDFLAGS=$_LDFLAGS
151 export CFLAGS LDFLAGS
155 ## -- >8 -- 8< -- ##
157 ## Notes:
158 ## - Heirloom sh(1) (and same origin) have problems with ': >' redirection,
159 ## so use "printf '' >" instead
160 ## - Heirloom sh(1) and maybe more execute loops with redirection in a subshell
161 ## (but don't export eval's from within), therefore we need to (re)include
162 ## variable assignments at toplevel instead (via reading temporary files)
164 ## First of all, create new configuration and check wether it changed ##
166 conf=./conf.rc
167 lst=./config.lst
168 h=./config.h
169 mk=./mk.mk
171 newlst=./config.lst-new
172 newmk=./config.mk-new
173 newh=./config.h-new
174 tmp0=___tmp
175 tmp=./${tmp0}1$$
177 # We need some standard utilities
178 unset -f command
179 check_tool() {
180 n=$1 i=$2 opt=${3:-0}
181 if type "${i}" >/dev/null 2>&1; then
182 eval ${n}=${i}
183 return 1
185 if [ ${opt} -eq 0 ]; then
186 echo >&2 "ERROR: no trace of the utility \`${n}'"
187 exit 1
189 return 0
192 # Check those tools right now that we need before including ${conf}
193 check_tool rm "${rm:-`command -v rm`}"
194 check_tool sed "${sed:-`command -v sed`}"
196 # Only incorporate what wasn't overwritten from command line / CONFIG
197 trap "${rm} -f ${tmp}; exit" 1 2 15
198 trap "${rm} -f ${tmp}" 0
199 ${rm} -f ${tmp}
201 < ${conf} ${sed} -e '/^[ \t]*#/d' -e '/^$/d' -e 's/[ \t]*$//' |
202 while read line; do
203 i="`echo ${line} | ${sed} -e 's/=.*$//'`"
204 eval j="\$${i}" jx="\${${i}+x}"
205 if [ -n "${j}" ] || [ "${jx}" = x ]; then
206 line="${i}=\"${j}\""
208 echo ${line}
209 done > ${tmp}
210 . ./${tmp}
212 check_tool awk "${awk:-`command -v awk`}"
213 check_tool cat "${cat:-`command -v cat`}"
214 check_tool chmod "${chmod:-`command -v chmod`}"
215 check_tool cp "${cp:-`command -v cp`}"
216 check_tool cmp "${cmp:-`command -v cmp`}"
217 check_tool grep "${grep:-`command -v grep`}"
218 check_tool mkdir "${mkdir:-`command -v mkdir`}"
219 check_tool mv "${mv:-`command -v mv`}"
220 # rm(1), sed(1) above
221 check_tool tee "${tee:-`command -v tee`}"
223 check_tool make "${MAKE:-`command -v make`}"
224 check_tool strip "${STRIP:-`command -v strip`}" 1
225 HAVE_STRIP=${?}
227 wantfeat() {
228 eval i=\$WANT_${1}
229 [ "${i}" = "1" ]
231 nwantfeat() {
232 eval i=\$WANT_${1}
233 [ "${i}" != "1" ]
236 option_update
238 # (No function since some shells loose non-exported variables in traps)
239 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}; exit" 1 2 15
240 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}" 0
241 ${rm} -f ${newlst} ${newmk} ${newh}
243 # (Could: use FD redirection, add eval(1) and don't re-'. ./${newlst}')
244 while read line; do
245 i=`echo ${line} | ${sed} -e 's/=.*$//'`
246 eval j=\$${i}
247 if [ -z "${j}" ] || [ "${j}" = 0 ]; then
248 printf "/*#define ${i}*/\n" >> ${newh}
249 elif [ "${j}" = 1 ]; then
250 printf "#define ${i}\n" >> ${newh}
251 else
252 printf "#define ${i} \"${j}\"\n" >> ${newh}
254 printf "${i} = ${j}\n" >> ${newmk}
255 printf "${i}=\"${j}\"\n"
256 done < ${tmp} > ${newlst}
257 . ./${newlst}
259 printf "#define UAGENT \"${SID}${NAIL}\"\n" >> ${newh}
260 printf "UAGENT = ${SID}${NAIL}\n" >> ${newmk}
262 compiler_flags
264 printf "CC = ${CC}\n" >> ${newmk}
265 printf "_CFLAGS = ${_CFLAGS}\nCFLAGS = ${CFLAGS}\n" >> ${newmk}
266 printf "_LDFLAGS = ${_LDFLAGS}\nLDFLAGS = ${LDFLAGS}\n" >> ${newmk}
267 printf "AWK = ${awk}\nCMP = ${cmp}\nCHMOD = ${chmod}\nCP = ${cp}\n" >> ${newmk}
268 printf "GREP = ${grep}\nMKDIR = ${mkdir}\nRM = ${rm}\nSED = ${sed}\n" \
269 >> ${newmk}
270 printf "STRIP = ${strip}\nHAVE_STRIP = ${HAVE_STRIP}\n" >> ${newmk}
271 # (We include the cc(1)/ld(1) environment only for update detection..)
272 printf "CC=\"${CC}\"\n" >> ${newlst}
273 printf "_CFLAGS=\"${_CFLAGS}\"\nCFLAGS=\"${CFLAGS}\"\n" >> ${newlst}
274 printf "_LDFLAGS=\"${_LDFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n" >> ${newlst}
275 printf "AWK=${awk}\nCMP=${cmp}\nCHMOD=${chmod}\nCP=${cp}\n" >> ${newlst}
276 printf "GREP=${grep}\nMKDIR=${mkdir}\nRM=${rm}\nSED=${sed}\n" >> ${newlst}
277 printf "STRIP=${strip}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newlst}
279 if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
280 exit 0
282 [ -f ${lst} ] && echo 'configuration updated..' || echo 'shiny configuration..'
284 ${mv} -f ${newlst} ${lst}
285 ${mv} -f ${newh} ${h}
286 ${mv} -f ${newmk} ${mk}
288 ## Compile and link checking ##
290 tmp2=./${tmp0}2$$
291 tmp3=./${tmp0}3$$
292 log=./config.log
293 lib=./config.lib
294 inc=./config.inc
295 src=./config.c
296 makefile=./config.mk
298 # (No function since some shells loose non-exported variables in traps)
299 trap "${rm} -f ${lst} ${h} ${mk} ${lib} ${inc} ${src} ${makefile}; exit" 1 2 15
300 trap "${rm} -rf ${tmp0}.* ${tmp0}* ${makefile}" 0
302 exec 5>&2 > ${log} 2>&1
303 printf '' > ${lib}
304 printf '' > ${inc}
305 # ${src} is only created if WANT_AMALGAMATION
306 ${rm} -f ${src}
307 ${cat} > ${makefile} << \!
308 .SUFFIXES: .o .c .x .y
309 .c.o:
310 $(CC) $(XINCS) -c $<
311 .c.x:
312 $(CC) $(XINCS) -E $< >$@
314 $(CC) $(XINCS) -o $@ $< $(XLIBS)
315 .y: ;
318 msg() {
319 fmt=$1
321 shift
322 printf "*** ${fmt}\\n" "${@}"
323 printf "${fmt}" "${@}" >&5
326 _check_preface() {
327 variable=$1 topic=$2 define=$3
329 echo '**********'
330 msg "checking ${topic} ... "
331 echo "/* checked ${topic} */" >> ${h}
332 ${rm} -f ${tmp} ${tmp}.o
333 echo '*** test program is'
334 ${tee} ${tmp}.c
335 #echo '*** the preprocessor generates'
336 #${make} -f ${makefile} ${tmp}.x
337 #${cat} ${tmp}.x
338 echo '*** results are'
341 compile_check() {
342 variable=$1 topic=$2 define=$3
344 _check_preface "${variable}" "${topic}" "${define}"
346 if ${make} -f ${makefile} XINCS="${INCS}" ./${tmp}.o &&
347 [ -f ./${tmp}.o ]; then
348 msg "yes\\n"
349 echo "${define}" >> ${h}
350 eval have_${variable}=yes
351 return 0
352 else
353 echo "/* ${define} */" >> ${h}
354 msg "no\\n"
355 eval unset have_${variable}
356 return 1
360 _link_mayrun() {
361 run=$1 variable=$2 topic=$3 define=$4 libs=$5 incs=$6
363 _check_preface "${variable}" "${topic}" "${define}"
365 if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
366 XLIBS="${LIBS} ${libs}" ./${tmp} &&
367 [ -f ./${tmp} ] &&
368 { [ ${run} -eq 0 ] || ./${tmp}; }; then
369 echo "*** adding INCS<${incs}> LIBS<${libs}>"
370 msg "yes\\n"
371 echo "${define}" >> ${h}
372 LIBS="${LIBS} ${libs}"
373 echo "${libs}" >> ${lib}
374 INCS="${INCS} ${incs}"
375 echo "${incs}" >> ${inc}
376 eval have_${variable}=yes
377 return 0
378 else
379 msg "no\\n"
380 echo "/* ${define} */" >> ${h}
381 eval unset have_${variable}
382 return 1
386 link_check() {
387 _link_mayrun 0 "${1}" "${2}" "${3}" "${4}" "${5}"
390 run_check() {
391 _link_mayrun 1 "${1}" "${2}" "${3}" "${4}" "${5}"
394 # Build a basic set of INCS and LIBS according to user environment.
395 # On pkgsrc(7) systems automatically add /usr/pkg/*
396 if [ -n "${C_INCLUDE_PATH}" ]; then
397 i=${IFS}
398 IFS=:
399 set -- ${C_INCLUDE_PATH}
400 IFS=${i}
401 # for i; do -- new in POSIX Issue 7 + TC1
402 for i
404 [ "${i}" = '/usr/pkg/include' ] && continue
405 INCS="${INCS} -I${i}"
406 done
408 [ -d /usr/pkg/include ] && INCS="${INCS} -I/usr/pkg/include"
409 echo "${INCS}" >> ${inc}
411 if [ -n "${LD_LIBRARY_PATH}" ]; then
412 i=${IFS}
413 IFS=:
414 set -- ${LD_LIBRARY_PATH}
415 IFS=${i}
416 # for i; do -- new in POSIX Issue 7 + TC1
417 for i
419 [ "${i}" = '/usr/pkg/lib' ] && continue
420 LIBS="${LIBS} -L${i}"
421 done
423 [ -d /usr/pkg/lib ] && LIBS="${LIBS} -L/usr/pkg/lib"
424 echo "${LIBS}" >> ${lib}
428 # Better set _GNU_SOURCE (if we are on Linux only?); 'surprised it did without
429 echo '#define _GNU_SOURCE' >> ${h}
431 if link_check hello 'if a hello world program can be built' << \!
432 #include <stdio.h>
434 int main(int argc, char *argv[])
436 (void)argc;
437 (void)argv;
438 puts("hello world");
439 return 0;
442 then
444 else
445 echo >&5 'This oooops is most certainly not related to me.'
446 echo >&5 "Read the file ${log} and check your compiler environment."
447 ${rm} -f ${lst} ${h} ${mk}
448 exit 1
451 if link_check termios 'for termios.h and tc*() family' << \!
452 #include <termios.h>
453 int main(void)
455 struct termios tios;
456 tcgetattr(0, &tios);
457 tcsetattr(0, TCSADRAIN | TCSAFLUSH, &tios);
458 return 0;
461 then
463 else
464 echo >&5 'We require termios.h and the tc*() family of functions.'
465 echo >&5 "That much Unix we indulge ourselfs."
466 ${rm} -f ${lst} ${h} ${mk}
467 exit 1
470 link_check setenv 'for setenv()/unsetenv()' '#define HAVE_SETENV' << \!
471 #include <stdlib.h>
472 int main(void)
474 setenv("s-nail", "to be made nifty!", 1);
475 unsetenv("s-nail");
476 return 0;
480 link_check snprintf 'for snprintf()' '#define HAVE_SNPRINTF' << \!
481 #include <stdio.h>
482 int main(void)
484 char b[20];
485 snprintf(b, sizeof b, "%s", "string");
486 return 0;
490 link_check putc_unlocked 'for putc_unlocked()' '#define HAVE_PUTC_UNLOCKED' <<\!
491 #include <stdio.h>
492 int main(void)
494 putc_unlocked('@', stdout);
495 return 0;
499 link_check fchdir 'for fchdir()' '#define HAVE_FCHDIR' << \!
500 #include <unistd.h>
501 int main(void)
503 fchdir(0);
504 return 0;
508 link_check pipe2 'for pipe2()' '#define HAVE_PIPE2' << \!
509 #include <fcntl.h>
510 #include <unistd.h>
511 int main(void)
513 int fds[2];
514 pipe2(fds, O_CLOEXEC);
515 return 0;
519 link_check mmap 'for mmap()' '#define HAVE_MMAP' << \!
520 #include <sys/types.h>
521 #include <sys/mman.h>
522 int main(void)
524 mmap(0, 0, 0, 0, 0, 0);
525 return 0;
529 link_check mremap 'for mremap()' '#define HAVE_MREMAP' << \!
530 #include <sys/types.h>
531 #include <sys/mman.h>
532 int main(void)
534 mremap(0, 0, 0, MREMAP_MAYMOVE);
535 return 0;
539 link_check setlocale 'for setlocale()' '#define HAVE_SETLOCALE' << \!
540 #include <locale.h>
541 int main(void)
543 setlocale(LC_ALL, "");
544 return 0;
548 if [ "${have_setlocale}" = yes ]; then
549 link_check c90amend1 'for ISO/IEC 9899:1990/Amendment 1:1995' \
550 '#define HAVE_C90AMEND1' << \!
551 #include <limits.h>
552 #include <stdlib.h>
553 #include <wchar.h>
554 #include <wctype.h>
555 int main(void)
557 char mbb[MB_LEN_MAX + 1];
558 wchar_t wc;
559 iswprint(L'c');
560 towupper(L'c');
561 mbtowc(&wc, "x", 1);
562 mbrtowc(&wc, "x", 1, NULL);
563 (void)wctomb(mbb, wc);
564 return (mblen("\0", 1) == 0);
568 if [ "${have_c90amend1}" = yes ]; then
569 link_check wcwidth 'for wcwidth()' '#define HAVE_WCWIDTH' << \!
570 #include <wchar.h>
571 int main(void)
573 wcwidth(L'c');
574 return 0;
579 link_check nl_langinfo 'for nl_langinfo()' '#define HAVE_NL_LANGINFO' << \!
580 #include <langinfo.h>
581 #include <stdlib.h>
582 int main(void)
584 nl_langinfo(DAY_1);
585 return (nl_langinfo(CODESET) == NULL);
588 fi # have_setlocale
590 link_check mkstemp 'for mkstemp()' '#define HAVE_MKSTEMP' << \!
591 #include <stdlib.h>
592 int main(void)
594 mkstemp("x");
595 return 0;
599 # Note: run_check, thus we also get only the desired implementation...
600 run_check realpath 'for realpath()' '#define HAVE_REALPATH' << \!
601 #include <stdlib.h>
602 int main(void)
604 char *x = realpath(".", NULL), *y = realpath("/", NULL);
605 return (x != NULL && y != NULL) ? 0 : 1;
609 link_check wordexp 'for wordexp()' '#define HAVE_WORDEXP' << \!
610 #include <wordexp.h>
611 int main(void)
613 wordexp((char *)0, (wordexp_t *)0, 0);
614 return 0;
620 if wantfeat DEBUG; then
621 echo '#define HAVE_DEBUG' >> ${h}
624 if wantfeat AMALGAMATION; then
625 echo '#define HAVE_AMALGAMATION' >> ${h}
628 if nwantfeat NOALLOCA; then
629 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
630 # versions of alloca(3) since modern compilers just can't be trusted
631 # not to overoptimize and silently break some code
632 link_check alloca 'for __builtin_alloca()' \
633 '#define HAVE_ALLOCA __builtin_alloca' << \!
634 int main(void)
636 void *vp = __builtin_alloca(1);
637 return (!! vp);
642 if wantfeat DEVEL; then
643 echo '#define HAVE_DEVEL' >> ${h}
646 if wantfeat NYD2; then
647 echo '#define HAVE_NYD2' >> ${h}
652 if wantfeat ICONV; then
653 ${cat} > ${tmp2}.c << \!
654 #include <iconv.h>
655 int main(void)
657 iconv_t id;
659 id = iconv_open("foo", "bar");
660 return 0;
663 < ${tmp2}.c link_check iconv 'for iconv functionality' \
664 '#define HAVE_ICONV' ||
665 < ${tmp2}.c link_check iconv \
666 'for iconv functionality in libiconv' \
667 '#define HAVE_ICONV' '-liconv'
668 else
669 echo '/* WANT_ICONV=0 */' >> ${h}
670 fi # wantfeat ICONV
672 if wantfeat SOCKETS; then
673 compile_check arpa_inet_h 'for <arpa/inet.h>' \
674 '#define HAVE_ARPA_INET_H' << \!
675 #include "config.h"
676 #include <sys/types.h>
677 #include <sys/socket.h>
678 #include <netdb.h>
679 #include <netinet/in.h>
680 #include <arpa/inet.h>
683 ${cat} > ${tmp2}.c << \!
684 #include "config.h"
685 #include <sys/types.h>
686 #include <sys/socket.h>
687 #include <netdb.h>
688 #include <netinet/in.h>
689 #ifdef HAVE_ARPA_INET_H
690 #include <arpa/inet.h>
691 #endif
693 int main(void)
695 struct sockaddr s;
696 socket(AF_INET, SOCK_STREAM, 0);
697 connect(0, &s, 0);
698 gethostbyname("foo");
699 return 0;
703 < ${tmp2}.c link_check sockets 'for sockets in libc' \
704 '#define HAVE_SOCKETS' ||
705 < ${tmp2}.c link_check sockets 'for sockets in libnsl' \
706 '#define HAVE_SOCKETS' '-lnsl' ||
707 < ${tmp2}.c link_check sockets \
708 'for sockets in libsocket and libnsl' \
709 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
710 WANT_SOCKETS=0
712 # XXX Shouldn't it be a hard error if there is no socket support, then?
713 option_update
714 else
715 echo '/* WANT_SOCKETS=0 */' >> ${h}
716 fi # wantfeat SOCKETS
718 wantfeat SOCKETS &&
719 link_check setsockopt 'for setsockopt()' '#define HAVE_SETSOCKOPT' << \!
720 #include <sys/socket.h>
721 #include <stdlib.h>
722 int main(void)
724 int sockfd = 3;
725 setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0);
726 return 0;
730 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
731 link_check so_sndtimeo 'for SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
732 #include <sys/socket.h>
733 #include <stdlib.h>
734 int main(void)
736 struct timeval tv;
737 int sockfd = 3;
738 tv.tv_sec = 42;
739 tv.tv_usec = 21;
740 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
741 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
742 return 0;
746 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
747 link_check so_linger 'for SO_LINGER' '#define HAVE_SO_LINGER' << \!
748 #include <sys/socket.h>
749 #include <stdlib.h>
750 int main(void)
752 struct linger li;
753 int sockfd = 3;
754 li.l_onoff = 1;
755 li.l_linger = 42;
756 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
757 return 0;
761 if wantfeat IPV6; then
762 link_check ipv6 'for IPv6 functionality' '#define HAVE_IPV6' << \!
763 #include "config.h"
764 #include <sys/types.h>
765 #include <sys/socket.h>
766 #include <netdb.h>
767 #include <netinet/in.h>
768 #ifdef HAVE_ARPA_INET_H
769 #include <arpa/inet.h>
770 #endif
772 int main(void)
774 struct addrinfo a, *ap;
775 getaddrinfo("foo", "0", &a, &ap);
776 return 0;
779 else
780 echo '/* WANT_IPV6=0 */' >> ${h}
781 fi # wantfeat IPV6
783 if wantfeat SSL; then
784 link_check openssl 'for sufficiently recent OpenSSL' \
785 '#define HAVE_SSL
786 #define HAVE_OPENSSL' '-lssl -lcrypto' << \!
787 #include <openssl/ssl.h>
788 #include <openssl/err.h>
789 #include <openssl/x509v3.h>
790 #include <openssl/x509.h>
791 #include <openssl/rand.h>
793 #if defined OPENSSL_NO_SSL2 && defined OPENSSL_NO_SSL3 &&\
794 defined OPENSSL_NO_TLS1
795 # error We need one of (SSLv2 and) SSLv3 and TLS1.
796 #endif
798 int main(void)
800 SSLv23_client_method();
801 #ifndef OPENSSL_NO_SSL3
802 SSLv3_client_method();
803 #endif
804 #ifndef OPENSSL_NO_TLS1
805 TLSv1_client_method();
806 # ifdef TLS1_1_VERSION
807 TLSv1_1_client_method();
808 # endif
809 # ifdef TLS1_2_VERSION
810 TLSv1_2_client_method();
811 # endif
812 #endif
813 PEM_read_PrivateKey(0, 0, 0, 0);
814 return 0;
818 if [ "${have_openssl}" = 'yes' ]; then
819 compile_check stack_of 'for OpenSSL STACK_OF()' \
820 '#define HAVE_OPENSSL_STACK_OF' << \!
821 #include <openssl/ssl.h>
822 #include <openssl/err.h>
823 #include <openssl/x509v3.h>
824 #include <openssl/x509.h>
825 #include <openssl/rand.h>
827 int main(void)
829 STACK_OF(GENERAL_NAME) *gens = NULL;
830 printf("%p", gens); /* to make it used */
831 return 0;
835 link_check rand_egd 'for OpenSSL RAND_egd()' \
836 '#define HAVE_OPENSSL_RAND_EGD' '-lssl -lcrypto' << \!
837 #include <openssl/rand.h>
839 int main(void)
841 return RAND_egd("some.where") > 0;
845 if wantfeat MD5 && nwantfeat NOEXTMD5; then
846 run_check openssl_md5 'for MD5 digest in OpenSSL' \
847 '#define HAVE_OPENSSL_MD5' << \!
848 #include <string.h>
849 #include <openssl/md5.h>
851 int main(void)
853 char const dat[] = "abrakadabrafidibus";
854 char dig[16], hex[16 * 2];
855 MD5_CTX ctx;
856 size_t i, j;
858 memset(dig, 0, sizeof(dig));
859 memset(hex, 0, sizeof(hex));
860 MD5_Init(&ctx);
861 MD5_Update(&ctx, dat, sizeof(dat) - 1);
862 MD5_Final(dig, &ctx);
864 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
865 for (i = 0; i < sizeof(hex) / 2; i++) {
866 j = i << 1;
867 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
868 hex[++j] = hexchar(dig[i] & 0x0f);
870 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
873 fi # wantfeat MD5 && nwantfeat NOEXTMD5
875 else
876 echo '/* WANT_SSL=0 */' >> ${h}
877 fi # wantfeat SSL
879 if wantfeat SMTP; then
880 echo '#define HAVE_SMTP' >> ${h}
881 else
882 echo '/* WANT_SMTP=0 */' >> ${h}
885 if wantfeat POP3; then
886 echo '#define HAVE_POP3' >> ${h}
887 else
888 echo '/* WANT_POP3=0 */' >> ${h}
891 if wantfeat IMAP; then
892 echo '#define HAVE_IMAP' >> ${h}
893 else
894 echo '/* WANT_IMAP=0 */' >> ${h}
897 if wantfeat GSSAPI; then
898 ${cat} > ${tmp2}.c << \!
899 #include <gssapi/gssapi.h>
901 int main(void)
903 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
904 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
905 return 0;
908 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
910 if command -v krb5-config >/dev/null 2>&1; then
911 i=`command -v krb5-config`
912 GSS_LIBS="`CFLAGS= ${i} --libs gssapi`"
913 GSS_INCS="`CFLAGS= ${i} --cflags`"
914 i='for GSS-API via krb5-config(1)'
915 else
916 GSS_LIBS='-lgssapi'
917 GSS_INCS=
918 i='for GSS-API in gssapi/gssapi.h, libgssapi'
920 < ${tmp2}.c link_check gss \
921 "${i}" '#define HAVE_GSSAPI' "${GSS_LIBS}" "${GSS_INCS}" ||\
922 < ${tmp3}.c link_check gss \
923 'for GSS-API in gssapi.h, libgssapi' \
924 '#define HAVE_GSSAPI
925 #define GSSAPI_REG_INCLUDE' \
926 '-lgssapi' ||\
927 < ${tmp2}.c link_check gss 'for GSS-API in libgssapi_krb5' \
928 '#define HAVE_GSSAPI' \
929 '-lgssapi_krb5' ||\
930 < ${tmp3}.c link_check gss \
931 'for GSS-API in libgssapi, OpenBSD-style (pre 5.3)' \
932 '#define HAVE_GSSAPI
933 #define GSS_REG_INCLUDE' \
934 '-lgssapi -lkrb5 -lcrypto' \
935 '-I/usr/include/kerberosV' ||\
936 < ${tmp2}.c link_check gss 'for GSS-API in libgss' \
937 '#define HAVE_GSSAPI' \
938 '-lgss' ||\
939 link_check gss 'for GSS-API in libgssapi_krb5, old-style' \
940 '#define HAVE_GSSAPI
941 #define GSSAPI_OLD_STYLE' \
942 '-lgssapi_krb5' << \!
943 #include <gssapi/gssapi.h>
944 #include <gssapi/gssapi_generic.h>
946 int main(void)
948 gss_import_name(0, 0, gss_nt_service_name, 0);
949 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
950 return 0;
953 else
954 echo '/* WANT_GSSAPI=0 */' >> ${h}
955 fi # wantfeat GSSAPI
957 if wantfeat NETRC; then
958 echo '#define HAVE_NETRC' >> ${h}
959 else
960 echo '/* WANT_NETRC=0 */' >> ${h}
963 if wantfeat AGENT; then
964 echo '#define HAVE_AGENT' >> ${h}
965 else
966 echo '/* WANT_AGENT=0 */' >> ${h}
969 if wantfeat IDNA; then
970 link_check idna 'for GNU Libidn' '#define HAVE_IDNA' '-lidn' << \!
971 #include <idna.h>
972 #include <idn-free.h>
973 #include <stringprep.h>
974 int main(void)
976 char *utf8, *idna_ascii, *idna_utf8;
977 utf8 = stringprep_locale_to_utf8("does.this.work");
978 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
979 != IDNA_SUCCESS)
980 return 1;
981 idn_free(idna_ascii);
982 /* (Rather link check only here) */
983 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
984 return 0;
987 else
988 echo '/* WANT_IDNA=0 */' >> ${h}
991 if wantfeat IMAP_SEARCH; then
992 echo '#define HAVE_IMAP_SEARCH' >> ${h}
993 else
994 echo '/* WANT_IMAP_SEARCH=0 */' >> ${h}
997 if wantfeat REGEX; then
998 link_check regex 'for regular expressions' '#define HAVE_REGEX' << \!
999 #include <regex.h>
1000 #include <stdlib.h>
1001 int main(void)
1003 int status;
1004 regex_t re;
1005 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
1006 return 1;
1007 status = regexec(&re, "plan9", 0,NULL, 0);
1008 regfree(&re);
1009 return !(status == REG_NOMATCH);
1012 else
1013 echo '/* WANT_REGEX=0 */' >> ${h}
1016 if wantfeat READLINE; then
1017 __edrdlib() {
1018 link_check readline "for readline(3) (${1})" \
1019 '#define HAVE_READLINE' "${1}" << \!
1020 #include <stdio.h>
1021 #include <readline/history.h>
1022 #include <readline/readline.h>
1023 int main(void)
1025 char *rl;
1026 HISTORY_STATE *hs;
1027 HIST_ENTRY **he;
1028 int i;
1029 using_history();
1030 read_history("");
1031 stifle_history(242);
1032 rl = readline("Enter a line:");
1033 if (rl && *rl)
1034 add_history(rl);
1035 write_history("");
1036 rl_extend_line_buffer(10);
1037 rl_point = rl_end = 10;
1038 rl_pre_input_hook = (rl_hook_func_t*)NULL;
1039 rl_forced_update_display();
1040 clear_history();
1041 hs = history_get_history_state();
1042 i = hs->length;
1043 he = history_list();
1044 if (i > 0)
1045 rl = he[0]->line;
1046 rl_free_line_state();
1047 rl_cleanup_after_signal();
1048 rl_reset_after_signal();
1049 return 0;
1054 __edrdlib -lreadline ||
1055 __edrdlib '-lreadline -ltermcap'
1056 [ -n "${have_readline}" ] && WANT_TABEXPAND=1
1059 if wantfeat EDITLINE && [ -z "${have_readline}" ]; then
1060 __edlib() {
1061 link_check editline "for editline(3) (${1})" \
1062 '#define HAVE_EDITLINE' "${1}" << \!
1063 #include <histedit.h>
1064 static char * getprompt(void) { return (char*)"ok"; }
1065 int main(void)
1067 EditLine *el_el = el_init("TEST", stdin, stdout, stderr);
1068 HistEvent he;
1069 History *el_hcom = history_init();
1070 history(el_hcom, &he, H_SETSIZE, 242);
1071 el_set(el_el, EL_SIGNAL, 0);
1072 el_set(el_el, EL_TERMINAL, NULL);
1073 el_set(el_el, EL_HIST, &history, el_hcom);
1074 el_set(el_el, EL_EDITOR, "emacs");
1075 el_set(el_el, EL_PROMPT, &getprompt);
1076 el_source(el_el, NULL);
1077 history(el_hcom, &he, H_GETSIZE);
1078 history(el_hcom, &he, H_CLEAR);
1079 el_end(el_el);
1080 /* TODO add loader and addfn checks */
1081 history_end(el_hcom);
1082 return 0;
1087 __edlib -ledit ||
1088 __edlib '-ledit -ltermcap'
1089 [ -n "${have_editline}" ] && WANT_TABEXPAND=0
1092 if wantfeat NCL && [ -z "${have_editline}" ] && [ -z "${have_readline}" ] &&\
1093 [ -n "${have_c90amend1}" ]; then
1094 have_ncl=1
1095 echo '#define HAVE_NCL' >> ${h}
1096 else
1097 echo '/* WANT_{READLINE,EDITLINE,NCL}=0 */' >> ${h}
1100 # Generic have-a-command-line-editor switch for those who need it below
1101 if [ -n "${have_ncl}" ] || [ -n "${have_editline}" ] ||\
1102 [ -n "${have_readline}" ]; then
1103 have_cle=1
1106 if [ -n "${have_cle}" ] && wantfeat HISTORY; then
1107 echo '#define HAVE_HISTORY' >> ${h}
1108 else
1109 echo '/* WANT_HISTORY=0 */' >> ${h}
1112 if [ -n "${have_cle}" ] && wantfeat TABEXPAND; then
1113 echo '#define HAVE_TABEXPAND' >> ${h}
1114 else
1115 echo '/* WANT_TABEXPAND=0 */' >> ${h}
1118 if wantfeat SPAM; then
1119 echo '#define HAVE_SPAM' >> ${h}
1120 if command -v spamc >/dev/null 2>&1; then
1121 echo "#define SPAMC_PATH \"`command -v spamc`\"" >> ${h}
1123 else
1124 echo '/* WANT_SPAM=0 */' >> ${h}
1127 if wantfeat DOCSTRINGS; then
1128 echo '#define HAVE_DOCSTRINGS' >> ${h}
1129 else
1130 echo '/* WANT_DOCSTRINGS=0 */' >> ${h}
1133 if wantfeat QUOTE_FOLD &&\
1134 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
1135 echo '#define HAVE_QUOTE_FOLD' >> ${h}
1136 else
1137 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
1140 if wantfeat COLOUR; then
1141 echo '#define HAVE_COLOUR' >> ${h}
1142 else
1143 echo '/* WANT_COLOUR=0 */' >> ${h}
1146 if wantfeat MD5; then
1147 echo '#define HAVE_MD5' >> ${h}
1148 else
1149 echo '/* WANT_MD5=0 */' >> ${h}
1152 ## Summarizing ##
1154 # Since we cat(1) the content of those to cc/"ld", convert them to single line
1155 squeeze_em() {
1156 < "${1}" > "${2}" ${awk} \
1157 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1159 ${rm} -f ${tmp}
1160 squeeze_em ${inc} ${tmp}
1161 ${mv} ${tmp} ${inc}
1162 squeeze_em ${lib} ${tmp}
1163 ${mv} ${tmp} ${lib}
1165 # config.h
1166 ${mv} ${h} ${tmp}
1167 printf '#ifndef _CONFIG_H\n# define _CONFIG_H\n' > ${h}
1168 ${cat} ${tmp} >> ${h}
1170 printf '\n/* The "feature string", for "simplicity" and lex.c */\n' >> ${h}
1171 printf '#ifdef _MAIN_SOURCE\n' >> ${h}
1172 printf '# ifdef HAVE_AMALGAMATION\nstatic\n# endif\n' >> ${h}
1173 printf 'char const features[] = "MIME"\n' >> ${h}
1174 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
1175 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
1176 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
1177 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
1178 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
1179 printf '# ifdef HAVE_IPV6\n ",IPv6"\n# endif\n' >> ${h}
1180 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TLS"\n# endif\n' >> ${h}
1181 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
1182 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
1183 printf '# ifdef HAVE_IMAP\n ",IMAP"\n# endif\n' >> ${h}
1184 printf '# ifdef HAVE_GSSAPI\n ",GSS-API"\n# endif\n' >> ${h}
1185 printf '# ifdef HAVE_NETRC\n ",NETRC"\n# endif\n' >> ${h}
1186 printf '# ifdef HAVE_AGENT\n ",AGENT"\n# endif\n' >> ${h}
1187 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
1188 printf '# ifdef HAVE_IMAP_SEARCH\n ",IMAP-searches"\n# endif\n' >> ${h}
1189 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
1190 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
1191 printf '# ifdef HAVE_EDITLINE\n ",EDITLINE"\n# endif\n' >> ${h}
1192 printf '# ifdef HAVE_NCL\n ",NCL"\n# endif\n' >> ${h}
1193 printf '# ifdef HAVE_TABEXPAND\n ",TABEXPAND"\n# endif\n' >> ${h}
1194 printf '# ifdef HAVE_HISTORY\n ",HISTORY"\n# endif\n' >> ${h}
1195 printf '# ifdef HAVE_SPAM\n ",SPAM"\n# endif\n' >> ${h}
1196 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
1197 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
1198 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
1199 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
1200 printf ';\n#endif /* _MAIN_SOURCE */\n' >> ${h}
1202 printf '#endif /* _CONFIG_H */\n' >> ${h}
1203 ${rm} -f ${tmp}
1205 # Create the real mk.mk
1206 ${rm} -rf ${tmp0}.* ${tmp0}*
1207 printf 'OBJ_SRC = ' >> ${mk}
1208 if nwantfeat AMALGAMATION; then
1209 echo *.c >> ${mk}
1210 echo 'OBJ_DEP =' >> ${mk}
1211 else
1212 j=`echo "${src}" | sed 's/^.\///'`
1213 echo "${j}" >> ${mk}
1214 printf 'OBJ_DEP = main.c ' >> ${mk}
1215 printf '#define _MAIN_SOURCE\n' >> ${src}
1216 printf '#include "nail.h"\n#include "main.c"\n' >> ${src}
1217 for i in *.c; do
1218 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ]; then
1219 continue
1221 printf "${i} " >> ${mk}
1222 printf "#include \"${i}\"\n" >> ${src}
1223 done
1224 echo >> ${mk}
1227 echo "LIBS = `${cat} ${lib}`" >> ${mk}
1228 echo "INCLUDES = `${cat} ${inc}`" >> ${mk}
1229 echo >> ${mk}
1230 ${cat} ./mk-mk.in >> ${mk}
1232 ## Finished! ##
1234 ${cat} > ${tmp2}.c << \!
1235 #include "config.h"
1236 #ifdef HAVE_NL_LANGINFO
1237 # include <langinfo.h>
1238 #endif
1240 :The following optional features are enabled:
1241 #ifdef HAVE_SETLOCALE
1242 : + Locale support: Printable characters depend on the environment
1243 # ifdef HAVE_C90AMEND1
1244 : + Multibyte character support
1245 # endif
1246 # ifdef HAVE_NL_LANGINFO
1247 : + Automatic detection of terminal character set
1248 # endif
1249 #endif
1250 #ifdef HAVE_ICONV
1251 : + Character set conversion using iconv()
1252 #endif
1253 #ifdef HAVE_SOCKETS
1254 : + Network support
1255 #endif
1256 #ifdef HAVE_IPV6
1257 : + Support for Internet Protocol v6 (IPv6)
1258 #endif
1259 #ifdef HAVE_SSL
1260 # ifdef HAVE_OPENSSL
1261 : + S/MIME and SSL/TLS (OpenSSL)
1262 # endif
1263 #endif
1264 #ifdef HAVE_SMTP
1265 : + SMTP protocol
1266 #endif
1267 #ifdef HAVE_POP3
1268 : + POP3 protocol
1269 #endif
1270 #ifdef HAVE_IMAP
1271 : + IMAP protocol
1272 #endif
1273 #ifdef HAVE_GSSAPI
1274 : + GSS-API authentication
1275 #endif
1276 #ifdef HAVE_NETRC
1277 : + .netrc file support
1278 #endif
1279 #ifdef HAVE_AGENT
1280 : + Password query through agent
1281 #endif
1282 #ifdef HAVE_IDNA
1283 : + IDNA (internationalized domain names for applications) support
1284 #endif
1285 #ifdef HAVE_IMAP_SEARCH
1286 : + IMAP-style search expressions
1287 #endif
1288 #ifdef HAVE_REGEX
1289 : + Regular expression support (searches, conditional expressions etc.)
1290 #endif
1291 #if defined HAVE_READLINE || defined HAVE_EDITLINE || defined HAVE_NCL
1292 : + Command line editing
1293 # ifdef HAVE_TABEXPAND
1294 : + + Tabulator expansion
1295 # endif
1296 # ifdef HAVE_HISTORY
1297 : + + History management
1298 # endif
1299 #endif
1300 #ifdef HAVE_SPAM
1301 : + Interaction with spam filters
1302 #endif
1303 #ifdef HAVE_DOCSTRINGS
1304 : + Documentation summary strings
1305 #endif
1306 #ifdef HAVE_QUOTE_FOLD
1307 : + Extended *quote-fold*ing
1308 #endif
1309 #ifdef HAVE_COLOUR
1310 : + Coloured message display (simple)
1311 #endif
1313 :The following optional features are disabled:
1314 #ifndef HAVE_SETLOCALE
1315 : - Locale support: Only ASCII characters are recognized
1316 #endif
1317 # ifndef HAVE_C90AMEND1
1318 : - Multibyte character support
1319 # endif
1320 # ifndef HAVE_NL_LANGINFO
1321 : - Automatic detection of terminal character set
1322 # endif
1323 #ifndef HAVE_ICONV
1324 : - Character set conversion using iconv()
1325 #endif
1326 #ifndef HAVE_SOCKETS
1327 : - Network support
1328 #endif
1329 #ifndef HAVE_IPV6
1330 : - Support for Internet Protocol v6 (IPv6)
1331 #endif
1332 #ifndef HAVE_SSL
1333 : - S/MIME and SSL/TLS
1334 #endif
1335 #ifndef HAVE_SMTP
1336 : - SMTP protocol
1337 #endif
1338 #ifndef HAVE_POP3
1339 : - POP3 protocol
1340 #endif
1341 #ifndef HAVE_IMAP
1342 : - IMAP protocol
1343 #endif
1344 #ifndef HAVE_GSSAPI
1345 : - GSS-API authentication
1346 #endif
1347 #ifndef HAVE_NETRC
1348 : - .netrc file support
1349 #endif
1350 #ifndef HAVE_AGENT
1351 : - Password query through agent
1352 #endif
1353 #ifndef HAVE_IDNA
1354 : - IDNA (internationalized domain names for applications) support
1355 #endif
1356 #ifndef HAVE_IMAP_SEARCH
1357 : - IMAP-style search expressions
1358 #endif
1359 #ifndef HAVE_REGEX
1360 : - Regular expression support
1361 #endif
1362 #if !defined HAVE_READLINE && !defined HAVE_EDITLINE && !defined HAVE_NCL
1363 : - Command line editing and history
1364 #endif
1365 #ifndef HAVE_SPAM
1366 : - Interaction with spam filters
1367 #endif
1368 #ifndef HAVE_DOCSTRINGS
1369 : - Documentation summary strings
1370 #endif
1371 #ifndef HAVE_QUOTE_FOLD
1372 : - Extended *quote-fold*ing
1373 #endif
1374 #ifndef HAVE_COLOUR
1375 : - Coloured message display (simple)
1376 #endif
1378 :Remarks:
1379 #ifndef HAVE_SNPRINTF
1380 : . The function snprintf() could not be found. We will use and internal
1381 : sprintf() instead. This might overflow buffers if input values are larger
1382 : than expected. Use the resulting binary with care or update your system
1383 : environment and start the configuration process again.
1384 #endif
1385 #ifndef HAVE_FCHDIR
1386 : . The function fchdir() could not be found. We will use chdir()
1387 : instead. This is not a problem unless the current working
1388 : directory of mailx is moved while the IMAP cache is used.
1389 #endif
1390 #ifdef HAVE_DEBUG
1391 : . Debug enabled binary: not meant to be used by end-users: THANKS!
1392 #endif
1396 ${make} -f ${makefile} ${tmp2}.x
1397 < ${tmp2}.x >&5 ${sed} -e '/^[^:]/d; /^$/d; s/^://'
1399 # s-it-mode