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} ${EXTRA_CFLAGS}"
187 LDFLAGS
="${_LDFLAGS} ${EXTRA_LDFLAGS}"
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} ${EXTRA_CFLAGS}"
248 LDFLAGS
="${_LDFLAGS} ${EXTRA_LDFLAGS}"
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 # EXTRA_CFLAGS/EXTRA_LDFLAGS
263 if feat_no AUTOCC
; then
265 # Ensure those don't do any harm
266 EXTRA_CFLAGS
= EXTRA_LDFLAGS
=
267 export EXTRA_CFLAGS EXTRA_LDFLAGS
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}, 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..' \
325 msg 'Testing usable ${CFLAGS}/${LDFLAGS} for ${CC}=%s' "${CC}"
328 i
=`echo "${CC}" | ${awk} 'BEGIN{FS="/"}{print $NF}'`
329 if { echo "${i}" | ${grep} tcc; } >/dev/null 2>&1; then
330 msg ' . have special tcc(1) environmental rules ...'
333 # As of pcc CVS 2016-04-02, stack protection support is announced but
334 # will break if used on Linux
335 if { echo "${i}" | ${grep} pcc; } >/dev
/null
2>&1; then
341 feat_no DEBUG
&& _CFLAGS
="-DNDEBUG ${_CFLAGS}"
342 CFLAGS
="${_CFLAGS} ${EXTRA_CFLAGS}"
343 LDFLAGS
="${_LDFLAGS} ${EXTRA_LDFLAGS}"
345 if feat_no DEBUG
; then
346 CFLAGS
="-DNDEBUG ${CFLAGS}"
350 export CFLAGS LDFLAGS
354 __cflags
=${_CFLAGS} __ldflags
=${_LDFLAGS}
361 if feat_yes DEBUG
; then
362 # May have problems to find libtcc cc_check -b
366 if ld_check
-Wl,-rpath =.
/ no
; then
367 need_R_ldflags
=-Wl,-rpath=
368 ld_runtime_flags
# update!
371 _CFLAGS
="${_CFLAGS} ${__cflags}" _LDFLAGS="${_LDFLAGS} ${__ldflags}"
372 unset __cflags __ldflags
375 _cc_flags_generic
() {
376 __cflags
=${_CFLAGS} __ldflags
=${_LDFLAGS}
378 feat_yes DEVEL
&& cc_check
-std=c89 || cc_check
-std=c99
380 # Check -g first since some others may rely upon -g / optim. level
381 if feat_yes DEBUG
; then
384 elif [ ${cc_maxopt} -gt 2 ] && cc_check
-O3; then
386 elif [ ${cc_maxopt} -gt 1 ] && cc_check
-O2; then
388 elif [ ${cc_maxopt} -gt 0 ] && cc_check
-O1; then
394 if feat_yes DEVEL
&& cc_check
-Weverything; then
399 cc_check
-Wbad-function-cast
400 cc_check
-Wcast-align
403 cc_check
-Wmissing-prototypes
406 cc_check
-Wwrite-strings
407 cc_check
-Wno-long-long
411 if feat_yes AMALGAMATION
&& feat_no DEVEL
; then
412 cc_check
-Wno-unused-function
414 feat_no DEVEL
&& cc_check
-Wno-unused-result # XXX do right way (pragma too)
416 cc_check
-fno-unwind-tables
417 cc_check
-fno-asynchronous-unwind-tables
418 cc_check
-fstrict-aliasing
419 if cc_check
-fstrict-overflow && feat_yes DEVEL
; then
420 cc_check
-Wstrict-overflow=5
423 if feat_yes DEBUG || feat_yes FORCED_STACKPROT
; then
424 if [ -z "${force_no_stackprot}" ]; then
425 if cc_check
-fstack-protector-strong ||
426 cc_check
-fstack-protector-all; then
427 cc_check
-D_FORTIFY_SOURCE=2
430 msg
'Not checking for -fstack-protector compiler option,'
431 msg
'since that caused errors in a "similar" configuration.'
432 msg
'You may turn off WANT_AUTOCC and use your own settings, rerun'
436 if feat_yes AMALGAMATION
; then
440 # LD (+ dependend CC)
442 if feat_yes DEVEL
; then
445 #if cc_check -fsanitize=memory &&
446 # ld_check -fsanitize=memory &&
447 # cc_check -fsanitize-memory-track-origins=2 &&
448 # ld_check -fsanitize-memory-track-origins=2; then
455 ld_check
-Wl,-z,relro
457 ld_check
-Wl,-z,noexecstack
458 if ld_check
-Wl,-rpath =.
/ no
; then
459 need_R_ldflags
=-Wl,-rpath=
460 ld_runtime_flags
# update!
461 elif ld_check
-Wl,-R .
/ no
; then
462 need_R_ldflags
=-Wl,-R
463 ld_runtime_flags
# update!
466 # Address randomization
468 if cc_check
-fPIE || cc_check
-fpie; then
469 ld_check
-pie || _CFLAGS
=${_ccfg}
473 _CFLAGS
="${_CFLAGS} ${__cflags}" _LDFLAGS="${_LDFLAGS} ${__ldflags}"
474 unset __cflags __ldflags
480 ## - Heirloom sh(1) (and same origin) have _sometimes_ problems with ': >'
481 ## redirection, so use "printf '' >" instead
483 ## Very first: we undergo several states regarding I/O redirection etc.,
484 ## but need to deal with option updates from within all. Since all the
485 ## option stuff should be above the scissor line, define utility functions
486 ## and redefine them as necessary.
487 ## And, since we have those functions, simply use them for whatever
496 printf >&2 -- "${fmt}\\n" "${@}"
499 ## First of all, create new configuration and check wether it changed
504 h
=.
/config.h h_name
=config.h
507 newlst
=.
/config.lst-new
508 newmk
=.
/config.mk-new
509 newev
=.
/config.ev-new
515 t1
=ten10one1ten10one1
516 if ( [ ${t1##*ten10} = one1
] && [ ${t1#*ten10} = one1ten10one1
] &&
517 [ ${t1%%one1*} = ten10
] && [ ${t1%one1*} = ten10one1ten10
]
518 ) > /dev
/null
2>&1; then
525 # We need some standard utilities
528 n
=${1} i=${2} opt=${3:-0}
529 # Evaluate, just in case user comes in with shell snippets (..well..)
531 if type "${i}" >/dev
/null
2>&1; then # XXX why have i type not command -v?
532 [ -n "${VERBOSE}" ] && msg ' . ${%s} ... %s' "${n}" "${i}"
536 if [ ${opt} -eq 0 ]; then
537 msg
'ERROR: no trace of utility "%s"' "${n}"
543 # Very easy checks for the operating system in order to be able to adjust paths
544 # or similar very basic things which we need to be able to go at all
547 # Check those tools right now that we need before including $rc
548 msg
'Checking for basic utility set'
549 check_tool
awk "${awk:-`command -v awk`}"
550 check_tool
rm "${rm:-`command -v rm`}"
551 check_tool
tr "${tr:-`command -v tr`}"
553 # Our feature check environment
555 [ "x${1}" = x0
] ||
[ "x${1}" = xn
] ||
556 [ "x${1}" = xfalse ] || [ "x${1}" = xno ] || [ "x${1}" = xoff
]
560 [ "x${1}" = x1
] ||
[ "x${1}" = xy
] ||
561 [ "x${1}" = xtrue ] || [ "x${1}" = xyes ] || [ "x${1}" = xon
] ||
562 [ "x${1}" = xrequire
]
566 [ "x${1}" = xrequire
]
571 i
="`echo ${i} | ${tr} '[A-Z]' '[a-z]'`"
572 if feat_val_no
"${i}"; then
574 elif feat_val_yes
"${i}"; then
577 msg
"ERROR: %s: 0/n/false/no/off or 1/y/true/yes/on/require, got: %s" \
588 _feat_check
${1} && return 1
594 i
="`echo ${i} | ${tr} '[A-Z]' '[a-z]'`"
595 [ "x${i}" = xrequire
] ||
[ "x${i}" = xrequired
]
598 feat_bail_required
() {
599 if feat_require
${1}; then
600 msg
'ERROR: feature WANT_%s is required but not available' "${1}"
604 option_update
# XXX this is rather useless here (dependency chain..)
608 # "path_check VARNAME" or "path_check VARNAME FLAG VARNAME"
609 varname
=${1} addflag=${2} flagvarname=${3}
617 [ -z "${i}" ] && continue
618 [ -d "${i}" ] ||
continue
619 # Skip any fakeroot packager environment
620 case "${i}" in *fakeroot
*) continue;; esac
621 if [ -n "${j}" ]; then
622 if { z
=${y}; echo "${z}"; } | ${grep} ":${i}:" >/dev/null 2>&1; then
627 [ -n "${addflag}" ] && k="${k} ${addflag}${i}"
632 [ -n "${addflag}" ] && k="${addflag}${i}"
635 eval "${varname}=\"${j}\""
636 [ -n "${addflag}" ] && eval "${flagvarname}=\"${k}\""
641 if [ -n "${need_R_ldflags}" ]; then
644 set -- ${LD_LIBRARY_PATH}
648 LDFLAGS="${LDFLAGS} ${need_R_ldflags}${i}"
649 _LDFLAGS="${_LDFLAGS} ${need_R_ldflags}${i}"
653 # Disable it for a possible second run.
658 [ -n "${cc_check_silent}" ] || printf >&2 ' . CC %s .. ' "${1}"
660 ${_CFLAGS} ${1} ${EXTRA_CFLAGS} ${_LDFLAGS} ${EXTRA_LDFLAGS} \
661 -o ${tmp2} ${tmp}.c ${LIBS} >/dev/null 2>&1; then
662 _CFLAGS="${_CFLAGS} ${1}"
663 [ -n "${cc_check_silent}" ] || printf >&2 'yes\n'
666 [ -n "${cc_check_silent}" ] || printf >&2 'no\n'
671 # $1=option [$2=option argument] [$3=if set, shall NOT be added to _LDFLAGS]
672 [ -n "${cc_check_silent}" ] || printf >&2 ' . LD %s .. ' "${1}"
673 if "${CC}" ${INCS} ${_CFLAGS} ${_LDFLAGS} ${1}${2} ${EXTRA_LDFLAGS} \
674 -o ${tmp2} ${tmp}.c ${LIBS} >/dev
/null
2>&1; then
675 [ -n "${3}" ] || _LDFLAGS="${_LDFLAGS} ${1}"
676 [ -n "${cc_check_silent}" ] ||
printf >&2 'yes\n'
679 [ -n "${cc_check_silent}" ] ||
printf >&2 'no\n'
683 # Include $rc, but only take from it what wasn't overwritten by the user from
684 # within the command line or from a chosen fixed CONFIG=
685 # Note we leave alone the values
686 trap "exit 1" HUP INT TERM
687 trap "${rm} -f ${tmp}" EXIT
689 printf >&2 'Reading and preparing configuration from "%s" ... ' ${rc}
691 # We want read(1) to perform backslash escaping in order to be able to use
692 # multiline values in make.rc; the resulting sh(1)/sed(1) code was very slow in
693 # VMs (see [fa2e248]), Aharon Robbins suggested the following
694 < ${rc} ${awk} 'BEGIN{line = ""}{
695 gsub
(/^
[[:space
:]]+/, "", $0)
696 gsub
(/[[:space
:]]+$
/, "", $0)
697 if(gsub
(/\\$
/, "", $0)){
702 if(index
(line
, "#") == 1){
704 }else if(length
(line
)){
710 if [ -n "${good_shell}" ]; then
713 i=`${awk} -v LINE="${line}" 'BEGIN
{
714 gsub
(/=.
*$
/, "", LINE
)
718 if [ "${i}" = "${line}" ]; then
719 msg 'ERROR
: invalid syntax
in "%s"' "${line}"
723 eval j="\$${i}" jx="\${${i}+x}"
724 if [ -n "${j}" ] || [ "${jx}" = x ]; then
727 j=`${awk} -v LINE="${line}" 'BEGIN
{
728 gsub
(/^
[^
=]*=/, "", LINE
)
729 gsub
(/^
\"*/, "", LINE
)
730 gsub
(/\"*$
/, "", LINE
)
734 [ "${i}" = "DESTDIR" ] && continue
737 # Reread the mixed version right now
741 # We need to know about that now, in order to provide utility overwrites etc.
744 msg 'Checking
for remaining
set of utilities
'
745 check_tool grep "${grep:-`command -v grep`}"
747 # Before we step ahead with the other utilities perform a path cleanup first.
751 check_tool cat "${cat:-`command -v cat`}"
752 check_tool chmod "${chmod:-`command -v chmod`}"
753 check_tool cp "${cp:-`command -v cp`}"
754 check_tool cmp "${cmp:-`command -v cmp`}"
756 check_tool mkdir "${mkdir:-`command -v mkdir`}"
757 check_tool mv "${mv:-`command -v mv`}"
759 check_tool sed "${sed:-`command -v sed`}"
760 check_tool sort "${sort:-`command -v sort`}"
761 check_tool tee "${tee:-`command -v tee`}"
763 check_tool chown "${chown:-`command -v chown`}" 1 ||
764 check_tool chown "/sbin/chown" 1 ||
765 check_tool chown "/usr/sbin/chown"
767 check_tool make "${MAKE:-`command -v make`}"
769 check_tool strip "${STRIP:-`command -v strip`}" 1 &&
770 HAVE_STRIP=1 || HAVE_STRIP=0
772 # For ./cc-test.sh only
773 check_tool cksum "${cksum:-`command -v cksum`}"
775 # Update WANT_ options now, in order to get possible inter-dependencies right
778 # (No functions since some shells loose non-exported variables in traps)
779 trap "trap \"\" HUP INT TERM; exit 1" HUP INT TERM
780 trap "trap \"\" HUP INT TERM EXIT;\
781 ${rm} -rf ${newlst} ${tmp0}.* ${tmp0}* ${newmk} ${newev} ${newh}" EXIT
783 # Our configuration options may at this point still contain shell snippets,
784 # we need to evaluate them in order to get them expanded, and we need those
785 # evaluated values not only in our new configuration file, but also at hand..
786 printf >&2 'Evaluating all configuration items ...
'
787 ${rm} -f ${newlst} ${newmk} ${newh}
788 exec 5<&0 6>&1 <${tmp} >${newlst}
791 if [ -n "${good_shell}" ]; then
793 [ "${i}" != "${i#WANT_}" ] && z=1
795 i=`${awk} -v LINE="${line}" 'BEGIN
{
796 gsub
(/=.
*$
/, "", LINE
);\
799 if echo "${i}" | ${grep} '^WANT_
' >/dev/null 2>&1; then
805 if [ -n "${z}" ]; then
806 j="`echo ${j} | ${tr} '[A-Z
]' '[a-z
]'`"
807 if [ -z "${j}" ] || feat_val_no "${j}"; then
809 printf "/*#define ${i}*/\n" >> ${newh}
810 elif feat_val_yes "${j}"; then
811 if feat_val_require "${j}"; then
816 printf "#define ${i}\n" >> ${newh}
818 msg 'ERROR
: cannot parse
<%s
>' "${line}"
822 printf "#define ${i} \"${j}\"\n" >> ${newh}
824 printf "${i} = ${j}\n" >> ${newmk}
828 exec 0<&5 1>&6 5<&- 6<&-
831 # Add the known utility and some other variables
832 printf "#define UAGENT \"${SID}${NAIL}\"\n" >> ${newh}
833 printf "UAGENT = ${SID}${NAIL}\n" >> ${newmk}
835 printf "#define PRIVSEP \"${SID}${NAIL}-privsep\"\n" >> ${newh}
836 printf "PRIVSEP = \$(UAGENT)-privsep\n" >> ${newmk}
837 if feat_yes DOTLOCK; then
838 printf "OPTIONAL_PRIVSEP = \$(PRIVSEP)\n" >> ${newmk}
840 printf "OPTIONAL_PRIVSEP =\n" >> ${newmk}
844 awk cat chmod chown cp cmp grep mkdir mv rm sed sort tee tr \
845 MAKE MAKEFLAGS make SHELL strip \
848 printf "${i} = ${j}\n" >> ${newmk}
849 printf "${i}=${j}\n" >> ${newlst}
850 printf "${i}=\"${j}\";export ${i}; " >> ${newev}
852 printf "\n" >> ${newev}
854 # Build a basic set of INCS and LIBS according to user environment.
855 path_check C_INCLUDE_PATH -I _INCS
856 INCS="${INCS} ${_INCS}"
857 path_check LD_LIBRARY_PATH -L _LIBS
858 LIBS="${LIBS} ${_LIBS}"
860 export C_INCLUDE_PATH LD_LIBRARY_PATH
862 # Some environments need runtime path flags to be able to go at all
865 ## Detect CC, wether we can use it, and possibly which CFLAGS we can use
869 ${cat} > ${tmp}.c << \!
872 static void doit(char const *s);
874 main(int argc, char **argv){
883 memcpy(buf, s, strlen(s) +1);
888 if "${CC}" ${INCS} ${CFLAGS} ${EXTRA_CFLAGS} ${LDFLAGS} ${EXTRA_LDFLAGS} \
889 -o ${tmp2} ${tmp}.c ${LIBS}; then
892 msg 'ERROR
: i cannot compile a
"Hello world" via
'
894 "${CC} ${INCS} ${CFLAGS} ${EXTRA_CFLAGS} ${LDFLAGS} ${EXTRA_LDFLAGS} ${LIBS}"
895 msg 'ERROR
: Please
read INSTALL
, rerun
'
899 # This may also update ld_runtime_flags() (again)
906 printf -- "${i}=${j}\n" >> ${newlst}
912 PATH C_INCLUDE_PATH LD_LIBRARY_PATH \
916 printf -- "${i} = ${j}\n" >> ${newmk}
917 printf -- "${i}=${j}\n" >> ${newlst}
920 # Now finally check wether we already have a configuration and if so, wether
921 # all those parameters are still the same.. or something has actually changed
922 if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
923 echo 'Configuration is up-to-date
'
925 elif [ -f ${lst} ]; then
926 echo 'Configuration has been updated..
'
927 ( eval "${MAKE} -f ./mk.mk clean" )
930 echo 'Shiny configuration..
'
933 # Time to redefine helper 1
935 ${rm} -f ${lst} ${h} ${mk}
939 ${mv} -f ${newlst} ${lst}
940 ${mv} -f ${newev} ${ev}
941 ${mv} -f ${newh} ${h}
942 ${mv} -f ${newmk} ${mk}
944 if [ -z "${VERBOSE}" ]; then
945 printf -- "ECHO_CC = @echo ' 'CC \$(@);\n" >> ${mk}
946 printf -- "ECHO_LINK = @echo ' 'LINK \$(@);\n" >> ${mk}
947 printf -- "ECHO_GEN = @echo ' 'GEN \$(@);\n" >> ${mk}
948 printf -- "ECHO_TEST = @\n" >> ${mk}
949 printf -- "ECHO_CMD = @echo ' CMD
';\n" >> ${mk}
950 printf -- "ECHO_BLOCK_BEGIN = @( \n" >> ${mk}
951 printf -- "ECHO_BLOCK_END = ) >/dev/null\n" >> ${mk}
954 ## Compile and link checking
962 # (No function since some shells loose non-exported variables in traps)
963 trap "trap \"\" HUP INT TERM;\
964 ${rm} -f ${lst} ${h} ${mk} ${lib} ${inc}; exit 1" HUP INT TERM
965 trap "trap \"\" HUP INT TERM EXIT;\
966 ${rm} -rf ${tmp0}.* ${tmp0}* ${makefile}" EXIT
968 # Time to redefine helper 2
972 printf "*** ${fmt}\\n" "${@}"
973 printf -- "${fmt}\\n" "${@}" >&5
978 printf "*** ${fmt}\\n" "${@}"
979 printf -- "${fmt}" "${@}" >&5
982 exec 5>&2 > ${log} 2>&1
984 echo "${LIBS}" > ${lib}
985 echo "${INCS}" > ${inc}
986 ${cat} > ${makefile} << \!
987 .SUFFIXES: .o .c .x .y
989 $(CC) -I./ $(XINCS) $(CFLAGS) -c $(<)
991 $(CC) -I./ $(XINCS) -E $(<) > $(@)
993 $(CC) -I./ $(XINCS) $(CFLAGS) $(LDFLAGS) -o $(@) $(<) $(XLIBS)
997 variable=$1 topic=$2 define=$3
1000 msg_nonl ' .
%s ...
' "${topic}"
1001 echo "/* checked ${topic} */" >> ${h}
1002 ${rm} -f ${tmp} ${tmp}.o
1003 echo '*** test program is
'
1004 { echo '#include <'"${h_name}"'>'; cat; } | ${tee} ${tmp}.c
1005 #echo '*** the preprocessor generates'
1006 #${make} -f ${makefile} ${tmp}.x
1008 echo '*** results are'
1012 variable
=$1 topic
=$2 define
=$3
1014 _check_preface
"${variable}" "${topic}" "${define}"
1016 if ${make} -f ${makefile} XINCS="${INCS}" ./${tmp}.o
&&
1017 [ -f .
/${tmp}.o
]; then
1019 echo "${define}" >> ${h}
1020 eval have_
${variable}=yes
1023 echo "/* ${define} */" >> ${h}
1025 eval unset have_
${variable}
1031 run
=$1 variable
=$2 topic
=$3 define
=$4 libs
=$5 incs
=$6
1033 _check_preface
"${variable}" "${topic}" "${define}"
1035 feat_yes CROSS_BUILD
&& run
=0
1037 if ${make} -f ${makefile} XINCS="${INCS} ${incs}" \
1038 XLIBS="${LIBS} ${libs}" ./${tmp} &&
1040 { [ ${run} -eq 0 ] || ./${tmp}; }; then
1041 echo "*** adding INCS<${incs}> LIBS<${libs}>; executed: ${run}"
1043 echo "${define}" >> ${h}
1044 LIBS
="${LIBS} ${libs}"
1045 echo "${libs}" >> ${lib}
1046 INCS
="${INCS} ${incs}"
1047 echo "${incs}" >> ${inc}
1048 eval have_
${variable}=yes
1052 echo "/* ${define} */" >> ${h}
1053 eval unset have_
${variable}
1059 _link_mayrun
0 "${1}" "${2}" "${3}" "${4}" "${5}"
1063 _link_mayrun
1 "${1}" "${2}" "${3}" "${4}" "${5}"
1067 if feat_yes
${1}; then
1068 echo '#define HAVE_'${1}'' >> ${h}
1070 echo '/* WANT_'${1}'=0 */' >> ${h}
1075 < "${1}" > "${2}" ${awk} \
1076 'BEGIN {ORS = " "} /^[^#]/ {print} {next} END {ORS = ""; print "\n"}'
1081 # May be multiline..
1082 [ -n "${OS_DEFINES}" ] && printf -- "${OS_DEFINES}" >> ${h}
1084 feat_def AMALGAMATION
1085 feat_def CROSS_BUILD
1092 if run_check inline
'"inline" functions' \
1093 '#define HAVE_INLINE
1094 #define n_INLINE static inline' << \
!
1095 static inline int ilf
(int i
){return ++i
;}
1096 int main
(void
){return ilf
(-1);}
1100 elif run_check inline
'"__inline" functions' \
1101 '#define HAVE_INLINE
1102 #define n_INLINE static __inline' << \
!
1103 static __inline int ilf
(int i
){return ++i
;}
1104 int main
(void
){return ilf
(-1);}
1110 if run_check endian
'Little endian byteorder' \
1111 '#define HAVE_BYTE_ORDER_LITTLE' << \
!
1113 enum
{vBig
= 1, vLittle
= 0};
1114 union
{unsigned short bom
; unsigned char buf
[2];} u
;
1116 return((u.buf
[1] == 0xFE) ? vLittle
: vBig
);
1123 ## Test for "basic" system-calls / functionality that is used by all parts
1124 ## of our program. Once this is done fork away BASE_LIBS and other BASE_*
1125 ## macros to be used by only the subprograms (potentially).
1127 if run_check clock_gettime
'clock_gettime(2)' \
1128 '#define HAVE_CLOCK_GETTIME' << \
!
1134 if(!clock_gettime
(CLOCK_REALTIME
, &ts
) || errno
!= ENOSYS
)
1141 elif run_check clock_gettime
'clock_gettime(2) (via -lrt)' \
1142 '#define HAVE_CLOCK_GETTIME' '-lrt' << \
!
1148 if(!clock_gettime
(CLOCK_REALTIME
, &ts
) || errno
!= ENOSYS
)
1155 elif run_check gettimeofday
'gettimeofday(2)' \
1156 '#define HAVE_GETTIMEOFDAY' << \
!
1157 #include <stdio.h> /* For C89 NULL */
1158 #include <sys/time.h>
1163 if(!gettimeofday
(&tv
, NULL
) || errno
!= ENOSYS
)
1171 have_no_subsecond_time
=1
1174 if run_check nanosleep
'nanosleep(2)' \
1175 '#define HAVE_NANOSLEEP' << \
!
1182 ts.tv_nsec
= 100000;
1183 if(!nanosleep
(&ts
, NULL
) || errno
!= ENOSYS
)
1190 elif run_check nanosleep
'nanosleep(2) (via -lrt)' \
1191 '#define HAVE_NANOSLEEP' '-lrt' << \
!
1198 ts.tv_nsec
= 100000;
1199 if(!nanosleep
(&ts
, NULL
) || errno
!= ENOSYS
)
1206 # link_check is enough for this, that function is so old, trust the proto
1207 elif link_check
sleep 'sleep(3)' \
1208 '#define HAVE_SLEEP' << \
!
1212 if(!sleep(1) || errno
!= ENOSYS
)
1220 msg
'ERROR: we require one of nanosleep(2) and sleep(3).'
1224 if run_check userdb
'gete?[gu]id(2), getpwuid(3), getpwnam(3)' << \
!
1233 if((gid
= getgid
()) != 0)
1235 if((uid
= getuid
()) != 0)
1237 if((pw
= getpwuid
(uid
)) == NULL
&& errno
== ENOSYS
)
1239 if((pw
= getpwnam
("root")) == NULL
&& errno
== ENOSYS
)
1247 msg
'ERROR: we require user and group info / database searches.'
1248 msg
'That much Unix we indulge ourselfs.'
1252 if run_check sa_restart
'SA_RESTART (for sigaction(2))' << \
!
1256 struct sigaction nact
, oact
;
1258 nact.sa_handler
= SIG_DFL
;
1259 sigemptyset
(&nact.sa_mask
);
1260 nact.sa_flags
= SA_RESTART
;
1261 return !(!sigaction
(SIGCHLD
, &nact
, &oact
) || errno
!= ENOSYS
);
1267 msg
'ERROR: we (yet) require the SA_RESTART flag for sigaction(2).'
1271 if link_check snprintf
'snprintf(3)' << \
!
1276 snprintf
(b
, sizeof b
, "%s", "string");
1283 msg
'ERROR: we require the snprintf(3) function.'
1287 if link_check environ
'environ(3)' << \
!
1288 #include <stdio.h> /* For C89 NULL */
1290 extern char
**environ
;
1292 return environ
[0] == NULL
;
1298 msg
'ERROR: we require the environ(3) array for subprocess control.'
1302 if link_check setenv
'(un)?setenv(3)' '#define HAVE_SETENV' << \
!
1305 setenv
("s-mailx", "i want to see it cute!", 1);
1306 unsetenv
("s-mailx");
1312 elif link_check setenv
'putenv(3)' '#define HAVE_PUTENV' << \
!
1315 putenv
("s-mailx=i want to see it cute!");
1322 msg
'ERROR: we require either the setenv(3) or putenv(3) functions.'
1326 if link_check termios
'termios.h and tc*(3) family' << \
!
1327 #include <termios.h>
1329 struct termios tios
;
1331 tcgetattr
(0, &tios
);
1332 tcsetattr
(0, TCSADRAIN | TCSAFLUSH
, &tios
);
1339 msg
'ERROR: we require termios.h and the tc*() family of functions.'
1340 msg
'That much Unix we indulge ourselfs.'
1346 if link_check vsnprintf
'vsnprintf(3)' << \
!
1349 static void dome
(char
*buf
, size_t blen
, ...
){
1353 vsnprintf
(buf
, blen
, "%s", ap
);
1359 dome
(b
, sizeof b
, "string");
1366 feat_bail_required ERRORS
1369 if [ "${have_vsnprintf}" = yes ]; then
1370 link_check va_copy
'va_copy(3)' '#define HAVE_VA_COPY' << \
!
1373 static void dome2
(char
*buf
, size_t blen
, va_list src
){
1377 vsnprintf
(buf
, blen
, "%s", ap
);
1380 static void dome
(char
*buf
, size_t blen
, ...
){
1384 dome2
(buf
, blen
, ap
)
1390 dome
(b
, sizeof b
, "string");
1396 run_check pathconf
'f?pathconf(2)' '#define HAVE_PATHCONF' << \
!
1403 rv |
= !(pathconf
(".", _PC_NAME_MAX
) >= 0 || errno
== 0 || errno
!= ENOSYS
);
1405 rv |
= !(pathconf
(".", _PC_PATH_MAX
) >= 0 || errno
== 0 || errno
!= ENOSYS
);
1407 /* Only link check
*/
1408 fpathconf
(0, _PC_NAME_MAX
);
1414 run_check pipe2
'pipe2(2)' '#define HAVE_PIPE2' << \
!
1421 if(!pipe2
(fds
, O_CLOEXEC
) || errno
!= ENOSYS
)
1427 # We use this only then for now (need NOW+1)
1428 run_check utimensat
'utimensat(2)' '#define HAVE_UTIMENSAT' << \
!
1429 #include <fcntl.h> /* For AT_* */
1430 #include <sys/stat.h>
1433 struct timespec ts
[2];
1435 ts
[0].tv_nsec
= UTIME_NOW
;
1436 ts
[1].tv_nsec
= UTIME_OMIT
;
1437 if(!utimensat
(AT_FDCWD
, "", ts
, 0) || errno
!= ENOSYS
)
1445 # XXX Add POSIX check once standardized
1446 if link_check posix_random
'arc4random(3)' '#define HAVE_POSIX_RANDOM 0' << \
!
1455 elif [ -n "${have_no_subsecond_time}" ]; then
1456 msg
'ERROR: %s %s' 'without a native random' \
1457 'one of clock_gettime(2) and gettimeofday(2) is required.'
1461 link_check putc_unlocked
'putc_unlocked(3)' '#define HAVE_PUTC_UNLOCKED' <<\
!
1464 putc_unlocked
('@', stdout
);
1469 link_check fchdir
'fchdir(3)' '#define HAVE_FCHDIR' << \
!
1477 if run_check realpath
'realpath(3)' '#define HAVE_REALPATH' << \
!
1480 char x_buf
[4096], *x
= realpath
(".", x_buf
);
1482 return (x
!= NULL
) ?
0 : 1;
1486 if run_check realpath_malloc
'realpath(3) takes NULL' \
1487 '#define HAVE_REALPATH_NULL' << \
!
1490 char
*x
= realpath
(".", NULL
);
1494 return (x
!= NULL
) ?
0 : 1;
1502 ## optional and selectable
1504 if feat_no NOALLOCA
; then
1505 # Due to NetBSD PR lib/47120 it seems best not to use non-cc-builtin
1506 # versions of alloca(3) since modern compilers just can't be trusted
1507 # not to overoptimize and silently break some code
1508 run_check alloca
'__builtin_alloca()' \
1509 '#define HAVE_ALLOCA __builtin_alloca' << \
!
1510 #include <stdio.h> /* For C89 NULL */
1512 void
*vp
= __builtin_alloca
(1);
1514 return (vp
!= NULL
);
1519 if feat_yes DOTLOCK
; then
1520 if run_check readlink
'readlink(2)' << \
!
1526 if(!readlink
("here", buf
, sizeof buf
) || errno
!= ENOSYS
)
1534 feat_bail_required DOTLOCK
1538 if feat_yes DOTLOCK
; then
1539 if run_check fchown
'fchown(2)' << \
!
1543 if(!fchown
(0, 0, 0) || errno
!= ENOSYS
)
1551 feat_bail_required DOTLOCK
1555 ## Now it is the time to fork away the BASE_ series
1558 squeeze_em
${inc} ${tmp}
1560 squeeze_em
${lib} ${tmp}
1563 echo "BASE_LIBS = `${cat} ${lib}`" >> ${mk}
1564 echo "BASE_INCS
= `${cat} ${inc}`" >> ${mk}
1566 ## The remains are expected to be used only by the main MUA binary!
1568 link_check setlocale 'setlocale(3)' '#define HAVE_SETLOCALE' << \!
1571 setlocale(LC_ALL, "");
1576 if [ "${have_setlocale}" = yes ]; then
1577 link_check c90amend1 'ISO/IEC 9899:1990/Amendment 1:1995' \
1578 '#define HAVE_C90AMEND1' << \!
1584 char mbb[MB_LEN_MAX + 1];
1589 mbtowc(&wc, "x", 1);
1590 mbrtowc(&wc, "x", 1, NULL);
1592 return (mblen("\0", 1) == 0);
1596 if [ "${have_c90amend1}" = yes ]; then
1597 link_check wcwidth 'wcwidth(3)' '#define HAVE_WCWIDTH' << \!
1606 link_check nl_langinfo 'nl_langinfo(3)' '#define HAVE_NL_LANGINFO' << \!
1607 #include <langinfo.h>
1611 return (nl_langinfo(CODESET) == NULL);
1616 link_check fnmatch 'fnmatch(3)' '#define HAVE_FNMATCH' << \!
1617 #include <fnmatch.h>
1619 return (fnmatch("*", ".", FNM_PATHNAME | FNM_PERIOD) == FNM_NOMATCH);
1623 link_check dirent_d_type 'struct dirent.d_type' '#define HAVE_DIRENT_TYPE' << \!
1627 return !(de.d_type == DT_UNKNOWN ||
1628 de.d_type == DT_DIR || de.d_type == DT_LNK);
1632 ## optional and selectable
1634 if feat_yes ICONV; then
1635 ${cat} > ${tmp2}.c << \!
1636 #include <stdio.h> /* For C89 NULL */
1641 id = iconv_open("foo", "bar");
1642 iconv(id, NULL, NULL, NULL, NULL);
1647 < ${tmp2}.c link_check iconv 'iconv(3) functionality' \
1648 '#define HAVE_ICONV' ||
1649 < ${tmp2}.c link_check iconv 'iconv(3) functionality (via -liconv)' \
1650 '#define HAVE_ICONV' '-liconv' ||
1651 feat_bail_required ICONV
1653 echo '/* WANT_ICONV=0 */' >> ${h}
1656 if feat_yes SOCKETS || feat_yes SPAM_SPAMD; then
1657 ${cat} > ${tmp2}.c << \!
1658 #include <sys/types.h>
1659 #include <sys/socket.h>
1663 struct sockaddr_un soun;
1665 if(socket(AF_UNIX, SOCK_STREAM, 0) == -1 && errno == ENOSYS)
1667 if(connect(0, (struct sockaddr*)&soun, 0) == -1 && errno == ENOSYS)
1669 if(shutdown(0, SHUT_RD | SHUT_WR | SHUT_RDWR) == -1 && errno == ENOSYS)
1675 < ${tmp2}.c run_check af_unix 'AF_UNIX sockets' \
1676 '#define HAVE_UNIX_SOCKETS' ||
1677 < ${tmp2}.c run_check af_unix 'AF_UNIX sockets (via -lnsl)' \
1678 '#define HAVE_UNIX_SOCKETS' '-lnsl' ||
1679 < ${tmp2}.c run_check af_unix 'AF_UNIX sockets (via -lsocket -lnsl)' \
1680 '#define HAVE_UNIX_SOCKETS' '-lsocket -lnsl'
1683 if feat_yes SOCKETS; then
1684 ${cat} > ${tmp2}.c << \!
1686 #include <sys/types.h>
1687 #include <sys/socket.h>
1688 #include <netinet/in.h>
1693 if(socket(AF_INET, SOCK_STREAM, 0) == -1 && errno == ENOSYS)
1695 if(connect(0, &s, 0) == -1 && errno == ENOSYS)
1701 < ${tmp2}.c run_check sockets 'sockets' \
1702 '#define HAVE_SOCKETS' ||
1703 < ${tmp2}.c run_check sockets 'sockets (via -lnsl)' \
1704 '#define HAVE_SOCKETS' '-lnsl' ||
1705 < ${tmp2}.c run_check sockets 'sockets (via -lsocket -lnsl)' \
1706 '#define HAVE_SOCKETS' '-lsocket -lnsl' ||
1707 feat_bail_required SOCKETS
1709 echo '/* WANT_SOCKETS=0 */' >> ${h}
1710 fi # feat_yes SOCKETS
1712 if feat_yes SOCKETS; then
1713 link_check getaddrinfo 'getaddrinfo(3)' \
1714 '#define HAVE_GETADDRINFO' << \!
1716 #include <sys/types.h>
1717 #include <sys/socket.h>
1721 struct addrinfo a, *ap;
1724 switch((lrv = getaddrinfo("foo", "0", &a, &ap))){
1728 fprintf(stderr, "%s\n", gai_strerror(lrv));
1737 if feat_yes SOCKETS && [ -z "${have_getaddrinfo}" ]; then
1738 compile_check arpa_inet_h '<arpa/inet.h>' \
1739 '#define HAVE_ARPA_INET_H' << \!
1741 #include <sys/types.h>
1742 #include <sys/socket.h>
1744 #include <netinet/in.h>
1745 #include <arpa/inet.h>
1748 ${cat} > ${tmp2}.c << \!
1750 #include <sys/types.h>
1751 #include <sys/socket.h>
1755 #include <netinet/in.h>
1756 #ifdef HAVE_ARPA_INET_H
1757 #include <arpa/inet.h>
1760 struct sockaddr_in servaddr;
1761 unsigned short portno;
1764 struct in_addr **pptr;
1767 if((ep = getservbyname("POPPY-PORT", "tcp")) != NULL)
1768 portno = (unsigned short)ep->s_port;
1770 if((hp = gethostbyname("POPPY-HOST")) != NULL){
1771 pptr = (struct in_addr**)hp->h_addr_list;
1772 if(hp->h_addrtype != AF_INET)
1773 fprintf(stderr, "au\n");
1776 case HOST_NOT_FOUND:
1782 fprintf(stderr, "au\n");
1787 memset(&servaddr, 0, sizeof servaddr);
1788 servaddr.sin_family = AF_INET;
1789 servaddr.sin_port = htons(portno);
1790 memcpy(&servaddr.sin_addr, *pptr, sizeof(struct in_addr));
1791 fprintf(stderr, "Would connect to %s:%d ...\n",
1792 inet_ntoa(**pptr), (int)portno);
1797 < ${tmp2}.c link_check gethostbyname 'get(serv|host)byname(3)' ||
1798 < ${tmp2}.c link_check gethostbyname \
1799 'get(serv|host)byname(3) (via -nsl)' '' '-lnsl' ||
1800 < ${tmp2}.c link_check gethostbyname \
1801 'get(serv|host)byname(3) (via -lsocket -nsl)' \
1802 '' '-lsocket -lnsl' ||
1803 feat_bail_required SOCKETS
1807 run_check setsockopt 'setsockopt(2)' '#define HAVE_SETSOCKOPT' << \!
1808 #include <sys/socket.h>
1814 if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0) == -1 &&
1821 feat_yes SOCKETS && [ -n "${have_setsockopt}" ] &&
1822 link_check so_sndtimeo 'SO_SNDTIMEO' '#define HAVE_SO_SNDTIMEO' << \!
1823 #include <sys/socket.h>
1831 setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
1832 setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
1837 feat_yes SOCKETS && [ -n "${have_setsockopt}" ] &&
1838 link_check so_linger 'SO_LINGER' '#define HAVE_SO_LINGER' << \!
1839 #include <sys/socket.h>
1847 setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
1852 if feat_yes SSL; then
1853 if link_check openssl 'OpenSSL (new style *_client_method(3ssl))' \
1855 #define HAVE_OPENSSL 10100' '-lssl -lcrypto' << \!
1856 #include <openssl/ssl.h>
1857 #include <openssl/err.h>
1858 #include <openssl/x509v3.h>
1859 #include <openssl/x509.h>
1860 #include <openssl/rand.h>
1861 #ifdef OPENSSL_NO_TLS1 /* TODO only deduced from OPENSSL_NO_SSL[23]! */
1862 # error We need TLSv1.
1865 SSL_CTX *ctx = SSL_CTX_new(TLS_client_method());
1868 PEM_read_PrivateKey(0, 0, 0, 0);
1874 elif link_check openssl 'OpenSSL (old style *_client_method(3ssl))' \
1876 #define HAVE_OPENSSL 10000' '-lssl -lcrypto' << \!
1877 #include <openssl/ssl.h>
1878 #include <openssl/err.h>
1879 #include <openssl/x509v3.h>
1880 #include <openssl/x509.h>
1881 #include <openssl/rand.h>
1882 #if defined OPENSSL_NO_SSL3 &&\
1883 defined OPENSSL_NO_TLS1 /* TODO only deduced from OPENSSL_NO_SSL[23]! */
1884 # error We need one of SSLv3 and TLSv1.
1887 SSL_CTX *ctx = SSL_CTX_new(SSLv23_client_method());
1890 PEM_read_PrivateKey(0, 0, 0, 0);
1897 feat_bail_required SSL
1900 if [ "${have_openssl}" = 'yes' ]; then
1901 compile_check stack_of 'OpenSSL STACK_OF()' \
1902 '#define HAVE_OPENSSL_STACK_OF' << \!
1903 #include <stdio.h> /* For C89 NULL */
1904 #include <openssl/ssl.h>
1905 #include <openssl/err.h>
1906 #include <openssl/x509v3.h>
1907 #include <openssl/x509.h>
1908 #include <openssl/rand.h>
1910 STACK_OF(GENERAL_NAME) *gens = NULL;
1912 printf("%p", gens); /* to use it */
1917 link_check ossl_conf 'OpenSSL_modules_load_file() support' \
1918 '#define HAVE_OPENSSL_CONFIG' << \!
1919 #include <stdio.h> /* For C89 NULL */
1920 #include <openssl/conf.h>
1922 CONF_modules_load_file(NULL, NULL, CONF_MFLAGS_IGNORE_MISSING_FILE);
1923 CONF_modules_free();
1928 link_check ossl_conf_ctx 'OpenSSL SSL_CONF_CTX support' \
1929 '#define HAVE_OPENSSL_CONF_CTX' << \!
1931 #include <openssl/ssl.h>
1932 #include <openssl/err.h>
1934 #if HAVE_OPENSSL < 10100
1935 SSL_CTX *ctx = SSL_CTX_new(SSLv23_client_method());
1937 SSL_CTX *ctx = SSL_CTX_new(TLS_client_method());
1939 SSL_CONF_CTX *cctx = SSL_CONF_CTX_new();
1941 SSL_CONF_CTX_set_flags(cctx,
1942 SSL_CONF_FLAG_FILE | SSL_CONF_FLAG_CLIENT |
1943 SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_SHOW_ERRORS);
1944 SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
1945 SSL_CONF_cmd(cctx, "Protocol", "ALL");
1946 SSL_CONF_CTX_finish(cctx);
1947 SSL_CONF_CTX_free(cctx);
1953 link_check rand_egd 'OpenSSL RAND_egd(3ssl)' \
1954 '#define HAVE_OPENSSL_RAND_EGD' << \!
1955 #include <openssl/rand.h>
1957 return RAND_egd("some.where") > 0;
1961 if feat_yes SSL_ALL_ALGORITHMS; then
1962 if link_check ssl_all_algo 'OpenSSL all-algorithms support' \
1963 '#define HAVE_SSL_ALL_ALGORITHMS' << \!
1964 #include <openssl/evp.h>
1966 OpenSSL_add_all_algorithms();
1967 EVP_get_cipherbyname("two cents i never exist");
1975 feat_bail_required SSL_ALL_ALGORITHMS
1977 fi # SSL_ALL_ALGORITHMS
1979 if feat_yes MD5 && feat_no NOEXTMD5; then
1980 run_check openssl_md5 'MD5 digest in OpenSSL' \
1981 '#define HAVE_OPENSSL_MD5' << \!
1984 #include <openssl/md5.h>
1986 char const dat[] = "abrakadabrafidibus";
1987 char dig[16], hex[16 * 2];
1991 memset(dig, 0, sizeof(dig));
1992 memset(hex, 0, sizeof(hex));
1994 MD5_Update(&ctx, dat, sizeof(dat) - 1);
1995 MD5_Final(dig, &ctx);
1997 #define hexchar(n) ((n) > 9 ? (n) - 10 + 'a' : (n) + '0')
1998 for(i = 0; i < sizeof(hex) / 2; i++){
2000 hex[j] = hexchar((dig[i] & 0xf0) >> 4);
2001 hex[++j] = hexchar(dig[i] & 0x0f);
2003 return !!memcmp("6d7d0a3d949da2e96f2aa010f65d8326", hex, sizeof(hex));
2006 fi # feat_yes MD5 && feat_no NOEXTMD5
2009 echo '/* WANT_SSL=0 */' >> ${h}
2012 if feat_yes SMTP; then
2013 echo '#define HAVE_SMTP' >> ${h}
2015 echo '/* WANT_SMTP=0 */' >> ${h}
2018 if feat_yes POP3; then
2019 echo '#define HAVE_POP3' >> ${h}
2021 echo '/* WANT_POP3=0 */' >> ${h}
2024 if feat_yes GSSAPI; then
2025 ${cat} > ${tmp2}.c << \!
2026 #include <gssapi/gssapi.h>
2028 gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
2029 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
2033 ${sed} -e '1s/gssapi\///' < ${tmp2}.c > ${tmp3}.c
2035 if command -v krb5-config >/dev/null 2>&1; then
2036 i=`command -v krb5-config
`
2037 GSS_LIBS="`CFLAGS
= ${i} --libs gssapi
`"
2038 GSS_INCS="`CFLAGS
= ${i} --cflags`"
2039 i='GSS-API via krb5-config(1)'
2043 i='GSS-API in gssapi/gssapi.h, libgssapi'
2045 if < ${tmp2}.c link_check gss \
2046 "${i}" '#define HAVE_GSSAPI' "${GSS_LIBS}" "${GSS_INCS}" ||\
2047 < ${tmp3}.c link_check gss \
2048 'GSS-API in gssapi.h, libgssapi' \
2049 '#define HAVE_GSSAPI
2050 #define GSSAPI_REG_INCLUDE' \
2052 < ${tmp2}.c link_check gss 'GSS-API in libgssapi_krb5' \
2053 '#define HAVE_GSSAPI' \
2055 < ${tmp3}.c link_check gss \
2056 'GSS-API in libgssapi, OpenBSD-style (pre 5.3)' \
2057 '#define HAVE_GSSAPI
2058 #define GSS_REG_INCLUDE' \
2059 '-lgssapi -lkrb5 -lcrypto' \
2060 '-I/usr/include/kerberosV' ||\
2061 < ${tmp2}.c link_check gss 'GSS-API in libgss' \
2062 '#define HAVE_GSSAPI' \
2064 link_check gss 'GSS-API in libgssapi_krb5, old-style' \
2065 '#define HAVE_GSSAPI
2066 #define GSSAPI_OLD_STYLE' \
2067 '-lgssapi_krb5' << \!
2068 #include <gssapi/gssapi.h>
2069 #include <gssapi/gssapi_generic.h>
2071 gss_import_name(0, 0, gss_nt_service_name, 0);
2072 gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
2079 feat_bail_required GSSAPI
2082 echo '/* WANT_GSSAPI=0 */' >> ${h}
2083 fi # feat_yes GSSAPI
2085 if feat_yes NETRC; then
2086 echo '#define HAVE_NETRC' >> ${h}
2088 echo '/* WANT_NETRC=0 */' >> ${h}
2091 if feat_yes AGENT; then
2092 echo '#define HAVE_AGENT' >> ${h}
2094 echo '/* WANT_AGENT=0 */' >> ${h}
2097 if feat_yes IDNA; then
2098 if link_check idna 'GNU Libidn' '#define HAVE_IDNA HAVE_IDNA_LIBIDNA' \
2101 #include <idn-free.h>
2102 #include <stringprep.h>
2104 char *utf8, *idna_ascii, *idna_utf8;
2106 utf8 = stringprep_locale_to_utf8("does.this.work");
2107 if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
2110 idn_free(idna_ascii);
2111 /* (Rather link check only here) */
2112 idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
2118 elif link_check idna 'idnkit' '#define HAVE_IDNA HAVE_IDNA_IDNKIT' \
2121 #include <idn/api.h>
2122 #include <idn/result.h>
2126 char local_name[256];
2128 r = idn_encodename(IDN_ENCODE_APP, "does.this.work", ace_name,
2130 if (r != idn_success) {
2131 fprintf(stderr, "idn_encodename failed: %s\n", idn_result_tostring(r));
2134 r = idn_decodename(IDN_DECODE_APP, ace_name, local_name, sizeof(local_name));
2135 if (r != idn_success) {
2136 fprintf(stderr, "idn_decodename failed: %s\n", idn_result_tostring(r));
2145 feat_bail_required IDNA
2148 if [ -n "${have_idna}" ]; then
2149 echo '#define HAVE_IDNA_LIBIDNA 0' >> ${h}
2150 echo '#define HAVE_IDNA_IDNKIT 1' >> ${h}
2153 echo '/* WANT_IDNA=0 */' >> ${h}
2156 if feat_yes IMAP_SEARCH; then
2157 echo '#define HAVE_IMAP_SEARCH' >> ${h}
2159 echo '/* WANT_IMAP_SEARCH=0 */' >> ${h}
2162 if feat_yes REGEX; then
2163 if link_check regex 'regular expressions' '#define HAVE_REGEX' << \!
2170 if (regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0)
2172 status = regexec(&re, "plan9", 0,NULL, 0);
2174 return !(status == REG_NOMATCH);
2180 feat_bail_required REGEX
2183 echo '/* WANT_REGEX=0 */' >> ${h}
2186 if feat_yes READLINE; then
2188 link_check readline "for readline(3) (${1})" \
2189 '#define HAVE_READLINE' "${1}" << \!
2191 #include <readline/history.h>
2192 #include <readline/readline.h>
2201 stifle_history(242);
2202 rl = readline("Enter a line:");
2206 rl_extend_line_buffer(10);
2207 rl_point = rl_end = 10;
2208 rl_pre_input_hook = (rl_hook_func_t*)NULL;
2209 rl_forced_update_display();
2211 hs = history_get_history_state();
2213 he = history_list();
2216 rl_free_line_state();
2217 rl_cleanup_after_signal();
2218 rl_reset_after_signal();
2224 __edrdlib -lreadline ||
2225 __edrdlib '-lreadline -ltermcap' || feat_bail_required READLINE
2228 if feat_yes MLE && [ -z "${have_readline}" ] &&
2229 [ -n "${have_c90amend1}" ]; then
2231 echo '#define HAVE_MLE' >> ${h}
2233 feat_bail_required MLE
2234 echo '/* WANT_{READLINE,MLE}=0 */' >> ${h}
2237 # Generic have-a-line-editor switch for those who need it below
2238 if [ -n "${have_mle}" ] ||
2239 [ -n "${have_readline}" ]; then
2243 if [ -n "${have_cle}" ] && feat_yes HISTORY; then
2244 echo '#define HAVE_HISTORY' >> ${h}
2246 echo '/* WANT_HISTORY=0 */' >> ${h}
2249 if [ -n "${have_mle}" ] && feat_yes KEY_BINDINGS; then
2250 echo '#define HAVE_KEY_BINDINGS' >> ${h}
2252 echo '/* WANT_KEY_BINDINGS=0 */' >> ${h}
2255 if feat_yes TERMCAP; then
2257 link_check termcap "termcap(5) (via ${4})" \
2258 "#define HAVE_TERMCAP${3}" "${1}" << _EOT
2263 #define UNCONST(P) ((void*)(unsigned long)(void const*)(P))
2264 static int my_putc(int c){return putchar(c);}
2266 char buf[1024+512], cmdbuf[2048], *cpb, *r1;
2267 int r2 = OK, r3 = ERR;
2269 tgetent(buf, getenv("TERM"));
2271 r1 = tgetstr(UNCONST("cm"), &cpb);
2273 r2 = tgetnum(UNCONST("Co"));
2274 r3 = tgetflag(UNCONST("ut"));
2275 tputs("cr", 1, &my_putc);
2276 return (r1 == NULL || r2 == -1 || r3 == 0);
2282 link_check terminfo "terminfo(5) (via ${2})" \
2283 '#define HAVE_TERMCAP
2284 #define HAVE_TERMCAP_CURSES
2285 #define HAVE_TERMINFO' "${1}" << _EOT
2289 #define UNCONST(P) ((void*)(unsigned long)(void const*)(P))
2290 static int my_putc(int c){return putchar(c);}
2296 r0 = setupterm(NULL, 1, &er);
2297 r1 = tigetflag(UNCONST("bce"));
2298 r2 = tigetnum(UNCONST("colors"));
2299 r3 = tigetstr(UNCONST("cr"));
2300 tp = tparm(r3, NULL);
2301 tputs(tp, 1, &my_putc);
2302 return (r0 == ERR || r1 == -1 || r2 == -2 || r2 == -1 ||
2303 r3 == (char*)-1 || r3 == NULL);
2308 if feat_yes TERMCAP_PREFER_TERMINFO; then
2309 __terminfolib -ltinfo -ltinfo ||
2310 __terminfolib -lcurses -lcurses ||
2311 __terminfolib -lcursesw -lcursesw ||
2312 feat_bail_required TERMCAP_PREFER_TERMINFO
2315 if [ -z "${have_terminfo}" ]; then
2316 __termcaplib -ltermcap '' '' '-ltermcap' ||
2317 __termcaplib -ltermcap '#include <curses.h>' '
2318 #define HAVE_TERMCAP_CURSES' \
2319 'curses.h / -ltermcap' ||
2320 __termcaplib -lcurses '#include <curses.h>' '
2321 #define HAVE_TERMCAP_CURSES' \
2322 'curses.h / -lcurses' ||
2323 __termcaplib -lcursesw '#include <curses.h>' '
2324 #define HAVE_TERMCAP_CURSES' \
2325 'curses.h / -lcursesw' ||
2326 feat_bail_required TERMCAP
2328 if [ -n "${have_termcap}" ]; then
2329 run_check tgetent_null \
2330 "tgetent(3) of termcap(5) takes NULL buffer" \
2331 "#define HAVE_TGETENT_NULL_BUF" << _EOT
2332 #include <stdio.h> /* For C89 NULL */
2334 #ifdef HAVE_TERMCAP_CURSES
2335 # include <curses.h>
2339 tgetent(NULL, getenv("TERM"));
2346 echo '/* WANT_TERMCAP=0 */' >> ${h}
2347 echo '/* WANT_TERMCAP_PREFER_TERMINFO=0 */' >> ${h}
2350 if feat_yes SPAM_SPAMC; then
2351 echo '#define HAVE_SPAM_SPAMC' >> ${h}
2352 if command -v spamc >/dev/null 2>&1; then
2353 echo "#define SPAM_SPAMC_PATH \"`command -v spamc
`\"" >> ${h}
2356 echo '/* WANT_SPAM_SPAMC=0 */' >> ${h}
2359 if feat_yes SPAM_SPAMD && [ -n "${have_af_unix}" ]; then
2360 echo '#define HAVE_SPAM_SPAMD' >> ${h}
2362 feat_bail_required SPAM_SPAMD
2363 echo '/* WANT_SPAM_SPAMD=0 */' >> ${h}
2366 feat_def SPAM_FILTER
2368 if feat_yes SPAM_SPAMC || feat_yes SPAM_SPAMD || feat_yes SPAM_FILTER; then
2369 echo '#define HAVE_SPAM' >> ${h}
2371 echo '/* HAVE_SPAM */' >> ${h}
2374 if feat_yes QUOTE_FOLD &&\
2375 [ -n "${have_c90amend1}" ] && [ -n "${have_wcwidth}" ]; then
2376 echo '#define HAVE_QUOTE_FOLD' >> ${h}
2378 echo '/* WANT_QUOTE_FOLD=0 */' >> ${h}
2381 feat_def FILTER_HTML_TAGSOUP
2390 squeeze_em ${inc} ${tmp}
2392 squeeze_em ${lib} ${tmp}
2397 printf '#ifndef n_CONFIG_H\n# define n_CONFIG_H 1\n' > ${h}
2398 ${cat} ${tmp} >> ${h}
2401 printf '\n/* The "feature string" */\n' >> ${h}
2402 printf '# if defined _ACCMACVAR_SOURCE || defined HAVE_AMALGAMATION\n' >> ${h}
2403 printf 'static char const _features[] = "MIME"\n' >> ${h}
2404 printf '# ifdef HAVE_SETLOCALE\n ",LOCALES"\n# endif\n' >> ${h}
2405 printf '# ifdef HAVE_C90AMEND1\n ",MULTIBYTE CHARSETS"\n# endif\n' >> ${h}
2406 printf '# ifdef HAVE_NL_LANGINFO\n ",TERMINAL CHARSET"\n# endif\n' >> ${h}
2407 printf '# ifdef HAVE_ICONV\n ",ICONV"\n# endif\n' >> ${h}
2408 printf '# ifdef HAVE_SOCKETS\n ",NETWORK"\n# endif\n' >> ${h}
2409 printf '# ifdef HAVE_SSL\n ",S/MIME,SSL/TLS"\n# endif\n' >> ${h}
2410 printf '# ifdef HAVE_SSL_ALL_ALGORITHMS\n ",SSL-ALL-ALGORITHMS"\n# endif\n'\
2412 printf '# ifdef HAVE_SMTP\n ",SMTP"\n# endif\n' >> ${h}
2413 printf '# ifdef HAVE_POP3\n ",POP3"\n# endif\n' >> ${h}
2414 printf '# ifdef HAVE_GSSAPI\n ",GSS-API"\n# endif\n' >> ${h}
2415 printf '# ifdef HAVE_MD5\n ",MD5 [APOP,CRAM-MD5]"\n# endif\n' >> ${h}
2416 printf '# ifdef HAVE_NETRC\n ",NETRC"\n# endif\n' >> ${h}
2417 printf '# ifdef HAVE_IDNA\n ",IDNA"\n# endif\n' >> ${h}
2418 printf '# ifdef HAVE_IMAP_SEARCH\n ",IMAP-SEARCH"\n# endif\n' >> ${h}
2419 printf '# ifdef HAVE_REGEX\n ",REGEX"\n# endif\n' >> ${h}
2420 printf '# ifdef HAVE_READLINE\n ",READLINE"\n# endif\n' >> ${h}
2421 printf '# ifdef HAVE_MLE\n ",MLE"\n# endif\n' >> ${h}
2422 printf '# ifdef HAVE_WCWIDTH\n " (WIDE GLYPHS)"\n# endif\n' >> ${h}
2423 printf '# ifdef HAVE_HISTORY\n ",HISTORY"\n# endif\n' >> ${h}
2424 printf '# ifdef HAVE_KEY_BINDINGS\n ",KEY-BINDINGS"\n# endif\n' >> ${h}
2425 printf '# ifdef HAVE_TERMCAP\n ",TERMCAP"\n# endif\n' >> ${h}
2426 printf '# ifdef HAVE_TERMINFO\n " (terminfo(5))"\n# endif\n' >> ${h}
2427 printf '# ifdef HAVE_SPAM_SPAMC\n ",SPAMC"\n# endif\n' >> ${h}
2428 printf '# ifdef HAVE_SPAM_SPAMD\n ",SPAMD"\n# endif\n' >> ${h}
2429 printf '# ifdef HAVE_SPAM_FILTER\n ",SPAMFILTER"\n# endif\n' >> ${h}
2430 printf '# ifdef HAVE_DOCSTRINGS\n ",DOCSTRINGS"\n# endif\n' >> ${h}
2431 printf '# ifdef HAVE_QUOTE_FOLD\n ",QUOTE-FOLD"\n# endif\n' >> ${h}
2432 printf '# ifdef HAVE_FILTER_HTML_TAGSOUP\n ",HTML-FILTER"\n# endif\n' >> ${h}
2433 printf '# ifdef HAVE_COLOUR\n ",COLOUR"\n# endif\n' >> ${h}
2434 printf '# ifdef HAVE_DOTLOCK\n ",DOTLOCK-FILES"\n# endif\n' >> ${h}
2435 printf '# ifdef HAVE_DEBUG\n ",DEBUG"\n# endif\n' >> ${h}
2436 printf '# ifdef HAVE_DEVEL\n ",DEVEL"\n# endif\n' >> ${h}
2437 printf '# ifdef HAVE_CROSS_BUILD\n ",CROSS-BUILD"\n# endif\n' >> ${h}
2438 printf ';\n# endif /* _ACCMACVAR_SOURCE || HAVE_AMALGAMATION */\n' >> ${h}
2440 # Create the real mk.mk
2441 # Note we cannout use explicit ./ filename prefix for source and object
2442 # pathnames because of a bug in bmake(1)
2443 ${rm} -rf ${tmp0}.* ${tmp0}*
2444 printf 'OBJ_SRC = ' >> ${mk}
2445 if feat_no AMALGAMATION; then
2446 for i in `printf '%s\n' *.c |
${sort}`; do
2447 if [ "${i}" = privsep.c ]; then
2450 printf "${i} " >> ${mk}
2452 printf '\nAMALGAM_TARGET =\nAMALGAM_DEP =\n' >> ${mk}
2454 printf 'main.c\nAMALGAM_TARGET = main.o\nAMALGAM_DEP = ' >> ${mk}
2456 printf '\n/* HAVE_AMALGAMATION: include sources */\n' >> ${h}
2457 printf '#elif _CONFIG_H + 0 == 1\n' >> ${h}
2458 printf '# undef _CONFIG_H\n' >> ${h}
2459 printf '# define _CONFIG_H 2\n' >> ${h}
2460 for i in `printf '%s\n' *.c |
${sort}`; do
2461 if [ "${i}" = "${j}" ] || [ "${i}" = main.c ] || \
2462 [ "${i}" = privsep.c ]; then
2465 printf "${i} " >> ${mk}
2466 printf "# include \"${i}\"\n" >> ${h}
2469 # tcc(1) fails on 2015-11-13 unless this #else clause existed
2470 echo '#else' >> ${h}
2473 printf '#endif /* n_CONFIG_H */\n' >> ${h}
2475 echo "LIBS = `${cat} ${lib}`" >> ${mk}
2476 echo "INCS = `${cat} ${inc}`" >> ${mk}
2478 ${cat} ./mk-mk.in >> ${mk}
2482 ${cat} > ${tmp2}.c << \!
2485 :The following optional features are enabled:
2486 #ifdef HAVE_SETLOCALE
2487 : + Locale support: Printable characters depend on the environment
2488 # ifdef HAVE_C90AMEND1
2489 : + Multibyte character support
2491 # ifdef HAVE_NL_LANGINFO
2492 : + Automatic detection of terminal character set
2496 : + Character set conversion using iconv()
2502 # ifdef HAVE_OPENSSL
2503 : + S/MIME and SSL/TLS (OpenSSL)
2505 # ifdef HAVE_SSL_ALL_ALGORITHMS
2506 : + + Support for more ("all
") digest and cipher algorithms
2516 : + GSS-API authentication
2519 : + MD5 message digest (APOP, CRAM-MD5)
2522 : + .netrc file support
2525 : + IDNA (internationalized domain names for applications) support
2527 #ifdef HAVE_IMAP_SEARCH
2528 : + IMAP-style search expressions
2531 : + Regular expression support (searches, conditional expressions etc.)
2533 #if defined HAVE_READLINE || defined HAVE_MLE
2534 # ifdef HAVE_READLINE
2535 : + Command line editing via readline(3)
2537 # ifdef HAVE_WCWIDTH
2538 : + Command line editing via M(ailx)-L(ine)-E(ditor) (wide glyph support)
2540 : + Command line editing via M(ailx)-L(ine)-E(ditor) (no wide glyph support)
2543 # ifdef HAVE_HISTORY
2544 : + + History management
2546 # ifdef HAVE_KEY_BINDINGS
2547 : + + Configurable key bindings
2551 # ifdef HAVE_TERMINFO
2552 : + Terminal capability queries (terminfo(5))
2554 : + Terminal capability queries (termcap(5))
2559 # ifdef HAVE_SPAM_SPAMC
2560 : + + Via spamc(1) (of spamassassin(1))
2562 # ifdef HAVE_SPAM_SPAMD
2563 : + + Directly via spamd(1) (of spamassassin(1))
2565 # ifdef HAVE_SPAM_FILTER
2566 : + + Via freely configurable *spam-filter-XY*s
2569 #ifdef HAVE_DOCSTRINGS
2570 : + Documentation summary strings
2572 #ifdef HAVE_QUOTE_FOLD
2573 : + Extended *quote-fold*ing
2575 #ifdef HAVE_FILTER_HTML_TAGSOUP
2576 : + Builtin HTML-to-text filter (for display purposes, primitive)
2579 : + Coloured message display (simple)
2582 : + Dotlock files and privilege-separated file dotlock program
2585 :The following optional features are disabled:
2586 #ifndef HAVE_SETLOCALE
2587 : - Locale support: Only ASCII characters are recognized
2589 # ifndef HAVE_C90AMEND1
2590 : - Multibyte character support
2592 # ifndef HAVE_NL_LANGINFO
2593 : - Automatic detection of terminal character set
2596 : - Character set conversion using iconv()
2597 : _ (Ooooh, no iconv(3), NO character set conversion possible! Really...)
2599 #ifndef HAVE_SOCKETS
2603 : - S/MIME and SSL/TLS
2605 # ifndef HAVE_SSL_ALL_ALGORITHMS
2606 : - Support for more S/MIME and SSL/TLS digest and cipher algorithms
2616 : - GSS-API authentication
2619 : - MD5 message digest (APOP, CRAM-MD5)
2622 : - .netrc file support
2625 : - IDNA (internationalized domain names for applications) support
2627 #ifndef HAVE_IMAP_SEARCH
2628 : - IMAP-style search expressions
2631 : - Regular expression support
2633 #if !defined HAVE_READLINE && !defined HAVE_MLE
2634 : - Command line editing and history
2636 # ifndef HAVE_HISTORY
2637 : + (Command line editing) - History management
2639 # ifndef HAVE_KEY_BINDINGS
2640 : + (Command line editing) - Configurable key bindings
2643 #ifndef HAVE_TERMCAP
2644 : - Terminal capability queries
2649 #ifndef HAVE_DOCSTRINGS
2650 : - Documentation summary strings
2652 #ifndef HAVE_QUOTE_FOLD
2653 : - Extended *quote-fold*ing
2655 #ifndef HAVE_FILTER_HTML_TAGSOUP
2656 : - Builtin HTML-to-text filter (for display purposes, primitive)
2659 : - Coloured message display (simple)
2661 #ifndef HAVE_DOTLOCK
2662 : - Dotlock files and privilege-separated file dotlock program
2665 #if !defined HAVE_FNMATCH || !defined HAVE_FCHDIR ||\
2666 defined HAVE_DEBUG || defined HAVE_DEVEL
2668 # ifndef HAVE_FNMATCH
2669 : . The function fnmatch(3) could not be found.
2670 : _ Filename patterns like wildcard are not supported on your system.
2672 # ifndef HAVE_FCHDIR
2673 : . The function fchdir(2) could not be found. We will use chdir(2)
2674 : _ instead. This is not a problem unless the current working
2675 : _ directory is changed while this program is inside of it.
2678 : . Debug enabled binary: not meant to be used by end-users: THANKS!
2681 : . Computers do not blunder.
2684 #endif /* Remarks */
2686 : . System-wide resource file: SYSCONFDIR/SYSCONFRC
2689 : . libexecdir: LIBEXECDIR
2692 : . sendmail(1): VAL_SENDMAIL (argv[0] = VAL_SENDMAIL_PROGNAME)
2693 : . Mail spool directory: MAILSPOOL
2697 ${make} -f ${makefile} ${tmp2}.x
2698 < ${tmp2}.x ${sed} -e '/^[^:]/d; /^$/d; s/^://' |