2 dnl configure.in -- autoconf template for nmh
7 dnl 2.13 definitely chokes; 2.53 is the earliest version I've tested.
8 dnl 2.50 is the major breakpoint between the old autoconf and the new,
9 dnl so require that. If there are bug reports about 2.50-2.52 not working
10 dnl we can always move this up a little.
14 AC_CONFIG_HEADER(config.h)
18 dnl ---------------------
19 dnl define a macro or two
20 dnl ---------------------
22 AC_DEFUN(NMH_PROG_GNU_LIBTOOL, [
23 if test -n "$LIBTOOL" ; then
24 tmptest=`$LIBTOOL --version 2>&1 | grep GNU`
25 if test x"$tmptest" != x ; then
27 AC_SUBST(GNU_LIBTOOL)dnl
33 dnl What version of nmh are we building?
34 VERSION=`sed -e 's/nmh-//' ${srcdir}/VERSION`
35 echo "configuring for nmh-$VERSION"
38 dnl What date of nmh are we building?
39 DATE=`cat ${srcdir}/DATE`
40 echo "configuring for nmh dated $DATE"
43 dnl --------------------------
44 dnl CHECK COMMAND LINE OPTIONS
45 dnl --------------------------
47 dnl Do you want client-side support for apop?
49 [ --enable-apop enable client-side support for POP3 and APOP])
50 if test x"$enable_apop" = x"yes"; then
57 dnl Do you want to debug nmh?
59 [ --enable-debug enable nmh code debugging])
60 dnl The old redundant --enable-nmh-debug is deprecated and undocumented.
61 if test x"$enable_nmh_debug" = x"yes"; then
65 dnl Allow users to send email from addresses other than their default?
66 AC_ARG_ENABLE(masquerade,
67 [ --enable-masquerade[='draft_from mmailid username_extension']
68 enable up to 3 types of address masquerading [none]],
69 [if test x"$enable_masquerade" = x"yes"; then
70 masquerade="draft_from mmailid username_extension"
72 masquerade="$enable_masquerade"
74 AC_SUBST(masquerade)dnl
76 dnl Do you want mhe support?
78 [ --enable-mhe enable mhe support (DEFAULT)])
80 dnl mhe support is on by default, so define it unless --disable-mhe or the
81 dnl deprecated, undocumented --disable-nmh-mhe are specified.
82 if test x"$enable_mhe" != x"no" -a x"$enable_nmh_mhe" != x"no"; then
86 dnl Do you want client-side support for pop?
88 [ --enable-pop enable client-side support for plain POP3])
89 dnl The old redundant --enable-nmh-pop is deprecated and undocumented.
90 if test x"$enable_nmh_pop" = x"yes"; then
94 dnl Do you want client-side support for using SASL for authentication?
95 dnl Note that this code will be enabled for both POP and SMTP
96 AC_ARG_WITH(cyrus-sasl,
97 [ --with-cyrus-sasl=<dir> Specify location of Cyrus SASL library for auth])
98 if test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != x"no"; then
99 AC_DEFINE(CYRUS_SASL)dnl
105 dnl What should be the default editor?
107 [ --with-editor=EDITOR specify the default editor])
109 if test -n "$with_editor"; then
110 editorpath="$with_editor"
113 dnl Set the backup prefix
114 AC_ARG_WITH([hash-backup],
115 [ --with-hash-backup use # as the backup prefix (default: ,)])
116 if test x"$with_hash_backup" != x -a x"$with_hash_backup" != x"no"; then
121 AC_DEFINE_UNQUOTED(BACKUP_PREFIX, "$backup_prefix")dnl
123 dnl Do you want support for hesiod
125 [ --with-hesiod=PREFIX specify location of Hesiod])
126 if test x"$with_hesiod" != x -a x"$with_hesiod" != x"no"; then
130 dnl Do you want client-side support for kpop
132 [ --with-krb4=PREFIX specify location of Kerberos V4 for KPOP support])
133 if test x"$with_krb4" != x -a x"$with_krb4" != x"no"; then
136 AC_DEFINE(KPOP_PRINCIPAL, "pop")dnl
139 dnl After we know if we're including apop and kpop support, do pop stuff
140 if test x"$enable_pop" = x"yes"; then
143 POPSED='/^%nmhbeginpop%/d;/^%nmhendpop%/d'
145 POPSED='/^%nmhbeginpop%/,/^%nmhendpop%/d'
150 dnl What method of locking to use?
152 [ --with-locking=LOCKTYPE specify the file locking method
153 (one of dot, fcntl, flock, lockf)])
155 if test x"$with_locking" = x"dot"; then
157 AC_DEFINE(DOT_LOCKING)dnl
158 elif test x"$with_locking" = x"flock"; then
160 AC_DEFINE(FLOCK_LOCKING)dnl
161 elif test x"$with_locking" = x"lockf"; then
163 AC_DEFINE(LOCKF_LOCKING)dnl
164 elif test x"$with_locking" = x"fcntl"; then
166 AC_DEFINE(FCNTL_LOCKING)dnl
169 AC_DEFINE(DOT_LOCKING)dnl
172 dnl What method of posting should post use?
174 [ --with-mts=MTS specify the default mail transport agent/service])
176 if test x"$with_mts" = x"smtp"; then
178 elif test x"$with_mts" = x"sendmail"; then
185 dnl Both the smtp and sendmail mail transport services use the smtp code
186 AC_DEFINE(SMTPMTS)dnl
188 dnl What should be the default pager?
190 [ --with-pager=PAGER specify the default pager])
192 if test -n "$with_pager"; then
193 pagerpath="$with_pager"
196 dnl What should be the default mail server(s)?
197 AC_ARG_WITH(smtpservers,
198 [ --with-smtpservers='SMTPSERVER1[ SMTPSERVER2...]'
199 specify the default SMTP server(s) [localhost]])
200 if test -n "$with_smtpservers"; then
201 smtpservers="$with_smtpservers"
203 smtpservers="localhost"
205 AC_SUBST(smtpservers)dnl
207 dnl ----------------------------------------------------
208 dnl Default location is /usr/local/nmh/{bin,etc,lib,man}
209 dnl ----------------------------------------------------
210 AC_PREFIX_DEFAULT(/usr/local/nmh)
212 dnl ------------------
213 dnl CHECK THE COMPILER
214 dnl ------------------
215 dnl We want these before the checks,
216 dnl so the checks can modify their values.
217 test -z "$CFLAGS" && CFLAGS= auto_cflags=1
218 if test x"$enable_debug" = x"yes"; then
219 test -z "$LDFLAGS" && LDFLAGS=-g
224 dnl if the user hasn't specified CFLAGS, then
225 dnl if compiler is gcc, then
226 dnl use -O2 and some warning flags
228 if test -n "$auto_cflags"; then
229 if test x"$enable_debug" = x"yes"; then
230 if test -n "$GCC"; then
231 test -z "$CFLAGS" && CFLAGS="-Wall -g" || CFLAGS="$CFLAGS -Wall -g"
233 test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g"
236 if test -z "$LDFLAGS"; then
246 if test -n "$GCC"; then
247 test -z "$CFLAGS" && CFLAGS="-Wall -O2" || CFLAGS="$CFLAGS -Wall -O2"
249 test -z "$CFLAGS" && CFLAGS=-O || CFLAGS="$CFLAGS -O"
254 AC_C_CONST dnl Does compiler support `const'.
256 dnl ------------------
257 dnl CHECK FOR PROGRAMS
258 dnl ------------------
259 AC_PROG_MAKE_SET dnl Does make define $MAKE
260 AC_PROG_INSTALL dnl Check for BSD compatible `install'
261 AC_PROG_RANLIB dnl Check for `ranlib'
262 AC_PROG_AWK dnl Check for mawk,gawk,nawk, then awk
263 AC_PROG_LEX dnl Check for lex/flex
266 pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
267 AC_PATH_PROG(cutpath, cut, no, [$pathtmp])
269 dnl ----------------------------------------------
270 dnl check for lclint, and lint if it doesn't exist
271 dnl ----------------------------------------------
272 AC_CHECK_PROG(linttmp1, lclint, lclint, no)dnl
273 if test x$ac_cv_prog_linttmp1 != xno ; then
274 LINT=$ac_cv_prog_linttmp1
275 LINTFLAGS="-weak +posixlib -macrovarprefixexclude"
277 AC_CHECK_PROG(linttmp2, lint, lint, no)dnl
278 if test x$ac_cv_prog_linttmp2 != xno ; then
279 LINT=$ac_cv_prog_linttmp2
282 LINT="echo 'No lint program found'"
287 AC_SUBST(LINTFLAGS)dnl
289 dnl try to figure out which one we've got
290 AC_CHECK_PROG(LIBTOOL, libtool, libtool, , [$pathtmp])
293 dnl Check for lorder and tsort commands
294 AC_CHECK_PROG(LORDER, lorder, lorder, no)dnl
295 AC_CHECK_PROG(TSORT, tsort, tsort, no)dnl
297 dnl If either doesn't exist, replace them with echo and cat
298 if test x$ac_cv_prog_LORDER != xlorder -o x$ac_cv_prog_TSORT != xtsort; then
303 dnl Mac OS X has lorder, but sh is too broken for it to work
304 dnl elif test -z "`lorder config/config.c 2>&1 | grep config/config.c`" ; then
307 dnl AC_SUBST(LORDER)dnl
308 dnl AC_SUBST(TSORT)dnl
311 dnl Check whether tsort can deal with loops
312 AC_CACHE_CHECK(whether tsort can deal with loops, nmh_cv_tsort_loop,
313 [if test -z "`echo a b b a | tsort 2>/dev/null | grep a`" ; then
316 nmh_cv_tsort_loop=yes
318 if test x$nmh_cv_tsort_loop = xno ; then
326 pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
327 AC_PATH_PROG(lspath, ls, no, [$pathtmp])
329 dnl See how we get ls to display the owner and the group
330 if test "$lspath" != "no"; then
331 AC_CACHE_CHECK(how to get ls to show us the group ownership of a file,
333 [if test x"`$lspath -dl / | $AWK '{print $9}'`" = x"/"; then
334 dnl There were 9 parameters, so unless this is a really bizarre, nonstandard
335 dnl ls, it would seem -l gave us both the user and group. On this type of
336 dnl ls, -g makes _only_ the group be displayed (and not the user).
337 nmh_cv_ls_grpopt="-l"
339 dnl Looks like -l only gave us the user, so we need -g to get the group too.
340 nmh_cv_ls_grpopt="-lg"
345 pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin
346 AC_PATH_PROG(morepath, more, no, [$pathtmp])
348 dnl If pager is not specified yet,
349 dnl then use `more' as the default.
350 if test -z "$pagerpath"; then
351 pagerpath="$morepath"
353 AC_SUBST(pagerpath)dnl
355 dnl Look for `sendmail'
356 pathtmp=/usr/lib:/usr/sbin:/usr/etc:/usr/ucblib:/usr/bin:/bin
357 AC_PATH_PROG(sendmailpath, sendmail, no, [$pathtmp])
360 pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin
361 AC_PATH_PROG(vipath, vi, no, [$pathtmp])
363 dnl If editor is not specified yet,
364 dnl then use `vi' as the default.
365 if test -z "$editorpath"; then
368 AC_SUBST(editorpath)dnl
370 dnl Check for broken vi
371 AC_CACHE_CHECK(for broken vi, nmh_cv_attvibug,
372 [if echo 'r /nonexist-file
380 if test "$nmh_cv_attvibug" = yes; then
381 AC_DEFINE(ATTVIBUG)dnl
384 dnl ----------------------------------------------------------
385 dnl FIND MAIL SPOOL AND SEE IF WE NEED TO MAKE inc SETGID MAIL
386 dnl ----------------------------------------------------------
387 AC_CACHE_CHECK(where mail spool is located, nmh_cv_mailspool,
388 [for mailspool in /var/mail dnl
391 /dev/null; dnl Just in case we fall through
393 test -d $mailspool && break
395 nmh_cv_mailspool=$mailspool
397 mailspool=$nmh_cv_mailspool
398 AC_SUBST(mailspool)dnl
400 dnl See whether the mail spool directory is world-writable.
401 if test "$lspath" != "no" -a "$cutpath" != "no"; then
402 AC_CACHE_CHECK(whether the mail spool is world-writable,
403 nmh_cv_mailspool_world_writable,
404 [if test "`$lspath -dlL $mailspool | $cutpath -c9`" = "-"; then
405 nmh_cv_mailspool_world_writable=no
407 nmh_cv_mailspool_world_writable=yes
411 dnl Also, check for liblockfile (as found on Debian systems)
412 AC_CHECK_HEADER(lockfile.h, AC_CHECK_LIB(lockfile, lockfile_create) )
414 dnl and whether its companion program dotlockfile is setgid
415 AC_PATH_PROG(dotlockfilepath, dotlockfile, no)
416 if test "$ac_cv_lib_lockfile_lockfile_create" != "no" ; then
417 if test "$ac_cv_path_dotlockfilepath" != "no" ; then
418 AC_CACHE_CHECK(whether dotlockfile is setgid, nmh_cv_dotlockfile_setgid,
419 [ if test -g "$ac_cv_path_dotlockfilepath" ; then
420 nmh_cv_dotlockfile_setgid=yes
422 nmh_cv_dotlockfile_setgid=no
427 dnl If mailspool is not world-writable and dotlockfile is not setgid,
428 dnl we need to #define MAILGROUP to 1 and make inc setgid.
429 if test x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then
430 dnl do we really need both of these?
431 AC_DEFINE(MAILGROUP)dnl
434 AC_SUBST(SETGID_MAIL)dnl
436 dnl Use ls to see which group owns the mail spool directory.
437 AC_CACHE_CHECK(what group owns the mail spool, nmh_cv_ls_mail_grp,
438 [nmh_cv_ls_mail_grp=`$lspath -dL $nmh_cv_ls_grpopt $mailspool|$AWK '{print $4}'`
440 MAIL_SPOOL_GRP=$nmh_cv_ls_mail_grp
441 AC_SUBST(MAIL_SPOOL_GRP)dnl
443 dnl ------------------
444 dnl CHECK HEADER FILES
445 dnl ------------------
451 AC_CHECK_HEADERS(string.h memory.h stdlib.h unistd.h errno.h fcntl.h \
452 limits.h crypt.h termcap.h termio.h termios.h locale.h \
453 langinfo.h netdb.h sys/param.h sys/time.h sys/utsname.h \
454 iconv.h arpa/inet.h arpa/ftp.h)
457 AC_CACHE_CHECK(POSIX termios, nmh_cv_sys_posix_termios,
458 [AC_TRY_LINK([#include <sys/types.h>
460 #include <termios.h>],
461 [/* SunOS 4.0.3 has termios.h but not the library calls. */
463 nmh_cv_sys_posix_termios=yes, nmh_cv_sys_posix_termios=no)])
465 if test $nmh_cv_sys_posix_termios = yes; then
466 AC_CACHE_CHECK(TIOCGWINSZ in termios.h,
467 nmh_cv_header_termios_h_tiocgwinsz,
468 [AC_TRY_LINK([#include <sys/types.h>
469 #include <termios.h>],
470 [int x = TIOCGWINSZ;],
471 nmh_cv_header_termios_h_tiocgwinsz=yes,
472 nmh_cv_header_termios_h_tiocgwinsz=no)])
474 nmh_cv_header_termios_h_tiocgwinsz=no
477 if test $nmh_cv_header_termios_h_tiocgwinsz = no; then
478 AC_CACHE_CHECK(TIOCGWINSZ in sys/ioctl.h,
479 nmh_cv_header_sys_ioctl_h_tiocgwinsz,
480 [AC_TRY_LINK([#include <sys/types.h>
481 #include <sys/ioctl.h>],
482 [int x = TIOCGWINSZ;],
483 nmh_cv_header_sys_ioctl_h_tiocgwinsz=yes,
484 nmh_cv_header_sys_ioctl_h_tiocgwinsz=no)])
485 if test $nmh_cv_header_sys_ioctl_h_tiocgwinsz = yes; then
486 AC_DEFINE(GWINSZ_IN_SYS_IOCTL)dnl
491 dnl Checks for _IO_write_ptr. A Linuxism used by nmh on linux. We
492 dnl really use a whole set of them, but this check should be
495 AC_CHECK_HEADER(libio.h, [
496 AC_EGREP_HEADER(_IO_write_ptr, libio.h, [
497 AC_DEFINE(LINUX_STDIO) ]) ])
499 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM))
505 AC_CHECK_LIB(mkstemp,mkstemp)
506 AC_CHECK_FUNCS(waitpid wait3 sigaction sigprocmask sigblock sigsetmask \
507 sighold sigrelse writev lstat uname tzset killpg mkstemp \
508 sethostent getutent nl_langinfo)
510 dnl solaris screws this up
511 AC_CHECK_FUNC(gethostbyname, [AC_DEFINE(HAVE_GETHOSTBYNAME)],
512 AC_CHECK_LIB(nsl, gethostbyname, [AC_DEFINE(HAVE_GETHOSTBYNAME)] ) )
514 dnl sigsetjmp may be a macro
515 AC_MSG_CHECKING(for sigsetjmp)
516 AC_TRY_LINK([#include <setjmp.h>], [sigsetjmp((void *)0, 0);],
517 [AC_DEFINE(HAVE_SIGSETJMP) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
519 AC_REPLACE_FUNCS(snprintf strerror strdup)
521 dnl Look for the initgroups() declaration. On AIX 4.[13], Solaris 4.1.3, and
522 dnl ULTRIX 4.2A the function is defined in libc but there's no declaration in
523 dnl any system header.
525 dnl On Solaris 2.[456], the declaration is in <grp.h>. On HP-UX 9-11 and
526 dnl (reportedly) FreeBSD 3.[23], it's in <unistd.h>. Any other locations we
528 AC_EGREP_HEADER(initgroups, grp.h, AC_DEFINE(INITGROUPS_HEADER, <grp.h>),
529 AC_EGREP_HEADER(initgroups, unistd.h,
530 AC_DEFINE(INITGROUPS_HEADER, <unistd.h>)))
532 dnl On AIX 4.1, snprintf() is defined in libc.a but there's no prototype in
533 dnl <stdio.h> or elsewhere. Apparently it's not officially supported (though it
534 dnl seems to work perfectly and IBM apparently uses it in internal code).
535 dnl Anyhow, if we omit our own snprintf() and vsnprintf() prototypes when we
536 dnl HAVE_SNPRINTF, we get a billion warnings at compile time. Use the C
537 dnl preprocessor to preprocess stdio.h and make sure that there's actually a
539 AC_EGREP_HEADER(snprintf, stdio.h, AC_DEFINE(HAVE_SNPRINTF_PROTOTYPE))
541 dnl -------------------
542 dnl CHECK FOR LIBRARIES
543 dnl -------------------
544 dnl Check location of modf
545 AC_CHECK_FUNC(modf, , AC_CHECK_LIB(m, modf))
547 dnl Checks for network libraries (nsl, socket)
550 termcap_curses_order="termcap curses ncurses"
551 for lib in $termcap_curses_order; do
552 AC_CHECK_LIB(${lib}, tgetent, [TERMLIB="-l$lib"; break])
560 dnl Find iconv. It may be in libiconv and may be iconv() or libiconv()
561 if test "x$ac_cv_header_iconv_h" = "xyes"; then
562 AC_CHECK_FUNC(iconv, ac_found_iconv=yes, ac_found_iconv=no)
563 if test "x$ac_found_iconv" = "xno"; then
564 AC_CHECK_LIB(iconv, iconv, ac_found_iconv=yes)
565 if test "x$ac_found_iconv" = "xno"; then
566 AC_CHECK_LIB(iconv, libiconv, ac_found_iconv=yes)
568 if test "x$ac_found_iconv" != "xno"; then
573 if test "x$ac_found_iconv" = xyes; then
574 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
577 dnl Check if iconv uses const in prototype declaration
578 if test "x$ac_found_iconv" = "xyes"; then
579 AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
580 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
581 #include <iconv.h>]],
585 #if defined(__STDC__) || defined(__cplusplus)
586 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
590 [ac_cv_iconv_const=],
591 [ac_cv_iconv_const=const])])
592 AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
593 [Define as const if the declaration of iconv() needs const.])
600 AC_CHECK_FUNC(dbm_open, ,
601 AC_CHECK_LIB(ndbm, dbm_open, ,
602 AC_CHECK_LIB(dbm, dbm_open, ,
603 AC_CHECK_LIB(db1, dbm_open, ,
604 AC_CHECK_LIB(gdbm, dbm_open, ,
605 AC_CHECK_LIB(db, __db_ndbm_open))))))
611 AC_CHECK_HEADERS(db1/ndbm.h gdbm/ndbm.h db.h, break, )
616 if test x"$with_hesiod" != x -a x"$with_hesiod" != x"no"; then
617 if test x"$with_hesiod" != x"yes"; then
618 HESIOD_INCLUDES="-I$with_hesiod/include"
619 HESIOD_LIBS="-L$with_hesiod/lib"
621 AC_CHECK_FUNC(res_send,
622 [AC_CHECK_LIB(hesiod, hes_resolve,
623 [HESIOD_LIBS="$HESIOD_LIBS -lhesiod"],
624 [AC_MSG_ERROR(Hesiod library not found)],
626 [AC_CHECK_LIB(hesiod, hes_resolve,
627 [HESIOD_LIBS="$HESIOD_LIBS -lhesiod -lresolv"],
628 [AC_MSG_ERROR(Hesiod library not found)],
629 $HESIOD_LIBS -lresolv)])
632 AC_SUBST(HESIOD_INCLUDES)dnl
633 AC_SUBST(HESIOD_LIBS)dnl
635 dnl ----------------------------------
636 dnl CHECK FOR KRB4 (Kerberos4 support)
637 dnl ----------------------------------
638 if test x"$with_krb4" != x -a x"$with_krb4" != x"no"; then
639 if test x"$with_krb4" != x"yes"; then
640 KRB4_INCLUDES="-I$with_krb4/include"
641 if test -d "$with_krb4/include/kerberosIV"; then
642 KRB4_INCLUDES="$KRB4_INCLUDES -I$with_krb4/include/kerberosIV"
644 KRB4_LIBS="-L$with_krb4/lib"
645 elif test -d /usr/include/kerberosIV; then
646 KRB4_INCLUDES="-I/usr/include/kerberosIV"
648 dnl First, check if we have -lk5crypto, since that means we have a recent krb5
650 AC_CHECK_LIB(k5crypto, krb5_encrypt,
651 [AC_CHECK_LIB(krb4, krb_rd_req,
652 [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
653 [AC_MSG_ERROR(Kerberos 4 compatibility libraries not found)],
654 $KRB4_LIBS -ldes425 -lkrb5 -lk5crypto -lcom_err)],
656 [AC_CHECK_LIB(krb4, krb_rd_req,
657 [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err"],
658 [AC_CHECK_LIB(krb, krb_rd_req,
659 [KRB4_LIBS="$KRB4_LIBS -lkrb -ldes"],
660 [AC_MSG_ERROR(Kerberos 4 libraries not found)],
662 $KRB4_LIBS -ldes425 -lkrb5 -lcrypto -lcom_err)],
666 AC_SUBST(KRB4_INCLUDES)dnl
667 AC_SUBST(KRB4_LIBS)dnl
669 dnl --------------------
670 dnl CHECK FOR CYRUS SASL
671 dnl --------------------
672 if test x"$with_cyrus_sasl" != x -a x"$with_cyrus_sasl" != x"no"; then
673 if test x"$with_cyrus_sasl" != x"yes"; then
674 SASL_INCLUDES="-I$with_cyrus_sasl/include"
675 SASL_LIBS="-L$with_cyrus_sasl/lib"
677 dnl Do OS-specific hardcoding of SASL shared library path into executables,
678 dnl so user isn't forced to set environment variables like Solaris'
682 SASL_LIBS="$SASL_LIBS -R$with_cyrus_sasl/lib"
686 save_LDFLAGS="$LDFLAGS"
687 LDFLAGS="$LDFLAGS $SASL_LIBS"
688 AC_CHECK_LIB(sasl2, sasl_client_new,
689 [SASL_LIBS="$SASL_LIBS -lsasl2"],
690 [AC_MSG_ERROR(Cyrus SASL library not found)])
691 LDFLAGS="$save_LDFLAGS"
693 AC_SUBST(SASL_INCLUDES)dnl
694 AC_SUBST(SASL_LIBS)dnl
696 dnl ---------------------
697 dnl CHECK TERMCAP LIBRARY
698 dnl ---------------------
700 dnl Add the termcap library, so that the following configure
701 dnl tests will find it when it tries to link test programs.
702 nmh_save_LIBS="$LIBS"
703 LIBS="$TERMLIB $LIBS"
705 dnl Checks for external variable ospeed in the termcap library.
706 AC_CACHE_CHECK(if an include file defines ospeed,
707 nmh_cv_decl_ospeed_include_defines,
709 [#include <sys/types.h>
715 #endif], [ospeed = 0;],
716 nmh_cv_decl_ospeed_include_defines=yes,
717 nmh_cv_decl_ospeed_include_defines=no)])
719 if test $nmh_cv_decl_ospeed_include_defines = no; then
720 AC_CACHE_CHECK(if you must define ospeed,
721 nmh_cv_decl_ospeed_must_define,
722 [AC_TRY_LINK( ,[extern short ospeed; ospeed = 0;],
723 nmh_cv_decl_ospeed_must_define=yes,
724 nmh_cv_decl_ospeed_must_define=no)])
727 if test $nmh_cv_decl_ospeed_include_defines = yes; then
728 AC_DEFINE(HAVE_OSPEED)dnl
729 elif test $nmh_cv_decl_ospeed_must_define = yes; then
730 AC_DEFINE(HAVE_OSPEED)
731 AC_DEFINE(MUST_DEFINE_OSPEED)
734 dnl dnl Checks if tgetent accepts NULL and will
735 dnl dnl allocate its own termcap buffer.
736 dnl AC_CACHE_CHECK(if tgetent accepts NULL,
737 dnl nmh_cv_func_tgetent_accepts_null,
738 dnl [AC_TRY_RUN([main(){int i = tgetent((char*)0,"vt100");exit(!i || i == -1);}],
739 dnl nmh_cv_func_tgetent_accepts_null=yes,
740 dnl nmh_cv_func_tgetent_accepts_null=no,
741 dnl nmh_cv_func_tgetent_accepts_null=no)])
742 dnl if test $nmh_cv_func_tgetent_accepts_null = yes; then
743 dnl AC_DEFINE(TGETENT_ACCEPTS_NULL)
746 dnl Now put the libraries back to what it was before we
747 dnl starting checking the termcap library.
748 LIBS="$nmh_save_LIBS"
760 dnl Check for sigset_t. Currently I'm looking in
761 dnl <sys/types.h> and <signal.h>. Others might need
763 AC_CACHE_CHECK(for sigset_t, nmh_cv_type_sigset_t,
765 [#include <sys/types.h>
766 #include <signal.h>], [sigset_t tempsigset;],
767 nmh_cv_type_sigset_t=yes, nmh_cv_type_sigset_t=no)])
768 if test $nmh_cv_type_sigset_t = no; then
769 AC_DEFINE(sigset_t, unsigned int)
777 AC_CACHE_CHECK(for tm_gmtoff in struct tm, nmh_cv_struct_tm_gmtoff,
779 [#ifdef TIME_WITH_SYS_TIME
780 # include <sys/time.h>
783 # ifdef TM_IN_SYS_TIME
784 # include <sys/time.h>
789 [struct tm temptm; temptm.tm_gmtoff = 0;],
790 nmh_cv_struct_tm_gmtoff=yes, nmh_cv_struct_tm_gmtoff=no)])
791 if test $nmh_cv_struct_tm_gmtoff = yes; then
792 AC_DEFINE(HAVE_TM_GMTOFF)
798 dnl What style of signal do you have (POSIX, BSD, or SYSV)?
799 AC_MSG_CHECKING(what style of signals to use)
800 if test $ac_cv_func_sigaction = yes -a $ac_cv_func_sigprocmask = yes; then
801 signals_style=POSIX_SIGNALS
802 AC_DEFINE(POSIX_SIGNALS)
803 AC_DEFINE(RELIABLE_SIGNALS)
804 elif test $ac_cv_func_sigblock = yes -a $ac_cv_func_sigsetmask = yes; then
805 signals_style=BSD_SIGNALS
806 AC_DEFINE(BSD_SIGNALS)
807 AC_DEFINE(RELIABLE_SIGNALS)
808 elif test $ac_cv_func_sighold = yes -a $ac_cv_func_sigrelse = yes; then
809 signals_style=SYSV_SIGNALS
810 AC_DEFINE(SYSV_SIGNALS)
812 signals_style=NO_SIGNAL_BLOCKING
813 AC_DEFINE(NO_SIGNAL_BLOCKING)
816 AC_MSG_RESULT($signals_style)
818 dnl Where is <signal.h> located? Needed as input for signames.awk
819 AC_CACHE_CHECK(where signal.h is located, nmh_cv_path_signal_h,
820 [for SIGNAL_H in /usr/include/bsd/sys/signal.h dnl Next
821 /usr/include/asm/signal.h dnl Linux 1.3.0 and above
822 /usr/include/asm/signum.h dnl some versions of Linux/Alpha
823 /usr/include/linux/signal.h dnl Linux up to 1.2.11
824 /usr/include/sys/signal.h dnl Almost everybody else
825 /dev/null; dnl Just in case we fall through
827 test -f $SIGNAL_H && \
828 grep '#[ ]*define[ ][ ]*SIG[0-9A-Z]*[ ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \
831 nmh_cv_path_signal_h=$SIGNAL_H
833 SIGNAL_H=$nmh_cv_path_signal_h
834 AC_SUBST(SIGNAL_H)dnl
837 dnl OS SPECIFIC DEFINES
878 AC_DEFINE(SCO_5_STDIO)
886 AC_OUTPUT(Makefile config/Makefile h/Makefile sbr/Makefile uip/Makefile \
887 mts/Makefile mts/smtp/Makefile \
888 etc/Makefile docs/Makefile man/Makefile, \
889 [test -z "$CONFIG_HEADERS" || echo > stamp-h])
891 dnl Umm, what's the point of these assignments?? -- <dan-nmh@dilvish.speed.net>
892 eval "nmhbin=${bindir}"; eval "nmhbin2=${nmhbin}"
893 eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf2=${nmhsysconf}"
894 eval "nmhlib=${libdir}"; eval "nmhlib2=${nmhlib}"
895 eval "nmhman=${mandir}"
898 if test x"$enable_pop" = x"yes"; then
901 if test x"$enable_apop" = x"yes"; then
902 pop_kinds="${pop_kinds}APOP "
905 if test x"$with_krb4" != x -a x"$with_krb4" != x"no"; then
906 pop_kinds="${pop_kinds}KPOP "
909 pop_kinds="${pop_kinds}POP3)"
915 nmh version : ${VERSION}
916 target os : ${target}
918 compiler flags : ${CFLAGS}
919 linker flags : ${LDFLAGS}
920 source code location : ${srcdir}
921 binary install path : ${nmhbin2}
922 libary install path : ${nmhlib2}
923 config files install path : ${nmhsysconf2}
924 man page install path : ${nmhman}
925 backup prefix : ${backup_prefix}
926 transport system : ${MTS}
927 file locking type : ${LOCKTYPE}
928 default smtp servers : ${smtpservers}
929 default editor : ${editorpath}
930 default pager : ${pagerpath}
931 email address masquerading : ${masquerade}
932 pop is enabled : ${pop_kinds}
933 SASL support : ${sasl_support}"