Introduce enum flock_type for fcntl_lock() (drop fcntl.h)
[s-mailx.git] / mk-conf.sh
blob5c0f6652e19e29eca9b2bdf8e70963aebdc8b349
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_REGEX=0
15 WANT_SPAM=0
16 WANT_DOCSTRINGS=0
17 WANT_QUOTE_FOLD=0
18 WANT_COLOUR=0
20 MEDIUM)
21 WANT_SOCKETS=0
22 WANT_IDNA=0
23 WANT_READLINE=0 WANT_EDITLINE=0
24 WANT_REGEX=0
25 WANT_SPAM=0
26 WANT_QUOTE_FOLD=0
27 WANT_COLOUR=0
29 NETSEND)
30 WANT_IMAP=0
31 WANT_POP3=0
32 WANT_READLINE=0 WANT_EDITLINE=0
33 WANT_REGEX=0
34 WANT_SPAM=0
35 WANT_QUOTE_FOLD=0
36 WANT_COLOUR=0
39 echo >&2 "Unknown CONFIG= setting: ${CONFIG}"
40 echo >&2 'Possible values: MINIMAL, MEDIUM, NETSEND'
41 exit 1
42 esac
45 # Inter-relationships
46 option_update() {
47 if nwantfeat SOCKETS; then
48 WANT_IPV6=0 WANT_SSL=0
49 WANT_IMAP=0 WANT_GSSAPI=0 WANT_POP3=0 WANT_SMTP=0
51 if nwantfeat IMAP && nwantfeat POP3 && nwantfeat SMTP; then
52 WANT_SOCKETS=0 WANT_IPV6=0 WANT_SSL=0
54 if nwantfeat IMAP; then
55 WANT_GSSAPI=0
57 # If we don't need MD5 except for producing boundary and message-id strings,
58 # leave it off, plain old srand(3) should be enough for that purpose.
59 if nwantfeat SOCKETS; then
60 WANT_MD5=0
62 if wantfeat DEBUG; then
63 WANT_NOALLOCA=1
67 # Check out compiler ($CC) and -flags ($CFLAGS)
68 compiler_flags() {
69 i=`uname -s`
70 _CFLAGS=
72 # $CC is overwritten when empty or a default "cc", even without WANT_AUTOCC
73 optim= dbgoptim=
74 if [ -z "${CC}" ] || [ "${CC}" = cc ]; then
75 _CFLAGS=
76 if { CC="`command -v clang`"; }; then
78 elif { CC="`command -v gcc`"; }; then
80 elif { CC="`command -v c89`"; }; then
81 [ "${i}" = UnixWare ] && _CFLAGS=-v optim=-O dbgoptim=
82 elif { CC="`command -v c99`"; }; then
84 else
85 echo >&2 'ERROR'
86 echo >&2 ' I cannot find a compiler!'
87 echo >&2 ' Neither of clang(1), gcc(1), c89(1) and c99(1).'
88 echo >&2 ' Please set the CC environment variable, maybe CFLAGS also.'
89 exit 1
92 export CC
94 ccver=`${CC} --version 2>/dev/null`
95 stackprot=no
96 if { i=$ccver; echo "${i}"; } | ${grep} -q -i -e gcc -e clang; then
97 #if echo "${i}" | ${grep} -q -i -e gcc -e 'clang version 1'; then
98 optim=-O2 dbgoptim=-O
99 stackprot=yes
100 _CFLAGS='-std=c89'
101 _CFLAGS="${_CFLAGS} -Wall -Wextra -pedantic"
102 _CFLAGS="${_CFLAGS} -fno-unwind-tables -fno-asynchronous-unwind-tables"
103 _CFLAGS="${_CFLAGS} -fstrict-aliasing"
104 _CFLAGS="${_CFLAGS} -Wbad-function-cast -Wcast-align -Wcast-qual"
105 _CFLAGS="${_CFLAGS} -Winit-self -Wmissing-prototypes"
106 _CFLAGS="${_CFLAGS} -Wshadow -Wunused -Wwrite-strings"
107 if { i=$ccver; echo "${i}"; } | ${grep} -q -e 'clang version 1'; then
109 else
110 _CFLAGS="${_CFLAGS} -fstrict-overflow -Wstrict-overflow=5"
111 if wantfeat AMALGAMATION && nwantfeat DEBUG; then
112 _CFLAGS="${_CFLAGS} -Wno-unused-function"
114 if { i=$ccver; echo "${i}"; } | ${grep} -q -i -e clang; then
115 _CFLAGS="${_CFLAGS} -Wno-unused-result" # TODO handle the right way
118 if wantfeat AMALGAMATION; then
119 _CFLAGS="${_CFLAGS} -pipe"
121 _CFLAGS="${_CFLAGS} -Wno-long-long" # ISO C89 has no 'long long'...
122 # elif { i=$ccver; echo "${i}"; } | ${grep} -q -i -e clang; then
123 # stackprot=yes
124 # optim=-O3 dbgoptim=-O
125 # _CFLAGS='-std=c89 -g -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 -ftrapv ${_CFLAGS}";
137 if [ "${stackprot}" = yes ]; then
138 _CFLAGS="${_CFLAGS} -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 link_check hello 'if a hello world program can be built' << \! || {\
432 echo >&5 'This oooops is most certainly not related to me.';\
433 echo >&5 "Read the file ${log} and check your compiler environment.";\
434 ${rm} -f ${lst} ${h} ${mk};\
435 exit 1;\
437 #include <stdio.h>
439 int main(int argc, char *argv[])
441 (void)argc;
442 (void)argv;
443 puts("hello world");
444 return 0;
448 link_check termios 'for termios.h and tc*() family' << \! || {\
449 echo >&5 'We require termios.h and the tc*() family of functions.';\
450 echo >&5 "That much Unix we indulge ourselfs.";\
451 ${rm} -f ${lst} ${h} ${mk};\
452 exit 1;\
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;
464 link_check setenv 'for setenv()/unsetenv()' '#define HAVE_SETENV' << \!
465 #include <stdlib.h>
466 int main(void)
468 setenv("s-nail", "to be made nifty!", 1);
469 unsetenv("s-nail");
470 return 0;
474 link_check snprintf 'for snprintf()' '#define HAVE_SNPRINTF' << \!
475 #include <stdio.h>
476 int main(void)
478 char b[20];
479 snprintf(b, sizeof b, "%s", "string");
480 return 0;
484 link_check putc_unlocked 'for putc_unlocked()' '#define HAVE_PUTC_UNLOCKED' <<\!
485 #include <stdio.h>
486 int main(void)
488 putc_unlocked('@', stdout);
489 return 0;
493 link_check fchdir 'for fchdir()' '#define HAVE_FCHDIR' << \!
494 #include <unistd.h>
495 int main(void)
497 fchdir(0);
498 return 0;
502 link_check mmap 'for mmap()' '#define HAVE_MMAP' << \!
503 #include <sys/types.h>
504 #include <sys/mman.h>
505 int main(void)
507 mmap(0, 0, 0, 0, 0, 0);
508 return 0;
512 link_check mremap 'for mremap()' '#define HAVE_MREMAP' << \!
513 #include <sys/types.h>
514 #include <sys/mman.h>
515 int main(void)
517 mremap(0, 0, 0, MREMAP_MAYMOVE);
518 return 0;
522 link_check setlocale 'for setlocale()' '#define HAVE_SETLOCALE' << \!
523 #include <locale.h>
524 int main(void)
526 setlocale(LC_ALL, "");
527 return 0;
531 if [ "${have_setlocale}" = yes ]; then
532 link_check c90amend1 'for ISO/IEC 9899:1990/Amendment 1:1995' \
533 '#define HAVE_C90AMEND1' << \!
534 #include <limits.h>
535 #include <stdlib.h>
536 #include <wchar.h>
537 #include <wctype.h>
538 int main(void)
540 char mbb[MB_LEN_MAX + 1];
541 wchar_t wc;
542 iswprint(L'c');
543 towupper(L'c');
544 mbtowc(&wc, "x", 1);
545 mbrtowc(&wc, "x", 1, NULL);
546 (void)wctomb(mbb, wc);
547 return (mblen("\0", 1) == 0);
551 if [ "${have_c90amend1}" = yes ]; then
552 link_check wcwidth 'for wcwidth()' '#define HAVE_WCWIDTH' << \!
553 #include <wchar.h>
554 int main(void)
556 wcwidth(L'c');
557 return 0;
562 link_check nl_langinfo 'for nl_langinfo()' '#define HAVE_NL_LANGINFO' << \!
563 #include <langinfo.h>
564 #include <stdlib.h>
565 int main(void)
567 nl_langinfo(DAY_1);
568 return (nl_langinfo(CODESET) == NULL);
571 fi # have_setlocale
573 link_check mkstemp 'for mkstemp()' '#define HAVE_MKSTEMP' << \!
574 #include <stdlib.h>
575 int main(void)
577 mkstemp("x");
578 return 0;
582 # Note: run_check, thus we also get only the desired implementation...
583 run_check realpath 'for realpath()' '#define HAVE_REALPATH' << \!
584 #include <stdlib.h>
585 int main(void)
587 char *x = realpath(".", NULL), *y = realpath("/", NULL);
588 return (x != NULL && y != NULL) ? 0 : 1;
592 link_check wordexp 'for wordexp()' '#define HAVE_WORDEXP' << \!
593 #include <wordexp.h>
594 int main(void)
596 wordexp((char *)0, (wordexp_t *)0, 0);
597 return 0;
603 if wantfeat DEBUG; then
604 echo '#define HAVE_DEBUG' >> ${h}
607 if wantfeat AMALGAMATION; then
608 echo '#define HAVE_AMALGAMATION' >> ${h}
611 if nwantfeat NOALLOCA; then
612 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
613 # versions of alloca(3) since modern compilers just can't be trusted
614 # not to overoptimize and silently break some code
615 link_check alloca 'for __builtin_alloca()' \
616 '#define HAVE_ALLOCA __builtin_alloca' << \!
617 int main(void)
619 void *vp = __builtin_alloca(1);
620 return (!! vp);
625 if nwantfeat NOGETOPT; then
626 link_check getopt 'for getopt()' '#define HAVE_GETOPT' << \!
627 #include <unistd.h>
628 int main(int argc, char **argv)
630 #if defined __GLIBC__ || defined __linux__
631 Argument and option reordering is not a desired feature.
632 #else
633 getopt(argc, argv, "oPt");
634 #endif
635 return (((long)optarg + optind) & 0x7F);
642 if wantfeat ICONV; then
643 ${cat} > ${tmp2}.c << \!
644 #include <iconv.h>
645 int main(void)
647 iconv_t id;
649 id = iconv_open("foo", "bar");
650 return 0;
653 < ${tmp2}.c link_check iconv 'for iconv functionality' \
654 '#define HAVE_ICONV' ||
655 < ${tmp2}.c link_check iconv \
656 'for iconv functionality in libiconv' \
657 '#define HAVE_ICONV' '-liconv'
658 else
659 echo '/* WANT_ICONV=0 */' >> ${h}
660 fi # wantfeat ICONV
662 if wantfeat SOCKETS; then
663 compile_check arpa_inet_h 'for <arpa/inet.h>' \
664 '#define HAVE_ARPA_INET_H' << \!
665 #include "config.h"
666 #include <sys/types.h>
667 #include <sys/socket.h>
668 #include <netdb.h>
669 #include <netinet/in.h>
670 #include <arpa/inet.h>
673 ${cat} > ${tmp2}.c << \!
674 #include "config.h"
675 #include <sys/types.h>
676 #include <sys/socket.h>
677 #include <netdb.h>
678 #include <netinet/in.h>
679 #ifdef HAVE_ARPA_INET_H
680 #include <arpa/inet.h>
681 #endif
683 int main(void)
685 struct sockaddr s;
686 socket(AF_INET, SOCK_STREAM, 0);
687 connect(0, &s, 0);
688 gethostbyname("foo");
689 return 0;
693 < ${tmp2}.c link_check sockets 'for sockets in libc' \
694 '#define HAVE_SOCKETS' ||
695 < ${tmp2}.c link_check sockets 'for sockets in libnsl' \
696 '#define HAVE_SOCKETS' '-lnsl' ||
697 < ${tmp2}.c link_check sockets \
698 'for sockets in libsocket and libnsl' \
699 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
700 WANT_SOCKETS=0
702 # XXX Shouldn't it be a hard error if there is no socket support, then?
703 option_update
704 else
705 echo '/* WANT_SOCKETS=0 */' >> ${h}
706 fi # wantfeat SOCKETS
708 wantfeat SOCKETS &&
709 link_check setsockopt 'for setsockopt()' '#define HAVE_SETSOCKOPT' << \!
710 #include <sys/socket.h>
711 #include <stdlib.h>
712 int main(void)
714 int sockfd = 3;
715 setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0);
716 return 0;
720 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
721 link_check so_sndtimeo 'for SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
722 #include <sys/socket.h>
723 #include <stdlib.h>
724 int main(void)
726 struct timeval tv;
727 int sockfd = 3;
728 tv.tv_sec = 42;
729 tv.tv_usec = 21;
730 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
731 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
732 return 0;
736 wantfeat SOCKETS && [ -n "${have_setsockopt}" ] &&
737 link_check so_linger 'for SO_LINGER' '#define HAVE_SO_LINGER' << \!
738 #include <sys/socket.h>
739 #include <stdlib.h>
740 int main(void)
742 struct linger li;
743 int sockfd = 3;
744 li.l_onoff = 1;
745 li.l_linger = 42;
746 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
747 return 0;
751 if wantfeat IPV6; then
752 link_check ipv6 'for IPv6 functionality' '#define HAVE_IPV6' << \!
753 #include "config.h"
754 #include <sys/types.h>
755 #include <sys/socket.h>
756 #include <netdb.h>
757 #include <netinet/in.h>
758 #ifdef HAVE_ARPA_INET_H
759 #include <arpa/inet.h>
760 #endif
762 int main(void)
764 struct addrinfo a, *ap;
765 getaddrinfo("foo", "0", &a, &ap);
766 return 0;
769 else
770 echo '/* WANT_IPV6=0 */' >> ${h}
771 fi # wantfeat IPV6
773 if wantfeat IMAP; then
774 echo '#define HAVE_IMAP' >> ${h}
775 else
776 echo '/* WANT_IMAP=0 */' >> ${h}
779 if wantfeat POP3; then
780 echo '#define HAVE_POP3' >> ${h}
781 else
782 echo '/* WANT_POP3=0 */' >> ${h}
785 if wantfeat SMTP; then
786 echo '#define HAVE_SMTP' >> ${h}
787 else
788 echo '/* WANT_SMTP=0 */' >> ${h}
791 if wantfeat SSL; then
792 link_check openssl 'for sufficiently recent OpenSSL' \
793 '#define HAVE_SSL
794 #define HAVE_OPENSSL' '-lssl -lcrypto' << \!
795 #include <openssl/ssl.h>
796 #include <openssl/err.h>
797 #include <openssl/x509v3.h>
798 #include <openssl/x509.h>
799 #include <openssl/rand.h>
801 #if defined OPENSSL_NO_SSL2 && defined OPENSSL_NO_SSL3 &&\
802 defined OPENSSL_NO_TLS1
803 # error We need one of (SSLv2 and) SSLv3 and TLS1.
804 #endif
806 int main(void)
808 SSLv23_client_method();
809 #ifndef OPENSSL_NO_SSL3
810 SSLv3_client_method();
811 #endif
812 #ifndef OPENSSL_NO_TLS1
813 TLSv1_client_method();
814 # ifdef TLS1_1_VERSION
815 TLSv1_1_client_method();
816 # endif
817 # ifdef TLS1_2_VERSION
818 TLSv1_2_client_method();
819 # endif
820 #endif
821 PEM_read_PrivateKey(0, 0, 0, 0);
822 return 0;
826 if [ "${have_openssl}" = 'yes' ]; then
827 compile_check stack_of 'for OpenSSL STACK_OF()' \
828 '#define HAVE_STACK_OF' << \!
829 #include <openssl/ssl.h>
830 #include <openssl/err.h>
831 #include <openssl/x509v3.h>
832 #include <openssl/x509.h>
833 #include <openssl/rand.h>
835 int main(void)
837 STACK_OF(GENERAL_NAME) *gens = NULL;
838 printf("%p", gens); /* to make it used */
839 return 0;
843 if wantfeat MD5; then
844 run_check openssl_md5 'for MD5 digest in OpenSSL' \
845 '#define HAVE_OPENSSL_MD5' << \!
846 #include <string.h>
847 #include <openssl/md5.h>
849 int main(void)
851 char const dat[] = "abrakadabrafidibus";
852 char dig[16], hex[16 * 2];
853 MD5_CTX ctx;
854 size_t i, j;
856 memset(dig, 0, sizeof(dig));
857 memset(hex, 0, sizeof(hex));
858 MD5_Init(&ctx);
859 MD5_Update(&ctx, dat, sizeof(dat) - 1);
860 MD5_Final(dig, &ctx);
862 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
863 for (i = 0; i < sizeof(hex) / 2; i++) {
864 j = i << 1;
865 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
866 hex[++j] = hexchar(dig[i] & 0x0f);
868 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
871 fi # wantfeat MD5
873 else
874 echo '/* WANT_SSL=0 */' >> ${h}
875 fi # wantfeat SSL
877 if wantfeat GSSAPI; then
878 ${cat} > ${tmp2}.c << \!
879 #include <gssapi/gssapi.h>
881 int main(void)
883 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
884 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
885 return 0;
888 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
890 if command -v krb5-config >/dev/null 2>&1; then
891 i=`command -v krb5-config`
892 GSSAPI_LIBS="`CFLAGS= ${i} --libs gssapi`"
893 GSSAPI_INCS="`CFLAGS= ${i} --cflags`"
894 i='for GSSAPI via krb5-config(1)'
895 else
896 GSSAPI_LIBS='-lgssapi'
897 GSSAPI_INCS=
898 i='for GSSAPI in gssapi/gssapi.h, libgssapi'
900 < ${tmp2}.c link_check gssapi \
901 "${i}" '#define HAVE_GSSAPI' \
902 "${GSSAPI_LIBS}" "${GSSAPI_INCS}" ||\
903 < ${tmp3}.c link_check gssapi \
904 'for GSSAPI in gssapi.h, libgssapi' \
905 '#define HAVE_GSSAPI
906 #define GSSAPI_REG_INCLUDE' \
907 '-lgssapi' ||\
908 < ${tmp2}.c link_check gssapi 'for GSSAPI in libgssapi_krb5' \
909 '#define HAVE_GSSAPI' \
910 '-lgssapi_krb5' ||\
911 < ${tmp3}.c link_check gssapi \
912 'for GSSAPI in libgssapi, OpenBSD-style (pre 5.3)' \
913 '#define HAVE_GSSAPI
914 #define GSSAPI_REG_INCLUDE' \
915 '-lgssapi -lkrb5 -lcrypto' \
916 '-I/usr/include/kerberosV' ||\
917 < ${tmp2}.c link_check gssapi 'for GSSAPI in libgss' \
918 '#define HAVE_GSSAPI' \
919 '-lgss' ||\
920 link_check gssapi 'for GSSAPI in libgssapi_krb5, old-style' \
921 '#define HAVE_GSSAPI
922 #define GSSAPI_OLD_STYLE' \
923 '-lgssapi_krb5' << \!
924 #include <gssapi/gssapi.h>
925 #include <gssapi/gssapi_generic.h>
927 int main(void)
929 gss_import_name(0, 0, gss_nt_service_name, 0);
930 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
931 return 0;
934 else
935 echo '/* WANT_GSSAPI=0 */' >> ${h}
936 fi # wantfeat GSSAPI
938 if wantfeat IDNA; then
939 link_check idna 'for GNU Libidn' '#define HAVE_IDNA' '-lidn' << \!
940 #include <idna.h>
941 #include <idn-free.h>
942 #include <stringprep.h>
943 int main(void)
945 char *utf8, *idna_ascii, *idna_utf8;
946 utf8 = stringprep_locale_to_utf8("does.this.work");
947 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
948 != IDNA_SUCCESS)
949 return 1;
950 idn_free(idna_ascii);
951 /* (Rather link check only here) */
952 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
953 return 0;
956 else
957 echo '/* WANT_IDNA=0 */' >> ${h}
960 if wantfeat REGEX; then
961 link_check regex 'for regular expressions' '#define HAVE_REGEX' << \!
962 #include <regex.h>
963 #include <stdlib.h>
964 int main(void)
966 int status;
967 regex_t re;
968 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
969 return 1;
970 status = regexec(&re, "plan9", 0,NULL, 0);
971 regfree(&re);
972 return !(status == REG_NOMATCH);
975 else
976 echo '/* WANT_REGEX=0 */' >> ${h}
979 if wantfeat READLINE; then
980 __edrdlib() {
981 link_check readline "for readline(3) (${1})" \
982 '#define HAVE_READLINE' "${1}" << \!
983 #include <stdio.h>
984 #include <readline/history.h>
985 #include <readline/readline.h>
986 int main(void)
988 char *rl;
989 HISTORY_STATE *hs;
990 HIST_ENTRY **he;
991 int i;
992 using_history();
993 read_history("");
994 stifle_history(242);
995 rl = readline("Enter a line:");
996 if (rl && *rl)
997 add_history(rl);
998 write_history("");
999 rl_extend_line_buffer(10);
1000 rl_point = rl_end = 10;
1001 rl_pre_input_hook = (rl_hook_func_t*)NULL;
1002 rl_forced_update_display();
1003 clear_history();
1004 hs = history_get_history_state();
1005 i = hs->length;
1006 he = history_list();
1007 if (i > 0)
1008 rl = he[0]->line;
1009 rl_free_line_state();
1010 rl_cleanup_after_signal();
1011 rl_reset_after_signal();
1012 return 0;
1017 __edrdlib -lreadline ||
1018 __edrdlib '-lreadline -ltermcap'
1019 [ -n "${have_readline}" ] && WANT_TABEXPAND=1
1022 if wantfeat EDITLINE && [ -z "${have_readline}" ]; then
1023 __edlib() {
1024 link_check editline "for editline(3) (${1})" \
1025 '#define HAVE_EDITLINE' "${1}" << \!
1026 #include <histedit.h>
1027 static char * getprompt(void) { return (char*)"ok"; }
1028 int main(void)
1030 EditLine *el_el = el_init("TEST", stdin, stdout, stderr);
1031 HistEvent he;
1032 History *el_hcom = history_init();
1033 history(el_hcom, &he, H_SETSIZE, 242);
1034 el_set(el_el, EL_SIGNAL, 0);
1035 el_set(el_el, EL_TERMINAL, NULL);
1036 el_set(el_el, EL_HIST, &history, el_hcom);
1037 el_set(el_el, EL_EDITOR, "emacs");
1038 el_set(el_el, EL_PROMPT, &getprompt);
1039 el_source(el_el, NULL);
1040 history(el_hcom, &he, H_GETSIZE);
1041 history(el_hcom, &he, H_CLEAR);
1042 el_end(el_el);
1043 /* TODO add loader and addfn checks */
1044 history_end(el_hcom);
1045 return 0;
1050 __edlib -ledit ||
1051 __edlib '-ledit -ltermcap'
1052 [ -n "${have_editline}" ] && WANT_TABEXPAND=0
1055 if wantfeat NCL && [ -z "${have_editline}" ] && [ -z "${have_readline}" ] &&\
1056 [ -n "${have_c90amend1}" ]; then
1057 have_ncl=1
1058 echo '#define HAVE_NCL' >> ${h}
1059 else
1060 echo '/* WANT_{READLINE,EDITLINE,NCL}=0 */' >> ${h}
1063 # Generic have-a-command-line-editor switch for those who need it below
1064 if [ -n "${have_ncl}" ] || [ -n "${have_editline}" ] ||\
1065 [ -n "${have_readline}" ]; then
1066 have_cle=1
1069 if [ -n "${have_cle}" ] && wantfeat TABEXPAND; then
1070 echo '#define HAVE_TABEXPAND' >> ${h}
1071 else
1072 echo '/* WANT_TABEXPAND=0 */' >> ${h}
1075 if [ -n "${have_cle}" ] && wantfeat HISTORY; then
1076 echo '#define HAVE_HISTORY' >> ${h}
1077 else
1078 echo '/* WANT_HISTORY=0 */' >> ${h}
1081 if wantfeat SPAM; then
1082 echo '#define HAVE_SPAM' >> ${h}
1083 if command -v spamc >/dev/null 2>&1; then
1084 echo "#define SPAMC_PATH \"`command -v spamc`\"" >> ${h}
1086 else
1087 echo '/* WANT_SPAM=0 */' >> ${h}
1090 if wantfeat DOCSTRINGS; then
1091 echo '#define HAVE_DOCSTRINGS' >> ${h}
1092 else
1093 echo '/* WANT_DOCSTRINGS=0 */' >> ${h}
1096 if wantfeat QUOTE_FOLD &&\
1097 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
1098 echo '#define HAVE_QUOTE_FOLD' >> ${h}
1099 else
1100 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
1103 if wantfeat COLOUR; then
1104 echo '#define HAVE_COLOUR' >> ${h}
1105 else
1106 echo '/* WANT_COLOUR=0 */' >> ${h}
1109 if wantfeat MD5; then
1110 echo '#define HAVE_MD5' >> ${h}
1111 else
1112 echo '/* WANT_MD5=0 */' >> ${h}
1115 ## Summarizing ##
1117 # Since we cat(1) the content of those to cc/"ld", convert them to single line
1118 squeeze_em() {
1119 < "${1}" > "${2}" ${awk} \
1120 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1122 ${rm} -f ${tmp}
1123 squeeze_em ${inc} ${tmp}
1124 ${mv} ${tmp} ${inc}
1125 squeeze_em ${lib} ${tmp}
1126 ${mv} ${tmp} ${lib}
1128 # config.h
1129 ${mv} ${h} ${tmp}
1130 printf '#ifndef _CONFIG_H\n# define _CONFIG_H\n' > ${h}
1131 ${cat} ${tmp} >> ${h}
1133 printf '\n/* The "feature string", for "simplicity" and lex.c */\n' >> ${h}
1134 printf '#ifdef _MAIN_SOURCE\n' >> ${h}
1135 printf '# ifdef HAVE_AMALGAMATION\nstatic\n# endif\n' >> ${h}
1136 printf 'char const features[] = "MIME"\n' >> ${h}
1137 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
1138 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
1139 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
1140 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
1141 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
1142 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
1143 printf '# ifdef HAVE_IPV6\n ",IPv6"\n# endif\n' >> ${h}
1144 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TSL"\n# endif\n' >> ${h}
1145 printf '# ifdef HAVE_IMAP\n ",IMAP"\n# endif\n' >> ${h}
1146 printf '# ifdef HAVE_GSSAPI\n ",GSSAPI"\n# endif\n' >> ${h}
1147 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
1148 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
1149 printf '# ifdef HAVE_SPAM\n ",SPAM"\n# endif\n' >> ${h}
1150 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
1151 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
1152 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
1153 printf '# ifdef HAVE_EDITLINE\n ",EDITLINE"\n# endif\n' >> ${h}
1154 printf '# ifdef HAVE_NCL\n ",NCL"\n# endif\n' >> ${h}
1155 printf '# ifdef HAVE_TABEXPAND\n ",TABEXPAND"\n# endif\n' >> ${h}
1156 printf '# ifdef HAVE_HISTORY\n ",HISTORY MANAGEMENT"\n# endif\n' >> ${h}
1157 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
1158 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
1159 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
1160 printf ';\n#endif /* _MAIN_SOURCE */\n' >> ${h}
1162 printf '#endif /* _CONFIG_H */\n' >> ${h}
1163 ${rm} -f ${tmp}
1165 # Create the real mk.mk
1166 ${rm} -rf ${tmp0}.* ${tmp0}*
1167 printf 'OBJ_SRC = ' >> ${mk}
1168 if nwantfeat AMALGAMATION; then
1169 echo *.c >> ${mk}
1170 echo 'OBJ_DEP =' >> ${mk}
1171 else
1172 j=`echo "${src}" | sed 's/^.\///'`
1173 echo "${j}" >> ${mk}
1174 printf 'OBJ_DEP = main.c ' >> ${mk}
1175 printf '#define _MAIN_SOURCE\n' >> ${src}
1176 printf '#include "nail.h"\n#include "main.c"\n' >> ${src}
1177 for i in *.c; do
1178 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ]; then
1179 continue
1181 printf "${i} " >> ${mk}
1182 printf "#include \"${i}\"\n" >> ${src}
1183 done
1184 echo >> ${mk}
1187 echo "LIBS = `${cat} ${lib}`" >> ${mk}
1188 echo "INCLUDES = `${cat} ${inc}`" >> ${mk}
1189 echo >> ${mk}
1190 ${cat} ./mk-mk.in >> ${mk}
1192 ## Finished! ##
1194 ${cat} > ${tmp2}.c << \!
1195 #include "config.h"
1196 #ifdef HAVE_NL_LANGINFO
1197 # include <langinfo.h>
1198 #endif
1200 :The following optional features are enabled:
1201 #ifdef HAVE_ICONV
1202 : + Character set conversion using iconv()
1203 #endif
1204 #ifdef HAVE_SETLOCALE
1205 : + Locale support: Printable characters depend on the environment
1206 # ifdef HAVE_C90AMEND1
1207 : + Multibyte character support
1208 # endif
1209 # ifdef HAVE_NL_LANGINFO
1210 : + Automatic detection of terminal character set
1211 # endif
1212 #endif
1213 #ifdef HAVE_SOCKETS
1214 : + Network support
1215 #endif
1216 #ifdef HAVE_IPV6
1217 : + Support for Internet Protocol v6 (IPv6)
1218 #endif
1219 #ifdef HAVE_SSL
1220 # ifdef HAVE_OPENSSL
1221 : + S/MIME and SSL/TLS using OpenSSL
1222 # endif
1223 #endif
1224 #ifdef HAVE_IMAP
1225 : + IMAP protocol
1226 #endif
1227 #ifdef HAVE_GSSAPI
1228 : + IMAP GSSAPI authentication
1229 #endif
1230 #ifdef HAVE_POP3
1231 : + POP3 protocol
1232 #endif
1233 #ifdef HAVE_SMTP
1234 : + SMTP protocol
1235 #endif
1236 #ifdef HAVE_SPAM
1237 : + Interaction with spam filters
1238 #endif
1239 #ifdef HAVE_IDNA
1240 : + IDNA (internationalized domain names for applications) support
1241 #endif
1242 #ifdef HAVE_REGEX
1243 : + Regular expression searches
1244 #endif
1245 #if defined HAVE_READLINE || defined HAVE_EDITLINE || defined HAVE_NCL
1246 : + Command line editing
1247 # ifdef HAVE_TABEXPAND
1248 : + + Tabulator expansion
1249 # endif
1250 # ifdef HAVE_HISTORY
1251 : + + History management
1252 # endif
1253 #endif
1254 #ifdef HAVE_QUOTE_FOLD
1255 : + Extended *quote-fold*ing
1256 #endif
1257 #ifdef HAVE_COLOUR
1258 : + Coloured message display (simple)
1259 #endif
1261 :The following optional features are disabled:
1262 #ifndef HAVE_ICONV
1263 : - Character set conversion using iconv()
1264 #endif
1265 #ifndef HAVE_SETLOCALE
1266 : - Locale support: Only ASCII characters are recognized
1267 #endif
1268 # ifndef HAVE_C90AMEND1
1269 : - Multibyte character support
1270 # endif
1271 # ifndef HAVE_NL_LANGINFO
1272 : - Automatic detection of terminal character set
1273 # endif
1274 #ifndef HAVE_SOCKETS
1275 : - Network support
1276 #endif
1277 #ifndef HAVE_IPV6
1278 : - Support for Internet Protocol v6 (IPv6)
1279 #endif
1280 #if !defined HAVE_SSL
1281 : - SSL/TLS (network transport authentication and encryption)
1282 #endif
1283 #ifndef HAVE_IMAP
1284 : - IMAP protocol
1285 #endif
1286 #ifndef HAVE_GSSAPI
1287 : - IMAP GSSAPI authentication
1288 #endif
1289 #ifndef HAVE_POP3
1290 : - POP3 protocol
1291 #endif
1292 #ifndef HAVE_SMTP
1293 : - SMTP protocol
1294 #endif
1295 #ifndef HAVE_SPAM
1296 : - Interaction with spam filters
1297 #endif
1298 #ifndef HAVE_IDNA
1299 : - IDNA (internationalized domain names for applications) support
1300 #endif
1301 #ifndef HAVE_REGEX
1302 : - Regular expression searches
1303 #endif
1304 #if !defined HAVE_READLINE && !defined HAVE_EDITLINE && !defined HAVE_NCL
1305 : - Command line editing and history
1306 #endif
1307 #ifndef HAVE_QUOTE_FOLD
1308 : - Extended *quote-fold*ing
1309 #endif
1310 #ifndef HAVE_COLOUR
1311 : - Coloured message display (simple)
1312 #endif
1314 :Remarks:
1315 #ifndef HAVE_SNPRINTF
1316 : . The function snprintf() could not be found. mailx will be compiled to use
1317 : sprintf() instead. This might overflow buffers if input values are larger
1318 : than expected. Use the resulting binary with care or update your system
1319 : environment and start the configuration process again.
1320 #endif
1321 #ifndef HAVE_FCHDIR
1322 : . The function fchdir() could not be found. mailx will be compiled to use
1323 : chdir() instead. This is not a problem unless the current working
1324 : directory of mailx is moved while the IMAP cache is used.
1325 #endif
1326 #ifndef HAVE_GETOPT
1327 : . Using a minimal builtin POSIX-like getopt()
1328 #endif
1329 #ifdef HAVE_DEBUG
1330 : . Debug enabled binary: not meant to be used by end-users: THANKS!
1331 #endif
1335 ${make} -f ${makefile} ${tmp2}.x
1336 < ${tmp2}.x >&5 ${sed} -e '/^[^:]/d; /^$/d; s/^://'
1338 # vim:set fenc=utf-8:s-it-mode