2 #@ Please see `INSTALL' and `make.rc' instead.
10 WANT_SSL
=0 WANT_ALL_SSL_ALGORITHMS
=0
11 WANT_SMTP
=0 WANT_POP3
=0
12 WANT_GSSAPI
=0 WANT_NETRC
=0 WANT_AGENT
=0
17 WANT_READLINE
=0 WANT_MLE
=0
18 WANT_HISTORY
=0 WANT_KEY_BINDINGS
=0
19 WANT_TERMCAP
=0 WANT_TERMCAP_PREFER_TERMINFO
=0
21 WANT_SPAM_SPAMC
=0 WANT_SPAM_SPAMD
=0 WANT_SPAM_FILTER
=0
24 WANT_FILTER_HTML_TAGSOUP
=0
32 WANT_SSL
=1 WANT_ALL_SSL_ALGORITHMS
=1
33 WANT_SMTP
=1 WANT_POP3
=1
34 WANT_GSSAPI
=1 WANT_NETRC
=1 WANT_AGENT
=1
40 WANT_HISTORY
=1 WANT_KEY_BINDINGS
=1
41 WANT_TERMCAP
=1 WANT_TERMCAP_PREFER_TERMINFO
=1
43 WANT_SPAM_SPAMC
=1 WANT_SPAM_SPAMD
=1 WANT_SPAM_FILTER
=1
46 WANT_FILTER_HTML_TAGSOUP
=1
51 # Predefined CONFIG= urations take precedence over anything else
52 if [ -n "${CONFIG}" ]; then
61 [mM
][iI
][nN
][iI
][mM
][aA
][lL
])
67 [mM
][eE
][dD
][iI
][uU
][mM
])
73 WANT_HISTORY
=1 WANT_KEY_BINDINGS
=1
80 [nN
][eE
][tT
][sS
][eE
][nN
][dD
])
86 WANT_GSSAPI
=1 WANT_NETRC
=1 WANT_AGENT
=1
90 WANT_HISTORY
=1 WANT_KEY_BINDINGS
=1
95 [mM
][aA
][xX
][iI
][mM
][aA
][lL
])
100 WANT_DEVEL
=1 WANT_DEBUG
=1 WANT_NYD2
=1
103 [oO
][dD
][eE
][vV
][eE
][lL
])
108 echo >&2 "Unknown CONFIG= setting: ${CONFIG}"
109 echo >&2 'Possible values: NULL, NULLI, MINIMAL, MEDIUM, NETSEND, MAXIMAL'
115 # Inter-relationships
117 if feat_no SMTP
&& feat_no POP3
; then
120 if feat_no SOCKETS
; then
121 if feat_require SMTP
; then
122 msg
'ERROR: need SOCKETS for required feature SMTP'
125 if feat_require POP3
; then
126 msg
'ERROR: need SOCKETS for required feature POP3'
129 WANT_SSL
=0 WANT_ALL_SSL_ALGORITHMS
=0
130 WANT_SMTP
=0 WANT_POP3
=0
131 WANT_GSSAPI
=0 WANT_NETRC
=0 WANT_AGENT
=0
133 if feat_no SMTP
; then
137 if feat_no READLINE
&& feat_no MLE
; then
138 WANT_HISTORY
=0 WANT_KEY_BINDINGS
=0
141 # If we don't need MD5 leave it alone
142 if feat_no SOCKETS
; then
146 if feat_yes DEVEL
; then
149 if feat_yes DEBUG
; then
150 WANT_NOALLOCA
=1 WANT_DEVEL
=1
154 # Note that potential duplicates in PATH, C_INCLUDE_PATH etc. will be cleaned
155 # via path_check() later on once possible
157 # TODO cc_maxopt is brute simple, we should compile test program and dig real
158 # compiler versions for known compilers, then be more specific
163 i
="${OS:-`uname -s`}"
165 if [ ${i} = SunOS
]; then
166 msg
'SunOS / Solaris? Applying some "early setup" rules ...'
167 _os_early_setup_sunos
172 # OSFULLSPEC is used to recognize changes (i.e., machine type, updates etc.)
173 OSFULLSPEC
="${OS:-`uname -a | ${tr} '[A-Z]' '[a-z]'`}"
174 OS
="${OS:-`uname -s | ${tr} '[A-Z]' '[a-z]'`}"
175 msg
'Operating system is "%s"' ${OS}
177 if [ ${OS} = sunos
]; then
178 msg
' . have special SunOS / Solaris "setup" rules ...'
180 elif [ ${OS} = unixware
]; then
181 msg
' . have special UnixWare environmental rules ...'
182 if feat_yes AUTOCC
&& command -v cc
>/dev
/null
2>&1; then
184 feat_yes DEBUG
&& _CFLAGS
='-v -Xa -g' || _CFLAGS
='-Xa -O'
186 CFLAGS
="${_CFLAGS} ${ADDCFLAGS}"
187 LDFLAGS
="${_LDFLAGS} ${ADDLDFLAGS}"
188 export CC CFLAGS LDFLAGS
189 WANT_AUTOCC
=0 had_want_autocc
=1 need_R_ldflags
=-R
191 elif [ -n "${VERBOSE}" ]; then
192 msg
' . no special treatment for this system necessary or known'
195 # Sledgehammer: better set _GNU_SOURCE
196 # And in general: oh, boy!
197 OS_DEFINES
="${OS_DEFINES}#define _GNU_SOURCE\n"
198 #OS_DEFINES="${OS_DEFINES}#define _POSIX_C_SOURCE 200809L\n"
199 #OS_DEFINES="${OS_DEFINES}#define _XOPEN_SOURCE 700\n"
200 #[ ${OS} = darwin ] && OS_DEFINES="${OS_DEFINES}#define _DARWIN_C_SOURCE\n"
202 # On pkgsrc(7) systems automatically add /usr/pkg/*
203 if [ -d /usr
/pkg
]; then
204 C_INCLUDE_PATH
="${C_INCLUDE_PATH}:/usr/pkg/include"
205 LD_LIBRARY_PATH
="${LD_LIBRARY_PATH}:/usr/pkg/lib"
209 _os_early_setup_sunos
() {
210 # According to standards(5), this is what we need to do
211 if [ -d /usr
/xpg4
]; then :; else
212 msg
'ERROR: On SunOS / Solaris we need /usr/xpg4 environment! Sorry.'
215 PATH
="/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:${PATH}"
216 [ -d /usr
/xpg6
] && PATH
="/usr/xpg6/bin:${PATH}"
221 C_INCLUDE_PATH
="/usr/xpg4/include:${C_INCLUDE_PATH}"
222 LD_LIBRARY_PATH
="/usr/xpg4/lib:${LD_LIBRARY_PATH}"
225 if [ -d /opt
/csw
]; then
226 C_INCLUDE_PATH
="${C_INCLUDE_PATH}:/opt/csw/include"
227 LD_LIBRARY_PATH
="${LD_LIBRARY_PATH}:/opt/csw/lib"
230 OS_DEFINES
="${OS_DEFINES}#define __EXTENSIONS__\n"
231 #OS_DEFINES="${OS_DEFINES}#define _POSIX_C_SOURCE 200112L\n"
233 [ -n "${cksum}" ] ||
cksum=/opt
/csw
/gnu
/cksum
234 if [ -x "${cksum}" ]; then :; else
235 msg
'ERROR: Not an executable program: "%s"' "${cksum}"
236 msg
'ERROR: We need a CRC-32 cksum(1), as specified in POSIX.'
237 msg
'ERROR: However, we do so only for tests.'
238 msg
'ERROR: If that is ok, set "cksum=/usr/bin/true", then rerun'
242 if feat_yes AUTOCC
; then
243 if command -v cc
>/dev
/null
2>&1; then
245 feat_yes DEBUG
&& _CFLAGS
="-v -Xa -g" || _CFLAGS
="-Xa -O"
247 CFLAGS
="${_CFLAGS} ${ADDCFLAGS}"
248 LDFLAGS
="${_LDFLAGS} ${ADDLDFLAGS}"
249 export CC CFLAGS LDFLAGS
250 WANT_AUTOCC
=0 had_want_autocc
=1 need_R_ldflags
=-R
252 # Assume gcc(1), which supports -R for compat
253 cc_maxopt
=2 force_no_stackprot
=1 need_R_ldflags
=-Wl,-R
258 # Check out compiler ($CC) and -flags ($CFLAGS)
260 # Even though it belongs into cc_flags we will try to compile and link
261 # something, so ensure we have a clean state regarding CFLAGS/LDFLAGS or
262 # ADDCFLAGS/ADDLDFLAGS
263 if feat_no AUTOCC
; then
265 # Ensure those don't do any harm
266 ADDCFLAGS
= ADDLDFLAGS
=
267 export ADDCFLAGS ADDLDFLAGS
271 export CFLAGS LDFLAGS
274 [ -n "${CC}" ] && [ "${CC}" != cc ] && { _cc_default; return; }
276 printf >&2 'Searching for a usable C compiler .. $CC='
277 if { i="`command -v clang`"; }; then
279 elif { i="`command -v gcc`"; }; then
281 elif { i="`command -v c99`"; }; then
283 elif { i="`command -v tcc`"; }; then
285 elif { i="`command -v pcc`"; }; then
288 if [ "${CC}" = cc ]; then
290 elif { i="`command -v c89`"; }; then
293 printf >&2 'boing booom tschak\n'
294 msg 'ERROR: I cannot find a compiler!'
295 msg ' Neither of clang(1), gcc(1), tcc(1), pcc(1), c89(1) and c99(1).'
296 msg ' Please set $CC environment variable, maybe $CFLAGS also, rerun.'
300 printf >&2 -- '"%s
"\n' "${CC}"
305 if [ -z "${CC}" ]; then
306 printf >&2 'To go on like you have chosen, please set $CC, rerun.'
310 if [ -z "${VERBOSE}" ] && [ -f ${lst} ] && feat_no DEBUG; then
313 msg 'Using C compiler $CC="%s
"' "${CC}"
318 if feat_yes AUTOCC; then
319 if [ -f ${lst} ] && feat_no DEBUG && [ -z "${VERBOSE}" ]; then
321 msg 'Detecting $CFLAGS/$LDFLAGS for $CC="%s
", just a second..' "${CC}"
324 msg 'Testing usable $CFLAGS/$LDFLAGS for $CC="%s
"' "${CC}"
327 i=`echo "${CC}" | ${awk} 'BEGIN{FS="/"}{print
$NF}'`
328 if { echo "${i}" | ${grep} tcc; } >/dev/null 2>&1; then
329 msg ' . have special tcc
(1) environmental rules ...
'
332 # As of pcc CVS 2016-04-02, stack protection support is announced but
333 # will break if used on Linux
334 if { echo "${i}" | ${grep} pcc; } >/dev/null 2>&1; then
340 feat_no DEBUG && _CFLAGS="-DNDEBUG ${_CFLAGS}"
341 CFLAGS="${_CFLAGS} ${ADDCFLAGS}"
342 LDFLAGS="${_LDFLAGS} ${ADDLDFLAGS}"
344 if feat_no DEBUG; then
345 CFLAGS="-DNDEBUG ${CFLAGS}"
349 export CFLAGS LDFLAGS
353 __cflags=${_CFLAGS} __ldflags=${_LDFLAGS}
360 if feat_yes DEBUG; then
361 # May have problems to find libtcc cc_check -b
365 if ld_check -Wl,-rpath =./ no; then
366 need_R_ldflags=-Wl,-rpath=
367 ld_runtime_flags # update!
370 _CFLAGS="${_CFLAGS} ${__cflags}" _LDFLAGS="${_LDFLAGS} ${__ldflags}"
371 unset __cflags __ldflags
374 _cc_flags_generic() {
375 __cflags=${_CFLAGS} __ldflags=${_LDFLAGS}
377 feat_yes DEVEL && cc_check -std=c89 || cc_check -std=c99
379 # Check -g first since some others may rely upon -g / optim. level
380 if feat_yes DEBUG; then
383 elif [ ${cc_maxopt} -gt 2 ] && cc_check -O3; then
385 elif [ ${cc_maxopt} -gt 1 ] && cc_check -O2; then
387 elif [ ${cc_maxopt} -gt 0 ] && cc_check -O1; then
393 if feat_yes DEVEL && cc_check -Weverything; then
398 cc_check -Wbad-function-cast
399 cc_check -Wcast-align
402 cc_check -Wmissing-prototypes
405 cc_check -Wwrite-strings
406 cc_check -Wno-long-long
410 if feat_yes AMALGAMATION && feat_no DEVEL; then
411 cc_check -Wno-unused-function
413 feat_no DEVEL && cc_check -Wno-unused-result # XXX do right way (pragma too)
415 cc_check -fno-unwind-tables
416 cc_check -fno-asynchronous-unwind-tables
417 cc_check -fstrict-aliasing
418 if cc_check -fstrict-overflow && feat_yes DEVEL; then
419 cc_check -Wstrict-overflow=5
422 if feat_yes DEBUG || feat_yes FORCED_STACKPROT; then
423 if [ -z "${force_no_stackprot}" ]; then
424 if cc_check -fstack-protector-strong ||
425 cc_check -fstack-protector-all; then
426 cc_check -D_FORTIFY_SOURCE=2
429 msg 'Not checking
for -fstack-protector compiler option
,'
430 msg 'since that caused errors
in a
"similar" configuration.
'
431 msg 'You may turn off WANT_AUTOCC and use your own settings
, rerun
'
435 if feat_yes AMALGAMATION; then
439 # LD (+ dependend CC)
441 if feat_yes DEVEL; then
444 #if cc_check -fsanitize=memory &&
445 # ld_check -fsanitize=memory &&
446 # cc_check -fsanitize-memory-track-origins=2 &&
447 # ld_check -fsanitize-memory-track-origins=2; then
454 ld_check -Wl,-z,relro
456 ld_check -Wl,-z,noexecstack
457 if ld_check -Wl,-rpath =./ no; then
458 need_R_ldflags=-Wl,-rpath=
459 ld_runtime_flags # update!
460 elif ld_check -Wl,-R ./ no; then
461 need_R_ldflags=-Wl,-R
462 ld_runtime_flags # update!
465 # Address randomization
467 if cc_check -fPIE || cc_check -fpie; then
468 ld_check -pie || _CFLAGS=${_ccfg}
472 _CFLAGS="${_CFLAGS} ${__cflags}" _LDFLAGS="${_LDFLAGS} ${__ldflags}"
473 unset __cflags __ldflags
479 ## - Heirloom sh(1) (and same origin) have _sometimes_ problems with ': >'
480 ## redirection, so use "printf '' >" instead
482 ## Very first: we undergo several states regarding I/O redirection etc.,
483 ## but need to deal with option updates from within all. Since all the
484 ## option stuff should be above the scissor line, define utility functions
485 ## and redefine them as necessary.
486 ## And, since we have those functions, simply use them for whatever
495 printf >&2 -- "${fmt}\\n" "${@}"
498 ## First of all, create new configuration and check wether it changed
502 h=./config.h h_name=config.h
505 newlst=./config.lst-new
506 newmk=./config.mk-new
512 t1=ten10one1ten10one1
513 if ( [ ${t1##*ten10} = one1 ] && [ ${t1#*ten10} = one1ten10one1 ] &&
514 [ ${t1%%one1*} = ten10 ] && [ ${t1%one1*} = ten10one1ten10 ]
515 ) > /dev/null 2>&1; then
522 # We need some standard utilities
525 n=${1} i=${2} opt=${3:-0}
526 # Evaluate, just in case user comes in with shell snippets (..well..)
528 if type "${i}" >/dev/null 2>&1; then # XXX why have i type not command -v?
529 [ -n "${VERBOSE}" ] && msg ' . $%s ... "%s"' "${n}" "${i}"
533 if [ ${opt} -eq 0 ]; then
534 msg 'ERROR
: no trace of utility
"%s"' "${n}"
540 # Very easy checks for the operating system in order to be able to adjust paths
541 # or similar very basic things which we need to be able to go at all
544 # Check those tools right now that we need before including $rc
545 msg 'Checking
for basic utility
set'
546 check_tool awk "${awk:-`command -v awk`}"
547 check_tool rm "${rm:-`command -v rm`}"
548 check_tool tr "${tr:-`command -v tr`}"
550 # Our feature check environment
553 [ "x${1}" = xfalse ] || [ "x${1}" = xno ] || [ "x${1}" = xoff ]
558 [ "x${1}" = xtrue ] || [ "x${1}" = xyes ] || [ "x${1}" = xon ] ||
559 [ "x${1}" = xrequire ]
563 [ "x${1}" = xrequire ]
568 i="`echo ${i} | ${tr} '[A-Z
]' '[a-z
]'`"
569 if feat_val_no "${i}"; then
571 elif feat_val_yes "${i}"; then
574 msg "ERROR: %s: any of 0/false/no/off or 1/true/yes/on/require, got: %s" \
585 _feat_check ${1} && return 1
591 i="`echo ${i} | ${tr} '[A-Z
]' '[a-z
]'`"
592 [ "x${i}" = xrequire ] || [ "x${i}" = xrequired ]
595 feat_bail_required() {
596 if feat_require ${1}; then
597 msg 'ERROR
: feature WANT_
%s is required but not available
' "${1}"
601 option_update # XXX this is rather useless here (dependency chain..)
605 # "path_check VARNAME" or "path_check VARNAME FLAG VARNAME"
606 varname=${1} addflag=${2} flagvarname=${3}
614 [ -z "${i}" ] && continue
615 [ -d "${i}" ] || continue
616 if [ -n "${j}" ]; then
617 if { z=${y}; echo "${z}"; } | ${grep} ":${i}:" >/dev/null 2>&1; then
622 [ -n "${addflag}" ] && k="${k} ${addflag}${i}"
627 [ -n "${addflag}" ] && k="${addflag}${i}"
630 eval "${varname}=\"${j}\""
631 [ -n "${addflag}" ] && eval "${flagvarname}=\"${k}\""
636 if [ -n "${need_R_ldflags}" ]; then
639 set -- ${LD_LIBRARY_PATH}
643 LDFLAGS="${LDFLAGS} ${need_R_ldflags}${i}"
644 _LDFLAGS="${_LDFLAGS} ${need_R_ldflags}${i}"
648 # Disable it for a possible second run.
653 [ -n "${cc_check_silent}" ] || printf >&2 ' . CC
%s ..
' "${1}"
654 if "${CC}" ${INCS} ${_CFLAGS} ${1} ${ADDCFLAGS} ${_LDFLAGS} ${ADDLDFLAGS} \
655 -o ${tmp2} ${tmp}.c ${LIBS} >/dev/null 2>&1; then
656 _CFLAGS="${_CFLAGS} ${1}"
657 [ -n "${cc_check_silent}" ] || printf >&2 'yes\n'
660 [ -n "${cc_check_silent}" ] || printf >&2 'no
\n'
665 # $1=option [$2=option argument] [$3=if set, shall NOT be added to _LDFLAGS]
666 [ -n "${cc_check_silent}" ] || printf >&2 ' . LD
%s ..
' "${1}"
667 if "${CC}" ${INCS} ${_CFLAGS} ${_LDFLAGS} ${1}${2} ${ADDLDFLAGS} \
668 -o ${tmp2} ${tmp}.c ${LIBS} >/dev/null 2>&1; then
669 [ -n "${3}" ] || _LDFLAGS="${_LDFLAGS} ${1}"
670 [ -n "${cc_check_silent}" ] || printf >&2 'yes\n'
673 [ -n "${cc_check_silent}" ] || printf >&2 'no
\n'
677 # Include $rc, but only take from it what wasn't overwritten by the user from
678 # within the command line or from a chosen fixed CONFIG=
679 # Note we leave alone the values
680 trap "exit 1" HUP INT TERM
681 trap "${rm} -f ${tmp}" EXIT
683 printf >&2 'Reading and preparing configuration from "%s" ... ' ${rc}
685 # We want read(1) to perform backslash escaping in order to be able to use
686 # multiline values in make.rc; the resulting sh(1)/sed(1) code was very slow in
687 # VMs (see [fa2e248]), Aharon Robbins suggested the following
688 < ${rc} ${awk} 'BEGIN{line = ""}{
689 gsub
(/^
[[:space
:]]+/, "", $0)
690 gsub
(/[[:space
:]]+$
/, "", $0)
691 if(gsub
(/\\$
/, "", $0)){
696 if(index
(line
, "#") == 1){
698 }else if(length
(line
)){
704 if [ -n "${good_shell}" ]; then
707 i=`${awk} -v LINE="${line}" 'BEGIN
{
708 gsub
(/=.
*$
/, "", LINE
)
712 if [ "${i}" = "${line}" ]; then
713 msg 'ERROR
: invalid syntax
in "%s"' "${line}"
717 eval j="\$${i}" jx="\${${i}+x}"
718 if [ -n "${j}" ] || [ "${jx}" = x ]; then
721 j=`${awk} -v LINE="${line}" 'BEGIN
{
722 gsub
(/^
[^
=]*=/, "", LINE
)
723 gsub
(/^
\"*/, "", LINE
)
724 gsub
(/\"*$
/, "", LINE
)
728 [ "${i}" = "DESTDIR" ] && continue
731 # Reread the mixed version right now
735 # We need to know about that now, in order to provide utility overwrites etc.
738 msg 'Checking
for remaining
set of utilities
'
739 check_tool grep "${grep:-`command -v grep`}"
741 # Before we step ahead with the other utilities perform a path cleanup first.
745 check_tool cat "${cat:-`command -v cat`}"
746 check_tool chmod "${chmod:-`command -v chmod`}"
747 check_tool cp "${cp:-`command -v cp`}"
748 check_tool cmp "${cmp:-`command -v cmp`}"
750 check_tool mkdir "${mkdir:-`command -v mkdir`}"
751 check_tool mv "${mv:-`command -v mv`}"
753 check_tool sed "${sed:-`command -v sed`}"
754 check_tool sort "${sort:-`command -v sort`}"
755 check_tool tee "${tee:-`command -v tee`}"
757 check_tool chown "${chown:-`command -v chown`}" 1 ||
758 check_tool chown "/sbin/chown" 1 ||
759 check_tool chown "/usr/sbin/chown"
761 check_tool make "${MAKE:-`command -v make`}"
763 check_tool strip "${STRIP:-`command -v strip`}" 1 &&
764 HAVE_STRIP=1 || HAVE_STRIP=0
766 # For ./cc-test.sh only
767 check_tool cksum "${cksum:-`command -v cksum`}"
769 # Update WANT_ options now, in order to get possible inter-dependencies right
772 # (No functions since some shells loose non-exported variables in traps)
773 trap "trap \"\" HUP INT TERM; exit 1" HUP INT TERM
774 trap "trap \"\" HUP INT TERM EXIT;\
775 ${rm} -rf ${newlst} ${tmp0}.* ${tmp0}* ${newmk} ${newh}" EXIT
777 # Our configuration options may at this point still contain shell snippets,
778 # we need to evaluate them in order to get them expanded, and we need those
779 # evaluated values not only in our new configuration file, but also at hand..
780 printf >&2 'Evaluating all configuration items ...
'
781 ${rm} -f ${newlst} ${newmk} ${newh}
782 exec 5<&0 6>&1 <${tmp} >${newlst}
785 if [ -n "${good_shell}" ]; then
787 [ "${i}" != "${i#WANT_}" ] && z=1
789 i=`${awk} -v LINE="${line}" 'BEGIN
{
790 gsub
(/=.
*$
/, "", LINE
);\
793 if echo "${i}" | ${grep} '^WANT_
' >/dev/null 2>&1; then
799 if [ -n "${z}" ]; then
800 j="`echo ${j} | ${tr} '[A-Z
]' '[a-z
]'`"
801 if [ -z "${j}" ] || feat_val_no "${j}"; then
803 printf "/*#define ${i}*/\n" >> ${newh}
804 elif feat_val_yes "${j}"; then
805 if feat_val_require "${j}"; then
810 printf "#define ${i}\n" >> ${newh}
812 msg 'ERROR
: cannot parse
<%s
>' "${line}"
816 printf "#define ${i} \"${j}\"\n" >> ${newh}
818 printf "${i} = ${j}\n" >> ${newmk}
822 exec 0<&5 1>&6 5<&- 6<&-
825 # Add the known utility and some other variables
826 printf "#define UAGENT \"${SID}${NAIL}\"\n" >> ${newh}
827 printf "UAGENT = ${SID}${NAIL}\n" >> ${newmk}
829 printf "#define PRIVSEP \"${SID}${NAIL}-privsep\"\n" >> ${newh}
830 printf "PRIVSEP = \$(UAGENT)-privsep\n" >> ${newmk}
831 if feat_yes DOTLOCK; then
832 printf "OPTIONAL_PRIVSEP = \$(PRIVSEP)\n" >> ${newmk}
834 printf "OPTIONAL_PRIVSEP =\n" >> ${newmk}
838 awk cat chmod chown cp cmp grep mkdir mv rm sed sort tee tr \
842 printf "${i} = ${j}\n" >> ${newmk}
843 printf "${i}=${j}\n" >> ${newlst}
846 # Build a basic set of INCS and LIBS according to user environment.
847 path_check C_INCLUDE_PATH -I _INCS
848 INCS="${INCS} ${_INCS}"
849 path_check LD_LIBRARY_PATH -L _LIBS
850 LIBS="${LIBS} ${_LIBS}"
852 export C_INCLUDE_PATH LD_LIBRARY_PATH
854 # Some environments need runtime path flags to be able to go at all
857 ## Detect CC, wether we can use it, and possibly which CFLAGS we can use
861 ${cat} > ${tmp}.c << \!
864 static void doit(char const *s);
866 main(int argc, char **argv){
875 memcpy(buf, s, strlen(s) +1);
880 if "${CC}" ${INCS} ${CFLAGS} ${ADDCFLAGS} ${LDFLAGS} ${ADDLDFLAGS} \
881 -o ${tmp2} ${tmp}.c ${LIBS}; then
884 msg 'ERROR
: i cannot compile a
"Hello world" via
'
886 "${CC} ${INCS} ${CFLAGS} ${ADDCFLAGS} ${LDFLAGS} ${ADDLDFLAGS} ${LIBS}"
887 msg 'ERROR
: Please
read INSTALL
, rerun
'
891 # This may also update ld_runtime_flags() (again)
898 printf -- "${i}=${j}\n" >> ${newlst}
904 PATH C_INCLUDE_PATH LD_LIBRARY_PATH \
908 printf -- "${i} = ${j}\n" >> ${newmk}
909 printf -- "${i}=${j}\n" >> ${newlst}
912 # Now finally check wether we already have a configuration and if so, wether
913 # all those parameters are still the same.. or something has actually changed
914 if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
915 echo 'Configuration is up-to-date
'
917 elif [ -f ${lst} ]; then
918 echo 'Configuration has been updated..
'
919 ( eval "${MAKE} -f ./mk.mk clean" )
922 echo 'Shiny configuration..
'
925 # Time to redefine helper 1
927 ${rm} -f ${lst} ${h} ${mk}
931 ${mv} -f ${newlst} ${lst}
932 ${mv} -f ${newh} ${h}
933 ${mv} -f ${newmk} ${mk}
935 ## Compile and link checking
943 # (No function since some shells loose non-exported variables in traps)
944 trap "trap \"\" HUP INT TERM;\
945 ${rm} -f ${lst} ${h} ${mk} ${lib} ${inc}; exit 1" HUP INT TERM
946 trap "trap \"\" HUP INT TERM EXIT;\
947 ${rm} -rf ${tmp0}.* ${tmp0}* ${makefile}" EXIT
949 # Time to redefine helper 2
953 printf "*** ${fmt}\\n" "${@}"
954 printf -- "${fmt}\\n" "${@}" >&5
959 printf "*** ${fmt}\\n" "${@}"
960 printf -- "${fmt}" "${@}" >&5
963 exec 5>&2 > ${log} 2>&1
965 echo "${LIBS}" > ${lib}
966 echo "${INCS}" > ${inc}
967 ${cat} > ${makefile} << \!
968 .SUFFIXES: .o .c .x .y
970 $(CC) -I./ $(XINCS) $(CFLAGS) -c $<
972 $(CC) -I./ $(XINCS) -E $< >$@
974 $(CC) -I./ $(XINCS) $(CFLAGS) $(LDFLAGS) -o $@ $< $(XLIBS)
979 variable=$1 topic=$2 define=$3
982 msg_nonl ' .
%s ...
' "${topic}"
983 echo "/* checked ${topic} */" >> ${h}
984 ${rm} -f ${tmp} ${tmp}.o
985 echo '*** test program is
'
986 { echo '#include <'"${h_name}"'>'; cat; } | ${tee} ${tmp}.c
987 #echo '*** the preprocessor generates'
988 #${make} -f ${makefile} ${tmp}.x
990 echo '*** results are'
994 variable
=$1 topic
=$2 define
=$3
996 _check_preface
"${variable}" "${topic}" "${define}"
998 if ${make} -f ${makefile} XINCS="${INCS}" ./${tmp}.o
&&
999 [ -f .
/${tmp}.o
]; then
1001 echo "${define}" >> ${h}
1002 eval have_
${variable}=yes
1005 echo "/* ${define} */" >> ${h}
1007 eval unset have_
${variable}
1013 run
=$1 variable
=$2 topic
=$3 define
=$4 libs
=$5 incs
=$6
1015 _check_preface
"${variable}" "${topic}" "${define}"
1017 feat_yes CROSS_BUILD
&& run
=0
1019 if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
1020 XLIBS="${LIBS} ${libs}" ./${tmp} &&
1022 { [ ${run} -eq 0 ] || ./${tmp}; }; then
1023 echo "*** adding INCS<${incs}> LIBS<${libs}>; executed: ${run}"
1025 echo "${define}" >> ${h}
1026 LIBS
="${LIBS} ${libs}"
1027 echo "${libs}" >> ${lib}
1028 INCS
="${INCS} ${incs}"
1029 echo "${incs}" >> ${inc}
1030 eval have_
${variable}=yes
1034 echo "/* ${define} */" >> ${h}
1035 eval unset have_
${variable}
1041 _link_mayrun
0 "${1}" "${2}" "${3}" "${4}" "${5}"
1045 _link_mayrun
1 "${1}" "${2}" "${3}" "${4}" "${5}"
1049 if feat_yes
${1}; then
1050 echo '#define HAVE_'${1}'' >> ${h}
1052 echo '/* WANT_'${1}'=0 */' >> ${h}
1057 < "${1}" > "${2}" ${awk} \
1058 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1063 # May be multiline..
1064 [ -n "${OS_DEFINES}" ] && printf -- "${OS_DEFINES}" >> ${h}
1066 feat_def AMALGAMATION
1067 feat_def CROSS_BUILD
1074 if run_check inline
'"inline" functions' \
1075 '#define HAVE_INLINE
1076 #define n_INLINE static inline' << \
!
1077 static inline int ilf
(int i
){return ++i
;}
1078 int main
(void
){return ilf
(-1);}
1082 elif run_check inline
'"__inline" functions' \
1083 '#define HAVE_INLINE
1084 #define n_INLINE static __inline' << \
!
1085 static __inline int ilf
(int i
){return ++i
;}
1086 int main
(void
){return ilf
(-1);}
1092 if run_check endian
'Little endian byteorder' \
1093 '#define HAVE_BYTE_ORDER_LITTLE' << \
!
1095 enum
{vBig
= 1, vLittle
= 0};
1096 union
{unsigned short bom
; unsigned char buf
[2];} u
;
1098 return((u.buf
[1] == 0xFE) ? vLittle
: vBig
);
1105 ## Test for "basic" system-calls / functionality that is used by all parts
1106 ## of our program. Once this is done fork away BASE_LIBS and other BASE_*
1107 ## macros to be used by only the subprograms (potentially).
1109 if run_check clock_gettime
'clock_gettime(2)' \
1110 '#define HAVE_CLOCK_GETTIME' << \
!
1116 if(!clock_gettime
(CLOCK_REALTIME
, &ts
) || errno
!= ENOSYS
)
1123 elif run_check clock_gettime
'clock_gettime(2) (via -lrt)' \
1124 '#define HAVE_CLOCK_GETTIME' '-lrt' << \
!
1130 if(!clock_gettime
(CLOCK_REALTIME
, &ts
) || errno
!= ENOSYS
)
1137 elif run_check gettimeofday
'gettimeofday(2)' \
1138 '#define HAVE_GETTIMEOFDAY' << \
!
1139 #include <stdio.h> /* For C89 NULL */
1140 #include <sys/time.h>
1145 if(!gettimeofday
(&tv
, NULL
) || errno
!= ENOSYS
)
1153 have_no_subsecond_time
=1
1156 if run_check nanosleep
'nanosleep(2)' \
1157 '#define HAVE_NANOSLEEP' << \
!
1164 ts.tv_nsec
= 100000;
1165 if(!nanosleep
(&ts
, NULL
) || errno
!= ENOSYS
)
1172 elif run_check nanosleep
'nanosleep(2) (via -lrt)' \
1173 '#define HAVE_NANOSLEEP' '-lrt' << \
!
1180 ts.tv_nsec
= 100000;
1181 if(!nanosleep
(&ts
, NULL
) || errno
!= ENOSYS
)
1188 # link_check is enough for this, that function is so old, trust the proto
1189 elif link_check
sleep 'sleep(3)' \
1190 '#define HAVE_SLEEP' << \
!
1194 if(!sleep(1) || errno
!= ENOSYS
)
1202 msg
'ERROR: we require one of nanosleep(2) and sleep(3).'
1206 if run_check userdb
'gete?[gu]id(2), getpwuid(3), getpwnam(3)' << \
!
1215 if((gid
= getgid
()) != 0)
1217 if((uid
= getuid
()) != 0)
1219 if((pw
= getpwuid
(uid
)) == NULL
&& errno
== ENOSYS
)
1221 if((pw
= getpwnam
("root")) == NULL
&& errno
== ENOSYS
)
1229 msg
'ERROR: we require user and group info / database searches.'
1230 msg
'That much Unix we indulge ourselfs.'
1234 if run_check sa_restart
'SA_RESTART (for sigaction(2))' << \
!
1238 struct sigaction nact
, oact
;
1240 nact.sa_handler
= SIG_DFL
;
1241 sigemptyset
(&nact.sa_mask
);
1242 nact.sa_flags
= SA_RESTART
;
1243 return !(!sigaction
(SIGCHLD
, &nact
, &oact
) || errno
!= ENOSYS
);
1249 msg
'ERROR: we (yet) require the SA_RESTART flag for sigaction(2).'
1253 if link_check snprintf
'v?snprintf(3)' << \
!
1256 static void dome
(char
*buf
, ...
){
1260 vsnprintf
(buf
, 20, "%s", ap
);
1267 snprintf
(b
, sizeof b
, "%s", "string");
1275 msg
'ERROR: we require the snprintf(3) and vsnprintf(3) functions.'
1279 if link_check environ
'environ(3)' << \
!
1280 #include <stdio.h> /* For C89 NULL */
1282 extern char
**environ
;
1284 return environ
[0] == NULL
;
1290 msg
'ERROR: we require the environ(3) array for subprocess control.'
1294 if link_check setenv
'(un)?setenv(3)' '#define HAVE_SETENV' << \
!
1297 setenv
("s-mailx", "i want to see it cute!", 1);
1298 unsetenv
("s-mailx");
1304 elif link_check setenv
'putenv(3)' '#define HAVE_PUTENV' << \
!
1307 putenv
("s-mailx=i want to see it cute!");
1314 msg
'ERROR: we require either the setenv(3) or putenv(3) functions.'
1318 if link_check termios
'termios.h and tc*(3) family' << \
!
1319 #include <termios.h>
1321 struct termios tios
;
1323 tcgetattr
(0, &tios
);
1324 tcsetattr
(0, TCSADRAIN | TCSAFLUSH
, &tios
);
1331 msg
'ERROR: we require termios.h and the tc*() family of functions.'
1332 msg
'That much Unix we indulge ourselfs.'
1338 run_check pathconf
'f?pathconf(2)' '#define HAVE_PATHCONF' << \
!
1345 rv |
= !(pathconf
(".", _PC_NAME_MAX
) >= 0 || errno
== 0 || errno
!= ENOSYS
);
1347 rv |
= !(pathconf
(".", _PC_PATH_MAX
) >= 0 || errno
== 0 || errno
!= ENOSYS
);
1349 /* Only link check
*/
1350 fpathconf
(0, _PC_NAME_MAX
);
1356 run_check pipe2
'pipe2(2)' '#define HAVE_PIPE2' << \
!
1363 if(!pipe2
(fds
, O_CLOEXEC
) || errno
!= ENOSYS
)
1369 # We use this only then for now (need NOW+1)
1370 run_check utimensat
'utimensat(2)' '#define HAVE_UTIMENSAT' << \
!
1371 #include <fcntl.h> /* For AT_* */
1372 #include <sys/stat.h>
1375 struct timespec ts
[2];
1377 ts
[0].tv_nsec
= UTIME_NOW
;
1378 ts
[1].tv_nsec
= UTIME_OMIT
;
1379 if(!utimensat
(AT_FDCWD
, "", ts
, 0) || errno
!= ENOSYS
)
1387 # XXX Add POSIX check once standardized
1388 if link_check posix_random
'arc4random(3)' '#define HAVE_POSIX_RANDOM 0' << \
!
1397 elif [ -n "${have_no_subsecond_time}" ]; then
1398 msg
'ERROR: %s %s' 'without a native random' \
1399 'one of clock_gettime(2) and gettimeofday(2) is required.'
1403 link_check putc_unlocked
'putc_unlocked(3)' '#define HAVE_PUTC_UNLOCKED' <<\
!
1406 putc_unlocked
('@', stdout
);
1411 link_check fchdir
'fchdir(3)' '#define HAVE_FCHDIR' << \
!
1419 if run_check realpath
'realpath(3)' '#define HAVE_REALPATH' << \
!
1422 char x_buf
[4096], *x
= realpath
(".", x_buf
);
1424 return (x
!= NULL
) ?
0 : 1;
1428 if run_check realpath_malloc
'realpath(3) takes NULL' \
1429 '#define HAVE_REALPATH_NULL' << \
!
1432 char
*x
= realpath
(".", NULL
);
1436 return (x
!= NULL
) ?
0 : 1;
1444 ## optional and selectable
1446 if feat_no NOALLOCA
; then
1447 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
1448 # versions of alloca(3) since modern compilers just can't be trusted
1449 # not to overoptimize and silently break some code
1450 run_check alloca
'__builtin_alloca()' \
1451 '#define HAVE_ALLOCA __builtin_alloca' << \
!
1452 #include <stdio.h> /* For C89 NULL */
1454 void
*vp
= __builtin_alloca
(1);
1456 return (vp
!= NULL
);
1461 if feat_yes DOTLOCK
; then
1462 if run_check readlink
'readlink(2)' << \
!
1468 if(!readlink
("here", buf
, sizeof buf
) || errno
!= ENOSYS
)
1476 feat_bail_required DOTLOCK
1480 if feat_yes DOTLOCK
; then
1481 if run_check fchown
'fchown(2)' << \
!
1485 if(!fchown
(0, 0, 0) || errno
!= ENOSYS
)
1493 feat_bail_required DOTLOCK
1497 ## Now it is the time to fork away the BASE_ series
1500 squeeze_em
${inc} ${tmp}
1502 squeeze_em
${lib} ${tmp}
1505 echo "BASE_LIBS = `${cat} ${lib}`" >> ${mk}
1506 echo "BASE_INCS
= `${cat} ${inc}`" >> ${mk}
1508 ## The remains are expected to be used only by the main MUA binary!
1510 link_check setlocale 'setlocale(3)' '#define HAVE_SETLOCALE' << \!
1513 setlocale(LC_ALL, "");
1518 if [ "${have_setlocale}" = yes ]; then
1519 link_check c90amend1 'ISO/IEC 9899:1990/Amendment 1:1995' \
1520 '#define HAVE_C90AMEND1' << \!
1526 char mbb[MB_LEN_MAX + 1];
1531 mbtowc(&wc, "x", 1);
1532 mbrtowc(&wc, "x", 1, NULL);
1534 return (mblen("\0", 1) == 0);
1538 if [ "${have_c90amend1}" = yes ]; then
1539 link_check wcwidth 'wcwidth(3)' '#define HAVE_WCWIDTH' << \!
1548 link_check nl_langinfo 'nl_langinfo(3)' '#define HAVE_NL_LANGINFO' << \!
1549 #include <langinfo.h>
1553 return (nl_langinfo(CODESET) == NULL);
1558 link_check fnmatch 'fnmatch(3)' '#define HAVE_FNMATCH' << \!
1559 #include <fnmatch.h>
1561 return (fnmatch("*", ".", FNM_PATHNAME | FNM_PERIOD) == FNM_NOMATCH);
1565 link_check dirent_d_type 'struct dirent.d_type' '#define HAVE_DIRENT_TYPE' << \!
1569 return !(de.d_type == DT_UNKNOWN ||
1570 de.d_type == DT_DIR || de.d_type == DT_LNK);
1574 ## optional and selectable
1576 if feat_yes ICONV; then
1577 ${cat} > ${tmp2}.c << \!
1578 #include <stdio.h> /* For C89 NULL */
1583 id = iconv_open("foo", "bar");
1584 iconv(id, NULL, NULL, NULL, NULL);
1589 < ${tmp2}.c link_check iconv 'iconv(3) functionality' \
1590 '#define HAVE_ICONV' ||
1591 < ${tmp2}.c link_check iconv 'iconv(3) functionality (via -liconv)' \
1592 '#define HAVE_ICONV' '-liconv' ||
1593 feat_bail_required ICONV
1595 echo '/* WANT_ICONV=0 */' >> ${h}
1598 if feat_yes SOCKETS || feat_yes SPAM_SPAMD; then
1599 ${cat} > ${tmp2}.c << \!
1600 #include <sys/types.h>
1601 #include <sys/socket.h>
1605 struct sockaddr_un soun;
1607 if(socket(AF_UNIX, SOCK_STREAM, 0) == -1 && errno == ENOSYS)
1609 if(connect(0, (struct sockaddr*)&soun, 0) == -1 && errno == ENOSYS)
1611 if(shutdown(0, SHUT_RD | SHUT_WR | SHUT_RDWR) == -1 && errno == ENOSYS)
1617 < ${tmp2}.c run_check af_unix 'AF_UNIX sockets' \
1618 '#define HAVE_UNIX_SOCKETS' ||
1619 < ${tmp2}.c run_check af_unix 'AF_UNIX sockets (via -lnsl)' \
1620 '#define HAVE_UNIX_SOCKETS' '-lnsl' ||
1621 < ${tmp2}.c run_check af_unix 'AF_UNIX sockets (via -lsocket -lnsl)' \
1622 '#define HAVE_UNIX_SOCKETS' '-lsocket -lnsl'
1625 if feat_yes SOCKETS; then
1626 ${cat} > ${tmp2}.c << \!
1628 #include <sys/types.h>
1629 #include <sys/socket.h>
1630 #include <netinet/in.h>
1635 if(socket(AF_INET, SOCK_STREAM, 0) == -1 && errno == ENOSYS)
1637 if(connect(0, &s, 0) == -1 && errno == ENOSYS)
1643 < ${tmp2}.c run_check sockets 'sockets' \
1644 '#define HAVE_SOCKETS' ||
1645 < ${tmp2}.c run_check sockets 'sockets (via -lnsl)' \
1646 '#define HAVE_SOCKETS' '-lnsl' ||
1647 < ${tmp2}.c run_check sockets 'sockets (via -lsocket -lnsl)' \
1648 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
1649 feat_bail_required SOCKETS
1651 echo '/* WANT_SOCKETS=0 */' >> ${h}
1652 fi # feat_yes SOCKETS
1654 if feat_yes SOCKETS; then
1655 link_check getaddrinfo 'getaddrinfo(3)' \
1656 '#define HAVE_GETADDRINFO' << \!
1658 #include <sys/types.h>
1659 #include <sys/socket.h>
1663 struct addrinfo a, *ap;
1666 switch((lrv = getaddrinfo("foo", "0", &a, &ap))){
1670 fprintf(stderr, "%s\n", gai_strerror(lrv));
1679 if feat_yes SOCKETS && [ -z "${have_getaddrinfo}" ]; then
1680 compile_check arpa_inet_h '<arpa/inet.h>' \
1681 '#define HAVE_ARPA_INET_H' << \!
1683 #include <sys/types.h>
1684 #include <sys/socket.h>
1686 #include <netinet/in.h>
1687 #include <arpa/inet.h>
1690 ${cat} > ${tmp2}.c << \!
1692 #include <sys/types.h>
1693 #include <sys/socket.h>
1697 #include <netinet/in.h>
1698 #ifdef HAVE_ARPA_INET_H
1699 #include <arpa/inet.h>
1702 struct sockaddr_in servaddr;
1703 unsigned short portno;
1706 struct in_addr **pptr;
1709 if((ep = getservbyname("POPPY-PORT", "tcp")) != NULL)
1710 portno = (unsigned short)ep->s_port;
1712 if((hp = gethostbyname("POPPY-HOST")) != NULL){
1713 pptr = (struct in_addr**)hp->h_addr_list;
1714 if(hp->h_addrtype != AF_INET)
1715 fprintf(stderr, "au\n");
1718 case HOST_NOT_FOUND:
1724 fprintf(stderr, "au\n");
1729 memset(&servaddr, 0, sizeof servaddr);
1730 servaddr.sin_family = AF_INET;
1731 servaddr.sin_port = htons(portno);
1732 memcpy(&servaddr.sin_addr, *pptr, sizeof(struct in_addr));
1733 fprintf(stderr, "Would connect to %s:%d ...\n",
1734 inet_ntoa(**pptr), (int)portno);
1739 < ${tmp2}.c link_check gethostbyname 'get(serv|host)byname(3)' ||
1740 < ${tmp2}.c link_check gethostbyname \
1741 'get(serv|host)byname(3) (via -nsl)' '' '-lnsl' ||
1742 < ${tmp2}.c link_check gethostbyname \
1743 'get(serv|host)byname(3) (via -lsocket -nsl)' \
1744 '' '-lsocket -lnsl' ||
1745 feat_bail_required SOCKETS
1749 run_check setsockopt 'setsockopt(2)' '#define HAVE_SETSOCKOPT' << \!
1750 #include <sys/socket.h>
1756 if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0) == -1 &&
1763 feat_yes SOCKETS && [ -n "${have_setsockopt}" ] &&
1764 link_check so_sndtimeo 'SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
1765 #include <sys/socket.h>
1773 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
1774 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
1779 feat_yes SOCKETS && [ -n "${have_setsockopt}" ] &&
1780 link_check so_linger 'SO_LINGER' '#define HAVE_SO_LINGER' << \!
1781 #include <sys/socket.h>
1789 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
1794 if feat_yes SSL; then
1795 if link_check openssl 'OpenSSL (new style *_client_method(3ssl))' \
1797 #define HAVE_OPENSSL 10100' '-lssl -lcrypto' << \!
1798 #include <openssl/ssl.h>
1799 #include <openssl/err.h>
1800 #include <openssl/x509v3.h>
1801 #include <openssl/x509.h>
1802 #include <openssl/rand.h>
1803 #ifdef OPENSSL_NO_TLS1 /* TODO only deduced from OPENSSL_NO_SSL[23]! */
1804 # error We need TLSv1.
1807 SSL_CTX *ctx = SSL_CTX_new(TLS_client_method());
1810 PEM_read_PrivateKey(0, 0, 0, 0);
1816 elif link_check openssl 'OpenSSL (old style *_client_method(3ssl))' \
1818 #define HAVE_OPENSSL 10000' '-lssl -lcrypto' << \!
1819 #include <openssl/ssl.h>
1820 #include <openssl/err.h>
1821 #include <openssl/x509v3.h>
1822 #include <openssl/x509.h>
1823 #include <openssl/rand.h>
1824 #if defined OPENSSL_NO_SSL3 &&\
1825 defined OPENSSL_NO_TLS1 /* TODO only deduced from OPENSSL_NO_SSL[23]! */
1826 # error We need one of SSLv3 and TLSv1.
1829 SSL_CTX *ctx = SSL_CTX_new(SSLv23_client_method());
1832 PEM_read_PrivateKey(0, 0, 0, 0);
1839 feat_bail_required SSL
1842 if [ "${have_openssl}" = 'yes' ]; then
1843 compile_check stack_of 'OpenSSL STACK_OF()' \
1844 '#define HAVE_OPENSSL_STACK_OF' << \!
1845 #include <stdio.h> /* For C89 NULL */
1846 #include <openssl/ssl.h>
1847 #include <openssl/err.h>
1848 #include <openssl/x509v3.h>
1849 #include <openssl/x509.h>
1850 #include <openssl/rand.h>
1852 STACK_OF(GENERAL_NAME) *gens = NULL;
1854 printf("%p", gens); /* to use it */
1859 link_check ossl_conf 'OpenSSL_modules_load_file() support' \
1860 '#define HAVE_OPENSSL_CONFIG' << \!
1861 #include <stdio.h> /* For C89 NULL */
1862 #include <openssl/conf.h>
1864 CONF_modules_load_file(NULL, NULL, CONF_MFLAGS_IGNORE_MISSING_FILE);
1865 CONF_modules_free();
1870 link_check ossl_conf_ctx 'OpenSSL SSL_CONF_CTX support' \
1871 '#define HAVE_OPENSSL_CONF_CTX' << \!
1873 #include <openssl/ssl.h>
1874 #include <openssl/err.h>
1876 #if HAVE_OPENSSL < 10100
1877 SSL_CTX *ctx = SSL_CTX_new(SSLv23_client_method());
1879 SSL_CTX *ctx = SSL_CTX_new(TLS_client_method());
1881 SSL_CONF_CTX *cctx = SSL_CONF_CTX_new();
1883 SSL_CONF_CTX_set_flags(cctx,
1884 SSL_CONF_FLAG_FILE | SSL_CONF_FLAG_CLIENT |
1885 SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_SHOW_ERRORS);
1886 SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
1887 SSL_CONF_cmd(cctx, "Protocol", "ALL");
1888 SSL_CONF_CTX_finish(cctx);
1889 SSL_CONF_CTX_free(cctx);
1895 link_check rand_egd 'OpenSSL RAND_egd(3ssl)' \
1896 '#define HAVE_OPENSSL_RAND_EGD' << \!
1897 #include <openssl/rand.h>
1899 return RAND_egd("some.where") > 0;
1903 if feat_yes SSL_ALL_ALGORITHMS; then
1904 if link_check ssl_all_algo 'OpenSSL all-algorithms support' \
1905 '#define HAVE_SSL_ALL_ALGORITHMS' << \!
1906 #include <openssl/evp.h>
1908 OpenSSL_add_all_algorithms();
1909 EVP_get_cipherbyname("two cents i never exist");
1917 feat_bail_required SSL_ALL_ALGORITHMS
1919 fi # SSL_ALL_ALGORITHMS
1921 if feat_yes MD5 && feat_no NOEXTMD5; then
1922 run_check openssl_md5 'MD5 digest in OpenSSL' \
1923 '#define HAVE_OPENSSL_MD5' << \!
1926 #include <openssl/md5.h>
1928 char const dat[] = "abrakadabrafidibus";
1929 char dig[16], hex[16 * 2];
1933 memset(dig, 0, sizeof(dig));
1934 memset(hex, 0, sizeof(hex));
1936 MD5_Update(&ctx, dat, sizeof(dat) - 1);
1937 MD5_Final(dig, &ctx);
1939 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
1940 for(i = 0; i < sizeof(hex) / 2; i++){
1942 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
1943 hex[++j] = hexchar(dig[i] & 0x0f);
1945 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
1948 fi # feat_yes MD5 && feat_no NOEXTMD5
1951 echo '/* WANT_SSL=0 */' >> ${h}
1954 if feat_yes SMTP; then
1955 echo '#define HAVE_SMTP' >> ${h}
1957 echo '/* WANT_SMTP=0 */' >> ${h}
1960 if feat_yes POP3; then
1961 echo '#define HAVE_POP3' >> ${h}
1963 echo '/* WANT_POP3=0 */' >> ${h}
1966 if feat_yes GSSAPI; then
1967 ${cat} > ${tmp2}.c << \!
1968 #include <gssapi/gssapi.h>
1970 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
1971 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
1975 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
1977 if command -v krb5-config >/dev/null 2>&1; then
1978 i=`command -v krb5-config
`
1979 GSS_LIBS="`CFLAGS
= ${i} --libs gssapi
`"
1980 GSS_INCS="`CFLAGS
= ${i} --cflags`"
1981 i='GSS-API via krb5-config(1)'
1985 i='GSS-API in gssapi/gssapi.h, libgssapi'
1987 if < ${tmp2}.c link_check gss \
1988 "${i}" '#define HAVE_GSSAPI' "${GSS_LIBS}" "${GSS_INCS}" ||\
1989 < ${tmp3}.c link_check gss \
1990 'GSS-API in gssapi.h, libgssapi' \
1991 '#define HAVE_GSSAPI
1992 #define GSSAPI_REG_INCLUDE' \
1994 < ${tmp2}.c link_check gss 'GSS-API in libgssapi_krb5' \
1995 '#define HAVE_GSSAPI' \
1997 < ${tmp3}.c link_check gss \
1998 'GSS-API in libgssapi, OpenBSD-style (pre 5.3)' \
1999 '#define HAVE_GSSAPI
2000 #define GSS_REG_INCLUDE' \
2001 '-lgssapi -lkrb5 -lcrypto' \
2002 '-I/usr/include/kerberosV' ||\
2003 < ${tmp2}.c link_check gss 'GSS-API in libgss' \
2004 '#define HAVE_GSSAPI' \
2006 link_check gss 'GSS-API in libgssapi_krb5, old-style' \
2007 '#define HAVE_GSSAPI
2008 #define GSSAPI_OLD_STYLE' \
2009 '-lgssapi_krb5' << \!
2010 #include <gssapi/gssapi.h>
2011 #include <gssapi/gssapi_generic.h>
2013 gss_import_name(0, 0, gss_nt_service_name, 0);
2014 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
2021 feat_bail_required GSSAPI
2024 echo '/* WANT_GSSAPI=0 */' >> ${h}
2025 fi # feat_yes GSSAPI
2027 if feat_yes NETRC; then
2028 echo '#define HAVE_NETRC' >> ${h}
2030 echo '/* WANT_NETRC=0 */' >> ${h}
2033 if feat_yes AGENT; then
2034 echo '#define HAVE_AGENT' >> ${h}
2036 echo '/* WANT_AGENT=0 */' >> ${h}
2039 if feat_yes IDNA; then
2040 if link_check idna 'GNU Libidn' '#define HAVE_IDNA HAVE_IDNA_LIBIDNA' \
2043 #include <idn-free.h>
2044 #include <stringprep.h>
2046 char *utf8, *idna_ascii, *idna_utf8;
2048 utf8 = stringprep_locale_to_utf8("does.this.work");
2049 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
2052 idn_free(idna_ascii);
2053 /* (Rather link check only here) */
2054 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
2060 elif link_check idna 'idnkit' '#define HAVE_IDNA HAVE_IDNA_IDNKIT' \
2063 #include <idn/api.h>
2064 #include <idn/result.h>
2068 char local_name[256];
2070 r = idn_encodename(IDN_ENCODE_APP, "does.this.work", ace_name,
2072 if (r != idn_success) {
2073 fprintf(stderr, "idn_encodename failed: %s\n", idn_result_tostring(r));
2076 r = idn_decodename(IDN_DECODE_APP, ace_name, local_name, sizeof(local_name));
2077 if (r != idn_success) {
2078 fprintf(stderr, "idn_decodename failed: %s\n", idn_result_tostring(r));
2087 feat_bail_required IDNA
2090 if [ -n "${have_idna}" ]; then
2091 echo '#define HAVE_IDNA_LIBIDNA 0' >> ${h}
2092 echo '#define HAVE_IDNA_IDNKIT 1' >> ${h}
2095 echo '/* WANT_IDNA=0 */' >> ${h}
2098 if feat_yes IMAP_SEARCH; then
2099 echo '#define HAVE_IMAP_SEARCH' >> ${h}
2101 echo '/* WANT_IMAP_SEARCH=0 */' >> ${h}
2104 if feat_yes REGEX; then
2105 if link_check regex 'regular expressions' '#define HAVE_REGEX' << \!
2112 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
2114 status = regexec(&re, "plan9", 0,NULL, 0);
2116 return !(status == REG_NOMATCH);
2122 feat_bail_required REGEX
2125 echo '/* WANT_REGEX=0 */' >> ${h}
2128 if feat_yes READLINE; then
2130 link_check readline "for readline(3) (${1})" \
2131 '#define HAVE_READLINE' "${1}" << \!
2133 #include <readline/history.h>
2134 #include <readline/readline.h>
2143 stifle_history(242);
2144 rl = readline("Enter a line:");
2148 rl_extend_line_buffer(10);
2149 rl_point = rl_end = 10;
2150 rl_pre_input_hook = (rl_hook_func_t*)NULL;
2151 rl_forced_update_display();
2153 hs = history_get_history_state();
2155 he = history_list();
2158 rl_free_line_state();
2159 rl_cleanup_after_signal();
2160 rl_reset_after_signal();
2166 __edrdlib -lreadline ||
2167 __edrdlib '-lreadline -ltermcap' || feat_bail_required READLINE
2170 if feat_yes MLE && [ -z "${have_readline}" ] &&
2171 [ -n "${have_c90amend1}" ]; then
2173 echo '#define HAVE_MLE' >> ${h}
2175 feat_bail_required MLE
2176 echo '/* WANT_{READLINE,MLE}=0 */' >> ${h}
2179 # Generic have-a-line-editor switch for those who need it below
2180 if [ -n "${have_mle}" ] ||
2181 [ -n "${have_readline}" ]; then
2185 if [ -n "${have_cle}" ] && feat_yes HISTORY; then
2186 echo '#define HAVE_HISTORY' >> ${h}
2188 echo '/* WANT_HISTORY=0 */' >> ${h}
2191 if [ -n "${have_mle}" ] && feat_yes KEY_BINDINGS; then
2192 echo '#define HAVE_KEY_BINDINGS' >> ${h}
2194 echo '/* WANT_KEY_BINDINGS=0 */' >> ${h}
2197 if feat_yes TERMCAP; then
2199 link_check termcap "termcap(5) (via ${4})" \
2200 "#define HAVE_TERMCAP${3}" "${1}" << _EOT
2205 #define UNCONST(P) ((void*)(unsigned long)(void const*)(P))
2206 static int my_putc(int c){return putchar(c);}
2208 char buf[1024+512], cmdbuf[2048], *cpb, *r1;
2209 int r2 = OK, r3 = ERR;
2211 tgetent(buf, getenv("TERM"));
2213 r1 = tgetstr(UNCONST("cm"), &cpb);
2215 r2 = tgetnum(UNCONST("Co"));
2216 r3 = tgetflag(UNCONST("ut"));
2217 tputs("cr", 1, &my_putc);
2218 return (r1 == NULL || r2 == -1 || r3 == 0);
2224 link_check terminfo "terminfo(5) (via ${2})" \
2225 '#define HAVE_TERMCAP
2226 #define HAVE_TERMCAP_CURSES
2227 #define HAVE_TERMINFO' "${1}" << _EOT
2231 #define UNCONST(P) ((void*)(unsigned long)(void const*)(P))
2232 static int my_putc(int c){return putchar(c);}
2238 r0 = setupterm(NULL, 1, &er);
2239 r1 = tigetflag(UNCONST("bce"));
2240 r2 = tigetnum(UNCONST("colors"));
2241 r3 = tigetstr(UNCONST("cr"));
2242 tp = tparm(r3, NULL);
2243 tputs(tp, 1, &my_putc);
2244 return (r0 == ERR || r1 == -1 || r2 == -2 || r2 == -1 ||
2245 r3 == (char*)-1 || r3 == NULL);
2250 if feat_yes TERMCAP_PREFER_TERMINFO; then
2251 __terminfolib -ltinfo -ltinfo ||
2252 __terminfolib -lcurses -lcurses ||
2253 __terminfolib -lcursesw -lcursesw ||
2254 feat_bail_required TERMCAP_PREFER_TERMINFO
2257 if [ -z "${have_terminfo}" ]; then
2258 __termcaplib -ltermcap '' '' '-ltermcap' ||
2259 __termcaplib -ltermcap '#include <curses.h>' '
2260 #define HAVE_TERMCAP_CURSES' \
2261 'curses.h / -ltermcap' ||
2262 __termcaplib -lcurses '#include <curses.h>' '
2263 #define HAVE_TERMCAP_CURSES' \
2264 'curses.h / -lcurses' ||
2265 __termcaplib -lcursesw '#include <curses.h>' '
2266 #define HAVE_TERMCAP_CURSES' \
2267 'curses.h / -lcursesw' ||
2268 feat_bail_required TERMCAP
2270 if [ -n "${have_termcap}" ]; then
2271 run_check tgetent_null \
2272 "tgetent(3) of termcap(5) takes NULL buffer" \
2273 "#define HAVE_TGETENT_NULL_BUF" << _EOT
2274 #include <stdio.h> /* For C89 NULL */
2276 #ifdef HAVE_TERMCAP_CURSES
2277 # include <curses.h>
2281 tgetent(NULL, getenv("TERM"));
2288 echo '/* WANT_TERMCAP=0 */' >> ${h}
2289 echo '/* WANT_TERMCAP_PREFER_TERMINFO=0 */' >> ${h}
2292 if feat_yes SPAM_SPAMC; then
2293 echo '#define HAVE_SPAM_SPAMC' >> ${h}
2294 if command -v spamc >/dev/null 2>&1; then
2295 echo "#define SPAM_SPAMC_PATH \"`command -v spamc
`\"" >> ${h}
2298 echo '/* WANT_SPAM_SPAMC=0 */' >> ${h}
2301 if feat_yes SPAM_SPAMD && [ -n "${have_af_unix}" ]; then
2302 echo '#define HAVE_SPAM_SPAMD' >> ${h}
2304 feat_bail_required SPAM_SPAMD
2305 echo '/* WANT_SPAM_SPAMD=0 */' >> ${h}
2308 feat_def SPAM_FILTER
2310 if feat_yes SPAM_SPAMC || feat_yes SPAM_SPAMD || feat_yes SPAM_FILTER; then
2311 echo '#define HAVE_SPAM' >> ${h}
2313 echo '/* HAVE_SPAM */' >> ${h}
2316 if feat_yes QUOTE_FOLD &&\
2317 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
2318 echo '#define HAVE_QUOTE_FOLD' >> ${h}
2320 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
2323 feat_def FILTER_HTML_TAGSOUP
2332 squeeze_em ${inc} ${tmp}
2334 squeeze_em ${lib} ${tmp}
2339 printf '#ifndef n_CONFIG_H\n# define n_CONFIG_H 1\n' > ${h}
2340 ${cat} ${tmp} >> ${h}
2343 printf '\n/* The "feature string" */\n' >> ${h}
2344 printf '# if defined _ACCMACVAR_SOURCE || defined HAVE_AMALGAMATION\n' >> ${h}
2345 printf 'static char const _features[] = "MIME"\n' >> ${h}
2346 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
2347 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
2348 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
2349 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
2350 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
2351 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TLS"\n# endif\n' >> ${h}
2352 printf '# ifdef HAVE_SSL_ALL_ALGORITHMS\n ",SSL-ALL-ALGORITHMS"\n# endif\n'\
2354 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
2355 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
2356 printf '# ifdef HAVE_GSSAPI\n ",GSS-API"\n# endif\n' >> ${h}
2357 printf '# ifdef HAVE_MD5\n ",MD5 [APOP,CRAM-MD5]"\n# endif\n' >> ${h}
2358 printf '# ifdef HAVE_NETRC\n ",NETRC"\n# endif\n' >> ${h}
2359 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
2360 printf '# ifdef HAVE_IMAP_SEARCH\n ",IMAP-SEARCH"\n# endif\n' >> ${h}
2361 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
2362 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
2363 printf '# ifdef HAVE_MLE\n ",MLE"\n# endif\n' >> ${h}
2364 printf '# ifdef HAVE_WCWIDTH\n " (WIDE GLYPHS)"\n# endif\n' >> ${h}
2365 printf '# ifdef HAVE_HISTORY\n ",HISTORY"\n# endif\n' >> ${h}
2366 printf '# ifdef HAVE_KEY_BINDINGS\n ",KEY-BINDINGS"\n# endif\n' >> ${h}
2367 printf '# ifdef HAVE_TERMCAP\n ",TERMCAP"\n# endif\n' >> ${h}
2368 printf '# ifdef HAVE_TERMINFO\n " (terminfo(5))"\n# endif\n' >> ${h}
2369 printf '# ifdef HAVE_SPAM_SPAMC\n ",SPAMC"\n# endif\n' >> ${h}
2370 printf '# ifdef HAVE_SPAM_SPAMD\n ",SPAMD"\n# endif\n' >> ${h}
2371 printf '# ifdef HAVE_SPAM_FILTER\n ",SPAMFILTER"\n# endif\n' >> ${h}
2372 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
2373 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
2374 printf '# ifdef HAVE_FILTER_HTML_TAGSOUP\n ",HTML-FILTER"\n# endif\n' >> ${h}
2375 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
2376 printf '# ifdef HAVE_DOTLOCK\n ",DOTLOCK-FILES"\n# endif\n' >> ${h}
2377 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
2378 printf '# ifdef HAVE_DEVEL\n ",DEVEL"\n# endif\n' >> ${h}
2379 printf '# ifdef HAVE_CROSS_BUILD\n ",CROSS-BUILD"\n# endif\n' >> ${h}
2380 printf ';\n# endif /* _ACCMACVAR_SOURCE || HAVE_AMALGAMATION */\n' >> ${h}
2382 # Create the real mk.mk
2383 # Note we cannout use explicit ./ filename prefix for source and object
2384 # pathnames because of a bug in bmake(1)
2385 ${rm} -rf ${tmp0}.* ${tmp0}*
2386 printf 'OBJ_SRC = ' >> ${mk}
2387 if feat_no AMALGAMATION; then
2388 for i in `printf '%s\n' *.c |
${sort}`; do
2389 if [ "${i}" = privsep.c ]; then
2392 printf "${i} " >> ${mk}
2394 printf '\nAMALGAM_TARGET =\nAMALGAM_DEP =\n' >> ${mk}
2396 printf 'main.c\nAMALGAM_TARGET = main.o\nAMALGAM_DEP = ' >> ${mk}
2398 printf '\n/* HAVE_AMALGAMATION: include sources */\n' >> ${h}
2399 printf '#elif _CONFIG_H + 0 == 1\n' >> ${h}
2400 printf '# undef _CONFIG_H\n' >> ${h}
2401 printf '# define _CONFIG_H 2\n' >> ${h}
2402 for i in `printf '%s\n' *.c |
${sort}`; do
2403 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ] || \
2404 [ "${i}" = privsep.c ]; then
2407 printf "${i} " >> ${mk}
2408 printf "# include \"${i}\"\n" >> ${h}
2411 # tcc(1) fails on 2015-11-13 unless this #else clause existed
2412 echo '#else' >> ${h}
2415 printf '#endif /* n_CONFIG_H */\n' >> ${h}
2417 echo "LIBS = `${cat} ${lib}`" >> ${mk}
2418 echo "INCS = `${cat} ${inc}`" >> ${mk}
2420 ${cat} ./mk-mk.in >> ${mk}
2424 ${cat} > ${tmp2}.c << \!
2427 :The following optional features are enabled:
2428 #ifdef HAVE_SETLOCALE
2429 : + Locale support: Printable characters depend on the environment
2430 # ifdef HAVE_C90AMEND1
2431 : + Multibyte character support
2433 # ifdef HAVE_NL_LANGINFO
2434 : + Automatic detection of terminal character set
2438 : + Character set conversion using iconv()
2444 # ifdef HAVE_OPENSSL
2445 : + S/MIME and SSL/TLS (OpenSSL)
2447 # ifdef HAVE_SSL_ALL_ALGORITHMS
2448 : + + Support for more ("all
") digest and cipher algorithms
2458 : + GSS-API authentication
2461 : + MD5 message digest (APOP, CRAM-MD5)
2464 : + .netrc file support
2467 : + IDNA (internationalized domain names for applications) support
2469 #ifdef HAVE_IMAP_SEARCH
2470 : + IMAP-style search expressions
2473 : + Regular expression support (searches, conditional expressions etc.)
2475 #if defined HAVE_READLINE || defined HAVE_MLE
2476 # ifdef HAVE_READLINE
2477 : + Command line editing via readline(3)
2479 # ifdef HAVE_WCWIDTH
2480 : + Command line editing via M(ailx)-L(ine)-E(ditor) (wide glyph support)
2482 : + Command line editing via M(ailx)-L(ine)-E(ditor) (no wide glyph support)
2485 # ifdef HAVE_HISTORY
2486 : + + History management
2488 # ifdef HAVE_KEY_BINDINGS
2489 : + + Configurable key bindings
2493 # ifdef HAVE_TERMINFO
2494 : + Terminal capability queries (terminfo(5))
2496 : + Terminal capability queries (termcap(5))
2501 # ifdef HAVE_SPAM_SPAMC
2502 : + + Via spamc(1) (of spamassassin(1))
2504 # ifdef HAVE_SPAM_SPAMD
2505 : + + Directly via spamd(1) (of spamassassin(1))
2507 # ifdef HAVE_SPAM_FILTER
2508 : + + Via freely configurable *spam-filter-XY*s
2511 #ifdef HAVE_DOCSTRINGS
2512 : + Documentation summary strings
2514 #ifdef HAVE_QUOTE_FOLD
2515 : + Extended *quote-fold*ing
2517 #ifdef HAVE_FILTER_HTML_TAGSOUP
2518 : + Builtin HTML-to-text filter (for display purposes, primitive)
2521 : + Coloured message display (simple)
2524 : + Dotlock files and privilege-separated file dotlock program
2527 :The following optional features are disabled:
2528 #ifndef HAVE_SETLOCALE
2529 : - Locale support: Only ASCII characters are recognized
2531 # ifndef HAVE_C90AMEND1
2532 : - Multibyte character support
2534 # ifndef HAVE_NL_LANGINFO
2535 : - Automatic detection of terminal character set
2538 : - Character set conversion using iconv()
2539 : _ (Ooooh, no iconv(3), NO character set conversion possible! Really...)
2541 #ifndef HAVE_SOCKETS
2545 : - S/MIME and SSL/TLS
2547 # ifndef HAVE_SSL_ALL_ALGORITHMS
2548 : - Support for more S/MIME and SSL/TLS digest and cipher algorithms
2558 : - GSS-API authentication
2561 : - MD5 message digest (APOP, CRAM-MD5)
2564 : - .netrc file support
2567 : - IDNA (internationalized domain names for applications) support
2569 #ifndef HAVE_IMAP_SEARCH
2570 : - IMAP-style search expressions
2573 : - Regular expression support
2575 #if !defined HAVE_READLINE && !defined HAVE_MLE
2576 : - Command line editing and history
2578 # ifndef HAVE_HISTORY
2579 : + (Command line editing) - History management
2581 # ifndef HAVE_KEY_BINDINGS
2582 : + (Command line editing) - Configurable key bindings
2585 #ifndef HAVE_TERMCAP
2586 : - Terminal capability queries
2591 #ifndef HAVE_DOCSTRINGS
2592 : - Documentation summary strings
2594 #ifndef HAVE_QUOTE_FOLD
2595 : - Extended *quote-fold*ing
2597 #ifndef HAVE_FILTER_HTML_TAGSOUP
2598 : - Builtin HTML-to-text filter (for display purposes, primitive)
2601 : - Coloured message display (simple)
2603 #ifndef HAVE_DOTLOCK
2604 : - Dotlock files and privilege-separated file dotlock program
2607 #if !defined HAVE_FNMATCH || !defined HAVE_FCHDIR ||\
2608 defined HAVE_DEBUG || defined HAVE_DEVEL
2610 # ifndef HAVE_FNMATCH
2611 : . The function fnmatch(3) could not be found.
2612 : _ Filename patterns like wildcard are not supported on your system.
2614 # ifndef HAVE_FCHDIR
2615 : . The function fchdir(2) could not be found. We will use chdir(2)
2616 : _ instead. This is not a problem unless the current working
2617 : _ directory is changed while this program is inside of it.
2620 : . Debug enabled binary: not meant to be used by end-users: THANKS!
2623 : . Computers do not blunder.
2626 #endif /* Remarks */
2628 : . System-wide resource file: SYSCONFDIR/SYSCONFRC
2631 : . libexecdir: LIBEXECDIR
2634 : . sendmail(1): VAL_SENDMAIL (argv[0] = VAL_SENDMAIL_PROGNAME)
2635 : . Mail spool directory: MAILSPOOL
2639 ${make} -f ${makefile} ${tmp2}.x
2640 < ${tmp2}.x ${sed} -e '/^[^:]/d; /^$/d; s/^://' |