Rename conf.rc to make.rc
[s-mailx.git] / mk-conf.sh
blobe229a22375857ed72498f176dffff57ae742570b
1 #!/bin/sh -
2 #@ Please see `INSTALL' and `make.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 rc=./make.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 $rc
193 check_tool rm "${rm:-`command -v rm`}"
194 check_tool sed "${sed:-`command -v sed`}"
196 # Include $rc, but only take from it what wasn't overwritten by the user from
197 # within the command line or from a chosen fixed CONFIG=
198 # Note we leave alone the values
199 trap "${rm} -f ${tmp}; exit" 1 2 15
200 trap "${rm} -f ${tmp}" 0
201 ${rm} -f ${tmp}
203 < ${rc} ${sed} -e '/^[ \t]*#/d' -e '/^$/d' -e 's/[ \t]*$//' |
204 while read line; do
205 i="`echo ${line} | ${sed} -e 's/=.*$//'`"
206 eval j="\$${i}" jx="\${${i}+x}"
207 if [ -n "${j}" ] || [ "${jx}" = x ]; then
208 line="${i}=\"${j}\""
210 echo ${line}
211 done > ${tmp}
212 . ./${tmp}
214 check_tool awk "${awk:-`command -v awk`}"
215 check_tool cat "${cat:-`command -v cat`}"
216 check_tool chmod "${chmod:-`command -v chmod`}"
217 check_tool cp "${cp:-`command -v cp`}"
218 check_tool cmp "${cmp:-`command -v cmp`}"
219 check_tool grep "${grep:-`command -v grep`}"
220 check_tool mkdir "${mkdir:-`command -v mkdir`}"
221 check_tool mv "${mv:-`command -v mv`}"
222 # rm(1), sed(1) above
223 check_tool tee "${tee:-`command -v tee`}"
225 check_tool make "${MAKE:-`command -v make`}"
226 check_tool strip "${STRIP:-`command -v strip`}" 1
227 HAVE_STRIP=${?}
229 wantfeat() {
230 eval i=\$WANT_${1}
231 [ "${i}" = "1" ]
233 nwantfeat() {
234 eval i=\$WANT_${1}
235 [ "${i}" != "1" ]
238 option_update
240 # (No function since some shells loose non-exported variables in traps)
241 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}; exit" 1 2 15
242 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}" 0
243 ${rm} -f ${newlst} ${newmk} ${newh}
245 # (Could: use FD redirection, add eval(1) and don't re-'. ./${newlst}')
246 while read line; do
247 i=`echo ${line} | ${sed} -e 's/=.*$//'`
248 eval j=\$${i}
249 if [ -z "${j}" ] || [ "${j}" = 0 ]; then
250 printf "/*#define ${i}*/\n" >> ${newh}
251 elif [ "${j}" = 1 ]; then
252 printf "#define ${i}\n" >> ${newh}
253 else
254 printf "#define ${i} \"${j}\"\n" >> ${newh}
256 printf "${i} = ${j}\n" >> ${newmk}
257 printf "${i}=\"${j}\"\n"
258 done < ${tmp} > ${newlst}
259 . ./${newlst}
261 printf "#define UAGENT \"${SID}${NAIL}\"\n" >> ${newh}
262 printf "UAGENT = ${SID}${NAIL}\n" >> ${newmk}
264 compiler_flags
266 printf "CC = ${CC}\n" >> ${newmk}
267 printf "_CFLAGS = ${_CFLAGS}\nCFLAGS = ${CFLAGS}\n" >> ${newmk}
268 printf "_LDFLAGS = ${_LDFLAGS}\nLDFLAGS = ${LDFLAGS}\n" >> ${newmk}
269 printf "AWK = ${awk}\nCMP = ${cmp}\nCHMOD = ${chmod}\nCP = ${cp}\n" >> ${newmk}
270 printf "GREP = ${grep}\nMKDIR = ${mkdir}\nRM = ${rm}\nSED = ${sed}\n" \
271 >> ${newmk}
272 printf "STRIP = ${strip}\nHAVE_STRIP = ${HAVE_STRIP}\n" >> ${newmk}
273 # (We include the cc(1)/ld(1) environment only for update detection..)
274 printf "CC=\"${CC}\"\n" >> ${newlst}
275 printf "_CFLAGS=\"${_CFLAGS}\"\nCFLAGS=\"${CFLAGS}\"\n" >> ${newlst}
276 printf "_LDFLAGS=\"${_LDFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n" >> ${newlst}
277 printf "AWK=${awk}\nCMP=${cmp}\nCHMOD=${chmod}\nCP=${cp}\n" >> ${newlst}
278 printf "GREP=${grep}\nMKDIR=${mkdir}\nRM=${rm}\nSED=${sed}\n" >> ${newlst}
279 printf "STRIP=${strip}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newlst}
281 if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
282 exit 0
284 [ -f ${lst} ] && echo 'configuration updated..' || echo 'shiny configuration..'
286 ${mv} -f ${newlst} ${lst}
287 ${mv} -f ${newh} ${h}
288 ${mv} -f ${newmk} ${mk}
290 ## Compile and link checking ##
292 tmp2=./${tmp0}2$$
293 tmp3=./${tmp0}3$$
294 log=./config.log
295 lib=./config.lib
296 inc=./config.inc
297 src=./config.c
298 makefile=./config.mk
300 # (No function since some shells loose non-exported variables in traps)
301 trap "${rm} -f ${lst} ${h} ${mk} ${lib} ${inc} ${src} ${makefile}; exit" 1 2 15
302 trap "${rm} -rf ${tmp0}.* ${tmp0}* ${makefile}" 0
304 exec 5>&2 > ${log} 2>&1
305 printf '' > ${lib}
306 printf '' > ${inc}
307 # ${src} is only created if WANT_AMALGAMATION
308 ${rm} -f ${src}
309 ${cat} > ${makefile} << \!
310 .SUFFIXES: .o .c .x .y
311 .c.o:
312 $(CC) $(XINCS) -c $<
313 .c.x:
314 $(CC) $(XINCS) -E $< >$@
316 $(CC) $(XINCS) -o $@ $< $(XLIBS)
317 .y: ;
320 msg() {
321 fmt=$1
323 shift
324 printf "*** ${fmt}\\n" "${@}"
325 printf "${fmt}" "${@}" >&5
328 _check_preface() {
329 variable=$1 topic=$2 define=$3
331 echo '**********'
332 msg "checking ${topic} ... "
333 echo "/* checked ${topic} */" >> ${h}
334 ${rm} -f ${tmp} ${tmp}.o
335 echo '*** test program is'
336 ${tee} ${tmp}.c
337 #echo '*** the preprocessor generates'
338 #${make} -f ${makefile} ${tmp}.x
339 #${cat} ${tmp}.x
340 echo '*** results are'
343 compile_check() {
344 variable=$1 topic=$2 define=$3
346 _check_preface "${variable}" "${topic}" "${define}"
348 if ${make} -f ${makefile} XINCS="${INCS}" ./${tmp}.o &&
349 [ -f ./${tmp}.o ]; then
350 msg "yes\\n"
351 echo "${define}" >> ${h}
352 eval have_${variable}=yes
353 return 0
354 else
355 echo "/* ${define} */" >> ${h}
356 msg "no\\n"
357 eval unset have_${variable}
358 return 1
362 _link_mayrun() {
363 run=$1 variable=$2 topic=$3 define=$4 libs=$5 incs=$6
365 _check_preface "${variable}" "${topic}" "${define}"
367 if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
368 XLIBS="${LIBS} ${libs}" ./${tmp} &&
369 [ -f ./${tmp} ] &&
370 { [ ${run} -eq 0 ] || ./${tmp}; }; then
371 echo "*** adding INCS<${incs}> LIBS<${libs}>"
372 msg "yes\\n"
373 echo "${define}" >> ${h}
374 LIBS="${LIBS} ${libs}"
375 echo "${libs}" >> ${lib}
376 INCS="${INCS} ${incs}"
377 echo "${incs}" >> ${inc}
378 eval have_${variable}=yes
379 return 0
380 else
381 msg "no\\n"
382 echo "/* ${define} */" >> ${h}
383 eval unset have_${variable}
384 return 1
388 link_check() {
389 _link_mayrun 0 "${1}" "${2}" "${3}" "${4}" "${5}"
392 run_check() {
393 _link_mayrun 1 "${1}" "${2}" "${3}" "${4}" "${5}"
396 # Build a basic set of INCS and LIBS according to user environment.
397 # On pkgsrc(7) systems automatically add /usr/pkg/*
398 if [ -n "${C_INCLUDE_PATH}" ]; then
399 i=${IFS}
400 IFS=:
401 set -- ${C_INCLUDE_PATH}
402 IFS=${i}
403 # for i; do -- new in POSIX Issue 7 + TC1
404 for i
406 [ "${i}" = '/usr/pkg/include' ] && continue
407 INCS="${INCS} -I${i}"
408 done
410 [ -d /usr/pkg/include ] && INCS="${INCS} -I/usr/pkg/include"
411 echo "${INCS}" >> ${inc}
413 if [ -n "${LD_LIBRARY_PATH}" ]; then
414 i=${IFS}
415 IFS=:
416 set -- ${LD_LIBRARY_PATH}
417 IFS=${i}
418 # for i; do -- new in POSIX Issue 7 + TC1
419 for i
421 [ "${i}" = '/usr/pkg/lib' ] && continue
422 LIBS="${LIBS} -L${i}"
423 done
425 [ -d /usr/pkg/lib ] && LIBS="${LIBS} -L/usr/pkg/lib"
426 echo "${LIBS}" >> ${lib}
430 # Better set _GNU_SOURCE (if we are on Linux only?); 'surprised it did without
431 echo '#define _GNU_SOURCE' >> ${h}
433 if link_check hello 'if a hello world program can be built' << \!
434 #include <stdio.h>
436 int main(int argc, char *argv[])
438 (void)argc;
439 (void)argv;
440 puts("hello world");
441 return 0;
444 then
446 else
447 echo >&5 'This oooops is most certainly not related to me.'
448 echo >&5 "Read the file ${log} and check your compiler environment."
449 ${rm} -f ${lst} ${h} ${mk}
450 exit 1
453 if link_check termios 'for termios.h and tc*() family' << \!
454 #include <termios.h>
455 int main(void)
457 struct termios tios;
458 tcgetattr(0, &tios);
459 tcsetattr(0, TCSADRAIN | TCSAFLUSH, &tios);
460 return 0;
463 then
465 else
466 echo >&5 'We require termios.h and the tc*() family of functions.'
467 echo >&5 "That much Unix we indulge ourselfs."
468 ${rm} -f ${lst} ${h} ${mk}
469 exit 1
472 link_check setenv 'for setenv()/unsetenv()' '#define HAVE_SETENV' << \!
473 #include <stdlib.h>
474 int main(void)
476 setenv("s-nail", "to be made nifty!", 1);
477 unsetenv("s-nail");
478 return 0;
482 link_check snprintf 'for snprintf()' '#define HAVE_SNPRINTF' << \!
483 #include <stdio.h>
484 int main(void)
486 char b[20];
487 snprintf(b, sizeof b, "%s", "string");
488 return 0;
492 link_check putc_unlocked 'for putc_unlocked()' '#define HAVE_PUTC_UNLOCKED' <<\!
493 #include <stdio.h>
494 int main(void)
496 putc_unlocked('@', stdout);
497 return 0;
501 link_check fchdir 'for fchdir()' '#define HAVE_FCHDIR' << \!
502 #include <unistd.h>
503 int main(void)
505 fchdir(0);
506 return 0;
510 link_check pipe2 'for pipe2()' '#define HAVE_PIPE2' << \!
511 #include <fcntl.h>
512 #include <unistd.h>
513 int main(void)
515 int fds[2];
516 pipe2(fds, O_CLOEXEC);
517 return 0;
521 link_check mmap 'for mmap()' '#define HAVE_MMAP' << \!
522 #include <sys/types.h>
523 #include <sys/mman.h>
524 int main(void)
526 mmap(0, 0, 0, 0, 0, 0);
527 return 0;
531 link_check mremap 'for mremap()' '#define HAVE_MREMAP' << \!
532 #include <sys/types.h>
533 #include <sys/mman.h>
534 int main(void)
536 mremap(0, 0, 0, MREMAP_MAYMOVE);
537 return 0;
541 link_check setlocale 'for setlocale()' '#define HAVE_SETLOCALE' << \!
542 #include <locale.h>
543 int main(void)
545 setlocale(LC_ALL, "");
546 return 0;
550 if [ "${have_setlocale}" = yes ]; then
551 link_check c90amend1 'for ISO/IEC 9899:1990/Amendment 1:1995' \
552 '#define HAVE_C90AMEND1' << \!
553 #include <limits.h>
554 #include <stdlib.h>
555 #include <wchar.h>
556 #include <wctype.h>
557 int main(void)
559 char mbb[MB_LEN_MAX + 1];
560 wchar_t wc;
561 iswprint(L'c');
562 towupper(L'c');
563 mbtowc(&wc, "x", 1);
564 mbrtowc(&wc, "x", 1, NULL);
565 (void)wctomb(mbb, wc);
566 return (mblen("\0", 1) == 0);
570 if [ "${have_c90amend1}" = yes ]; then
571 link_check wcwidth 'for wcwidth()' '#define HAVE_WCWIDTH' << \!
572 #include <wchar.h>
573 int main(void)
575 wcwidth(L'c');
576 return 0;
581 link_check nl_langinfo 'for nl_langinfo()' '#define HAVE_NL_LANGINFO' << \!
582 #include <langinfo.h>
583 #include <stdlib.h>
584 int main(void)
586 nl_langinfo(DAY_1);
587 return (nl_langinfo(CODESET) == NULL);
590 fi # have_setlocale
592 link_check mkstemp 'for mkstemp()' '#define HAVE_MKSTEMP' << \!
593 #include <stdlib.h>
594 int main(void)
596 mkstemp("x");
597 return 0;
601 # Note: run_check, thus we also get only the desired implementation...
602 run_check realpath 'for realpath()' '#define HAVE_REALPATH' << \!
603 #include <stdlib.h>
604 int main(void)
606 char *x = realpath(".", NULL), *y = realpath("/", NULL);
607 return (x != NULL && y != NULL) ? 0 : 1;
611 link_check wordexp 'for wordexp()' '#define HAVE_WORDEXP' << \!
612 #include <wordexp.h>
613 int main(void)
615 wordexp((char *)0, (wordexp_t *)0, 0);
616 return 0;
622 if wantfeat DEBUG; then
623 echo '#define HAVE_DEBUG' >> ${h}
626 if wantfeat AMALGAMATION; then
627 echo '#define HAVE_AMALGAMATION' >> ${h}
630 if nwantfeat NOALLOCA; then
631 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
632 # versions of alloca(3) since modern compilers just can't be trusted
633 # not to overoptimize and silently break some code
634 link_check alloca 'for __builtin_alloca()' \
635 '#define HAVE_ALLOCA __builtin_alloca' << \!
636 int main(void)
638 void *vp = __builtin_alloca(1);
639 return (!! vp);
644 if wantfeat DEVEL; then
645 echo '#define HAVE_DEVEL' >> ${h}
648 if wantfeat NYD2; then
649 echo '#define HAVE_NYD2' >> ${h}
654 if wantfeat ICONV; then
655 ${cat} > ${tmp2}.c << \!
656 #include <iconv.h>
657 int main(void)
659 iconv_t id;
661 id = iconv_open("foo", "bar");
662 return 0;
665 < ${tmp2}.c link_check iconv 'for iconv functionality' \
666 '#define HAVE_ICONV' ||
667 < ${tmp2}.c link_check iconv \
668 'for iconv functionality in libiconv' \
669 '#define HAVE_ICONV' '-liconv'
670 else
671 echo '/* WANT_ICONV=0 */' >> ${h}
672 fi # wantfeat ICONV
674 if wantfeat SOCKETS; then
675 compile_check arpa_inet_h 'for <arpa/inet.h>' \
676 '#define HAVE_ARPA_INET_H' << \!
677 #include "config.h"
678 #include <sys/types.h>
679 #include <sys/socket.h>
680 #include <netdb.h>
681 #include <netinet/in.h>
682 #include <arpa/inet.h>
685 ${cat} > ${tmp2}.c << \!
686 #include "config.h"
687 #include <sys/types.h>
688 #include <sys/socket.h>
689 #include <netdb.h>
690 #include <netinet/in.h>
691 #ifdef HAVE_ARPA_INET_H
692 #include <arpa/inet.h>
693 #endif
695 int main(void)
697 struct sockaddr s;
698 socket(AF_INET, SOCK_STREAM, 0);
699 connect(0, &s, 0);
700 gethostbyname("foo");
701 return 0;
705 < ${tmp2}.c link_check sockets 'for sockets in libc' \
706 '#define HAVE_SOCKETS' ||
707 < ${tmp2}.c link_check sockets 'for sockets in libnsl' \
708 '#define HAVE_SOCKETS' '-lnsl' ||
709 < ${tmp2}.c link_check sockets \
710 'for sockets in libsocket and libnsl' \
711 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
712 WANT_SOCKETS=0
714 # XXX Shouldn't it be a hard error if there is no socket support, then?
715 option_update
716 else
717 echo '/* WANT_SOCKETS=0 */' >> ${h}
718 fi # wantfeat SOCKETS
720 wantfeat SOCKETS &&
721 link_check setsockopt 'for setsockopt()' '#define HAVE_SETSOCKOPT' << \!
722 #include <sys/socket.h>
723 #include <stdlib.h>
724 int main(void)
726 int sockfd = 3;
727 setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0);
728 return 0;
732 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
733 link_check so_sndtimeo 'for SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
734 #include <sys/socket.h>
735 #include <stdlib.h>
736 int main(void)
738 struct timeval tv;
739 int sockfd = 3;
740 tv.tv_sec = 42;
741 tv.tv_usec = 21;
742 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
743 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
744 return 0;
748 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
749 link_check so_linger 'for SO_LINGER' '#define HAVE_SO_LINGER' << \!
750 #include <sys/socket.h>
751 #include <stdlib.h>
752 int main(void)
754 struct linger li;
755 int sockfd = 3;
756 li.l_onoff = 1;
757 li.l_linger = 42;
758 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
759 return 0;
763 if wantfeat IPV6; then
764 link_check ipv6 'for IPv6 functionality' '#define HAVE_IPV6' << \!
765 #include "config.h"
766 #include <sys/types.h>
767 #include <sys/socket.h>
768 #include <netdb.h>
769 #include <netinet/in.h>
770 #ifdef HAVE_ARPA_INET_H
771 #include <arpa/inet.h>
772 #endif
774 int main(void)
776 struct addrinfo a, *ap;
777 getaddrinfo("foo", "0", &a, &ap);
778 return 0;
781 else
782 echo '/* WANT_IPV6=0 */' >> ${h}
783 fi # wantfeat IPV6
785 if wantfeat SSL; then
786 link_check openssl 'for sufficiently recent OpenSSL' \
787 '#define HAVE_SSL
788 #define HAVE_OPENSSL' '-lssl -lcrypto' << \!
789 #include <openssl/ssl.h>
790 #include <openssl/err.h>
791 #include <openssl/x509v3.h>
792 #include <openssl/x509.h>
793 #include <openssl/rand.h>
795 #if defined OPENSSL_NO_SSL2 && defined OPENSSL_NO_SSL3 &&\
796 defined OPENSSL_NO_TLS1
797 # error We need one of (SSLv2 and) SSLv3 and TLS1.
798 #endif
800 int main(void)
802 SSLv23_client_method();
803 #ifndef OPENSSL_NO_SSL3
804 SSLv3_client_method();
805 #endif
806 #ifndef OPENSSL_NO_TLS1
807 TLSv1_client_method();
808 # ifdef TLS1_1_VERSION
809 TLSv1_1_client_method();
810 # endif
811 # ifdef TLS1_2_VERSION
812 TLSv1_2_client_method();
813 # endif
814 #endif
815 PEM_read_PrivateKey(0, 0, 0, 0);
816 return 0;
820 if [ "${have_openssl}" = 'yes' ]; then
821 compile_check stack_of 'for OpenSSL STACK_OF()' \
822 '#define HAVE_OPENSSL_STACK_OF' << \!
823 #include <openssl/ssl.h>
824 #include <openssl/err.h>
825 #include <openssl/x509v3.h>
826 #include <openssl/x509.h>
827 #include <openssl/rand.h>
829 int main(void)
831 STACK_OF(GENERAL_NAME) *gens = NULL;
832 printf("%p", gens); /* to make it used */
833 return 0;
837 link_check rand_egd 'for OpenSSL RAND_egd()' \
838 '#define HAVE_OPENSSL_RAND_EGD' '-lssl -lcrypto' << \!
839 #include <openssl/rand.h>
841 int main(void)
843 return RAND_egd("some.where") > 0;
847 if wantfeat MD5 && nwantfeat NOEXTMD5; then
848 run_check openssl_md5 'for MD5 digest in OpenSSL' \
849 '#define HAVE_OPENSSL_MD5' << \!
850 #include <string.h>
851 #include <openssl/md5.h>
853 int main(void)
855 char const dat[] = "abrakadabrafidibus";
856 char dig[16], hex[16 * 2];
857 MD5_CTX ctx;
858 size_t i, j;
860 memset(dig, 0, sizeof(dig));
861 memset(hex, 0, sizeof(hex));
862 MD5_Init(&ctx);
863 MD5_Update(&ctx, dat, sizeof(dat) - 1);
864 MD5_Final(dig, &ctx);
866 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
867 for (i = 0; i < sizeof(hex) / 2; i++) {
868 j = i << 1;
869 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
870 hex[++j] = hexchar(dig[i] & 0x0f);
872 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
875 fi # wantfeat MD5 && nwantfeat NOEXTMD5
877 else
878 echo '/* WANT_SSL=0 */' >> ${h}
879 fi # wantfeat SSL
881 if wantfeat SMTP; then
882 echo '#define HAVE_SMTP' >> ${h}
883 else
884 echo '/* WANT_SMTP=0 */' >> ${h}
887 if wantfeat POP3; then
888 echo '#define HAVE_POP3' >> ${h}
889 else
890 echo '/* WANT_POP3=0 */' >> ${h}
893 if wantfeat IMAP; then
894 echo '#define HAVE_IMAP' >> ${h}
895 else
896 echo '/* WANT_IMAP=0 */' >> ${h}
899 if wantfeat GSSAPI; then
900 ${cat} > ${tmp2}.c << \!
901 #include <gssapi/gssapi.h>
903 int main(void)
905 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
906 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
907 return 0;
910 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
912 if command -v krb5-config >/dev/null 2>&1; then
913 i=`command -v krb5-config`
914 GSS_LIBS="`CFLAGS= ${i} --libs gssapi`"
915 GSS_INCS="`CFLAGS= ${i} --cflags`"
916 i='for GSS-API via krb5-config(1)'
917 else
918 GSS_LIBS='-lgssapi'
919 GSS_INCS=
920 i='for GSS-API in gssapi/gssapi.h, libgssapi'
922 < ${tmp2}.c link_check gss \
923 "${i}" '#define HAVE_GSSAPI' "${GSS_LIBS}" "${GSS_INCS}" ||\
924 < ${tmp3}.c link_check gss \
925 'for GSS-API in gssapi.h, libgssapi' \
926 '#define HAVE_GSSAPI
927 #define GSSAPI_REG_INCLUDE' \
928 '-lgssapi' ||\
929 < ${tmp2}.c link_check gss 'for GSS-API in libgssapi_krb5' \
930 '#define HAVE_GSSAPI' \
931 '-lgssapi_krb5' ||\
932 < ${tmp3}.c link_check gss \
933 'for GSS-API in libgssapi, OpenBSD-style (pre 5.3)' \
934 '#define HAVE_GSSAPI
935 #define GSS_REG_INCLUDE' \
936 '-lgssapi -lkrb5 -lcrypto' \
937 '-I/usr/include/kerberosV' ||\
938 < ${tmp2}.c link_check gss 'for GSS-API in libgss' \
939 '#define HAVE_GSSAPI' \
940 '-lgss' ||\
941 link_check gss 'for GSS-API in libgssapi_krb5, old-style' \
942 '#define HAVE_GSSAPI
943 #define GSSAPI_OLD_STYLE' \
944 '-lgssapi_krb5' << \!
945 #include <gssapi/gssapi.h>
946 #include <gssapi/gssapi_generic.h>
948 int main(void)
950 gss_import_name(0, 0, gss_nt_service_name, 0);
951 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
952 return 0;
955 else
956 echo '/* WANT_GSSAPI=0 */' >> ${h}
957 fi # wantfeat GSSAPI
959 if wantfeat NETRC; then
960 echo '#define HAVE_NETRC' >> ${h}
961 else
962 echo '/* WANT_NETRC=0 */' >> ${h}
965 if wantfeat AGENT; then
966 echo '#define HAVE_AGENT' >> ${h}
967 else
968 echo '/* WANT_AGENT=0 */' >> ${h}
971 if wantfeat IDNA; then
972 link_check idna 'for GNU Libidn' '#define HAVE_IDNA' '-lidn' << \!
973 #include <idna.h>
974 #include <idn-free.h>
975 #include <stringprep.h>
976 int main(void)
978 char *utf8, *idna_ascii, *idna_utf8;
979 utf8 = stringprep_locale_to_utf8("does.this.work");
980 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
981 != IDNA_SUCCESS)
982 return 1;
983 idn_free(idna_ascii);
984 /* (Rather link check only here) */
985 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
986 return 0;
989 else
990 echo '/* WANT_IDNA=0 */' >> ${h}
993 if wantfeat IMAP_SEARCH; then
994 echo '#define HAVE_IMAP_SEARCH' >> ${h}
995 else
996 echo '/* WANT_IMAP_SEARCH=0 */' >> ${h}
999 if wantfeat REGEX; then
1000 link_check regex 'for regular expressions' '#define HAVE_REGEX' << \!
1001 #include <regex.h>
1002 #include <stdlib.h>
1003 int main(void)
1005 int status;
1006 regex_t re;
1007 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
1008 return 1;
1009 status = regexec(&re, "plan9", 0,NULL, 0);
1010 regfree(&re);
1011 return !(status == REG_NOMATCH);
1014 else
1015 echo '/* WANT_REGEX=0 */' >> ${h}
1018 if wantfeat READLINE; then
1019 __edrdlib() {
1020 link_check readline "for readline(3) (${1})" \
1021 '#define HAVE_READLINE' "${1}" << \!
1022 #include <stdio.h>
1023 #include <readline/history.h>
1024 #include <readline/readline.h>
1025 int main(void)
1027 char *rl;
1028 HISTORY_STATE *hs;
1029 HIST_ENTRY **he;
1030 int i;
1031 using_history();
1032 read_history("");
1033 stifle_history(242);
1034 rl = readline("Enter a line:");
1035 if (rl && *rl)
1036 add_history(rl);
1037 write_history("");
1038 rl_extend_line_buffer(10);
1039 rl_point = rl_end = 10;
1040 rl_pre_input_hook = (rl_hook_func_t*)NULL;
1041 rl_forced_update_display();
1042 clear_history();
1043 hs = history_get_history_state();
1044 i = hs->length;
1045 he = history_list();
1046 if (i > 0)
1047 rl = he[0]->line;
1048 rl_free_line_state();
1049 rl_cleanup_after_signal();
1050 rl_reset_after_signal();
1051 return 0;
1056 __edrdlib -lreadline ||
1057 __edrdlib '-lreadline -ltermcap'
1058 [ -n "${have_readline}" ] && WANT_TABEXPAND=1
1061 if wantfeat EDITLINE && [ -z "${have_readline}" ]; then
1062 __edlib() {
1063 link_check editline "for editline(3) (${1})" \
1064 '#define HAVE_EDITLINE' "${1}" << \!
1065 #include <histedit.h>
1066 static char * getprompt(void) { return (char*)"ok"; }
1067 int main(void)
1069 EditLine *el_el = el_init("TEST", stdin, stdout, stderr);
1070 HistEvent he;
1071 History *el_hcom = history_init();
1072 history(el_hcom, &he, H_SETSIZE, 242);
1073 el_set(el_el, EL_SIGNAL, 0);
1074 el_set(el_el, EL_TERMINAL, NULL);
1075 el_set(el_el, EL_HIST, &history, el_hcom);
1076 el_set(el_el, EL_EDITOR, "emacs");
1077 el_set(el_el, EL_PROMPT, &getprompt);
1078 el_source(el_el, NULL);
1079 history(el_hcom, &he, H_GETSIZE);
1080 history(el_hcom, &he, H_CLEAR);
1081 el_end(el_el);
1082 /* TODO add loader and addfn checks */
1083 history_end(el_hcom);
1084 return 0;
1089 __edlib -ledit ||
1090 __edlib '-ledit -ltermcap'
1091 [ -n "${have_editline}" ] && WANT_TABEXPAND=0
1094 if wantfeat NCL && [ -z "${have_editline}" ] && [ -z "${have_readline}" ] &&\
1095 [ -n "${have_c90amend1}" ]; then
1096 have_ncl=1
1097 echo '#define HAVE_NCL' >> ${h}
1098 else
1099 echo '/* WANT_{READLINE,EDITLINE,NCL}=0 */' >> ${h}
1102 # Generic have-a-command-line-editor switch for those who need it below
1103 if [ -n "${have_ncl}" ] || [ -n "${have_editline}" ] ||\
1104 [ -n "${have_readline}" ]; then
1105 have_cle=1
1108 if [ -n "${have_cle}" ] && wantfeat HISTORY; then
1109 echo '#define HAVE_HISTORY' >> ${h}
1110 else
1111 echo '/* WANT_HISTORY=0 */' >> ${h}
1114 if [ -n "${have_cle}" ] && wantfeat TABEXPAND; then
1115 echo '#define HAVE_TABEXPAND' >> ${h}
1116 else
1117 echo '/* WANT_TABEXPAND=0 */' >> ${h}
1120 if wantfeat SPAM; then
1121 echo '#define HAVE_SPAM' >> ${h}
1122 if command -v spamc >/dev/null 2>&1; then
1123 echo "#define SPAMC_PATH \"`command -v spamc`\"" >> ${h}
1125 else
1126 echo '/* WANT_SPAM=0 */' >> ${h}
1129 if wantfeat DOCSTRINGS; then
1130 echo '#define HAVE_DOCSTRINGS' >> ${h}
1131 else
1132 echo '/* WANT_DOCSTRINGS=0 */' >> ${h}
1135 if wantfeat QUOTE_FOLD &&\
1136 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
1137 echo '#define HAVE_QUOTE_FOLD' >> ${h}
1138 else
1139 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
1142 if wantfeat COLOUR; then
1143 echo '#define HAVE_COLOUR' >> ${h}
1144 else
1145 echo '/* WANT_COLOUR=0 */' >> ${h}
1148 if wantfeat MD5; then
1149 echo '#define HAVE_MD5' >> ${h}
1150 else
1151 echo '/* WANT_MD5=0 */' >> ${h}
1154 ## Summarizing ##
1156 # Since we cat(1) the content of those to cc/"ld", convert them to single line
1157 squeeze_em() {
1158 < "${1}" > "${2}" ${awk} \
1159 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1161 ${rm} -f ${tmp}
1162 squeeze_em ${inc} ${tmp}
1163 ${mv} ${tmp} ${inc}
1164 squeeze_em ${lib} ${tmp}
1165 ${mv} ${tmp} ${lib}
1167 # config.h
1168 ${mv} ${h} ${tmp}
1169 printf '#ifndef _CONFIG_H\n# define _CONFIG_H\n' > ${h}
1170 ${cat} ${tmp} >> ${h}
1172 printf '\n/* The "feature string", for "simplicity" and lex.c */\n' >> ${h}
1173 printf '#ifdef _MAIN_SOURCE\n' >> ${h}
1174 printf '# ifdef HAVE_AMALGAMATION\nstatic\n# endif\n' >> ${h}
1175 printf 'char const features[] = "MIME"\n' >> ${h}
1176 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
1177 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
1178 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
1179 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
1180 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
1181 printf '# ifdef HAVE_IPV6\n ",IPv6"\n# endif\n' >> ${h}
1182 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TLS"\n# endif\n' >> ${h}
1183 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
1184 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
1185 printf '# ifdef HAVE_IMAP\n ",IMAP"\n# endif\n' >> ${h}
1186 printf '# ifdef HAVE_GSSAPI\n ",GSS-API"\n# endif\n' >> ${h}
1187 printf '# ifdef HAVE_NETRC\n ",NETRC"\n# endif\n' >> ${h}
1188 printf '# ifdef HAVE_AGENT\n ",AGENT"\n# endif\n' >> ${h}
1189 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
1190 printf '# ifdef HAVE_IMAP_SEARCH\n ",IMAP-searches"\n# endif\n' >> ${h}
1191 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
1192 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
1193 printf '# ifdef HAVE_EDITLINE\n ",EDITLINE"\n# endif\n' >> ${h}
1194 printf '# ifdef HAVE_NCL\n ",NCL"\n# endif\n' >> ${h}
1195 printf '# ifdef HAVE_TABEXPAND\n ",TABEXPAND"\n# endif\n' >> ${h}
1196 printf '# ifdef HAVE_HISTORY\n ",HISTORY"\n# endif\n' >> ${h}
1197 printf '# ifdef HAVE_SPAM\n ",SPAM"\n# endif\n' >> ${h}
1198 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
1199 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
1200 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
1201 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
1202 printf ';\n#endif /* _MAIN_SOURCE */\n' >> ${h}
1204 printf '#endif /* _CONFIG_H */\n' >> ${h}
1205 ${rm} -f ${tmp}
1207 # Create the real mk.mk
1208 ${rm} -rf ${tmp0}.* ${tmp0}*
1209 printf 'OBJ_SRC = ' >> ${mk}
1210 if nwantfeat AMALGAMATION; then
1211 echo *.c >> ${mk}
1212 echo 'OBJ_DEP =' >> ${mk}
1213 else
1214 j=`echo "${src}" | sed 's/^.\///'`
1215 echo "${j}" >> ${mk}
1216 printf 'OBJ_DEP = main.c ' >> ${mk}
1217 printf '#define _MAIN_SOURCE\n' >> ${src}
1218 printf '#include "nail.h"\n#include "main.c"\n' >> ${src}
1219 for i in *.c; do
1220 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ]; then
1221 continue
1223 printf "${i} " >> ${mk}
1224 printf "#include \"${i}\"\n" >> ${src}
1225 done
1226 echo >> ${mk}
1229 echo "LIBS = `${cat} ${lib}`" >> ${mk}
1230 echo "INCLUDES = `${cat} ${inc}`" >> ${mk}
1231 echo >> ${mk}
1232 ${cat} ./mk-mk.in >> ${mk}
1234 ## Finished! ##
1236 ${cat} > ${tmp2}.c << \!
1237 #include "config.h"
1238 #ifdef HAVE_NL_LANGINFO
1239 # include <langinfo.h>
1240 #endif
1242 :The following optional features are enabled:
1243 #ifdef HAVE_SETLOCALE
1244 : + Locale support: Printable characters depend on the environment
1245 # ifdef HAVE_C90AMEND1
1246 : + Multibyte character support
1247 # endif
1248 # ifdef HAVE_NL_LANGINFO
1249 : + Automatic detection of terminal character set
1250 # endif
1251 #endif
1252 #ifdef HAVE_ICONV
1253 : + Character set conversion using iconv()
1254 #endif
1255 #ifdef HAVE_SOCKETS
1256 : + Network support
1257 #endif
1258 #ifdef HAVE_IPV6
1259 : + Support for Internet Protocol v6 (IPv6)
1260 #endif
1261 #ifdef HAVE_SSL
1262 # ifdef HAVE_OPENSSL
1263 : + S/MIME and SSL/TLS (OpenSSL)
1264 # endif
1265 #endif
1266 #ifdef HAVE_SMTP
1267 : + SMTP protocol
1268 #endif
1269 #ifdef HAVE_POP3
1270 : + POP3 protocol
1271 #endif
1272 #ifdef HAVE_IMAP
1273 : + IMAP protocol
1274 #endif
1275 #ifdef HAVE_GSSAPI
1276 : + GSS-API authentication
1277 #endif
1278 #ifdef HAVE_NETRC
1279 : + .netrc file support
1280 #endif
1281 #ifdef HAVE_AGENT
1282 : + Password query through agent
1283 #endif
1284 #ifdef HAVE_IDNA
1285 : + IDNA (internationalized domain names for applications) support
1286 #endif
1287 #ifdef HAVE_IMAP_SEARCH
1288 : + IMAP-style search expressions
1289 #endif
1290 #ifdef HAVE_REGEX
1291 : + Regular expression support (searches, conditional expressions etc.)
1292 #endif
1293 #if defined HAVE_READLINE || defined HAVE_EDITLINE || defined HAVE_NCL
1294 : + Command line editing
1295 # ifdef HAVE_TABEXPAND
1296 : + + Tabulator expansion
1297 # endif
1298 # ifdef HAVE_HISTORY
1299 : + + History management
1300 # endif
1301 #endif
1302 #ifdef HAVE_SPAM
1303 : + Interaction with spam filters
1304 #endif
1305 #ifdef HAVE_DOCSTRINGS
1306 : + Documentation summary strings
1307 #endif
1308 #ifdef HAVE_QUOTE_FOLD
1309 : + Extended *quote-fold*ing
1310 #endif
1311 #ifdef HAVE_COLOUR
1312 : + Coloured message display (simple)
1313 #endif
1315 :The following optional features are disabled:
1316 #ifndef HAVE_SETLOCALE
1317 : - Locale support: Only ASCII characters are recognized
1318 #endif
1319 # ifndef HAVE_C90AMEND1
1320 : - Multibyte character support
1321 # endif
1322 # ifndef HAVE_NL_LANGINFO
1323 : - Automatic detection of terminal character set
1324 # endif
1325 #ifndef HAVE_ICONV
1326 : - Character set conversion using iconv()
1327 #endif
1328 #ifndef HAVE_SOCKETS
1329 : - Network support
1330 #endif
1331 #ifndef HAVE_IPV6
1332 : - Support for Internet Protocol v6 (IPv6)
1333 #endif
1334 #ifndef HAVE_SSL
1335 : - S/MIME and SSL/TLS
1336 #endif
1337 #ifndef HAVE_SMTP
1338 : - SMTP protocol
1339 #endif
1340 #ifndef HAVE_POP3
1341 : - POP3 protocol
1342 #endif
1343 #ifndef HAVE_IMAP
1344 : - IMAP protocol
1345 #endif
1346 #ifndef HAVE_GSSAPI
1347 : - GSS-API authentication
1348 #endif
1349 #ifndef HAVE_NETRC
1350 : - .netrc file support
1351 #endif
1352 #ifndef HAVE_AGENT
1353 : - Password query through agent
1354 #endif
1355 #ifndef HAVE_IDNA
1356 : - IDNA (internationalized domain names for applications) support
1357 #endif
1358 #ifndef HAVE_IMAP_SEARCH
1359 : - IMAP-style search expressions
1360 #endif
1361 #ifndef HAVE_REGEX
1362 : - Regular expression support
1363 #endif
1364 #if !defined HAVE_READLINE && !defined HAVE_EDITLINE && !defined HAVE_NCL
1365 : - Command line editing and history
1366 #endif
1367 #ifndef HAVE_SPAM
1368 : - Interaction with spam filters
1369 #endif
1370 #ifndef HAVE_DOCSTRINGS
1371 : - Documentation summary strings
1372 #endif
1373 #ifndef HAVE_QUOTE_FOLD
1374 : - Extended *quote-fold*ing
1375 #endif
1376 #ifndef HAVE_COLOUR
1377 : - Coloured message display (simple)
1378 #endif
1380 :Remarks:
1381 #ifndef HAVE_SNPRINTF
1382 : . The function snprintf() could not be found. We will use and internal
1383 : sprintf() instead. This might overflow buffers if input values are larger
1384 : than expected. Use the resulting binary with care or update your system
1385 : environment and start the configuration process again.
1386 #endif
1387 #ifndef HAVE_FCHDIR
1388 : . The function fchdir() could not be found. We will use chdir()
1389 : instead. This is not a problem unless the current working
1390 : directory of mailx is moved while the IMAP cache is used.
1391 #endif
1392 #ifdef HAVE_DEBUG
1393 : . Debug enabled binary: not meant to be used by end-users: THANKS!
1394 #endif
1398 ${make} -f ${makefile} ${tmp2}.x
1399 < ${tmp2}.x >&5 ${sed} -e '/^[^:]/d; /^$/d; s/^://'
1401 # s-it-mode