acmava.c:_define1(): allow empty lines, don't unstack if loading
[s-mailx.git] / mk-conf.sh
blob90d79613ed3aab008541baf754376f3a07ba986a
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 # $CC is overwritten when empty or a default "cc", even without WANT_AUTOCC
71 optim= dbgoptim= _CFLAGS=
72 if [ -z "${CC}" ] || [ "${CC}" = cc ]; then
73 if { CC="`command -v clang`"; }; then
75 elif { CC="`command -v gcc`"; }; then
77 elif { CC="`command -v c89`"; }; then
78 [ "`uname -s`" = UnixWare ] && _CFLAGS=-v optim=-O dbgoptim=
79 elif { CC="`command -v c99`"; }; then
81 else
82 echo >&2 'ERROR'
83 echo >&2 ' I cannot find a compiler!'
84 echo >&2 ' Neither of clang(1), gcc(1), c89(1) and c99(1).'
85 echo >&2 ' Please set the CC environment variable, maybe CFLAGS also.'
86 exit 1
89 export CC
91 ccver=`${CC} --version 2>/dev/null`
92 stackprot=no
93 if { i=${ccver}; echo "${i}"; } | ${grep} -q -i -e gcc -e clang; then
94 #if echo "${i}" | ${grep} -q -i -e gcc -e 'clang version 1'; then
95 optim=-O2 dbgoptim=-O
96 stackprot=yes
97 _CFLAGS="${_CFLAGS} -std=c89 -Wall -Wextra -pedantic"
98 _CFLAGS="${_CFLAGS} -fno-unwind-tables -fno-asynchronous-unwind-tables"
99 _CFLAGS="${_CFLAGS} -fstrict-aliasing"
100 _CFLAGS="${_CFLAGS} -Wbad-function-cast -Wcast-align -Wcast-qual"
101 _CFLAGS="${_CFLAGS} -Winit-self -Wmissing-prototypes"
102 _CFLAGS="${_CFLAGS} -Wshadow -Wunused -Wwrite-strings"
103 _CFLAGS="${_CFLAGS} -Wno-long-long" # ISO C89 has no 'long long'...
104 if { i=${ccver}; echo "${i}"; } | ${grep} -q -e 'clang version 1'; then
105 _CFLAGS="${_CFLAGS} -Wstrict-overflow=5"
106 else
107 _CFLAGS="${_CFLAGS} -fstrict-overflow -Wstrict-overflow=5"
108 if wantfeat AMALGAMATION && nwantfeat DEBUG; then
109 _CFLAGS="${_CFLAGS} -Wno-unused-function"
111 if { i=${ccver}; echo "${i}"; } | ${grep} -q -i -e clang; then
112 _CFLAGS="${_CFLAGS} -Wno-unused-result" # TODO handle the right way
115 if wantfeat AMALGAMATION; then
116 _CFLAGS="${_CFLAGS} -pipe"
118 # elif { i=${ccver}; echo "${i}"; } | ${grep} -q -i -e clang; then
119 # optim=-O3 dbgoptim=-O
120 # stackprot=yes
121 # _CFLAGS='-std=c89 -Weverything -Wno-long-long'
122 # if wantfeat AMALGAMATION; then
123 # _CFLAGS="${_CFLAGS} -pipe"
124 # fi
125 elif [ -z "${optim}" ]; then
126 optim=-O1 dbgoptim=-O
129 if nwantfeat DEBUG; then
130 _CFLAGS="${optim} -DNDEBUG ${_CFLAGS}"
131 else
132 _CFLAGS="${dbgoptim} -g -ftrapv ${_CFLAGS}";
133 if [ "${stackprot}" = yes ]; then
134 _CFLAGS="${_CFLAGS} -fstack-protector-all "
135 _CFLAGS="${_CFLAGS} -Wstack-protector -D_FORTIFY_SOURCE=2"
138 _CFLAGS="${_CFLAGS} ${ADDCFLAGS}"
139 # XXX -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack: need detection
140 _LDFLAGS="${_LDFLAGS} ${ADDLDFLAGS}" # XXX -Wl,--sort-common,[-O1]
141 export _CFLAGS _LDFLAGS
143 # $CFLAGS and $LDFLAGS are only overwritten if explicitly wanted
144 if wantfeat AUTOCC; then
145 CFLAGS=$_CFLAGS
146 LDFLAGS=$_LDFLAGS
147 export CFLAGS LDFLAGS
151 ## -- >8 -- 8< -- ##
153 ## Notes:
154 ## - Heirloom sh(1) (and same origin) have problems with ': >' redirection,
155 ## so use "printf '' >" instead
156 ## - Heirloom sh(1) and maybe more execute loops with redirection in a subshell
157 ## (but don't export eval's from within), therefore we need to (re)include
158 ## variable assignments at toplevel instead (via reading temporary files)
160 ## First of all, create new configuration and check wether it changed ##
162 conf=./conf.rc
163 lst=./config.lst
164 h=./config.h
165 mk=./mk.mk
167 newlst=./config.lst-new
168 newmk=./config.mk-new
169 newh=./config.h-new
170 tmp0=___tmp
171 tmp=./${tmp0}1$$
173 # We need some standard utilities
174 unset -f command
175 check_tool() {
176 n=$1 i=$2 opt=${3:-0}
177 if type "${i}" >/dev/null 2>&1; then
178 eval ${n}=${i}
179 return 1
181 if [ ${opt} -eq 0 ]; then
182 echo >&2 "ERROR: no trace of the utility \`${n}'"
183 exit 1
185 return 0
188 # Check those tools right now that we need before including ${conf}
189 check_tool rm "${rm:-`command -v rm`}"
190 check_tool sed "${sed:-`command -v sed`}"
192 # Only incorporate what wasn't overwritten from command line / CONFIG
193 trap "${rm} -f ${tmp}; exit" 1 2 15
194 trap "${rm} -f ${tmp}" 0
195 ${rm} -f ${tmp}
197 < ${conf} ${sed} -e '/^[ \t]*#/d' -e '/^$/d' -e 's/[ \t]*$//' |
198 while read line; do
199 i=`echo ${line} | ${sed} -e 's/=.*$//'`
200 eval j=\$${i} jx=\${${i}+x}
201 if [ -n "${j}" ] || [ "${jx}" = x ]; then
202 line="${i}=\"${j}\""
204 echo ${line}
205 done > ${tmp}
206 . ./${tmp}
208 check_tool awk "${awk:-`command -v awk`}"
209 check_tool cat "${cat:-`command -v cat`}"
210 check_tool chmod "${chmod:-`command -v chmod`}"
211 check_tool cp "${cp:-`command -v cp`}"
212 check_tool cmp "${cmp:-`command -v cmp`}"
213 check_tool grep "${grep:-`command -v grep`}"
214 check_tool mkdir "${mkdir:-`command -v mkdir`}"
215 check_tool mv "${mv:-`command -v mv`}"
216 # rm(1), sed(1) above
217 check_tool tee "${tee:-`command -v tee`}"
219 check_tool make "${MAKE:-`command -v make`}"
220 check_tool strip "${STRIP:-`command -v strip`}" 1
221 HAVE_STRIP=${?}
223 wantfeat() {
224 eval i=\$WANT_${1}
225 [ "${i}" = "1" ]
227 nwantfeat() {
228 eval i=\$WANT_${1}
229 [ "${i}" != "1" ]
232 option_update
234 # (No function since some shells loose non-exported variables in traps)
235 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}; exit" 1 2 15
236 trap "${rm} -f ${tmp} ${newlst} ${newmk} ${newh}" 0
237 ${rm} -f ${newlst} ${newmk} ${newh}
239 # (Could: use FD redirection, add eval(1) and don't re-'. ./${newlst}')
240 while read line; do
241 i=`echo ${line} | ${sed} -e 's/=.*$//'`
242 eval j=\$${i}
243 if [ -z "${j}" ] || [ "${j}" = 0 ]; then
244 printf "/*#define ${i}*/\n" >> ${newh}
245 elif [ "${j}" = 1 ]; then
246 printf "#define ${i}\n" >> ${newh}
247 else
248 printf "#define ${i} \"${j}\"\n" >> ${newh}
250 printf "${i} = ${j}\n" >> ${newmk}
251 printf "${i}=\"${j}\"\n"
252 done < ${tmp} > ${newlst}
253 . ./${newlst}
255 printf "#define UAGENT \"${SID}${NAIL}\"\n" >> ${newh}
256 printf "UAGENT = ${SID}${NAIL}\n" >> ${newmk}
258 compiler_flags
260 printf "CC = ${CC}\n" >> ${newmk}
261 printf "_CFLAGS = ${_CFLAGS}\nCFLAGS = ${CFLAGS}\n" >> ${newmk}
262 printf "_LDFLAGS = ${_LDFLAGS}\nLDFLAGS = ${LDFLAGS}\n" >> ${newmk}
263 printf "AWK = ${awk}\nCMP = ${cmp}\nCHMOD = ${chmod}\nCP = ${cp}\n" >> ${newmk}
264 printf "GREP = ${grep}\nMKDIR = ${mkdir}\nRM = ${rm}\nSED = ${sed}\n" \
265 >> ${newmk}
266 printf "STRIP = ${strip}\nHAVE_STRIP = ${HAVE_STRIP}\n" >> ${newmk}
267 # (We include the cc(1)/ld(1) environment only for update detection..)
268 printf "CC=\"${CC}\"\n" >> ${newlst}
269 printf "_CFLAGS=\"${_CFLAGS}\"\nCFLAGS=\"${CFLAGS}\"\n" >> ${newlst}
270 printf "_LDFLAGS=\"${_LDFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n" >> ${newlst}
271 printf "AWK=${awk}\nCMP=${cmp}\nCHMOD=${chmod}\nCP=${cp}\n" >> ${newlst}
272 printf "GREP=${grep}\nMKDIR=${mkdir}\nRM=${rm}\nSED=${sed}\n" >> ${newlst}
273 printf "STRIP=${strip}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newlst}
275 if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
276 exit 0
278 [ -f ${lst} ] && echo 'configuration updated..' || echo 'shiny configuration..'
280 ${mv} -f ${newlst} ${lst}
281 ${mv} -f ${newh} ${h}
282 ${mv} -f ${newmk} ${mk}
284 ## Compile and link checking ##
286 tmp2=./${tmp0}2$$
287 tmp3=./${tmp0}3$$
288 log=./config.log
289 lib=./config.lib
290 inc=./config.inc
291 src=./config.c
292 makefile=./config.mk
294 # (No function since some shells loose non-exported variables in traps)
295 trap "${rm} -f ${lst} ${h} ${mk} ${lib} ${inc} ${src} ${makefile}; exit" 1 2 15
296 trap "${rm} -rf ${tmp0}.* ${tmp0}* ${makefile}" 0
298 exec 5>&2 > ${log} 2>&1
299 printf '' > ${lib}
300 printf '' > ${inc}
301 # ${src} is only created if WANT_AMALGAMATION
302 ${rm} -f ${src}
303 ${cat} > ${makefile} << \!
304 .SUFFIXES: .o .c .x .y
305 .c.o:
306 $(CC) $(XINCS) -c $<
307 .c.x:
308 $(CC) $(XINCS) -E $< >$@
310 $(CC) $(XINCS) -o $@ $< $(XLIBS)
311 .y: ;
314 msg() {
315 fmt=$1
317 shift
318 printf "*** ${fmt}\\n" "${@}"
319 printf "${fmt}" "${@}" >&5
322 _check_preface() {
323 variable=$1 topic=$2 define=$3
325 echo '**********'
326 msg "checking ${topic} ... "
327 echo "/* checked ${topic} */" >> ${h}
328 ${rm} -f ${tmp} ${tmp}.o
329 echo '*** test program is'
330 ${tee} ${tmp}.c
331 #echo '*** the preprocessor generates'
332 #${make} -f ${makefile} ${tmp}.x
333 #${cat} ${tmp}.x
334 echo '*** results are'
337 compile_check() {
338 variable=$1 topic=$2 define=$3
340 _check_preface "${variable}" "${topic}" "${define}"
342 if ${make} -f ${makefile} XINCS="${INCS}" ./${tmp}.o &&
343 [ -f ./${tmp}.o ]; then
344 msg "yes\\n"
345 echo "${define}" >> ${h}
346 eval have_${variable}=yes
347 return 0
348 else
349 echo "/* ${define} */" >> ${h}
350 msg "no\\n"
351 eval unset have_${variable}
352 return 1
356 _link_mayrun() {
357 run=$1 variable=$2 topic=$3 define=$4 libs=$5 incs=$6
359 _check_preface "${variable}" "${topic}" "${define}"
361 if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
362 XLIBS="${LIBS} ${libs}" ./${tmp} &&
363 [ -f ./${tmp} ] &&
364 { [ ${run} -eq 0 ] || ./${tmp}; }; then
365 echo "*** adding INCS<${incs}> LIBS<${libs}>"
366 msg "yes\\n"
367 echo "${define}" >> ${h}
368 LIBS="${LIBS} ${libs}"
369 echo "${libs}" >> ${lib}
370 INCS="${INCS} ${incs}"
371 echo "${incs}" >> ${inc}
372 eval have_${variable}=yes
373 return 0
374 else
375 msg "no\\n"
376 echo "/* ${define} */" >> ${h}
377 eval unset have_${variable}
378 return 1
382 link_check() {
383 _link_mayrun 0 "${1}" "${2}" "${3}" "${4}" "${5}"
386 run_check() {
387 _link_mayrun 1 "${1}" "${2}" "${3}" "${4}" "${5}"
390 # Build a basic set of INCS and LIBS according to user environment.
391 # On pkgsrc(7) systems automatically add /usr/pkg/*
392 if [ -n "${C_INCLUDE_PATH}" ]; then
393 i=${IFS}
394 IFS=:
395 set -- ${C_INCLUDE_PATH}
396 IFS=${i}
397 # for i; do -- new in POSIX Issue 7 + TC1
398 for i
400 [ "${i}" = '/usr/pkg/include' ] && continue
401 INCS="${INCS} -I${i}"
402 done
404 [ -d /usr/pkg/include ] && INCS="${INCS} -I/usr/pkg/include"
405 echo "${INCS}" >> ${inc}
407 if [ -n "${LD_LIBRARY_PATH}" ]; then
408 i=${IFS}
409 IFS=:
410 set -- ${LD_LIBRARY_PATH}
411 IFS=${i}
412 # for i; do -- new in POSIX Issue 7 + TC1
413 for i
415 [ "${i}" = '/usr/pkg/lib' ] && continue
416 LIBS="${LIBS} -L${i}"
417 done
419 [ -d /usr/pkg/lib ] && LIBS="${LIBS} -L/usr/pkg/lib"
420 echo "${LIBS}" >> ${lib}
424 # Better set _GNU_SOURCE (if we are on Linux only?); 'surprised it did without
425 echo '#define _GNU_SOURCE' >> ${h}
427 if link_check hello 'if a hello world program can be built' << \!
428 #include <stdio.h>
430 int main(int argc, char *argv[])
432 (void)argc;
433 (void)argv;
434 puts("hello world");
435 return 0;
438 then
440 else
441 echo >&5 'This oooops is most certainly not related to me.'
442 echo >&5 "Read the file ${log} and check your compiler environment."
443 ${rm} -f ${lst} ${h} ${mk}
444 exit 1
447 if link_check termios 'for termios.h and tc*() family' << \!
448 #include <termios.h>
449 int main(void)
451 struct termios tios;
452 tcgetattr(0, &tios);
453 tcsetattr(0, TCSADRAIN | TCSAFLUSH, &tios);
454 return 0;
457 then
459 else
460 echo >&5 'We require termios.h and the tc*() family of functions.'
461 echo >&5 "That much Unix we indulge ourselfs."
462 ${rm} -f ${lst} ${h} ${mk}
463 exit 1
466 #link_check setenv 'for setenv()/unsetenv()' '#define HAVE_SETENV' << \!
467 ##include <stdlib.h>
468 #int main(void)
470 # setenv("s-nail", "to be made nifty!", 1);
471 # unsetenv("s-nail");
472 # return 0;
476 link_check snprintf 'for snprintf()' '#define HAVE_SNPRINTF' << \!
477 #include <stdio.h>
478 int main(void)
480 char b[20];
481 snprintf(b, sizeof b, "%s", "string");
482 return 0;
486 link_check putc_unlocked 'for putc_unlocked()' '#define HAVE_PUTC_UNLOCKED' <<\!
487 #include <stdio.h>
488 int main(void)
490 putc_unlocked('@', stdout);
491 return 0;
495 link_check fchdir 'for fchdir()' '#define HAVE_FCHDIR' << \!
496 #include <unistd.h>
497 int main(void)
499 fchdir(0);
500 return 0;
504 link_check pipe2 'for pipe2()' '#define HAVE_PIPE2' << \!
505 #include <fcntl.h>
506 #include <unistd.h>
507 int main(void)
509 int fds[2];
510 pipe2(fds, O_CLOEXEC);
511 return 0;
515 link_check mmap 'for mmap()' '#define HAVE_MMAP' << \!
516 #include <sys/types.h>
517 #include <sys/mman.h>
518 int main(void)
520 mmap(0, 0, 0, 0, 0, 0);
521 return 0;
525 link_check mremap 'for mremap()' '#define HAVE_MREMAP' << \!
526 #include <sys/types.h>
527 #include <sys/mman.h>
528 int main(void)
530 mremap(0, 0, 0, MREMAP_MAYMOVE);
531 return 0;
535 link_check setlocale 'for setlocale()' '#define HAVE_SETLOCALE' << \!
536 #include <locale.h>
537 int main(void)
539 setlocale(LC_ALL, "");
540 return 0;
544 if [ "${have_setlocale}" = yes ]; then
545 link_check c90amend1 'for ISO/IEC 9899:1990/Amendment 1:1995' \
546 '#define HAVE_C90AMEND1' << \!
547 #include <limits.h>
548 #include <stdlib.h>
549 #include <wchar.h>
550 #include <wctype.h>
551 int main(void)
553 char mbb[MB_LEN_MAX + 1];
554 wchar_t wc;
555 iswprint(L'c');
556 towupper(L'c');
557 mbtowc(&wc, "x", 1);
558 mbrtowc(&wc, "x", 1, NULL);
559 (void)wctomb(mbb, wc);
560 return (mblen("\0", 1) == 0);
564 if [ "${have_c90amend1}" = yes ]; then
565 link_check wcwidth 'for wcwidth()' '#define HAVE_WCWIDTH' << \!
566 #include <wchar.h>
567 int main(void)
569 wcwidth(L'c');
570 return 0;
575 link_check nl_langinfo 'for nl_langinfo()' '#define HAVE_NL_LANGINFO' << \!
576 #include <langinfo.h>
577 #include <stdlib.h>
578 int main(void)
580 nl_langinfo(DAY_1);
581 return (nl_langinfo(CODESET) == NULL);
584 fi # have_setlocale
586 link_check mkstemp 'for mkstemp()' '#define HAVE_MKSTEMP' << \!
587 #include <stdlib.h>
588 int main(void)
590 mkstemp("x");
591 return 0;
595 # Note: run_check, thus we also get only the desired implementation...
596 run_check realpath 'for realpath()' '#define HAVE_REALPATH' << \!
597 #include <stdlib.h>
598 int main(void)
600 char *x = realpath(".", NULL), *y = realpath("/", NULL);
601 return (x != NULL && y != NULL) ? 0 : 1;
605 link_check wordexp 'for wordexp()' '#define HAVE_WORDEXP' << \!
606 #include <wordexp.h>
607 int main(void)
609 wordexp((char *)0, (wordexp_t *)0, 0);
610 return 0;
616 if wantfeat DEBUG; then
617 echo '#define HAVE_DEBUG' >> ${h}
620 if wantfeat AMALGAMATION; then
621 echo '#define HAVE_AMALGAMATION' >> ${h}
624 if nwantfeat NOALLOCA; then
625 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
626 # versions of alloca(3) since modern compilers just can't be trusted
627 # not to overoptimize and silently break some code
628 link_check alloca 'for __builtin_alloca()' \
629 '#define HAVE_ALLOCA __builtin_alloca' << \!
630 int main(void)
632 void *vp = __builtin_alloca(1);
633 return (!! vp);
638 if nwantfeat NOGETOPT; then
639 link_check getopt 'for getopt()' '#define HAVE_GETOPT' << \!
640 #include <unistd.h>
641 int main(int argc, char **argv)
643 #if defined __GLIBC__ || defined __linux__
644 Argument and option reordering is not a desired feature.
645 #else
646 getopt(argc, argv, "oPt");
647 #endif
648 return (((long)optarg + optind) & 0x7F);
655 if wantfeat ICONV; then
656 ${cat} > ${tmp2}.c << \!
657 #include <iconv.h>
658 int main(void)
660 iconv_t id;
662 id = iconv_open("foo", "bar");
663 return 0;
666 < ${tmp2}.c link_check iconv 'for iconv functionality' \
667 '#define HAVE_ICONV' ||
668 < ${tmp2}.c link_check iconv \
669 'for iconv functionality in libiconv' \
670 '#define HAVE_ICONV' '-liconv'
671 else
672 echo '/* WANT_ICONV=0 */' >> ${h}
673 fi # wantfeat ICONV
675 if wantfeat SOCKETS; then
676 compile_check arpa_inet_h 'for <arpa/inet.h>' \
677 '#define HAVE_ARPA_INET_H' << \!
678 #include "config.h"
679 #include <sys/types.h>
680 #include <sys/socket.h>
681 #include <netdb.h>
682 #include <netinet/in.h>
683 #include <arpa/inet.h>
686 ${cat} > ${tmp2}.c << \!
687 #include "config.h"
688 #include <sys/types.h>
689 #include <sys/socket.h>
690 #include <netdb.h>
691 #include <netinet/in.h>
692 #ifdef HAVE_ARPA_INET_H
693 #include <arpa/inet.h>
694 #endif
696 int main(void)
698 struct sockaddr s;
699 socket(AF_INET, SOCK_STREAM, 0);
700 connect(0, &s, 0);
701 gethostbyname("foo");
702 return 0;
706 < ${tmp2}.c link_check sockets 'for sockets in libc' \
707 '#define HAVE_SOCKETS' ||
708 < ${tmp2}.c link_check sockets 'for sockets in libnsl' \
709 '#define HAVE_SOCKETS' '-lnsl' ||
710 < ${tmp2}.c link_check sockets \
711 'for sockets in libsocket and libnsl' \
712 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
713 WANT_SOCKETS=0
715 # XXX Shouldn't it be a hard error if there is no socket support, then?
716 option_update
717 else
718 echo '/* WANT_SOCKETS=0 */' >> ${h}
719 fi # wantfeat SOCKETS
721 wantfeat SOCKETS &&
722 link_check setsockopt 'for setsockopt()' '#define HAVE_SETSOCKOPT' << \!
723 #include <sys/socket.h>
724 #include <stdlib.h>
725 int main(void)
727 int sockfd = 3;
728 setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0);
729 return 0;
733 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
734 link_check so_sndtimeo 'for SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
735 #include <sys/socket.h>
736 #include <stdlib.h>
737 int main(void)
739 struct timeval tv;
740 int sockfd = 3;
741 tv.tv_sec = 42;
742 tv.tv_usec = 21;
743 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
744 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
745 return 0;
749 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
750 link_check so_linger 'for SO_LINGER' '#define HAVE_SO_LINGER' << \!
751 #include <sys/socket.h>
752 #include <stdlib.h>
753 int main(void)
755 struct linger li;
756 int sockfd = 3;
757 li.l_onoff = 1;
758 li.l_linger = 42;
759 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
760 return 0;
764 if wantfeat IPV6; then
765 link_check ipv6 'for IPv6 functionality' '#define HAVE_IPV6' << \!
766 #include "config.h"
767 #include <sys/types.h>
768 #include <sys/socket.h>
769 #include <netdb.h>
770 #include <netinet/in.h>
771 #ifdef HAVE_ARPA_INET_H
772 #include <arpa/inet.h>
773 #endif
775 int main(void)
777 struct addrinfo a, *ap;
778 getaddrinfo("foo", "0", &a, &ap);
779 return 0;
782 else
783 echo '/* WANT_IPV6=0 */' >> ${h}
784 fi # wantfeat IPV6
786 if wantfeat IMAP; then
787 echo '#define HAVE_IMAP' >> ${h}
788 else
789 echo '/* WANT_IMAP=0 */' >> ${h}
792 if wantfeat POP3; then
793 echo '#define HAVE_POP3' >> ${h}
794 else
795 echo '/* WANT_POP3=0 */' >> ${h}
798 if wantfeat SMTP; then
799 echo '#define HAVE_SMTP' >> ${h}
800 else
801 echo '/* WANT_SMTP=0 */' >> ${h}
804 if wantfeat SSL; then
805 link_check openssl 'for sufficiently recent OpenSSL' \
806 '#define HAVE_SSL
807 #define HAVE_OPENSSL' '-lssl -lcrypto' << \!
808 #include <openssl/ssl.h>
809 #include <openssl/err.h>
810 #include <openssl/x509v3.h>
811 #include <openssl/x509.h>
812 #include <openssl/rand.h>
814 #if defined OPENSSL_NO_SSL2 && defined OPENSSL_NO_SSL3 &&\
815 defined OPENSSL_NO_TLS1
816 # error We need one of (SSLv2 and) SSLv3 and TLS1.
817 #endif
819 int main(void)
821 SSLv23_client_method();
822 #ifndef OPENSSL_NO_SSL3
823 SSLv3_client_method();
824 #endif
825 #ifndef OPENSSL_NO_TLS1
826 TLSv1_client_method();
827 # ifdef TLS1_1_VERSION
828 TLSv1_1_client_method();
829 # endif
830 # ifdef TLS1_2_VERSION
831 TLSv1_2_client_method();
832 # endif
833 #endif
834 PEM_read_PrivateKey(0, 0, 0, 0);
835 return 0;
839 if [ "${have_openssl}" = 'yes' ]; then
840 compile_check stack_of 'for OpenSSL STACK_OF()' \
841 '#define HAVE_STACK_OF' << \!
842 #include <openssl/ssl.h>
843 #include <openssl/err.h>
844 #include <openssl/x509v3.h>
845 #include <openssl/x509.h>
846 #include <openssl/rand.h>
848 int main(void)
850 STACK_OF(GENERAL_NAME) *gens = NULL;
851 printf("%p", gens); /* to make it used */
852 return 0;
856 if wantfeat MD5; then
857 run_check openssl_md5 'for MD5 digest in OpenSSL' \
858 '#define HAVE_OPENSSL_MD5' << \!
859 #include <string.h>
860 #include <openssl/md5.h>
862 int main(void)
864 char const dat[] = "abrakadabrafidibus";
865 char dig[16], hex[16 * 2];
866 MD5_CTX ctx;
867 size_t i, j;
869 memset(dig, 0, sizeof(dig));
870 memset(hex, 0, sizeof(hex));
871 MD5_Init(&ctx);
872 MD5_Update(&ctx, dat, sizeof(dat) - 1);
873 MD5_Final(dig, &ctx);
875 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
876 for (i = 0; i < sizeof(hex) / 2; i++) {
877 j = i << 1;
878 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
879 hex[++j] = hexchar(dig[i] & 0x0f);
881 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
884 fi # wantfeat MD5
886 else
887 echo '/* WANT_SSL=0 */' >> ${h}
888 fi # wantfeat SSL
890 if wantfeat GSSAPI; then
891 ${cat} > ${tmp2}.c << \!
892 #include <gssapi/gssapi.h>
894 int main(void)
896 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
897 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
898 return 0;
901 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
903 if command -v krb5-config >/dev/null 2>&1; then
904 i=`command -v krb5-config`
905 GSSAPI_LIBS="`CFLAGS= ${i} --libs gssapi`"
906 GSSAPI_INCS="`CFLAGS= ${i} --cflags`"
907 i='for GSSAPI via krb5-config(1)'
908 else
909 GSSAPI_LIBS='-lgssapi'
910 GSSAPI_INCS=
911 i='for GSSAPI in gssapi/gssapi.h, libgssapi'
913 < ${tmp2}.c link_check gssapi \
914 "${i}" '#define HAVE_GSSAPI' \
915 "${GSSAPI_LIBS}" "${GSSAPI_INCS}" ||\
916 < ${tmp3}.c link_check gssapi \
917 'for GSSAPI in gssapi.h, libgssapi' \
918 '#define HAVE_GSSAPI
919 #define GSSAPI_REG_INCLUDE' \
920 '-lgssapi' ||\
921 < ${tmp2}.c link_check gssapi 'for GSSAPI in libgssapi_krb5' \
922 '#define HAVE_GSSAPI' \
923 '-lgssapi_krb5' ||\
924 < ${tmp3}.c link_check gssapi \
925 'for GSSAPI in libgssapi, OpenBSD-style (pre 5.3)' \
926 '#define HAVE_GSSAPI
927 #define GSSAPI_REG_INCLUDE' \
928 '-lgssapi -lkrb5 -lcrypto' \
929 '-I/usr/include/kerberosV' ||\
930 < ${tmp2}.c link_check gssapi 'for GSSAPI in libgss' \
931 '#define HAVE_GSSAPI' \
932 '-lgss' ||\
933 link_check gssapi 'for GSSAPI in libgssapi_krb5, old-style' \
934 '#define HAVE_GSSAPI
935 #define GSSAPI_OLD_STYLE' \
936 '-lgssapi_krb5' << \!
937 #include <gssapi/gssapi.h>
938 #include <gssapi/gssapi_generic.h>
940 int main(void)
942 gss_import_name(0, 0, gss_nt_service_name, 0);
943 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
944 return 0;
947 else
948 echo '/* WANT_GSSAPI=0 */' >> ${h}
949 fi # wantfeat GSSAPI
951 if wantfeat IDNA; then
952 link_check idna 'for GNU Libidn' '#define HAVE_IDNA' '-lidn' << \!
953 #include <idna.h>
954 #include <idn-free.h>
955 #include <stringprep.h>
956 int main(void)
958 char *utf8, *idna_ascii, *idna_utf8;
959 utf8 = stringprep_locale_to_utf8("does.this.work");
960 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
961 != IDNA_SUCCESS)
962 return 1;
963 idn_free(idna_ascii);
964 /* (Rather link check only here) */
965 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
966 return 0;
969 else
970 echo '/* WANT_IDNA=0 */' >> ${h}
973 if wantfeat REGEX; then
974 link_check regex 'for regular expressions' '#define HAVE_REGEX' << \!
975 #include <regex.h>
976 #include <stdlib.h>
977 int main(void)
979 int status;
980 regex_t re;
981 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
982 return 1;
983 status = regexec(&re, "plan9", 0,NULL, 0);
984 regfree(&re);
985 return !(status == REG_NOMATCH);
988 else
989 echo '/* WANT_REGEX=0 */' >> ${h}
992 if wantfeat READLINE; then
993 __edrdlib() {
994 link_check readline "for readline(3) (${1})" \
995 '#define HAVE_READLINE' "${1}" << \!
996 #include <stdio.h>
997 #include <readline/history.h>
998 #include <readline/readline.h>
999 int main(void)
1001 char *rl;
1002 HISTORY_STATE *hs;
1003 HIST_ENTRY **he;
1004 int i;
1005 using_history();
1006 read_history("");
1007 stifle_history(242);
1008 rl = readline("Enter a line:");
1009 if (rl && *rl)
1010 add_history(rl);
1011 write_history("");
1012 rl_extend_line_buffer(10);
1013 rl_point = rl_end = 10;
1014 rl_pre_input_hook = (rl_hook_func_t*)NULL;
1015 rl_forced_update_display();
1016 clear_history();
1017 hs = history_get_history_state();
1018 i = hs->length;
1019 he = history_list();
1020 if (i > 0)
1021 rl = he[0]->line;
1022 rl_free_line_state();
1023 rl_cleanup_after_signal();
1024 rl_reset_after_signal();
1025 return 0;
1030 __edrdlib -lreadline ||
1031 __edrdlib '-lreadline -ltermcap'
1032 [ -n "${have_readline}" ] && WANT_TABEXPAND=1
1035 if wantfeat EDITLINE && [ -z "${have_readline}" ]; then
1036 __edlib() {
1037 link_check editline "for editline(3) (${1})" \
1038 '#define HAVE_EDITLINE' "${1}" << \!
1039 #include <histedit.h>
1040 static char * getprompt(void) { return (char*)"ok"; }
1041 int main(void)
1043 EditLine *el_el = el_init("TEST", stdin, stdout, stderr);
1044 HistEvent he;
1045 History *el_hcom = history_init();
1046 history(el_hcom, &he, H_SETSIZE, 242);
1047 el_set(el_el, EL_SIGNAL, 0);
1048 el_set(el_el, EL_TERMINAL, NULL);
1049 el_set(el_el, EL_HIST, &history, el_hcom);
1050 el_set(el_el, EL_EDITOR, "emacs");
1051 el_set(el_el, EL_PROMPT, &getprompt);
1052 el_source(el_el, NULL);
1053 history(el_hcom, &he, H_GETSIZE);
1054 history(el_hcom, &he, H_CLEAR);
1055 el_end(el_el);
1056 /* TODO add loader and addfn checks */
1057 history_end(el_hcom);
1058 return 0;
1063 __edlib -ledit ||
1064 __edlib '-ledit -ltermcap'
1065 [ -n "${have_editline}" ] && WANT_TABEXPAND=0
1068 if wantfeat NCL && [ -z "${have_editline}" ] && [ -z "${have_readline}" ] &&\
1069 [ -n "${have_c90amend1}" ]; then
1070 have_ncl=1
1071 echo '#define HAVE_NCL' >> ${h}
1072 else
1073 echo '/* WANT_{READLINE,EDITLINE,NCL}=0 */' >> ${h}
1076 # Generic have-a-command-line-editor switch for those who need it below
1077 if [ -n "${have_ncl}" ] || [ -n "${have_editline}" ] ||\
1078 [ -n "${have_readline}" ]; then
1079 have_cle=1
1082 if [ -n "${have_cle}" ] && wantfeat TABEXPAND; then
1083 echo '#define HAVE_TABEXPAND' >> ${h}
1084 else
1085 echo '/* WANT_TABEXPAND=0 */' >> ${h}
1088 if [ -n "${have_cle}" ] && wantfeat HISTORY; then
1089 echo '#define HAVE_HISTORY' >> ${h}
1090 else
1091 echo '/* WANT_HISTORY=0 */' >> ${h}
1094 if wantfeat SPAM; then
1095 echo '#define HAVE_SPAM' >> ${h}
1096 if command -v spamc >/dev/null 2>&1; then
1097 echo "#define SPAMC_PATH \"`command -v spamc`\"" >> ${h}
1099 else
1100 echo '/* WANT_SPAM=0 */' >> ${h}
1103 if wantfeat DOCSTRINGS; then
1104 echo '#define HAVE_DOCSTRINGS' >> ${h}
1105 else
1106 echo '/* WANT_DOCSTRINGS=0 */' >> ${h}
1109 if wantfeat QUOTE_FOLD &&\
1110 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
1111 echo '#define HAVE_QUOTE_FOLD' >> ${h}
1112 else
1113 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
1116 if wantfeat COLOUR; then
1117 echo '#define HAVE_COLOUR' >> ${h}
1118 else
1119 echo '/* WANT_COLOUR=0 */' >> ${h}
1122 if wantfeat IMAP_SEARCH; then
1123 echo '#define HAVE_IMAP_SEARCH' >> ${h}
1124 else
1125 echo '/* WANT_IMAP_SEARCH=0 */' >> ${h}
1128 if wantfeat MD5; then
1129 echo '#define HAVE_MD5' >> ${h}
1130 else
1131 echo '/* WANT_MD5=0 */' >> ${h}
1134 ## Summarizing ##
1136 # Since we cat(1) the content of those to cc/"ld", convert them to single line
1137 squeeze_em() {
1138 < "${1}" > "${2}" ${awk} \
1139 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1141 ${rm} -f ${tmp}
1142 squeeze_em ${inc} ${tmp}
1143 ${mv} ${tmp} ${inc}
1144 squeeze_em ${lib} ${tmp}
1145 ${mv} ${tmp} ${lib}
1147 # config.h
1148 ${mv} ${h} ${tmp}
1149 printf '#ifndef _CONFIG_H\n# define _CONFIG_H\n' > ${h}
1150 ${cat} ${tmp} >> ${h}
1152 printf '\n/* The "feature string", for "simplicity" and lex.c */\n' >> ${h}
1153 printf '#ifdef _MAIN_SOURCE\n' >> ${h}
1154 printf '# ifdef HAVE_AMALGAMATION\nstatic\n# endif\n' >> ${h}
1155 printf 'char const features[] = "MIME"\n' >> ${h}
1156 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
1157 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
1158 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
1159 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
1160 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
1161 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
1162 printf '# ifdef HAVE_IPV6\n ",IPv6"\n# endif\n' >> ${h}
1163 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TLS"\n# endif\n' >> ${h}
1164 printf '# ifdef HAVE_IMAP\n ",IMAP"\n# endif\n' >> ${h}
1165 printf '# ifdef HAVE_GSSAPI\n ",GSSAPI"\n# endif\n' >> ${h}
1166 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
1167 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
1168 printf '# ifdef HAVE_SPAM\n ",SPAM"\n# endif\n' >> ${h}
1169 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
1170 printf '# ifdef HAVE_IMAP_SEARCH\n ",IMAP-searches"\n# endif\n' >> ${h}
1171 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
1172 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
1173 printf '# ifdef HAVE_EDITLINE\n ",EDITLINE"\n# endif\n' >> ${h}
1174 printf '# ifdef HAVE_NCL\n ",NCL"\n# endif\n' >> ${h}
1175 printf '# ifdef HAVE_TABEXPAND\n ",TABEXPAND"\n# endif\n' >> ${h}
1176 printf '# ifdef HAVE_HISTORY\n ",HISTORY MANAGEMENT"\n# endif\n' >> ${h}
1177 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
1178 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
1179 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
1180 printf ';\n#endif /* _MAIN_SOURCE */\n' >> ${h}
1182 printf '#endif /* _CONFIG_H */\n' >> ${h}
1183 ${rm} -f ${tmp}
1185 # Create the real mk.mk
1186 ${rm} -rf ${tmp0}.* ${tmp0}*
1187 printf 'OBJ_SRC = ' >> ${mk}
1188 if nwantfeat AMALGAMATION; then
1189 echo *.c >> ${mk}
1190 echo 'OBJ_DEP =' >> ${mk}
1191 else
1192 j=`echo "${src}" | sed 's/^.\///'`
1193 echo "${j}" >> ${mk}
1194 printf 'OBJ_DEP = main.c ' >> ${mk}
1195 printf '#define _MAIN_SOURCE\n' >> ${src}
1196 printf '#include "nail.h"\n#include "main.c"\n' >> ${src}
1197 for i in *.c; do
1198 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ]; then
1199 continue
1201 printf "${i} " >> ${mk}
1202 printf "#include \"${i}\"\n" >> ${src}
1203 done
1204 echo >> ${mk}
1207 echo "LIBS = `${cat} ${lib}`" >> ${mk}
1208 echo "INCLUDES = `${cat} ${inc}`" >> ${mk}
1209 echo >> ${mk}
1210 ${cat} ./mk-mk.in >> ${mk}
1212 ## Finished! ##
1214 ${cat} > ${tmp2}.c << \!
1215 #include "config.h"
1216 #ifdef HAVE_NL_LANGINFO
1217 # include <langinfo.h>
1218 #endif
1220 :The following optional features are enabled:
1221 #ifdef HAVE_ICONV
1222 : + Character set conversion using iconv()
1223 #endif
1224 #ifdef HAVE_SETLOCALE
1225 : + Locale support: Printable characters depend on the environment
1226 # ifdef HAVE_C90AMEND1
1227 : + Multibyte character support
1228 # endif
1229 # ifdef HAVE_NL_LANGINFO
1230 : + Automatic detection of terminal character set
1231 # endif
1232 #endif
1233 #ifdef HAVE_SOCKETS
1234 : + Network support
1235 #endif
1236 #ifdef HAVE_IPV6
1237 : + Support for Internet Protocol v6 (IPv6)
1238 #endif
1239 #ifdef HAVE_SSL
1240 # ifdef HAVE_OPENSSL
1241 : + S/MIME and SSL/TLS using OpenSSL
1242 # endif
1243 #endif
1244 #ifdef HAVE_IMAP
1245 : + IMAP protocol
1246 #endif
1247 #ifdef HAVE_GSSAPI
1248 : + IMAP GSSAPI authentication
1249 #endif
1250 #ifdef HAVE_POP3
1251 : + POP3 protocol
1252 #endif
1253 #ifdef HAVE_SMTP
1254 : + SMTP protocol
1255 #endif
1256 #ifdef HAVE_SPAM
1257 : + Interaction with spam filters
1258 #endif
1259 #ifdef HAVE_IDNA
1260 : + IDNA (internationalized domain names for applications) support
1261 #endif
1262 #ifdef HAVE_IMAP_SEARCH
1263 : + IMAP-style search expressions
1264 #endif
1265 #ifdef HAVE_REGEX
1266 : + Regular expression searches
1267 #endif
1268 #if defined HAVE_READLINE || defined HAVE_EDITLINE || defined HAVE_NCL
1269 : + Command line editing
1270 # ifdef HAVE_TABEXPAND
1271 : + + Tabulator expansion
1272 # endif
1273 # ifdef HAVE_HISTORY
1274 : + + History management
1275 # endif
1276 #endif
1277 #ifdef HAVE_QUOTE_FOLD
1278 : + Extended *quote-fold*ing
1279 #endif
1280 #ifdef HAVE_COLOUR
1281 : + Coloured message display (simple)
1282 #endif
1284 :The following optional features are disabled:
1285 #ifndef HAVE_ICONV
1286 : - Character set conversion using iconv()
1287 #endif
1288 #ifndef HAVE_SETLOCALE
1289 : - Locale support: Only ASCII characters are recognized
1290 #endif
1291 # ifndef HAVE_C90AMEND1
1292 : - Multibyte character support
1293 # endif
1294 # ifndef HAVE_NL_LANGINFO
1295 : - Automatic detection of terminal character set
1296 # endif
1297 #ifndef HAVE_SOCKETS
1298 : - Network support
1299 #endif
1300 #ifndef HAVE_IPV6
1301 : - Support for Internet Protocol v6 (IPv6)
1302 #endif
1303 #if !defined HAVE_SSL
1304 : - SSL/TLS (network transport authentication and encryption)
1305 #endif
1306 #ifndef HAVE_IMAP
1307 : - IMAP protocol
1308 #endif
1309 #ifndef HAVE_GSSAPI
1310 : - IMAP GSSAPI authentication
1311 #endif
1312 #ifndef HAVE_POP3
1313 : - POP3 protocol
1314 #endif
1315 #ifndef HAVE_SMTP
1316 : - SMTP protocol
1317 #endif
1318 #ifndef HAVE_SPAM
1319 : - Interaction with spam filters
1320 #endif
1321 #ifndef HAVE_IDNA
1322 : - IDNA (internationalized domain names for applications) support
1323 #endif
1324 #ifndef HAVE_IMAP_SEARCH
1325 : - IMAP-style search expressions
1326 #endif
1327 #ifndef HAVE_REGEX
1328 : - Regular expression searches
1329 #endif
1330 #if !defined HAVE_READLINE && !defined HAVE_EDITLINE && !defined HAVE_NCL
1331 : - Command line editing and history
1332 #endif
1333 #ifndef HAVE_QUOTE_FOLD
1334 : - Extended *quote-fold*ing
1335 #endif
1336 #ifndef HAVE_COLOUR
1337 : - Coloured message display (simple)
1338 #endif
1340 :Remarks:
1341 #ifndef HAVE_SNPRINTF
1342 : . The function snprintf() could not be found. mailx will be compiled to use
1343 : sprintf() instead. This might overflow buffers if input values are larger
1344 : than expected. Use the resulting binary with care or update your system
1345 : environment and start the configuration process again.
1346 #endif
1347 #ifndef HAVE_FCHDIR
1348 : . The function fchdir() could not be found. mailx will be compiled to use
1349 : chdir() instead. This is not a problem unless the current working
1350 : directory of mailx is moved while the IMAP cache is used.
1351 #endif
1352 #ifndef HAVE_GETOPT
1353 : . Using a minimal builtin POSIX-like getopt()
1354 #endif
1355 #ifdef HAVE_DEBUG
1356 : . Debug enabled binary: not meant to be used by end-users: THANKS!
1357 #endif
1361 ${make} -f ${makefile} ${tmp2}.x
1362 < ${tmp2}.x >&5 ${sed} -e '/^[^:]/d; /^$/d; s/^://'
1364 # vim:set fenc=utf-8:s-it-mode