[SVN] r326 - in /trunk/cyrus-imapd-2.2: ./ CVS/ cmulocal/ cmulocal/CVS/ debian/ debian/patches/ depot/ depot/CVS/ doc/ doc/CVS/ imap/ imap/CVS/ imtest/ imtest/CVS/ lib/ lib/CVS/ lib/charset/ lib/charset/CVS/ man/ man/CVS/ master/ master/CVS/ master/conf/ master/conf/CVS/ notifyd/ notifyd/CVS/ perl/imap/ perl/imap/CVS/ perl/imap/IMAP/ perl/imap/IMAP/CVS/ perl/sieve/lib/ perl/sieve/lib/CVS/ perl/sieve/managesieve/ perl/sieve/managesieve/CVS/ ptclient/ ptclient/CVS/ sieve/ sieve/CVS/ snmp/ snmp/CVS/ timsieved/ timsieved/CVS/ tools/ tools/CVS/

debian at incase.de debian at incase.de
Fri Mar 31 18:18:25 UTC 2006


Author: sven
Date: Fri Mar 31 20:18:13 2006
New Revision: 326

URL: https://mail.incase.de/viewcvs?rev=326&root=cyrus22&view=rev
Log:
First test checkin of cyrus-imapd-2.2 version 2.2.13-1

Added:
    trunk/cyrus-imapd-2.2/
      - copied from r324, trunk/cyrus-imapd-2.2.12/
    trunk/cyrus-imapd-2.2/cmulocal/clamav.m4
    trunk/cyrus-imapd-2.2/cmulocal/openldap.m4
    trunk/cyrus-imapd-2.2/imap/lmtpd.h   (with props)
    trunk/cyrus-imapd-2.2/lib/auth.c   (with props)
    trunk/cyrus-imapd-2.2/lib/xstrlcat.c   (with props)
    trunk/cyrus-imapd-2.2/lib/xstrlcat.h   (with props)
    trunk/cyrus-imapd-2.2/lib/xstrlcpy.c   (with props)
    trunk/cyrus-imapd-2.2/lib/xstrlcpy.h   (with props)
    trunk/cyrus-imapd-2.2/ptclient/ptloader.h   (with props)
Removed:
    trunk/cyrus-imapd-2.2/debian/patches/00-6662-upstream-off-by-one_in_imap_spool.dpatch
Modified:
    trunk/cyrus-imapd-2.2/CVS/Entries
    trunk/cyrus-imapd-2.2/Makefile.in
    trunk/cyrus-imapd-2.2/README.andrew
    trunk/cyrus-imapd-2.2/SMakefile
    trunk/cyrus-imapd-2.2/aclocal.m4
    trunk/cyrus-imapd-2.2/cmulocal/CVS/Entries
    trunk/cyrus-imapd-2.2/cmulocal/afs.m4
    trunk/cyrus-imapd-2.2/cmulocal/arx.m4
    trunk/cyrus-imapd-2.2/cmulocal/berkdb.m4
    trunk/cyrus-imapd-2.2/cmulocal/bsd_sockets.m4
    trunk/cyrus-imapd-2.2/cmulocal/com_err_link.m4
    trunk/cyrus-imapd-2.2/cmulocal/common.m4
    trunk/cyrus-imapd-2.2/cmulocal/heimdal.m4
    trunk/cyrus-imapd-2.2/cmulocal/kafs.m4
    trunk/cyrus-imapd-2.2/cmulocal/kerberos_v4.m4
    trunk/cyrus-imapd-2.2/cmulocal/kerberos_v5.m4
    trunk/cyrus-imapd-2.2/cmulocal/libXau.m4
    trunk/cyrus-imapd-2.2/cmulocal/libcyrus.m4
    trunk/cyrus-imapd-2.2/cmulocal/libloguse.m4
    trunk/cyrus-imapd-2.2/cmulocal/libnet.m4
    trunk/cyrus-imapd-2.2/cmulocal/libpcap.m4
    trunk/cyrus-imapd-2.2/cmulocal/librestrict.m4
    trunk/cyrus-imapd-2.2/cmulocal/libssl.m4
    trunk/cyrus-imapd-2.2/cmulocal/libwrap.m4
    trunk/cyrus-imapd-2.2/cmulocal/openssl.m4
    trunk/cyrus-imapd-2.2/cmulocal/sasl.m4
    trunk/cyrus-imapd-2.2/cmulocal/sasl2.m4
    trunk/cyrus-imapd-2.2/cmulocal/telnet.m4
    trunk/cyrus-imapd-2.2/cmulocal/ucdsnmp.m4
    trunk/cyrus-imapd-2.2/cmulocal/zephyr.m4
    trunk/cyrus-imapd-2.2/config.h.in
    trunk/cyrus-imapd-2.2/configure
    trunk/cyrus-imapd-2.2/configure.in
    trunk/cyrus-imapd-2.2/debian/changelog
    trunk/cyrus-imapd-2.2/debian/patches/00list
    trunk/cyrus-imapd-2.2/depot/CVS/Entries
    trunk/cyrus-imapd-2.2/depot/depot.conf
    trunk/cyrus-imapd-2.2/doc/CVS/Entries
    trunk/cyrus-imapd-2.2/doc/changes.html
    trunk/cyrus-imapd-2.2/doc/specs.html
    trunk/cyrus-imapd-2.2/imap/CVS/Entries
    trunk/cyrus-imapd-2.2/imap/annotate.c
    trunk/cyrus-imapd-2.2/imap/append.c
    trunk/cyrus-imapd-2.2/imap/append.h
    trunk/cyrus-imapd-2.2/imap/arbitron.c
    trunk/cyrus-imapd-2.2/imap/backend.c
    trunk/cyrus-imapd-2.2/imap/backend.h
    trunk/cyrus-imapd-2.2/imap/ctl_cyrusdb.c
    trunk/cyrus-imapd-2.2/imap/ctl_mboxlist.c
    trunk/cyrus-imapd-2.2/imap/fetchnews.c
    trunk/cyrus-imapd-2.2/imap/fud.c
    trunk/cyrus-imapd-2.2/imap/global.c
    trunk/cyrus-imapd-2.2/imap/global.h
    trunk/cyrus-imapd-2.2/imap/idle.h
    trunk/cyrus-imapd-2.2/imap/idle_idled.c
    trunk/cyrus-imapd-2.2/imap/idle_no.c
    trunk/cyrus-imapd-2.2/imap/idle_poll.c
    trunk/cyrus-imapd-2.2/imap/imapd.c
    trunk/cyrus-imapd-2.2/imap/imapd.h
    trunk/cyrus-imapd-2.2/imap/imapparse.c
    trunk/cyrus-imapd-2.2/imap/index.c
    trunk/cyrus-imapd-2.2/imap/lmtp_sieve.c
    trunk/cyrus-imapd-2.2/imap/lmtp_sieve.h
    trunk/cyrus-imapd-2.2/imap/lmtpd.c
    trunk/cyrus-imapd-2.2/imap/lmtpengine.c
    trunk/cyrus-imapd-2.2/imap/lmtpproxyd.c
    trunk/cyrus-imapd-2.2/imap/mailbox.c
    trunk/cyrus-imapd-2.2/imap/mboxlist.c
    trunk/cyrus-imapd-2.2/imap/mbpath.c
    trunk/cyrus-imapd-2.2/imap/mupdate-client.c
    trunk/cyrus-imapd-2.2/imap/mupdate-client.h
    trunk/cyrus-imapd-2.2/imap/mupdate-slave.c
    trunk/cyrus-imapd-2.2/imap/mupdate.c
    trunk/cyrus-imapd-2.2/imap/nntpd.c
    trunk/cyrus-imapd-2.2/imap/pop3d.c
    trunk/cyrus-imapd-2.2/imap/proxyd.c
    trunk/cyrus-imapd-2.2/imap/quota.c
    trunk/cyrus-imapd-2.2/imap/smmapd.c
    trunk/cyrus-imapd-2.2/imap/spool.c
    trunk/cyrus-imapd-2.2/imap/tls.c
    trunk/cyrus-imapd-2.2/imap/version.c
    trunk/cyrus-imapd-2.2/imap/version.h
    trunk/cyrus-imapd-2.2/imtest/CVS/Entries
    trunk/cyrus-imapd-2.2/imtest/imtest.c
    trunk/cyrus-imapd-2.2/lib/CVS/Entries
    trunk/cyrus-imapd-2.2/lib/Makefile.in
    trunk/cyrus-imapd-2.2/lib/auth.h
    trunk/cyrus-imapd-2.2/lib/auth_krb.c
    trunk/cyrus-imapd-2.2/lib/auth_krb5.c
    trunk/cyrus-imapd-2.2/lib/auth_pts.c
    trunk/cyrus-imapd-2.2/lib/auth_unix.c
    trunk/cyrus-imapd-2.2/lib/charset/CVS/Entries
    trunk/cyrus-imapd-2.2/lib/charset/unifix.txt
    trunk/cyrus-imapd-2.2/lib/cyrusdb.c
    trunk/cyrus-imapd-2.2/lib/cyrusdb.h
    trunk/cyrus-imapd-2.2/lib/cyrusdb_berkeley.c
    trunk/cyrus-imapd-2.2/lib/cyrusdb_quotalegacy.c
    trunk/cyrus-imapd-2.2/lib/imapoptions
    trunk/cyrus-imapd-2.2/lib/imclient.c
    trunk/cyrus-imapd-2.2/lib/imclient.h
    trunk/cyrus-imapd-2.2/lib/libconfig.c
    trunk/cyrus-imapd-2.2/lib/libcyr_cfg.c
    trunk/cyrus-imapd-2.2/lib/libcyr_cfg.h
    trunk/cyrus-imapd-2.2/lib/mpool.c
    trunk/cyrus-imapd-2.2/lib/mpool.h
    trunk/cyrus-imapd-2.2/lib/xmalloc.c
    trunk/cyrus-imapd-2.2/lib/xmalloc.h
    trunk/cyrus-imapd-2.2/man/CVS/Entries
    trunk/cyrus-imapd-2.2/man/arbitron.8
    trunk/cyrus-imapd-2.2/man/fetchnews.8
    trunk/cyrus-imapd-2.2/man/imclient.3
    trunk/cyrus-imapd-2.2/master/CVS/Entries
    trunk/cyrus-imapd-2.2/master/conf/CVS/Entries
    trunk/cyrus-imapd-2.2/master/conf/normal.conf
    trunk/cyrus-imapd-2.2/master/cyrusMasterMIB.c
    trunk/cyrus-imapd-2.2/master/master.c
    trunk/cyrus-imapd-2.2/master/service-thread.c
    trunk/cyrus-imapd-2.2/master/service.c
    trunk/cyrus-imapd-2.2/notifyd/CVS/Entries
    trunk/cyrus-imapd-2.2/notifyd/notify_mailto.c
    trunk/cyrus-imapd-2.2/notifyd/notifyd.c
    trunk/cyrus-imapd-2.2/perl/imap/CVS/Entries
    trunk/cyrus-imapd-2.2/perl/imap/IMAP.pm
    trunk/cyrus-imapd-2.2/perl/imap/IMAP/Admin.pm
    trunk/cyrus-imapd-2.2/perl/imap/IMAP/CVS/Entries
    trunk/cyrus-imapd-2.2/perl/imap/IMAP/Shell.pm
    trunk/cyrus-imapd-2.2/perl/imap/cyradm.sh
    trunk/cyrus-imapd-2.2/perl/sieve/lib/CVS/Entries
    trunk/cyrus-imapd-2.2/perl/sieve/lib/isieve.c
    trunk/cyrus-imapd-2.2/perl/sieve/managesieve/CVS/Entries
    trunk/cyrus-imapd-2.2/perl/sieve/managesieve/Makefile.PL
    trunk/cyrus-imapd-2.2/perl/sieve/managesieve/managesieve.xs
    trunk/cyrus-imapd-2.2/ptclient/CVS/Entries
    trunk/cyrus-imapd-2.2/ptclient/Makefile.in
    trunk/cyrus-imapd-2.2/ptclient/afskrb.c
    trunk/cyrus-imapd-2.2/ptclient/ldap.c
    trunk/cyrus-imapd-2.2/ptclient/ptloader.c
    trunk/cyrus-imapd-2.2/sieve/CVS/Entries
    trunk/cyrus-imapd-2.2/sieve/comparator.c
    trunk/cyrus-imapd-2.2/sieve/test.c
    trunk/cyrus-imapd-2.2/snmp/CVS/Entries
    trunk/cyrus-imapd-2.2/snmp/snmpgen
    trunk/cyrus-imapd-2.2/timsieved/CVS/Entries
    trunk/cyrus-imapd-2.2/timsieved/actions.c
    trunk/cyrus-imapd-2.2/timsieved/parser.c
    trunk/cyrus-imapd-2.2/timsieved/timsieved.c
    trunk/cyrus-imapd-2.2/tools/CVS/Entries
    trunk/cyrus-imapd-2.2/tools/config2header
    trunk/cyrus-imapd-2.2/tools/dohash
    trunk/cyrus-imapd-2.2/tools/masssievec
    trunk/cyrus-imapd-2.2/tools/mkimap
    trunk/cyrus-imapd-2.2/tools/rehash
    trunk/cyrus-imapd-2.2/tools/translatesieve
    trunk/cyrus-imapd-2.2/tools/undohash
    trunk/cyrus-imapd-2.2/tools/upgradesieve

Modified: trunk/cyrus-imapd-2.2/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,11 +1,11 @@
 /.cvsignore/1.2/Fri Oct  4 14:09:26 2002//
 /COPYRIGHT/1.7/Thu Oct 12 20:45:21 2000//
-/Makefile.in/1.81/Mon Feb 14 16:43:44 2005//
+/Makefile.in/1.82/Wed Mar 29 19:08:04 2006//
 /README/1.13/Wed Oct 22 18:50:01 2003//
-/README.andrew/1.32/Tue Mar 26 21:01:44 2002//
-/SMakefile/1.94/Wed Jun  2 17:22:11 2004//
+/README.andrew/1.34/Thu Oct 13 19:53:04 2005//
+/SMakefile/1.97/Fri Jan 20 20:26:46 2006//
 /config.guess/1.1/Tue Apr 25 04:42:12 2000//
 /config.sub/1.1/Tue Apr 25 04:42:12 2000//
-/configure.in/1.290/Tue Jan 18 23:46:00 2005//
+/configure.in/1.296/Thu Oct 13 19:56:14 2005//
 /install-sh/1.1/Fri Feb 10 19:26:06 1995//
 D

Modified: trunk/cyrus-imapd-2.2/Makefile.in
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/Makefile.in?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2/Makefile.in Fri Mar 31 20:18:13 2006
@@ -62,7 +62,7 @@
 LEX = @LEX@
 COMPILE_ET = @COMPILE_ET@
 
-VERSION = 2.2.12
+VERSION = 2.2.13
 
 all:: 
 	@for d in  $(SUBDIRS); \

Modified: trunk/cyrus-imapd-2.2/README.andrew
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/README.andrew?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/README.andrew (original)
+++ trunk/cyrus-imapd-2.2/README.andrew Fri Mar 31 20:18:13 2006
@@ -8,7 +8,7 @@
 #
 #
 
-smake -d init mf checkdepend all install
+smake -d init mf checkdepend all install 2>&1 | tee LOG.`sys`
 
 exit 0
 
@@ -41,7 +41,7 @@
 - announce to:
     info-cyrus
     comp.mail.imap
-    comp.os.linux.announce
+    cyrus-announce
     freshmeat.net
 
 - update asg.web links to new version

Modified: trunk/cyrus-imapd-2.2/SMakefile
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/SMakefile?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/SMakefile (original)
+++ trunk/cyrus-imapd-2.2/SMakefile Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
 # This file is specific to Carnegie Mellon University's
 # software build process
 # 
-# $Id: SMakefile,v 1.94 2004/06/02 17:22:11 rjs3 Exp $
+# $Id: SMakefile,v 1.97 2006/01/20 20:26:46 jeaton Exp $
 #
 
 NEW_AUTOTOOLS=yes
@@ -70,7 +70,16 @@
 LOCALDEFS="-DEXTRA_IDENT=\\\"$VER\\\""
 
 # PERL CONFIGURATION
-PERL_MM_OPT="INSTALLPRIVLIB=${DESTDIR}/usr/local/lib/perl5 INSTALLARCHLIB=${DESTDIR}/usr/local/lib/perl5/5.6.1 INSTALLSITELIB=${DESTDIR}/usr/local/lib/perl5/site_perl/5.6.1 INSTALLSITEARCH=${DESTDIR}/usr/local/lib/perl5/site_perl/5.6.1 INSTALLBIN=${DESTDIR}/usr/local/bin INSTALLSCRIPT=${DESTDIR}/usr/local/bin INSTALLMAN1DIR=${DESTDIR}/usr/local/man/man1 INSTALLMAN3DIR=${DESTDIR}/usr/local/man/man3"
+if perl -e 'exit ($] != 5.006001)'; then
+   PERL_MM_OPT="INSTALLPRIVLIB=${DESTDIR}/usr/local/lib/perl5 INSTALLARCHLIB=${DESTDIR}/usr/local/lib/perl5/5.6.1 INSTALLSITELIB=${DESTDIR}/usr/local/lib/perl5/site_perl/5.6.1 INSTALLSITEARCH=${DESTDIR}/usr/local/lib/perl5/site_perl/5.6.1 INSTALLBIN=${DESTDIR}/usr/local/bin INSTALLSCRIPT=${DESTDIR}/usr/local/bin INSTALLMAN1DIR=${DESTDIR}/usr/local/man/man1 INSTALLMAN3DIR=${DESTDIR}/usr/local/man/man3"
+else
+  if perl -e 'exit ($] < 5.008005)'; then
+    # MakeMaker now supports DESTDIR!
+    PERL_MM_OPT=""
+  else
+    echo "no support for thus perl version in SMakefile"
+  fi
+fi
 export PERL_MM_OPT
 # end perl configuration
 
@@ -80,7 +89,7 @@
   CFLAGS="-g"
 else
   CC="gcc"
-  CFLAGS="${CFLAGS} -O3 -g -Wall -W"
+  CFLAGS="${CFLAGS} -g -Wall -W"
 fi
 
 if test "${WASH_CYRUS_DEBUG}" = "t"; then
@@ -104,10 +113,17 @@
     ;;
 esac
 
+case `sys` in
+    i386_fc3)
+	LIBS="$LIBS -ldes"
+	OS_CONFIG="--with-krbdes"
+    ;;
+esac
+
 
 # settings; we have to disable these on some platforms
 DEBUG=""
-WITHAUTH="--with-auth=pts --enable-krb5afspts --without-krbdes"
+WITHAUTH="--with-afs=/usr/local --enable-krb5afspts --without-krbdes"
 SSL_CONFIG="--with-openssl=/usr/local/lib"
 
 # the defaults are good enough for us
@@ -115,8 +131,9 @@
 
 # the following is for staticly linking SASL only
 SASL_CONFIG="--with-staticsasl=/usr/local --with-gssapi=/usr/local"
-KRB_CONFIG="--enable-statickrb --with-krb=/usr/local"
-FEATURE_CONFIG="--enable-murder --enable-cmulocal"
+#KRB_CONFIG="--enable-statickrb --with-krb=/usr/local"
+KRB_CONFIG="--with-krb=/usr/local"
+FEATURE_CONFIG="--enable-murder --enable-cmulocal --enable-nntp --with-idle=idled"
 EXT_PACKAGE_CONFIG="--with-inn=/usr/news --with-ucdsnmp=/usr/local"
 
 MFCOMMAND="./configure $WITHAUTH $KRB_CONFIG $DB_CONFIG --enable-experiment --with-cyrus-group=staff $FEATURE_CONFIG $EXT_PACKAGE_CONFIG $SASL_CONFIG $DEBUG"

Modified: trunk/cyrus-imapd-2.2/aclocal.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/aclocal.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/aclocal.m4 (original)
+++ trunk/cyrus-imapd-2.2/aclocal.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.7.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -11,1850 +11,13 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-# isc-posix.m4 serial 2 (gettext-0.11.2)
-dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
-
-# This test replaces the one in autoconf.
-# Currently this macro should have the same name as the autoconf macro
-# because gettext's gettext.m4 (distributed in the automake package)
-# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
-# give these diagnostics:
-#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
-#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
-
-undefine([AC_ISC_POSIX])
-
-AC_DEFUN([AC_ISC_POSIX],
-  [
-    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
-    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
-  ]
-)
-
-dnl
-dnl $Id: c-attribute.m4,v 1.3 2003/10/08 20:35:24 rjs3 Exp $
-dnl
-
-dnl
-dnl Test for __attribute__
-dnl
-
-AC_DEFUN([CMU_C___ATTRIBUTE__], [
-AC_MSG_CHECKING(for __attribute__)
-AC_CACHE_VAL(ac_cv___attribute__, [
-AC_TRY_COMPILE([
-#include <stdlib.h>
-],
-[
-static void foo(void) __attribute__ ((noreturn));
-
-static void
-foo(void)
-{
-  exit(1);
-}
-],
-ac_cv___attribute__=yes,
-ac_cv___attribute__=no)])
-if test "$ac_cv___attribute__" = "yes"; then
-  AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
-fi
-AC_MSG_RESULT($ac_cv___attribute__)
-])
-
-
-dnl
-dnl $Id: c-fpic.m4,v 1.2 2003/10/08 20:35:24 rjs3 Exp $
-dnl
-
-dnl
-dnl Test for -fPIC
-dnl
-
-AC_DEFUN([CMU_C_FPIC], [
-AC_MSG_CHECKING(if compiler supports -fPIC)
-AC_CACHE_VAL(ac_cv_fpic, [
-save_CFLAGS=$CFLAGS
-CFLAGS="${CFLAGS} -fPIC"
-AC_TRY_COMPILE([
-#include <stdlib.h>
-],
-[
-static void
-foo(void)
-{
-  exit(1);
-}
-],
-ac_cv_fpic=yes,
-ac_cv_fpic=no)
-CFLAGS=$save_CFLAGS
-])
-if test "$ac_cv_fpic" = "yes"; then
-    FPIC_CFLAGS="-fPIC"
-else
-    FPIC_CFLAGS=""
-fi
-AC_MSG_RESULT($ac_cv_fpic)
-])
-
-
-dnl
-dnl Additional macros for configure.in packaged up for easier theft.
-dnl $Id: cyrus.m4,v 1.4 2003/10/08 20:35:24 rjs3 Exp $
-dnl tjs at andrew.cmu.edu 6-may-1998
-dnl
-
-dnl It would be good if ANDREW_ADD_LIBPATH could detect if something was
-dnl already there and not redundantly add it if it is.
-
-dnl add -L(arg), and possibly (runpath switch)(arg), to LDFLAGS
-dnl (so the runpath for shared libraries is set).
-AC_DEFUN([CMU_ADD_LIBPATH], [
-  # this is CMU ADD LIBPATH
-  if test "$andrew_runpath_switch" = "none" ; then
-	LDFLAGS="-L$1 ${LDFLAGS}"
-  else
-	LDFLAGS="-L$1 $andrew_runpath_switch$1 ${LDFLAGS}"
-  fi
-])
-
-dnl add -L(1st arg), and possibly (runpath switch)(1st arg), to (2nd arg)
-dnl (so the runpath for shared libraries is set).
-AC_DEFUN([CMU_ADD_LIBPATH_TO], [
-  # this is CMU ADD LIBPATH TO
-  if test "$andrew_runpath_switch" = "none" ; then
-	$2="-L$1 ${$2}"
-  else
-	$2="-L$1 ${$2} $andrew_runpath_switch$1"
-  fi
-])
-
-dnl runpath initialization
-AC_DEFUN([CMU_GUESS_RUNPATH_SWITCH], [
-   # CMU GUESS RUNPATH SWITCH
-  AC_CACHE_CHECK(for runpath switch, andrew_runpath_switch, [
-    # first, try -R
-    SAVE_LDFLAGS="${LDFLAGS}"
-    LDFLAGS="-R /usr/lib"
-    AC_TRY_LINK([],[],[andrew_runpath_switch="-R"], [
-  	LDFLAGS="-Wl,-rpath,/usr/lib"
-    AC_TRY_LINK([],[],[andrew_runpath_switch="-Wl,-rpath,"],
-    [andrew_runpath_switch="none"])
-    ])
-  LDFLAGS="${SAVE_LDFLAGS}"
-  ])])
-
-dnl bsd_sockets.m4--which socket libraries do we need? 
-dnl Derrick Brashear
-dnl from Zephyr
-dnl $Id: bsd_sockets.m4,v 1.9 2003/10/08 20:35:24 rjs3 Exp $
-
-dnl Hacked on by Rob Earhart to not just toss stuff in LIBS
-dnl It now puts everything required for sockets into LIB_SOCKET
-
-AC_DEFUN([CMU_SOCKETS], [
-	save_LIBS="$LIBS"
-	LIB_SOCKET=""
-	AC_CHECK_FUNC(connect, :,
-		AC_CHECK_LIB(nsl, gethostbyname,
-			     LIB_SOCKET="-lnsl $LIB_SOCKET")
-		AC_CHECK_LIB(socket, connect,
-			     LIB_SOCKET="-lsocket $LIB_SOCKET")
-	)
-	LIBS="$LIB_SOCKET $save_LIBS"
-	AC_CHECK_FUNC(res_search, :,
-                AC_CHECK_LIB(resolv, res_search,
-                              LIB_SOCKET="-lresolv $LIB_SOCKET") 
-        )
-	LIBS="$LIB_SOCKET $save_LIBS"
-	AC_CHECK_FUNCS(dn_expand dns_lookup)
-	LIBS="$save_LIBS"
-	AC_SUBST(LIB_SOCKET)
-	])
-
-dnl See whether we can use IPv6 related functions
-dnl contributed by Hajimu UMEMOTO
-
-AC_DEFUN([IPv6_CHECK_FUNC], [
-AC_CHECK_FUNC($1, [dnl
-  ac_cv_lib_socket_$1=no
-  ac_cv_lib_inet6_$1=no
-], [dnl
-  AC_CHECK_LIB(socket, $1, [dnl
-    LIBS="$LIBS -lsocket"
-    ac_cv_lib_inet6_$1=no
-  ], [dnl
-    AC_MSG_CHECKING([whether your system has IPv6 directory])
-    AC_CACHE_VAL(ipv6_cv_dir, [dnl
-      for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
-	if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
-	  break
-	fi
-      done])dnl
-    AC_MSG_RESULT($ipv6_cv_dir)
-    if test $ipv6_cv_dir = no; then
-      ac_cv_lib_inet6_$1=no
-    else
-      if test x$ipv6_libinet6 = x; then
-	ipv6_libinet6=no
-	SAVELDFLAGS="$LDFLAGS"
-	LDFLAGS="$LDFLAGS -L$ipv6_cv_dir/lib"
-      fi
-      AC_CHECK_LIB(inet6, $1, [dnl
-	if test $ipv6_libinet6 = no; then
-	  ipv6_libinet6=yes
-	  LIBS="$LIBS -linet6"
-	fi],)dnl
-      if test $ipv6_libinet6 = no; then
-	LDFLAGS="$SAVELDFLAGS"
-      fi
-    fi])dnl
-])dnl
-ipv6_cv_$1=no
-if test $ac_cv_func_$1 = yes -o $ac_cv_lib_socket_$1 = yes \
-     -o $ac_cv_lib_inet6_$1 = yes
-then
-  ipv6_cv_$1=yes
-fi
-if test $ipv6_cv_$1 = no; then
-  if test $1 = getaddrinfo; then
-    for ipv6_cv_pfx in o n; do
-      AC_EGREP_HEADER(${ipv6_cv_pfx}$1, netdb.h,
-		      [AC_CHECK_FUNC(${ipv6_cv_pfx}$1)])
-      if eval test X\$ac_cv_func_${ipv6_cv_pfx}$1 = Xyes; then
-        AC_DEFINE(HAVE_GETADDRINFO,[],[Do we have a getaddrinfo?])
-        ipv6_cv_$1=yes
-        break
-      fi
-    done
-  fi
-fi
-if test $ipv6_cv_$1 = yes; then
-  ifelse([$2], , :, [$2])
-else
-  ifelse([$3], , :, [$3])
-fi])
-
-
-dnl See whether we have ss_family in sockaddr_storage
-AC_DEFUN([IPv6_CHECK_SS_FAMILY], [
-AC_MSG_CHECKING([whether you have ss_family in struct sockaddr_storage])
-AC_CACHE_VAL(ipv6_cv_ss_family, [dnl
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
-	[struct sockaddr_storage ss; int i = ss.ss_family;],
-	[ipv6_cv_ss_family=yes], [ipv6_cv_ss_family=no])])dnl
-if test $ipv6_cv_ss_family = yes; then
-  ifelse([$1], , AC_DEFINE(HAVE_SS_FAMILY,[],[Is there an ss_family in sockaddr_storage?]), [$1])
-else
-  ifelse([$2], , :, [$2])
-fi
-AC_MSG_RESULT($ipv6_cv_ss_family)])
-
-
-dnl whether you have sa_len in struct sockaddr
-AC_DEFUN([IPv6_CHECK_SA_LEN], [
-AC_MSG_CHECKING([whether you have sa_len in struct sockaddr])
-AC_CACHE_VAL(ipv6_cv_sa_len, [dnl
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
-	       [struct sockaddr sa; int i = sa.sa_len;],
-	       [ipv6_cv_sa_len=yes], [ipv6_cv_sa_len=no])])dnl
-if test $ipv6_cv_sa_len = yes; then
-  ifelse([$1], , AC_DEFINE(HAVE_SOCKADDR_SA_LEN,[],[Does sockaddr have an sa_len?]), [$1])
-else
-  ifelse([$2], , :, [$2])
-fi
-AC_MSG_RESULT($ipv6_cv_sa_len)])
-
-
-dnl See whether sys/socket.h has socklen_t
-AC_DEFUN([IPv6_CHECK_SOCKLEN_T], [
-AC_MSG_CHECKING(for socklen_t)
-AC_CACHE_VAL(ipv6_cv_socklen_t, [dnl
-AC_TRY_LINK([#include <sys/types.h>
-#include <sys/socket.h>],
-	    [socklen_t len = 0;],
-	    [ipv6_cv_socklen_t=yes], [ipv6_cv_socklen_t=no])])dnl
-if test $ipv6_cv_socklen_t = yes; then
-  ifelse([$1], , AC_DEFINE(HAVE_SOCKLEN_T,[],[Do we have a socklen_t?]), [$1])
-else
-  ifelse([$2], , :, [$2])
-fi
-AC_MSG_RESULT($ipv6_cv_socklen_t)])
-
-
-dnl $Id: berkdb.m4,v 1.19 2005/01/06 20:24:52 shadow Exp $
-
-AC_DEFUN([CMU_DB_INC_WHERE1], [
-saved_CPPFLAGS=$CPPFLAGS
-CPPFLAGS="$saved_CPPFLAGS -I$1"
-AC_TRY_COMPILE([#include <db.h>],
-[DB *db;
-db_create(&db, NULL, 0);
-db->open(db, "foo.db", NULL, DB_UNKNOWN, DB_RDONLY, 0644);],
-ac_cv_found_db_inc=yes,
-ac_cv_found_db_inc=no)
-CPPFLAGS=$saved_CPPFLAGS
-])
-
-AC_DEFUN([CMU_DB_INC_WHERE], [
-   for i in $1; do
-      AC_MSG_CHECKING(for db headers in $i)
-      CMU_DB_INC_WHERE1($i)
-      CMU_TEST_INCPATH($i, db)
-      if test "$ac_cv_found_db_inc" = "yes"; then
-        ac_cv_db_where_inc=$i
-        AC_MSG_RESULT(found)
-        break
-      else
-        AC_MSG_RESULT(not found)
-      fi
-    done
-])
-
-#
-# Test for lib files
-#
-
-AC_DEFUN([CMU_DB3_LIB_WHERE1], [
-AC_REQUIRE([CMU_AFS])
-AC_REQUIRE([CMU_KRB4])
-saved_LIBS=$LIBS
-  LIBS="$saved_LIBS -L$1 -ldb-3"
-AC_TRY_LINK([#include <db.h>],
-[db_env_create(NULL, 0);],
-[ac_cv_found_db_3_lib=yes],
-ac_cv_found_db_3_lib=no)
-LIBS=$saved_LIBS
-])
-AC_DEFUN([CMU_DB4_LIB_WHERE1], [
-AC_REQUIRE([CMU_AFS])
-AC_REQUIRE([CMU_KRB4])
-saved_LIBS=$LIBS
-LIBS="$saved_LIBS -L$1 -ldb-4"
-AC_TRY_LINK([#include <db.h>],
-[db_env_create(NULL, 0);],
-[ac_cv_found_db_4_lib=yes],
-ac_cv_found_db_4_lib=no)
-LIBS=$saved_LIBS
-])
-
-AC_DEFUN([CMU_DB_LIB_WHERE], [
-   for i in $1; do
-      AC_MSG_CHECKING(for db libraries in $i)
-if test "$enable_db4" = "yes"; then
-      CMU_DB4_LIB_WHERE1($i)
-      CMU_TEST_LIBPATH($i, [db-4])
-      ac_cv_found_db_lib=$ac_cv_found_db_4_lib
-else
-      CMU_DB3_LIB_WHERE1($i)
-      CMU_TEST_LIBPATH($i, [db-3])
-      ac_cv_found_db_lib=$ac_cv_found_db_3_lib
-fi
-      if test "$ac_cv_found_db_lib" = "yes" ; then
-        ac_cv_db_where_lib=$i
-        AC_MSG_RESULT(found)
-        break
-      else
-        AC_MSG_RESULT(not found)
-      fi
-    done
-])
-
-AC_DEFUN([CMU_USE_DB], [
-AC_ARG_WITH(db,
-	[  --with-db=PREFIX      Compile with db support],
-	[if test "X$with_db" = "X"; then
-		with_db=yes
-	fi])
-AC_ARG_WITH(db-lib,
-	[  --with-db-lib=dir     use db libraries in dir],
-	[if test "$withval" = "yes" -o "$withval" = "no"; then
-		AC_MSG_ERROR([No argument for --with-db-lib])
-	fi])
-AC_ARG_WITH(db-include,
-	[  --with-db-include=dir use db headers in dir],
-	[if test "$withval" = "yes" -o "$withval" = "no"; then
-		AC_MSG_ERROR([No argument for --with-db-include])
-	fi])
-AC_ARG_ENABLE(db4,
-	[  --enable-db4          use db 4.x libraries])
-	
-	if test "X$with_db" != "X"; then
-	  if test "$with_db" != "yes"; then
-	    ac_cv_db_where_lib=$with_db/lib
-	    ac_cv_db_where_inc=$with_db/include
-	  fi
-	fi
-
-	if test "X$with_db_lib" != "X"; then
-	  ac_cv_db_where_lib=$with_db_lib
-	fi
-	if test "X$ac_cv_db_where_lib" = "X"; then
-	  CMU_DB_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib)
-	fi
-
-	if test "X$with_db_include" != "X"; then
-	  ac_cv_db_where_inc=$with_db_include
-	fi
-	if test "X$ac_cv_db_where_inc" = "X"; then
-	  CMU_DB_INC_WHERE(/usr/athena/include /usr/local/include)
-	fi
-
-	AC_MSG_CHECKING(whether to include db)
-	if test "X$ac_cv_db_where_lib" = "X" -o "X$ac_cv_db_where_inc" = "X"; then
-	  ac_cv_found_db=no
-	  AC_MSG_RESULT(no)
-	else
-	  ac_cv_found_db=yes
-	  AC_MSG_RESULT(yes)
-	  DB_INC_DIR=$ac_cv_db_where_inc
-	  DB_LIB_DIR=$ac_cv_db_where_lib
-	  DB_INC_FLAGS="-I${DB_INC_DIR}"
-          if test "$enable_db4" = "yes"; then
-	     DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-4"
-          else
-	     DB_LIB_FLAGS="-L${DB_LIB_DIR} -ldb-3"
-          fi
-          dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally
-          dnl Allow makefile substitutions....
-          AC_SUBST(DB_INC_FLAGS)
-          AC_SUBST(DB_LIB_FLAGS)
-	  if test "X$RPATH" = "X"; then
-		RPATH=""
-	  fi
-	  case "${host}" in
-	    *-*-linux*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,-rpath,${DB_LIB_DIR}"
-	      else 
-		RPATH="${RPATH}:${DB_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-hpux*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,+b${DB_LIB_DIR}"
-	      else 
-		RPATH="${RPATH}:${DB_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-irix*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,-rpath,${DB_LIB_DIR}"
-	      else 
-		RPATH="${RPATH}:${DB_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-solaris2*)
-	      if test "$ac_cv_prog_gcc" = yes; then
-		if test "X$RPATH" = "X"; then
-		  RPATH="-Wl,-R${DB_LIB_DIR}"
-		else 
-		  RPATH="${RPATH}:${DB_LIB_DIR}"
-		fi
-	      else
-	        RPATH="${RPATH} -R${DB_LIB_DIR}"
-	      fi
-	      ;;
-	  esac
-	  AC_SUBST(RPATH)
-	fi
-	])
-
-
-
-dnl ---- CUT HERE ---
-
-dnl These are the Cyrus Berkeley DB macros.  In an ideal world these would be
-dnl identical to the above.
-
-dnl They are here so that they can be shared between Cyrus IMAPd
-dnl and Cyrus SASL with relative ease.
-
-dnl The big difference between this and the ones above is that we don't assume
-dnl that we know the name of the library, and we try a lot of permutations
-dnl instead.  We also assume that DB4 is acceptable.
-
-dnl When we're done, there will be a BDB_LIBADD and a BDB_INCADD which should
-dnl be used when necessary.  We should probably be smarter about our RPATH
-dnl handling.
-
-dnl Call these with BERKELEY_DB_CHK.
-
-dnl We will also set $dblib to "berkeley" if we are successful, "no" otherwise.
-
-dnl this is unbelievably painful due to confusion over what db-3 should be
-dnl named and where the db-3 header file is located.  arg.
-AC_DEFUN([CYRUS_BERKELEY_DB_CHK_LIB],
-[
-	BDB_SAVE_LDFLAGS=$LDFLAGS
-
-	if test -d $with_bdb_lib; then
-	    CMU_ADD_LIBPATH_TO($with_bdb_lib, LDFLAGS)
-	    CMU_ADD_LIBPATH_TO($with_bdb_lib, BDB_LIBADD)
-	else
-	    BDB_LIBADD=""
-	fi
-
-	saved_LIBS=$LIBS
-        for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
-          do
-	    LIBS="$saved_LIBS -l$dbname"
-	    AC_TRY_LINK([#include <db.h>],
-	    [db_create(NULL, NULL, 0);],
-	    BDB_LIBADD="$BDB_LIBADD -l$dbname"; dblib="berkeley"; dbname=db,
-            dblib="no")
-	    if test "$dblib" = "berkeley"; then break; fi
-          done
-        if test "$dblib" = "no"; then
-	    LIBS="$saved_LIBS -ldb"
-	    AC_TRY_LINK([#include <db.h>],
-	    [db_open(NULL, 0, 0, 0, NULL, NULL, NULL);],
-	    BDB_LIBADD="$BDB_LIBADD -ldb"; dblib="berkeley"; dbname=db,
-            dblib="no")
-        fi
-	LIBS=$saved_LIBS
-
-	LDFLAGS=$BDB_SAVE_LDFLAGS
-])
-
-AC_DEFUN([CYRUS_BERKELEY_DB_OPTS],
-[
-AC_ARG_WITH(bdb-libdir,
-	[  --with-bdb-libdir=DIR   Berkeley DB lib files are in DIR],
-	with_bdb_lib=$withval,
-	[ test "${with_bdb_lib+set}" = set || with_bdb_lib=none])
-AC_ARG_WITH(bdb-incdir,
-	[  --with-bdb-incdir=DIR   Berkeley DB include files are in DIR],
-	with_bdb_inc=$withval,
-	[ test "${with_bdb_inc+set}" = set || with_bdb_inc=none ])
-])
-
-AC_DEFUN([CYRUS_BERKELEY_DB_CHK],
-[
-	AC_REQUIRE([CYRUS_BERKELEY_DB_OPTS])
-
-	cmu_save_CPPFLAGS=$CPPFLAGS
-
-	if test -d $with_bdb_inc; then
-	    CPPFLAGS="$CPPFLAGS -I$with_bdb_inc"
-	    BDB_INCADD="-I$with_bdb_inc"
-	else
-	    BDB_INCADD=""
-	fi
-
-	dnl Note that FreeBSD puts it in a wierd place
-        dnl (but they should use with-bdb-incdir)
-        AC_CHECK_HEADER(db.h,
-                        [CYRUS_BERKELEY_DB_CHK_LIB()],
-                        dblib="no")
-
-	CPPFLAGS=$cmu_save_CPPFLAGS
-])
-
-dnl $Id: common.m4,v 1.11 2003/10/08 20:35:24 rjs3 Exp $
-
-AC_DEFUN([CMU_TEST_LIBPATH], [
-changequote(<<, >>)
-define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>))
-changequote([, ])
-if test "$CMU_AC_CV_FOUND" = "yes"; then
-  if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl"; then
-    CMU_AC_CV_FOUND=no
-  fi
-fi
-])
-
-AC_DEFUN([CMU_TEST_INCPATH], [
-changequote(<<, >>)
-define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_inc, [ *], [_p]))
-changequote([, ])
-if test "$CMU_AC_CV_FOUND" = "yes"; then
-  if test \! -r "$1/$2.h"; then
-    CMU_AC_CV_FOUND=no
-  fi
-fi
-])
-
-dnl CMU_CHECK_HEADER_NOCACHE(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-AC_DEFUN([CMU_CHECK_HEADER_NOCACHE],
-[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
-ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
-AC_MSG_CHECKING([for $1])
-AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
-  eval "ac_cv_header_$ac_safe=no")
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  AC_MSG_RESULT(yes)
-  ifelse([$2], , :, [$2])
-else
-  AC_MSG_RESULT(no)
-ifelse([$3], , , [$3
-])dnl
-fi
-])
-
-dnl afs.m4--AFS libraries, includes, and dependencies
-dnl $Id: afs.m4,v 1.28 2004/04/29 22:00:07 cg2v Exp $
-dnl Chaskiel Grundman
-dnl based on kerberos_v4.m4
-dnl Derrick Brashear
-dnl from KTH krb and Arla
-
-AC_DEFUN([CMU_AFS_INC_WHERE1], [
-cmu_save_CPPFLAGS=$CPPFLAGS
-CPPFLAGS="$cmu_save_CPPFLAGS -I$1"
-AC_TRY_COMPILE([#include <afs/param.h>],
-[#ifndef SYS_NAME
-choke me
-#endif
-int foo;],
-ac_cv_found_afs_inc=yes,
-ac_cv_found_afs_inc=no)
-CPPFLAGS=$cmu_save_CPPFLAGS
-])
-
-AC_DEFUN([CMU_AFS_LIB_WHERE1], [
-save_LIBS="$LIBS"
-save_LDFLAGS="$LDFLAGS"
-
-LIBS="-lauth $1/afs/util.a $LIB_SOCKET $LIBS"
-LDFLAGS="-L$1 -L$1/afs $LDFLAGS"
-dnl suppress caching
-AC_TRY_LINK([],[afsconf_Open();], ac_cv_found_afs_lib=yes, ac_cv_found_afs_lib=no)
-LIBS="$save_LIBS"
-LDFLAGS="$save_LDFLAGS"
-])
-
-AC_DEFUN([CMU_AFS_WHERE], [
-   for i in $1; do
-      AC_MSG_CHECKING(for AFS in $i)
-      CMU_AFS_INC_WHERE1("$i/include")
-      ac_cv_found_lwp_inc=$ac_cv_found_afs_inc
-      CMU_TEST_INCPATH($i/include, lwp) 
-      ac_cv_found_afs_inc=$ac_cv_found_lwp_inc
-      if test "$ac_cv_found_afs_inc" = "yes"; then
-        CMU_AFS_LIB_WHERE1("$i/lib")
-        if test "$ac_cv_found_afs_lib" = "yes"; then
-          ac_cv_afs_where=$i
-          AC_MSG_RESULT(found)
-          break
-        else
-          AC_MSG_RESULT(not found)
-        fi
-      else
-        AC_MSG_RESULT(not found)
-      fi
-    done
-])
-
-AC_DEFUN([CMU_AFS], [
-AC_REQUIRE([CMU_SOCKETS])
-AC_REQUIRE([CMU_LIBSSL])
-AC_ARG_WITH(AFS,
-	[  --with-afs=PREFIX      Compile with AFS support],
-	[if test "X$with_AFS" = "X"; then
-		with_AFS=yes
-	fi])
-
-	if test "X$with_AFS" != "X"; then
-	  ac_cv_afs_where=$with_AFS
-	fi
-	if test "X$ac_cv_afs_where" = "X"; then
-	  CMU_AFS_WHERE(/usr/afsws /usr/local /usr/athena /Library/OpenAFS/Tools)
-	fi
-
-	AC_MSG_CHECKING(whether to include AFS)
-	if test "X$ac_cv_afs_where" = "Xno" -o "X$ac_cv_afs_where" = "X"; then
-	  ac_cv_found_afs=no
-	  AC_MSG_RESULT(no)
-	else
-	  ac_cv_found_afs=yes
-	  AC_MSG_RESULT(yes)
-	  AFS_INC_DIR="$ac_cv_afs_where/include"
-	  AFS_LIB_DIR="$ac_cv_afs_where/lib"
-	  AFS_TOP_DIR="$ac_cv_afs_where"
-	  AFS_INC_FLAGS="-I${AFS_INC_DIR}"
-          AFS_LIB_FLAGS="-L${AFS_LIB_DIR} -L${AFS_LIB_DIR}/afs"
-          cmu_save_LIBS="$LIBS"
-          cmu_save_CPPFLAGS="$CPPFLAGS"
-          CPPFLAGS="$CPPFLAGS ${AFS_INC_FLAGS}"
-	  cmu_save_LDFLAGS="$LDFLAGS"
- 	  LDFLAGS="$cmu_save_LDFLAGS ${AFS_LIB_FLAGS}"
-                        
-          AC_CHECK_HEADERS(afs/stds.h)
-
-          AC_MSG_CHECKING([if libdes is needed])
-          AC_TRY_LINK([],[des_quad_cksum();],AFS_DES_LIB="",AFS_DES_LIB="maybe")
-          if test "X$AFS_DES_LIB" != "X"; then
-              LIBS="$cmu_save_LIBS -ldes"
-              AC_TRY_LINK([], [des_quad_cksum();],AFS_DES_LIB="yes")
-              if test "X$AFS_DES_LIB" = "Xyes"; then
-                  AC_MSG_RESULT([yes])
-    	          AFS_LIBDES="-ldes"
-    	          AFS_LIBDESA="${AFS_LIB_DIR}/libdes.a"
-    	      else
-   	          LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
- 	          AC_TRY_LINK([],
-	          [des_quad_cksum();],AFS_DES_LIB="libcrypto")
-	          if test "X$AFS_DES_LIB" = "Xlibcrypto"; then
-	              AC_MSG_RESULT([libcrypto])
-		      AFS_LIBDES="$LIBSSL_LIB_FLAGS"
-	              AFS_LIBDESA="$LIBSSL_LIB_FLAGS"
-	          else
-         	      AC_MSG_RESULT([unknown])
-	              AC_MSG_ERROR([Could not use -ldes])
-	          fi 
-	      fi 
-	  else
-             AC_MSG_RESULT([no])
-          fi
-
-
-	  AFS_CLIENT_LIBS_STATIC="${AFS_LIB_DIR}/afs/libvolser.a ${AFS_LIB_DIR}/afs/libvldb.a ${AFS_LIB_DIR}/afs/libkauth.a ${AFS_LIB_DIR}/afs/libprot.a ${AFS_LIB_DIR}/libubik.a ${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/librxkad.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcmd.a ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
-          AFS_KTC_LIBS_STATIC="${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
-	  AFS_CLIENT_LIBS="-lvolser -lvldb -lkauth -lprot -lubik -lauth -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a"
-	  AFS_RX_LIBS="-lauth -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a"
-          AFS_KTC_LIBS="-lauth ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcom_err ${AFS_LIB_DIR}/afs/util.a"
-
-          LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
-          AC_CHECK_FUNC(des_pcbc_init)
-          if test "X$ac_cv_func_des_pcbc_init" != "Xyes"; then
-           AC_CHECK_LIB(descompat, des_pcbc_init, AFS_DESCOMPAT_LIB="-ldescompat")
-           if test "X$AFS_DESCOMPAT_LIB" != "X" ; then
-                AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_DESCOMPAT_LIB"
-                AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_DESCOMPAT_LIB"
-                AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_DESCOMPAT_LIB"
-                AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_DESCOMPAT_LIB"
-           else
-
-           AC_MSG_CHECKING([if rxkad needs des_pcbc_init])
-           AC_TRY_LINK(,[tkt_DecodeTicket();],RXKAD_PROBLEM=no,RXKAD_PROBLEM=maybe)
-            if test "$RXKAD_PROBLEM" = "maybe"; then
-              AC_TRY_LINK([int des_pcbc_init() { return 0;}],
-              [tkt_DecodeTicket();],RXKAD_PROBLEM=yes,RXKAD_PROBLEM=error)
-              if test "$RXKAD_PROBLEM" = "yes"; then
-                    AC_MSG_RESULT([yes])
-                    AC_MSG_ERROR([cannot use rxkad])
-              else
-                    AC_MSG_RESULT([unknown])        
-                    AC_MSG_ERROR([Unknown error testing rxkad])
-              fi
-            else
-              AC_MSG_RESULT([no])
-            fi
-           fi
-          fi
-
-          LIBS="$cmu_save_LIBS"
-          AC_CHECK_FUNC(flock)
-          LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
-          if test "X$ac_cv_func_flock" != "Xyes"; then
-             AC_MSG_CHECKING([if AFS needs flock])
-             AC_TRY_LINK([#include <afs/param.h>
-#ifdef HAVE_AFS_STDS_H
-#include <afs/stds.h>
-#endif
-#include <ubik.h>
-#include <afs/cellconfig.h>
-#include <afs/auth.h>
-#include <afs/volser.h>
-struct ubik_client * cstruct;
-int sigvec() {return 0;}
-extern int UV_SetSecurity();],
-             [vsu_ClientInit(1,"","",0,
-                             &cstruct,UV_SetSecurity)],
-             AFS_FLOCK=no,AFS_FLOCK=yes)
-             if test $AFS_FLOCK = "no"; then
-                AC_MSG_RESULT([no])
-             else
-               AC_MSG_RESULT([yes])
-               LDFLAGS="$LDFLAGS -L/usr/ucblib"
-               AC_CHECK_LIB(ucb, flock,:, [AC_CHECK_LIB(BSD, flock)])
-             fi
-          fi
-          LIBS="$cmu_save_LIBS"
-          AC_CHECK_FUNC(sigvec)
-          LIBS="$cmu_save_LIBS ${AFS_CLIENT_LIBS} ${LIB_SOCKET}"
-          if test "X$ac_cv_func_sigvec" != "Xyes"; then
-             AC_MSG_CHECKING([if AFS needs sigvec])
-             AC_TRY_LINK([#include <afs/param.h>
-#ifdef HAVE_AFS_STDS_H
-#include <afs/stds.h>
-#endif
-#include <ubik.h>
-#include <afs/cellconfig.h>
-#include <afs/auth.h>
-#include <afs/volser.h>
-struct ubik_client * cstruct;
-int flock() {return 0;}
-extern int UV_SetSecurity();],
-             [vsu_ClientInit(1,"","",0,
-                             &cstruct,UV_SetSecurity)],
-             AFS_SIGVEC=no,AFS_SIGVEC=yes)
-             if test $AFS_SIGVEC = "no"; then
-                AC_MSG_RESULT([no])
-             else
-               AC_MSG_RESULT([yes])
-               LDFLAGS="$LDFLAGS -L/usr/ucblib"
-               AC_CHECK_LIB(ucb, sigvec,:,[AC_CHECK_LIB(BSD, sigvec)])
-             fi
-          fi
-          if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
-             AFS_LIB_FLAGS="${AFS_LIB_FLAGS} -L/usr/ucblib -R/usr/ucblib"
-          fi
-          if test "$ac_cv_lib_ucb_flock" = "yes" -o "$ac_cv_lib_ucb_sigvec" = "yes"; then
-             AFS_BSD_LIB="-lucb"
-          elif test "$ac_cv_lib_BSD_flock" = "yes" -o "$ac_cv_lib_BSD_sigvec" = "yes"; then
-             AFS_BSD_LIB="-lBSD"
-          fi
-          if test "X$AFS_BSD_LIB" != "X" ; then
-                AFS_CLIENT_LIBS_STATIC="$AFS_CLIENT_LIBS_STATIC $AFS_BSD_LIB"
-                AFS_KTC_LIBS_STATIC="$AFS_KTC_LIBS_STATIC $AFS_BSD_LIB"
-                AFS_CLIENT_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
-                AFS_RX_LIBS="$AFS_CLIENT_LIBS $AFS_BSD_LIB"
-                AFS_KTC_LIBS="$AFS_KTC_LIBS $AFS_BSD_LIB"
-          fi
-
-          AC_MSG_CHECKING([if libaudit is needed])
-	  AFS_LIBAUDIT=""
-          LIBS="$cmu_save_LIBS $AFS_CLIENT_LIBS ${LIB_SOCKET}"
-          AC_TRY_LINK([#include <afs/param.h>
-#ifdef HAVE_AFS_STDS_H
-#include <afs/stds.h>
-#endif
-#include <afs/cellconfig.h>
-#include <afs/auth.h>],
-          [afsconf_SuperUser();],AFS_AUDIT_LIB="",AFS_AUDIT_LIB="maybe")
-          if test "X$AFS_AUDIT_LIB" != "X"; then
-          LIBS="$cmu_save_LIBS -lvolser -lvldb -lkauth -lprot -lubik -lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB $LIB_SOCKET"
-             AC_TRY_LINK([#include <afs/param.h>
-#ifdef HAVE_AFS_STDS_H
-#include <afs/stds.h>
-#endif
-#include <afs/cellconfig.h>
-#include <afs/auth.h>],
-             [afsconf_SuperUser();],AFS_AUDIT_LIB="yes")
-             if test "X$AFS_AUDIT_LIB" = "Xyes"; then
-                 AC_MSG_RESULT([yes])
-	         AFS_LIBAUDIT="-laudit"
-	         AFS_CLIENT_LIBS_STATIC="${AFS_LIB_DIR}/afs/libvolser.a ${AFS_LIB_DIR}/afs/libvldb.a ${AFS_LIB_DIR}/afs/libkauth.a ${AFS_LIB_DIR}/afs/libprot.a ${AFS_LIB_DIR}/libubik.a ${AFS_LIB_DIR}/afs/libauth.a ${AFS_LIB_DIR}/afs/libaudit.a ${AFS_LIB_DIR}/librxkad.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/afs/libsys.a ${AFS_LIB_DIR}/librx.a ${AFS_LIB_DIR}/liblwp.a ${AFS_LIBDESA} ${AFS_LIB_DIR}/afs/libcmd.a ${AFS_LIB_DIR}/afs/libcom_err.a ${AFS_LIB_DIR}/afs/util.a"
-                 AFS_CLIENT_LIBS="-lvolser -lvldb -lkauth -lprot -lubik -lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB"
-                 AFS_RX_LIBS="-lauth -laudit -lrxkad -lrx ${AFS_LIB_DIR}/afs/libsys.a -lrx -llwp ${AFS_LIBDES} -lcmd -lcom_err ${AFS_LIB_DIR}/afs/util.a $AFS_BSD_LIB $AFS_DESCOMPAT_LIB"
-             else
-                 AC_MSG_RESULT([unknown])
-                 AC_MSG_ERROR([Could not use -lauth while testing for -laudit])
-             fi 
-          else
-             AC_MSG_RESULT([no])
-          fi
-
-	  AC_CHECK_FUNCS(VL_ProbeServer)
-          AC_MSG_CHECKING([if new-style afs_ integer types are defined])
-          AC_CACHE_VAL(ac_cv_afs_int32,
-dnl The next few lines contain a quoted argument to egrep
-dnl It is critical that there be no leading or trailing whitespace
-dnl or newlines
-[AC_EGREP_CPP(dnl
-changequote(<<,>>)dnl
-<<(^|[^a-zA-Z_0-9])afs_int32[^a-zA-Z_0-9]>>dnl
-changequote([,]), [#include <afs/param.h>
-#ifdef HAVE_AFS_STDS_H
-#include <afs/stds.h>
-#endif],
-ac_cv_afs_int32=yes, ac_cv_afs_int32=no)])
-          AC_MSG_RESULT($ac_cv_afs_int32)
-          if test $ac_cv_afs_int32 = yes ; then
-            AC_DEFINE(HAVE_AFS_INT32,, [AFS provides new "unambiguous" type names])
-          else
-            AC_DEFINE(afs_int16, int16, [it's a type definition])
-            AC_DEFINE(afs_int32, int32, [it's a type definition])
-            AC_DEFINE(afs_uint16, u_int16, [it's a type definition])
-            AC_DEFINE(afs_uint32, u_int32, [it's a type definition])
-          fi
-
-          CPPFLAGS="${cmu_save_CPPFLAGS}"
-          LDFLAGS="${cmu_save_LDFLAGS}"
-          LIBS="${cmu_save_LIBS}"
-	  AC_DEFINE(AFS_ENV,, [Use AFS. (find what needs this and nuke it)])
-          AC_DEFINE(AFS,, [Use AFS. (find what needs this and nuke it)])
-          AC_SUBST(AFS_CLIENT_LIBS_STATIC)
-          AC_SUBST(AFS_KTC_LIBS_STATIC)
-          AC_SUBST(AFS_CLIENT_LIBS)
-          AC_SUBST(AFS_RX_LIBS)
-          AC_SUBST(AFS_KTC_LIBS)
-          AC_SUBST(AFS_INC_FLAGS)
-          AC_SUBST(AFS_LIB_FLAGS)
-	  AC_SUBST(AFS_TOP_DIR)
-	  AC_SUBST(AFS_LIBAUDIT)
-	  AC_SUBST(AFS_LIBDES)
-          AC_SUBST(AFS_LIBDESA)
-       	fi
-	])
-
-AC_DEFUN([CMU_NEEDS_AFS],
-[AC_REQUIRE([CMU_AFS])
-if test "$ac_cv_found_afs" != "yes"; then
-        AC_ERROR([Cannot continue without AFS])
-fi])
-
-dnl libssl.m4--Ssl libraries and includes
-dnl Derrick Brashear
-dnl from KTH kafs and Arla
-dnl $Id: libssl.m4,v 1.9 2003/10/08 20:35:25 rjs3 Exp $
-
-AC_DEFUN([CMU_LIBSSL_INC_WHERE1], [
-saved_CPPFLAGS=$CPPFLAGS
-CPPFLAGS="$saved_CPPFLAGS -I$1"
-CMU_CHECK_HEADER_NOCACHE(openssl/ssl.h,
-ac_cv_found_libssl_inc=yes,
-ac_cv_found_libssl_inc=no)
-CPPFLAGS=$saved_CPPFLAGS
-])
-
-AC_DEFUN([CMU_LIBSSL_INC_WHERE], [
-   for i in $1; do
-      AC_MSG_CHECKING(for libssl headers in $i)
-      CMU_LIBSSL_INC_WHERE1($i)
-      CMU_TEST_INCPATH($i, ssl)
-      if test "$ac_cv_found_libssl_inc" = "yes"; then
-        ac_cv_libssl_where_inc=$i
-        AC_MSG_RESULT(found)
-        break
-      else
-        AC_MSG_RESULT(not found)
-      fi
-    done
-])
-
-AC_DEFUN([CMU_LIBSSL_LIB_WHERE1], [
-saved_LIBS=$LIBS
-LIBS="$saved_LIBS -L$1 -lssl -lcrypto $LIB_SOCKET"
-AC_TRY_LINK(,
-[SSL_write();],
-[ac_cv_found_ssl_lib=yes],
-ac_cv_found_ssl_lib=no)
-LIBS=$saved_LIBS
-])
-
-AC_DEFUN([CMU_LIBSSL_LIB_WHERE], [
-   for i in $1; do
-      AC_MSG_CHECKING(for libssl libraries in $i)
-      CMU_LIBSSL_LIB_WHERE1($i)
-      dnl deal with false positives from implicit link paths
-      CMU_TEST_LIBPATH($i, ssl)
-      if test "$ac_cv_found_ssl_lib" = "yes" ; then
-        ac_cv_libssl_where_lib=$i
-        AC_MSG_RESULT(found)
-        break
-      else
-        AC_MSG_RESULT(not found)
-      fi
-    done
-])
-
-AC_DEFUN([CMU_LIBSSL], [
-AC_REQUIRE([CMU_SOCKETS])
-AC_ARG_WITH(libssl,
-	[  --with-libssl=PREFIX      Compile with Libssl support],
-	[if test "X$with_libssl" = "X"; then
-		with_libssl=yes
-	fi])
-AC_ARG_WITH(libssl-lib,
-	[  --with-libssl-lib=dir     use libssl libraries in dir],
-	[if test "$withval" = "yes" -o "$withval" = "no"; then
-		AC_MSG_ERROR([No argument for --with-libssl-lib])
-	fi])
-AC_ARG_WITH(libssl-include,
-	[  --with-libssl-include=dir use libssl headers in dir],
-	[if test "$withval" = "yes" -o "$withval" = "no"; then
-		AC_MSG_ERROR([No argument for --with-libssl-include])
-	fi])
-
-	if test "X$with_libssl" != "X"; then
-	  if test "$with_libssl" != "yes" -a "$with_libssl" != no; then
-	    ac_cv_libssl_where_lib=$with_libssl/lib
-	    ac_cv_libssl_where_inc=$with_libssl/include
-	  fi
-	fi
-
-	if test "$with_libssl" != "no"; then 
-	  if test "X$with_libssl_lib" != "X"; then
-	    ac_cv_libssl_where_lib=$with_libssl_lib
-	  fi
-	  if test "X$ac_cv_libssl_where_lib" = "X"; then
-	    CMU_LIBSSL_LIB_WHERE(/usr/local/lib/openssl /usr/lib/openssl /usr/local/lib /usr/lib)
-	  fi
-
-	  if test "X$with_libssl_include" != "X"; then
-	    ac_cv_libssl_where_inc=$with_libssl_include
-	  fi
-	  if test "X$ac_cv_libssl_where_inc" = "X"; then
-	    CMU_LIBSSL_INC_WHERE(/usr/local/include /usr/include)
-	  fi
-	fi
-
-	AC_MSG_CHECKING(whether to include libssl)
-	if test "X$ac_cv_libssl_where_lib" = "X" -a "X$ac_cv_libssl_where_inc" = "X"; then
-	  ac_cv_found_libssl=no
-	  AC_MSG_RESULT(no)
-	else
-	  ac_cv_found_libssl=yes
-	  AC_MSG_RESULT(yes)
-	  LIBSSL_INC_DIR=$ac_cv_libssl_where_inc
-	  LIBSSL_LIB_DIR=$ac_cv_libssl_where_lib
-	  LIBSSL_INC_FLAGS="-I${LIBSSL_INC_DIR}"
-	  LIBSSL_LIB_FLAGS="-L${LIBSSL_LIB_DIR} -lssl -lcrypto"
-	  if test "X$RPATH" = "X"; then
-		RPATH=""
-	  fi
-	  case "${host}" in
-	    *-*-linux*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
-	      else 
- 		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-hpux*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,+b${LIBSSL_LIB_DIR}"
-	      else 
-		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-irix*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,-rpath,${LIBSSL_LIB_DIR}"
-	      else 
-		RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-solaris2*)
-	      if test "$ac_cv_prog_gcc" = yes; then
-		if test "X$RPATH" = "X"; then
-		  RPATH="-Wl,-R${LIBSSL_LIB_DIR}"
-		else 
-		  RPATH="${RPATH}:${LIBSSL_LIB_DIR}"
-		fi
-	      else
-	        RPATH="${RPATH} -R${LIBSSL_LIB_DIR}"
-	      fi
-	      ;;
-	  esac
-	  AC_SUBST(RPATH)
-	fi
-	AC_SUBST(LIBSSL_INC_DIR)
-	AC_SUBST(LIBSSL_LIB_DIR)
-	AC_SUBST(LIBSSL_INC_FLAGS)
-	AC_SUBST(LIBSSL_LIB_FLAGS)
-	])
-
-
-dnl kerberos_v4.m4--Kerberos 4 libraries and includes
-dnl Derrick Brashear
-dnl from KTH krb and Arla
-dnl $Id: kerberos_v4.m4,v 1.27 2004/02/05 18:28:47 cg2v Exp $
-
-AC_DEFUN([CMU_KRB_SENDAUTH_PROTO], [
-AC_MSG_CHECKING(for krb_sendauth prototype)
-AC_TRY_COMPILE(
-[#include <krb.h>
-int krb_sendauth (long options, int fd, KTEXT ktext, char *service,
-                  char *inst, char *realm, u_long checksum,
-                  MSG_DAT *msg_data, CREDENTIALS *cred,
-                  Key_schedule schedule, struct sockaddr_in *laddr,
-                  struct sockaddr_in *faddr, char *version);],
-[int foo = krb_sendauth(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ],
-ac_cv_krb_sendauth_proto=no,
-ac_cv_krb_sendauth_proto=yes)
-AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
-if test "$ac_cv_krb_sendauth_proto" = yes; then
-        AC_DEFINE(HAVE_KRB_SENDAUTH_PROTO)dnl
-fi
-AC_MSG_RESULT($ac_cv_krb_sendauth_proto)
-])
-
-AC_DEFUN([CMU_KRB_SET_KEY_PROTO], [
-AC_MSG_CHECKING(for krb_set_key prototype)
-AC_CACHE_VAL(ac_cv_krb_set_key_proto, [
-cmu_save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
-AC_TRY_COMPILE(
-[#include <krb.h>
-int krb_set_key(char *key, int cvt);],
-[int foo = krb_set_key(0, 0);],
-ac_cv_krb_set_key_proto=no,
-ac_cv_krb_set_key_proto=yes)
-])
-CPPFLAGS="${cmu_save_CPPFLAGS}"
-if test "$ac_cv_krb_set_key_proto" = yes; then
-	AC_DEFINE(HAVE_KRB_SET_KEY_PROTO)dnl
-fi
-AC_MSG_RESULT($ac_cv_krb_set_key_proto)
-])
-
-AC_DEFUN([CMU_KRB4_32_DEFN], [
-AC_MSG_CHECKING(for KRB4_32 definition)
-AC_CACHE_VAL(ac_cv_krb4_32_defn, [
-cmu_save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
-AC_TRY_COMPILE(
-[#include <krb.h>
-],
-[KRB4_32 foo = 1;],
-ac_cv_krb4_32_defn=yes,
-ac_cv_krb4_32_defn=no)
-])
-CPPFLAGS="${cmu_save_CPPFLAGS}"
-if test "$ac_cv_krb4_32_defn" = yes; then
-	AC_DEFINE(HAVE_KRB4_32_DEFINE)dnl
-fi
-AC_MSG_RESULT($ac_cv_krb4_32_defn)
-])
-
-AC_DEFUN([CMU_KRB_RD_REQ_PROTO], [
-AC_MSG_CHECKING(for krb_rd_req prototype)
-AC_CACHE_VAL(ac_cv_krb_rd_req_proto, [
-cmu_save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="${CPPFLAGS} ${KRB_INC_FLAGS}"
-AC_TRY_COMPILE(
-[#include <krb.h>
-int krb_rd_req(KTEXT authent, char *service, char *instance,
-unsigned KRB_INT32 from_addr, AUTH_DAT *ad, char *fn);],
-[int foo = krb_rd_req(0,0,0,0,0,0);],
-ac_cv_krb_rd_req_proto=no,
-ac_cv_krb_rd_req_proto=yes)
-])
-CPPFLAGS="${cmu_save_CPPFLAGS}"
-if test "$ac_cv_krb_rd_req_proto" = yes; then
-	AC_DEFINE(HAVE_KRB_RD_REQ_PROTO)dnl
-fi
-AC_MSG_RESULT($ac_cv_krb_rd_req_proto)
-])
-
-AC_DEFUN([CMU_KRB_INC_WHERE1], [
-saved_CPPFLAGS=$CPPFLAGS
-CPPFLAGS="$saved_CPPFLAGS -I$1"
-AC_TRY_COMPILE([#include <krb.h>],
-[struct ktext foo;],
-ac_cv_found_krb_inc=yes,
-ac_cv_found_krb_inc=no)
-if test "$ac_cv_found_krb_inc" = "no"; then
-  CPPFLAGS="$saved_CPPFLAGS -I$1 -I$1/kerberosIV"
-  AC_TRY_COMPILE([#include <krb.h>],
-  [struct ktext foo;],
-  [ac_cv_found_krb_inc=yes],
-  ac_cv_found_krb_inc=no)
-fi
-CPPFLAGS=$saved_CPPFLAGS
-])
-
-AC_DEFUN([CMU_KRB_INC_WHERE], [
-   for i in $1; do
-      AC_MSG_CHECKING(for kerberos headers in $i)
-      CMU_KRB_INC_WHERE1($i)
-      CMU_TEST_INCPATH($i, krb)
-      if test "$ac_cv_found_krb_inc" = "yes"; then
-        ac_cv_krb_where_inc=$i
-        AC_MSG_RESULT(found)
-        break
-      else
-        AC_MSG_RESULT(not found)
-      fi
-    done
-])
-
-#
-# Test for kerberos lib files
-#
-
-AC_DEFUN([CMU_KRB_LIB_WHERE1], [
-saved_LIBS=$LIBS
-LIBS="$saved_LIBS -L$1 -lkrb ${KRB_LIBDES}"
-AC_TRY_LINK(,
-[dest_tkt();],
-[ac_cv_found_krb_lib=yes],
-ac_cv_found_krb_lib=no)
-LIBS=$saved_LIBS
-])
-
-AC_DEFUN([CMU_KRB_LIB_WHERE], [
-   for i in $1; do
-      AC_MSG_CHECKING(for kerberos libraries in $i)
-      CMU_KRB_LIB_WHERE1($i)
-      dnl deal with false positives from implicit link paths
-      CMU_TEST_LIBPATH($i, krb)
-      if test "$ac_cv_found_krb_lib" = "yes" ; then
-        ac_cv_krb_where_lib=$i
-        AC_MSG_RESULT(found)
-        break
-      else
-        AC_MSG_RESULT(not found)
-      fi
-    done
-])
-
-AC_DEFUN([CMU_KRB4], [
-AC_REQUIRE([CMU_SOCKETS])
-AC_REQUIRE([CMU_LIBSSL])
-AC_ARG_WITH(krb4,
-	[  --with-krb4=PREFIX      Compile with Kerberos 4 support],
-	[if test "X$with_krb4" = "X"; then
-		with_krb4=yes
-	fi])
-AC_ARG_WITH(krb4-lib,
-	[  --with-krb4-lib=dir     use kerberos 4 libraries in dir],
-	[if test "$withval" = "yes" -o "$withval" = "no"; then
-		AC_MSG_ERROR([No argument for --with-krb4-lib])
-	fi])
-AC_ARG_WITH(krb4-include,
-	[  --with-krb4-include=dir use kerberos 4 headers in dir],
-	[if test "$withval" = "yes" -o "$withval" = "no"; then
-		AC_MSG_ERROR([No argument for --with-krb4-include])
-	fi])
-
-	if test "X$with_krb4" != "X"; then
-	  if test "$with_krb4" != "yes" -a "$with_krb4" != "no"; then
-	    ac_cv_krb_where_lib=$with_krb4/lib
-	    ac_cv_krb_where_inc=$with_krb4/include
-	  fi
-	fi
-       
-	if test "$with_krb4" != "no"; then
-	  if test "X$with_krb4_lib" != "X"; then
-	    ac_cv_krb_where_lib=$with_krb4_lib
-	  fi
-	  if test "X$with_krb4_include" != "X"; then
-	    ac_cv_krb_where_inc=$with_krb4_include
-	  fi
-	  if test "X$ac_cv_krb_where_inc" = "X"; then
-	    CMU_KRB_INC_WHERE(/usr/athena/include /usr/include/kerberosIV /usr/local/include /usr/include/kerberos)
-	  fi
-
-          AC_MSG_CHECKING([if libdes is needed])
-          AC_TRY_LINK([],[des_quad_cksum();],KRB_DES_LIB="",KRB_DES_LIB="maybe")
-          if test "X$KRB_DES_LIB" != "X"; then
-              LIBS="$cmu_save_LIBS -ldes"
-              AC_TRY_LINK([], [des_quad_cksum();],KRB_DES_LIB="yes")
-              if test "X$KRB_DES_LIB" = "Xyes"; then
-                  AC_MSG_RESULT([yes])
-                  KRB_LIBDES="-ldes"
-                  KRB_LIBDESA='$(KRB_LIB_DIR)/libdes.a'
-              else
-                  LIBS="$cmu_save_LIBS $LIBSSL_LIB_FLAGS"
-                  AC_TRY_LINK([],
-                  [des_quad_cksum();],KRB_DES_LIB="libcrypto")
-                  if test "X$KRB_DES_LIB" = "Xlibcrypto"; then
-                      AC_MSG_RESULT([libcrypto])
-                      KRB_LIBDES="$LIBSSL_LIB_FLAGS"
-                      KRB_LIBDESA="$LIBSSL_LIB_FLAGS"
-                  else
-                      AC_MSG_RESULT([unknown])
-                      AC_MSG_ERROR([Could not use -ldes])
-                  fi 
-              fi 
-          else
-             AC_MSG_RESULT([no])
-          fi
-          if test "X$ac_cv_krb_where_lib" = "X"; then
-            CMU_KRB_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib)
-          fi
-	fi
-	  LIBS="${cmu_save_LIBS}"
-
-
-	AC_MSG_CHECKING([whether to include kerberos 4])
-	if test "X$ac_cv_krb_where_lib" = "X" -o "X$ac_cv_krb_where_inc" = "X"; then
-	  ac_cv_found_krb=no
-	  AC_MSG_RESULT(no)
-	else
-	  ac_cv_found_krb=yes
-	  AC_MSG_RESULT(yes)
-	  KRB_INC_DIR=$ac_cv_krb_where_inc
-	  KRB_LIB_DIR=$ac_cv_krb_where_lib
-	  KRB_INC_FLAGS="-I${KRB_INC_DIR}"
-	  KRB_LIB_FLAGS="-L${KRB_LIB_DIR} -lkrb ${KRB_LIBDES}"
-	  LIBS="${cmu_save_LIBS} ${KRB_LIB_FLAGS}"
-	  AC_CHECK_LIB(resolv, dns_lookup, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lresolv",,"${KRB_LIB_FLAGS}")
-	  AC_CHECK_LIB(crypt, crypt, KRB_LIB_FLAGS="${KRB_LIB_FLAGS} -lcrypt",,"${KRB_LIB_FLAGS}")
-	  LIBS="${LIBS} ${KRB_LIB_FLAGS}"
-	  AC_CHECK_FUNCS(krb_get_int krb_life_to_time)
-          AC_SUBST(KRB_INC_FLAGS)
-          AC_SUBST(KRB_LIB_FLAGS)
-	  LIBS="${cmu_save_LIBS}"
-	  AC_DEFINE(KERBEROS,,[Use kerberos 4. find out what needs this symbol])
-	  if test "X$RPATH" = "X"; then
-		RPATH=""
-	  fi
-	  case "${host}" in
-	    *-*-linux*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
-	      else 
-		RPATH="${RPATH}:${KRB_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-hpux*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,+b${KRB_LIB_DIR}"
-	      else 
-		RPATH="${RPATH}:${KRB_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-irix*)
-	      if test "X$RPATH" = "X"; then
-	        RPATH="-Wl,-rpath,${KRB_LIB_DIR}"
-	      else 
-		RPATH="${RPATH}:${KRB_LIB_DIR}"
-	      fi
-	      ;;
-	    *-*-solaris2*)
-	      if test "$ac_cv_prog_gcc" = yes; then
-		if test "X$RPATH" = "X"; then
-		  RPATH="-Wl,-R${KRB_LIB_DIR}"
-		else 
-		  RPATH="${RPATH}:${KRB_LIB_DIR}"
-		fi
-	      else
-	        RPATH="${RPATH} -R${KRB_LIB_DIR}"
-	      fi
-	      ;;
-	  esac
-	  AC_SUBST(RPATH)
-	fi
-	])
-
-
-dnl sasl2.m4--sasl2 libraries and includes
-dnl Rob Siemborski
-dnl $Id: sasl2.m4,v 1.48 2004/09/13 21:06:34 shadow Exp $
-
-AC_DEFUN([SASL_GSSAPI_CHK],[
- AC_ARG_ENABLE(gssapi, [  --enable-gssapi=<DIR>   enable GSSAPI authentication [yes] ],
-    gssapi=$enableval,
-    gssapi=yes)
- AC_ARG_WITH(gss_impl, [  --with-gss_impl={heimdal|mit|cybersafe|seam|auto}                                                       choose specific GSSAPI implementation [[auto]] ],
-    gss_impl=$withval,
-    gss_impl=auto)
- AC_REQUIRE([SASL2_CRYPT_CHK])
- AC_REQUIRE([CMU_SOCKETS])
-
- if test "$gssapi" != no; then
-    platform=
-    case "${host}" in
-      *-*-linux*)
-        platform=__linux
-        ;;
-      *-*-hpux*)
-        platform=__hpux
-        ;;
-      *-*-irix*)
-        platform=__irix
-        ;;
-      *-*-solaris2*)
-# When should we use __sunos?
-        platform=__solaris
-        ;;
-      *-*-aix*)
-        platform=__aix
-        ;;
-      *)
-        AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script])
-	if test "$gss_impl" = "cybersafe"; then
-	   AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported])
-	fi
-        ;;
-    esac
-
-    cmu_saved_CPPFLAGS=$CPPFLAGS
-
-    if test -d ${gssapi}; then
-       CPPFLAGS="$CPPFLAGS -I$gssapi/include"
-# We want to keep -I in our CPPFLAGS, but only if we succeed
-       cmu_saved_CPPFLAGS=$CPPFLAGS
-       LDFLAGS="$LDFLAGS -L$gssapi/lib"
-
-       if test -n "$platform"; then
-         if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
-           CPPFLAGS="$CPPFLAGS -D$platform"
-           if test -d "${gssapi}/appsec-sdk/include"; then
-             CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
-           fi
-         fi
-       fi
-    fi
-    AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H,,[Define if you have the gssapi.h header file]), [
-      AC_CHECK_HEADER(gssapi/gssapi.h,, AC_WARN(Disabling GSSAPI - no include files found); gssapi=no)])
-
-    CPPFLAGS=$cmu_saved_CPPFLAGS
-
- fi
-
- if test "$gssapi" != no; then
-  dnl We need to find out which gssapi implementation we are
-  dnl using. Supported alternatives are: MIT Kerberos 5,
-  dnl Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal),
-  dnl CyberSafe Kerberos 5 (http://www.cybersafe.com/)
-  dnl and Sun SEAM (http://wwws.sun.com/software/security/kerberos/)
-  dnl
-  dnl The choice is reflected in GSSAPIBASE_LIBS
-
-  AC_CHECK_LIB(resolv,res_search)
-  if test -d ${gssapi}; then
-     gssapi_dir="${gssapi}/lib"
-     GSSAPIBASE_LIBS="-L$gssapi_dir"
-     GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir"
-  else
-     dnl FIXME: This is only used for building cyrus, and then only as
-     dnl a real hack.  it needs to be fixed.
-     gssapi_dir="/usr/local/lib"
-  fi
-
-  # Check a full link against the Heimdal libraries.
-  # If this fails, check a full link against the MIT libraries.
-  # If this fails, check a full link against the CyberSafe libraries.
-  # If this fails, check a full link against the Solaris 8 and up libgss.
-
-  if test "$gss_impl" = "auto" -o "$gss_impl" = "heimdal"; then
-    gss_failed=0
-    AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1,$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET})
-    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
-      gss_impl="failed"
-    fi
-  fi
-
-  if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then
-    gss_failed=0
-    AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1,$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${LIB_SOCKET})
-    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
-      gss_impl="failed"
-    fi
-  fi
-
-  # For Cybersafe one has to set a platform define in order to make compilation work
-  if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
-
-    cmu_saved_CPPFLAGS=$CPPFLAGS
-    cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS
-# FIX ME - Note that the libraries are in .../lib/64 for 64bit kernels
-    if test -d "${gssapi}/appsec-rt/lib"; then
-      GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib"
-    fi
-    CPPFLAGS="$CPPFLAGS -D$platform"
-    if test -d "${gssapi}/appsec-sdk/include"; then
-      CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
-    fi
-
-    gss_failed=0
-
-# Check for CyberSafe with two libraries first, than fall back to a single 
-# library (older CyberSafe)
-
-    unset ac_cv_lib_gss_csf_gss_acq_user
-    AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03",[
-      unset ac_cv_lib_gss_csf_gss_acq_user;AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe",gss_failed=1,$GSSAPIBASE_LIBS -lgss)],$GSSAPIBASE_LIBS -lgss -lcstbk5)
-
-    if test "$gss_failed" = "1"; then
-# Restore variables
-      GSSAPIBASE_LIBS=$cmu_saved_GSSAPIBASE_LIBS
-      CPPFLAGS=$cmu_saved_CPPFLAGS
-
-      if test "$gss_impl" != "auto"; then
-        gss_impl="failed"
-      fi
-    fi
-  fi
-
-  if test "$gss_impl" = "auto" -o "$gss_impl" = "seam"; then
-    gss_failed=0
-    AC_CHECK_LIB(gss,gss_unwrap,gss_impl="seam",gss_failed=1,-lgss)
-    if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
-      gss_impl="failed"
-    fi
-  fi
-
-  if test "$gss_impl" = "mit"; then
-    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
-    GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a"
-  elif test "$gss_impl" = "heimdal"; then
-    CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL"
-    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err"
-    GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_STATIC_LIBS $gssapi_dir/libgssapi.a $gssapi_dir/libkrb5.a $gssapi_dir/libasn1.a $gssapi_dir/libroken.a $gssapi_dir/libcom_err.a ${LIB_CRYPT}"
-  elif test "$gss_impl" = "cybersafe03"; then
-# Version of CyberSafe with two libraries
-    CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
-    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss -lcstbk5"
-    # there is no static libgss for CyberSafe
-    GSSAPIBASE_STATIC_LIBS=none
-  elif test "$gss_impl" = "cybersafe"; then
-    CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include"
-    GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss"
-    # there is no static libgss for CyberSafe
-    GSSAPIBASE_STATIC_LIBS=none
-  elif test "$gss_impl" = "seam"; then
-    GSSAPIBASE_LIBS=-lgss
-    # there is no static libgss on Solaris 8 and up
-    GSSAPIBASE_STATIC_LIBS=none
-  elif test "$gss_impl" = "failed"; then
-    gssapi="no"
-    GSSAPIBASE_LIBS=
-    GSSAPIBASE_STATIC_LIBS=
-    AC_WARN(Disabling GSSAPI - specified library not found)
-  else
-    gssapi="no"
-    GSSAPIBASE_LIBS=
-    GSSAPIBASE_STATIC_LIBS=
-    AC_WARN(Disabling GSSAPI - no library)
-  fi
- fi
-
-#
-# Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME in gssapi\rfckrb5.h
-#
- if test "$gssapi" != "no"; then
-  if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
-   AC_EGREP_CPP(hostbased_service_gss_nt_yes,
-    [#include <gssapi/gssapi.h>
-     #ifdef GSS_C_NT_HOSTBASED_SERVICE
-      hostbased_service_gss_nt_yes
-     #endif
-    ], AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]), AC_WARN(Cybersafe define not found))
-
-  elif test "$ac_cv_header_gssapi_h" = "yes"; then
-   AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h,
-     AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]))
-  elif test "$ac_cv_header_gssapi_gssapi_h"; then
-
-   AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h,
-     AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]))
-  fi
-
-  if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
-   AC_EGREP_CPP(user_name_yes_gss_nt,
-    [#include <gssapi/gssapi.h>
-     #ifdef GSS_C_NT_USER_NAME
-      user_name_yes_gss_nt
-     #endif
-    ], AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]), AC_WARN(Cybersafe define not found))
-  elif test "$ac_cv_header_gssapi_h" = "yes"; then
-   AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h,
-    AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]))
-  elif test "$ac_cv_header_gssapi_gssapi_h"; then
-   AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h,
-    AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]))
-  fi
- fi
-
- GSSAPI_LIBS=""
- AC_MSG_CHECKING(GSSAPI)
- if test "$gssapi" != no; then
-  AC_MSG_RESULT(with implementation ${gss_impl})
-  AC_CHECK_LIB(resolv,res_search,GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv")
-  SASL_MECHS="$SASL_MECHS libgssapiv2.la"
-  SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/gssapi.o"
-
-  cmu_save_LIBS="$LIBS"
-  LIBS="$LIBS $GSSAPIBASE_LIBS"
-  AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity)
-  LIBS="$cmu_save_LIBS"
-else
-  AC_MSG_RESULT(disabled)
-fi
-AC_SUBST(GSSAPI_LIBS)
-AC_SUBST(GSSAPIBASE_LIBS)
-])
-
-AC_DEFUN([SASL_SET_GSSAPI_LIBS], [
-    SASL_GSSAPI_LIBS_SET="yes"
-])
-
-dnl What we want to do here is setup LIB_SASL with what one would
-dnl generally want to have (e.g. if static is requested, make it that,
-dnl otherwise make it dynamic.
-
-dnl We also want to create LIB_DYN_SASL and DYNSASLFLAGS.
-
-dnl Also sets using_static_sasl to "no" "static" or "staticonly"
-
-AC_DEFUN([CMU_SASL2], [
-	AC_REQUIRE([SASL_GSSAPI_CHK])
-
-AC_ARG_WITH(sasl,
-            [  --with-sasl=DIR         Compile with libsasl2 in <DIR>],
-	    with_sasl="$withval",
-            with_sasl="yes")
-
-AC_ARG_WITH(staticsasl,
-	    [  --with-staticsasl=DIR   Compile with staticly linked libsasl2 in <DIR>],
-	    with_staticsasl="$withval";
-	    if test $with_staticsasl != "no"; then
-		using_static_sasl="static"
-	    fi,
-	    with_staticsasl="no"; using_static_sasl="no")
-
-	SASLFLAGS=""
-	LIB_SASL=""
-
-	cmu_saved_CPPFLAGS=$CPPFLAGS
-	cmu_saved_LDFLAGS=$LDFLAGS
-	cmu_saved_LIBS=$LIBS
-
-	if test ${with_staticsasl} != "no"; then
-	  if test -d ${with_staticsasl}; then
-	    if test -d ${with_staticsasl}/lib64 ; then
-	      ac_cv_sasl_where_lib=${with_staticsasl}/lib64
-	    else
-	      ac_cv_sasl_where_lib=${with_staticsasl}/lib
-	    fi
-	    ac_cv_sasl_where_lib=${with_staticsasl}/lib
-	    ac_cv_sasl_where_inc=${with_staticsasl}/include
-
-	    SASLFLAGS="-I$ac_cv_sasl_where_inc"
-	    LIB_SASL="-L$ac_cv_sasl_where_lib"
-	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
-	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
-	  else
-	    with_staticsasl="/usr"
-	  fi
-
-	  AC_CHECK_HEADER(sasl/sasl.h, [
-	    AC_CHECK_HEADER(sasl/saslutil.h, [
-	     for i42 in lib64 lib; do
-	        if test -r ${with_staticsasl}/$i42/libsasl2.a; then
-		  ac_cv_found_sasl=yes
-		  AC_MSG_CHECKING(for static libsasl)
-		  LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
-		fi
-	     done
-             if test ! "$ac_cv_found_sasl" = "yes"; then
-	          AC_MSG_CHECKING(for static libsasl)
-		  AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a])
-             fi
-	    ])])
-
-	  AC_MSG_RESULT(found)
-
-          if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
-	    LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
-	  else
-	    SASL_GSSAPI_LIBS_SET=""
-	    cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS" 
-	  fi
-	fi
-
-	if test -d ${with_sasl}; then
-            ac_cv_sasl_where_lib=${with_sasl}/lib
-            ac_cv_sasl_where_inc=${with_sasl}/include
-
-	    DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
-	    if test "$ac_cv_sasl_where_lib" != ""; then
-		CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL)
-	    fi
-	    LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
-	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
-	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
-	fi
-
-	dnl be sure to check for a SASLv2 specific function
-	AC_CHECK_HEADER(sasl/sasl.h, [
-	    AC_CHECK_HEADER(sasl/saslutil.h, [
-	      AC_CHECK_LIB(sasl2, prop_get, 
-                           ac_cv_found_sasl=yes,
-		           ac_cv_found_sasl=no)],
-	                   ac_cv_found_sasl=no)], ac_cv_found_sasl=no)
-
-	if test "$ac_cv_found_sasl" = "yes"; then
-	    if test "$ac_cv_sasl_where_lib" != ""; then
-	        CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL)
-	    fi
-	    DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
-	    if test "$using_static_sasl" != "static"; then
-		LIB_SASL=$DYNLIB_SASL
-		SASLFLAGS=$DYNSASLFLAGS
-	    fi
-	else
-	    DYNLIB_SASL=""
-	    DYNSASLFLAGS=""
-	    using_static_sasl="staticonly"
-	fi
-
-        if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
-	    SASL_GSSAPI_LIBS_SET=""
-	    cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS" 
-	fi
-
-	LIBS="$cmu_saved_LIBS"
-	LDFLAGS="$cmu_saved_LDFLAGS"
-	CPPFLAGS="$cmu_saved_CPPFLAGS"
-
-	AC_SUBST(LIB_DYN_SASL)
-	AC_SUBST(DYNSASLFLAGS)
-	AC_SUBST(LIB_SASL)
-	AC_SUBST(SASLFLAGS)
-	])
-
-AC_DEFUN([CMU_SASL2_REQUIRED],
-[AC_REQUIRE([CMU_SASL2])
-if test "$ac_cv_found_sasl" != "yes"; then
-        AC_ERROR([Cannot continue without libsasl2.
-Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.])
-fi])
-
-AC_DEFUN([CMU_SASL2_REQUIRE_VER], [
-	AC_REQUIRE([CMU_SASL2_REQUIRED])
-
-	cmu_saved_CPPFLAGS=$CPPFLAGS
-	CPPFLAGS="$CPPFLAGS $SASLFLAGS"
-
-	AC_TRY_CPP([
-#include <sasl/sasl.h>
-
-#ifndef SASL_VERSION_MAJOR
-#error SASL_VERSION_MAJOR not defined
-#endif
-#ifndef SASL_VERSION_MINOR
-#error SASL_VERSION_MINOR not defined
-#endif
-#ifndef SASL_VERSION_STEP
-#error SASL_VERSION_STEP not defined
-#endif
-
-#if SASL_VERSION_MAJOR < $1 || SASL_VERSION_MINOR < $2 || SASL_VERSION_STEP < $3
-#error SASL version is less than $1.$2.$3
-#endif
-	],,AC_ERROR([Incorrect SASL headers found.  This package requires SASL $1.$2.$3 or newer.]))
-
-	CPPFLAGS=$cmu_saved_CPPFLAGS
-])
-
-AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED], [
-	AC_REQUIRE([CMU_SASL2_REQUIRED])
-
-	cmu_saved_LDFLAGS=$LDFLAGS
-
-	LDFLAGS="$LDFLAGS $LIB_SASL"
-
-	AC_CHECK_LIB(sasl2, sasl_checkapop, AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?]),
-		AC_MSG_ERROR([libsasl2 without working sasl_checkapop.  Cannot continue.]))
-
-	LDFLAGS=$cmu_saved_LDFLAGS
-])
-
-AC_DEFUN([SASL2_CRYPT_CHK],[
- AC_CHECK_FUNC(crypt, cmu_have_crypt=yes, [
-  AC_CHECK_LIB(crypt, crypt,
-	       LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes,
-	       cmu_have_crypt=no)])
- AC_SUBST(LIB_CRYPT)
-])
-
-dnl libwrap.m4 --- do we have libwrap, the access control library?
-dnl $Id: libwrap.m4,v 1.9 2003/10/22 18:50:02 rjs3 Exp $
-
-AC_DEFUN([CMU_LIBWRAP], [
-  AC_REQUIRE([CMU_SOCKETS])
-  AC_ARG_WITH(libwrap, 
-              [  --with-libwrap=DIR      use libwrap (rooted in DIR) [yes] ],
-              with_libwrap=$withval, with_libwrap=yes)
-  if test "$with_libwrap" != no; then
-    if test -d "$with_libwrap"; then
-      CPPFLAGS="$CPPFLAGS -I${with_libwrap}/include"
-      LDFLAGS="$LDFLAGS -L${with_libwrap}/lib"
-    fi
-    cmu_save_LIBS="$LIBS"
-    AC_CHECK_LIB(wrap, request_init, [
-		 AC_CHECK_HEADER(tcpd.h,, with_libwrap=no)],
-		 with_libwrap=no, ${LIB_SOCKET})
-    LIBS="$cmu_save_LIBS"
-  fi
-  AC_MSG_CHECKING(libwrap support)
-  AC_MSG_RESULT($with_libwrap)
-  LIB_WRAP=""
-  if test "$with_libwrap" != no; then
-    AC_DEFINE(HAVE_LIBWRAP,[],[Do we have TCP wrappers?])
-    LIB_WRAP="-lwrap"
-    AC_CHECK_LIB(nsl, yp_get_default_domain, LIB_WRAP="${LIB_WRAP} -lnsl")
-  fi
-  AC_SUBST(LIB_WRAP)
-])
-
-dnl look for the (ucd|net)snmp libraries
-dnl $Id: ucdsnmp.m4,v 1.10 2004/05/24 19:25:41 ken3 Exp $
-
-AC_DEFUN([CMU_UCDSNMP], [
-  AC_REQUIRE([CMU_SOCKETS])
-  AC_ARG_WITH(snmp, 
-              [  --with-snmp=DIR         use ucd|net snmp (rooted in DIR) [yes] ],
-              with_snmp=$withval, with_snmp=yes)
-
-  dnl
-  dnl Maintain backwards compatibility with old --with-ucdsnmp option
-  dnl
-  AC_ARG_WITH(ucdsnmp,, with_snmp=$withval,)
-
-if test "$with_snmp" != "no"; then
-
-  dnl
-  dnl Try net-snmp first
-  dnl
-  if test "$with_snmp" = "yes"; then
-    AC_PATH_PROG(SNMP_CONFIG,net-snmp-config,,[/usr/local/bin:$PATH])
-  else
-    SNMP_CONFIG="$with_snmp/bin/net-snmp-config"
-  fi
-
-  if test -x "$SNMP_CONFIG"; then
-    AC_MSG_CHECKING(NET SNMP libraries)
-
-    SNMP_LIBS=`$SNMP_CONFIG --agent-libs`
-    SNMP_PREFIX=`$SNMP_CONFIG --prefix`
-
-    if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then
-      CPPFLAGS="$CPPFLAGS -I${SNMP_PREFIX}/include"
-      LIB_UCDSNMP=$SNMP_LIBS
-      AC_DEFINE(HAVE_NETSNMP,1,[Do we have Net-SNMP support?])
-      AC_SUBST(LIB_UCDSNMP)
-      AC_MSG_RESULT(yes)
-    else
-      AC_MSG_RESULT(no)
-      AC_MSG_WARN([Could not find the required paths. Please check your net-snmp installation.])
-    fi
-  else
-    dnl
-    dnl Try ucd-snmp if net-snmp test failed
-    dnl
-    if test "$with_snmp" != no; then
-      if test -d "$with_snmp"; then
-        CPPFLAGS="$CPPFLAGS -I${with_snmp}/include"
-        LDFLAGS="$LDFLAGS -L${with_snmp}/lib"
-      fi
-      cmu_save_LIBS="$LIBS"
-      AC_CHECK_LIB(snmp, sprint_objid, [
-  		 AC_CHECK_HEADER(ucd-snmp/version.h,, with_snmp=no)],
-  		 with_snmp=no, ${LIB_SOCKET})
-      LIBS="$cmu_save_LIBS"
-    fi
-    AC_MSG_CHECKING(UCD SNMP libraries)
-    AC_MSG_RESULT($with_snmp)
-    LIB_UCDSNMP=""
-    if test "$with_snmp" != no; then
-      AC_DEFINE(HAVE_UCDSNMP,1,[Do we have UCD-SNMP support?])
-      LIB_UCDSNMP="-lucdagent -lucdmibs -lsnmp"
-      AC_CHECK_LIB(rpm, rpmdbOpen,
-		 LIB_UCDSNMP="${LIB_UCDSNMP} -lrpm -lpopt",,-lpopt)
-    fi
-    AC_SUBST(LIB_UCDSNMP)
-  fi
-fi
-
-])
-
+m4_include([cmulocal/berkdb.m4])
+m4_include([cmulocal/bsd_sockets.m4])
+m4_include([cmulocal/c-attribute.m4])
+m4_include([cmulocal/c-fpic.m4])
+m4_include([cmulocal/common.m4])
+m4_include([cmulocal/cyrus.m4])
+m4_include([cmulocal/ipv6.m4])
+m4_include([cmulocal/libwrap.m4])
+m4_include([cmulocal/sasl2.m4])
+m4_include([cmulocal/ucdsnmp.m4])

Modified: trunk/cyrus-imapd-2.2/cmulocal/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,46 +1,48 @@
 /COPYING/1.1/Fri Oct  2 21:35:59 1998//
 /README.andrew/1.11/Mon Feb 16 16:23:42 2004//
-/afs.m4/1.28/Thu Apr 29 22:00:07 2004//
+/afs.m4/1.29/Tue Apr 26 19:14:07 2005//
 /agentx.m4/1.5/Wed Oct  8 20:35:24 2003//
-/arx.m4/1.5/Wed Oct  8 20:35:24 2003//
+/arx.m4/1.6/Tue Apr 26 19:14:07 2005//
 /ax_path_bdb.m4/1.1/Thu Jan  6 20:24:52 2005//
-/berkdb.m4/1.19/Thu Jan  6 20:24:52 2005//
-/bsd_sockets.m4/1.9/Wed Oct  8 20:35:24 2003//
+/berkdb.m4/1.20/Tue Apr 26 19:14:07 2005//
+/bsd_sockets.m4/1.10/Tue Apr 26 19:14:07 2005//
 /c-attribute.m4/1.3/Wed Oct  8 20:35:24 2003//
 /c-fpic.m4/1.2/Wed Oct  8 20:35:24 2003//
+/clamav.m4/1.2/Sat May 28 02:26:59 2005//
 /com_err.m4/1.6/Wed Oct  8 20:35:24 2003//
-/com_err_link.m4/1.7/Wed Oct  8 20:35:24 2003//
-/common.m4/1.11/Wed Oct  8 20:35:24 2003//
+/com_err_link.m4/1.9/Sat Feb 25 18:32:46 2006//
+/common.m4/1.13/Sat Feb 25 18:29:46 2006//
 /cyrus.m4/1.4/Wed Oct  8 20:35:24 2003//
 /db.m4/1.2/Sat Feb 14 21:16:18 2004//
 /find-func-no-libs.m4/1.2/Wed Oct  8 20:35:24 2003//
 /find-func-no-libs2.m4/1.2/Wed Oct  8 20:35:24 2003//
 /find-func.m4/1.2/Wed Oct  8 20:35:24 2003//
-/heimdal.m4/1.8/Wed Apr  7 06:34:36 2004//
+/heimdal.m4/1.9/Tue Apr 26 19:14:07 2005//
 /init_automake.m4/1.4/Wed Oct  8 20:35:24 2003//
 /ipv6.m4/1.6/Wed Dec 10 17:59:31 2003//
-/kafs.m4/1.6/Wed Oct  8 20:35:24 2003//
-/kerberos_v4.m4/1.27/Thu Feb  5 18:28:47 2004//
-/kerberos_v5.m4/1.8/Wed Apr  7 06:34:36 2004//
-/libXau.m4/1.4/Wed Oct  8 20:35:25 2003//
-/libcyrus.m4/1.19/Wed Oct  8 20:35:25 2003//
-/libloguse.m4/1.5/Wed Oct  8 20:35:25 2003//
-/libnet.m4/1.7/Wed Oct  8 20:35:25 2003//
-/libpcap.m4/1.8/Wed Oct  8 20:35:25 2003//
-/librestrict.m4/1.4/Wed Oct  8 20:35:25 2003//
-/libssl.m4/1.9/Wed Oct  8 20:35:25 2003//
+/kafs.m4/1.7/Tue Apr 26 19:14:07 2005//
+/kerberos_v4.m4/1.28/Tue Apr 26 19:14:08 2005//
+/kerberos_v5.m4/1.9/Tue Apr 26 19:14:08 2005//
+/libXau.m4/1.5/Tue Apr 26 19:14:08 2005//
+/libcyrus.m4/1.20/Tue Apr 26 19:14:08 2005//
+/libloguse.m4/1.7/Sat Feb 25 18:26:22 2006//
+/libnet.m4/1.8/Tue Apr 26 19:14:08 2005//
+/libpcap.m4/1.9/Tue Apr 26 19:14:08 2005//
+/librestrict.m4/1.6/Sat Feb 25 18:26:22 2006//
+/libssl.m4/1.10/Tue Apr 26 19:14:08 2005//
 /libtoolhack.m4/1.4/Wed Oct  8 20:35:25 2003//
-/libwrap.m4/1.9/Wed Oct 22 18:50:02 2003//
+/libwrap.m4/1.10/Tue Apr 26 19:14:08 2005//
 /mips-abi.m4/1.5/Wed Oct  8 20:35:25 2003//
 /nadine.m4/1.6/Wed Oct  8 20:35:25 2003//
 /nana.m4/1.5/Wed Oct  8 20:35:25 2003//
-/openssl.m4/1.9/Tue Dec 30 14:38:54 2003//
+/openldap.m4/1.2/Mon Mar 13 19:16:11 2006//
+/openssl.m4/1.10/Tue Apr 26 19:14:08 2005//
 /pthreads.m4/1.11/Wed Oct  8 20:35:25 2003//
-/sasl.m4/1.22/Wed Oct  8 20:35:25 2003//
-/sasl2.m4/1.48/Mon Sep 13 21:06:34 2004//
+/sasl.m4/1.23/Tue Apr 26 19:14:08 2005//
+/sasl2.m4/1.51/Sat May  7 04:15:17 2005//
 /tcl.m4/1.4/Wed Oct  8 20:35:25 2003//
-/telnet.m4/1.12/Wed Oct  8 20:35:25 2003//
-/ucdsnmp.m4/1.10/Mon May 24 19:25:41 2004//
+/telnet.m4/1.13/Sat Feb 25 18:36:36 2006//
+/ucdsnmp.m4/1.11/Tue Apr 26 19:14:08 2005//
 /util.m4/1.10/Wed Oct  8 20:35:26 2003//
-/zephyr.m4/1.1/Sat Feb 14 21:10:51 2004//
+/zephyr.m4/1.2/Tue Apr 26 19:14:08 2005//
 D

Modified: trunk/cyrus-imapd-2.2/cmulocal/afs.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/afs.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/afs.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/afs.m4 Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 dnl afs.m4--AFS libraries, includes, and dependencies
-dnl $Id: afs.m4,v 1.28 2004/04/29 22:00:07 cg2v Exp $
+dnl $Id: afs.m4,v 1.29 2005/04/26 19:14:07 shadow Exp $
 dnl Chaskiel Grundman
 dnl based on kerberos_v4.m4
 dnl Derrick Brashear
@@ -31,6 +31,7 @@
 ])
 
 AC_DEFUN([CMU_AFS_WHERE], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
    for i in $1; do
       AC_MSG_CHECKING(for AFS in $i)
       CMU_AFS_INC_WHERE1("$i/include")
@@ -38,7 +39,7 @@
       CMU_TEST_INCPATH($i/include, lwp) 
       ac_cv_found_afs_inc=$ac_cv_found_lwp_inc
       if test "$ac_cv_found_afs_inc" = "yes"; then
-        CMU_AFS_LIB_WHERE1("$i/lib")
+        CMU_AFS_LIB_WHERE1("$i/$CMU_LIB_SUBDIR")
         if test "$ac_cv_found_afs_lib" = "yes"; then
           ac_cv_afs_where=$i
           AC_MSG_RESULT(found)
@@ -53,6 +54,7 @@
 ])
 
 AC_DEFUN([CMU_AFS], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_REQUIRE([CMU_LIBSSL])
 AC_ARG_WITH(AFS,
@@ -76,7 +78,7 @@
 	  ac_cv_found_afs=yes
 	  AC_MSG_RESULT(yes)
 	  AFS_INC_DIR="$ac_cv_afs_where/include"
-	  AFS_LIB_DIR="$ac_cv_afs_where/lib"
+	  AFS_LIB_DIR="$ac_cv_afs_where/$CMU_LIB_SUBDIR"
 	  AFS_TOP_DIR="$ac_cv_afs_where"
 	  AFS_INC_FLAGS="-I${AFS_INC_DIR}"
           AFS_LIB_FLAGS="-L${AFS_LIB_DIR} -L${AFS_LIB_DIR}/afs"
@@ -105,9 +107,18 @@
 	              AC_MSG_RESULT([libcrypto])
 		      AFS_LIBDES="$LIBSSL_LIB_FLAGS"
 	              AFS_LIBDESA="$LIBSSL_LIB_FLAGS"
-	          else
-         	      AC_MSG_RESULT([unknown])
-	              AC_MSG_ERROR([Could not use -ldes])
+    	          else
+   	              LIBS="$cmu_save_LIBS -L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+ 	              AC_TRY_LINK([],
+	              [des_quad_cksum();],AFS_DES_LIB="libcrypto+descompat")
+	              if test "X$AFS_DES_LIB" = "Xlibcrypto+descompat"; then
+	                  AC_MSG_RESULT([libcrypto+descompat])
+		          AFS_LIBDES="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+	                  AFS_LIBDESA="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+	              else
+         	          AC_MSG_RESULT([unknown])
+	                  AC_MSG_ERROR([Could not use -ldes])
+	              fi 
 	          fi 
 	      fi 
 	  else

Modified: trunk/cyrus-imapd-2.2/cmulocal/arx.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/arx.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/arx.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/arx.m4 Fri Mar 31 20:18:13 2006
@@ -1,4 +1,4 @@
-dnl $Id: arx.m4,v 1.5 2003/10/08 20:35:24 rjs3 Exp $
+dnl $Id: arx.m4,v 1.6 2005/04/26 19:14:07 shadow Exp $
 
 AC_DEFUN([CMU_ARX_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -57,6 +57,7 @@
 ])
 
 AC_DEFUN([CMU_USE_ARX], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_ARG_WITH(arx,
 	[  --with-arx=PREFIX      Compile with arx support],
 	[if test "X$with_arx" = "X"; then
@@ -75,7 +76,7 @@
 
 	if test "X$with_arx" != "X"; then
 	  if test "$with_arx" != "yes"; then
-	    ac_cv_arx_where_lib=$with_arx/lib
+	    ac_cv_arx_where_lib=$with_arx/${CMU_LIB_SUBDIR}
 	    ac_cv_arx_where_inc=$with_arx/include
 	  fi
 	fi
@@ -84,7 +85,7 @@
 	  ac_cv_arx_where_lib=$with_arx_lib
 	fi
 	if test "X$ac_cv_arx_where_lib" = "X"; then
-	  CMU_ARX_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib)
+	  CMU_ARX_LIB_WHERE(/usr/athena/${CMU_LIB_SUBDIR} /usr/local/${CMU_LIB_SUBDIR} /usr/${CMU_LIB_SUBDIR})
 	fi
 
 	if test "X$with_arx_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/berkdb.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/berkdb.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/berkdb.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/berkdb.m4 Fri Mar 31 20:18:13 2006
@@ -1,4 +1,4 @@
-dnl $Id: berkdb.m4,v 1.19 2005/01/06 20:24:52 shadow Exp $
+dnl $Id: berkdb.m4,v 1.20 2005/04/26 19:14:07 shadow Exp $
 
 AC_DEFUN([CMU_DB_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -77,6 +77,7 @@
 ])
 
 AC_DEFUN([CMU_USE_DB], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_ARG_WITH(db,
 	[  --with-db=PREFIX      Compile with db support],
 	[if test "X$with_db" = "X"; then
@@ -97,7 +98,7 @@
 	
 	if test "X$with_db" != "X"; then
 	  if test "$with_db" != "yes"; then
-	    ac_cv_db_where_lib=$with_db/lib
+	    ac_cv_db_where_lib=$with_db/$CMU_LIB_SUBDIR
 	    ac_cv_db_where_inc=$with_db/include
 	  fi
 	fi
@@ -106,7 +107,7 @@
 	  ac_cv_db_where_lib=$with_db_lib
 	fi
 	if test "X$ac_cv_db_where_lib" = "X"; then
-	  CMU_DB_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib)
+	  CMU_DB_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	fi
 
 	if test "X$with_db_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/bsd_sockets.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/bsd_sockets.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/bsd_sockets.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/bsd_sockets.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl bsd_sockets.m4--which socket libraries do we need? 
 dnl Derrick Brashear
 dnl from Zephyr
-dnl $Id: bsd_sockets.m4,v 1.9 2003/10/08 20:35:24 rjs3 Exp $
+dnl $Id: bsd_sockets.m4,v 1.10 2005/04/26 19:14:07 shadow Exp $
 
 dnl Hacked on by Rob Earhart to not just toss stuff in LIBS
 dnl It now puts everything required for sockets into LIB_SOCKET
@@ -17,8 +17,20 @@
 	)
 	LIBS="$LIB_SOCKET $save_LIBS"
 	AC_CHECK_FUNC(res_search, :,
-                AC_CHECK_LIB(resolv, res_search,
-                              LIB_SOCKET="-lresolv $LIB_SOCKET") 
+		LIBS="-lresolv $LIB_SOCKET $save_LIBS"
+		AC_TRY_LINK([[
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#ifdef HAVE_ARPA_NAMESER_COMPAT_H
+#include <arpa/nameser_compat.h>
+#endif
+#include <resolv.h>]],[[
+const char host[12]="openafs.org";
+u_char ans[1024];
+res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans));
+return 0;
+]], LIB_SOCKET="-lresolv $LIB_SOCKET")
         )
 	LIBS="$LIB_SOCKET $save_LIBS"
 	AC_CHECK_FUNCS(dn_expand dns_lookup)

Added: trunk/cyrus-imapd-2.2/cmulocal/clamav.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/clamav.m4?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/clamav.m4 (added)
+++ trunk/cyrus-imapd-2.2/cmulocal/clamav.m4 Fri Mar 31 20:18:13 2006
@@ -1,0 +1,35 @@
+dnl
+dnl macros for configure.in to detect clamav library
+dnl $Id: clamav.m4,v 1.2 2005/05/28 02:26:59 shadow Exp $
+dnl
+
+AC_DEFUN([CMU_CLAMAV], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
+AC_ARG_WITH(clamav,[  --with-clamav=PATH	use ClamAV - PATH to clamav-config (yes)],
+	with_clamav=$withval, with_clamav=yes)
+  have_clamav=no
+  if test "$with_clamav" != no; then
+	
+	if test -d $with_clamav; then
+		clamav_path=${with_clamav}:${with_clamav}/bin
+	else
+		clamav_path=/usr/local/bin:/usr/bin:$PATH
+	fi
+	AC_PATH_PROG(CLAMAV_CONFIG,clamav-config,,[$clamav_path])
+
+	if test -x "$CLAMAV_CONFIG"; then
+		LIB_CLAMAV="`$CLAMAV_CONFIG --libs` -lclamav"
+		CFLAGS_CLAMAV=`$CLAMAV_CONFIG --cflags`
+
+		if test -n "$LIB_CLAMAV"; then
+			have_clamav=yes
+			test -n "$CFLAGS_CLAMAV" && CPPFLAGS="$CPPFLAGS $CFLAGS_CLAMAV"
+			AC_DEFINE(HAVE_CLAMAV,[],[Do we have ClamAV?])
+			AC_SUBST(LIB_CLAMAV)
+		fi
+	fi
+   fi
+
+   AC_MSG_CHECKING(ClamAV support)
+   AC_MSG_RESULT($have_clamav)
+])

Modified: trunk/cyrus-imapd-2.2/cmulocal/com_err_link.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/com_err_link.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/com_err_link.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/com_err_link.m4 Fri Mar 31 20:18:13 2006
@@ -2,7 +2,7 @@
 dnl library with the collection, I just want to know where it's installed,
 dnl so don't bitch, Rob...
 dnl Derrick Brashear
-dnl $Id: com_err_link.m4,v 1.7 2003/10/08 20:35:24 rjs3 Exp $
+dnl $Id: com_err_link.m4,v 1.9 2006/02/25 18:32:46 cg2v Exp $
 
 
 AC_DEFUN([CMU_COMERR_INC_WHERE1], [
@@ -60,6 +60,7 @@
 ])
 
 AC_DEFUN([CMU_USE_COMERR], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_ARG_WITH(comerr,
 	[  --with-comerr=PREFIX      Compile with com_err support],
 	[if test "X$with_comerr" = "X"; then
@@ -78,7 +79,7 @@
 
 	if test "X$with_comerr" != "X"; then
 	  if test "$with_comerr" != "yes"; then
-	    ac_cv_comerr_where_lib=$with_comerr/lib
+	    ac_cv_comerr_where_lib=$with_comerr/$CMU_LIB_SUBDIR
 	    ac_cv_comerr_where_inc=$with_comerr/include
 	  fi
 	fi
@@ -87,7 +88,7 @@
 	  ac_cv_comerr_where_lib=$with_comerr_lib
 	fi
 	if test "X$ac_cv_comerr_where_lib" = "X"; then
-	  CMU_COMERR_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib)
+	  CMU_COMERR_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	fi
 
 	if test "X$with_comerr_include" != "X"; then
@@ -106,8 +107,9 @@
 	  AC_MSG_RESULT(yes)
 	  COMERR_INC_DIR=$ac_cv_comerr_where_inc
 	  COMERR_LIB_DIR=$ac_cv_comerr_where_lib
-	  COMERR_INC_FLAGS="-I${COMERR_INC_DIR}"
-	  COMERR_LIB_FLAGS="-L${COMERR_LIB_DIR} -lcom_err"
+	  test "$COMERR_INC_DIR"  && COMERR_INC_FLAGS="-I${COMERR_INC_DIR}"
+	  COMERR_LIB_FLAGS="-lcom_err"
+	  test "$COMERR_LIB_DIR"  && COMERR_LIB_FLAGS="-L${COMERR_LIB_DIR} -lcom_err"
           dnl Do not force configure.in to put these in CFLAGS and LIBS unconditionally
           dnl Allow makefile substitutions....
           AC_SUBST(COMERR_INC_FLAGS)

Modified: trunk/cyrus-imapd-2.2/cmulocal/common.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/common.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/common.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/common.m4 Fri Mar 31 20:18:13 2006
@@ -1,11 +1,11 @@
-dnl $Id: common.m4,v 1.11 2003/10/08 20:35:24 rjs3 Exp $
+dnl $Id: common.m4,v 1.13 2006/02/25 18:29:46 cg2v Exp $
 
 AC_DEFUN([CMU_TEST_LIBPATH], [
 changequote(<<, >>)
 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>))
 changequote([, ])
 if test "$CMU_AC_CV_FOUND" = "yes"; then
-  if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl"; then
+  if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl" -a \! -r "$1/lib$2.dylib"; then
     CMU_AC_CV_FOUND=no
   fi
 fi
@@ -38,3 +38,24 @@
 ])dnl
 fi
 ])
+
+AC_DEFUN([CMU_FIND_LIB_SUBDIR],
+[dnl
+AC_ARG_WITH([lib-subdir], AC_HELP_STRING([--with-lib-subdir=DIR],[Find libraries in DIR instead of lib]))
+AC_CHECK_SIZEOF(long)
+AC_CACHE_CHECK([what directory libraries are found in], [ac_cv_cmu_lib_subdir],
+[test "X$with_lib_subdir" = "Xyes" && with_lib_subdir=
+test "X$with_lib_subdir" = "Xno" && with_lib_subdir=
+if test "X$with_lib_subdir" = "X" ; then
+  ac_cv_cmu_lib_subdir=lib
+  if test $ac_cv_sizeof_long -eq 4 ; then
+    test -d /usr/lib32 && ac_cv_cmu_lib_subdir=lib32
+  fi
+  if test $ac_cv_sizeof_long -eq 8 ; then
+    test -d /usr/lib64 && ac_cv_cmu_lib_subdir=lib64
+  fi
+else
+  ac_cv_cmu_lib_subdir=$with_lib_subdir
+fi])
+AC_SUBST(CMU_LIB_SUBDIR, $ac_cv_cmu_lib_subdir)
+])

Modified: trunk/cyrus-imapd-2.2/cmulocal/heimdal.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/heimdal.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/heimdal.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/heimdal.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl kerberos_v5.m4--Kerberos 5 libraries and includes
 dnl Derrick Brashear
 dnl from KTH krb and Arla
-dnl $Id: heimdal.m4,v 1.8 2004/04/07 06:34:36 shadow Exp $
+dnl $Id: heimdal.m4,v 1.9 2005/04/26 19:14:07 shadow Exp $
 
 AC_DEFUN([CMU_LIBHEIMDAL_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -79,8 +79,17 @@
               HEIM_LIBDES="$LIBSSL_LIB_FLAGS"
               HEIM_LIBDESA="$LIBSSL_LIB_FLAGS"
           else
-              AC_MSG_RESULT([unknown])
-              AC_MSG_ERROR([Could not use -ldes])
+              LIBS="$cmu_save_LIBS -L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+              AC_TRY_LINK([],
+              [des_quad_cksum();],HEIM_DES_LIB="libcrypto+descompat")
+              if test "X$HEIM_DES_LIB" = "Xlibcrypto+descompat"; then
+                  AC_MSG_RESULT([libcrypto+descompat])
+                  HEIM_LIBDES="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+                  HEIM_LIBDESA="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+              else
+                  AC_MSG_RESULT([unknown])
+                  AC_MSG_ERROR([Could not use -ldes])
+              fi 
           fi 
       fi 
   else
@@ -89,6 +98,7 @@
 ])
 
 AC_DEFUN([CMU_LIBHEIMDAL], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_REQUIRE([CMU_USE_COMERR])
 AC_ARG_WITH(LIBHEIMDAL,
@@ -109,7 +119,7 @@
 
 	if test "X$with_libheimdal" != "X"; then
 	  if test "$with_libheimdal" != "yes" -a "$with_libheimdal" != "no"; then
-	    ac_cv_libheimdal_where_lib=$with_libheimdal/lib
+	    ac_cv_libheimdal_where_lib=$with_libheimdal/$CMU_LIB_SUBDIR
 	    ac_cv_libheimdal_where_inc=$with_libheimdal/include
 	  fi
 	fi
@@ -119,7 +129,7 @@
 	    ac_cv_libheimdal_where_lib=$with_libheimdal_lib
 	  fi
 	  if test "X$ac_cv_libheimdal_where_lib" = "X"; then
-	    CMU_LIBHEIMDAL_LIB_WHERE(/usr/athena/lib /usr/lib /usr/heimdal/lib /usr/local/lib)
+	    CMU_LIBHEIMDAL_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/heimdal/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	  fi
 
 	  if test "X$with_libheimdal_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/kafs.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/kafs.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/kafs.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/kafs.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl kerberos_v4.m4--Kafs libraries and includes
 dnl Derrick Brashear
 dnl from KTH kafs and Arla
-dnl $Id: kafs.m4,v 1.6 2003/10/08 20:35:24 rjs3 Exp $
+dnl $Id: kafs.m4,v 1.7 2005/04/26 19:14:07 shadow Exp $
 
 AC_DEFUN([CMU_KAFS_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -70,6 +70,7 @@
 ])
 
 AC_DEFUN([CMU_KAFS], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_REQUIRE([CMU_KRB4])
 AC_REQUIRE([CMU_KRB5])
@@ -91,7 +92,7 @@
 
 	if test "X$with_kafs" != "X"; then
 	  if test "$with_kafs" != "yes" -a "$with_kafs" != no; then
-	    ac_cv_kafs_where_lib=$with_kafs/lib
+	    ac_cv_kafs_where_lib=$with_kafs/$CMU_LIB_SUBDIR
 	    ac_cv_kafs_where_inc=$with_kafs/include
 	  fi
 	fi
@@ -101,7 +102,7 @@
 	    ac_cv_kafs_where_lib=$with_kafs_lib
 	  fi
 	  if test "X$ac_cv_kafs_where_lib" = "X"; then
-	    CMU_KAFS_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib)
+	    CMU_KAFS_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
 	  fi
 
 	  if test "X$with_kafs_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/kerberos_v4.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/kerberos_v4.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/kerberos_v4.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/kerberos_v4.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl kerberos_v4.m4--Kerberos 4 libraries and includes
 dnl Derrick Brashear
 dnl from KTH krb and Arla
-dnl $Id: kerberos_v4.m4,v 1.27 2004/02/05 18:28:47 cg2v Exp $
+dnl $Id: kerberos_v4.m4,v 1.28 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_KRB_SENDAUTH_PROTO], [
 AC_MSG_CHECKING(for krb_sendauth prototype)
@@ -143,6 +143,7 @@
 ])
 
 AC_DEFUN([CMU_KRB4], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_REQUIRE([CMU_LIBSSL])
 AC_ARG_WITH(krb4,
@@ -163,7 +164,7 @@
 
 	if test "X$with_krb4" != "X"; then
 	  if test "$with_krb4" != "yes" -a "$with_krb4" != "no"; then
-	    ac_cv_krb_where_lib=$with_krb4/lib
+	    ac_cv_krb_where_lib=$with_krb4/$CMU_LIB_SUBDIR
 	    ac_cv_krb_where_inc=$with_krb4/include
 	  fi
 	fi
@@ -197,15 +198,24 @@
                       KRB_LIBDES="$LIBSSL_LIB_FLAGS"
                       KRB_LIBDESA="$LIBSSL_LIB_FLAGS"
                   else
-                      AC_MSG_RESULT([unknown])
-                      AC_MSG_ERROR([Could not use -ldes])
+                      LIBS="$cmu_save_LIBS -L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+                      AC_TRY_LINK([],
+                      [des_quad_cksum();],KRB_DES_LIB="libcrypto+descompat")
+                      if test "X$KRB_DES_LIB" = "Xlibcrypto+descompat"; then
+                          AC_MSG_RESULT([libcrypto+descompat])
+                          KRB_LIBDES="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+                          KRB_LIBDESA="-L$LIBSSL_LIB_DIR -ldescompat $LIBSSL_LIB_FLAGS"
+                      else
+                          AC_MSG_RESULT([unknown])
+                          AC_MSG_ERROR([Could not use -ldes])
+                      fi 
                   fi 
               fi 
           else
              AC_MSG_RESULT([no])
           fi
           if test "X$ac_cv_krb_where_lib" = "X"; then
-            CMU_KRB_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib)
+            CMU_KRB_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
           fi
 	fi
 	  LIBS="${cmu_save_LIBS}"
@@ -230,6 +240,7 @@
           AC_SUBST(KRB_INC_FLAGS)
           AC_SUBST(KRB_LIB_FLAGS)
 	  LIBS="${cmu_save_LIBS}"
+	  AC_DEFINE(HAVE_KRB4,,[Kerberos V4 is present])dnl zephyr uses this
 	  AC_DEFINE(KERBEROS,,[Use kerberos 4. find out what needs this symbol])
 	  if test "X$RPATH" = "X"; then
 		RPATH=""

Modified: trunk/cyrus-imapd-2.2/cmulocal/kerberos_v5.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/kerberos_v5.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/kerberos_v5.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/kerberos_v5.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl kerberos_v5.m4--Kerberos 5 libraries and includes
 dnl Derrick Brashear
 dnl from KTH krb and Arla
-dnl $Id: kerberos_v5.m4,v 1.8 2004/04/07 06:34:36 shadow Exp $
+dnl $Id: kerberos_v5.m4,v 1.9 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_KRB5_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -58,6 +58,7 @@
 ])
 
 AC_DEFUN([CMU_KRB5], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_REQUIRE([CMU_USE_COMERR])
 AC_ARG_WITH(krb5,
@@ -84,7 +85,7 @@
 
 	if test "X$with_krb5" != "X"; then
 	  if test "$with_krb5" != "yes" -a "$with_krb5" != "no"; then
-	    ac_cv_krb5_where_lib=$with_krb5/lib
+	    ac_cv_krb5_where_lib=$with_krb5/$CMU_LIB_SUBDIR
 	    ac_cv_krb5_where_inc=$with_krb5/include
 	    ac_cv_krb5_impl=mit
 	  fi
@@ -99,13 +100,13 @@
 	    ac_cv_krb5_impl=$with_krb5_impl
 	  fi
 	  if test "X$ac_cv_krb5_where_lib" = "X" -a "X$with_krb5_impl" != "Xheimdal"; then
-	    CMU_KRB5_LIB_WHERE(/usr/athena/lib /usr/lib /usr/local/lib)
+	    CMU_KRB5_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	    if test "X$ac_cv_krb5_where_lib" != "X"; then
               ac_cv_krb5_impl=mit
 	    fi
 	  fi
 	  if test "X$ac_cv_krb5_where_lib" = "X" -a "X$with_krb5_impl" != "Xmit"; then
-	    CMU_LIBHEIMDAL_LIB_WHERE(/usr/athena/lib /usr/lib /usr/heimdal/lib /usr/local/lib)
+	    CMU_LIBHEIMDAL_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/heimdal/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	    if test "X$ac_cv_libheimdal_where_lib" != "X"; then
 	      ac_cv_krb5_where_lib=$ac_cv_libheimdal_where_lib
 	      ac_cv_krb5_impl=heimdal
@@ -139,6 +140,7 @@
 	  KRB5_INC_FLAGS="-I${KRB5_INC_DIR}"
 	  AC_SUBST(KRB5_INC_FLAGS)
 	  AC_SUBST(KRB5_LIB_FLAGS)
+	  AC_DEFINE(HAVE_KRB5,,[Kerberos V5 is present])dnl zephyr uses this
 	  AC_DEFINE(KRB5,,[Use Kerberos 5. (maybe find what needs this and nuke it)])
 	  if test "X$RPATH" = "X"; then
 		RPATH=""

Modified: trunk/cyrus-imapd-2.2/cmulocal/libXau.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/libXau.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/libXau.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/libXau.m4 Fri Mar 31 20:18:13 2006
@@ -1,4 +1,4 @@
-dnl $Id: libXau.m4,v 1.4 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: libXau.m4,v 1.5 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_XAU_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -54,6 +54,7 @@
 ])
 
 AC_DEFUN([CMU_XAU], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_ARG_WITH(Xau,
 	[  --with-Xau=PREFIX      Compile with Xau support],
@@ -73,7 +74,7 @@
 
 	if test "X$with_Xau" != "X"; then
 	  if test "$with_Xau" != "yes"; then
-	    ac_cv_Xau_where_lib=$with_Xau/lib
+	    ac_cv_Xau_where_lib=$with_Xau/$CMU_LIB_SUBDIR
 	    ac_cv_Xau_where_inc=$with_Xau/include
 	  fi
 	fi
@@ -82,7 +83,7 @@
 	  ac_cv_Xau_where_lib=$with_Xau_lib
 	fi
 	if test "X$ac_cv_Xau_where_lib" = "X"; then
-	  CMU_XAU_LIB_WHERE(/usr/X11R6/lib /usr/local/lib /usr/openwin/lib)
+	  CMU_XAU_LIB_WHERE(/usr/X11R6/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR /usr/openwin/$CMU_LIB_SUBDIR)
 	fi
 
 	if test "X$with_Xau_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/libcyrus.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/libcyrus.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/libcyrus.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/libcyrus.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl libcyrus.m4--Cyrus libraries and includes
 dnl Derrick Brashear
 dnl from KTH kafs and Arla
-dnl $Id: libcyrus.m4,v 1.19 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: libcyrus.m4,v 1.20 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_LIBCYRUS_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -54,6 +54,7 @@
 ])
 
 AC_DEFUN([CMU_LIBCYRUS], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_REQUIRE([CMU_SASL2])
 AC_REQUIRE([CMU_LIBSSL])
@@ -75,7 +76,7 @@
 
 	if test "X$with_libcyrus" != "X"; then
 	  if test "$with_libcyrus" != "yes" -a "$with_libcyrus" != no; then
-	    ac_cv_cyrus_where_lib=$with_libcyrus/lib
+	    ac_cv_cyrus_where_lib=$with_libcyrus/$CMU_LIB_SUBDIR
 	    ac_cv_cyrus_where_inc=$with_libcyrus/include
 	  fi
 	fi
@@ -85,7 +86,7 @@
 	    ac_cv_cyrus_where_lib=$with_libcyrus_lib
 	  fi
 	  if test "X$ac_cv_cyrus_where_lib" = "X"; then
-	    CMU_LIBCYRUS_LIB_WHERE(/usr/cyrus/lib /usr/local/lib /usr/lib)
+	    CMU_LIBCYRUS_LIB_WHERE(/usr/cyrus/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
 	  fi
 
 	  if test "X$with_libcyrus_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/libloguse.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/libloguse.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/libloguse.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/libloguse.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl libloguse.m4--LOGUSE libraries and includes
 dnl Derrick Brashear
 dnl from KTH krb and Arla
-dnl $Id: libloguse.m4,v 1.5 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: libloguse.m4,v 1.7 2006/02/25 18:26:22 cg2v Exp $
 
 AC_DEFUN([CMU_LOGUSE_LIB_WHERE1], [
 saved_LIBS=$LIBS
@@ -29,6 +29,7 @@
 ])
 
 AC_DEFUN([CMU_LOGUSE], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_ARG_WITH(loguse,
 	[  --with-loguse=PREFIX      Compile with LOGUSE support],
@@ -38,7 +39,7 @@
 
 	if test "X$with_loguse" != "X"; then
 	  if test "$with_loguse" != "yes"; then
-	    ac_cv_loguse_where_lib=$with_loguse/lib
+	    ac_cv_loguse_where_lib=$with_loguse/$CMU_LIB_SUBDIR
 	  fi
 	fi
 
@@ -46,7 +47,7 @@
 	  ac_cv_loguse_where_lib=$with_loguse_lib
 	fi
 	if test "X$ac_cv_loguse_where_lib" = "X"; then
-	  CMU_LOGUSE_LIB_WHERE(/usr/lib /usr/local/lib)
+	  CMU_LOGUSE_LIB_WHERE(/usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	fi
 
 	AC_MSG_CHECKING(whether to include loguse)
@@ -55,7 +56,7 @@
 	  AC_MSG_RESULT(no)
 	else
 	  ac_cv_found_loguse=yes
-	  AC_DEFINE(HAVE_LOGUSE)
+	  AC_DEFINE(HAVE_LOGUSE,, [Use libloguse])
 	  AC_MSG_RESULT(yes)
 	  LOGUSE_LIB_DIR=$ac_cv_loguse_where_lib
 	  LOGUSE_LIB_FLAGS="-L${LOGUSE_LIB_DIR} -lloguse"

Modified: trunk/cyrus-imapd-2.2/cmulocal/libnet.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/libnet.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/libnet.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/libnet.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl libnet.m4--libnet and includes
 dnl Derrick Brashear
 dnl from KTH krb and Arla
-dnl $Id: libnet.m4,v 1.7 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: libnet.m4,v 1.8 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_LIBNET_CFG_WHERE1], [
 ac_cv_found_libnet_bin=no
@@ -78,6 +78,7 @@
 ])
 
 AC_DEFUN([CMU_LIBNET], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_ARG_WITH(libnet,
 	[  --with-libnet=PREFIX      Compile with LIBNET support],
 	[if test "X$with_libnet" = "X"; then
@@ -106,7 +107,7 @@
             else
 	      ac_cv_libnet_where_cfg=$with_libnet/bin
             fi
-	    ac_cv_libnet_where_lib=$with_libnet/lib
+	    ac_cv_libnet_where_lib=$with_libnet/$CMU_LIB_SUBDIR
 	    ac_cv_libnet_where_inc=$with_libnet/include
 	  fi
 	fi
@@ -122,7 +123,7 @@
 	  ac_cv_libnet_where_lib=$with_libnet_lib
 	fi
 	if test "X$ac_cv_libnet_where_lib" = "X"; then
-	  CMU_LIBNET_LIB_WHERE(/usr/ng/lib /usr/lib /usr/local/lib)
+	  CMU_LIBNET_LIB_WHERE(/usr/ng/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	fi
 
 	if test "X$with_libnet_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/libpcap.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/libpcap.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/libpcap.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/libpcap.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl libpcap.m4--PCAP libraries and includes
 dnl Derrick Brashear
 dnl from KTH krb and Arla
-dnl $Id: libpcap.m4,v 1.8 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: libpcap.m4,v 1.9 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_PCAP_INC_WHERE1], [
 ac_cv_found_pcap_inc=no
@@ -50,6 +50,7 @@
 ])
 
 AC_DEFUN([CMU_PCAP], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_ARG_WITH(pcap,
 	[  --with-pcap=PREFIX      Compile with PCAP support],
 	[if test "X$with_pcap" = "X"; then
@@ -68,7 +69,7 @@
 
 	if test "X$with_pcap" != "X"; then
 	  if test "$with_pcap" != "yes"; then
-	    ac_cv_pcap_where_lib=$with_pcap/lib
+	    ac_cv_pcap_where_lib=$with_pcap/$CMU_LIB_SUBDIR
 	    ac_cv_pcap_where_inc=$with_pcap/include
 	  fi
 	fi
@@ -77,7 +78,7 @@
 	  ac_cv_pcap_where_lib=$with_pcap_lib
 	fi
 	if test "X$ac_cv_pcap_where_lib" = "X"; then
-	  CMU_PCAP_LIB_WHERE(/usr/ng/lib /usr/lib /usr/local/lib)
+	  CMU_PCAP_LIB_WHERE(/usr/ng/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	fi
 
 	if test "X$with_pcap_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/librestrict.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/librestrict.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/librestrict.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/librestrict.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl librestrict.m4--restrict libraries and includes
 dnl Derrick Brashear
 dnl from KTH krb and Arla
-dnl $Id: librestrict.m4,v 1.4 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: librestrict.m4,v 1.6 2006/02/25 18:26:22 cg2v Exp $
 
 AC_DEFUN([CMU_RESTRICT_LIB_WHERE1], [
 saved_LIBS=$LIBS
@@ -29,6 +29,7 @@
 ])
 
 AC_DEFUN([CMU_RESTRICT], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_ARG_WITH(restrict,
 	[  --with-restrict=PREFIX      Compile with RESTRICT support],
 	[if test "X$with_restrict" = "X"; then
@@ -37,7 +38,7 @@
 
 	if test "X$with_restrict" != "X"; then
 	  if test "$with_restrict" != "yes"; then
-	    ac_cv_restrict_where_lib=$with_restrict/lib
+	    ac_cv_restrict_where_lib=$with_restrict/$CMU_LIB_SUBDIR
 	  fi
 	fi
 
@@ -45,7 +46,7 @@
 	  ac_cv_restrict_where_lib=$with_restrict_lib
 	fi
 	if test "X$ac_cv_restrict_where_lib" = "X"; then
-	  CMU_RESTRICT_LIB_WHERE(/usr/lib /usr/local/lib)
+	  CMU_RESTRICT_LIB_WHERE(/usr/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR)
 	fi
 
 	AC_MSG_CHECKING(whether to include restrict)
@@ -54,7 +55,7 @@
 	  AC_MSG_RESULT(no)
 	else
 	  ac_cv_found_restrict=yes
-	  AC_DEFINE(HAVE_RESTRICT)
+	  AC_DEFINE(HAVE_RESTRICT,, [Use librestrict])
 	  AC_MSG_RESULT(yes)
 	  RESTRICT_LIB_DIR=$ac_cv_restrict_where_lib
 	  RESTRICT_LIB_FLAGS="-L${RESTRICT_LIB_DIR} -lrestrict"

Modified: trunk/cyrus-imapd-2.2/cmulocal/libssl.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/libssl.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/libssl.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/libssl.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl libssl.m4--Ssl libraries and includes
 dnl Derrick Brashear
 dnl from KTH kafs and Arla
-dnl $Id: libssl.m4,v 1.9 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: libssl.m4,v 1.10 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_LIBSSL_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -54,6 +54,7 @@
 ])
 
 AC_DEFUN([CMU_LIBSSL], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_ARG_WITH(libssl,
 	[  --with-libssl=PREFIX      Compile with Libssl support],
@@ -73,7 +74,7 @@
 
 	if test "X$with_libssl" != "X"; then
 	  if test "$with_libssl" != "yes" -a "$with_libssl" != no; then
-	    ac_cv_libssl_where_lib=$with_libssl/lib
+	    ac_cv_libssl_where_lib=$with_libssl/$CMU_LIB_SUBDIR
 	    ac_cv_libssl_where_inc=$with_libssl/include
 	  fi
 	fi
@@ -83,7 +84,7 @@
 	    ac_cv_libssl_where_lib=$with_libssl_lib
 	  fi
 	  if test "X$ac_cv_libssl_where_lib" = "X"; then
-	    CMU_LIBSSL_LIB_WHERE(/usr/local/lib/openssl /usr/lib/openssl /usr/local/lib /usr/lib)
+	    CMU_LIBSSL_LIB_WHERE(/usr/local/$CMU_LIB_SUBDIR/openssl /usr/$CMU_LIB_SUBDIR/openssl /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
 	  fi
 
 	  if test "X$with_libssl_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/cmulocal/libwrap.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/libwrap.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/libwrap.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/libwrap.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,8 @@
 dnl libwrap.m4 --- do we have libwrap, the access control library?
-dnl $Id: libwrap.m4,v 1.9 2003/10/22 18:50:02 rjs3 Exp $
+dnl $Id: libwrap.m4,v 1.10 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_LIBWRAP], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
   AC_REQUIRE([CMU_SOCKETS])
   AC_ARG_WITH(libwrap, 
               [  --with-libwrap=DIR      use libwrap (rooted in DIR) [yes] ],
@@ -9,7 +10,7 @@
   if test "$with_libwrap" != no; then
     if test -d "$with_libwrap"; then
       CPPFLAGS="$CPPFLAGS -I${with_libwrap}/include"
-      LDFLAGS="$LDFLAGS -L${with_libwrap}/lib"
+      LDFLAGS="$LDFLAGS -L${with_libwrap}/$CMU_LIB_SUBDIR"
     fi
     cmu_save_LIBS="$LIBS"
     AC_CHECK_LIB(wrap, request_init, [

Added: trunk/cyrus-imapd-2.2/cmulocal/openldap.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/openldap.m4?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/openldap.m4 (added)
+++ trunk/cyrus-imapd-2.2/cmulocal/openldap.m4 Fri Mar 31 20:18:13 2006
@@ -1,0 +1,36 @@
+dnl
+dnl macros for configure.in to detect openldap
+dnl $Id: openldap.m4,v 1.2 2006/03/13 19:16:11 mel Exp $
+dnl
+
+dnl
+dnl Check for OpenLDAP version compatility
+AC_DEFUN([CMU_OPENLDAP_API],
+[AC_CACHE_CHECK([OpenLDAP api], [cmu_cv_openldap_api],[
+    AC_EGREP_CPP(__openldap_api,[
+#include <ldap.h>
+
+#ifdef LDAP_API_FEATURE_X_OPENLDAP
+char *__openldap_api = LDAP_API_FEATURE_X_OPENLDAP;
+#endif
+],      [cmu_cv_openldap_api=yes], [cmu_cv_openldap_api=no])])
+])
+
+dnl
+dnl Check for OpenLDAP version compatility
+AC_DEFUN([CMU_OPENLDAP_COMPAT],
+[AC_CACHE_CHECK([OpenLDAP version], [cmu_cv_openldap_compat],[
+    AC_EGREP_CPP(__openldap_compat,[
+#include <ldap.h>
+
+/* Require 2.1.27+ and 2.2.6+ */
+#if LDAP_VENDOR_VERSION_MAJOR == 2  && LDAP_VENDOR_VERSION_MINOR == 1 && LDAP_VENDOR_VERSION_PATCH > 26
+char *__openldap_compat = "2.1.27 or better okay";
+#elif LDAP_VENDOR_VERSION_MAJOR == 2  && LDAP_VENDOR_VERSION_MINOR == 2 && LDAP_VENDOR_VERSION_PATCH > 5
+char *__openldap_compat = "2.2.6 or better okay";
+#elif LDAP_VENDOR_VERSION_MAJOR == 2  && LDAP_VENDOR_VERSION_MINOR > 2
+char *__openldap_compat = "2.3 or better okay"
+#endif
+],      [cmu_cv_openldap_compat=yes], [cmu_cv_openldap_compat=no])])
+])
+

Modified: trunk/cyrus-imapd-2.2/cmulocal/openssl.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/openssl.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/openssl.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/openssl.m4 Fri Mar 31 20:18:13 2006
@@ -1,9 +1,10 @@
 dnl
 dnl macros for configure.in to detect openssl
-dnl $Id: openssl.m4,v 1.9 2003/12/30 14:38:54 rjs3 Exp $
+dnl $Id: openssl.m4,v 1.10 2005/04/26 19:14:08 shadow Exp $
 dnl
 
 AC_DEFUN([CMU_HAVE_OPENSSL], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_ARG_WITH(openssl,[  --with-openssl=PATH     use OpenSSL from PATH],
 	with_openssl=$withval, with_openssl="yes")
 
@@ -12,7 +13,7 @@
 
 	if test -d $with_openssl; then
 	  CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include"
-	  CMU_ADD_LIBPATH(${with_openssl}/lib)
+	  CMU_ADD_LIBPATH(${with_openssl}/$CMU_LIB_SUBDIR)
 	fi
 
 case "$with_openssl" in

Modified: trunk/cyrus-imapd-2.2/cmulocal/sasl.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/sasl.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/sasl.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/sasl.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl sasl.m4--sasl libraries and includes
 dnl Derrick Brashear
 dnl from KTH sasl and Arla
-dnl $Id: sasl.m4,v 1.22 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: sasl.m4,v 1.23 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_SASL_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -46,6 +46,7 @@
 ])
 
 AC_DEFUN([CMU_SASL], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_ARG_WITH(sasl,
             [  --with-sasl=DIR        Compile with libsasl in <DIR>],
 	    with_sasl="$withval",
@@ -58,7 +59,7 @@
 	cmu_saved_LDFLAGS=$LDFLAGS
 	cmu_saved_LIBS=$LIBS
 	if test -d ${with_sasl}; then
-          ac_cv_sasl_where_lib=${with_sasl}/lib
+          ac_cv_sasl_where_lib=${with_sasl}/$CMU_LIB_SUBDIR
           ac_cv_sasl_where_inc=${with_sasl}/include
 
 	  SASLFLAGS="-I$ac_cv_sasl_where_inc"

Modified: trunk/cyrus-imapd-2.2/cmulocal/sasl2.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/sasl2.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/sasl2.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/sasl2.m4 Fri Mar 31 20:18:13 2006
@@ -1,79 +1,88 @@
-dnl sasl2.m4--sasl2 libraries and includes
-dnl Rob Siemborski
-dnl $Id: sasl2.m4,v 1.48 2004/09/13 21:06:34 shadow Exp $
-
-AC_DEFUN([SASL_GSSAPI_CHK],[
- AC_ARG_ENABLE(gssapi, [  --enable-gssapi=<DIR>   enable GSSAPI authentication [yes] ],
-    gssapi=$enableval,
-    gssapi=yes)
- AC_ARG_WITH(gss_impl, [  --with-gss_impl={heimdal|mit|cybersafe|seam|auto}                                                       choose specific GSSAPI implementation [[auto]] ],
-    gss_impl=$withval,
-    gss_impl=auto)
- AC_REQUIRE([SASL2_CRYPT_CHK])
- AC_REQUIRE([CMU_SOCKETS])
-
- if test "$gssapi" != no; then
-    platform=
-    case "${host}" in
-      *-*-linux*)
-        platform=__linux
-        ;;
-      *-*-hpux*)
-        platform=__hpux
-        ;;
-      *-*-irix*)
-        platform=__irix
-        ;;
-      *-*-solaris2*)
+# sasl2.m4--sasl2 libraries and includes
+# Rob Siemborski
+# $Id: sasl2.m4,v 1.51 2005/05/07 04:15:17 shadow Exp $
+
+# SASL2_CRYPT_CHK
+# ---------------
+AC_DEFUN([SASL_GSSAPI_CHK],
+[AC_REQUIRE([SASL2_CRYPT_CHK])
+AC_REQUIRE([CMU_SOCKETS])
+AC_ARG_ENABLE([gssapi],
+              [AC_HELP_STRING([--enable-gssapi=<DIR>],
+                              [enable GSSAPI authentication [yes]])],
+              [gssapi=$enableval],
+              [gssapi=yes])
+AC_ARG_WITH([gss_impl],
+            [AC_HELP_STRING([--with-gss_impl={heimdal|mit|cybersafe|seam|auto}],
+                            [choose specific GSSAPI implementation [[auto]]])],
+            [gss_impl=$withval],
+            [gss_impl=auto])
+
+if test "$gssapi" != no; then
+  platform=
+  case "${host}" in
+    *-*-linux*)
+      platform=__linux
+      ;;
+    *-*-hpux*)
+      platform=__hpux
+      ;;
+    *-*-irix*)
+      platform=__irix
+      ;;
+    *-*-solaris2*)
 # When should we use __sunos?
-        platform=__solaris
-        ;;
-      *-*-aix*)
+      platform=__solaris
+      ;;
+    *-*-aix*)
 ###_AIX
-        platform=__aix
-        ;;
-      *)
-        AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script])
-	if test "$gss_impl" = "cybersafe"; then
-	   AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported])
-	fi
-        ;;
-    esac
-
+      platform=__aix
+      ;;
+    *)
+      AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script])
+      if test "$gss_impl" = "cybersafe"; then
+        AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported])
+      fi
+      ;;
+  esac
+
+  cmu_saved_CPPFLAGS=$CPPFLAGS
+
+  if test -d ${gssapi}; then
+    CPPFLAGS="$CPPFLAGS -I$gssapi/include"
+# We want to keep -I in our CPPFLAGS, but only if we succeed
     cmu_saved_CPPFLAGS=$CPPFLAGS
-
-    if test -d ${gssapi}; then
-       CPPFLAGS="$CPPFLAGS -I$gssapi/include"
-# We want to keep -I in our CPPFLAGS, but only if we succeed
-       cmu_saved_CPPFLAGS=$CPPFLAGS
 ### I am not sure how useful is this (and whether this is required at all
 ### especially when we have to provide two -L flags for new CyberSafe
-       LDFLAGS="$LDFLAGS -L$gssapi/lib"
-
-       if test -n "$platform"; then
-         if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
-           CPPFLAGS="$CPPFLAGS -D$platform"
-           if test -d "${gssapi}/appsec-sdk/include"; then
-             CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
-           fi
-         fi
-       fi
-    fi
-    AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H,,[Define if you have the gssapi.h header file]), [
-      AC_CHECK_HEADER(gssapi/gssapi.h,, AC_WARN(Disabling GSSAPI - no include files found); gssapi=no)])
-
-    CPPFLAGS=$cmu_saved_CPPFLAGS
-
- fi
-
- if test "$gssapi" != no; then
-  dnl We need to find out which gssapi implementation we are
-  dnl using. Supported alternatives are: MIT Kerberos 5,
-  dnl Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal),
-  dnl CyberSafe Kerberos 5 (http://www.cybersafe.com/)
-  dnl and Sun SEAM (http://wwws.sun.com/software/security/kerberos/)
-  dnl
-  dnl The choice is reflected in GSSAPIBASE_LIBS
+    LDFLAGS="$LDFLAGS -L$gssapi/lib"
+
+    if test -n "$platform"; then
+      if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
+        CPPFLAGS="$CPPFLAGS -D$platform"
+        if test -d "${gssapi}/appsec-sdk/include"; then
+          CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
+        fi
+      fi
+    fi
+  fi
+  AC_CHECK_HEADER([gssapi.h],
+                  [AC_DEFINE(HAVE_GSSAPI_H,,
+                             [Define if you have the gssapi.h header file])],
+                  [AC_CHECK_HEADER([gssapi/gssapi.h],,
+                                   [AC_WARN([Disabling GSSAPI - no include files found]); gssapi=no])])
+
+  CPPFLAGS=$cmu_saved_CPPFLAGS
+
+fi
+
+if test "$gssapi" != no; then
+  # We need to find out which gssapi implementation we are
+  # using. Supported alternatives are: MIT Kerberos 5,
+  # Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal),
+  # CyberSafe Kerberos 5 (http://www.cybersafe.com/)
+  # and Sun SEAM (http://wwws.sun.com/software/security/kerberos/)
+  #
+  # The choice is reflected in GSSAPIBASE_LIBS
 
   AC_CHECK_LIB(resolv,res_search)
   if test -d ${gssapi}; then
@@ -81,8 +90,8 @@
      GSSAPIBASE_LIBS="-L$gssapi_dir"
      GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir"
   else
-     dnl FIXME: This is only used for building cyrus, and then only as
-     dnl a real hack.  it needs to be fixed.
+     # FIXME: This is only used for building cyrus, and then only as
+     # a real hack.  it needs to be fixed.
      gssapi_dir="/usr/local/lib"
   fi
 
@@ -93,7 +102,8 @@
 
   if test "$gss_impl" = "auto" -o "$gss_impl" = "heimdal"; then
     gss_failed=0
-    AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1,$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET})
+    AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1,
+                 ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET})
     if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
       gss_impl="failed"
     fi
@@ -101,7 +111,8 @@
 
   if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then
     gss_failed=0
-    AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1,$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${LIB_SOCKET})
+    AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1,
+                 ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${LIB_SOCKET})
     if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then
       gss_impl="failed"
     fi
@@ -112,7 +123,7 @@
 
     cmu_saved_CPPFLAGS=$CPPFLAGS
     cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS
-# FIX ME - Note that the libraries are in .../lib/64 for 64bit kernels
+# FIXME - Note that the libraries are in .../lib64 for 64bit kernels
     if test -d "${gssapi}/appsec-rt/lib"; then
       GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib"
     fi
@@ -127,8 +138,11 @@
 # library (older CyberSafe)
 
     unset ac_cv_lib_gss_csf_gss_acq_user
-    AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03",[
-      unset ac_cv_lib_gss_csf_gss_acq_user;AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe",gss_failed=1,$GSSAPIBASE_LIBS -lgss)],$GSSAPIBASE_LIBS -lgss -lcstbk5)
+    AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03",
+                 [unset ac_cv_lib_gss_csf_gss_acq_user;
+                  AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe",
+                               gss_failed=1,$GSSAPIBASE_LIBS -lgss)],
+                 [${GSSAPIBASE_LIBS} -lgss -lcstbk5])
 
     if test "$gss_failed" = "1"; then
 # Restore variables
@@ -175,214 +189,236 @@
     gssapi="no"
     GSSAPIBASE_LIBS=
     GSSAPIBASE_STATIC_LIBS=
-    AC_WARN(Disabling GSSAPI - specified library not found)
+    AC_WARN([Disabling GSSAPI - specified library not found])
   else
     gssapi="no"
     GSSAPIBASE_LIBS=
     GSSAPIBASE_STATIC_LIBS=
-    AC_WARN(Disabling GSSAPI - no library)
-  fi
- fi
+    AC_WARN([Disabling GSSAPI - no library])
+  fi
+fi
 
 #
-# Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME in gssapi\rfckrb5.h
+# Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME
+# in gssapi\rfckrb5.h
 #
- if test "$gssapi" != "no"; then
+if test "$gssapi" != "no"; then
   if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
-   AC_EGREP_CPP(hostbased_service_gss_nt_yes,
-    [#include <gssapi/gssapi.h>
-     #ifdef GSS_C_NT_HOSTBASED_SERVICE
-      hostbased_service_gss_nt_yes
-     #endif
-    ], AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]), AC_WARN(Cybersafe define not found))
+    AC_EGREP_CPP(hostbased_service_gss_nt_yes,
+                 [#include <gssapi/gssapi.h>
+                  #ifdef GSS_C_NT_HOSTBASED_SERVICE
+                    hostbased_service_gss_nt_yes
+                  #endif],
+                 [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
+                            [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])],
+                 [AC_WARN([Cybersafe define not found])])
 
   elif test "$ac_cv_header_gssapi_h" = "yes"; then
-   AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h,
-     AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]))
+    AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h,
+                    [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
+                               [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])])
   elif test "$ac_cv_header_gssapi_gssapi_h"; then
-
-   AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h,
-     AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,[Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE]))
+    AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h,
+                    [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
+                               [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])])
   fi
 
   if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
-   AC_EGREP_CPP(user_name_yes_gss_nt,
-    [#include <gssapi/gssapi.h>
-     #ifdef GSS_C_NT_USER_NAME
-      user_name_yes_gss_nt
-     #endif
-    ], AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]), AC_WARN(Cybersafe define not found))
+    AC_EGREP_CPP(user_name_yes_gss_nt,
+                 [#include <gssapi/gssapi.h>
+                  #ifdef GSS_C_NT_USER_NAME
+                   user_name_yes_gss_nt
+                  #endif],
+                 [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
+                            [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])],
+                 [AC_WARN([Cybersafe define not found])])
   elif test "$ac_cv_header_gssapi_h" = "yes"; then
-   AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h,
-    AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]))
+    AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h,
+                    [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
+                               [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])])
   elif test "$ac_cv_header_gssapi_gssapi_h"; then
-   AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h,
-    AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,[Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME]))
-  fi
- fi
-
- GSSAPI_LIBS=""
- AC_MSG_CHECKING(GSSAPI)
- if test "$gssapi" != no; then
-  AC_MSG_RESULT(with implementation ${gss_impl})
+    AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h,
+                    [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,,
+                               [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])])
+  fi
+fi
+
+GSSAPI_LIBS=""
+AC_MSG_CHECKING([GSSAPI])
+if test "$gssapi" != no; then
+  AC_MSG_RESULT([with implementation ${gss_impl}])
   AC_CHECK_LIB(resolv,res_search,GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv")
   SASL_MECHS="$SASL_MECHS libgssapiv2.la"
-  SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/gssapi.o"
+  SASL_STATIC_OBJS="$SASL_STATIC_OBJS gssapi.o"
+  SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/gssapi.c"
 
   cmu_save_LIBS="$LIBS"
   LIBS="$LIBS $GSSAPIBASE_LIBS"
   AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity)
   LIBS="$cmu_save_LIBS"
 else
-  AC_MSG_RESULT(disabled)
+  AC_MSG_RESULT([disabled])
 fi
 AC_SUBST(GSSAPI_LIBS)
 AC_SUBST(GSSAPIBASE_LIBS)
+])# SASL_GSSAPI_CHK
+
+
+# SASL_SET_GSSAPI_LIBS
+# --------------------
+AC_DEFUN([SASL_SET_GSSAPI_LIBS],
+[SASL_GSSAPI_LIBS_SET="yes"
 ])
 
-AC_DEFUN([SASL_SET_GSSAPI_LIBS], [
-    SASL_GSSAPI_LIBS_SET="yes"
-])
-
-dnl What we want to do here is setup LIB_SASL with what one would
-dnl generally want to have (e.g. if static is requested, make it that,
-dnl otherwise make it dynamic.
-
-dnl We also want to create LIB_DYN_SASL and DYNSASLFLAGS.
-
-dnl Also sets using_static_sasl to "no" "static" or "staticonly"
-
-AC_DEFUN([CMU_SASL2], [
-	AC_REQUIRE([SASL_GSSAPI_CHK])
+
+# CMU_SASL2
+# ---------
+# What we want to do here is setup LIB_SASL with what one would
+# generally want to have (e.g. if static is requested, make it that,
+# otherwise make it dynamic.
+#
+# We also want to create LIB_DYN_SASL and DYNSASLFLAGS.
+#
+# Also sets using_static_sasl to "no" "static" or "staticonly"
+#
+AC_DEFUN([CMU_SASL2],
+[AC_REQUIRE([SASL_GSSAPI_CHK])
 
 AC_ARG_WITH(sasl,
-            [  --with-sasl=DIR         Compile with libsasl2 in <DIR>],
-	    with_sasl="$withval",
+            [AC_HELP_STRING([--with-sasl=DIR],[Compile with libsasl2 in <DIR>])],
+            with_sasl="$withval",
             with_sasl="yes")
 
 AC_ARG_WITH(staticsasl,
-	    [  --with-staticsasl=DIR   Compile with staticly linked libsasl2 in <DIR>],
-	    with_staticsasl="$withval";
-	    if test $with_staticsasl != "no"; then
-		using_static_sasl="static"
-	    fi,
-	    with_staticsasl="no"; using_static_sasl="no")
-
-	SASLFLAGS=""
-	LIB_SASL=""
-
-	cmu_saved_CPPFLAGS=$CPPFLAGS
-	cmu_saved_LDFLAGS=$LDFLAGS
-	cmu_saved_LIBS=$LIBS
-
-	if test ${with_staticsasl} != "no"; then
-	  if test -d ${with_staticsasl}; then
-	    if test -d ${with_staticsasl}/lib64 ; then
-	      ac_cv_sasl_where_lib=${with_staticsasl}/lib64
-	    else
-	      ac_cv_sasl_where_lib=${with_staticsasl}/lib
-	    fi
-	    ac_cv_sasl_where_lib=${with_staticsasl}/lib
-	    ac_cv_sasl_where_inc=${with_staticsasl}/include
-
-	    SASLFLAGS="-I$ac_cv_sasl_where_inc"
-	    LIB_SASL="-L$ac_cv_sasl_where_lib"
-	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
-	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
-	  else
-	    with_staticsasl="/usr"
-	  fi
-
-	  AC_CHECK_HEADER(sasl/sasl.h, [
-	    AC_CHECK_HEADER(sasl/saslutil.h, [
-	     for i42 in lib64 lib; do
-	        if test -r ${with_staticsasl}/$i42/libsasl2.a; then
-		  ac_cv_found_sasl=yes
-		  AC_MSG_CHECKING(for static libsasl)
-		  LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
-		fi
-	     done
-             if test ! "$ac_cv_found_sasl" = "yes"; then
-	          AC_MSG_CHECKING(for static libsasl)
-		  AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a])
-             fi
-	    ])])
-
-	  AC_MSG_RESULT(found)
-
-          if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
-	    LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
-	  else
-	    SASL_GSSAPI_LIBS_SET=""
-	    cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS" 
-	  fi
-	fi
-
-	if test -d ${with_sasl}; then
-            ac_cv_sasl_where_lib=${with_sasl}/lib
-            ac_cv_sasl_where_inc=${with_sasl}/include
-
-	    DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
-	    if test "$ac_cv_sasl_where_lib" != ""; then
-		CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL)
-	    fi
-	    LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
-	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
-	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
-	fi
-
-	dnl be sure to check for a SASLv2 specific function
-	AC_CHECK_HEADER(sasl/sasl.h, [
-	    AC_CHECK_HEADER(sasl/saslutil.h, [
-	      AC_CHECK_LIB(sasl2, prop_get, 
-                           ac_cv_found_sasl=yes,
-		           ac_cv_found_sasl=no)],
-	                   ac_cv_found_sasl=no)], ac_cv_found_sasl=no)
-
-	if test "$ac_cv_found_sasl" = "yes"; then
-	    if test "$ac_cv_sasl_where_lib" != ""; then
-	        CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL)
-	    fi
-	    DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
-	    if test "$using_static_sasl" != "static"; then
-		LIB_SASL=$DYNLIB_SASL
-		SASLFLAGS=$DYNSASLFLAGS
-	    fi
-	else
-	    DYNLIB_SASL=""
-	    DYNSASLFLAGS=""
-	    using_static_sasl="staticonly"
-	fi
-
-        if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
-	    SASL_GSSAPI_LIBS_SET=""
-	    cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS" 
-	fi
-
-	LIBS="$cmu_saved_LIBS"
-	LDFLAGS="$cmu_saved_LDFLAGS"
-	CPPFLAGS="$cmu_saved_CPPFLAGS"
-
-	AC_SUBST(LIB_DYN_SASL)
-	AC_SUBST(DYNSASLFLAGS)
-	AC_SUBST(LIB_SASL)
-	AC_SUBST(SASLFLAGS)
-	])
-
+            [AC_HELP_STRING([--with-staticsasl=DIR],
+                            [Compile with staticly linked libsasl2 in <DIR>])],
+            [with_staticsasl="$withval";
+             if test $with_staticsasl != "no"; then
+               using_static_sasl="static"
+             fi],
+            [with_staticsasl="no"; using_static_sasl="no"])
+
+SASLFLAGS=""
+LIB_SASL=""
+
+cmu_saved_CPPFLAGS=$CPPFLAGS
+cmu_saved_LDFLAGS=$LDFLAGS
+cmu_saved_LIBS=$LIBS
+
+if test ${with_staticsasl} != "no"; then
+  if test -d ${with_staticsasl}; then
+    if test -d ${with_staticsasl}/lib64 ; then
+      ac_cv_sasl_where_lib=${with_staticsasl}/lib64
+    else
+      ac_cv_sasl_where_lib=${with_staticsasl}/lib
+    fi
+    ac_cv_sasl_where_lib=${with_staticsasl}/lib
+    ac_cv_sasl_where_inc=${with_staticsasl}/include
+
+    SASLFLAGS="-I$ac_cv_sasl_where_inc"
+    LIB_SASL="-L$ac_cv_sasl_where_lib"
+    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
+    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
+  else
+    with_staticsasl="/usr"
+  fi
+
+  AC_CHECK_HEADER(sasl/sasl.h,
+                  [AC_CHECK_HEADER(sasl/saslutil.h,
+                                   [for i42 in lib64 lib; do
+                                      if test -r ${with_staticsasl}/$i42/libsasl2.a; then
+                                        ac_cv_found_sasl=yes
+                                        AC_MSG_CHECKING([for static libsasl])
+                                        LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
+                                      fi
+                                    done
+                                    if test ! "$ac_cv_found_sasl" = "yes"; then
+                                      AC_MSG_CHECKING([for static libsasl])
+                                      AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a])
+                                    fi])])
+
+  AC_MSG_RESULT([found])
+
+  if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
+    LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
+  else
+    SASL_GSSAPI_LIBS_SET=""
+    cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS" 
+  fi
+fi
+
+if test -d ${with_sasl}; then
+  ac_cv_sasl_where_lib=${with_sasl}/lib
+  ac_cv_sasl_where_inc=${with_sasl}/include
+
+  DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
+  if test "$ac_cv_sasl_where_lib" != ""; then
+    CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL)
+  fi
+  LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
+  CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
+  LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
+fi
+
+# be sure to check for a SASLv2 specific function
+AC_CHECK_HEADER(sasl/sasl.h,
+                [AC_CHECK_HEADER(sasl/saslutil.h,
+                                 [AC_CHECK_LIB(sasl2, prop_get, 
+                                               ac_cv_found_sasl=yes,
+                                               ac_cv_found_sasl=no)],
+                                 ac_cv_found_sasl=no)],
+                ac_cv_found_sasl=no)
+
+if test "$ac_cv_found_sasl" = "yes"; then
+  if test "$ac_cv_sasl_where_lib" != ""; then
+    CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL)
+  fi
+  DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
+  if test "$using_static_sasl" != "static"; then
+    LIB_SASL=$DYNLIB_SASL
+    SASLFLAGS=$DYNSASLFLAGS
+  fi
+else
+  DYNLIB_SASL=""
+  DYNSASLFLAGS=""
+  using_static_sasl="staticonly"
+fi
+
+if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
+  SASL_GSSAPI_LIBS_SET=""
+  cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS" 
+fi
+
+LIBS="$cmu_saved_LIBS"
+LDFLAGS="$cmu_saved_LDFLAGS"
+CPPFLAGS="$cmu_saved_CPPFLAGS"
+
+AC_SUBST(LIB_DYN_SASL)
+AC_SUBST(DYNSASLFLAGS)
+AC_SUBST(LIB_SASL)
+AC_SUBST(SASLFLAGS)
+])# CMU_SASL2
+
+
+# CMU_SASL2_REQUIRED
+# ------------------
 AC_DEFUN([CMU_SASL2_REQUIRED],
 [AC_REQUIRE([CMU_SASL2])
 if test "$ac_cv_found_sasl" != "yes"; then
-        AC_ERROR([Cannot continue without libsasl2.
+  AC_ERROR([Cannot continue without libsasl2.
 Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.])
 fi])
 
-AC_DEFUN([CMU_SASL2_REQUIRE_VER], [
-	AC_REQUIRE([CMU_SASL2_REQUIRED])
-
-	cmu_saved_CPPFLAGS=$CPPFLAGS
-	CPPFLAGS="$CPPFLAGS $SASLFLAGS"
-
-	AC_TRY_CPP([
+
+# CMU_SASL2_REQUIRE_VER
+# ---------------------
+AC_DEFUN([CMU_SASL2_REQUIRE_VER],
+[AC_REQUIRE([CMU_SASL2_REQUIRED])
+
+cmu_saved_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $SASLFLAGS"
+
+AC_TRY_CPP([
 #include <sasl/sasl.h>
 
 #ifndef SASL_VERSION_MAJOR
@@ -398,28 +434,36 @@
 #if SASL_VERSION_MAJOR < $1 || SASL_VERSION_MINOR < $2 || SASL_VERSION_STEP < $3
 #error SASL version is less than $1.$2.$3
 #endif
-	],,AC_ERROR([Incorrect SASL headers found.  This package requires SASL $1.$2.$3 or newer.]))
-
-	CPPFLAGS=$cmu_saved_CPPFLAGS
-])
-
-AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED], [
-	AC_REQUIRE([CMU_SASL2_REQUIRED])
-
-	cmu_saved_LDFLAGS=$LDFLAGS
-
-	LDFLAGS="$LDFLAGS $LIB_SASL"
-
-	AC_CHECK_LIB(sasl2, sasl_checkapop, AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?]),
-		AC_MSG_ERROR([libsasl2 without working sasl_checkapop.  Cannot continue.]))
-
-	LDFLAGS=$cmu_saved_LDFLAGS
-])
-
-AC_DEFUN([SASL2_CRYPT_CHK],[
- AC_CHECK_FUNC(crypt, cmu_have_crypt=yes, [
-  AC_CHECK_LIB(crypt, crypt,
-	       LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes,
-	       cmu_have_crypt=no)])
- AC_SUBST(LIB_CRYPT)
-])
+],,
+           [AC_ERROR([Incorrect SASL headers found.  This package requires SASL $1.$2.$3 or newer.])])
+
+CPPFLAGS=$cmu_saved_CPPFLAGS
+])# CMU_SASL2_REQUIRE_VER
+
+
+# CMU_SASL2_CHECKAPOP_REQUIRED
+# ----------------------------
+AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED],
+[AC_REQUIRE([CMU_SASL2_REQUIRED])
+
+cmu_saved_LDFLAGS=$LDFLAGS
+
+LDFLAGS="$LDFLAGS $LIB_SASL"
+
+AC_CHECK_LIB(sasl2, sasl_checkapop,
+             [AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?])],
+             [AC_MSG_ERROR([libsasl2 without working sasl_checkapop.  Cannot continue.])])
+
+LDFLAGS=$cmu_saved_LDFLAGS
+])# CMU_SASL2_CHECKAPOP_REQUIRED
+
+
+# SASL2_CRYPT_CHK
+# ---------------
+AC_DEFUN([SASL2_CRYPT_CHK],
+[AC_CHECK_FUNC(crypt, cmu_have_crypt=yes,
+               [AC_CHECK_LIB(crypt, crypt,
+                             LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes,
+                             cmu_have_crypt=no)])
+AC_SUBST(LIB_CRYPT)
+])# SASL2_CRYPT_CHK

Modified: trunk/cyrus-imapd-2.2/cmulocal/telnet.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/telnet.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/telnet.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/telnet.m4 Fri Mar 31 20:18:13 2006
@@ -1,10 +1,10 @@
 dnl telnet.m4--telnet special macros
 dnl Derrick Brashear
-dnl $Id: telnet.m4,v 1.12 2003/10/08 20:35:25 rjs3 Exp $
+dnl $Id: telnet.m4,v 1.13 2006/02/25 18:36:36 cg2v Exp $
 
 AC_DEFUN([CMU_TELNET_WHICH_TERM], [
 AC_CHECK_LIB(termlib, setupterm, [
-AC_DEFINE(HAVE_SETUPTERM) 
+AC_DEFINE(HAVE_SETUPTERM,, [Define to 1 if you have the `setupterm' function.]) 
 AC_CHECK_LIB(c, setupterm, TCLIB="/usr/ccs/lib/libtermlib.a",TCLIB="-ltermlib","/usr/ccs/lib/libtermlib.a")
 ],  TCLIB="-ltermcap")
 ])
@@ -28,22 +28,22 @@
 cmu_cv_cc_t_definition=no)
 ])
 if test "$cmu_cv_cc_t_definition" = "no"; then
-        AC_DEFINE(NO_CC_T)
+        AC_DEFINE(NO_CC_T,, [The type `cc_t' is not available])
 fi
 AC_MSG_RESULT($cmu_cv_cc_t_definition)
 ])
 
 AC_DEFUN([CMU_STREAMS], [
 if test "$ac_cv_header_sys_stropts_h" = "yes" -o "$ac_cv_header_stropts_h" = "yes"; then 
-	AC_DEFINE(HAVE_STREAMS)dnl
+	AC_DEFINE(HAVE_STREAMS,, [STREAMS are available])dnl
 fi
 ])
 
 AC_DEFUN([CMU_TERMIO_MODEL], [
 if test "$ac_cv_header_sys_termio_h" = "yes" -o "$ac_cv_header_sys_termios_h" = "yes"; then 
-	AC_DEFINE(USE_TERMIO)dnl
+	AC_DEFINE(USE_TERMIO,, [Use termios for tty configuration])dnl
 	if test "$ac_cv_header_sys_termios_h" = "no"; then
-		AC_DEFINE(SYSV_TERMIO)dnl
+		AC_DEFINE(SYSV_TERMIO,, [Use SysV termios])dnl
 	fi
 fi
 ])
@@ -60,7 +60,7 @@
 cmu_cv_des_string_to_key_proto=yes)
 ])
 if test "$cmu_cv_des_string_to_key_proto" = yes; then
-        AC_DEFINE(HAVE_DES_STRING_TO_KEY_PROTO)dnl
+        AC_DEFINE(HAVE_DES_STRING_TO_KEY_PROTO,, [define to 1 if `des_string_to_key' has a prototype])dnl
 fi
 AC_MSG_RESULT($cmu_cv_des_string_to_key_proto)
 ])
@@ -71,14 +71,14 @@
 AC_TRY_COMPILE(
 [
 #include <des.h>
-char des_key_sched(int foo, int bar, int baz);
+char des_key_sched(int foo, int bar);
 ],
 [des_key_sched(NULL, NULL);],
 cmu_cv_des_key_sched_proto=no,
 cmu_cv_des_key_sched_proto=yes)
 ])
 if test "$cmu_cv_des_key_sched_proto" = yes; then
-        AC_DEFINE(HAVE_DES_KEY_SCHED_PROTO)dnl
+        AC_DEFINE(HAVE_DES_KEY_SCHED_PROTO,, [define to 1 if `des_key_sched' has a prototype])dnl
 fi
 AC_MSG_RESULT($cmu_cv_des_key_sched_proto)
 ])
@@ -89,14 +89,14 @@
 AC_TRY_COMPILE(
 [
 #include <des.h>
-char des_set_random_generator_seed(int foo, int bar, int baz);
+char des_set_random_generator_seed(int foo, int bar);
 ],
 [des_set_random_generator_seed(NULL, NULL);],
 cmu_cv_des_set_random_generator_seed_proto=no,
 cmu_cv_des_set_random_generator_seed_proto=yes)
 ])
 if test "$cmu_cv_des_set_random_generator_seed_proto" = yes; then
-        AC_DEFINE(HAVE_DES_SET_RANDOM_GENERATOR_SEED_PROTO)dnl
+        AC_DEFINE(HAVE_DES_SET_RANDOM_GENERATOR_SEED_PROTO,, [define to 1 if `des_set_random_generator_seed' has a prototype])dnl
 fi
 AC_MSG_RESULT($cmu_cv_des_set_random_generator_seed_proto)
 ])
@@ -107,14 +107,14 @@
 AC_TRY_COMPILE(
 [
 #include <des.h>
-char des_new_random_key(int foo, int bar, int baz);
+char des_new_random_key(int foo, int bar);
 ],
 [des_new_random_key(NULL, NULL);],
 cmu_cv_des_new_random_key_proto=no,
 cmu_cv_des_new_random_key_proto=yes)
 ])
 if test "$cmu_cv_des_new_random_key_proto" = yes; then
-        AC_DEFINE(HAVE_DES_NEW_RANDOM_KEY_PROTO)dnl
+        AC_DEFINE(HAVE_DES_NEW_RANDOM_KEY_PROTO,, [define to 1 if `des_new_random_key' has a prototype])dnl
 fi
 AC_MSG_RESULT($cmu_cv_des_new_random_key_proto)
 ])
@@ -132,48 +132,16 @@
 cmu_cv_des_ecb_encrypt_proto=yes)
 ])
 if test "$cmu_cv_des_ecb_encrypt_proto" = yes; then
-        AC_DEFINE(HAVE_DES_ECB_ENCRYPT_PROTO)dnl
+        AC_DEFINE(HAVE_DES_ECB_ENCRYPT_PROTO,, [define to 1 if `des_ecb_encrypt' has a prototype])dnl
 fi
 AC_MSG_RESULT($cmu_cv_des_ecb_encrypt_proto)
 ])
-
-AC_DEFUN([CMU_TELNET_NEWDES], [
-AC_REQUIRE([CMU_KRB4])
-AC_REQUIRE([CMU_KRB5])
-AC_MSG_CHECKING(for des_new_random_key prototype)
-AC_CACHE_VAL(ac_cv_func_des_new_random_key_proto, [
-AC_TRY_COMPILE(
-[#include <des.h>
-des_cblock key;],
-[des_new_random_key(&key);],
-ac_cv_func_des_new_random_key=yes,
-ac_cv_func_des_new_random_key=no)
-])
-if test "$ac_cv_func_des_new_random_key" = yes; then
-        AC_DEFINE(NEWDESLIB)dnl
-fi
-AC_MSG_RESULT($ac_cv_func_des_new_random_key)
-])
-
-AC_DEFUN([CMU_TELNET_OLDNEWDES], [
-AC_REQUIRE([CMU_KRB4])
-AC_REQUIRE([CMU_KRB5])
-	 saved_LIBS=$LIBS
-	 LIBS="$KRB_LIB_FLAGS $KRB5_LIB_FLAGS"
-	 if test "$with_des" = yes; then
-		AC_CHECK_FUNCS(des_new_random_key)
-		if test "$ac_cv_func_des_new_random_key" = yes; then
-			AC_DEFINE(NEWDESLIB)
-		fi
-	 fi
-	 LIBS=$saved_LIBS
-	 ])
 
 AC_DEFUN([CMU_TELNET_GETTYTAB], [
 	 if test -f "/etc/gettytab"; then
 		AC_CHECK_FUNCS(getent getstr)
 	        if test "X$ac_cv_func_getent" != "Xyes"; then
-			AC_DEFINE(HAVE_GETTYTAB)
+			AC_DEFINE(HAVE_GETTYTAB,, [gettytab support is present])
 			if test "X$ac_cv_func_getstr" = "Xyes"; then
 				CFLAGS="$CFLAGS -Dgetstr=ggetstr"
 			fi
@@ -185,10 +153,10 @@
 
 AC_DEFUN([CMU_TELNET_ISSUE], [
 	 if test -f "/etc/issue.net"; then
-		AC_DEFINE(ISSUE_FILE, "/etc/issue.net")
+		AC_DEFINE(ISSUE_FILE, "/etc/issue.net", [path of issue file to use])
 	 else
 		if test -f "/etc/issue"; then
-			AC_DEFINE(ISSUE_FILE, "/etc/issue")
+			AC_DEFINE(ISSUE_FILE, "/etc/issue", [path of issue file to use])
 		fi
 	 fi
 	 ])
@@ -200,11 +168,11 @@
 		  *-*-irix*)
 		    ;;
 		  *-*-linux*)
-		    AC_DEFINE(PTYDIR)
+		    AC_DEFINE(PTYDIR,, [Has /dev/ptX and pty allocation funcs])
 		    ;;
 		  *)
-		    AC_DEFINE(PTYDIR)
-		    AC_DEFINE(STREAMSPTY)
+		    AC_DEFINE(PTYDIR,, [Has /dev/ptX and pty allocation funcs])
+		    AC_DEFINE(STREAMSPTY,, [ptys are streams devices])
 		    ;;
 		esac
 	 fi

Modified: trunk/cyrus-imapd-2.2/cmulocal/ucdsnmp.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/ucdsnmp.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/ucdsnmp.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/ucdsnmp.m4 Fri Mar 31 20:18:13 2006
@@ -1,7 +1,8 @@
 dnl look for the (ucd|net)snmp libraries
-dnl $Id: ucdsnmp.m4,v 1.10 2004/05/24 19:25:41 ken3 Exp $
+dnl $Id: ucdsnmp.m4,v 1.11 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_UCDSNMP], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
   AC_REQUIRE([CMU_SOCKETS])
   AC_ARG_WITH(snmp, 
               [  --with-snmp=DIR         use ucd|net snmp (rooted in DIR) [yes] ],
@@ -46,7 +47,7 @@
     if test "$with_snmp" != no; then
       if test -d "$with_snmp"; then
         CPPFLAGS="$CPPFLAGS -I${with_snmp}/include"
-        LDFLAGS="$LDFLAGS -L${with_snmp}/lib"
+        LDFLAGS="$LDFLAGS -L${with_snmp}/$CMU_LIB_SUBDIR"
       fi
       cmu_save_LIBS="$LIBS"
       AC_CHECK_LIB(snmp, sprint_objid, [

Modified: trunk/cyrus-imapd-2.2/cmulocal/zephyr.m4
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/cmulocal/zephyr.m4?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/cmulocal/zephyr.m4 (original)
+++ trunk/cyrus-imapd-2.2/cmulocal/zephyr.m4 Fri Mar 31 20:18:13 2006
@@ -2,7 +2,7 @@
 dnl based on kafs.m4, by
 dnl Derrick Brashear
 dnl from KTH kafs and Arla
-dnl $Id: zephyr.m4,v 1.1 2004/02/14 21:10:51 cg2v Exp $
+dnl $Id: zephyr.m4,v 1.2 2005/04/26 19:14:08 shadow Exp $
 
 AC_DEFUN([CMU_ZEPHYR_INC_WHERE1], [
 saved_CPPFLAGS=$CPPFLAGS
@@ -57,6 +57,7 @@
 ])
 
 AC_DEFUN([CMU_ZEPHYR], [
+AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
 AC_REQUIRE([CMU_SOCKETS])
 AC_REQUIRE([CMU_KRB4])
 AC_ARG_WITH(zephyr,
@@ -77,7 +78,7 @@
 
         if test "X$with_zephyr" != "X"; then
           if test "$with_zephyr" != "yes" -a "$with_zephyr" != no; then
-            ac_cv_zephyr_where_lib=$with_zephyr/lib
+            ac_cv_zephyr_where_lib=$with_zephyr/$CMU_LIB_SUBDIR
             ac_cv_zephyr_where_inc=$with_zephyr/include
           fi
         fi
@@ -87,7 +88,7 @@
             ac_cv_zephyr_where_lib=$with_zephyr_lib
           fi
           if test "X$ac_cv_zephyr_where_lib" = "X"; then
-            CMU_ZEPHYR_LIB_WHERE(/usr/athena/lib /usr/local/lib /usr/lib)
+            CMU_ZEPHYR_LIB_WHERE(/usr/athena/$CMU_LIB_SUBDIR /usr/local/$CMU_LIB_SUBDIR /usr/$CMU_LIB_SUBDIR)
           fi
 
           if test "X$with_zephyr_include" != "X"; then

Modified: trunk/cyrus-imapd-2.2/config.h.in
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/config.h.in?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/config.h.in (original)
+++ trunk/cyrus-imapd-2.2/config.h.in Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 /* config.h.in.  Generated from configure.in by autoheader.  */
 
 
-/* $Id: configure.in,v 1.290 2005/01/18 23:46:00 shadow Exp $ */
+/* $Id: configure.in,v 1.296 2005/10/13 19:56:14 jeaton Exp $ */
 /* 
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -73,6 +73,9 @@
 /* Do we have strerror()? */
 #undef HAS_STRERROR
 
+/* Should we build afskrb pts module? */
+#undef HAVE_AFSKRB
+
 /* Does SASL support APOP? */
 #undef HAVE_APOP
 
@@ -135,6 +138,9 @@
 /* Support for Kerberos? */
 #undef HAVE_KRB
 
+/* Should we build ldap pts module? */
+#undef HAVE_LDAP
+
 /* Define to 1 if you have the `dl' library (-ldl). */
 #undef HAVE_LIBDL
 
@@ -280,6 +286,12 @@
 /* Use "imap" as sieve service name? */
 #undef OLD_SIEVE_SERVICE_NAME
 
+/* Configure OpenSSL to provide krb4-compatible legacy des apis */
+#undef OPENSSL_DES_LIBDES_COMPATIBILITY
+
+/* Configure OpenSSL to provide legacy des apis */
+#undef OPENSSL_ENABLE_OLD_DES_SUPPORT
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
@@ -297,6 +309,9 @@
 
 /* Directiory to use for service binaries */
 #undef SERVICE_PATH
+
+/* The size of a `long', as computed by sizeof. */
+#undef SIZEOF_LONG
 
 /* Do we already have setproctitle? */
 #undef SPT_TYPE
@@ -336,9 +351,11 @@
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
-/* Define as `__inline' if that's what the C compiler calls it, or to nothing
-   if it is not supported. */
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
 #undef inline
+#endif
 
 
 /* time.h */

Modified: trunk/cyrus-imapd-2.2/configure
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/configure?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/configure (original)
+++ trunk/cyrus-imapd-2.2/configure Fri Mar 31 20:18:13 2006
@@ -1,9 +1,8 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.59.
 #
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -20,9 +19,10 @@
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
 else
   as_unset=false
@@ -41,7 +41,7 @@
   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
   LC_TELEPHONE LC_TIME
 do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
     $as_unset $as_var
@@ -218,16 +218,17 @@
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
 else
+  test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
 as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
 # Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 # IFS
@@ -308,7 +309,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os MAKEDEPEND cyrus_prefix service_path cyrus_user cyrus_group CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP AWK LIBOBJS LIB_SOCKET IPV6_OBJS PRE_SUBDIRS EXTRA_SUBDIRS DEPLIBS LOCALDEFS WITH_AUTH BDB_INC BDB_LIB CYRUSDB_OBJS SIEVE_OBJS SIEVE_LIBS SIEVE_CPPFLAGS YACC LEX LEXLIB LEX_OUTPUT_ROOT SIEVE_SUBDIRS WITH_NONBLOCK WITH_GMTOFF WITH_MAP WITH_LOCK cyrus_sigveclib WITH_PTS AFS_LIBS AFS_LDFLAGS LDAP_CPPFLAGS LDAP_LDFLAGS LDAP_LIBS SERVER_SUBDIRS OPENSSL_INC OPENSSL_LIB ZEPHYR_LIBS ZEPHYR_CPPFLAGS WITH_IDLE IMAP_PROGS COMPILE_ET COM_ERR_LIBS COM_ERR_LDFLAGS COM_ERR_CPPFLAGS LIB_CRYPT GSSAPI_LIBS GSSAPIBASE_LIBS LIB_DYN_SASL DYNSASLFLAGS LIB_SASL SASLFLAGS PERL PERL_CCCDLFLAGS MD5OBJ SNMP_SUBDIRS LIB_WRAP SNMP_CONFIG LIB_UCDSNMP LIB_RT IMAP_COM_ERR_LIBS IMAP_LIBS PERL_SUBDIRS PERL_DEPSUBDIRS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os MAKEDEPEND cyrus_prefix service_path cyrus_user cyrus_group CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP AWK LIBOBJS LIB_SOCKET IPV6_OBJS PRE_SUBDIRS EXTRA_SUBDIRS DEPLIBS LOCALDEFS BDB_INC BDB_LIB CYRUSDB_OBJS SIEVE_OBJS SIEVE_LIBS SIEVE_CPPFLAGS YACC LEX LEXLIB LEX_OUTPUT_ROOT SIEVE_SUBDIRS WITH_NONBLOCK WITH_GMTOFF WITH_MAP WITH_LOCK cyrus_sigveclib AFS_LIBS AFS_LDFLAGS LDAP_CPPFLAGS LDAP_LDFLAGS LDAP_LIBS SERVER_SUBDIRS OPENSSL_INC OPENSSL_LIB ZEPHYR_LIBS ZEPHYR_CPPFLAGS WITH_IDLE IMAP_PROGS COMPILE_ET COM_ERR_LIBS COM_ERR_LDFLAGS COM_ERR_CPPFLAGS LIB_CRYPT GSSAPI_LIBS GSSAPIBASE_LIBS LIB_DYN_SASL DYNSASLFLAGS LIB_SASL SASLFLAGS PERL PERL_CCCDLFLAGS MD5OBJ SNMP_SUBDIRS CMU_LIB_SUBDIR LIB_WRAP SNMP_CONFIG LIB_UCDSNMP LIB_RT IMAP_COM_ERR_LIBS IMAP_LIBS PERL_SUBDIRS PERL_DEPSUBDIRS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -667,7 +668,7 @@
 
 # Be sure to have absolute paths.
 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-              localstatedir libdir includedir oldincludedir infodir mandir
+	      localstatedir libdir includedir oldincludedir infodir mandir
 do
   eval ac_val=$`echo $ac_var`
   case $ac_val in
@@ -707,10 +708,10 @@
   # Try the directory containing this script, then its parent.
   ac_confdir=`(dirname "$0") 2>/dev/null ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$0" : 'X\(//\)[^/]' \| \
-         X"$0" : 'X\(//\)$' \| \
-         X"$0" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
 echo X"$0" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -802,9 +803,9 @@
   cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
+			  [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
+			  [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -854,7 +855,7 @@
   --enable-listext        enable IMAP List extensions
   --enable-netscapehack   enable Netscape hack for the menu option
                           in Communicator to Administrate Mail
-  --enable-gssapi=<DIR>   enable GSSAPI authentication yes
+  --enable-gssapi=<DIR>   enable GSSAPI authentication [yes]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -865,16 +866,12 @@
   --with-service-path=DIR    use DIR as service install directory
   --with-cyrus-user=USERID   use USERID cyrus userid
   --with-cyrus-group=GROUPID use GROUPID cyrus group
-  --with-auth=METHOD      use authorization module METHOD
-                          METHOD is 'unix' (default), 'krb', 'krb5', or 'pts'
   --with-bdb=DIR          use Berkeley DB (in DIR) [yes]
   --with-bdb-libdir=DIR   Berkeley DB lib files are in DIR
   --with-bdb-incdir=DIR   Berkeley DB include files are in DIR
   --with-lock=METHOD      force use of METHOD for locking (flock or fcntl)
   --with-afs=PATH         use AFS libraries from PATH
   --with-ldap=DIR         use LDAP (in DIR) (experimental) /usr/local
-  --with-pts=MODULE       use PTS module MODULE
-                          MODULE is 'afskrb' (default) or 'ldap' (experimental)
   --with-krb=PATH         use Kerberos from PATH
   --with-krbimpl=\kth|mit\         assume Kerberos 4 from KTH or MIT
   --with-krbdes           use Kerberos DES implementation [yes]
@@ -888,10 +885,12 @@
   --with-com_err=PATH     use com_err from path -- includes in PATH/include,
                           libs in PATH/lib, and compile_et in PATH/bin
   --with-syslogfacility=FACILITY set the syslog facility to use (default LOCAL6)
-  --with-gss_impl={heimdal|mit|cybersafe|seam|auto}                                                       choose specific GSSAPI implementation [auto]
+  --with-gss_impl={heimdal|mit|cybersafe|seam|auto}
+                          choose specific GSSAPI implementation [[auto]]
   --with-sasl=DIR         Compile with libsasl2 in <DIR>
   --with-staticsasl=DIR   Compile with staticly linked libsasl2 in <DIR>
   --with-perl=PERL        use PERL for perl
+  --with-lib-subdir=DIR   Find libraries in DIR instead of lib
   --with-libwrap=DIR      use libwrap (rooted in DIR) yes
   --with-snmp=DIR         use ucd|net snmp (rooted in DIR) yes
 
@@ -940,12 +939,45 @@
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
     cd $ac_dir
     # Check for guested configure; otherwise get Cygnus style configure.
@@ -956,7 +988,7 @@
       echo
       $SHELL $ac_srcdir/configure  --help=recursive
     elif test -f $ac_srcdir/configure.ac ||
-           test -f $ac_srcdir/configure.in; then
+	   test -f $ac_srcdir/configure.in; then
       echo
       $ac_configure --help
     else
@@ -970,8 +1002,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -983,7 +1014,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.57.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
 
@@ -1060,19 +1091,19 @@
     2)
       ac_configure_args1="$ac_configure_args1 '$ac_arg'"
       if test $ac_must_keep_next = true; then
-        ac_must_keep_next=false # Got value, back to normal.
+	ac_must_keep_next=false # Got value, back to normal.
       else
-        case $ac_arg in
-          *=* | --config-cache | -C | -disable-* | --disable-* \
-          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-          | -with-* | --with-* | -without-* | --without-* | --x)
-            case "$ac_configure_args0 " in
-              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-            esac
-            ;;
-          -* ) ac_must_keep_next=true ;;
-        esac
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
       fi
       ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
       # Get rid of the leading space.
@@ -1106,12 +1137,12 @@
     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
     *ac_space=\ *)
       sed -n \
-        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
       ;;
     *)
       sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
 }
@@ -1140,7 +1171,7 @@
       for ac_var in $ac_subst_files
       do
 	eval ac_val=$`echo $ac_var`
-        echo "$ac_var='"'"'$ac_val'"'"'"
+	echo "$ac_var='"'"'$ac_val'"'"'"
       done | sort
       echo
     fi
@@ -1159,7 +1190,7 @@
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core core.* *.core &&
+  rm -f core *.core &&
   rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
      ' 0
@@ -1239,7 +1270,7 @@
 # value.
 ac_cache_corrupted=false
 for ac_var in `(set) 2>&1 |
-               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
@@ -1256,13 +1287,13 @@
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
 echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
 echo "$as_me:   current value: $ac_new_val" >&2;}
-        ac_cache_corrupted=:
+	ac_cache_corrupted=:
       fi;;
   esac
   # Pass precious variables to config.status.
@@ -1853,7 +1884,6 @@
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -1873,8 +1903,8 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
@@ -1894,23 +1924,23 @@
   test -f "$ac_file" || continue
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-        ;;
+	;;
     conftest.$ac_ext )
-        # This is the source file.
-        ;;
+	# This is the source file.
+	;;
     [ab].out )
-        # We found the default executable, but exeext='' is most
-        # certainly right.
-        break;;
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
     *.* )
-        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-        # FIXME: I believe we export ac_cv_exeext for Libtool,
-        # but it would be cool to find out if it's true.  Does anybody
-        # maintain Libtool? --akim.
-        export ac_cv_exeext
-        break;;
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
     * )
-        break;;
+	break;;
   esac
 done
 else
@@ -1984,8 +2014,8 @@
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          export ac_cv_exeext
-          break;;
+	  export ac_cv_exeext
+	  break;;
     * ) break;;
   esac
 done
@@ -2010,7 +2040,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2061,7 +2090,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2081,11 +2109,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2098,7 +2136,7 @@
 
 ac_compiler_gnu=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
@@ -2114,7 +2152,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2131,11 +2168,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2148,7 +2195,7 @@
 
 ac_cv_prog_cc_g=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
@@ -2175,7 +2222,6 @@
   ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2203,6 +2249,16 @@
   va_end (v);
   return s;
 }
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2229,11 +2285,21 @@
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2246,7 +2312,7 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext
+rm -f conftest.err conftest.$ac_objext
 done
 rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
@@ -2274,19 +2340,28 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
-   ''\
-   '#include <stdlib.h>' \
+   '' \
    'extern "C" void std::exit (int) throw (); using std::exit;' \
    'extern "C" void std::exit (int); using std::exit;' \
    'extern "C" void exit (int) throw ();' \
@@ -2294,13 +2369,57 @@
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
 #include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $ac_declaration
 int
 main ()
@@ -2312,59 +2431,33 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  :
+  break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-continue
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 rm -f conftest*
 if test -n "$ac_declaration"; then
@@ -2378,7 +2471,7 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2467,7 +2560,7 @@
 
 echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2505,6 +2598,7 @@
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
 echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
@@ -2521,6 +2615,7 @@
 case $as_dir/ in
   ./ | .// | /cC/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -2528,20 +2623,20 @@
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-          if test $ac_prog = install &&
-            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # AIX install.  It has an incompatible calling convention.
-            :
-          elif test $ac_prog = install &&
-            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # program-specific install script used by HP pwplus--don't use.
-            :
-          else
-            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-            break 3
-          fi
-        fi
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
       done
     done
     ;;
@@ -2600,7 +2695,6 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2611,7 +2705,7 @@
 #else
 # include <assert.h>
 #endif
-                     Syntax error
+		     Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -2623,6 +2717,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -2643,7 +2738,6 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2661,6 +2755,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -2707,7 +2802,6 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2718,7 +2812,7 @@
 #else
 # include <assert.h>
 #endif
-                     Syntax error
+		     Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -2730,6 +2824,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -2750,7 +2845,6 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2768,6 +2862,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -2826,7 +2921,6 @@
 echo "$as_me:$LINENO: checking for AIX" >&5
 echo $ECHO_N "checking for AIX... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2852,16 +2946,14 @@
 rm -f conftest*
 
 
-
-        echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
-echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
-if test "${ac_cv_lib_cposix_strerror+set}" = set; then
+echo "$as_me:$LINENO: checking for library containing strerror" >&5
+echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
+if test "${ac_cv_search_strerror+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcposix  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_strerror=no
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2885,33 +2977,100 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_cposix_strerror=yes
+  ac_cv_search_strerror="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_cposix_strerror=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
-echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
-if test $ac_cv_lib_cposix_strerror = yes; then
-  LIBS="$LIBS -lcposix"
-fi
-
-
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_strerror" = no; then
+  for ac_lib in cposix; do
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char strerror ();
+int
+main ()
+{
+strerror ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_strerror="-l$ac_lib"
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
+echo "${ECHO_T}$ac_cv_search_strerror" >&6
+if test "$ac_cv_search_strerror" != no; then
+  test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
+
+fi
 
 for ac_prog in gawk mawk nawk awk
 do
@@ -2959,7 +3118,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3022,11 +3180,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3039,7 +3207,7 @@
 
 ac_cv_c_const=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
 echo "${ECHO_T}$ac_cv_c_const" >&6
@@ -3113,7 +3281,6 @@
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3128,11 +3295,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3144,23 +3321,27 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
 echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
 echo "${ECHO_T}$ac_cv_c_inline" >&6
+
+
 case $ac_cv_c_inline in
   inline | yes) ;;
-  no)
-cat >>confdefs.h <<\_ACEOF
-#define inline
-_ACEOF
- ;;
-  *)  cat >>confdefs.h <<_ACEOF
-#define inline $ac_cv_c_inline
-_ACEOF
- ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
 esac
 
 
@@ -3172,7 +3353,6 @@
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3199,11 +3379,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3216,7 +3406,7 @@
 
 ac_cv___attribute__=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
 if test "$ac_cv___attribute__" = "yes"; then
@@ -3239,7 +3429,6 @@
 save_CFLAGS=$CFLAGS
 CFLAGS="${CFLAGS} -fPIC"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3264,11 +3453,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3281,7 +3480,7 @@
 
 ac_cv_fpic=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 CFLAGS=$save_CFLAGS
 
 fi
@@ -3294,97 +3493,6 @@
 echo "$as_me:$LINENO: result: $ac_cv_fpic" >&5
 echo "${ECHO_T}$ac_cv_fpic" >&6
 
-
-
-   # CMU GUESS RUNPATH SWITCH
-  echo "$as_me:$LINENO: checking for runpath switch" >&5
-echo $ECHO_N "checking for runpath switch... $ECHO_C" >&6
-if test "${andrew_runpath_switch+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-    # first, try -R
-    SAVE_LDFLAGS="${LDFLAGS}"
-    LDFLAGS="-R /usr/lib"
-    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  andrew_runpath_switch="-R"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-  	LDFLAGS="-Wl,-rpath,/usr/lib"
-    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  andrew_runpath_switch="-Wl,-rpath,"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-andrew_runpath_switch="none"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS="${SAVE_LDFLAGS}"
-
-fi
-echo "$as_me:$LINENO: result: $andrew_runpath_switch" >&5
-echo "${ECHO_T}$andrew_runpath_switch" >&6
 
 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
@@ -3392,7 +3500,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3413,11 +3520,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3430,12 +3547,11 @@
 
 ac_cv_header_stdc=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3457,7 +3573,6 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3482,7 +3597,6 @@
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3494,9 +3608,9 @@
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #else
 # define ISLOWER(c) \
-                   (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 #endif
 
@@ -3507,7 +3621,7 @@
   int i;
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
+	|| toupper (i) != TOUPPER (i))
       exit(2);
   exit (0);
 }
@@ -3532,7 +3646,7 @@
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
@@ -3557,7 +3671,7 @@
 
 
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                  inttypes.h stdint.h unistd.h
+		  inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -3566,7 +3680,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3578,11 +3691,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3595,7 +3718,7 @@
 
 eval "$as_ac_Header=no"
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -3608,6 +3731,532 @@
 
 done
 
+
+echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6
+if test "${ac_cv_type_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((long *) 0)
+  return 0;
+if (sizeof (long))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_long=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6
+
+echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_long" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+		    if test $ac_lo -le $ac_mid; then
+		      ac_lo= ac_hi=
+		      break
+		    fi
+		    ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+		       if test $ac_mid -le $ac_hi; then
+			 ac_lo= ac_hi=
+			 break
+		       fi
+		       ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+long longval () { return (long) (sizeof (long)); }
+unsigned long ulongval () { return (long) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (long))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (long))))
+	exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (long))))
+	exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_long=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+
+
+   # CMU GUESS RUNPATH SWITCH
+  echo "$as_me:$LINENO: checking for runpath switch" >&5
+echo $ECHO_N "checking for runpath switch... $ECHO_C" >&6
+if test "${andrew_runpath_switch+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+    # first, try -R
+    SAVE_LDFLAGS="${LDFLAGS}"
+    LDFLAGS="-R /usr/lib"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  andrew_runpath_switch="-R"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+  	LDFLAGS="-Wl,-rpath,/usr/lib"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  andrew_runpath_switch="-Wl,-rpath,"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+andrew_runpath_switch="none"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  LDFLAGS="${SAVE_LDFLAGS}"
+
+fi
+echo "$as_me:$LINENO: result: $andrew_runpath_switch" >&5
+echo "${ECHO_T}$andrew_runpath_switch" >&6
 
 
 
@@ -3629,7 +4278,6 @@
 echo "$as_me:$LINENO: checking $ac_header usability" >&5
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3640,11 +4288,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3657,7 +4315,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -3665,7 +4323,6 @@
 echo "$as_me:$LINENO: checking $ac_header presence" >&5
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3683,6 +4340,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -3702,33 +4360,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -3739,7 +4396,7 @@
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -3767,21 +4424,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -3812,11 +4476,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3829,7 +4503,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -3839,7 +4514,14 @@
 _ACEOF
 
 else
-  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
+  case $LIBOBJS in
+    "$ac_func.$ac_objext"   | \
+  *" $ac_func.$ac_objext"   | \
+    "$ac_func.$ac_objext "* | \
+  *" $ac_func.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
+esac
+
 fi
 done
 
@@ -3855,21 +4537,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -3900,11 +4589,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3917,7 +4616,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -3943,7 +4643,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3963,11 +4662,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3980,7 +4689,7 @@
 
 eval "$as_ac_Header=no"
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -4003,7 +4712,6 @@
   ac_func_search_save_LIBS=$LIBS
 ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4027,11 +4735,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4043,12 +4761,12 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_search_opendir" = no; then
   for ac_lib in dir; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4072,11 +4790,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4089,7 +4817,8 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
   done
 fi
 LIBS=$ac_func_search_save_LIBS
@@ -4110,7 +4839,6 @@
   ac_func_search_save_LIBS=$LIBS
 ac_cv_search_opendir=no
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4134,11 +4862,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4150,12 +4888,12 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_search_opendir" = no; then
   for ac_lib in x; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4179,11 +4917,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4196,7 +4944,8 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
   done
 fi
 LIBS=$ac_func_search_save_LIBS
@@ -4220,21 +4969,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef connect
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -4265,11 +5021,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4282,7 +5048,8 @@
 
 ac_cv_func_connect=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
 echo "${ECHO_T}$ac_cv_func_connect" >&6
@@ -4297,7 +5064,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4321,11 +5087,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4338,7 +5114,8 @@
 
 ac_cv_lib_nsl_gethostbyname=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
@@ -4355,7 +5132,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4379,11 +5155,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4396,7 +5182,8 @@
 
 ac_cv_lib_socket_connect=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
@@ -4415,21 +5202,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define res_search to an innocuous variant, in case <limits.h> declares res_search.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define res_search innocuous_res_search
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char res_search (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef res_search
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -4460,11 +5254,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4477,71 +5281,72 @@
 
 ac_cv_func_res_search=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_res_search" >&5
 echo "${ECHO_T}$ac_cv_func_res_search" >&6
 if test $ac_cv_func_res_search = yes; then
   :
 else
-  echo "$as_me:$LINENO: checking for res_search in -lresolv" >&5
-echo $ECHO_N "checking for res_search in -lresolv... $ECHO_C" >&6
-if test "${ac_cv_lib_resolv_res_search+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lresolv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char res_search ();
+  LIBS="-lresolv $LIB_SOCKET $save_LIBS"
+		cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#ifdef HAVE_ARPA_NAMESER_COMPAT_H
+#include <arpa/nameser_compat.h>
+#endif
+#include <resolv.h>
 int
 main ()
 {
-res_search ();
+
+const char host[12]="openafs.org";
+u_char ans[1024];
+res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans));
+return 0;
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_resolv_res_search=yes
+  LIB_SOCKET="-lresolv $LIB_SOCKET"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_resolv_res_search=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_search" >&5
-echo "${ECHO_T}$ac_cv_lib_resolv_res_search" >&6
-if test $ac_cv_lib_resolv_res_search = yes; then
-  LIB_SOCKET="-lresolv $LIB_SOCKET"
-fi
-
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 
 fi
 
@@ -4557,21 +5362,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -4602,11 +5414,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4619,7 +5441,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -4644,21 +5467,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define getaddrinfo to an innocuous variant, in case <limits.h> declares getaddrinfo.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define getaddrinfo innocuous_getaddrinfo
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getaddrinfo (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef getaddrinfo
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -4689,11 +5519,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4706,7 +5546,8 @@
 
 ac_cv_func_getaddrinfo=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5
 echo "${ECHO_T}$ac_cv_func_getaddrinfo" >&6
@@ -4723,7 +5564,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4747,11 +5587,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4764,7 +5614,8 @@
 
 ac_cv_lib_socket_getaddrinfo=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_socket_getaddrinfo" >&5
@@ -4803,7 +5654,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-linet6  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4827,11 +5677,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4844,7 +5704,8 @@
 
 ac_cv_lib_inet6_getaddrinfo=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_inet6_getaddrinfo" >&5
@@ -4872,7 +5733,6 @@
   if test getaddrinfo = getaddrinfo; then
     for ipv6_cv_pfx in o n; do
       cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4890,21 +5750,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define ${ipv6_cv_pfx}getaddrinfo to an innocuous variant, in case <limits.h> declares ${ipv6_cv_pfx}getaddrinfo.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define ${ipv6_cv_pfx}getaddrinfo innocuous_${ipv6_cv_pfx}getaddrinfo
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char ${ipv6_cv_pfx}getaddrinfo (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef ${ipv6_cv_pfx}getaddrinfo
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -4935,11 +5802,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4952,7 +5829,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -4980,21 +5858,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gai_strerror to an innocuous variant, in case <limits.h> declares gai_strerror.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gai_strerror innocuous_gai_strerror
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gai_strerror (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef gai_strerror
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -5025,11 +5910,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5042,7 +5937,8 @@
 
 ac_cv_func_gai_strerror=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_gai_strerror" >&5
 echo "${ECHO_T}$ac_cv_func_gai_strerror" >&6
@@ -5059,7 +5955,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5083,11 +5978,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5100,7 +6005,8 @@
 
 ac_cv_lib_socket_gai_strerror=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_socket_gai_strerror" >&5
@@ -5139,7 +6045,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-linet6  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5163,11 +6068,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5180,7 +6095,8 @@
 
 ac_cv_lib_inet6_gai_strerror=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_inet6_gai_strerror" >&5
@@ -5208,7 +6124,6 @@
   if test gai_strerror = getaddrinfo; then
     for ipv6_cv_pfx in o n; do
       cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5226,21 +6141,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define ${ipv6_cv_pfx}gai_strerror to an innocuous variant, in case <limits.h> declares ${ipv6_cv_pfx}gai_strerror.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define ${ipv6_cv_pfx}gai_strerror innocuous_${ipv6_cv_pfx}gai_strerror
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char ${ipv6_cv_pfx}gai_strerror (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef ${ipv6_cv_pfx}gai_strerror
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -5271,11 +6193,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5288,7 +6220,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -5333,21 +6266,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define getnameinfo to an innocuous variant, in case <limits.h> declares getnameinfo.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define getnameinfo innocuous_getnameinfo
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getnameinfo (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef getnameinfo
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -5378,11 +6318,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5395,7 +6345,8 @@
 
 ac_cv_func_getnameinfo=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_getnameinfo" >&5
 echo "${ECHO_T}$ac_cv_func_getnameinfo" >&6
@@ -5412,7 +6363,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5436,11 +6386,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5453,7 +6413,8 @@
 
 ac_cv_lib_socket_getnameinfo=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_socket_getnameinfo" >&5
@@ -5492,7 +6453,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-linet6  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5516,11 +6476,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5533,7 +6503,8 @@
 
 ac_cv_lib_inet6_getnameinfo=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_inet6_getnameinfo" >&5
@@ -5561,7 +6532,6 @@
   if test getnameinfo = getaddrinfo; then
     for ipv6_cv_pfx in o n; do
       cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5579,21 +6549,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define ${ipv6_cv_pfx}getnameinfo to an innocuous variant, in case <limits.h> declares ${ipv6_cv_pfx}getnameinfo.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define ${ipv6_cv_pfx}getnameinfo innocuous_${ipv6_cv_pfx}getnameinfo
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char ${ipv6_cv_pfx}getnameinfo (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef ${ipv6_cv_pfx}getnameinfo
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -5624,11 +6601,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5641,7 +6628,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -5682,7 +6670,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5700,11 +6687,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5717,7 +6714,7 @@
 
 ipv6_cv_ss_family=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 if test $ipv6_cv_ss_family = yes; then
 
@@ -5737,7 +6734,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5755,11 +6751,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5772,7 +6778,7 @@
 
 ipv6_cv_sa_len=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 if test $ipv6_cv_sa_len = yes; then
 
@@ -5805,7 +6811,6 @@
 echo "$as_me:$LINENO: checking $ac_header usability" >&5
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5816,11 +6821,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5833,7 +6848,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -5841,7 +6856,6 @@
 echo "$as_me:$LINENO: checking $ac_header presence" >&5
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5859,6 +6873,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -5878,33 +6893,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -5915,7 +6929,7 @@
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -5936,7 +6950,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5957,11 +6970,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5974,7 +6997,7 @@
 
 ac_cv_header_time=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
 echo "${ECHO_T}$ac_cv_header_time" >&6
@@ -5992,7 +7015,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6011,11 +7033,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6028,7 +7060,7 @@
 
 ac_cv_struct_tm=sys/time.h
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
 echo "${ECHO_T}$ac_cv_struct_tm" >&6
@@ -6046,7 +7078,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6068,11 +7099,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6084,7 +7125,6 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6106,11 +7146,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6123,9 +7173,9 @@
 
 ac_cv_member_struct_tm_tm_zone=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6
@@ -6151,7 +7201,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6172,11 +7221,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6189,7 +7248,8 @@
 
 ac_cv_var_tzname=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
 echo "${ECHO_T}$ac_cv_var_tzname" >&6
@@ -6218,21 +7278,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -6263,11 +7330,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6280,7 +7357,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -6295,21 +7373,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define _doprnt innocuous__doprnt
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef _doprnt
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -6340,11 +7425,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6357,7 +7452,8 @@
 
 ac_cv_func__doprnt=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
 echo "${ECHO_T}$ac_cv_func__doprnt" >&6
@@ -6373,21 +7469,6 @@
 done
 
 
-
-
-# Check whether --with-auth or --without-auth was given.
-if test "${with_auth+set}" = set; then
-  withval="$with_auth"
-  WITH_AUTH="$withval"
-else
-  WITH_AUTH="unix"
-fi;
-
-
-echo "$as_me:$LINENO: checking authorization method" >&5
-echo $ECHO_N "checking authorization method... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $WITH_AUTH" >&5
-echo "${ECHO_T}$WITH_AUTH" >&6
 
 
 CYRUSDB_OBJS="cyrusdb_flat.o cyrusdb_skiplist.o cyrusdb_quotalegacy.o"
@@ -6470,7 +7551,6 @@
 echo "$as_me:$LINENO: checking db.h usability" >&5
 echo $ECHO_N "checking db.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6481,11 +7561,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6498,7 +7588,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -6506,7 +7596,6 @@
 echo "$as_me:$LINENO: checking db.h presence" >&5
 echo $ECHO_N "checking db.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6524,6 +7613,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -6543,33 +7633,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: db.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: db.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: db.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: db.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: db.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: db.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: db.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: db.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: db.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: db.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: db.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: db.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: db.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: db.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: db.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: db.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: db.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: db.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -6616,7 +7705,6 @@
           do
 	    LIBS="$saved_LIBS -l$dbname"
 	    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6633,11 +7721,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6650,13 +7748,13 @@
 
 dblib="no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 	    if test "$dblib" = "berkeley"; then break; fi
           done
         if test "$dblib" = "no"; then
 	    LIBS="$saved_LIBS -ldb"
 	    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6673,11 +7771,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6690,7 +7798,8 @@
 
 dblib="no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
         fi
 	LIBS=$saved_LIBS
 
@@ -6858,7 +7967,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lfl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6882,11 +7990,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6899,7 +8017,8 @@
 
 ac_cv_lib_fl_yywrap=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
@@ -6915,7 +8034,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ll  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6939,11 +8057,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -6956,7 +8084,8 @@
 
 ac_cv_lib_l_yywrap=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
@@ -7018,11 +8147,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7034,7 +8173,8 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_save_LIBS
 rm -f "${LEX_OUTPUT_ROOT}.c"
 
@@ -7059,7 +8199,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lfl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7077,11 +8216,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7094,7 +8243,8 @@
 
 ac_cv_lib_fl_main=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_fl_main" >&5
@@ -7117,7 +8267,6 @@
   ac_func_search_save_LIBS=$LIBS
 ac_cv_search_regcomp=no
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7141,11 +8290,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7157,12 +8316,12 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 if test "$ac_cv_search_regcomp" = no; then
   for ac_lib in rx regex; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7186,11 +8345,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7203,7 +8372,8 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
   done
 fi
 LIBS=$ac_func_search_save_LIBS
@@ -7231,7 +8401,6 @@
 echo "$as_me:$LINENO: checking rxposix.h usability" >&5
 echo $ECHO_N "checking rxposix.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7242,11 +8411,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7259,7 +8438,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -7267,7 +8446,6 @@
 echo "$as_me:$LINENO: checking rxposix.h presence" >&5
 echo $ECHO_N "checking rxposix.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7285,6 +8463,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -7304,33 +8483,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: rxposix.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: rxposix.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rxposix.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: rxposix.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: rxposix.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: rxposix.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rxposix.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: rxposix.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rxposix.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: rxposix.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rxposix.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: rxposix.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: rxposix.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: rxposix.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rxposix.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: rxposix.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: rxposix.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: rxposix.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: rxposix.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: rxposix.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: rxposix.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: rxposix.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -7372,21 +8550,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define strerror to an innocuous variant, in case <limits.h> declares strerror.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define strerror innocuous_strerror
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strerror (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef strerror
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -7417,11 +8602,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7434,7 +8629,8 @@
 
 ac_cv_func_strerror=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_strerror" >&5
 echo "${ECHO_T}$ac_cv_func_strerror" >&6
@@ -7470,7 +8666,6 @@
 echo "$as_me:$LINENO: checking $ac_header usability" >&5
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7481,11 +8676,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7498,7 +8703,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -7506,7 +8711,6 @@
 echo "$as_me:$LINENO: checking $ac_header presence" >&5
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7524,6 +8728,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -7543,33 +8748,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -7580,7 +8784,7 @@
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -7605,21 +8809,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -7650,11 +8861,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7667,7 +8888,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -7689,21 +8911,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -7734,11 +8963,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7751,7 +8990,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -7775,21 +9015,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -7820,11 +9067,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7837,7 +9094,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -7860,21 +9118,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -7905,11 +9170,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7922,7 +9197,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -7936,7 +9212,6 @@
 
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7956,7 +9231,6 @@
 rm -f conftest*
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7976,7 +9250,6 @@
 rm -f conftest*
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8003,21 +9276,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define setproctitle to an innocuous variant, in case <limits.h> declares setproctitle.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define setproctitle innocuous_setproctitle
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef setproctitle
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -8048,11 +9328,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8065,7 +9355,8 @@
 
 ac_cv_func_setproctitle=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_setproctitle" >&5
 echo "${ECHO_T}$ac_cv_func_setproctitle" >&6
@@ -8082,7 +9373,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lutil  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8106,11 +9396,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8123,7 +9423,8 @@
 
 ac_cv_lib_util_setproctitle=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_util_setproctitle" >&5
@@ -8148,7 +9449,6 @@
 echo "$as_me:$LINENO: checking sys/pstat.h usability" >&5
 echo $ECHO_N "checking sys/pstat.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8159,11 +9459,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8176,7 +9486,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -8184,7 +9494,6 @@
 echo "$as_me:$LINENO: checking sys/pstat.h presence" >&5
 echo $ECHO_N "checking sys/pstat.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8202,6 +9511,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -8221,33 +9531,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sys/pstat.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sys/pstat.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/pstat.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/pstat.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sys/pstat.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/pstat.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/pstat.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/pstat.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/pstat.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/pstat.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/pstat.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/pstat.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sys/pstat.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sys/pstat.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/pstat.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/pstat.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: sys/pstat.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/pstat.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/pstat.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/pstat.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/pstat.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/pstat.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -8284,7 +9593,6 @@
 echo "$as_me:$LINENO: checking sys/sysnews.h usability" >&5
 echo $ECHO_N "checking sys/sysnews.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8295,11 +9603,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8312,7 +9630,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -8320,7 +9638,6 @@
 echo "$as_me:$LINENO: checking sys/sysnews.h presence" >&5
 echo $ECHO_N "checking sys/sysnews.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8338,6 +9655,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -8357,33 +9675,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sys/sysnews.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/sysnews.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/sysnews.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/sysnews.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/sysnews.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/sysnews.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sys/sysnews.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/sysnews.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/sysnews.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/sysnews.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/sysnews.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/sysnews.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -8413,7 +9730,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8436,6 +9752,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -8466,7 +9783,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8487,6 +9803,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -8517,7 +9834,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8538,6 +9854,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -8575,7 +9892,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8597,11 +9913,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8614,7 +9940,8 @@
 
 cyrus_cv_sys_nonblock=ioctl
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 
 WITH_NONBLOCK=$cyrus_cv_sys_nonblock
@@ -8628,7 +9955,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8648,11 +9974,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8665,7 +10001,7 @@
 
 cyrus_cv_struct_sys_gmtoff=gmtime
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
 WITH_GMTOFF=$cyrus_cv_struct_sys_gmtoff
@@ -8681,7 +10017,6 @@
   cyrus_cv_func_mmap_shared=no
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8733,7 +10068,7 @@
 ( exit $ac_status )
 cyrus_cv_func_mmap_shared=no
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 
@@ -8751,7 +10086,6 @@
   cyrus_cv_func_mmap_stupidshared=no
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8804,7 +10138,7 @@
 ( exit $ac_status )
 cyrus_cv_func_mmap_stupidshared=no
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 
@@ -8835,21 +10169,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define fcntl to an innocuous variant, in case <limits.h> declares fcntl.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define fcntl innocuous_fcntl
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char fcntl (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef fcntl
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -8880,11 +10221,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8897,7 +10248,8 @@
 
 ac_cv_func_fcntl=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_fcntl" >&5
 echo "${ECHO_T}$ac_cv_func_fcntl" >&6
@@ -8911,21 +10263,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define flock to an innocuous variant, in case <limits.h> declares flock.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define flock innocuous_flock
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char flock (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef flock
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -8956,11 +10315,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8973,7 +10342,8 @@
 
 ac_cv_func_flock=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_flock" >&5
 echo "${ECHO_T}$ac_cv_func_flock" >&6
@@ -9002,21 +10372,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define fdatasync to an innocuous variant, in case <limits.h> declares fdatasync.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define fdatasync innocuous_fdatasync
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char fdatasync (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef fdatasync
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -9047,11 +10424,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9064,7 +10451,8 @@
 
 ac_cv_func_fdatasync=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_fdatasync" >&5
 echo "${ECHO_T}$ac_cv_func_fdatasync" >&6
@@ -9084,7 +10472,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lrt  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9108,11 +10495,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9125,7 +10522,8 @@
 
 ac_cv_lib_rt_fdatasync=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_rt_fdatasync" >&5
@@ -9156,21 +10554,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define sigvec to an innocuous variant, in case <limits.h> declares sigvec.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define sigvec innocuous_sigvec
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char sigvec (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef sigvec
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -9201,11 +10606,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9218,7 +10633,8 @@
 
 ac_cv_func_sigvec=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_sigvec" >&5
 echo "${ECHO_T}$ac_cv_func_sigvec" >&6
@@ -9236,7 +10652,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lBSD  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9260,11 +10675,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9277,7 +10702,8 @@
 
 ac_cv_lib_BSD_sigvec=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_BSD_sigvec" >&5
@@ -9296,7 +10722,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lucb  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9320,11 +10745,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9337,7 +10772,8 @@
 
 ac_cv_lib_ucb_sigvec=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_ucb_sigvec" >&5
@@ -9368,35 +10804,23 @@
 if test "${with_afs+set}" = set; then
   withval="$with_afs"
   with_afs="${withval}"
-	CFLAGS="${CFLAGS} -I${withval}/include"
-else
-  with_afs="/usr/local"
+else
+  with_afs="no"
 fi;
 
 
 # Check whether --with-ldap or --without-ldap was given.
 if test "${with_ldap+set}" = set; then
   withval="$with_ldap"
-  with_ldap=$withval
-else
-  with_ldap="/usr/local"
+  with_ldap="${withval}"
+else
+  with_ldap="no"
 fi;
-
-
-# Check whether --with-pts or --without-pts was given.
-if test "${with_pts+set}" = set; then
-  withval="$with_pts"
-  WITH_PTS="$withval"
-else
-  WITH_PTS="afskrb"
-fi;
-
 
 # Check whether --enable-krb5afspts or --disable-krb5afspts was given.
 if test "${enable_krb5afspts+set}" = set; then
   enableval="$enable_krb5afspts"
-
-    SASL_GSSAPI_LIBS_SET="yes"
+  SASL_GSSAPI_LIBS_SET="yes"
 
 
 cat >>confdefs.h <<\_ACEOF
@@ -9405,25 +10829,16 @@
 
 fi;
 
-if test "$WITH_AUTH" = "pts"; then
-	echo "$as_me:$LINENO: checking which pts module to use" >&5
-echo $ECHO_N "checking which pts module to use... $ECHO_C" >&6
-	echo "$as_me:$LINENO: result: $WITH_PTS" >&5
-echo "${ECHO_T}$WITH_PTS" >&6
-
-	EXTRA_SUBDIRS="${EXTRA_SUBDIRS} ptclient"
-	EXTRA_OUTPUT="${EXTRA_OUTPUT} ptclient/Makefile"
-
-	LDAP_CPPFLAGS=""
-	LDAP_LDFLAGS=""
-	LDAP_LIBS=""
-
-  	if test "$WITH_PTS" = "afskrb"; then
-	    AFS_LIBS="${with_afs}/lib/afs/libkauth.a ${with_afs}/lib/afs/libprot.a  ${with_afs}/lib/afs/libauth.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/librxkad.a ${with_afs}/lib/librx.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/libubik.a  ${with_afs}/lib/liblwp.a ${with_afs}/lib/afs/util.a"
-	    if test -f ${with_afs}/lib/afs/libaudit.a; then
-		AFS_LIBS="$AFS_LIBS ${with_afs}/lib/afs/libaudit.a"
-	    fi
-	    if test -f /usr/ucblib/libucb.a; then
+if test "x$with_afs" != "xno"; then
+    if test ! -d $with_afs; then
+        $with_afs=/usr/local
+    fi
+    CFLAGS="${CFLAGS} -I${with_afs}/include"
+    AFS_LIBS="${with_afs}/lib/afs/libkauth.a ${with_afs}/lib/afs/libprot.a  ${with_afs}/lib/afs/libauth.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/librxkad.a ${with_afs}/lib/librx.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/libubik.a  ${with_afs}/lib/liblwp.a ${with_afs}/lib/afs/util.a"
+    if test -f ${with_afs}/lib/afs/libaudit.a; then
+    AFS_LIBS="$AFS_LIBS ${with_afs}/lib/afs/libaudit.a"
+    fi
+    if test -f /usr/ucblib/libucb.a; then
 
   # this is CMU ADD LIBPATH TO
   if test "$andrew_runpath_switch" = "none" ; then
@@ -9432,19 +10847,18 @@
 	AFS_LDFLAGS="-L/usr/ucblib ${AFS_LDFLAGS} $andrew_runpath_switch/usr/ucblib"
   fi
 
-		AFS_LIBS="$AFS_LIBS -lc -lucb"
-	    fi
-
-	    if test "${cyrus_afs_sigvec+set}" = set; then
+    AFS_LIBS="$AFS_LIBS -lc -lucb"
+    fi
+
+    if test "${cyrus_afs_sigvec+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-		SAVE_LIBS="$LIBS"
-		LIBS="${with_afs}/lib/liblwp.a"
-		echo "$as_me:$LINENO: checking if AFS libraries need sigvec" >&5
+        SAVE_LIBS="$LIBS"
+        LIBS="${with_afs}/lib/liblwp.a"
+        echo "$as_me:$LINENO: checking if AFS libraries need sigvec" >&5
 echo $ECHO_N "checking if AFS libraries need sigvec... $ECHO_C" >&6
-						cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+                        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9461,68 +10875,92 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-								echo "$as_me:$LINENO: result: no" >&5
+                                                echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-				cyrus_afs_sigvec="no"
+                        cyrus_afs_sigvec="no"
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-								echo "$as_me:$LINENO: result: yes" >&5
+                                                echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-				cyrus_afs_sigvec="yes"
-
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-fi
-
-	    if test "$cyrus_afs_sigvec" = yes; then
-	      if test "$cant_find_sigvec" = yes; then
-                { echo "$as_me:$LINENO: WARNING: Can't find a sigvec for AFS libraries which seem" >&5
-echo "$as_me: WARNING: Can't find a sigvec for AFS libraries which seem" >&2;}
-	        { echo "$as_me:$LINENO: WARNING: to need one; ptloader may not build." >&5
-echo "$as_me: WARNING: to need one; ptloader may not build." >&2;}
-              else
-	        AFS_LIBS="${AFS_LIBS} $cyrus_sigveclib"
-	      fi
-	    fi
-	    LIBS="$SAVE_LIBS"
-
-
-	elif test "$WITH_PTS" = "ldap"; then
-	    { echo "$as_me:$LINENO: WARNING: *** WARNING: COMPILING WITH EXPERIMENTAL LDAP PTLOADER MODULE ***" >&5
-echo "$as_me: WARNING: *** WARNING: COMPILING WITH EXPERIMENTAL LDAP PTLOADER MODULE ***" >&2;}
-	    if test -d $with_ldap; then
-	        LDAP_CPPFLAGS="$CPPFLAGS -I${with_ldap}/include"
-	        LDAP_LDFLAGS="$LDFLAGS -L${with_ldap}/lib"
-	    else
-	 	{ { echo "$as_me:$LINENO: error: LDAP path isn't a directory" >&5
-echo "$as_me: error: LDAP path isn't a directory" >&2;}
-   { (exit 1); exit 1; }; }
-	    fi
-
-	    LDAP_LIBS=""
-
-           save_CPPFLAGS=$CPPFLAGS
-           save_LDFLAGS=$LDFLAGS
-           CPPFLAGS=$LDAP_CPPFLAGS
-           LDFLAGS=$LDAP_LDFLAGS
-
-	    echo "$as_me:$LINENO: checking for ldap_initialize in -lldap" >&5
+                        cyrus_afs_sigvec="yes"
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+    if test "$cyrus_afs_sigvec" = yes; then
+      if test "$cant_find_sigvec" = yes; then
+        { echo "$as_me:$LINENO: WARNING: Can't find a sigvec for AFS libraries which seem to need one." >&5
+echo "$as_me: WARNING: Can't find a sigvec for AFS libraries which seem to need one." >&2;}
+      else
+        AFS_LIBS="${AFS_LIBS} $cyrus_sigveclib"
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AFSKRB
+_ACEOF
+
+      fi
+    else
+      AFS_LIBS="${AFS_LIBS}"
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AFSKRB
+_ACEOF
+
+    fi
+    LIBS="$SAVE_LIBS"
+fi
+
+LDAP_CPPFLAGS=""
+LDAP_LDFLAGS=""
+LDAP_LIBS=""
+
+if test "x$with_ldap" != "xno"; then
+    if test ! -d $with_ldap; then
+        $with_ldap=/usr/local
+    fi
+
+    LDAP_CPPFLAGS="$CPPFLAGS -I${with_ldap}/include"
+    LDAP_LDFLAGS="$LDFLAGS -L${with_ldap}/lib"
+    LDAP_LIBS=""
+
+    save_CPPFLAGS=$CPPFLAGS
+    save_LDFLAGS=$LDFLAGS
+    CPPFLAGS=$LDAP_CPPFLAGS
+    LDFLAGS=$LDAP_LDFLAGS
+
+    echo "$as_me:$LINENO: checking for ldap_initialize in -lldap" >&5
 echo $ECHO_N "checking for ldap_initialize in -lldap... $ECHO_C" >&6
 if test "${ac_cv_lib_ldap_ldap_initialize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9530,7 +10968,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lldap -llber $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9554,11 +10991,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9571,37 +11018,38 @@
 
 ac_cv_lib_ldap_ldap_initialize=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_initialize" >&5
 echo "${ECHO_T}$ac_cv_lib_ldap_ldap_initialize" >&6
 if test $ac_cv_lib_ldap_ldap_initialize = yes; then
 
-                         LDAP_LIBS="-lldap -llber"
-fi
-
-
-           CPPFLAGS=$save_CPPFLAGS
-           LDFLAGS=$save_LDFLAGS
-	else
-	    { { echo "$as_me:$LINENO: error: unknown with-pts value" >&5
-echo "$as_me: error: unknown with-pts value" >&2;}
-   { (exit 1); exit 1; }; }
-	fi
-
-
-
-
-
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LDAP
+_ACEOF
+
+
+
+
+          LDAP_LIBS="-lldap -llber"
+fi
+
+
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+fi
+
+if test "x$with_afs" != "xno" -o "x$with_ldap" != "xno"; then
+	EXTRA_SUBDIRS="${EXTRA_SUBDIRS} ptclient"
+	EXTRA_OUTPUT="${EXTRA_OUTPUT} ptclient/Makefile"
 
 cat >>confdefs.h <<\_ACEOF
 #define WITH_PTS
 _ACEOF
 
 fi
-
-
 
 SERVER_SUBDIRS="master imap"
 # Check whether --enable-server or --disable-server was given.
@@ -9640,7 +11088,6 @@
   with_statickrb="no"
 fi;
 
-if test "$WITH_AUTH" = "krb" -o "$WITH_AUTH" = "krb_pts" -o "$with_krb" != "no"; then
 
 
 echo "$as_me:$LINENO: checking for res_search in -lresolv" >&5
@@ -9651,7 +11098,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9675,11 +11121,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9692,7 +11148,8 @@
 
 ac_cv_lib_resolv_res_search=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_search" >&5
@@ -9707,12 +11164,13 @@
 fi
 
 
-  if test "$with_statickrb" = "yes" -a ! -d "$with_krb"; then
-	{ { echo "$as_me:$LINENO: error: --enable-statickrb specified but --with-krb did not specify a valid directory" >&5
+if test "$with_statickrb" = "yes" -a ! -d "$with_krb"; then
+      { { echo "$as_me:$LINENO: error: --enable-statickrb specified but --with-krb did not specify a valid directory" >&5
 echo "$as_me: error: --enable-statickrb specified but --with-krb did not specify a valid directory" >&2;}
    { (exit 1); exit 1; }; }
-  fi
-
+fi
+
+if test "$with_krb" != "no"; then
 
 # Check whether --with-krbdes or --without-krbdes was given.
 if test "${with_krbdes+set}" = set; then
@@ -9721,8 +11179,8 @@
 else
   with_krbdes="yes"
 fi;
-  if test "$with_krbdes" = "yes"; then
-    echo "$as_me:$LINENO: checking for des_ecb_encrypt in -ldes" >&5
+if test "$with_krbdes" = "yes"; then
+  echo "$as_me:$LINENO: checking for des_ecb_encrypt in -ldes" >&5
 echo $ECHO_N "checking for des_ecb_encrypt in -ldes... $ECHO_C" >&6
 if test "${ac_cv_lib_des_des_ecb_encrypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9730,7 +11188,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldes  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9754,11 +11211,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9771,47 +11238,49 @@
 
 ac_cv_lib_des_des_ecb_encrypt=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_ecb_encrypt" >&5
 echo "${ECHO_T}$ac_cv_lib_des_des_ecb_encrypt" >&6
 if test $ac_cv_lib_des_des_ecb_encrypt = yes; then
   if test "$with_statickrb" = "yes"; then
-	    KRB_LIBS="$with_krb/lib/libdes.a"
-	else
-	    KRB_LIBS="-ldes"
-	fi
+          KRB_LIBS="$with_krb/lib/libdes.a"
+      else
+          KRB_LIBS="-ldes"
+      fi
 else
   { { echo "$as_me:$LINENO: error: The Kerberos DES library is required for Kerberos support.  You might want --with-auth=unix." >&5
 echo "$as_me: error: The Kerberos DES library is required for Kerberos support.  You might want --with-auth=unix." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-  fi
-
-      if test -d ${with_krb}; then
-     echo "$as_me:$LINENO: checking for Kerberos includes" >&5
+fi
+fi
+
+if test -d ${with_krb}; then
+   echo "$as_me:$LINENO: checking for Kerberos includes" >&5
 echo $ECHO_N "checking for Kerberos includes... $ECHO_C" >&6
 if test "${cyrus_krbinclude+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-       for krbhloc in include/kerberosIV include
-       do
-         if test -f ${with_krb}/${krbhloc}/krb.h ; then
-           cyrus_krbinclude=${with_krb}/${krbhloc}
-           break
-         fi
-       done
+     for krbhloc in include/kerberosIV include
+     do
+       if test -f ${with_krb}/${krbhloc}/krb.h ; then
+         cyrus_krbinclude=${with_krb}/${krbhloc}
+         break
+       fi
+     done
 
 fi
 echo "$as_me:$LINENO: result: $cyrus_krbinclude" >&5
 echo "${ECHO_T}$cyrus_krbinclude" >&6
 
-     if test -n "${cyrus_krbinclude}"; then
-       CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}"
-     fi
+   if test -n "${cyrus_krbinclude}"; then
+     CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}"
+   fi
 
   # this is CMU ADD LIBPATH
   if test "$andrew_runpath_switch" = "none" ; then
@@ -9820,16 +11289,16 @@
 	LDFLAGS="-L${with_krb}/lib $andrew_runpath_switch${with_krb}/lib ${LDFLAGS}"
   fi
 
-  fi
-
-  if test "$with_krbimpl" != "kth"; then
-    KRBLIB="krb4"
-  else
-    KRBLIB="krb"
-  fi
-
-  if test "$with_des" != no; then
-    if test "${ac_cv_header_krb_h+set}" = set; then
+fi
+
+if test "$with_krbimpl" != "kth"; then
+  KRBLIB="krb4"
+else
+  KRBLIB="krb"
+fi
+
+if test "$with_des" != no; then
+  if test "${ac_cv_header_krb_h+set}" = set; then
   echo "$as_me:$LINENO: checking for krb.h" >&5
 echo $ECHO_N "checking for krb.h... $ECHO_C" >&6
 if test "${ac_cv_header_krb_h+set}" = set; then
@@ -9842,7 +11311,6 @@
 echo "$as_me:$LINENO: checking krb.h usability" >&5
 echo $ECHO_N "checking krb.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9853,11 +11321,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -9870,7 +11348,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -9878,7 +11356,6 @@
 echo "$as_me:$LINENO: checking krb.h presence" >&5
 echo $ECHO_N "checking krb.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9896,6 +11373,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -9915,33 +11393,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: krb.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: krb.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: krb.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: krb.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: krb.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: krb.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: krb.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: krb.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: krb.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: krb.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: krb.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: krb.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: krb.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: krb.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: krb.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: krb.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: krb.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -9968,7 +11445,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l${KRBLIB} $KRB_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9992,11 +11468,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10009,17 +11495,18 @@
 
 eval "$as_ac_Lib=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
   if test "$with_statickrb" = "yes"; then
-	    KRB_LIBS="$KRB_LIBS $with_krb/lib/lib${KRBLIB}.a"
-	else
-	    KRB_LIBS="$KRB_LIBS -l${KRBLIB}"
-	fi
+          KRB_LIBS="$KRB_LIBS $with_krb/lib/lib${KRBLIB}.a"
+      else
+          KRB_LIBS="$KRB_LIBS -l${KRBLIB}"
+      fi
 else
   { echo "$as_me:$LINENO: WARNING: No Kerberos V4 found" >&5
 echo "$as_me: WARNING: No Kerberos V4 found" >&2;}; krb4=no
@@ -10031,32 +11518,24 @@
 fi
 
 
-  else
-    { echo "$as_me:$LINENO: WARNING: No DES library found for Kerberos V4 support" >&5
+else
+  { echo "$as_me:$LINENO: WARNING: No DES library found for Kerberos V4 support" >&5
 echo "$as_me: WARNING: No DES library found for Kerberos V4 support" >&2;}
-    krb4=no
-  fi
-
-  if test "${krb4}" != no; then
+  krb4=no
+fi
+
+if test "${krb4}" != no; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_KRB
 _ACEOF
 
-  else
-    { { echo "$as_me:$LINENO: error: Kerberos not found for authorization module" >&5
-echo "$as_me: error: Kerberos not found for authorization module" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
 fi
 
 LIBS="$KRB_LIBS $LIBS"
 
-if test "$WITH_AUTH" = "krb5"; then
-
-    SASL_GSSAPI_LIBS_SET="yes"
-
-fi
+SASL_GSSAPI_LIBS_SET="yes"
+
 
 IMAP_PROGS=""
 
@@ -10080,7 +11559,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lrsaref  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10104,11 +11582,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10121,7 +11609,8 @@
 
 ac_cv_lib_rsaref_RSAPublicEncrypt=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_rsaref_RSAPublicEncrypt" >&5
@@ -10142,7 +11631,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcrypto $LIB_RSAREF $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10166,11 +11654,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10183,7 +11681,8 @@
 
 ac_cv_lib_crypto_BIO_accept=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_BIO_accept" >&5
@@ -10202,7 +11701,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lssl -lcrypto $LIB_RSAREF $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10226,11 +11724,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10243,7 +11751,8 @@
 
 ac_cv_lib_ssl_SSL_CTX_new=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5
@@ -10291,6 +11800,18 @@
 _ACEOF
 
 	IMAP_PROGS="$IMAP_PROGS tls_prune"
+        if test "${krb4}" != no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define OPENSSL_ENABLE_OLD_DES_SUPPORT
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define OPENSSL_DES_LIBDES_COMPATIBILITY
+_ACEOF
+
+        fi
 fi
 
 
@@ -10335,7 +11856,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lzephyr  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10359,11 +11879,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10376,7 +11906,8 @@
 
 ac_cv_lib_zephyr_ZInitialize=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_zephyr_ZInitialize" >&5
@@ -10468,7 +11999,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcom_err  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10492,11 +12022,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10509,7 +12049,8 @@
 
 ac_cv_lib_com_err_com_err=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_com_err_com_err" >&5
@@ -10533,7 +12074,6 @@
 echo "$as_me:$LINENO: checking et/com_err.h usability" >&5
 echo $ECHO_N "checking et/com_err.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10544,11 +12084,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10561,7 +12111,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -10569,7 +12119,6 @@
 echo "$as_me:$LINENO: checking et/com_err.h presence" >&5
 echo $ECHO_N "checking et/com_err.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10587,6 +12136,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -10606,33 +12156,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: et/com_err.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: et/com_err.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: et/com_err.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: et/com_err.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: et/com_err.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: et/com_err.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: et/com_err.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: et/com_err.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: et/com_err.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: et/com_err.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: et/com_err.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: et/com_err.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: et/com_err.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: et/com_err.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: et/com_err.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: et/com_err.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: et/com_err.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: et/com_err.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: et/com_err.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: et/com_err.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: et/com_err.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: et/com_err.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -10669,7 +12218,6 @@
 echo "$as_me:$LINENO: checking com_err.h usability" >&5
 echo $ECHO_N "checking com_err.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10680,11 +12228,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -10697,7 +12255,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -10705,7 +12263,6 @@
 echo "$as_me:$LINENO: checking com_err.h presence" >&5
 echo $ECHO_N "checking com_err.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10723,6 +12280,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -10742,33 +12300,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: com_err.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: com_err.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: com_err.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: com_err.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: com_err.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: com_err.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: com_err.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: com_err.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: com_err.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: com_err.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: com_err.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: com_err.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: com_err.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: com_err.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: com_err.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: com_err.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: com_err.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: com_err.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: com_err.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: com_err.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: com_err.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: com_err.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -10984,7 +12541,6 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11005,6 +12561,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -11060,21 +12617,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -11105,11 +12669,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11122,7 +12696,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -11132,7 +12707,14 @@
 _ACEOF
 
 else
-  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
+  case $LIBOBJS in
+    "$ac_func.$ac_objext"   | \
+  *" $ac_func.$ac_objext"   | \
+    "$ac_func.$ac_objext "* | \
+  *" $ac_func.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
+esac
+
 fi
 done
 
@@ -11198,21 +12780,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef dlopen
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -11243,11 +12832,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11260,7 +12859,8 @@
 
 ac_cv_func_dlopen=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
 echo "${ECHO_T}$ac_cv_func_dlopen" >&6
@@ -11276,7 +12876,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11300,11 +12899,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11317,7 +12926,8 @@
 
 ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
@@ -11333,28 +12943,34 @@
 
 fi
 
-
- echo "$as_me:$LINENO: checking for crypt" >&5
+echo "$as_me:$LINENO: checking for crypt" >&5
 echo $ECHO_N "checking for crypt... $ECHO_C" >&6
 if test "${ac_cv_func_crypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define crypt to an innocuous variant, in case <limits.h> declares crypt.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define crypt innocuous_crypt
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef crypt
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -11385,11 +13001,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11402,14 +13028,14 @@
 
 ac_cv_func_crypt=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_crypt" >&5
 echo "${ECHO_T}$ac_cv_func_crypt" >&6
 if test $ac_cv_func_crypt = yes; then
   cmu_have_crypt=yes
 else
-
   echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5
 echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6
 if test "${ac_cv_lib_crypt_crypt+set}" = set; then
@@ -11418,7 +13044,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcrypt  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11442,11 +13067,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11459,7 +13094,8 @@
 
 ac_cv_lib_crypt_crypt=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5
@@ -11475,7 +13111,8 @@
 
 
 
- # Check whether --enable-gssapi or --disable-gssapi was given.
+
+# Check whether --enable-gssapi or --disable-gssapi was given.
 if test "${enable_gssapi+set}" = set; then
   enableval="$enable_gssapi"
   gssapi=$enableval
@@ -11491,56 +13128,57 @@
   gss_impl=auto
 fi;
 
-
-
- if test "$gssapi" != no; then
-    platform=
-    case "${host}" in
-      *-*-linux*)
-        platform=__linux
-        ;;
-      *-*-hpux*)
-        platform=__hpux
-        ;;
-      *-*-irix*)
-        platform=__irix
-        ;;
-      *-*-solaris2*)
+if test "$gssapi" != no; then
+  platform=
+  case "${host}" in
+    *-*-linux*)
+      platform=__linux
+      ;;
+    *-*-hpux*)
+      platform=__hpux
+      ;;
+    *-*-irix*)
+      platform=__irix
+      ;;
+    *-*-solaris2*)
 # When should we use __sunos?
-        platform=__solaris
-        ;;
-      *-*-aix*)
-        platform=__aix
-        ;;
-      *)
-        { echo "$as_me:$LINENO: WARNING: The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script" >&5
+      platform=__solaris
+      ;;
+    *-*-aix*)
+###_AIX
+      platform=__aix
+      ;;
+    *)
+      { echo "$as_me:$LINENO: WARNING: The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script" >&5
 echo "$as_me: WARNING: The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script" >&2;}
-	if test "$gss_impl" = "cybersafe"; then
-	   { { echo "$as_me:$LINENO: error: CyberSafe was forced, cannot continue as platform is not supported" >&5
+      if test "$gss_impl" = "cybersafe"; then
+        { { echo "$as_me:$LINENO: error: CyberSafe was forced, cannot continue as platform is not supported" >&5
 echo "$as_me: error: CyberSafe was forced, cannot continue as platform is not supported" >&2;}
    { (exit 1); exit 1; }; }
-	fi
-        ;;
-    esac
-
+      fi
+      ;;
+  esac
+
+  cmu_saved_CPPFLAGS=$CPPFLAGS
+
+  if test -d ${gssapi}; then
+    CPPFLAGS="$CPPFLAGS -I$gssapi/include"
+# We want to keep -I in our CPPFLAGS, but only if we succeed
     cmu_saved_CPPFLAGS=$CPPFLAGS
-
-    if test -d ${gssapi}; then
-       CPPFLAGS="$CPPFLAGS -I$gssapi/include"
-# We want to keep -I in our CPPFLAGS, but only if we succeed
-       cmu_saved_CPPFLAGS=$CPPFLAGS
-       LDFLAGS="$LDFLAGS -L$gssapi/lib"
-
-       if test -n "$platform"; then
-         if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
-           CPPFLAGS="$CPPFLAGS -D$platform"
-           if test -d "${gssapi}/appsec-sdk/include"; then
-             CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
-           fi
-         fi
-       fi
+### I am not sure how useful is this (and whether this is required at all
+### especially when we have to provide two -L flags for new CyberSafe
+    LDFLAGS="$LDFLAGS -L$gssapi/lib"
+
+    if test -n "$platform"; then
+      if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then
+        CPPFLAGS="$CPPFLAGS -D$platform"
+        if test -d "${gssapi}/appsec-sdk/include"; then
+          CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include"
+        fi
+      fi
     fi
-    if test "${ac_cv_header_gssapi_h+set}" = set; then
+  fi
+  if test "${ac_cv_header_gssapi_h+set}" = set; then
   echo "$as_me:$LINENO: checking for gssapi.h" >&5
 echo $ECHO_N "checking for gssapi.h... $ECHO_C" >&6
 if test "${ac_cv_header_gssapi_h+set}" = set; then
@@ -11553,7 +13191,6 @@
 echo "$as_me:$LINENO: checking gssapi.h usability" >&5
 echo $ECHO_N "checking gssapi.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11564,11 +13201,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11581,7 +13228,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -11589,7 +13236,6 @@
 echo "$as_me:$LINENO: checking gssapi.h presence" >&5
 echo $ECHO_N "checking gssapi.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11607,6 +13253,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -11626,33 +13273,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: gssapi.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: gssapi.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: gssapi.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: gssapi.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: gssapi.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: gssapi.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: gssapi.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: gssapi.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: gssapi.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: gssapi.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: gssapi.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: gssapi.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: gssapi.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: gssapi.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: gssapi.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: gssapi.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: gssapi.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -11676,8 +13322,7 @@
 _ACEOF
 
 else
-
-      if test "${ac_cv_header_gssapi_gssapi_h+set}" = set; then
+  if test "${ac_cv_header_gssapi_gssapi_h+set}" = set; then
   echo "$as_me:$LINENO: checking for gssapi/gssapi.h" >&5
 echo $ECHO_N "checking for gssapi/gssapi.h... $ECHO_C" >&6
 if test "${ac_cv_header_gssapi_gssapi_h+set}" = set; then
@@ -11690,7 +13335,6 @@
 echo "$as_me:$LINENO: checking gssapi/gssapi.h usability" >&5
 echo $ECHO_N "checking gssapi/gssapi.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11701,11 +13345,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11718,7 +13372,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -11726,7 +13380,6 @@
 echo "$as_me:$LINENO: checking gssapi/gssapi.h presence" >&5
 echo $ECHO_N "checking gssapi/gssapi.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11744,6 +13397,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -11763,33 +13417,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: gssapi/gssapi.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: gssapi/gssapi.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: gssapi/gssapi.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: gssapi/gssapi.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: gssapi/gssapi.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: gssapi/gssapi.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: gssapi/gssapi.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: gssapi/gssapi.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: gssapi/gssapi.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: gssapi/gssapi.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: gssapi/gssapi.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: gssapi/gssapi.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -11818,11 +13471,18 @@
 
 
 
-    CPPFLAGS=$cmu_saved_CPPFLAGS
-
- fi
-
- if test "$gssapi" != no; then
+  CPPFLAGS=$cmu_saved_CPPFLAGS
+
+fi
+
+if test "$gssapi" != no; then
+  # We need to find out which gssapi implementation we are
+  # using. Supported alternatives are: MIT Kerberos 5,
+  # Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal),
+  # CyberSafe Kerberos 5 (http://www.cybersafe.com/)
+  # and Sun SEAM (http://wwws.sun.com/software/security/kerberos/)
+  #
+  # The choice is reflected in GSSAPIBASE_LIBS
 
 
 echo "$as_me:$LINENO: checking for res_search in -lresolv" >&5
@@ -11833,7 +13493,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11857,11 +13516,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11874,7 +13543,8 @@
 
 ac_cv_lib_resolv_res_search=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_search" >&5
@@ -11893,7 +13563,9 @@
      GSSAPIBASE_LIBS="-L$gssapi_dir"
      GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir"
   else
-               gssapi_dir="/usr/local/lib"
+     # FIXME: This is only used for building cyrus, and then only as
+     # a real hack.  it needs to be fixed.
+     gssapi_dir="/usr/local/lib"
   fi
 
   # Check a full link against the Heimdal libraries.
@@ -11909,9 +13581,8 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgssapi $GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET} $LIBS"
+LIBS="-lgssapi ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET} $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -11935,11 +13606,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -11952,7 +13633,8 @@
 
 ac_cv_lib_gssapi_gss_unwrap=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_gssapi_gss_unwrap" >&5
@@ -11976,9 +13658,8 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgssapi_krb5 $GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${LIB_SOCKET} $LIBS"
+LIBS="-lgssapi_krb5 ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${LIB_SOCKET} $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12002,11 +13683,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12019,7 +13710,8 @@
 
 ac_cv_lib_gssapi_krb5_gss_unwrap=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_gssapi_krb5_gss_unwrap" >&5
@@ -12040,7 +13732,7 @@
 
     cmu_saved_CPPFLAGS=$CPPFLAGS
     cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS
-# FIX ME - Note that the libraries are in .../lib/64 for 64bit kernels
+# FIXME - Note that the libraries are in .../lib64 for 64bit kernels
     if test -d "${gssapi}/appsec-rt/lib"; then
       GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib"
     fi
@@ -12061,9 +13753,8 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgss $GSSAPIBASE_LIBS -lgss -lcstbk5 $LIBS"
+LIBS="-lgss ${GSSAPIBASE_LIBS} -lgss -lcstbk5 $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12087,11 +13778,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12104,7 +13805,8 @@
 
 ac_cv_lib_gss_csf_gss_acq_user=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_gss_csf_gss_acq_user" >&5
@@ -12112,8 +13814,8 @@
 if test $ac_cv_lib_gss_csf_gss_acq_user = yes; then
   gss_impl="cybersafe03"
 else
-
-      unset ac_cv_lib_gss_csf_gss_acq_user;echo "$as_me:$LINENO: checking for csf_gss_acq_user in -lgss" >&5
+  unset ac_cv_lib_gss_csf_gss_acq_user;
+                  echo "$as_me:$LINENO: checking for csf_gss_acq_user in -lgss" >&5
 echo $ECHO_N "checking for csf_gss_acq_user in -lgss... $ECHO_C" >&6
 if test "${ac_cv_lib_gss_csf_gss_acq_user+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12121,7 +13823,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgss $GSSAPIBASE_LIBS -lgss $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12145,11 +13846,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12162,7 +13873,8 @@
 
 ac_cv_lib_gss_csf_gss_acq_user=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_gss_csf_gss_acq_user" >&5
@@ -12197,7 +13909,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgss -lgss $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12221,11 +13932,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12238,7 +13959,8 @@
 
 ac_cv_lib_gss_gss_unwrap=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_gss_gss_unwrap" >&5
@@ -12289,25 +14011,24 @@
     { echo "$as_me:$LINENO: WARNING: Disabling GSSAPI - no library" >&5
 echo "$as_me: WARNING: Disabling GSSAPI - no library" >&2;}
   fi
- fi
+fi
 
 #
-# Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME in gssapi\rfckrb5.h
+# Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME
+# in gssapi\rfckrb5.h
 #
- if test "$gssapi" != "no"; then
+if test "$gssapi" != "no"; then
   if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
-   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <gssapi/gssapi.h>
-     #ifdef GSS_C_NT_HOSTBASED_SERVICE
-      hostbased_service_gss_nt_yes
-     #endif
-
+                  #ifdef GSS_C_NT_HOSTBASED_SERVICE
+                    hostbased_service_gss_nt_yes
+                  #endif
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "hostbased_service_gss_nt_yes" >/dev/null 2>&1; then
@@ -12324,8 +14045,7 @@
 
 
   elif test "$ac_cv_header_gssapi_h" = "yes"; then
-   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12345,9 +14065,7 @@
 rm -f conftest*
 
   elif test "$ac_cv_header_gssapi_gssapi_h"; then
-
-   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12369,18 +14087,16 @@
   fi
 
   if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then
-   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <gssapi/gssapi.h>
-     #ifdef GSS_C_NT_USER_NAME
-      user_name_yes_gss_nt
-     #endif
-
+                  #ifdef GSS_C_NT_USER_NAME
+                   user_name_yes_gss_nt
+                  #endif
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "user_name_yes_gss_nt" >/dev/null 2>&1; then
@@ -12396,8 +14112,7 @@
 rm -f conftest*
 
   elif test "$ac_cv_header_gssapi_h" = "yes"; then
-   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12417,8 +14132,7 @@
 rm -f conftest*
 
   elif test "$ac_cv_header_gssapi_gssapi_h"; then
-   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12438,12 +14152,12 @@
 rm -f conftest*
 
   fi
- fi
-
- GSSAPI_LIBS=""
- echo "$as_me:$LINENO: checking GSSAPI" >&5
+fi
+
+GSSAPI_LIBS=""
+echo "$as_me:$LINENO: checking GSSAPI" >&5
 echo $ECHO_N "checking GSSAPI... $ECHO_C" >&6
- if test "$gssapi" != no; then
+if test "$gssapi" != no; then
   echo "$as_me:$LINENO: result: with implementation ${gss_impl}" >&5
 echo "${ECHO_T}with implementation ${gss_impl}" >&6
   echo "$as_me:$LINENO: checking for res_search in -lresolv" >&5
@@ -12454,7 +14168,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12478,11 +14191,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12495,7 +14218,8 @@
 
 ac_cv_lib_resolv_res_search=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_search" >&5
@@ -12505,7 +14229,8 @@
 fi
 
   SASL_MECHS="$SASL_MECHS libgssapiv2.la"
-  SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/gssapi.o"
+  SASL_STATIC_OBJS="$SASL_STATIC_OBJS gssapi.o"
+  SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/gssapi.c"
 
   cmu_save_LIBS="$LIBS"
   LIBS="$LIBS $GSSAPIBASE_LIBS"
@@ -12519,21 +14244,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef $ac_func
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -12564,11 +14296,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12581,7 +14323,8 @@
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
@@ -12604,7 +14347,6 @@
 
 
 
-
 # Check whether --with-sasl or --without-sasl was given.
 if test "${with_sasl+set}" = set; then
   withval="$with_sasl"
@@ -12618,39 +14360,39 @@
 if test "${with_staticsasl+set}" = set; then
   withval="$with_staticsasl"
   with_staticsasl="$withval";
-	    if test $with_staticsasl != "no"; then
-		using_static_sasl="static"
-	    fi
+             if test $with_staticsasl != "no"; then
+               using_static_sasl="static"
+             fi
 else
   with_staticsasl="no"; using_static_sasl="no"
 fi;
 
-	SASLFLAGS=""
-	LIB_SASL=""
-
-	cmu_saved_CPPFLAGS=$CPPFLAGS
-	cmu_saved_LDFLAGS=$LDFLAGS
-	cmu_saved_LIBS=$LIBS
-
-	if test ${with_staticsasl} != "no"; then
-	  if test -d ${with_staticsasl}; then
-	    if test -d ${with_staticsasl}/lib64 ; then
-	      ac_cv_sasl_where_lib=${with_staticsasl}/lib64
-	    else
-	      ac_cv_sasl_where_lib=${with_staticsasl}/lib
-	    fi
-	    ac_cv_sasl_where_lib=${with_staticsasl}/lib
-	    ac_cv_sasl_where_inc=${with_staticsasl}/include
-
-	    SASLFLAGS="-I$ac_cv_sasl_where_inc"
-	    LIB_SASL="-L$ac_cv_sasl_where_lib"
-	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
-	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
-	  else
-	    with_staticsasl="/usr"
-	  fi
-
-	  if test "${ac_cv_header_sasl_sasl_h+set}" = set; then
+SASLFLAGS=""
+LIB_SASL=""
+
+cmu_saved_CPPFLAGS=$CPPFLAGS
+cmu_saved_LDFLAGS=$LDFLAGS
+cmu_saved_LIBS=$LIBS
+
+if test ${with_staticsasl} != "no"; then
+  if test -d ${with_staticsasl}; then
+    if test -d ${with_staticsasl}/lib64 ; then
+      ac_cv_sasl_where_lib=${with_staticsasl}/lib64
+    else
+      ac_cv_sasl_where_lib=${with_staticsasl}/lib
+    fi
+    ac_cv_sasl_where_lib=${with_staticsasl}/lib
+    ac_cv_sasl_where_inc=${with_staticsasl}/include
+
+    SASLFLAGS="-I$ac_cv_sasl_where_inc"
+    LIB_SASL="-L$ac_cv_sasl_where_lib"
+    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
+    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
+  else
+    with_staticsasl="/usr"
+  fi
+
+  if test "${ac_cv_header_sasl_sasl_h+set}" = set; then
   echo "$as_me:$LINENO: checking for sasl/sasl.h" >&5
 echo $ECHO_N "checking for sasl/sasl.h... $ECHO_C" >&6
 if test "${ac_cv_header_sasl_sasl_h+set}" = set; then
@@ -12663,7 +14405,6 @@
 echo "$as_me:$LINENO: checking sasl/sasl.h usability" >&5
 echo $ECHO_N "checking sasl/sasl.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12674,11 +14415,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12691,7 +14442,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -12699,7 +14450,6 @@
 echo "$as_me:$LINENO: checking sasl/sasl.h presence" >&5
 echo $ECHO_N "checking sasl/sasl.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12717,6 +14467,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -12736,33 +14487,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sasl/sasl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sasl/sasl.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sasl/sasl.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sasl/sasl.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sasl/sasl.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sasl/sasl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sasl/sasl.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sasl/sasl.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sasl/sasl.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -12780,8 +14530,7 @@
 
 fi
 if test $ac_cv_header_sasl_sasl_h = yes; then
-
-	    if test "${ac_cv_header_sasl_saslutil_h+set}" = set; then
+  if test "${ac_cv_header_sasl_saslutil_h+set}" = set; then
   echo "$as_me:$LINENO: checking for sasl/saslutil.h" >&5
 echo $ECHO_N "checking for sasl/saslutil.h... $ECHO_C" >&6
 if test "${ac_cv_header_sasl_saslutil_h+set}" = set; then
@@ -12794,7 +14543,6 @@
 echo "$as_me:$LINENO: checking sasl/saslutil.h usability" >&5
 echo $ECHO_N "checking sasl/saslutil.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12805,11 +14553,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12822,7 +14580,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -12830,7 +14588,6 @@
 echo "$as_me:$LINENO: checking sasl/saslutil.h presence" >&5
 echo $ECHO_N "checking sasl/saslutil.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12848,6 +14605,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -12867,33 +14625,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sasl/saslutil.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sasl/saslutil.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sasl/saslutil.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sasl/saslutil.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sasl/saslutil.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sasl/saslutil.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sasl/saslutil.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sasl/saslutil.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sasl/saslutil.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sasl/saslutil.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sasl/saslutil.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -12911,47 +14668,45 @@
 
 fi
 if test $ac_cv_header_sasl_saslutil_h = yes; then
-
-	     for i42 in lib64 lib; do
-	        if test -r ${with_staticsasl}/$i42/libsasl2.a; then
-		  ac_cv_found_sasl=yes
-		  echo "$as_me:$LINENO: checking for static libsasl" >&5
+  for i42 in lib64 lib; do
+                                      if test -r ${with_staticsasl}/$i42/libsasl2.a; then
+                                        ac_cv_found_sasl=yes
+                                        echo "$as_me:$LINENO: checking for static libsasl" >&5
 echo $ECHO_N "checking for static libsasl... $ECHO_C" >&6
-		  LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
-		fi
-	     done
-             if test ! "$ac_cv_found_sasl" = "yes"; then
-	          echo "$as_me:$LINENO: checking for static libsasl" >&5
+                                        LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a"
+                                      fi
+                                    done
+                                    if test ! "$ac_cv_found_sasl" = "yes"; then
+                                      echo "$as_me:$LINENO: checking for static libsasl" >&5
 echo $ECHO_N "checking for static libsasl... $ECHO_C" >&6
-		  { { echo "$as_me:$LINENO: error: Could not find ${with_staticsasl}/lib*/libsasl2.a" >&5
+                                      { { echo "$as_me:$LINENO: error: Could not find ${with_staticsasl}/lib*/libsasl2.a" >&5
 echo "$as_me: error: Could not find ${with_staticsasl}/lib*/libsasl2.a" >&2;}
    { (exit 1); exit 1; }; }
-             fi
-
-fi
-
-
-fi
-
-
-
-	  echo "$as_me:$LINENO: result: found" >&5
+                                    fi
+fi
+
+
+fi
+
+
+
+  echo "$as_me:$LINENO: result: found" >&5
 echo "${ECHO_T}found" >&6
 
-          if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
-	    LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
-	  else
-	    SASL_GSSAPI_LIBS_SET=""
-	    cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS"
-	  fi
-	fi
-
-	if test -d ${with_sasl}; then
-            ac_cv_sasl_where_lib=${with_sasl}/lib
-            ac_cv_sasl_where_inc=${with_sasl}/include
-
-	    DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
-	    if test "$ac_cv_sasl_where_lib" != ""; then
+  if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then
+    LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS"
+  else
+    SASL_GSSAPI_LIBS_SET=""
+    cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS"
+  fi
+fi
+
+if test -d ${with_sasl}; then
+  ac_cv_sasl_where_lib=${with_sasl}/lib
+  ac_cv_sasl_where_inc=${with_sasl}/include
+
+  DYNSASLFLAGS="-I$ac_cv_sasl_where_inc"
+  if test "$ac_cv_sasl_where_lib" != ""; then
 
   # this is CMU ADD LIBPATH TO
   if test "$andrew_runpath_switch" = "none" ; then
@@ -12960,13 +14715,14 @@
 	LIB_DYN_SASL="-L$ac_cv_sasl_where_lib ${LIB_DYN_SASL} $andrew_runpath_switch$ac_cv_sasl_where_lib"
   fi
 
-	    fi
-	    LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
-	    CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
-	    LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
-	fi
-
-		if test "${ac_cv_header_sasl_sasl_h+set}" = set; then
+  fi
+  LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2"
+  CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}"
+  LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}"
+fi
+
+# be sure to check for a SASLv2 specific function
+if test "${ac_cv_header_sasl_sasl_h+set}" = set; then
   echo "$as_me:$LINENO: checking for sasl/sasl.h" >&5
 echo $ECHO_N "checking for sasl/sasl.h... $ECHO_C" >&6
 if test "${ac_cv_header_sasl_sasl_h+set}" = set; then
@@ -12979,7 +14735,6 @@
 echo "$as_me:$LINENO: checking sasl/sasl.h usability" >&5
 echo $ECHO_N "checking sasl/sasl.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12990,11 +14745,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13007,7 +14772,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -13015,7 +14780,6 @@
 echo "$as_me:$LINENO: checking sasl/sasl.h presence" >&5
 echo $ECHO_N "checking sasl/sasl.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13033,6 +14797,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -13052,33 +14817,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sasl/sasl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sasl/sasl.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sasl/sasl.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sasl/sasl.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sasl/sasl.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sasl/sasl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sasl/sasl.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sasl/sasl.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sasl/sasl.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sasl/sasl.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -13096,8 +14860,7 @@
 
 fi
 if test $ac_cv_header_sasl_sasl_h = yes; then
-
-	    if test "${ac_cv_header_sasl_saslutil_h+set}" = set; then
+  if test "${ac_cv_header_sasl_saslutil_h+set}" = set; then
   echo "$as_me:$LINENO: checking for sasl/saslutil.h" >&5
 echo $ECHO_N "checking for sasl/saslutil.h... $ECHO_C" >&6
 if test "${ac_cv_header_sasl_saslutil_h+set}" = set; then
@@ -13110,7 +14873,6 @@
 echo "$as_me:$LINENO: checking sasl/saslutil.h usability" >&5
 echo $ECHO_N "checking sasl/saslutil.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13121,11 +14883,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13138,7 +14910,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -13146,7 +14918,6 @@
 echo "$as_me:$LINENO: checking sasl/saslutil.h presence" >&5
 echo $ECHO_N "checking sasl/saslutil.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13164,6 +14935,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -13183,33 +14955,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: sasl/saslutil.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sasl/saslutil.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sasl/saslutil.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sasl/saslutil.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sasl/saslutil.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sasl/saslutil.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: sasl/saslutil.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sasl/saslutil.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sasl/saslutil.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sasl/saslutil.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sasl/saslutil.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sasl/saslutil.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -13227,8 +14998,7 @@
 
 fi
 if test $ac_cv_header_sasl_saslutil_h = yes; then
-
-	      echo "$as_me:$LINENO: checking for prop_get in -lsasl2" >&5
+  echo "$as_me:$LINENO: checking for prop_get in -lsasl2" >&5
 echo $ECHO_N "checking for prop_get in -lsasl2... $ECHO_C" >&6
 if test "${ac_cv_lib_sasl2_prop_get+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13236,7 +15006,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsasl2  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13260,11 +15029,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13277,7 +15056,8 @@
 
 ac_cv_lib_sasl2_prop_get=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_sasl2_prop_get" >&5
@@ -13299,8 +15079,8 @@
 
 
 
-	if test "$ac_cv_found_sasl" = "yes"; then
-	    if test "$ac_cv_sasl_where_lib" != ""; then
+if test "$ac_cv_found_sasl" = "yes"; then
+  if test "$ac_cv_sasl_where_lib" != ""; then
 
   # this is CMU ADD LIBPATH TO
   if test "$andrew_runpath_switch" = "none" ; then
@@ -13309,26 +15089,26 @@
 	DYNLIB_SASL="-L$ac_cv_sasl_where_lib ${DYNLIB_SASL} $andrew_runpath_switch$ac_cv_sasl_where_lib"
   fi
 
-	    fi
-	    DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
-	    if test "$using_static_sasl" != "static"; then
-		LIB_SASL=$DYNLIB_SASL
-		SASLFLAGS=$DYNSASLFLAGS
-	    fi
-	else
-	    DYNLIB_SASL=""
-	    DYNSASLFLAGS=""
-	    using_static_sasl="staticonly"
-	fi
-
-        if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
-	    SASL_GSSAPI_LIBS_SET=""
-	    cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS"
-	fi
-
-	LIBS="$cmu_saved_LIBS"
-	LDFLAGS="$cmu_saved_LDFLAGS"
-	CPPFLAGS="$cmu_saved_CPPFLAGS"
+  fi
+  DYNLIB_SASL="$DYNLIB_SASL -lsasl2"
+  if test "$using_static_sasl" != "static"; then
+    LIB_SASL=$DYNLIB_SASL
+    SASLFLAGS=$DYNSASLFLAGS
+  fi
+else
+  DYNLIB_SASL=""
+  DYNSASLFLAGS=""
+  using_static_sasl="staticonly"
+fi
+
+if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then
+  SASL_GSSAPI_LIBS_SET=""
+  cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS"
+fi
+
+LIBS="$cmu_saved_LIBS"
+LDFLAGS="$cmu_saved_LDFLAGS"
+CPPFLAGS="$cmu_saved_CPPFLAGS"
 
 
 
@@ -13337,7 +15117,7 @@
 
 
 if test "$ac_cv_found_sasl" != "yes"; then
-        { { echo "$as_me:$LINENO: error: Cannot continue without libsasl2.
+  { { echo "$as_me:$LINENO: error: Cannot continue without libsasl2.
 Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/." >&5
 echo "$as_me: error: Cannot continue without libsasl2.
 Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/." >&2;}
@@ -13345,12 +15125,10 @@
 fi
 
 
-
-	cmu_saved_CPPFLAGS=$CPPFLAGS
-	CPPFLAGS="$CPPFLAGS $SASLFLAGS"
-
-	cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+cmu_saved_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $SASLFLAGS"
+
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13384,6 +15162,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -13402,16 +15181,15 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 
-	CPPFLAGS=$cmu_saved_CPPFLAGS
-
-
-
-
-	cmu_saved_LDFLAGS=$LDFLAGS
-
-	LDFLAGS="$LDFLAGS $LIB_SASL"
-
-	echo "$as_me:$LINENO: checking for sasl_checkapop in -lsasl2" >&5
+CPPFLAGS=$cmu_saved_CPPFLAGS
+
+
+
+cmu_saved_LDFLAGS=$LDFLAGS
+
+LDFLAGS="$LDFLAGS $LIB_SASL"
+
+echo "$as_me:$LINENO: checking for sasl_checkapop in -lsasl2" >&5
 echo $ECHO_N "checking for sasl_checkapop in -lsasl2... $ECHO_C" >&6
 if test "${ac_cv_lib_sasl2_sasl_checkapop+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13419,7 +15197,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsasl2  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13443,11 +15220,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13460,7 +15247,8 @@
 
 ac_cv_lib_sasl2_sasl_checkapop=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_sasl2_sasl_checkapop" >&5
@@ -13478,7 +15266,7 @@
 fi
 
 
-	LDFLAGS=$cmu_saved_LDFLAGS
+LDFLAGS=$cmu_saved_LDFLAGS
 
 
 
@@ -13570,21 +15358,28 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define MD5Init to an innocuous variant, in case <limits.h> declares MD5Init.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define MD5Init innocuous_MD5Init
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char MD5Init (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef MD5Init
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -13615,11 +15410,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13632,7 +15437,8 @@
 
 ac_cv_func_MD5Init=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_MD5Init" >&5
 echo "${ECHO_T}$ac_cv_func_MD5Init" >&6
@@ -13647,7 +15453,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13671,11 +15476,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13688,7 +15503,8 @@
 
 ac_cv_lib_md_MD5Init=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_md_MD5Init" >&5
@@ -13704,6 +15520,451 @@
 
 
 SNMP_SUBDIRS=""
+
+
+
+# Check whether --with-lib-subdir or --without-lib-subdir was given.
+if test "${with_lib_subdir+set}" = set; then
+  withval="$with_lib_subdir"
+
+fi;
+echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6
+if test "${ac_cv_type_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((long *) 0)
+  return 0;
+if (sizeof (long))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_long=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6
+
+echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_long" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+		    if test $ac_lo -le $ac_mid; then
+		      ac_lo= ac_hi=
+		      break
+		    fi
+		    ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+		       if test $ac_mid -le $ac_hi; then
+			 ac_lo= ac_hi=
+			 break
+		       fi
+		       ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+long longval () { return (long) (sizeof (long)); }
+unsigned long ulongval () { return (long) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (long))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (long))))
+	exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (long))))
+	exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_long=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking what directory libraries are found in" >&5
+echo $ECHO_N "checking what directory libraries are found in... $ECHO_C" >&6
+if test "${ac_cv_cmu_lib_subdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  test "X$with_lib_subdir" = "Xyes" && with_lib_subdir=
+test "X$with_lib_subdir" = "Xno" && with_lib_subdir=
+if test "X$with_lib_subdir" = "X" ; then
+  ac_cv_cmu_lib_subdir=lib
+  if test $ac_cv_sizeof_long -eq 4 ; then
+    test -d /usr/lib32 && ac_cv_cmu_lib_subdir=lib32
+  fi
+  if test $ac_cv_sizeof_long -eq 8 ; then
+    test -d /usr/lib64 && ac_cv_cmu_lib_subdir=lib64
+  fi
+else
+  ac_cv_cmu_lib_subdir=$with_lib_subdir
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cmu_lib_subdir" >&5
+echo "${ECHO_T}$ac_cv_cmu_lib_subdir" >&6
+CMU_LIB_SUBDIR=$ac_cv_cmu_lib_subdir
+
 
 
 
@@ -13719,7 +15980,7 @@
   if test "$with_libwrap" != no; then
     if test -d "$with_libwrap"; then
       CPPFLAGS="$CPPFLAGS -I${with_libwrap}/include"
-      LDFLAGS="$LDFLAGS -L${with_libwrap}/lib"
+      LDFLAGS="$LDFLAGS -L${with_libwrap}/$CMU_LIB_SUBDIR"
     fi
     cmu_save_LIBS="$LIBS"
     echo "$as_me:$LINENO: checking for request_init in -lwrap" >&5
@@ -13730,7 +15991,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lwrap ${LIB_SOCKET} $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13754,11 +16014,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13771,7 +16041,8 @@
 
 ac_cv_lib_wrap_request_init=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_wrap_request_init" >&5
@@ -13791,7 +16062,6 @@
 echo "$as_me:$LINENO: checking tcpd.h usability" >&5
 echo $ECHO_N "checking tcpd.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13802,11 +16072,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13819,7 +16099,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -13827,7 +16107,6 @@
 echo "$as_me:$LINENO: checking tcpd.h presence" >&5
 echo $ECHO_N "checking tcpd.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13845,6 +16124,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -13864,33 +16144,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: tcpd.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: tcpd.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: tcpd.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: tcpd.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: tcpd.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: tcpd.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: tcpd.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: tcpd.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: tcpd.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: tcpd.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: tcpd.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: tcpd.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: tcpd.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: tcpd.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: tcpd.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: tcpd.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: tcpd.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: tcpd.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: tcpd.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: tcpd.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: tcpd.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: tcpd.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -13940,7 +16219,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -13964,11 +16242,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13981,7 +16269,8 @@
 
 ac_cv_lib_nsl_yp_get_default_domain=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_yp_get_default_domain" >&5
@@ -13991,6 +16280,7 @@
 fi
 
   fi
+
 
 
 
@@ -14086,7 +16376,7 @@
                 if test "$with_snmp" != no; then
       if test -d "$with_snmp"; then
         CPPFLAGS="$CPPFLAGS -I${with_snmp}/include"
-        LDFLAGS="$LDFLAGS -L${with_snmp}/lib"
+        LDFLAGS="$LDFLAGS -L${with_snmp}/$CMU_LIB_SUBDIR"
       fi
       cmu_save_LIBS="$LIBS"
       echo "$as_me:$LINENO: checking for sprint_objid in -lsnmp" >&5
@@ -14097,7 +16387,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsnmp ${LIB_SOCKET} $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14121,11 +16410,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14138,7 +16437,8 @@
 
 ac_cv_lib_snmp_sprint_objid=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_snmp_sprint_objid" >&5
@@ -14158,7 +16458,6 @@
 echo "$as_me:$LINENO: checking ucd-snmp/version.h usability" >&5
 echo $ECHO_N "checking ucd-snmp/version.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14169,11 +16468,21 @@
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14186,7 +16495,7 @@
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -14194,7 +16503,6 @@
 echo "$as_me:$LINENO: checking ucd-snmp/version.h presence" >&5
 echo $ECHO_N "checking ucd-snmp/version.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14212,6 +16520,7 @@
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -14231,33 +16540,32 @@
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: ucd-snmp/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ucd-snmp/version.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ucd-snmp/version.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ucd-snmp/version.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ucd-snmp/version.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ucd-snmp/version.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: ucd-snmp/version.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ucd-snmp/version.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-  no:yes )
-    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ucd-snmp/version.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ucd-snmp/version.h: check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ucd-snmp/version.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ucd-snmp/version.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf at gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -14307,7 +16615,6 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lrpm -lpopt $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14331,11 +16638,21 @@
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -14348,7 +16665,8 @@
 
 ac_cv_lib_rpm_rpmdbOpen=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_rpm_rpmdbOpen" >&5
@@ -14440,13 +16758,13 @@
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
-        "s/'/'\\\\''/g;
-    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
       ;;
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
       sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
 } |
@@ -14476,13 +16794,13 @@
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
 s/:*\$(srcdir):*/:/;
 s/:*\${srcdir}:*/:/;
 s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ 	]*\):*/\1/;
+s/^\([^=]*=[	 ]*\):*/\1/;
 s/:*$//;
-s/^[^=]*=[ 	]*$//;
+s/^[^=]*=[	 ]*$//;
 }'
 fi
 
@@ -14493,7 +16811,7 @@
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_i=`echo "$ac_i" |
-         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
   # 2. Add them.
   ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
   ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
@@ -14537,9 +16855,10 @@
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
 else
   as_unset=false
@@ -14558,7 +16877,7 @@
   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
   LC_TELEPHONE LC_TIME
 do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
     $as_unset $as_var
@@ -14737,16 +17056,17 @@
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
 else
+  test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
 as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
 # Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 # IFS
@@ -14773,7 +17093,7 @@
 cat >&5 <<_CSEOF
 
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -14817,9 +17137,9 @@
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
   --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
+		   instantiate the configuration file FILE
   --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
+		   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -14833,11 +17153,10 @@
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.57,
+configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 srcdir=$srcdir
@@ -15066,7 +17385,6 @@
 s, at EXTRA_SUBDIRS@,$EXTRA_SUBDIRS,;t t
 s, at DEPLIBS@,$DEPLIBS,;t t
 s, at LOCALDEFS@,$LOCALDEFS,;t t
-s, at WITH_AUTH@,$WITH_AUTH,;t t
 s, at BDB_INC@,$BDB_INC,;t t
 s, at BDB_LIB@,$BDB_LIB,;t t
 s, at CYRUSDB_OBJS@,$CYRUSDB_OBJS,;t t
@@ -15083,7 +17401,6 @@
 s, at WITH_MAP@,$WITH_MAP,;t t
 s, at WITH_LOCK@,$WITH_LOCK,;t t
 s, at cyrus_sigveclib@,$cyrus_sigveclib,;t t
-s, at WITH_PTS@,$WITH_PTS,;t t
 s, at AFS_LIBS@,$AFS_LIBS,;t t
 s, at AFS_LDFLAGS@,$AFS_LDFLAGS,;t t
 s, at LDAP_CPPFLAGS@,$LDAP_CPPFLAGS,;t t
@@ -15111,6 +17428,7 @@
 s, at PERL_CCCDLFLAGS@,$PERL_CCCDLFLAGS,;t t
 s, at MD5OBJ@,$MD5OBJ,;t t
 s, at SNMP_SUBDIRS@,$SNMP_SUBDIRS,;t t
+s, at CMU_LIB_SUBDIR@,$CMU_LIB_SUBDIR,;t t
 s, at LIB_WRAP@,$LIB_WRAP,;t t
 s, at SNMP_CONFIG@,$SNMP_CONFIG,;t t
 s, at LIB_UCDSNMP@,$LIB_UCDSNMP,;t t
@@ -15149,9 +17467,9 @@
       (echo ':t
   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
       if test -z "$ac_sed_cmds"; then
-  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
       else
-  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
       fi
       ac_sed_frag=`expr $ac_sed_frag + 1`
       ac_beg=$ac_end
@@ -15169,21 +17487,21 @@
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
   - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   * )   ac_file_in=$ac_file.in ;;
   esac
 
   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
   ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -15199,10 +17517,10 @@
       as_dirs="$as_dir $as_dirs"
       as_dir=`(dirname "$as_dir") 2>/dev/null ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -15240,12 +17558,45 @@
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
 
   case $INSTALL in
@@ -15267,7 +17618,7 @@
     configure_input="$ac_file.  "
   fi
   configure_input=$configure_input"Generated from `echo $ac_file_in |
-                                     sed 's,.*/,,'` by configure."
+				     sed 's,.*/,,'` by configure."
 
   # First look for the input files in the build tree, otherwise in the
   # src tree.
@@ -15276,24 +17627,24 @@
       case $f in
       -) echo $tmp/stdin ;;
       [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         echo $f;;
+	 echo "$f";;
       *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         fi;;
+	 fi;;
       esac
     done` || { (exit 1); exit 1; }
 _ACEOF
@@ -15335,12 +17686,12 @@
 # NAME is the cpp macro being defined and VALUE is the value it is being given.
 #
 # ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
-ac_dB='[ 	].*$,\1#\2'
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
 ac_dC=' '
 ac_dD=',;t'
 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
 ac_uB='$,\1#\2define\3'
 ac_uC=' '
 ac_uD=',;t'
@@ -15349,11 +17700,11 @@
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
   - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   * )   ac_file_in=$ac_file.in ;;
   esac
 
@@ -15367,28 +17718,29 @@
       case $f in
       -) echo $tmp/stdin ;;
       [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         echo $f;;
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
       *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         fi;;
+	 fi;;
       esac
     done` || { (exit 1); exit 1; }
   # Remove the trailing spaces.
-  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
 
 _ACEOF
 
@@ -15411,9 +17763,9 @@
 s,[\\$`],\\&,g
 t clear
 : clear
-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
 t end
-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
 : end
 _ACEOF
 # If some macros were called several times there might be several times
@@ -15427,13 +17779,13 @@
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
 cat >>conftest.undefs <<\_ACEOF
-s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
 _ACEOF
 
 # Break up conftest.defines because some shells have a limit on the size
 # of here documents, and old seds have small limits too (100 cmds).
 echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
 echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
 echo '  :' >>$CONFIG_STATUS
 rm -f conftest.tail
@@ -15442,7 +17794,7 @@
   # Write a limited-size here document to $tmp/defines.sed.
   echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
   # Speed up: don't consider the non `#define' lines.
-  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
   # Work around the forget-to-reset-the-flag bug.
   echo 't clr' >>$CONFIG_STATUS
   echo ': clr' >>$CONFIG_STATUS
@@ -15469,7 +17821,7 @@
   # Write a limited-size here document to $tmp/undefs.sed.
   echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
   # Speed up: don't consider the non `#undef'
-  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
   # Work around the forget-to-reset-the-flag bug.
   echo 't clr' >>$CONFIG_STATUS
   echo ': clr' >>$CONFIG_STATUS
@@ -15503,10 +17855,10 @@
     else
       ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -15522,10 +17874,10 @@
       as_dirs="$as_dir $as_dirs"
       as_dir=`(dirname "$as_dir") 2>/dev/null ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }

Modified: trunk/cyrus-imapd-2.2/configure.in
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/configure.in?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/configure.in (original)
+++ trunk/cyrus-imapd-2.2/configure.in Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
 dnl
-dnl Copyright (c) 1998-2000 Carnegie Mellon University.  All rights reserved.
+dnl Copyright (c) 1998-2005 Carnegie Mellon University.  All rights reserved.
 dnl
 dnl Redistribution and use in source and binary forms, with or without
 dnl modification, are permitted provided that the following conditions
@@ -42,7 +42,7 @@
 
 dnl
 dnl configure.in for the Cyrus imapd
-dnl $Id: configure.in,v 1.290 2005/01/18 23:46:00 shadow Exp $
+dnl $Id: configure.in,v 1.296 2005/10/13 19:56:14 jeaton Exp $
 dnl
 
 
@@ -103,6 +103,8 @@
 CMU_C___ATTRIBUTE__
 CMU_C_FPIC
 
+AC_CHECK_SIZEOF(long)
+
 dnl check for -R, etc. switch
 CMU_GUESS_RUNPATH_SWITCH
 
@@ -151,16 +153,6 @@
 AC_SUBST(DEPLIBS)
 AC_SUBST(LOCALDEFS)
 AC_FUNC_VPRINTF
-
-dnl check authorization method before databases, to find out
-dnl if we need a PTS database or not
-AC_ARG_WITH(auth,[  --with-auth=METHOD      use authorization module METHOD
-                          METHOD is 'unix' (default), 'krb', 'krb5', or 'pts'],
-	WITH_AUTH="$withval", WITH_AUTH="unix")
-AC_SUBST(WITH_AUTH)
-
-AC_MSG_CHECKING(authorization method)
-AC_MSG_RESULT($WITH_AUTH)
 
 dnl function for doing each of the database backends
 dnl parameters: backend name, variable to set, withval
@@ -463,106 +455,100 @@
 # all authentication goes through SASL
 
 AC_ARG_WITH(afs,[  --with-afs=PATH         use AFS libraries from PATH],
-	[with_afs="${withval}"
-	CFLAGS="${CFLAGS} -I${withval}/include"],with_afs="/usr/local")
+	with_afs="${withval}", with_afs="no")
 
 AC_ARG_WITH(ldap, [  --with-ldap=DIR         use LDAP (in DIR) (experimental) [/usr/local] ],
-	with_ldap=$withval, with_ldap="/usr/local")
-
-dnl select module for ptloader
-AC_ARG_WITH(pts,[  --with-pts=MODULE       use PTS module MODULE
-                          MODULE is 'afskrb' (default) or 'ldap' (experimental)],
-	    WITH_PTS="$withval", WITH_PTS="afskrb")
-AC_SUBST(WITH_PTS)
+	with_ldap="${withval}", with_ldap="no")
 
 dnl select mode of afspts
 AC_ARG_ENABLE(krb5afspts,[  --enable-krb5afspts     compile afskrb PTS module with krb5 support],
 	[SASL_SET_GSSAPI_LIBS
          AC_DEFINE(AFSPTS_USE_KRB5,[],[Should the AFS PTS plugin use krb5?])])
 
-if test "$WITH_AUTH" = "pts"; then
-	AC_MSG_CHECKING(which pts module to use)
-	AC_MSG_RESULT($WITH_PTS)
-
+if test "x$with_afs" != "xno"; then
+    if test ! -d $with_afs; then
+        $with_afs=/usr/local
+    fi
+    CFLAGS="${CFLAGS} -I${with_afs}/include"
+    AFS_LIBS="${with_afs}/lib/afs/libkauth.a ${with_afs}/lib/afs/libprot.a  ${with_afs}/lib/afs/libauth.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/librxkad.a ${with_afs}/lib/librx.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/libubik.a  ${with_afs}/lib/liblwp.a ${with_afs}/lib/afs/util.a"
+    if test -f ${with_afs}/lib/afs/libaudit.a; then
+    AFS_LIBS="$AFS_LIBS ${with_afs}/lib/afs/libaudit.a"
+    fi
+    if test -f /usr/ucblib/libucb.a; then
+    CMU_ADD_LIBPATH_TO(/usr/ucblib, AFS_LDFLAGS)
+    AFS_LIBS="$AFS_LIBS -lc -lucb"
+    fi
+
+    AC_CACHE_VAL(cyrus_afs_sigvec,[
+        SAVE_LIBS="$LIBS"
+        LIBS="${with_afs}/lib/liblwp.a"
+        AC_MSG_CHECKING(if AFS libraries need sigvec)
+        dnl Does AFS need sigvec?  We have to link against lwp and see
+        dnl if IOMGR_Initialize wants it
+        AC_TRY_LINK([IOMGR_Initialize();],
+                [IOMGR_Initialize()],
+                [
+                        dnl it linked; don't need it
+                        AC_MSG_RESULT(no)
+                        cyrus_afs_sigvec="no"
+                ], [
+                        dnl didn't link; pick up sigvec
+                        AC_MSG_RESULT(yes)
+                        cyrus_afs_sigvec="yes"
+                ])
+        ])
+    if test "$cyrus_afs_sigvec" = yes; then
+      if test "$cant_find_sigvec" = yes; then
+        AC_MSG_WARN([Can't find a sigvec for AFS libraries which seem to need one.])
+      else
+        AFS_LIBS="${AFS_LIBS} $cyrus_sigveclib"
+        AC_SUBST(AFS_LIBS)
+        AC_SUBST(AFS_LDFLAGS)
+        AC_DEFINE(HAVE_AFSKRB,[],[Should we build afskrb pts module?])
+      fi
+    else
+      AFS_LIBS="${AFS_LIBS}"
+      AC_SUBST(AFS_LIBS)
+      AC_SUBST(AFS_LDFLAGS)
+      AC_DEFINE(HAVE_AFSKRB,[],[Should we build afskrb pts module?])
+    fi
+    LIBS="$SAVE_LIBS"
+fi
+
+LDAP_CPPFLAGS=""
+LDAP_LDFLAGS=""
+LDAP_LIBS=""
+
+if test "x$with_ldap" != "xno"; then
+    if test ! -d $with_ldap; then
+        $with_ldap=/usr/local
+    fi
+
+    LDAP_CPPFLAGS="$CPPFLAGS -I${with_ldap}/include"
+    LDAP_LDFLAGS="$LDFLAGS -L${with_ldap}/lib"
+    LDAP_LIBS=""
+
+    save_CPPFLAGS=$CPPFLAGS
+    save_LDFLAGS=$LDFLAGS
+    CPPFLAGS=$LDAP_CPPFLAGS
+    LDFLAGS=$LDAP_LDFLAGS
+
+    AC_CHECK_LIB(ldap, ldap_initialize, 
+        [ AC_DEFINE(HAVE_LDAP,[],[Should we build ldap pts module?])
+          AC_SUBST(LDAP_CPPFLAGS)
+          AC_SUBST(LDAP_LDFLAGS)
+          AC_SUBST(LDAP_LIBS)	
+          LDAP_LIBS="-lldap -llber" ],,-llber)
+
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+fi
+
+if test "x$with_afs" != "xno" -o "x$with_ldap" != "xno"; then
 	EXTRA_SUBDIRS="${EXTRA_SUBDIRS} ptclient"
 	EXTRA_OUTPUT="${EXTRA_OUTPUT} ptclient/Makefile"
-
-	LDAP_CPPFLAGS=""
-	LDAP_LDFLAGS=""
-	LDAP_LIBS=""
-
-  	if test "$WITH_PTS" = "afskrb"; then
-	    AFS_LIBS="${with_afs}/lib/afs/libkauth.a ${with_afs}/lib/afs/libprot.a  ${with_afs}/lib/afs/libauth.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/librxkad.a ${with_afs}/lib/librx.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/libubik.a  ${with_afs}/lib/liblwp.a ${with_afs}/lib/afs/util.a"
-	    if test -f ${with_afs}/lib/afs/libaudit.a; then
-		AFS_LIBS="$AFS_LIBS ${with_afs}/lib/afs/libaudit.a"
-	    fi
-	    if test -f /usr/ucblib/libucb.a; then
-		CMU_ADD_LIBPATH_TO(/usr/ucblib, AFS_LDFLAGS)
-		AFS_LIBS="$AFS_LIBS -lc -lucb"
-	    fi
-
-	    AC_CACHE_VAL(cyrus_afs_sigvec,[
-		SAVE_LIBS="$LIBS"
-		LIBS="${with_afs}/lib/liblwp.a"
-		AC_MSG_CHECKING(if AFS libraries need sigvec)
-		dnl Does AFS need sigvec?  We have to link against lwp and see
-		dnl if IOMGR_Initialize wants it
-		AC_TRY_LINK([IOMGR_Initialize();],
-			[IOMGR_Initialize()],
-			[
-				dnl it linked; don't need it
-				AC_MSG_RESULT(no)
-				cyrus_afs_sigvec="no"
-			], [
-				dnl didn't link; pick up sigvec
-				AC_MSG_RESULT(yes)
-				cyrus_afs_sigvec="yes"
-			])
-		])
-	    if test "$cyrus_afs_sigvec" = yes; then
-	      if test "$cant_find_sigvec" = yes; then
-                AC_MSG_WARN([Can't find a sigvec for AFS libraries which seem])
-	        AC_MSG_WARN([to need one; ptloader may not build.])
-              else
-	        AFS_LIBS="${AFS_LIBS} $cyrus_sigveclib"
-	      fi
-	    fi
-	    LIBS="$SAVE_LIBS"
-	    AC_SUBST(AFS_LIBS)
-	    AC_SUBST(AFS_LDFLAGS)
-	elif test "$WITH_PTS" = "ldap"; then
-	    AC_MSG_WARN([*** WARNING: COMPILING WITH EXPERIMENTAL LDAP PTLOADER MODULE ***])
-	    if test -d $with_ldap; then
-	        LDAP_CPPFLAGS="$CPPFLAGS -I${with_ldap}/include"
-	        LDAP_LDFLAGS="$LDFLAGS -L${with_ldap}/lib"
-	    else
-	 	AC_ERROR(LDAP path isn't a directory)
-	    fi	
-
-	    LDAP_LIBS=""
-
-           save_CPPFLAGS=$CPPFLAGS
-           save_LDFLAGS=$LDFLAGS
-           CPPFLAGS=$LDAP_CPPFLAGS
-           LDFLAGS=$LDAP_LDFLAGS
-
-	    AC_CHECK_LIB(ldap, ldap_initialize, [
-                         LDAP_LIBS="-lldap -llber" ],,-llber)
-
-           CPPFLAGS=$save_CPPFLAGS
-           LDFLAGS=$save_LDFLAGS
-	else
-	    AC_ERROR(unknown with-pts value)
-	fi
-
-   	AC_SUBST(LDAP_CPPFLAGS)
-	AC_SUBST(LDAP_LDFLAGS)
-	AC_SUBST(LDAP_LIBS)	
-
 	AC_DEFINE(WITH_PTS,[],[Build in PTS support?])
 fi
-
-
 
 SERVER_SUBDIRS="master imap"
 AC_ARG_ENABLE(server,
@@ -585,82 +571,78 @@
 		[  --enable-statickrb      link Kerberos statically],
 	with_statickrb="yes", with_statickrb="no")
 
-if test "$WITH_AUTH" = "krb" -o "$WITH_AUTH" = "krb_pts" -o "$with_krb" != "no"; then
-  dnl In order to compile kerberos4, we need libkrb and libdes.
-
-  dnl we might need -lresolv for kerberos
-  AC_CHECK_LIB(resolv,res_search)
-
-  if test "$with_statickrb" = "yes" -a ! -d "$with_krb"; then
-	AC_MSG_ERROR([--enable-statickrb specified but --with-krb did not specify a valid directory])
-  fi 
-
-  dnl Do we need DES for kerberos?
-  AC_ARG_WITH(krbdes,[  --with-krbdes           use Kerberos DES implementation [[yes]]],
-	with_krbdes="$withval", with_krbdes="yes")
-  if test "$with_krbdes" = "yes"; then
-    AC_CHECK_LIB(des,des_ecb_encrypt,
-	if test "$with_statickrb" = "yes"; then
-	    KRB_LIBS="$with_krb/lib/libdes.a"
-	else
-	    KRB_LIBS="-ldes"
-	fi,
-    AC_MSG_ERROR([The Kerberos DES library is required for Kerberos support.  You might want --with-auth=unix.]))
-  fi
-
-  dnl if we were ambitious, we'd look more aggressively for the
-  dnl krb4 install
-  if test -d ${with_krb}; then
-     AC_CACHE_CHECK(for Kerberos includes, cyrus_krbinclude, [
-       for krbhloc in include/kerberosIV include
-       do
-         if test -f ${with_krb}/${krbhloc}/krb.h ; then
-           cyrus_krbinclude=${with_krb}/${krbhloc}
-           break
-         fi
-       done
-       ])
-
-     if test -n "${cyrus_krbinclude}"; then
-       CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}"
-     fi
-     CMU_ADD_LIBPATH(${with_krb}/lib)
-  fi
-
-  if test "$with_krbimpl" != "kth"; then
-    KRBLIB="krb4"
-  else
-    KRBLIB="krb"
-  fi
-
-  if test "$with_des" != no; then
-    AC_CHECK_HEADER(krb.h,
-      AC_CHECK_LIB(${KRBLIB}, krb_mk_priv,
-	if test "$with_statickrb" = "yes"; then
-	    KRB_LIBS="$KRB_LIBS $with_krb/lib/lib${KRBLIB}.a"
-	else
-	    KRB_LIBS="$KRB_LIBS -l${KRBLIB}"
-	fi,
-                   AC_WARN(No Kerberos V4 found); krb4=no,
-		   $KRB_LIBS),
-      AC_WARN(No Kerberos V4 found); krb4=no)
-  else
-    AC_WARN(No DES library found for Kerberos V4 support)
-    krb4=no
-  fi
-
-  if test "${krb4}" != no; then
-    AC_DEFINE(HAVE_KRB,[],[Support for Kerberos?])
-  else
-    AC_ERROR([Kerberos not found for authorization module])
-  fi
+dnl In order to compile kerberos4, we need libkrb and libdes.
+
+dnl we might need -lresolv for kerberos
+AC_CHECK_LIB(resolv,res_search)
+
+if test "$with_statickrb" = "yes" -a ! -d "$with_krb"; then
+      AC_MSG_ERROR([--enable-statickrb specified but --with-krb did not specify a valid directory])
+fi 
+
+if test "$with_krb" != "no"; then
+dnl Do we need DES for kerberos?
+AC_ARG_WITH(krbdes,[  --with-krbdes           use Kerberos DES implementation [[yes]]],
+      with_krbdes="$withval", with_krbdes="yes")
+if test "$with_krbdes" = "yes"; then
+  AC_CHECK_LIB(des,des_ecb_encrypt,
+      if test "$with_statickrb" = "yes"; then
+          KRB_LIBS="$with_krb/lib/libdes.a"
+      else
+          KRB_LIBS="-ldes"
+      fi,
+  AC_MSG_ERROR([The Kerberos DES library is required for Kerberos support.  You might want --with-auth=unix.]))
+fi
+fi
+
+dnl if we were ambitious, we'd look more aggressively for the
+dnl krb4 install
+if test -d ${with_krb}; then
+   AC_CACHE_CHECK(for Kerberos includes, cyrus_krbinclude, [
+     for krbhloc in include/kerberosIV include
+     do
+       if test -f ${with_krb}/${krbhloc}/krb.h ; then
+         cyrus_krbinclude=${with_krb}/${krbhloc}
+         break
+       fi
+     done
+     ])
+
+   if test -n "${cyrus_krbinclude}"; then
+     CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}"
+   fi
+   CMU_ADD_LIBPATH(${with_krb}/lib)
+fi
+
+if test "$with_krbimpl" != "kth"; then
+  KRBLIB="krb4"
+else
+  KRBLIB="krb"
+fi
+
+if test "$with_des" != no; then
+  AC_CHECK_HEADER(krb.h,
+    AC_CHECK_LIB(${KRBLIB}, krb_mk_priv,
+      if test "$with_statickrb" = "yes"; then
+          KRB_LIBS="$KRB_LIBS $with_krb/lib/lib${KRBLIB}.a"
+      else
+          KRB_LIBS="$KRB_LIBS -l${KRBLIB}"
+      fi,
+                 AC_WARN(No Kerberos V4 found); krb4=no,
+      	   $KRB_LIBS),
+    AC_WARN(No Kerberos V4 found); krb4=no)
+else
+  AC_WARN(No DES library found for Kerberos V4 support)
+  krb4=no
+fi
+
+if test "${krb4}" != no; then
+  AC_DEFINE(HAVE_KRB,[],[Support for Kerberos?])
 fi
 
 LIBS="$KRB_LIBS $LIBS"
 
-if test "$WITH_AUTH" = "krb5"; then
-    SASL_SET_GSSAPI_LIBS
-fi
+SASL_SET_GSSAPI_LIBS
 
 dnl
 dnl Test for OpenSSL
@@ -704,6 +686,10 @@
 if test "$with_openssl" != "no"; then
 	AC_DEFINE(HAVE_SSL,[],[Build with SSL support?])
 	IMAP_PROGS="$IMAP_PROGS tls_prune"
+        if test "${krb4}" != no; then
+           AC_DEFINE(OPENSSL_ENABLE_OLD_DES_SUPPORT,[],[Configure OpenSSL to provide legacy des apis])
+           AC_DEFINE(OPENSSL_DES_LIBDES_COMPATIBILITY,[],[Configure OpenSSL to provide krb4-compatible legacy des apis])
+        fi
 fi
 AC_SUBST(OPENSSL_INC)
 AC_SUBST(OPENSSL_LIB)
@@ -1032,7 +1018,7 @@
 AC_SUBST(PERL)
 
 AH_TOP([
-/* $Id: configure.in,v 1.290 2005/01/18 23:46:00 shadow Exp $ */
+/* $Id: configure.in,v 1.296 2005/10/13 19:56:14 jeaton Exp $ */
 /* 
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *

Modified: trunk/cyrus-imapd-2.2/debian/changelog
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/debian/changelog?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/debian/changelog (original)
+++ trunk/cyrus-imapd-2.2/debian/changelog Fri Mar 31 20:18:13 2006
@@ -1,15 +1,16 @@
-cyrus-imapd-2.2 (2.2.12-5) UNRELEASED; urgency=low
+cyrus-imapd-2.2 (2.2.13-1) UNRELEASED; urgency=low
 
   [ Sven Mueller ]
   * Add example entries for squatter to cyrus.conf (Closes: #355303)
   * Fix URLs in README.sendmail (Closes: #355771)
   * Remove STDERR redirection from cyrus-common-2.2 postinst call to adduser
-
-  [ Benjamin Seidenberg ]
-  * Default to lmtp_downcase_rcpt: yes for compliance with RFC 2821 
+  * Switch to 2.2.13
+
+  [ Benjamin Seidenberg ]
+  * Default to lmtp_downcase_rcpt: yes for compliance with RFC 2821
     (Closes: #357040)
 
- -- Benjamin Seidenberg <astronut at dlgeek.net>  Mon, 27 Mar 2006 18:09:38 -0500
+ -- Sven Mueller <debian at incase.de>  Fri, 31 Mar 2006 20:11:54 +0200
 
 cyrus-imapd-2.2 (2.2.12-4) unstable; urgency=low
 

Modified: trunk/cyrus-imapd-2.2/debian/patches/00list
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/debian/patches/00list?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/debian/patches/00list (original)
+++ trunk/cyrus-imapd-2.2/debian/patches/00list Fri Mar 31 20:18:13 2006
@@ -1,4 +1,3 @@
-00-6662-upstream-off-by-one_in_imap_spool.dpatch
 01-fix_Makefile.in.dpatch
 02-add_mkinstalldirs.dpatch
 03-fix_docs.dpatch

Modified: trunk/cyrus-imapd-2.2/depot/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/depot/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/depot/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/depot/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /.cvsignore/1.1/Sun Jan  6 20:23:54 2002//
 /Makefile.in/1.7/Fri May 28 13:39:38 2004//
-/depot.conf/1.4/Fri Mar 15 22:50:00 2002//
+/depot.conf/1.5/Thu Oct 13 19:57:05 2005//
 /rc.local.imap/1.2/Thu Aug  2 19:20:41 2001//
 /rc.local.ptclient/1.2/Tue Dec 26 19:30:48 2000//
 D

Modified: trunk/cyrus-imapd-2.2/depot/depot.conf
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/depot/depot.conf?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/depot/depot.conf (original)
+++ trunk/cyrus-imapd-2.2/depot/depot.conf Fri Mar 31 20:18:13 2006
@@ -2,3 +2,7 @@
 usr/cyrus root.server/usr/cyrus
 etc	  root.server/etc
 ~delete lib/perl5/5.6.1/perllocal.pod
+~delete lib/perl5/5.8.6/i686-linux-thread-multi-64int-ld/perllocal.pod
+~delete lib/perl5/5.8.6/i686-linux/perllocal.pod
+~delete lib/perl5/5.8.6/sparc-solaris-thread-multi-64int-ld/perllocal.pod
+~delete lib/perl5/5.8.6/sparc-solaris/perllocal.pod

Modified: trunk/cyrus-imapd-2.2/doc/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/doc/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/doc/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/doc/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -3,7 +3,7 @@
 /altnamespace.html/1.2/Tue Oct 23 20:15:18 2001//
 /anoncvs.html/1.3/Sat May 25 19:57:43 2002//
 /bugs.html/1.28/Mon Mar 22 00:30:59 2004//
-/changes.html/1.98/Mon Feb 14 06:39:54 2005//
+/changes.html/1.102/Fri Mar 31 15:24:29 2006//
 /cyrusv2.mc/1.4/Thu Aug 23 23:26:56 2001//
 /faq.html/1.36/Sun Mar  7 21:56:48 2004//
 /feedback.html/1.6/Fri Aug 15 17:37:04 2003//
@@ -33,5 +33,5 @@
 /readme.html/1.19/Wed Oct 22 18:50:04 2003//
 /sieve-protocol.html/1.3/Fri May  2 17:01:57 2003//
 /sieve.html/1.1/Tue Apr 25 02:56:46 2000//
-/specs.html/1.63/Wed Sep 29 20:57:14 2004//
+/specs.html/1.65/Fri Mar 31 15:22:58 2006//
 D

Modified: trunk/cyrus-imapd-2.2/doc/changes.html
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/doc/changes.html?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/doc/changes.html (original)
+++ trunk/cyrus-imapd-2.2/doc/changes.html Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- $Id: changes.html,v 1.98 2005/02/14 06:39:54 shadow Exp $ -->
+<!-- $Id: changes.html,v 1.102 2006/03/31 15:24:29 murch Exp $ -->
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta name="generator" content="HTML Tidy, see www.w3.org" />
@@ -8,6 +8,34 @@
 </head>
 <body>
 
+<h1>Changes to the Cyrus IMAP Server since 2.2.12</h1> 
+<ul> 
+<li>Allow sieve scripts to be run on shared mailboxes (via <tt>sieve</tt>
+annotation).</li>
+<li>Updated <tt>nntpd</tt> to be compliant with latest draft (soon to be
+RFC3977).</li>
+<li>Updated IMAP UIDPLUS extension to be compliant with latest
+specification (RFC4315).</li>
+<li>Performance improvements to <tt>quota</tt> utility.<li>
+<li>Fixed possible race condition in IMAP IDLE.</li>
+<li>Made <tt>ptloader</tt> runtime configurable.</li>
+<li>Added more extensive output to <tt>arbitron</tt>.</li>
+<li>Allow responses of any length from backend when proxing
+IMAP/POP3/NNTP traffic.</li>
+<li>Added <tt>plaintextloginalert</tt> option.</li>
+<li>Only allow <tt>mbpath</tt> to be run as Cyrus user.</li>
+<li>Added <tt>berkeley_hash</tt> and <tt>berkeley_hash_nosync</tt>
+cyrusdb backends (seem to perform better under heavy loads).</li>
+<li>Added <tt>lastpop</tt> mailbox annotation.</li>
+<li>Added subscribe/unsubscribe support to <tt>cyradm</tt>.</li>
+<li>Fixed miscellaneous bugs and build issues.</li>
+</ul>
+
+<h1>Changes to the Cyrus IMAP Server since 2.2.11</h1> 
+<ul> 
+<li>Revert index change which wasn't supposed to make it into 2.2.11</li>
+</ul>
+
 <h1>Changes to the Cyrus IMAP Server since 2.2.10</h1>
 <ul>
 <li>Fix possible single byte overflow in mailbox handling code.</li>
@@ -20,6 +48,8 @@
 <ul>
 <li>Fix 0 termination in mysasl_canon_user.</li>
 <li>Check for imap magic plus buffer overflow in proxyd also (CAN-2004-1015).</li>
+<li>Only send an over quota ALERT on SELECT if the quotaroot is different
+from the last ALERT, or we haven't sent an ALERT in over 10 min.</li>
 </ul>
 
 <h1>Changes to the Cyrus IMAP Server since 2.2.8</h1>
@@ -1998,7 +2028,7 @@
 </ul>
 
 <hr />
-last modified: $Date: 2005/02/14 06:39:54 $ <br />
+last modified: $Date: 2006/03/31 15:24:29 $ <br />
 <a href="index.html">Return</a> to the Cyrus IMAP Server Home Page
 </body>
 </html>

Modified: trunk/cyrus-imapd-2.2/doc/specs.html
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/doc/specs.html?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/doc/specs.html (original)
+++ trunk/cyrus-imapd-2.2/doc/specs.html Fri Mar 31 20:18:13 2006
@@ -1,4 +1,4 @@
-<!-- $Id: specs.html,v 1.63 2004/09/29 20:57:14 ken3 Exp $ -->
+<!-- $Id: specs.html,v 1.65 2006/03/31 15:22:58 murch Exp $ -->
 <HTML>
 <HEAD>
 <TITLE>Cyrus IMAP Server Protocol Specifications</TITLE>
@@ -29,8 +29,8 @@
 <TD>IMAP4 Mailbox Referrals</TD></TR>
 <TR><TD><A HREF="http://www.ietf.org/rfc/rfc2342.txt">RFC 2342</A></TD>
 <TD>IMAP4 Namespace</TD></TR>
-<TR><TD><A HREF="http://www.ietf.org/rfc/rfc2359.txt">RFC 2359</A></TD>
-<TD>IMAP4 UIDPLUS extension</TD></TR>
+<TR><TD><A HREF="http://www.ietf.org/rfc/rfc4315.txt">RFC 4315</A></TD>
+<TD>Internet Message Access Protocol (IMAP) - UIDPLUS extension</TD></TR>
 <TR><TD><A HREF="http://www.ietf.org/rfc/rfc2971.txt">RFC 2971</A></TD>
 <TD>IMAP4 ID extension</TD></TR>
 <TR><TD><A HREF="http://www.ietf.org/rfc/rfc3348.txt">RFC 3348</A></TD>

Modified: trunk/cyrus-imapd-2.2/imap/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/imap/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,82 +1,83 @@
 /.cvsignore/1.10/Mon Dec  1 21:00:52 2003//
 /Makefile.dist/1.8/Mon Mar  1 19:47:35 2004//
 /Makefile.in/1.184/Fri May 28 18:03:02 2004//
-/annotate.c/1.28/Mon Feb 14 06:39:54 2005//
+/annotate.c/1.32/Mon Oct 31 17:08:59 2005//
 /annotate.h/1.9/Wed Aug  4 13:03:12 2004//
-/append.c/1.107/Sat May 22 03:45:48 2004//
-/append.h/1.26/Thu Jan 22 21:17:07 2004//
-/arbitron.c/1.35/Sat May 22 03:45:48 2004//
-/backend.c/1.35/Mon Feb 14 06:39:55 2005//
-/backend.h/1.11/Wed Feb  4 01:42:38 2004//
+/append.c/1.108/Thu Jun  2 15:47:50 2005//
+/append.h/1.27/Thu Jun  2 15:47:51 2005//
+/arbitron.c/1.39/Fri Jan 13 16:47:18 2006//
+/backend.c/1.39/Tue Feb  7 20:57:27 2006//
+/backend.h/1.12/Thu Jan 12 22:17:57 2006//
 /chk_cyrus.c/1.16/Wed Aug  4 13:03:12 2004//
 /cli_fatal.c/1.3/Fri Oct 24 18:24:05 2003//
 /convert_code.c/1.7/Thu Feb 13 20:15:23 2003//
 /convert_code.h/1.6/Wed Oct 22 18:50:07 2003//
-/ctl_cyrusdb.c/1.26/Tue Jul 13 02:34:20 2004//
+/ctl_cyrusdb.c/1.27/Wed Feb 16 20:37:58 2005//
 /ctl_deliver.c/1.20/Sat May 22 03:45:48 2004//
-/ctl_mboxlist.c/1.48/Sat May 22 03:45:48 2004//
+/ctl_mboxlist.c/1.49/Wed Nov 23 13:40:08 2005//
 /cvt_cyrusdb.c/1.15/Sat May 22 03:45:48 2004//
 /cyr_expire.c/1.7/Sat May 22 03:45:48 2004//
 /cyrdump.c/1.16/Sat May 22 03:45:48 2004//
 /deliver.c/1.174/Sat May 22 03:45:48 2004//
 /duplicate.c/1.41/Thu Mar 11 18:36:42 2004//
 /duplicate.h/1.15/Thu Feb 12 02:32:22 2004//
-/fetchnews.c/1.12/Mon Feb 14 06:39:55 2005//
-/fud.c/1.52/Fri Dec 17 16:32:07 2004//
-/global.c/1.17/Tue Nov 23 17:40:15 2004//
-/global.h/1.6/Fri Dec 17 16:32:08 2004//
-/idle.h/1.6/Wed Oct 22 20:05:10 2003//
-/idle_idled.c/1.14/Wed Oct 22 20:05:11 2003//
-/idle_no.c/1.5/Wed Oct 22 20:05:11 2003//
-/idle_poll.c/1.10/Wed Oct 22 20:05:11 2003//
+/fetchnews.c/1.14/Wed Mar 23 00:40:11 2005//
+/fud.c/1.53/Wed Apr 13 15:42:04 2005//
+/global.c/1.19/Thu Mar  3 15:59:12 2005//
+/global.h/1.7/Wed Feb 16 20:37:58 2005//
+/idle.h/1.7/Fri Dec  9 16:12:50 2005//
+/idle_idled.c/1.16/Fri Dec  9 21:09:14 2005//
+/idle_no.c/1.6/Fri Dec  9 16:12:50 2005//
+/idle_poll.c/1.12/Fri Dec  9 19:15:35 2005//
 /idled.c/1.23/Tue Jul 27 16:19:44 2004//
 /idled.h/1.4/Thu Feb 13 20:15:24 2003//
 /imap_err.et/1.52/Wed Oct 22 20:05:11 2003//
-/imapd.c/1.490/Mon Feb 14 06:39:55 2005//
-/imapd.h/1.61/Tue Jun 22 21:36:18 2004//
-/imapparse.c/1.14/Tue Jan  6 16:32:17 2004//
-/index.c/1.213/Mon Feb 14 16:42:08 2005//
+/imapd.c/1.498/Fri Jan 13 22:06:28 2006//
+/imapd.h/1.62/Thu Jun  2 15:47:57 2005//
+/imapparse.c/1.15/Tue Oct 18 23:38:43 2005//
+/index.c/1.218/Thu Jun  2 15:47:58 2005//
 /index.h/1.10/Sat May 22 03:45:50 2004//
 /ipurge.c/1.25/Wed May 26 15:32:10 2004//
-/lmtp_sieve.c/1.8/Tue Jun  1 13:47:16 2004//
-/lmtp_sieve.h/1.2/Thu Feb 12 02:32:23 2004//
-/lmtpd.c/1.140/Fri Dec 17 16:32:15 2004//
-/lmtpengine.c/1.115/Tue Aug 10 17:18:38 2004//
+/lmtp_sieve.c/1.11/Mon Nov 21 16:26:16 2005//
+/lmtp_sieve.h/1.3/Thu Oct 20 15:29:02 2005//
+/lmtpd.c/1.143/Fri Jan 20 20:29:33 2006//
+/lmtpd.h/1.3/Mon Oct 31 14:21:54 2005//
+/lmtpengine.c/1.116/Tue Nov  1 19:47:47 2005//
 /lmtpengine.h/1.22/Thu Mar  4 16:09:32 2004//
-/lmtpproxyd.c/1.67/Fri Dec 17 16:32:16 2004//
+/lmtpproxyd.c/1.69/Tue Nov 29 16:22:35 2005//
 /lmtpstats.snmp/1.6/Thu Oct 12 19:13:57 2000//
-/mailbox.c/1.156/Mon Feb 14 06:39:57 2005//
+/mailbox.c/1.159/Thu Apr  7 00:25:52 2005//
 /mailbox.h/1.81/Thu Jan 22 21:17:09 2004//
 /mbdump.c/1.30/Sat May 22 03:45:51 2004//
 /mbdump.h/1.4/Thu Feb 13 20:15:27 2003//
 /mbexamine.c/1.11/Fri Dec 17 16:32:16 2004//
-/mboxlist.c/1.240/Mon Jul 26 18:08:03 2004//
+/mboxlist.c/1.241/Tue Nov 22 18:20:51 2005//
 /mboxlist.h/1.39/Wed Mar 17 18:07:49 2004//
 /mboxname.c/1.36/Mon Feb 14 06:39:57 2005//
 /mboxname.h/1.13/Fri Mar 19 14:49:17 2004//
-/mbpath.c/1.18/Wed Jun  2 17:35:08 2004//
+/mbpath.c/1.19/Sat Feb 25 18:31:51 2006//
 /message.c/1.99/Thu Sep 16 17:58:54 2004//
 /message.h/1.6/Thu Feb 13 20:15:28 2003//
-/mupdate-client.c/1.46/Wed Aug 25 15:35:41 2004//
-/mupdate-client.h/1.14/Mon Mar  8 17:31:05 2004//
-/mupdate-slave.c/1.26/Mon Mar  8 19:23:04 2004//
-/mupdate.c/1.89/Fri Dec 17 16:32:16 2004//
+/mupdate-client.c/1.47/Wed Nov 23 13:40:09 2005//
+/mupdate-client.h/1.15/Wed Nov 23 13:40:09 2005//
+/mupdate-slave.c/1.27/Wed Nov 23 13:40:09 2005//
+/mupdate.c/1.92/Fri Nov  4 13:33:30 2005//
 /mupdate.h/1.16/Wed Dec 10 16:07:03 2003//
 /mupdate_err.et/1.5/Wed Mar 20 23:03:06 2002//
 /mutex.h/1.2/Wed Oct 22 18:02:58 2003//
 /mutex_fake.c/1.2/Wed Oct 22 18:02:58 2003//
 /mutex_pthread.c/1.2/Wed Oct 22 18:02:58 2003//
 /nntp_err.et/1.2/Wed Oct 22 18:02:58 2003//
-/nntpd.c/1.43/Fri Jan  7 20:59:04 2005//
+/nntpd.c/1.51/Tue Dec 13 15:18:55 2005//
 /notify.c/1.13/Wed Oct 22 18:50:08 2003//
 /notify.h/1.7/Wed Oct 22 18:50:08 2003//
-/pop3d.c/1.166/Tue Jan  4 15:06:13 2005//
+/pop3d.c/1.167/Mon Apr 11 06:57:35 2005//
 /proc.c/1.25/Wed Oct 22 18:50:08 2003//
 /protocol.c/1.13/Tue Dec  7 19:26:24 2004//
 /protocol.h/1.5/Thu May  6 18:52:07 2004//
-/proxyd.c/1.192/Fri Dec 17 16:32:20 2004//
+/proxyd.c/1.199/Tue Feb  7 20:57:27 2006//
 /pushstats.snmp/1.10/Wed Mar  6 20:49:03 2002//
-/quota.c/1.57/Wed Jun 30 19:23:26 2004//
+/quota.c/1.65/Fri May 27 16:49:13 2005//
 /quota.h/1.2/Fri Feb 27 17:44:56 2004//
 /quota_db.c/1.2/Sat May 22 03:45:52 2004//
 /reconstruct.c/1.88/Mon Oct 11 14:01:24 2004//
@@ -92,10 +93,10 @@
 /setproctitle.c/1.16/Thu Feb 13 20:15:30 2003//
 /signals.c/1.13/Mon Feb 14 16:26:50 2005//
 /signals.h/1.1/Fri Dec 17 16:32:22 2004//
-/smmapd.c/1.11/Fri Dec 17 16:32:22 2004//
+/smmapd.c/1.13/Wed Apr 13 15:42:04 2005//
 /smtpclient.c/1.2/Wed Oct 22 18:02:59 2003//
 /smtpclient.h/1.2/Wed Oct 22 18:02:59 2003//
-/spool.c/1.7/Wed Oct 27 20:40:50 2004//
+/spool.c/1.8/Mon Oct 24 12:57:59 2005//
 /spool.h/1.4/Thu Mar  4 16:09:35 2004//
 /squat.c/1.7/Fri Feb 27 17:44:56 2004//
 /squat.h/1.2/Thu Feb 13 20:15:31 2003//
@@ -106,12 +107,12 @@
 /syncnews.c/1.26/Sat May 22 03:45:52 2004//
 /telemetry.c/1.8/Wed Oct 22 18:50:08 2003//
 /telemetry.h/1.3/Tue Jul 22 19:17:20 2003//
-/tls.c/1.50/Tue May  4 19:47:34 2004//
+/tls.c/1.51/Fri Oct 28 14:45:19 2005//
 /tls.h/1.18/Wed Oct 22 18:50:09 2003//
 /tls_prune.c/1.6/Mon Jan 26 17:46:58 2004//
 /user.c/1.20/Tue Jun 22 16:59:17 2004//
 /user.h/1.6/Wed Oct 22 18:50:09 2003//
-/version.c/1.18/Mon Jun 21 15:31:13 2004//
-/version.h/1.139/Mon Feb 14 16:43:51 2005//
+/version.c/1.19/Wed Feb 16 20:37:58 2005//
+/version.h/1.140/Wed Mar 29 19:08:06 2006//
 /xversion.sh/1.7/Wed Oct 22 18:03:00 2003//
 D

Modified: trunk/cyrus-imapd-2.2/imap/annotate.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/annotate.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/annotate.c (original)
+++ trunk/cyrus-imapd-2.2/imap/annotate.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  *
  */
 /*
- * $Id: annotate.c,v 1.28 2005/02/14 06:39:54 shadow Exp $
+ * $Id: annotate.c,v 1.32 2005/10/31 17:08:59 ken3 Exp $
  */
 
 #include <config.h>
@@ -789,6 +789,62 @@
     output_entryatt(ext_mboxname, entry, "", &attrib, fdata);
 }
 
+static void annotation_get_lastpop(const char *int_mboxname,
+                                 const char *ext_mboxname,
+                                 const char *entry,
+                                 struct fetchdata *fdata,
+                                 struct mailbox_annotation_rock *mbrock,
+                                 void *rock __attribute__((unused)))
+{ 
+    struct mailbox mailbox;
+    int r = 0;
+    char value[40];
+    struct annotation_data attrib;
+  
+    if(!int_mboxname || !ext_mboxname || !fdata || !mbrock)
+
+      fatal("annotation_get_lastpop called with bad parameters",
+              EC_TEMPFAIL);
+
+    get_mb_data(int_mboxname, mbrock);
+
+    /* Check ACL */
+    if(!fdata->isadmin &&
+       (!mbrock->acl ||
+      !(cyrus_acl_myrights(fdata->auth_state, mbrock->acl) & ACL_LOOKUP) ||
+      !(cyrus_acl_myrights(fdata->auth_state, mbrock->acl) & ACL_READ)))
+      return;
+
+
+    if (mailbox_open_header(int_mboxname, 0, &mailbox) != 0)
+      return;
+
+    if (!r) {
+      r = mailbox_open_index(&mailbox);
+    }
+
+    if (!r) {
+      if (mailbox.pop3_last_login == 0) {
+          strcpy (value, " ");
+      } else {
+          cyrus_ctime(mailbox.pop3_last_login, value);
+      }
+    }
+
+    mailbox_close(&mailbox);
+
+    if ( r)
+      return;
+
+    memset(&attrib, 0, sizeof(attrib));
+
+    attrib.value = value;
+    attrib.size = strlen(value);
+    attrib.contenttype = "text/plain";
+
+    output_entryatt(ext_mboxname, entry, "", &attrib, fdata);
+}
+
 struct rw_rock {
     const char *ext_mboxname;
     struct fetchdata *fdata;
@@ -874,6 +930,8 @@
       annotation_get_size, NULL },
     { "/vendor/cmu/cyrus-imapd/lastupdate", BACKEND_ONLY,
       annotation_get_lastupdate, NULL },
+    { "/vendor/cmu/cyrus-imapd/lastpop", BACKEND_ONLY,
+      annotation_get_lastpop, NULL },
     { NULL, ANNOTATION_PROXY_T_INVALID, NULL, NULL }
 };
 
@@ -983,7 +1041,7 @@
 					  (void*) entries_ptr->entrypat));
     }
 
-    if (proxy_fetch_func && fdata->orig_entry
+    if (proxy_fetch_func && fdata->orig_entry && mbrock.server
 	&& !hash_lookup(mbrock.server, &(fdata->server_table))) {
 	/* xxx ignoring result */
 	proxy_fetch_func(mbrock.server, fdata->orig_mailbox,
@@ -1601,6 +1659,9 @@
       ATTRIB_VALUE_SHARED | ATTRIB_CONTENTTYPE_SHARED,
       ACL_ADMIN, annotation_set_todb, NULL },
     { "/vendor/cmu/cyrus-imapd/news2mail", ATTRIB_TYPE_STRING, BACKEND_ONLY,
+      ATTRIB_VALUE_SHARED | ATTRIB_CONTENTTYPE_SHARED,
+      ACL_ADMIN, annotation_set_todb, NULL },
+    { "/vendor/cmu/cyrus-imapd/sieve", ATTRIB_TYPE_STRING, BACKEND_ONLY,
       ATTRIB_VALUE_SHARED | ATTRIB_CONTENTTYPE_SHARED,
       ACL_ADMIN, annotation_set_todb, NULL },
     { NULL, 0, ANNOTATION_PROXY_T_INVALID, 0, 0, NULL, NULL }

Modified: trunk/cyrus-imapd-2.2/imap/append.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/append.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/append.c (original)
+++ trunk/cyrus-imapd-2.2/imap/append.c Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* append.c -- Routines for appending messages to a mailbox
- * $Id: append.c,v 1.107 2004/05/22 03:45:48 rjs3 Exp $
+ * $Id: append.c,v 1.108 2005/06/02 15:47:50 ken3 Exp $
  *
  * Copyright (c)1998, 2000 Carnegie Mellon University.  All rights reserved.
  *
@@ -801,7 +801,8 @@
 int append_copy(struct mailbox *mailbox, 
 		struct appendstate *as,
 		int nummsg, 
-		struct copymsg *copymsg)
+		struct copymsg *copymsg,
+		int nolink)
 {
     struct mailbox *append_mailbox = &as->m;
     int msg;
@@ -845,7 +846,7 @@
 	    mailbox_message_get_fname(mailbox, copymsg[msg].uid, fnamebuf,
 				      sizeof(fnamebuf));
 	    /* Link/copy message file */
-	    r = mailbox_copyfile(fnamebuf, fname, 0);
+	    r = mailbox_copyfile(fnamebuf, fname, nolink);
 	    if (r) goto fail;
 
 	    /* Write out cache info, copy other info */

Modified: trunk/cyrus-imapd-2.2/imap/append.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/append.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/append.h (original)
+++ trunk/cyrus-imapd-2.2/imap/append.h Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* append.h -- Description of messages to be copied 
- * $Id: append.h,v 1.26 2004/01/22 21:17:07 ken3 Exp $ 
+ * $Id: append.h,v 1.27 2005/06/02 15:47:51 ken3 Exp $ 
  *
  * Copyright (c) 1998, 2000 Carnegie Mellon University.  All rights reserved.
  *
@@ -137,7 +137,7 @@
 
 extern int append_copy(struct mailbox *mailbox,
 		       struct appendstate *append_mailbox,
-		       int nummsg, struct copymsg *copymsg);
+		       int nummsg, struct copymsg *copymsg, int nolink);
 
 extern int append_collectnews(struct appendstate *mailbox,
 			      const char *group, unsigned long feeduid);

Modified: trunk/cyrus-imapd-2.2/imap/arbitron.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/arbitron.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/arbitron.c (original)
+++ trunk/cyrus-imapd-2.2/imap/arbitron.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: arbitron.c,v 1.35 2004/05/22 03:45:48 rjs3 Exp $ */
+/* $Id: arbitron.c,v 1.39 2006/01/13 16:47:18 murch Exp $ */
 
 #include <config.h>
 
@@ -80,17 +80,26 @@
 
 /* Maintain the mailbox list */
 /* xxx it'd be nice to generate a subscriber list too */
+struct user_list {
+    const char *user;
+    struct user_list *next;
+};
+
 struct arb_mailbox_data {
-    int readers;
-    int subscribers;
+    int nreaders;
+    struct user_list *readers;
+    int nsubscribers;
+    struct user_list *subscribers;
 };
 
 struct mpool *arb_pool;
 hash_table mailbox_table, mboxname_table;
 
-time_t report_time, prune_time = 0;
+time_t report_start_time = -1, report_end_time, prune_time = 0;
 int code = 0;
 int dosubs = 1;
+int dousers = 0;
+int long_report = 0;
 
 /* current namespace */
 static struct namespace arb_namespace;
@@ -99,8 +108,8 @@
 void usage(void);
 void run_users(void);
 void make_report(char *key, void *data, void *rock);
-void process_seen(const char *path);
-void process_subs(const char *path);
+void process_seen(const char *path, const char *user);
+void process_subs(const char *path, const char *user);
 int do_mailbox(const char *name, int matchlen, int maycreate, void *rock);
 
 int main(int argc,char **argv)
@@ -110,29 +119,69 @@
     int prune_months = 0;
     char pattern[MAX_MAILBOX_NAME+1];
     char *alt_config = NULL;
+    time_t now = time(0);
 
     strcpy(pattern, "*");
 
     if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
 
-    while ((opt = getopt(argc, argv, "C:od:p:")) != EOF) {
+    report_end_time = now;
+
+    while ((opt = getopt(argc, argv, "C:oud:D:p:l")) != EOF) {
 	switch (opt) {
 	case 'C': /* alt config file */
 	    alt_config = optarg;
 	    break;
 
 	case 'd':
+	    if (report_start_time != -1) usage();
 	    report_days = atoi(optarg);
 	    if (report_days <= 0) usage();
 	    break;
 
+	case 'D': {
+	    unsigned  month, day, year;
+	    struct tm date;
+
+	    if (strlen(optarg) < 8 ||
+		sscanf(optarg, "%02u%02u%04u", &month, &day, &year) < 3) {
+		usage();
+	    }
+	    memset(&date, 0, sizeof(struct tm));
+	    date.tm_mon = month - 1;
+	    date.tm_mday = day;
+	    date.tm_year = year - 1900;
+	    report_start_time = mktime(&date);
+
+	    if (optarg[8] == ':' && strlen(optarg+9) == 8) {
+		if (sscanf(optarg+9, "%02u%02u%04u", &month, &day, &year) < 3) {
+		    usage();
+		}
+		memset(&date, 0, sizeof(struct tm));
+		date.tm_mon = month - 1;
+		date.tm_mday = day;
+		date.tm_year = year - 1900;
+		report_end_time = mktime(&date);
+	    }
+
+	    break;
+	}
+
 	case 'o':
 	    dosubs = 0;
+	    break;
+
+	case 'u':
+	    dousers = 1;
 	    break;
 
 	case 'p':
 	    prune_months = atoi(optarg);
 	    if (prune_months <= 0) usage();
+	    break;
+
+	case 'l':
+	    long_report = dousers = 1;
 	    break;
 
 	default:
@@ -154,9 +203,11 @@
 
     if (optind != argc) strlcpy(pattern, argv[optind], sizeof(pattern));
 
-    report_time = time(0) - (report_days*60*60*24);
+    if (report_start_time == -1) {
+	report_start_time = now - (report_days*60*60*24);
+    }
     if (prune_months) {
-	prune_time = time(0) - (prune_months*60*60*24*31);
+	prune_time = now - (prune_months*60*60*24*31);
     }
 
     /* Allocate our shared memory pools */
@@ -177,7 +228,7 @@
     /* Now do all the users */
     run_users();
 
-    fprintf(stderr, "\n");    
+    fprintf(stderr, "Done\n");    
 
     /* And print the report */
     hash_enumerate(&mboxname_table, make_report, NULL);    
@@ -197,8 +248,9 @@
 void usage(void)
 {
     fprintf(stderr,
-	    "usage: arbitron [-o] [-C alt_config] [-d days]"
-	    " [-p months] [mboxpattern]\n");
+	    "usage: arbitron [-o] [-u] [-l] [-C alt_config] "
+	    "[-d days | -D mmddyyy[:mmddyyyy]]\n"
+            "                [-p months] [mboxpattern]\n");
     exit(EC_USAGE);
 }    
 
@@ -214,8 +266,8 @@
 	struct arb_mailbox_data *d = mpool_malloc(arb_pool,
 						  sizeof(struct arb_mailbox_data));
     
-	d->readers = 0;
-	d->subscribers = 0;
+	d->nreaders = 0;
+	d->nsubscribers = 0;
 
 /*	printf("inserting %s (key %s)\n", name, mbox.uniqueid); */
 
@@ -266,15 +318,25 @@
 	        /* 5 is magic number for strlen(".seen") and
 		   4 is the magic number for strlen(".sub") */
 		if(len > 4) {
+		    char *user = NULL;
+
 		    snprintf(file, sizeof(file),
 			     "%s/%s", path, dirent2->d_name);
 /*		    printf("got file %s\n",file); */
 		    if(len > 5 &&
 		       !strcmp(dirent2->d_name + len - 5, ".seen")) {
-			process_seen(file);
+			if (dousers) {
+			    user = mpool_strndup(arb_pool, dirent2->d_name,
+						 len-5);
+			}
+			process_seen(file, user);
 		    } else if (dosubs &&
 			       !strcmp(dirent2->d_name + len - 4, ".sub")) {
-			process_subs(file);		    
+			if (dousers) {
+			    user = mpool_strndup(arb_pool, dirent2->d_name,
+						 len-4);
+			}
+			process_subs(file, user);
 		    }
 		}
 	    }
@@ -300,7 +362,7 @@
 }
 
 /* We can cheat and do all we need to in this function */
-static int process_user_p(void *rockp __attribute__((unused)),
+static int process_user_p(void *rockp,
 			  const char *key,
 			  int keylen,
 			  const char *data,
@@ -311,6 +373,7 @@
     char *p;    
     char buf[64];
     struct arb_mailbox_data *mbox;
+    const char *user = (const char *) rockp;
 
     /* remember that 'data' may not be null terminated ! */
     version = strtol(data, &p, 10); data = p;
@@ -322,9 +385,18 @@
 
     mbox = hash_lookup(buf, &mailbox_table);
 
-    if(mbox && lastread >= report_time) {
+    if(mbox && lastread >= report_start_time &&
+       lastread <= report_end_time) {
 /*	printf("got %s\n", mbox->name);	     */
-	mbox->readers++;
+	mbox->nreaders++;
+	if (user) {
+	    struct user_list *u = mpool_malloc(arb_pool,
+					       sizeof(struct user_list));
+
+	    u->user = user;
+	    u->next = mbox->readers;
+	    mbox->readers = u;
+	}
     }
 
     /* Check for pruning even if mailbox isn't valid */
@@ -336,7 +408,7 @@
     return ret;    
 }
 
-void process_seen(const char *path) 
+void process_seen(const char *path, const char *user) 
 {
     int r;    
     struct db *tmp = NULL;
@@ -344,7 +416,8 @@
     r = DB->open(path, 0, &tmp);
     if(r) goto done;
     
-    DB->foreach(tmp, "", 0, process_user_p, process_user_cb, tmp, NULL);
+    DB->foreach(tmp, "", 0, process_user_p, process_user_cb,
+		(void *) user, NULL);
 
  done:
     if(tmp) DB->close(tmp);
@@ -359,13 +432,14 @@
     return 0;
 }
 
-static int process_subs_p(void *rockp __attribute__((unused)),
+static int process_subs_p(void *rockp,
 			  const char *key, int keylen,
 			  const char *tmpdata __attribute__((unused)),
 			  int tmpdatalen __attribute__((unused))) 
 {
     struct arb_mailbox_data *mbox;
     char buf[MAX_MAILBOX_NAME+1];
+    const char *user = (const char *) rockp;
 
     memcpy(buf, key, keylen);
     buf[keylen] = '\0';
@@ -376,13 +450,21 @@
 
     if(mbox) {
 /*	printf("got sub %s\n", buf); */
-	mbox->subscribers++;
+	mbox->nsubscribers++;
+	if (user) {
+	    struct user_list *u = mpool_malloc(arb_pool,
+					       sizeof(struct user_list));
+
+	    u->user = user;
+	    u->next = mbox->subscribers;
+	    mbox->subscribers = u;
+	}
     }
 
     return 0; /* never do callback */
 }
 
-void process_subs(const char *path) 
+void process_subs(const char *path, const char *user) 
 {
     int r;    
     struct db *tmp = NULL;
@@ -390,23 +472,63 @@
     r = SUBDB->open(path, 0, &tmp);
     if(r) goto done;
     
-    SUBDB->foreach(tmp, "", 0, process_subs_p, process_subs_cb, NULL, NULL);
+    SUBDB->foreach(tmp, "", 0, process_subs_p, process_subs_cb,
+		   (void *) user, NULL);
 
  done:
     if(tmp) SUBDB->close(tmp);
 }
 
+void report_users(struct user_list *u)
+{
+    char sep = ':';
+
+    while (u) {
+	printf("%c%s", sep, u->user);
+	sep = ',';
+	u = u->next;
+    }
+}
+
+void long_report_users(struct user_list *u, const char *mbox, char type)
+{
+    char buf[100];
+    struct tm *tm;
+
+    while (u) {
+	printf("%s,%s,%c,", mbox, u->user, type);
+	tm = localtime(&report_start_time);
+	strftime(buf, sizeof(buf), "%m-%d-%Y %H:%M:%S", tm);
+	printf("%s,", buf);
+
+	tm = localtime(&report_end_time);
+	strftime(buf, sizeof(buf), "%m-%d-%Y %H:%M:%S", tm);
+	printf("%s\n", buf);
+	u = u->next;
+    }
+}
+
 void make_report(char *key, void *data, void *rock __attribute__((unused))) 
 {
     struct arb_mailbox_data *mbox = (struct arb_mailbox_data *)data;
 
     /* Skip underread user mailboxes */
-    if(!strncasecmp(key, "user.", 5) && mbox->readers <= 1)
+    if(!strncasecmp(key, "user.", 5) && mbox->nreaders <= 1)
 	return;    
 
     mboxname_hiersep_toexternal(&arb_namespace, key, 0);
 
-    printf("%s %d", key, mbox->readers);
-    if(dosubs) printf(" %d", mbox->subscribers);
-    printf("\n");   
-}
+    if (long_report) {
+	long_report_users(mbox->readers, key, 'r');
+	long_report_users(mbox->subscribers, key, 's');
+    }
+    else {
+	printf("%s %d", key, mbox->nreaders);
+	if (dousers) report_users(mbox->readers);
+	if (dosubs) {
+	    printf(" %d", mbox->nsubscribers);
+	if (dousers) report_users(mbox->subscribers);
+	}
+	printf("\n");
+    }
+}

Modified: trunk/cyrus-imapd-2.2/imap/backend.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/backend.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/backend.c (original)
+++ trunk/cyrus-imapd-2.2/imap/backend.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: backend.c,v 1.35 2005/02/14 06:39:55 shadow Exp $ */
+/* $Id: backend.c,v 1.39 2006/02/07 20:57:27 murch Exp $ */
 
 #include <config.h>
 
@@ -200,7 +200,7 @@
 	return r;
     }
 
-    secprops = mysasl_secprops(0);
+    secprops = mysasl_secprops(SASL_SEC_NOPLAINTEXT);
     r = sasl_setprop(s->saslconn, SASL_SEC_PROPS, secprops);
     if (r != SASL_OK) {
 	return r;
@@ -271,8 +271,8 @@
     /* need to (re)establish connection to server or create one */
     int sock = -1;
     int r;
-    int err;
-    struct addrinfo hints, *res0 = NULL, *res;
+    int err = 0;
+    struct addrinfo hints, *res0 = NULL, *res1 = NULL, *res;
     struct sockaddr_un sunsock;
     char buf[2048], *mechlist = NULL;
     struct sigaction action;
@@ -315,6 +315,12 @@
 	    free(ret);
 	    return NULL;
 	}
+        /* Get addrinfo struct for local interface. */
+        err = getaddrinfo(config_servername, NULL, &hints, &res1);
+        if(err) {
+            syslog(LOG_ERR, "getaddrinfo(%s) failed: %s",
+                   config_servername, gai_strerror(err));
+        }
     }
 
     /* Setup timeout */
@@ -331,6 +337,15 @@
 	sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
 	if (sock < 0)
 	    continue;
+        /* Bind to local interface. */
+        if (!err) {
+            if (bind(sock, res1->ai_addr, res1->ai_addrlen) < 0) {
+                struct sockaddr_in *local_sockaddr = (struct sockaddr_in *) res1->ai_addr;
+                syslog(LOG_ERR, "failed to bind to address %s: %s",
+                       inet_ntoa(local_sockaddr->sin_addr), strerror(errno));
+            }
+            freeaddrinfo(res1);
+        }
 	alarm(config_getint(IMAPOPT_CLIENT_TIMEOUT));
 	if (connect(sock, res->ai_addr, res->ai_addrlen) >= 0)
 	    break;
@@ -420,13 +435,14 @@
 	if (prot && prot->logout_cmd.cmd) {
 	    prot_printf(s->out, "%s\r\n", prot->logout_cmd.cmd);
 	    prot_flush(s->out);
-
+#if 0  /* XXX  don't care about response -- we may not get one */
 	    while (prot_fgets(buf, sizeof(buf), s->in)) {
 		if (!strncmp(prot->logout_cmd.resp, buf,
 			     strlen(prot->logout_cmd.resp))) {
 		    break;
 		}
 	    }
+#endif
 	}
 
 	/* Flush the incoming buffer */

Modified: trunk/cyrus-imapd-2.2/imap/backend.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/backend.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/backend.h (original)
+++ trunk/cyrus-imapd-2.2/imap/backend.h Fri Mar 31 20:18:13 2006
@@ -39,19 +39,18 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: backend.h,v 1.11 2004/02/04 01:42:38 ken3 Exp $ */
+/* $Id: backend.h,v 1.12 2006/01/12 22:17:57 murch Exp $ */
 
 #ifndef _INCLUDED_BACKEND_H
 #define _INCLUDED_BACKEND_H
 
+#include "global.h"
 #include "mboxlist.h"
 #include "prot.h"
 #include "protocol.h"
 #include "tls.h"
 
 /* Functionality to bring up/down connections to backend servers */
-
-#define LAST_RESULT_LEN 1024
 
 struct backend {
     char hostname[MAX_PARTITION_LEN];
@@ -72,7 +71,7 @@
 
     unsigned long capability;
 
-    char last_result[LAST_RESULT_LEN];
+    struct buf last_result;
     struct protstream *in; /* from the be server to me, the proxy */
     struct protstream *out; /* to the be server */
 };

Modified: trunk/cyrus-imapd-2.2/imap/ctl_cyrusdb.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/ctl_cyrusdb.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/ctl_cyrusdb.c (original)
+++ trunk/cyrus-imapd-2.2/imap/ctl_cyrusdb.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ctl_cyrusdb.c,v 1.26 2004/07/13 02:34:20 ken3 Exp $
+ * $Id: ctl_cyrusdb.c,v 1.27 2005/02/16 20:37:58 shadow Exp $
  */
 
 #include <config.h>
@@ -99,9 +99,7 @@
     { FNAME_ANNOTATIONS,	&config_annotation_db,	1 },
     { FNAME_DELIVERDB,		&config_duplicate_db,	0 },
     { FNAME_TLSSESSIONS,	&config_tlscache_db,	0 },
-#ifdef WITH_PTS
     { FNAME_PTSDB,              &config_ptscache_db,    0 },
-#endif
     { NULL,			NULL,			0 }
 };
 

Modified: trunk/cyrus-imapd-2.2/imap/ctl_mboxlist.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/ctl_mboxlist.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/ctl_mboxlist.c (original)
+++ trunk/cyrus-imapd-2.2/imap/ctl_mboxlist.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  *
  */
 
-/* $Id: ctl_mboxlist.c,v 1.48 2004/05/22 03:45:48 rjs3 Exp $ */
+/* $Id: ctl_mboxlist.c,v 1.49 2005/11/23 13:40:08 murch Exp $ */
 
 /* currently doesn't catch signals; probably SHOULD */
 
@@ -61,7 +61,7 @@
 #include "global.h"
 #include "libcyr_cfg.h"
 #include "mboxlist.h"
-#include "mupdate-client.h"
+#include "mupdate.h"
 #include "xmalloc.h"
 
 /* config.c stuff */

Modified: trunk/cyrus-imapd-2.2/imap/fetchnews.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/fetchnews.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/fetchnews.c (original)
+++ trunk/cyrus-imapd-2.2/imap/fetchnews.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: fetchnews.c,v 1.12 2005/02/14 06:39:55 shadow Exp $
+ * $Id: fetchnews.c,v 1.14 2005/03/23 00:40:11 shadow Exp $
  */
 
 #include <config.h>
@@ -125,7 +125,7 @@
 void usage(void)
 {
     fprintf(stderr,
-	    "fetchnews [-C <altconfig>] [-s <server>] [-n] [-w <wildmat>] [-f <tstamp file>]\n"
+	    "fetchnews [-C <altconfig>] [-s <server>] [-n] [-y] [-w <wildmat>] [-f <tstamp file>]\n"
 	    "          [-a <authname> [-p <password>]] <peer>\n");
     exit(-1);
 }
@@ -262,13 +262,13 @@
     char sfile[1024] = "";
     int fd = -1, i, n, offered, rejected, accepted, failed;
     time_t stamp;
-    struct tm *tm;
     char **resp = NULL;
     int newnews = 1;
+    char *datefmt = "%y%m%d %H%M%S";
 
     if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
 
-    while ((opt = getopt(argc, argv, "C:s:w:f:a:p:n")) != EOF) {
+    while ((opt = getopt(argc, argv, "C:s:w:f:a:p:n:y")) != EOF) {
 	switch (opt) {
 	case 'C': /* alt config file */
 	    alt_config = optarg;
@@ -301,6 +301,10 @@
 	case 'n': /* no newnews */
 	    newnews = 0;
 	    break;
+	
+	case 'y': /* newsserver is y2k compliant */
+	    datefmt = "%Y%m%d %H%M%S";
+	    break;
 
 	default:
 	    usage();
@@ -367,6 +371,24 @@
     prot_fgets(buf, sizeof(buf), pin);
 
     if (newnews) {
+	struct tm ctime, *ptime;
+
+	/* fetch the server's current time */
+	prot_printf(pout, "DATE\r\n");
+
+	if (!prot_fgets(buf, sizeof(buf), pin) || strncmp("111 ", buf, 4)) {
+	    syslog(LOG_ERR, "error fetching DATE");
+	    goto quit;
+	}
+
+	/* parse and normalize the server time */
+	memset(&ctime, 0, sizeof(struct tm));
+	sscanf(buf+4, "%4d%02d%02d%02d%02d%02d",
+	       &ctime.tm_year, &ctime.tm_mon, &ctime.tm_mday,
+	       &ctime.tm_hour, &ctime.tm_min, &ctime.tm_sec);
+	ctime.tm_year -= 1900;
+	ctime.tm_mon--;
+
 	/* read the previous timestamp */
 	if (!sfile[0]) {
 	    char oldfile[1024];
@@ -393,8 +415,9 @@
 	}
 
 	/* ask for new articles */
-	tm = gmtime(&stamp);
-	strftime(buf, sizeof(buf), "%Y%m%d %H%M%S", tm);
+	if (stamp) stamp -= 180; /* adjust back 3 minutes */
+	ptime = gmtime(&stamp);
+	strftime(buf, sizeof(buf), datefmt, ptime);
 	prot_printf(pout, "NEWNEWS %s %s GMT\r\n", wildmat, buf);
 	
 	if (!prot_fgets(buf, sizeof(buf), pin) || strncmp("230", buf, 3)) {
@@ -402,7 +425,15 @@
 	    newnews = 0;
 	}
 
-	stamp = time(NULL);
+	/* prepare server's current time as new timestamp */
+	stamp = mktime(&ctime);
+	/* adjust for local timezone
+
+	   XXX  We need to do this because we use gmtime() above.
+	   We can't change this, otherwise we'd be incompatible
+	   with an old localtime timestamp.
+	*/
+	stamp -= timezone;
     }
 
     if (!newnews) {

Modified: trunk/cyrus-imapd-2.2/imap/fud.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/fud.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/fud.c (original)
+++ trunk/cyrus-imapd-2.2/imap/fud.c Fri Mar 31 20:18:13 2006
@@ -42,7 +42,7 @@
 
 #include <config.h>
 
-/* $Id: fud.c,v 1.52 2004/12/17 16:32:07 ken3 Exp $ */
+/* $Id: fud.c,v 1.53 2005/04/13 15:42:04 shadow Exp $ */
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -202,6 +202,7 @@
     r = begin_handling();
 
     shut_down(r);
+    return 0;
 }
 
 static void cyrus_timeout(int signo __attribute__((unused)))

Modified: trunk/cyrus-imapd-2.2/imap/global.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/global.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/global.c (original)
+++ trunk/cyrus-imapd-2.2/imap/global.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  *
  */
 
-/* $Id: global.c,v 1.17 2004/11/23 17:40:15 shadow Exp $ */
+/* $Id: global.c,v 1.19 2005/03/03 15:59:12 shadow Exp $ */
 
 #include <config.h>
 
@@ -89,9 +89,7 @@
 struct cyrusdb_backend *config_seenstate_db;
 struct cyrusdb_backend *config_duplicate_db;
 struct cyrusdb_backend *config_tlscache_db;
-#ifdef WITH_PTS
 struct cyrusdb_backend *config_ptscache_db;
-#endif
 
 /* Called before a cyrus application starts (but after command line parameters
  * are read) */
@@ -179,10 +177,8 @@
 	    cyrusdb_fromname(config_getstring(IMAPOPT_DUPLICATE_DB));
 	config_tlscache_db =
 	    cyrusdb_fromname(config_getstring(IMAPOPT_TLSCACHE_DB));
-#ifdef WITH_PTS
 	config_ptscache_db =
 	    cyrusdb_fromname(config_getstring(IMAPOPT_PTSCACHE_DB));
-#endif
 
 	/* configure libcyrus as needed */
 	libcyrus_config_setstring(CYRUSOPT_CONFIG_DIR, config_dir);
@@ -206,6 +202,8 @@
 				  config_getenum(IMAPOPT_VIRTDOMAINS));
 	libcyrus_config_setint(CYRUSOPT_BERKELEY_CACHESIZE,
 			       config_getint(IMAPOPT_BERKELEY_CACHESIZE));
+	libcyrus_config_setstring(CYRUSOPT_AUTH_MECH,
+				  config_getstring(IMAPOPT_AUTH_MECH));
 	libcyrus_config_setint(CYRUSOPT_BERKELEY_LOCKS_MAX,
 			       config_getint(IMAPOPT_BERKELEY_LOCKS_MAX));
 	libcyrus_config_setint(CYRUSOPT_BERKELEY_TXNS_MAX,
@@ -244,7 +242,7 @@
     }
 
     if(server && sasl_server_init(callbacks, "Cyrus")) {
-	fatal("could not init sasl (client)", EC_SOFTWARE);
+	fatal("could not init sasl (server)", EC_SOFTWARE);
     }
 }
 

Modified: trunk/cyrus-imapd-2.2/imap/global.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/global.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/global.h (original)
+++ trunk/cyrus-imapd-2.2/imap/global.h Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* global.h -- Header for global/shared variables & functions.
- * $Id: global.h,v 1.6 2004/12/17 16:32:08 ken3 Exp $
+ * $Id: global.h,v 1.7 2005/02/16 20:37:58 shadow Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -150,8 +150,6 @@
 extern struct cyrusdb_backend *config_seenstate_db;
 extern struct cyrusdb_backend *config_duplicate_db;
 extern struct cyrusdb_backend *config_tlscache_db;
-#ifdef WITH_PTS
 extern struct cyrusdb_backend *config_ptscache_db;
-#endif
 
 #endif /* INCLUDED_GLOBAL_H */

Modified: trunk/cyrus-imapd-2.2/imap/idle.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/idle.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/idle.h (original)
+++ trunk/cyrus-imapd-2.2/imap/idle.h Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: idle.h,v 1.6 2003/10/22 20:05:10 ken3 Exp $ */
+/* $Id: idle.h,v 1.7 2005/12/09 16:12:50 murch Exp $ */
 
 #ifndef IDLE_H
 #define IDLE_H
@@ -58,11 +58,14 @@
 /* Is IDLE enabled?  Can also do initial setup, if necessary */
 int idle_enabled(void);
 
-/* Setup for IDLE on 'mailbox'.
- * Accepts pointer to a function which reports mailbox updates and/or
+/* Setup for IDLE.
+ * 'proc' is a pointer to a function which reports mailbox updates and/or
  * ALERTs to the client.
  */
-int idle_init(struct mailbox *mailbox, idle_updateproc_t *proc);
+int idle_init(idle_updateproc_t *proc);
+
+/* Start IDLEing on 'mailbox'. */
+void idle_start(struct mailbox *mailbox);
 
 /* Cleanup when IDLE is completed. */
 void idle_done(struct mailbox *mailbox);

Modified: trunk/cyrus-imapd-2.2/imap/idle_idled.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/idle_idled.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/idle_idled.c (original)
+++ trunk/cyrus-imapd-2.2/imap/idle_idled.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: idle_idled.c,v 1.14 2003/10/22 20:05:11 ken3 Exp $ */
+/* $Id: idle_idled.c,v 1.16 2005/12/09 21:09:14 murch Exp $ */
 
 #include <config.h>
 
@@ -65,6 +65,7 @@
 
 /* how often to poll the mailbox */
 static time_t idle_period = -1;
+static int idle_started = 0;
 
 /* UNIX socket variables */
 static int notify_sock = -1;
@@ -136,6 +137,9 @@
 
 static void idle_poll(int sig)
 {
+    /* ignore the signals, unless the server has started idling */
+    if (!idle_started) return;
+
     switch (sig) {
     case SIGUSR1:
 	idle_update(IDLE_MAILBOX);
@@ -150,38 +154,45 @@
     }
 }
 
-int idle_init(struct mailbox *mailbox, idle_updateproc_t *proc)
+int idle_init(idle_updateproc_t *proc)
 {
     struct sigaction action;
 
     idle_update = proc;
 
+    /* We don't want recursive calls to idle_update() */
     sigemptyset(&action.sa_mask);
+    sigaddset(&action.sa_mask, SIGUSR1);
+    sigaddset(&action.sa_mask, SIGUSR2);
     action.sa_flags = 0;
 #ifdef SA_RESTART
     action.sa_flags |= SA_RESTART;
 #endif
     action.sa_handler = idle_poll;
 
+    /* Setup the signal handlers */
+    if ((sigaction(SIGUSR1, &action, NULL) < 0) ||
+	(sigaction(SIGUSR2, &action, NULL) < 0) ||
+	(sigaction(SIGALRM, &action, NULL) < 0)) {
+	syslog(LOG_ERR, "sigaction: %m");
+
+	/* Cancel receiving signals */
+	idle_done(NULL);
+	return 0;
+    }
+
+    return 1;
+}
+
+void idle_start(struct mailbox *mailbox)
+{
+    idle_started = 1;
+
     /* Tell idled that we're idling */
-    if (idle_send_msg(IDLE_INIT, mailbox)) {
-	/* if we can talk to idled, setup the signal handlers */
-	if ((sigaction(SIGUSR1, &action, NULL) < 0) ||
-	    (sigaction(SIGUSR2, &action, NULL) < 0)) {
-	    syslog(LOG_ERR, "sigaction: %m");
-	    return 0;
-	}
-    }
-    else { /* otherwise, we'll poll with SIGALRM */
-	if (sigaction(SIGALRM, &action, NULL) < 0) {
-	    syslog(LOG_ERR, "sigaction: %m");
-	    return 0;
-	}
-
+    if (!idle_send_msg(IDLE_INIT, mailbox)) {
+	/* otherwise, we'll poll with SIGALRM */
 	alarm(idle_period);
     }
-
-    return 1;
 }
 
 void idle_done(struct mailbox *mailbox)
@@ -193,6 +204,9 @@
     signal(SIGUSR1, SIG_IGN);
     signal(SIGUSR2, SIG_IGN);
     signal(SIGALRM, SIG_IGN);
+
+    idle_update = NULL;
+    idle_started = 0;
 }
 
 /*

Modified: trunk/cyrus-imapd-2.2/imap/idle_no.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/idle_no.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/idle_no.c (original)
+++ trunk/cyrus-imapd-2.2/imap/idle_no.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: idle_no.c,v 1.5 2003/10/22 20:05:11 ken3 Exp $ */
+/* $Id: idle_no.c,v 1.6 2005/12/09 16:12:50 murch Exp $ */
 
 #include "idle.h"
 
@@ -50,9 +50,13 @@
     return 0;
 }
 
-int idle_init(struct mailbox *mailbox, idle_updateproc_t *proc)
+int idle_init(idle_updateproc_t *proc)
 {
     return 0;
+}
+
+void idle_start(struct mailbox *mailbox)
+{
 }
 
 void idle_done(struct mailbox *mailbox)

Modified: trunk/cyrus-imapd-2.2/imap/idle_poll.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/idle_poll.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/idle_poll.c (original)
+++ trunk/cyrus-imapd-2.2/imap/idle_poll.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: idle_poll.c,v 1.10 2003/10/22 20:05:11 ken3 Exp $ */
+/* $Id: idle_poll.c,v 1.12 2005/12/09 19:15:35 murch Exp $ */
 
 #include <config.h>
 
@@ -78,8 +78,7 @@
     alarm(idle_period);
 }
 
-int idle_init(struct mailbox *mailbox __attribute__((unused)),
-	      idle_updateproc_t *proc)
+int idle_init(idle_updateproc_t *proc)
 {
     struct sigaction action;
 
@@ -95,16 +94,24 @@
     action.sa_handler = idle_poll;
     if (sigaction(SIGALRM, &action, NULL) < 0) {
 	syslog(LOG_ERR, "sigaction: %m");
+
+	/* Cancel receiving signals */
+	idle_done(NULL);
 	return 0;
     }
 
+    return 1;
+}
+
+void idle_start(struct mailbox *mailbox __attribute__((unused)))
+{
     alarm(idle_period);
-
-    return 1;
 }
 
 void idle_done(struct mailbox *mailbox __attribute__((unused)))
 {
     /* Remove the polling function */
     signal(SIGALRM, SIG_IGN);
+
+    idle_update = NULL;
 }

Modified: trunk/cyrus-imapd-2.2/imap/imapd.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/imapd.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/imapd.c (original)
+++ trunk/cyrus-imapd-2.2/imap/imapd.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: imapd.c,v 1.490 2005/02/14 06:39:55 shadow Exp $ */
+/* $Id: imapd.c,v 1.498 2006/01/13 22:06:28 murch Exp $ */
 
 #include <config.h>
 
@@ -118,6 +118,7 @@
 static int imapd_userisproxyadmin = 0;
 static sasl_conn_t *imapd_saslconn; /* the sasl connection context */
 static int imapd_starttls_done = 0; /* have we done a successful starttls? */
+const char *plaintextloginalert = NULL;
 #ifdef HAVE_SSL
 /* our tls connection, if any */
 static SSL *tls_conn = NULL;
@@ -501,6 +502,7 @@
 	imapd_saslconn = NULL;
     }
     imapd_starttls_done = 0;
+    plaintextloginalert = NULL;
 
     if(saslprops.iplocalport) {
 	free(saslprops.iplocalport);
@@ -873,6 +875,12 @@
 	    cmd.s[0] = toupper((unsigned char) cmd.s[0]);
 	for (p = &cmd.s[1]; *p; p++) {
 	    if (isupper((unsigned char) *p)) *p = tolower((unsigned char) *p);
+	}
+
+	if (plaintextloginalert) {
+	    prot_printf(imapd_out, "* OK [ALERT] %s\r\n",
+			plaintextloginalert);
+	    plaintextloginalert = NULL;
 	}
 
 	/* Only Authenticate/Login/Logout/Noop/Capability/Id/Starttls
@@ -1704,7 +1712,6 @@
     struct buf passwdbuf;
     char *passwd;
     const char *reply = NULL;
-    int plaintextloginpause;
     int r;
     
     if (imapd_userid) {
@@ -1819,10 +1826,15 @@
 	       imapd_starttls_done ? "+TLS" : "", 
 	       reply ? reply : "");
 
-	plaintextloginpause = config_getint(IMAPOPT_PLAINTEXTLOGINPAUSE);
-	if (plaintextloginpause != 0 && !imapd_starttls_done) {
-	    /* Apply penalty only if not under layer */
-	    sleep(plaintextloginpause);
+	/* Apply penalty only if not under layer */
+	if (!imapd_starttls_done) {
+	    int plaintextloginpause = config_getint(IMAPOPT_PLAINTEXTLOGINPAUSE);
+	    if (plaintextloginpause) {
+		sleep(plaintextloginpause);
+	    }
+
+	    /* Fetch plaintext login nag message */
+	    plaintextloginalert = config_getstring(IMAPOPT_PLAINTEXTLOGINALERT);
 	}
     }
     
@@ -2181,7 +2193,7 @@
     static struct buf arg;
 
     /* Setup for doing mailbox updates */
-    if (!idle_init(imapd_mailbox, idle_update)) {
+    if (!idle_init(idle_update)) {
 	prot_printf(imapd_out, 
 		    "%s NO cannot start idling\r\n", tag);
 	return;
@@ -2191,8 +2203,18 @@
     prot_printf(imapd_out, "+ idling\r\n");
     prot_flush(imapd_out);
 
+    /* Start doing mailbox updates */
+    if (imapd_mailbox) index_check(imapd_mailbox, 0, 1);
+    idle_start(imapd_mailbox);
+
     /* Get continuation data */
     c = getword(imapd_in, &arg);
+
+    /* Stop updates and do any necessary cleanup */
+    idle_done(imapd_mailbox);
+
+    if (imapd_mailbox) index_check(imapd_mailbox, 0, 1);
+
     if (c != EOF) {
 	if (!strcasecmp(arg.s, "Done") &&
 	    (c = (c == '\r') ? prot_getc(imapd_in) : c) == '\n') {
@@ -2206,9 +2228,6 @@
 	    eatline(imapd_in, c);
 	}
     }
-
-    /* Do any necessary cleanup */
-    idle_done(imapd_mailbox);
 
     return;
 }
@@ -2322,6 +2341,7 @@
     struct appendstate mailbox;
     unsigned long uidvalidity;
     unsigned long firstuid, num;
+    long doappenduid = 0;
     const char *parseerr = NULL;
     FILE *f;
     int numalloc = 5;
@@ -2498,6 +2518,8 @@
 			 imapd_userid, imapd_authstate, ACL_INSERT, totalsize);
     }
     if (!r) {
+	doappenduid = (mailbox.m.myrights & ACL_READ);
+
 	for (i = 0; !r && i < numstage; i++) {
 	    r = append_fromstage(&mailbox, stage[i]->stage, stage[i]->internaldate, 
 				 (const char **) stage[i]->flag, stage[i]->nflags, 0);
@@ -2539,8 +2561,7 @@
 						 imapd_userid, imapd_authstate,
 						 (char **)0, (char **)0) == 0)
 		    ? "[TRYCREATE] " : "", error_message(r));
-    } else {
-	/* is this a space seperated list or sequence list? */
+    } else if (doappenduid) {
 	prot_printf(imapd_out, "%s OK [APPENDUID %lu", tag, uidvalidity);
 	if (num == 1) {
 	    prot_printf(imapd_out, " %lu", firstuid);
@@ -2548,6 +2569,9 @@
 	    prot_printf(imapd_out, " %lu:%lu", firstuid, firstuid + num - 1);
 	}
 	prot_printf(imapd_out, "] %s\r\n", error_message(IMAP_OK_COMPLETED));
+    } else {
+	prot_printf(imapd_out, "%s OK %s\r\n", tag,
+		    error_message(IMAP_OK_COMPLETED));
     }
 }
 
@@ -2561,6 +2585,8 @@
     int r = 0;
     double usage;
     int doclose = 0;
+    static char lastqr[MAX_MAILBOX_PATH+1] = "";
+    static time_t nextalert = 0;
 
     if (imapd_mailbox) {
 	index_closemailbox(imapd_mailbox);
@@ -2616,9 +2642,12 @@
     }
 
     if (imapd_mailbox->myrights & ACL_DELETE) {
+	time_t now = time(NULL);
+
 	/* Warn if mailbox is close to or over quota */
 	r = quota_read(&imapd_mailbox->quota, NULL, 0);
-	if (!r && imapd_mailbox->quota.limit > 0) {
+	if (!r && imapd_mailbox->quota.limit > 0 &&
+	    (strcmp(imapd_mailbox->quota.root, lastqr) || now > nextalert)) {
  	    /* Warn if the following possibilities occur:
  	     * - quotawarnkb not set + quotawarn hit
 	     * - quotawarnkb set larger than mailbox + quotawarn hit
@@ -2642,6 +2671,8 @@
 		    prot_printf(imapd_out, "\r\n");
 		}
 	    }
+	    strlcpy(lastqr, imapd_mailbox->quota.root, sizeof(lastqr));
+	    nextalert = now + 600; /* ALERT every 10 min regardless */
 	}
     }
 
@@ -3593,12 +3624,12 @@
 					       imapd_userid, mailboxname);
     if (!r) {
 	r = index_copy(imapd_mailbox, sequence, usinguid, mailboxname,
-		       &copyuid);
+		       &copyuid, !config_getswitch(IMAPOPT_SINGLEINSTANCESTORE));
     }
 
     index_check(imapd_mailbox, usinguid, 0);
 
-    if (r) {
+    if (r && !(usinguid && r == IMAP_NO_NOSUCHMSG)) {
 	prot_printf(imapd_out, "%s NO %s%s\r\n", tag,
 		    (r == IMAP_MAILBOX_NONEXISTENT &&
 		     mboxlist_createmailboxcheck(mailboxname, 0, 0,
@@ -3607,21 +3638,14 @@
 						 (char **)0, (char **)0) == 0)
 		    ? "[TRYCREATE] " : "", error_message(r));
     }
-    else {
-	if (copyuid) {
+    else if (copyuid) {
 	    prot_printf(imapd_out, "%s OK [COPYUID %s] %s\r\n", tag,
 			copyuid, error_message(IMAP_OK_COMPLETED));
 	    free(copyuid);
-	}
-	else if (usinguid) {
-	    prot_printf(imapd_out, "%s OK %s\r\n", tag,
-			error_message(IMAP_OK_COMPLETED));
-	}
-	else {
-	    /* normal COPY, message doesn't exist */
-	    prot_printf(imapd_out, "%s NO %s\r\n", tag,
-			error_message(IMAP_NO_NOSUCHMSG));
-	}
+    }
+    else {
+	prot_printf(imapd_out, "%s OK %s\r\n", tag,
+		    error_message(IMAP_OK_COMPLETED));
     }
 }    
 

Modified: trunk/cyrus-imapd-2.2/imap/imapd.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/imapd.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/imapd.h (original)
+++ trunk/cyrus-imapd-2.2/imap/imapd.h Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* imapd.h -- Common state for IMAP daemon
- * $Id: imapd.h,v 1.61 2004/06/22 21:36:18 rjs3 Exp $
+ * $Id: imapd.h,v 1.62 2005/06/02 15:47:57 ken3 Exp $
  *
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -249,7 +249,7 @@
 extern int index_thread(struct mailbox *mailbox, int algorithm,
 			struct searchargs *searchargs, int usinguid);
 extern int index_copy(struct mailbox *mailbox, char *sequence,
-			 int usinguid, char *name, char **copyuidp);
+		      int usinguid, char *name, char **copyuidp, int nolink);
 extern int index_status(struct mailbox *mailbox, char *name,
 			   int statusitems);
 

Modified: trunk/cyrus-imapd-2.2/imap/imapparse.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/imapparse.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/imapparse.c (original)
+++ trunk/cyrus-imapd-2.2/imap/imapparse.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: imapparse.c,v 1.14 2004/01/06 16:32:17 rjs3 Exp $ */
+/* $Id: imapparse.c,v 1.15 2005/10/18 23:38:43 jeaton Exp $ */
 
 #include <config.h>
 
@@ -52,8 +52,8 @@
 #include "exitcodes.h"
 
 enum {
-    MAXQUOTED = 16384,
-    MAXWORD = 16384,
+    MAXQUOTED = 32768,
+    MAXWORD = 32768,
     MAXLITERAL = INT_MAX / 20
 };
 

Modified: trunk/cyrus-imapd-2.2/imap/index.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/index.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/index.c (original)
+++ trunk/cyrus-imapd-2.2/imap/index.c Fri Mar 31 20:18:13 2006
@@ -41,7 +41,7 @@
  *
  */
 /*
- * $Id: index.c,v 1.213 2005/02/14 16:42:08 shadow Exp $
+ * $Id: index.c,v 1.218 2005/06/02 15:47:58 ken3 Exp $
  */
 #include <config.h>
 
@@ -84,9 +84,11 @@
 /* The index and cache files, mapped into memory */
 static const char *index_base;
 static unsigned long index_len;
+static unsigned long index_dirty;
 static const char *cache_base;
 static unsigned long cache_len;
 static unsigned long cache_end;
+static unsigned long cache_dirty;
 
 /* Attributes of memory-mapped index file */
 static ino_t index_ino;
@@ -207,9 +209,12 @@
 	seendb = 0;
     }
     if (index_len) {
-	map_free(&index_base, &index_len);
-	map_free(&cache_base, &cache_len);
-	index_len = cache_end = 0;
+        /* So what happens if these weren't cloned from this mailbox? */
+	if (index_dirty)
+	    map_free(&index_base, &index_len); 
+	if (cache_dirty)
+	    map_free(&cache_base, &cache_len); 
+	index_dirty = cache_dirty = index_len = cache_end = 0;
     }
 }
 
@@ -234,6 +239,7 @@
     examining = 1;
     allseen = 0;
     recentuid = 0;
+    index_dirty = cache_dirty = 0;
     index_base = mailbox->index_base;
     index_len = mailbox->index_len;
     cache_base = mailbox->cache_base;
@@ -311,6 +317,7 @@
 	    map_free(&index_base, &index_len);
 	    map_free(&cache_base, &cache_len);
 	    cache_end = 0;
+	    index_dirty = cache_dirty = 0;
 
 	    /* Force a * n EXISTS message */
 	    imapd_exists = -1;
@@ -330,6 +337,7 @@
     map_refresh(mailbox->index_fd, 0, &index_base, &index_len,
 		start_offset + newexists * record_size,
 		"index", mailbox->name);
+    index_dirty = 1;
     if (fstat(mailbox->cache_fd, &sbuf) == -1) {
 	syslog(LOG_ERR, "IOERROR: stating cache file for %s: %m",
 	       mailbox->name);
@@ -339,6 +347,7 @@
 	cache_end = sbuf.st_size;
 	map_refresh(mailbox->cache_fd, 0, &cache_base, &cache_len,
 		    cache_end, "cache", mailbox->name);
+	cache_dirty = 1;
     }
 
     /* If opening mailbox, get \Recent info */
@@ -907,6 +916,7 @@
     map_refresh(mailbox->index_fd, 0, &index_base, &index_len,
 		start_offset + imapd_exists * record_size,
 		"index", mailbox->name);
+    index_dirty = 1;
 
     return r;
 }
@@ -1145,7 +1155,8 @@
 	   char *sequence, 
 	   int usinguid,
 	   char *name, 
-	   char **copyuidp)
+	   char **copyuidp,
+	   int nolink)
 {
     static struct copyargs copyargs;
     int i;
@@ -1157,15 +1168,15 @@
     int sepchar;
     unsigned long uidvalidity;
     unsigned long startuid, num;
+    long docopyuid;
+
+    *copyuidp = NULL;
 
     copyargs.nummsg = 0;
     index_forsequence(mailbox, sequence, usinguid, index_copysetup,
 		      (char *)&copyargs, NULL);
 
-    if (copyargs.nummsg == 0) {
-	*copyuidp = 0;
-	return 0;
-    }
+    if (copyargs.nummsg == 0) return IMAP_NO_NOSUCHMSG;
 
     for (i = 0; i < copyargs.nummsg; i++) {
 	totalsize += copyargs.copymsg[i].size;
@@ -1175,11 +1186,13 @@
 		     imapd_userid, imapd_authstate, ACL_INSERT, totalsize);
     if (r) return r;
 
+    docopyuid = (append_mailbox.m.myrights & ACL_READ);
+
     r = append_copy(mailbox, &append_mailbox, copyargs.nummsg,
-		    copyargs.copymsg);
+		    copyargs.copymsg, nolink);
     if (!r) append_commit(&append_mailbox, totalsize,
 			  &uidvalidity, &startuid, &num);
-    if (!r) {
+    if (!r && docopyuid) {
 	copyuid_size = 1024;
 	copyuid = xmalloc(copyuid_size);
 	snprintf(copyuid, copyuid_size, "%lu", uidvalidity);

Modified: trunk/cyrus-imapd-2.2/imap/lmtp_sieve.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/lmtp_sieve.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/lmtp_sieve.c (original)
+++ trunk/cyrus-imapd-2.2/imap/lmtp_sieve.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* lmtp_sieve.c -- Sieve implementation for lmtpd
  *
- * $Id: lmtp_sieve.c,v 1.8 2004/06/01 13:47:16 ken3 Exp $
+ * $Id: lmtp_sieve.c,v 1.11 2005/11/21 16:26:16 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -56,11 +56,13 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#include "annotate.h"
 #include "append.h"
 #include "auth.h"
 #include "duplicate.h"
 #include "exitcodes.h"
 #include "global.h"
+#include "lmtpd.h"
 #include "lmtp_sieve.h"
 #include "lmtpengine.h"
 #include "lmtpstats.h"
@@ -83,21 +85,6 @@
     struct auth_state *authstate;
 } script_data_t;
 
-/* forward declarations */
-extern int deliver_mailbox(struct protstream *msg,
-			   struct stagemsg *stage,
-			   unsigned size,
-			   char **flag,
-			   int nflags,
-			   char *authuser,
-			   struct auth_state *authstate,
-			   char *id,
-			   const char *user,
-			   char *notifyheader,
-			   const char *mailboxname,
-			   int quotaoverride,
-			   int acloverride);
-
 static char *make_sieve_db(const char *user)
 {
     static char buf[MAX_MAILBOX_PATH+1];
@@ -113,7 +100,7 @@
 /* gets the header "head" from msg. */
 static int getheader(void *v, const char *phead, const char ***body)
 {
-    message_data_t *m = ((sieve_msgdata_t *) v)->m;
+    message_data_t *m = ((deliver_data_t *) v)->m;
 
     if (phead==NULL) return SIEVE_FAIL;
     *body = msg_getheader(m, phead);
@@ -127,7 +114,7 @@
 
 static int getsize(void *mc, int *size)
 {
-    message_data_t *m = ((sieve_msgdata_t *) mc)->m;
+    message_data_t *m = ((deliver_data_t *) mc)->m;
 
     *size = msg_getsize(m);
     return SIEVE_OK;
@@ -137,7 +124,7 @@
    to return, and we also can't expose our the receipients to the message */
 static int getenvelope(void *mc, const char *field, const char ***contents)
 {
-    sieve_msgdata_t *mydata = (sieve_msgdata_t *) mc;
+    deliver_data_t *mydata = (deliver_data_t *) mc;
     message_data_t *m = mydata->m;
 
     if (!strcasecmp(field, "from")) {
@@ -318,7 +305,7 @@
 {
     sieve_redirect_context_t *rc = (sieve_redirect_context_t *) ac;
     script_data_t *sd = (script_data_t *) sc;
-    message_data_t *m = ((sieve_msgdata_t *) mc)->m;
+    message_data_t *m = ((deliver_data_t *) mc)->m;
     char buf[8192], *sievedb = NULL;
     int res;
 
@@ -357,7 +344,7 @@
 			 const char **errmsg __attribute__((unused)))
 {
     script_data_t *sd = (script_data_t *) sc;
-    message_data_t *md = ((sieve_msgdata_t *) mc)->m;
+    message_data_t *md = ((deliver_data_t *) mc)->m;
 
     snmp_increment(SIEVE_DISCARD, 1);
 
@@ -383,7 +370,7 @@
 {
     sieve_reject_context_t *rc = (sieve_reject_context_t *) ac;
     script_data_t *sd = (script_data_t *) sc;
-    message_data_t *md = ((sieve_msgdata_t *) mc)->m;
+    message_data_t *md = ((deliver_data_t *) mc)->m;
     const char **body;
     const char *origreceip;
     int res;
@@ -425,14 +412,11 @@
 {
     sieve_fileinto_context_t *fc = (sieve_fileinto_context_t *) ac;
     script_data_t *sd = (script_data_t *) sc;
-    sieve_msgdata_t *mdata = (sieve_msgdata_t *) mc;
+    deliver_data_t *mdata = (deliver_data_t *) mc;
     message_data_t *md = mdata->m;
     int quotaoverride = msg_getrcpt_ignorequota(md, mdata->cur_rcpt);
     char namebuf[MAX_MAILBOX_NAME+1];
     int ret;
-
-    /* we're now the user who owns the script */
-    if (!sd->authstate) return SIEVE_FAIL;
 
     ret = (*mdata->namespace->mboxname_tointernal)(mdata->namespace,
 						   fc->mailbox,
@@ -460,44 +444,11 @@
 {
     sieve_keep_context_t *kc = (sieve_keep_context_t *) ac;
     script_data_t *sd = (script_data_t *) sc;
-    sieve_msgdata_t *mydata = (sieve_msgdata_t *) mc;
-    message_data_t *md = mydata->m;
-    int quotaoverride = msg_getrcpt_ignorequota(md, mydata->cur_rcpt);
-    char namebuf[MAX_MAILBOX_NAME+1], *tail;
+    deliver_data_t *mydata = (deliver_data_t *) mc;
     int ret;
 
-    ret = (*mydata->namespace->mboxname_tointernal)(mydata->namespace,
-						    "INBOX",
-						    sd->username, namebuf);
-
-    if (!ret) {
-	int ret2 = 1;
-
-	tail = namebuf + strlen(namebuf);
-	if (sd->mailboxname) {
-	    strlcat(namebuf, ".", sizeof(namebuf));
-	    strlcat(namebuf, sd->mailboxname, sizeof(namebuf));
-
-	    ret2 = deliver_mailbox(md->data, mydata->stage, md->size,
-				   kc->imapflags->flag, kc->imapflags->nflags,
-				   mydata->authuser, mydata->authstate, md->id,
-				   sd->username, mydata->notifyheader,
-				   namebuf, quotaoverride, 0);
-	}
-	if (ret2) {
-	    /* we're now the user who owns the script */
-	    if (!sd->authstate) return SIEVE_FAIL;
-
-	    /* normal delivery to INBOX */
-	    *tail = '\0';
-
-	    ret = deliver_mailbox(md->data, mydata->stage, md->size,
-				  kc->imapflags->flag, kc->imapflags->nflags,
-				  (char *) sd->username, sd->authstate, md->id,
-				  sd->username, mydata->notifyheader,
-				  namebuf, quotaoverride, 1);
-	}
-    }
+    ret = deliver_local(mydata, kc->imapflags->flag, kc->imapflags->nflags,
+			(char *) sd->username, sd->mailboxname);
 
     if (!ret) {
 	snmp_increment(SIEVE_KEEP, 1);
@@ -586,7 +537,7 @@
     char datestr[80];
     pid_t sm_pid, p;
     sieve_send_response_context_t *src = (sieve_send_response_context_t *) ac;
-    message_data_t *md = ((sieve_msgdata_t *) mc)->m;
+    message_data_t *md = ((deliver_data_t *) mc)->m;
     script_data_t *sdata = (script_data_t *) sc;
 
     smbuf[0] = "sendmail";
@@ -689,7 +640,7 @@
 				       void *sc, void *mc)
 {
     script_data_t *sd = (script_data_t *) sc;
-    message_data_t *md = ((sieve_msgdata_t *) mc)->m;
+    message_data_t *md = ((deliver_data_t *) mc)->m;
     
     syslog(LOG_INFO, "sieve runtime error for %s id %s: %s",
 	   sd->username, md->id ? md->id : "(null)", msg);
@@ -790,13 +741,17 @@
 }
 
 static int sieve_find_script(const char *user, const char *domain,
-			     char *fname, size_t size)
-{
-    if (strlen(user) > 900) {
+			     const char *script, char *fname, size_t size)
+{
+    if (!user && !script) {
 	return -1;
     }
-    
-    if (sieve_usehomedir) { /* look in homedir */
+
+    if (user && strlen(user) > 900) {
+	return -1;
+    }
+    
+    if (sieve_usehomedir && user) { /* look in homedir */
 	struct passwd *pent = getpwnam(user);
 
 	if (pent == NULL) {
@@ -804,81 +759,112 @@
 	}
 
 	/* check ~USERNAME/.sieve */
-	snprintf(fname, size, "%s/%s", pent->pw_dir, ".sieve");
+	snprintf(fname, size, "%s/%s", pent->pw_dir, script ? script : ".sieve");
     } else { /* look in sieve_dir */
-	char hash = (char) dir_hash_c(user);
+	size_t len = strlcpy(fname, sieve_dir, size);
 
 	if (domain) {
 	    char dhash = (char) dir_hash_c(domain);
-	    snprintf(fname, size, "%s%s%c/%s/%c/%s/defaultbc",
-		     sieve_dir, FNAME_DOMAINDIR, dhash, domain, hash, user);
-	} else {
-	    snprintf(fname, size, "%s/%c/%s/defaultbc", sieve_dir, hash, user);
-	}
+	    len += snprintf(fname+len, size-len, "%s%c/%s",
+			    FNAME_DOMAINDIR, dhash, domain);
+	}
+
+	if (!user) { /* global script */
+	    len = strlcat(fname, "/global/", size);
+	}
+	else {
+	    char hash = (char) dir_hash_c(user);
+	    len += snprintf(fname+len, size-len, "/%c/%s/", hash, user);
+
+	    if (!script) { /* default script */
+		strlcat(fname, "defaultbc", size);
+		return 0;
+	    }
+	}
+
+	snprintf(fname+len, size-len, "%s.bc", script);
     }
 	
     return 0;
 }
 
 int run_sieve(const char *user, const char *domain, const char *mailbox,
-	      sieve_interp_t *interp, sieve_msgdata_t *msgdata)
-{
+	      sieve_interp_t *interp, deliver_data_t *msgdata)
+{
+    char namebuf[MAX_MAILBOX_NAME+1] = "";
+    struct annotation_data attrib;
+    const char *script = NULL;
     char fname[MAX_MAILBOX_PATH+1];
+    sieve_bytecode_t *bc = NULL;
+    script_data_t sdata;
+    char userbuf[MAX_MAILBOX_NAME+1] = "";
+    char authuserbuf[MAX_MAILBOX_NAME+1];
     int r = 0;
 
-    if (sieve_find_script(user, domain, fname, sizeof(fname)) != -1) {
-	script_data_t *sdata = NULL;
-	sieve_bytecode_t *bc = NULL;
-	char userbuf[MAX_MAILBOX_NAME+1];
-	char authuserbuf[MAX_MAILBOX_NAME+1];
-
-	sdata = (script_data_t *) xmalloc(sizeof(script_data_t));
-
-	strlcpy(userbuf, user, sizeof(userbuf));
-	if (domain) {
-	    strlcat(userbuf, "@", sizeof(userbuf));
-	    strlcat(userbuf, domain, sizeof(userbuf));
-	}
+    if (!user) {
+	/* shared mailbox, check for annotation */
+	if (domain) snprintf(namebuf, sizeof(namebuf), "%s!", domain);
+	strlcat(namebuf, mailbox, sizeof(namebuf));
+
+	if (annotatemore_lookup(namebuf,
+				"/vendor/cmu/cyrus-imapd/sieve", "",
+				&attrib) != 0 || !attrib.value) {
+	    /* no sieve script annotation */
+	    return 1; /* do normal delivery actions */
+	}
+
+	script = attrib.value;
+    }
+
+    if (sieve_find_script(user, domain, script, fname, sizeof(fname)) != 0 ||
+	sieve_script_load(fname, &bc) != SIEVE_OK) {
+	/* no sieve script */
+	return 1; /* do normal delivery actions */
+    }
+
+    if (user) strlcpy(userbuf, user, sizeof(userbuf));
+    if (domain) {
+	strlcat(userbuf, "@", sizeof(userbuf));
+	strlcat(userbuf, domain, sizeof(userbuf));
+    }
+    sdata.username = userbuf;
+    sdata.mailboxname = mailbox;
+
+    if (user) {
 	strlcpy(authuserbuf, userbuf, sizeof(authuserbuf));
 	if (config_getswitch(IMAPOPT_UNIXHIERARCHYSEP)) {
 	    mboxname_hiersep_toexternal(msgdata->namespace, authuserbuf,
 					domain ? strcspn(authuserbuf, "@") : 0);
 	}
-	sdata->username = userbuf;
-	sdata->mailboxname = mailbox;
-	sdata->authstate = auth_newstate(authuserbuf);
-
-	r = sieve_script_load(fname, &bc);
-	if (r == SIEVE_OK) {
-	    r = sieve_execute_bytecode(bc, interp,
-				       (void *) sdata, (void *) msgdata);
-	}
-	if ((r == SIEVE_OK) && (msgdata->m->id)) {
-	    /* ok, we've run the script */
-	    char namebuf[MAX_MAILBOX_NAME+1];
-	    char *sdb;
+	sdata.authstate = auth_newstate(authuserbuf);
+    }
+    else {
+	sdata.authstate = msgdata->authstate;
+    }	
+
+    r = sieve_execute_bytecode(bc, interp,
+			       (void *) &sdata, (void *) msgdata);
+
+    if ((r == SIEVE_OK) && (msgdata->m->id)) {
+	/* ok, we've run the script */
+	char *sdb;
 		    
-	    /* slap the mailbox back on so we hash the envelope & id
-	       when we figure out whether or not to keep the message */
-	    snprintf(namebuf, sizeof(namebuf), "%s+%s@%s",
-		     user, mailbox ? mailbox : "", domain ? domain : "");
-	    sdb = make_sieve_db(namebuf);
+	/* slap the mailbox back on so we hash the envelope & id
+	   when we figure out whether or not to keep the message */
+	snprintf(namebuf, sizeof(namebuf), "%s+%s@%s",
+		 user ? user : "", mailbox ? mailbox : "",
+		 domain ? domain : "");
+	sdb = make_sieve_db(namebuf);
 		
-	    duplicate_mark(msgdata->m->id, strlen(msgdata->m->id), 
-			   sdb, strlen(sdb), time(NULL), 0);
-	}
+	duplicate_mark(msgdata->m->id, strlen(msgdata->m->id), 
+		       sdb, strlen(sdb), time(NULL), 0);
+    }
 		
-	/* free everything */
-	if (sdata->authstate) auth_freestate(sdata->authstate);
-	if (sdata) free(sdata);
-	sieve_script_unload(&bc);
+    /* free everything */
+    if (user && sdata.authstate) auth_freestate(sdata.authstate);
+    sieve_script_unload(&bc);
 		
-	/* if there was an error, r is non-zero and 
-	   we'll do normal delivery */
-    } else {
-	/* no sieve script */
-	r = 1; /* do normal delivery actions */
-    }
-
+    /* if there was an error, r is non-zero and 
+       we'll do normal delivery */
     return r;
 }

Modified: trunk/cyrus-imapd-2.2/imap/lmtp_sieve.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/lmtp_sieve.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/lmtp_sieve.h (original)
+++ trunk/cyrus-imapd-2.2/imap/lmtp_sieve.h Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* lmtp_sieve.h -- Sieve implementation for lmtpd
  *
- * $Id: lmtp_sieve.h,v 1.2 2004/02/12 02:32:23 ken3 Exp $
+ * $Id: lmtp_sieve.h,v 1.3 2005/10/20 15:29:02 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -45,31 +45,11 @@
 #ifndef LMTP_SIEVE_H
 #define LMTP_SIEVE_H
 
-#include "append.h"
-#include "auth.h"
-#include "lmtpengine.h"
-#include "mboxname.h"
+#include "lmtpd.h"
 #include "sieve_interface.h"
-
-/* data per message */
-typedef struct sieve_msgdata {
-    message_data_t *m;
-    int cur_rcpt;
-
-    struct stagemsg *stage;	/* staging location for single instance
-				   store */
-    char *notifyheader;
-    const char *temp[2];	/* used to avoid extra indirection in
-				   getenvelope() */
-
-    struct namespace *namespace;
-
-    char *authuser;		/* user who submitted message */
-    struct auth_state *authstate;
-} sieve_msgdata_t;
 
 sieve_interp_t *setup_sieve(void);
 int run_sieve(const char *user, const char *domain, const char *mailbox,
-	      sieve_interp_t *interp, sieve_msgdata_t *mydata);
+	      sieve_interp_t *interp, deliver_data_t *mydata);
 
 #endif /* LMTP_SIEVE_H */

Modified: trunk/cyrus-imapd-2.2/imap/lmtpd.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/lmtpd.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/lmtpd.c (original)
+++ trunk/cyrus-imapd-2.2/imap/lmtpd.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* lmtpd.c -- Program to deliver mail to a mailbox
  *
- * $Id: lmtpd.c,v 1.140 2004/12/17 16:32:15 ken3 Exp $
+ * $Id: lmtpd.c,v 1.143 2006/01/20 20:29:33 jeaton Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -66,6 +66,7 @@
 #include <sasl/saslutil.h>
 
 #include "acl.h"
+#include "annotate.h"
 #include "assert.h"
 #include "util.h"
 #include "auth.h"
@@ -85,6 +86,7 @@
 #include "idle.h"
 #include "tls.h"
 
+#include "lmtpd.h"
 #include "lmtpengine.h"
 #include "lmtpstats.h"
 #ifdef USE_SIEVE
@@ -182,6 +184,10 @@
     /* so we can do quota operations */
     quotadb_init(0);
     quotadb_open(NULL);
+
+    /* Initialize the annotatemore db (for sieve on shared mailboxes) */
+    annotatemore_init(0, NULL, NULL);
+    annotatemore_open(NULL);
 
     /* setup for sending IMAP IDLE notifications */
     idle_enabled();
@@ -299,8 +305,23 @@
 	prot_rewind(msg);
 	r = append_fromstage(&as, stage, now,
 			     (const char **) flag, nflags, !singleinstance);
-	if (!r) append_commit(&as, quotaoverride ? -1 : 0, NULL, &uid, NULL);
-	else append_abort(&as);
+	if (r || (dupelim && id && 
+	    duplicate_check(id, strlen(id), mailboxname, strlen(mailboxname)))) 
+	{
+	    append_abort(&as);
+                    
+	    if (!r) {
+	      /* duplicate message */
+		duplicate_log(id, mailboxname, "delivery");
+		return 0;
+	    }            
+	} else {
+	    if (dupelim && id) 
+		duplicate_mark(id, strlen(id), mailboxname, 
+			       strlen(mailboxname), now, uid);
+
+	    append_commit(&as, quotaoverride ? -1 : 0, NULL, &uid, NULL);
+	}
     }
 
     if (!r && user && (notifier = config_getstring(IMAPOPT_MAILNOTIFIER))) {
@@ -338,10 +359,65 @@
 	}
     }
 
-    if (!r && dupelim && id) duplicate_mark(id, strlen(id), 
-					    mailboxname, strlen(mailboxname),
-					    now, uid);
     return r;
+}
+
+int deliver_local(deliver_data_t *mydata, char **flag, int nflags,
+		  const char *username, const char *mailboxname)
+{
+    char namebuf[MAX_MAILBOX_NAME+1] = "", *tail;
+    message_data_t *md = mydata->m;
+    int quotaoverride = msg_getrcpt_ignorequota(md, mydata->cur_rcpt);
+    int ret;
+
+    /* case 1: shared mailbox request */
+    if (!*username || username[0] == '@') {
+	if (*username) snprintf(namebuf, sizeof(namebuf), "%s!", username+1);
+	strlcat(namebuf, mailboxname, sizeof(namebuf));
+
+	return deliver_mailbox(md->data, mydata->stage,
+			       md->size, flag, nflags,
+			       mydata->authuser, mydata->authstate, md->id,
+			       NULL, mydata->notifyheader,
+			       namebuf, quotaoverride, 0);
+    }
+
+    /* case 2: ordinary user */
+    ret = (*mydata->namespace->mboxname_tointernal)(mydata->namespace,
+						    "INBOX",
+						    username, namebuf);
+
+    if (!ret) {
+	ret = 1;
+
+	tail = namebuf + strlen(namebuf);
+	if (mailboxname) {
+	    strlcat(namebuf, ".", sizeof(namebuf));
+	    strlcat(namebuf, mailboxname, sizeof(namebuf));
+
+	    ret = deliver_mailbox(md->data, mydata->stage,
+				  md->size, flag, nflags,
+				  mydata->authuser, mydata->authstate, md->id,
+				  username, mydata->notifyheader,
+				  namebuf, quotaoverride, 0);
+	}
+	if (ret) {
+	    /* normal delivery to INBOX */
+	    struct auth_state *authstate = auth_newstate(username);
+
+	    *tail = '\0';
+
+	    ret = deliver_mailbox(md->data, mydata->stage,
+				  md->size, flag, nflags,
+				  (char *) username, authstate, md->id,
+				  username, mydata->notifyheader,
+				  namebuf, quotaoverride, 1);
+
+	    if (authstate) auth_freestate(authstate);
+	}
+    }
+
+    return ret;
 }
 
 int deliver(message_data_t *msgdata, char *authuser,
@@ -349,9 +425,7 @@
 {
     int n, nrcpts;
     char *notifyheader;
-#ifdef USE_SIEVE
-    sieve_msgdata_t mydata;
-#endif
+    deliver_data_t mydata;
     
     assert(msgdata);
     nrcpts = msg_getnumrcpt(msgdata);
@@ -359,7 +433,6 @@
 
     notifyheader = generate_notify(msgdata);
 
-#ifdef USE_SIEVE
     /* create 'mydata', our per-delivery data */
     mydata.m = msgdata;
     mydata.stage = stage;
@@ -367,74 +440,49 @@
     mydata.namespace = &lmtpd_namespace;
     mydata.authuser = authuser;
     mydata.authstate = authstate;
-#endif
     
     /* loop through each recipient, attempting delivery for each */
     for (n = 0; n < nrcpts; n++) {
 	char namebuf[MAX_MAILBOX_NAME+1] = "";
+	char userbuf[MAX_MAILBOX_NAME+1];
 	const char *user, *domain, *mailbox;
-	int quotaoverride = msg_getrcpt_ignorequota(msgdata, n);
 	int r = 0;
 
 	msg_getrcpt(msgdata, n, &user, &domain, &mailbox);
+
+	namebuf[0] = '\0';
+	userbuf[0] = '\0';
 
 	if (domain) snprintf(namebuf, sizeof(namebuf), "%s!", domain);
 
 	/* case 1: shared mailbox request */
 	if (!user) {
 	    strlcat(namebuf, mailbox, sizeof(namebuf));
-
-	    r = deliver_mailbox(msgdata->data, stage, msgdata->size, 
-				NULL, 0, authuser, authstate,
-				msgdata->id, NULL, notifyheader,
-				namebuf, quotaoverride, 0);
-	}
-
-	/* case 2: ordinary user, might have Sieve script */
+	}
+
+	/* case 2: ordinary user */
 	else {
-	    char userbuf[MAX_MAILBOX_NAME+1];
-	    char *tail;
-
 	    strlcat(namebuf, "user.", sizeof(namebuf));
 	    strlcat(namebuf, user, sizeof(namebuf));
-	    tail = namebuf + strlen(namebuf);
 
 	    strlcpy(userbuf, user, sizeof(userbuf));
-	    if (domain) {
-		strlcat(userbuf, "@", sizeof(userbuf));
-		strlcat(userbuf, domain, sizeof(userbuf));
-	    }
-
+	}
+	if (domain) {
+	    strlcat(userbuf, "@", sizeof(userbuf));
+	    strlcat(userbuf, domain, sizeof(userbuf));
+	}
+
+	mydata.cur_rcpt = n;
 #ifdef USE_SIEVE
-	    mydata.cur_rcpt = n;
-	    r = run_sieve(user, domain, mailbox, sieve_interp, &mydata);
-	    /* if there was no sieve script, or an error during execution,
-	       r is non-zero and we'll do normal delivery */
+	r = run_sieve(user, domain, mailbox, sieve_interp, &mydata);
+	/* if there was no sieve script, or an error during execution,
+	   r is non-zero and we'll do normal delivery */
 #else
-	    r = 1;		/* normal delivery */
+	r = 1;		/* normal delivery */
 #endif
 
-	    if (r && mailbox) {
-		/* normal delivery to + mailbox */
-		strlcat(namebuf, ".", sizeof(namebuf));
-		strlcat(namebuf, mailbox, sizeof(namebuf));
-		
-		r = deliver_mailbox(msgdata->data, stage, msgdata->size, 
-				    NULL, 0, authuser, authstate,
-				    msgdata->id, userbuf, notifyheader,
-				    namebuf, quotaoverride, 0);
-	    }
-
-	    if (r) {
-		/* normal delivery to INBOX */
-		*tail = '\0';
-		
-		/* ignore ACL's trying to deliver to INBOX */
-		r = deliver_mailbox(msgdata->data, stage, msgdata->size, 
-				    NULL, 0, authuser, authstate,
-				    msgdata->id, userbuf, notifyheader,
-				    namebuf, quotaoverride, 1);
-	    }
+	if (r) {
+	    r = deliver_local(&mydata, NULL, 0, userbuf, mailbox);
 	}
 
 	msg_setrcpt_status(msgdata, n, r);
@@ -489,6 +537,9 @@
 
     quotadb_close();
     quotadb_done();
+
+    annotatemore_close();
+    annotatemore_done();
 #ifdef HAVE_SSL
     tls_shutdown_serverengine();
 #endif

Added: trunk/cyrus-imapd-2.2/imap/lmtpd.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/lmtpd.h?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/lmtpd.h (added)
+++ trunk/cyrus-imapd-2.2/imap/lmtpd.h Fri Mar 31 20:18:13 2006
@@ -1,0 +1,93 @@
+/* lmtpd.h -- Program to deliver mail to a mailbox
+ *
+ * $Id: lmtpd.h,v 1.3 2005/10/31 14:21:54 ken3 Exp $
+ * Copyright (c) 1998-2005 Carnegie Mellon University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For permission or any other legal
+ *    details, please contact  
+ *      Office of Technology Transfer
+ *      Carnegie Mellon University
+ *      5000 Forbes Avenue
+ *      Pittsburgh, PA  15213-3890
+ *      (412) 268-4387, fax: (412) 268-7395
+ *      tech-transfer at andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Computing Services
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ *
+ */
+
+#ifndef LMTPD_H
+#define LMTPD_H
+
+#include "append.h"
+#include "auth.h"
+#include "lmtpengine.h"
+#include "mboxname.h"
+#include "message.h"
+
+/* data per message */
+typedef struct deliver_data {
+    message_data_t *m;
+    struct message_content *content;
+
+    int cur_rcpt;
+
+    struct stagemsg *stage;	/* staging location for single instance
+				   store */
+    char *notifyheader;
+    const char *temp[2];	/* used to avoid extra indirection in
+				   getenvelope() */
+
+    struct namespace *namespace;
+
+    char *authuser;		/* user who submitted message */
+    struct auth_state *authstate;
+} deliver_data_t;
+
+/* forward declarations */
+extern int deliver_mailbox(struct protstream *msg,
+			   struct stagemsg *stage,
+			   unsigned size,
+			   char **flag,
+			   int nflags,
+			   char *authuser,
+			   struct auth_state *authstate,
+			   char *id,
+			   const char *user,
+			   char *notifyheader,
+			   const char *mailboxname,
+			   int quotaoverride,
+			   int acloverride);
+
+extern int deliver_local(deliver_data_t *mydata, char **flag, int nflags,
+			 const char *username, const char *mailboxname);
+
+extern int fuzzy_match(char *mboxname);
+
+#endif /* LMTPD_H */

Propchange: trunk/cyrus-imapd-2.2/imap/lmtpd.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/cyrus-imapd-2.2/imap/lmtpengine.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/lmtpengine.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/lmtpengine.c (original)
+++ trunk/cyrus-imapd-2.2/imap/lmtpengine.c Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* lmtpengine.c: LMTP protocol engine
- * $Id: lmtpengine.c,v 1.115 2004/08/10 17:18:38 ken3 Exp $
+ * $Id: lmtpengine.c,v 1.116 2005/11/01 19:47:47 murch Exp $
  *
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -774,7 +774,7 @@
 		   error_message(errno));
 	}
 	fclose(f);
-	func->removespool(m);
+	if (func->removespool) func->removespool(m);
 	return IMAP_IOERROR;
     }
 
@@ -785,7 +785,7 @@
 			error_message(errno));
 	}
 	fclose(f);
-	func->removespool(m);
+	if (func->removespool) func->removespool(m);
 	return IMAP_IOERROR;
     }
     m->size = sbuf.st_size;

Modified: trunk/cyrus-imapd-2.2/imap/lmtpproxyd.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/lmtpproxyd.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/lmtpproxyd.c (original)
+++ trunk/cyrus-imapd-2.2/imap/lmtpproxyd.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* lmtpproxyd.c -- Program to proxy mail delivery
  *
- * $Id: lmtpproxyd.c,v 1.67 2004/12/17 16:32:16 ken3 Exp $
+ * $Id: lmtpproxyd.c,v 1.69 2005/11/29 16:22:35 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,7 @@
 #include "version.h"
 #include "mboxname.h"
 
-#include "mupdate-client.h"
+#include "mupdate.h"
 #include "backend.h"
 #include "lmtpengine.h"
 #include "lmtpstats.h"
@@ -714,6 +714,10 @@
 /* we're a proxy, we don't care about single instance store */
 FILE *proxy_spoolfile(message_data_t *msgdata __attribute__((unused))) 
 {
-    return tmpfile();
-}
-    
+    FILE *f = NULL;
+    int fd = create_tempfile();
+
+    if (fd != -1) f = fdopen(fd, "w+");
+
+    return f;
+}

Modified: trunk/cyrus-imapd-2.2/imap/mailbox.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/mailbox.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/mailbox.c (original)
+++ trunk/cyrus-imapd-2.2/imap/mailbox.c Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* mailbox.c -- Mailbox manipulation routines
- * $Id: mailbox.c,v 1.156 2005/02/14 06:39:57 shadow Exp $
+ * $Id: mailbox.c,v 1.159 2005/04/07 00:25:52 shadow Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -1780,6 +1780,12 @@
 	    
 	    cache_offset = ntohl(*((bit32 *)(buf+OFFSET_CACHE_OFFSET)));
 
+	    if (cache_offset == 0) {
+		syslog(LOG_ERR, "IOERROR: reading index header for %s: got 0 cache_offset on message %u/%lu; trying recovery",
+		       mailbox->name, msgno, mailbox->exists);
+		continue;
+	    }
+
 	    /* Fix up cache file offset */
 	    *((bit32 *)(buf+OFFSET_CACHE_OFFSET)) =
 		htonl(new_cache_total_size);

Modified: trunk/cyrus-imapd-2.2/imap/mboxlist.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/mboxlist.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/mboxlist.c (original)
+++ trunk/cyrus-imapd-2.2/imap/mboxlist.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  *
  */
 /*
- * $Id: mboxlist.c,v 1.240 2004/07/26 18:08:03 ken3 Exp $
+ * $Id: mboxlist.c,v 1.241 2005/11/22 18:20:51 murch Exp $
  */
 
 #include <config.h>
@@ -384,7 +384,7 @@
     if(!isadmin && force_user_create) return IMAP_PERMISSION_DENIED;
 
     /* User has admin rights over their own mailbox namespace */
-    if (mboxname_userownsmailbox(userid, name) &&
+    if (mboxname_userownsmailbox(userid, name) && strchr(name+5, '.') &&
 	(config_implicitrights & ACL_ADMIN)) {
 	isadmin = 1;
     }

Modified: trunk/cyrus-imapd-2.2/imap/mbpath.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/mbpath.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/mbpath.c (original)
+++ trunk/cyrus-imapd-2.2/imap/mbpath.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* mbpath.c -- help the sysadmin to find the path matching the mailbox
  *
- * $Id: mbpath.c,v 1.18 2004/06/02 17:35:08 ken3 Exp $
+ * $Id: mbpath.c,v 1.19 2006/02/25 18:31:51 murch Exp $
  * 
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -42,7 +42,7 @@
  *
  */
 
-/* static char _rcsid[] = "$Id: mbpath.c,v 1.18 2004/06/02 17:35:08 ken3 Exp $"; */
+/* static char _rcsid[] = "$Id: mbpath.c,v 1.19 2006/02/25 18:31:51 murch Exp $"; */
 
 #include <config.h>
 
@@ -95,6 +95,8 @@
   int opt;		/* getopt() returns an int */
   char *alt_config = NULL;
   char buf[MAX_MAILBOX_PATH+1];
+
+  if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
 
   while ((opt = getopt(argc, argv, "C:qs")) != EOF) {
     switch(opt) {
@@ -152,5 +154,5 @@
   return 0;
 }
 
-/* $Header: /cvs/src/cyrus/imap/mbpath.c,v 1.18 2004/06/02 17:35:08 ken3 Exp $ */
+/* $Header: /cvs/src/cyrus/imap/mbpath.c,v 1.19 2006/02/25 18:31:51 murch Exp $ */
 

Modified: trunk/cyrus-imapd-2.2/imap/mupdate-client.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/mupdate-client.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/mupdate-client.c (original)
+++ trunk/cyrus-imapd-2.2/imap/mupdate-client.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* mupdate-client.c -- cyrus murder database clients
  *
- * $Id: mupdate-client.c,v 1.46 2004/08/25 15:35:41 ken3 Exp $
+ * $Id: mupdate-client.c,v 1.47 2005/11/23 13:40:09 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -73,7 +73,6 @@
 #include "imparse.h"
 #include "iptostring.h"
 #include "mupdate.h"
-#include "mupdate_err.h"
 #include "prot.h"
 #include "protocol.h"
 #include "xmalloc.h"

Modified: trunk/cyrus-imapd-2.2/imap/mupdate-client.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/mupdate-client.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/mupdate-client.h (original)
+++ trunk/cyrus-imapd-2.2/imap/mupdate-client.h Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* mupdate-client.h -- cyrus murder database clients
  *
- * $Id: mupdate-client.h,v 1.14 2004/03/08 17:31:05 rjs3 Exp $
+ * $Id: mupdate-client.h,v 1.15 2005/11/23 13:40:09 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,6 @@
 #define INCLUDED_MUPDATE_CLIENT_H
 
 #include <sasl/sasl.h>
-#include "mupdate_err.h"
 
 #define FNAME_MUPDATE_TARGET_SOCK "/socket/mupdate.target"
 

Modified: trunk/cyrus-imapd-2.2/imap/mupdate-slave.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/mupdate-slave.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/mupdate-slave.c (original)
+++ trunk/cyrus-imapd-2.2/imap/mupdate-slave.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* mupdate-slave.c -- cyrus murder database clients
  *
- * $Id: mupdate-slave.c,v 1.26 2004/03/08 19:23:04 rjs3 Exp $
+ * $Id: mupdate-slave.c,v 1.27 2005/11/23 13:40:09 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -73,7 +73,6 @@
 #include "imparse.h"
 #include "iptostring.h"
 #include "mupdate.h"
-#include "mupdate_err.h"
 #include "exitcodes.h"
 
 /* Returns file descriptor of kick socket (or does not return) */

Modified: trunk/cyrus-imapd-2.2/imap/mupdate.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/mupdate.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/mupdate.c (original)
+++ trunk/cyrus-imapd-2.2/imap/mupdate.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* mupdate.c -- cyrus murder database master 
  *
- * $Id: mupdate.c,v 1.89 2004/12/17 16:32:16 ken3 Exp $
+ * $Id: mupdate.c,v 1.92 2005/11/04 13:33:30 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -460,9 +460,36 @@
     return 0;
 }
 
+
+/*
+ * The auth_*.c backends called by mysasl_proxy_policy()
+ * use static variables which we need to protect with a mutex.
+ */
+static pthread_mutex_t proxy_policy_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+static int mupdate_proxy_policy(sasl_conn_t *conn,
+				void *context,
+				const char *requested_user, unsigned rlen,
+				const char *auth_identity, unsigned alen,
+				const char *def_realm,
+				unsigned urlen,
+				struct propctx *propctx)
+{
+    int r;
+
+    pthread_mutex_lock(&proxy_policy_mutex); /* LOCK */
+
+    r = mysasl_proxy_policy(conn, context, requested_user, rlen,
+			    auth_identity, alen, def_realm, urlen, propctx);
+
+    pthread_mutex_unlock(&proxy_policy_mutex); /* UNLOCK */
+
+    return r;
+}
+
 static struct sasl_callback mysasl_cb[] = {
     { SASL_CB_GETOPT, &mysasl_config, NULL },
-    { SASL_CB_PROXY_POLICY, &mysasl_proxy_policy, NULL },
+    { SASL_CB_PROXY_POLICY, &mupdate_proxy_policy, NULL },
     { SASL_CB_LIST_END, NULL, NULL }
 };
 
@@ -949,7 +976,7 @@
 	close(fd);
 
 	syslog(LOG_ERR,
-	       "Server too busy, droping connection.");
+	       "Server too busy, dropping connection.");
     } else if(write(conn_pipe[1], &fd, sizeof(fd)) == -1) {
 	/* signal that a new file descriptor is available.
 	 * If it fails... */
@@ -1045,10 +1072,7 @@
 	if(!max_worker_flag) idle_worker_count++;
 	pthread_mutex_unlock(&idle_worker_mutex);
 
-	if(max_worker_flag) {
-	    pthread_mutex_unlock(&idle_worker_mutex);
-	    goto worker_thread_done;
-	}
+	if(max_worker_flag) goto worker_thread_done;
 
     retry_lock:
 
@@ -1133,7 +1157,7 @@
 	if(need_workers > 0) {
 	    too_many = (need_workers + worker_count) - 
 		config_getint(IMAPOPT_MUPDATE_WORKERS_MAX);
-	    need_workers -= too_many;
+	    if (too_many > 0) need_workers -= too_many;
 	}
 	
 	/* Do we need a new worker (or two, or three...)?

Modified: trunk/cyrus-imapd-2.2/imap/nntpd.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/nntpd.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/nntpd.c (original)
+++ trunk/cyrus-imapd-2.2/imap/nntpd.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: nntpd.c,v 1.43 2005/01/07 20:59:04 ken3 Exp $
+ * $Id: nntpd.c,v 1.51 2005/12/13 15:18:55 murch Exp $
  */
 
 /*
@@ -784,7 +784,7 @@
 
     sasl_dispose(conn);
     /* do initialization typical of service_main */
-    ret = sasl_server_new("news", config_servername,
+    ret = sasl_server_new("nntp", config_servername,
                          NULL, NULL, NULL,
                          NULL, SASL_SUCCESS_DATA, conn);
     if(ret != SASL_OK) return ret;
@@ -828,7 +828,7 @@
     static struct buf cmd, arg1, arg2, arg3, arg4;
     char *p, *result, buf[1024];
     const char *err;
-    unsigned long uid;
+    unsigned long uid, last;
     struct backend *be;
 
     allowanonymous = config_getswitch(IMAPOPT_ALLOWANONYMOUSLOGIN);
@@ -1013,16 +1013,22 @@
 		if (c == '\r') c = prot_getc(nntp_in);
 		if (c != '\n') goto extraargs;
 
-		r = open_group(arg1.s, 0, &backend_current, NULL);
+		r = open_group(arg1.s, 0, &be, NULL);
 		if (r) goto nogroup;
-		else if (backend_current) {
-		    prot_printf(backend_current->out, "GROUP %s\r\n", arg1.s);
-		    r = read_response(backend_current, 0, &result);
+		else if (be) {
+		    prot_printf(be->out, "GROUP %s\r\n", arg1.s);
+		    r = read_response(be, 0, &result);
 		    if (r) goto nogroup;
 
 		    prot_printf(nntp_out, "%s", result);
+
+		    if (!strncmp(result, "211", 3)) {
+			backend_current = be;
+		    }
 		}
 		else {
+		    backend_current = NULL;
+
 		    nntp_exists = nntp_group->exists;
 		    nntp_current = nntp_exists > 0;
 
@@ -1053,7 +1059,6 @@
 	    else if (!nntp_userid && !allowanonymous) goto nologin;
 	    else if (!strcmp(cmd.s, "Hdr")) {
 		char curgroup[MAX_MAILBOX_NAME+1], *msgid;
-		unsigned long last;
 
 	      hdr:
 		if (arg2.s) *arg2.s = 0;
@@ -1164,41 +1169,47 @@
 	    }
 	    else if (!strcmp(cmd.s, "Listgroup")) {
 		arg1.len = 0;
+		arg2.s = arg2.s ? strcpy(arg2.s, "1-") : "1-";
+		be = backend_current;
 
 		if (c == ' ') {
 		    c = getword(nntp_in, &arg1); /* group (optional) */
 		    if (c == EOF) goto missingargs;
+		    if (c == ' ') {
+			c = getword(nntp_in, &arg2); /* range (optional) */
+			if (c == EOF) goto missingargs;
+		    }
 		}
 		if (c == '\r') c = prot_getc(nntp_in);
 		if (c != '\n') goto extraargs;
 
 		if (arg1.len) {
-		    r = open_group(arg1.s, 0, &backend_current, NULL);
+		    r = open_group(arg1.s, 0, &be, NULL);
 		    if (r) goto nogroup;
-
-		    if (nntp_group) {
-			nntp_exists = nntp_group->exists;
-			nntp_current = nntp_exists > 0;
-		    }
-		}
-		if (backend_current) {
+		}
+
+		if (be) {
 		    if (arg1.len)
-			prot_printf(backend_current->out, "LISTGROUP %s\r\n",
-				    arg1.s);
+			prot_printf(be->out, "LISTGROUP %s %s\r\n",
+				    arg1.s, arg2.s);
 		    else
-			prot_printf(backend_current->out, "LISTGROUP\r\n");
-
-		    r = read_response(backend_current, 0, &result);
+			prot_printf(be->out, "LISTGROUP\r\n");
+
+		    r = read_response(be, 0, &result);
 		    if (r) goto noopengroup;
 
 		    prot_printf(nntp_out, "%s", result);
 		    if (!strncmp(result, "211", 3)) {
-			pipe_to_end_of_response(backend_current, 0);
+			pipe_to_end_of_response(be, 0);
+
+			backend_current = be;
 		    }
 		}
 		else if (!nntp_group) goto noopengroup;
-		else {
-		    int i;
+		else if (parserange(arg2.s, &uid, &last, NULL, NULL) != -1) {
+		    int msgno, last_msgno;
+
+		    backend_current = NULL;
 
 		    nntp_exists = nntp_group->exists;
 		    nntp_current = nntp_exists > 0;
@@ -1211,8 +1222,12 @@
 				nntp_group->last_uid,
 				nntp_group->name + strlen(newsprefix));
 
-		    for (i = 1; i <= nntp_exists; i++)
-			prot_printf(nntp_out, "%u\r\n", index_getuid(i));
+		    msgno = index_finduid(uid);
+		    if (!msgno || index_getuid(msgno) != uid) msgno++;
+		    last_msgno = index_finduid(last);
+
+		    for (; msgno <= last_msgno; msgno++)
+			prot_printf(nntp_out, "%u\r\n", index_getuid(msgno));
 		    prot_printf(nntp_out, ".\r\n");
 		}
 	    }
@@ -1316,7 +1331,6 @@
 	case 'O':
 	    if (!strcmp(cmd.s, "Over")) {
 		char curgroup[MAX_MAILBOX_NAME+1], *msgid;
-		unsigned long last;
 
 	      over:
 		if (arg1.s) *arg1.s = 0;
@@ -1421,7 +1435,6 @@
 	    }
 	    else if (!strcmp(cmd.s, "Xpat")) {
 		char curgroup[MAX_MAILBOX_NAME+1], *msgid;
-		unsigned long last;
 
 		if (c != ' ') goto missingargs;
 		c = getword(nntp_in, &arg1); /* header */
@@ -1599,7 +1612,7 @@
     if (ret) *ret = NULL;
 
     if (!str || !*str) {
-	/* argument, use current article */
+	/* no argument, use current article */
 	if (backend_current) {
 	    if (ret) *ret = backend_current;
 	}
@@ -1623,7 +1636,6 @@
     else if (backend_current)
 	*ret = backend_current;
     else if (!nntp_group) goto noopengroup;
-    else if (!nntp_exists) goto noarticle;
     else if ((*uid = parsenum(str, &p)) <= 0) goto badrange;
     else if (p && *p) {
 	/* extra stuff, check for range */
@@ -1632,7 +1644,6 @@
 	    *last = parsenum(p, NULL);
 	else
 	    *last = index_getuid(nntp_exists);
-	if (*last <= 0 || *last < *uid) goto badrange;
     }
 
     if (last && !*last) *last = *uid;
@@ -1645,10 +1656,6 @@
 
   nocurrent:
     prot_printf(nntp_out, "420 Current article number is invalid\r\n");
-    return -1;
-
-  noarticle:
-    prot_printf(nntp_out, "423 No such article in this newsgroup\r\n");
     return -1;
 
   nomsgid:
@@ -1658,7 +1665,7 @@
     return -1;
 
   badrange:
-    prot_printf(nntp_out, "501 Bad message-id or range\r\n");
+    prot_printf(nntp_out, "501 Bad message-id, message number, or range\r\n");
     return -1;
 }
 
@@ -1831,7 +1838,10 @@
 
     /* add the reader capabilities/extensions */
     if ((nntp_capa & MODE_READ) && (nntp_userid || allowanonymous)) {
-	prot_printf(nntp_out, "READER POST LISTGROUP\r\n");
+	prot_printf(nntp_out, "READER\r\n");
+	prot_printf(nntp_out, "POST\r\n");
+	if (config_getswitch(IMAPOPT_ALLOWNEWNEWS))
+	    prot_printf(nntp_out, "NEWNEWS\r\n");
 	prot_printf(nntp_out, "HDR\r\n");
 	prot_printf(nntp_out, "OVER\r\n");
 	prot_printf(nntp_out, "XPAT\r\n");
@@ -1913,6 +1923,8 @@
 	prot_printf(nntp_out, "502 Could not read message file\r\n");
 	return;
     }
+
+    nntp_current = msgno;
 
     if (!by_msgid) msgid = index_get_msgid(nntp_group, msgno);
 
@@ -2203,16 +2215,22 @@
 static void cmd_hdr(char *cmd, char *hdr, char *pat, char *msgid,
 		    unsigned long uid, unsigned long last)
 {
+    int msgno, last_msgno;
+    int by_msgid = (msgid != NULL);
+    int found = 0;
+
     lcase(hdr);
 
-    prot_printf(nntp_out, "%u Headers follow:\r\n", cmd[0] == 'X' ? 221 : 225);
-
-    for (; uid <= last; uid++) {
+    msgno = index_finduid(uid);
+    if (!msgno || index_getuid(msgno) != uid) msgno++;
+    last_msgno = index_finduid(last);
+
+    for (; msgno <= last_msgno; msgno++) {
 	char *body;
-	int msgno = index_finduid(uid);
-	int by_msgid = (msgid != NULL);
-
-	if (!msgno || index_getuid(msgno) != uid) continue;
+
+	if (!found++)
+	    prot_printf(nntp_out, "%u Headers follow:\r\n",
+			cmd[0] == 'X' ? 221 : 225);
 
 	/* see if we're looking for metadata */
 	if (hdr[0] == ':') {
@@ -2228,10 +2246,12 @@
 			    size + strlen(xref) + 2); /* +2 for \r\n */
 	    }
 	    else if (!strcasecmp(":lines", hdr))
-		prot_printf(nntp_out, "%lu %lu\r\n", by_msgid ? 0 : uid,
+		prot_printf(nntp_out, "%u %lu\r\n",
+			    by_msgid ? 0 : index_getuid(msgno),
 			    index_getlines(nntp_group, msgno));
 	    else
-		prot_printf(nntp_out, "%lu \r\n", by_msgid ? 0 : uid);
+		prot_printf(nntp_out, "%u \r\n",
+			    by_msgid ? 0 : index_getuid(msgno));
 	}
 	else if (!strcmp(hdr, "xref") && !pat /* [X]HDR only */) {
 	    char xref[8192];
@@ -2240,16 +2260,21 @@
 	    build_xref(msgid, xref, sizeof(xref), 1);
 	    if (!by_msgid) free(msgid);
 
-	    prot_printf(nntp_out, "%lu %s\r\n", by_msgid ? 0 : uid, xref);
+	    prot_printf(nntp_out, "%u %s\r\n",
+			by_msgid ? 0 : index_getuid(msgno), xref);
 	}
 	else if ((body = index_getheader(nntp_group, msgno, hdr)) &&
 		 (!pat ||			/* [X]HDR */
 		  wildmat(body, pat))) {	/* XPAT with match */
-		prot_printf(nntp_out, "%lu %s\r\n", by_msgid ? 0 : uid, body);
-	}
-    }
-
-    prot_printf(nntp_out, ".\r\n");
+		prot_printf(nntp_out, "%u %s\r\n",
+			    by_msgid ? 0 : index_getuid(msgno), body);
+	}
+    }
+
+    if (found)
+	prot_printf(nntp_out, ".\r\n");
+    else
+	prot_printf(nntp_out, "423 No such article(s) in this newsgroup\r\n");
 }
 
 static void cmd_help(void)
@@ -2311,9 +2336,7 @@
 		    "\t\tList the descriptions of the specified newsgroups.\r\n");
 	prot_printf(nntp_out, "\tLIST OVERVIEW.FMT\r\n"
 		    "\t\tList the headers and metadata items available via OVER.\r\n");
-    }
-    if ((nntp_capa & MODE_READ) && (nntp_userid || allowanonymous)) {
-	prot_printf(nntp_out, "\tLISTGROUP [group]\r\n"
+	prot_printf(nntp_out, "\tLISTGROUP [group [range]]\r\n"
 		    "\t\tList the article numbers in the specified newsgroup.\r\n");
 	if (config_getswitch(IMAPOPT_ALLOWNEWNEWS))
 	    prot_printf(nntp_out, "\tNEWNEWS wildmat date time [GMT]\r\n"
@@ -2759,21 +2782,22 @@
 
 static void cmd_over(char *msgid, unsigned long uid, unsigned long last)
 {
-    int msgno;
+    int msgno, last_msgno;
     struct nntp_overview *over;
     int found = 0;
 
-    for (; uid <= last; uid++) {
-	msgno = index_finduid(uid);
-	if (!msgno || index_getuid(msgno) != uid) continue;
+    msgno = index_finduid(uid);
+    if (!msgno || index_getuid(msgno) != uid) msgno++;
+    last_msgno = index_finduid(last);
+
+    for (; msgno <= last_msgno; msgno++) {
+	if (!found++)
+	    prot_printf(nntp_out, "224 Overview information follows:\r\n");
 
 	if ((over = index_overview(nntp_group, msgno))) {
 	    char xref[8192];
 
 	    build_xref(over->msgid, xref, sizeof(xref), 0);
-
-	    if (!found++)
-		prot_printf(nntp_out, "224 Overview information follows:\r\n");
 
 	    prot_printf(nntp_out, "%lu\t%s\t%s\t%s\t%s\t%s\t%lu\t%lu\t%s\r\n",
 			msgid ? 0 : over->uid,
@@ -2790,7 +2814,7 @@
     if (found)
 	prot_printf(nntp_out, ".\r\n");
     else
-	prot_printf(nntp_out, "420 No articles selected\r\n");
+	prot_printf(nntp_out, "423 No such article(s) in this newsgroup\r\n");
 }
 
 
@@ -2923,6 +2947,8 @@
 	NULL
     };
     int addlen;
+
+    m->f = f;
 
     /* fill the cache */
     r = spool_fill_hdrcache(nntp_in, f, m->hdrcache, skipheaders);
@@ -3128,7 +3154,7 @@
 	else {
 	    /* close the tmpfile and use the stage */
 	    fclose(f);
-	    f = stagef;
+	    m->f = f = stagef;
 	}
     }
     /* else this is probably a remote group, so use the tmpfile */
@@ -3146,7 +3172,6 @@
 	return IMAP_IOERROR;
     }
     m->size = sbuf.st_size;
-    m->f = f;
     m->data = prot_new(fileno(f), 0);
 
     return 0;
@@ -3244,8 +3269,20 @@
 		    r = append_fromstream(&as, msg->data, msg->size, now,
 					  (const char **) NULL, 0);
 		}
-		if (!r) append_commit(&as, 0, NULL, &uid, NULL);
-		else append_abort(&as);
+		if (r || (msg->id &&   
+			  duplicate_check(msg->id, strlen(msg->id),
+					  rcpt, strlen(rcpt)))) {  
+		    append_abort(&as);
+		    
+		    if (!r) {
+			/* duplicate message */
+			duplicate_log(msg->id, rcpt, "nntp delivery");
+			continue;
+		    }            
+		}                
+		else {           
+		    r = append_commit(&as, 0, NULL, &uid, NULL);
+		}
 	    }
 
 	    if (!r && msg->id)

Modified: trunk/cyrus-imapd-2.2/imap/pop3d.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/pop3d.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/pop3d.c (original)
+++ trunk/cyrus-imapd-2.2/imap/pop3d.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  */
 
 /*
- * $Id: pop3d.c,v 1.166 2005/01/04 15:06:13 ken3 Exp $
+ * $Id: pop3d.c,v 1.167 2005/04/11 06:57:35 shadow Exp $
  */
 #include <config.h>
 
@@ -686,7 +686,18 @@
 	    if (!arg) {
 		if (popd_mailbox) {
 		    if (!mailbox_lock_index(popd_mailbox)) {
-			popd_mailbox->pop3_last_login = popd_login_time;
+		        int pollpadding =config_getint(IMAPOPT_POPPOLLPADDING);
+			int minpollsec = config_getint(IMAPOPT_POPMINPOLL)*60;
+		        if ((minpollsec > 0) && (pollpadding > 1)) { 
+			    int mintime = popd_login_time - (minpollsec*(pollpadding));
+			    if (popd_mailbox->pop3_last_login < mintime) {
+			        popd_mailbox->pop3_last_login = mintime + minpollsec; 
+			    } else {
+			        popd_mailbox->pop3_last_login += minpollsec;
+			    }
+		        } else { 
+			    popd_mailbox->pop3_last_login = popd_login_time;
+		        }
 			mailbox_write_index_header(popd_mailbox);
 			mailbox_unlock_index(popd_mailbox);
 		    }

Modified: trunk/cyrus-imapd-2.2/imap/proxyd.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/proxyd.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/proxyd.c (original)
+++ trunk/cyrus-imapd-2.2/imap/proxyd.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: proxyd.c,v 1.192 2004/12/17 16:32:20 ken3 Exp $ */
+/* $Id: proxyd.c,v 1.199 2006/02/07 20:57:27 murch Exp $ */
 
 #include <config.h>
 
@@ -146,6 +146,7 @@
 int proxyd_userisadmin;
 sasl_conn_t *proxyd_saslconn; /* the sasl connection context to the client */
 int proxyd_starttls_done = 0; /* have we done a successful starttls yet? */
+const char *plaintextloginalert = NULL;
 #ifdef HAVE_SSL
 static SSL *tls_conn;
 #endif /* HAVE_SSL */
@@ -275,38 +276,43 @@
     snprintf(tag, len, "PROXY%d", proxyd_cmdcnt++);
 }
 
-/* pipe_until_tag() reads from 's->in' until the tagged response
-   starting with 'tag' appears.  it returns the result of the
-   tagged command, and sets 's->last_result' with the tagged line. */
-
-/* 's->last_result' assumes that tagged responses are:
-   a) short
-   b) don't contain literals
-   
-   IMAP grammar allows both, unfortunately */
+/* pipe_response() reads from 's->in' until either the tagged response
+   starting with 'tag' appears, or if 'tag' is NULL, to the end of the
+   current line.  If 'include_tag' is set, the tagged line is included
+   in the output, otherwise the tagged line is stored in 's->last_result'. 
+   In either case, the result of the tagged command is returned.
+
+/* 's->last_result' assumes that tagged responses don't contain literals.
+   Unfortunately, the IMAP grammar allows them */
 
 /* force_notfatal says to not fatal() if we lose connection to backend_current
  * even though it is in 95% of the cases, a good idea... */
-static int pipe_until_tag(struct backend *s, char *tag, int force_notfatal)
+static int pipe_response(struct backend *s, char *tag, int include_tag,
+			 int force_notfatal)
 {
     char buf[2048];
     char eol[128];
     int sl;
-    int cont = 0, last = 0, r = -1;
-    size_t taglen = strlen(tag);
+    int cont = 0, last = !tag, r = PROXY_OK;
+    size_t taglen;
 
     s->timeout->mark = time(NULL) + IDLE_TIMEOUT;
-    
-    if(taglen >= sizeof(buf)) {
-	fatal("tag too large",EC_TEMPFAIL);
-    }
+
+    if (tag) {
+	taglen = strlen(tag);
+	if(taglen >= sizeof(buf)) {
+	    fatal("tag too large",EC_TEMPFAIL);
+	}
+    }
+
+    s->last_result.len = 0;
 
     /* the only complication here are literals */
-    while (!last || cont) {
+    do {
 	/* if 'cont' is set, we're looking at the continuation to a very
 	   long line.
 	   if 'last' is set, we've seen the tag we're looking for, we're
-	   just reading the end of the line, and we shouldn't echo it. */
+	   just reading the end of the line. */
 	if (!cont) eol[0] = '\0';
 
 	if (!prot_fgets(buf, sizeof(buf), s->in)) {
@@ -316,35 +322,50 @@
 	    proxyd_downserver(s);
 	    return PROXY_NOCONNECTION;
 	}
-	if (!cont && buf[taglen] == ' ' && !strncmp(tag, buf, taglen)) {
-	    strlcpy(s->last_result, buf + taglen + 1, sizeof(s->last_result));
-	    /* guarantee that 's->last_result' has \r\n\0 at the end */
-	    s->last_result[LAST_RESULT_LEN - 3] = '\r';
-	    s->last_result[LAST_RESULT_LEN - 2] = '\n';
-	    s->last_result[LAST_RESULT_LEN - 1] = '\0';
-	    switch (buf[taglen + 1]) {
-	    case 'O': case 'o':
-		r = PROXY_OK;
-		break;
-	    case 'N': case 'n':
-		r = PROXY_NO;
-		break;
-	    case 'B': case 'b':
-		r = PROXY_BAD;
-		break;
-	    default: /* huh? no result? */
-		if(s == backend_current && !force_notfatal)
-		    fatal("Lost connection to selected backend",
-			  EC_UNAVAILABLE);
-		proxyd_downserver(s);
-		r = PROXY_NOCONNECTION;
-		break;
-	    }
-
-	    last = 1;
-	}
+
+	sl = strlen(buf);
+
+	if (tag) {
+	    /* Check for the tagged line */
+	    if (!cont && buf[taglen] == ' ' && !strncmp(tag, buf, taglen)) {
+
+		switch (buf[taglen + 1]) {
+		case 'O': case 'o':
+		    r = PROXY_OK;
+		    break;
+		case 'N': case 'n':
+		    r = PROXY_NO;
+		    break;
+		case 'B': case 'b':
+		    r = PROXY_BAD;
+		    break;
+		default: /* huh? no result? */
+		    if(s == backend_current && !force_notfatal)
+			fatal("Lost connection to selected backend",
+			      EC_UNAVAILABLE);
+		    proxyd_downserver(s);
+		    r = PROXY_NOCONNECTION;
+		    break;
+		}
+
+		last = 1;
+	    }
 	
-	sl = strlen(buf);
+	    if (last && !include_tag) {
+		/* Store the tagged line */
+		if (sl > s->last_result.alloc - s->last_result.len) {
+		    s->last_result.alloc =
+			(s->last_result.alloc == 0) ? sizeof(buf) :
+			s->last_result.alloc * 2;
+		    s->last_result.s = xrealloc(s->last_result.s,
+						s->last_result.alloc+1);
+		}
+
+		strcpy(s->last_result.s + s->last_result.len, buf + taglen + 1);
+		s->last_result.len += sl - taglen - 1;
+	    }
+	}
+
 	if (sl == (sizeof(buf) - 1) && buf[sl-1] != '\n') {
             /* only got part of a line */
 	    /* we save the last 64 characters in case it has important
@@ -353,14 +374,14 @@
 
 	    /* write out this part, but we have to keep reading until we
 	       hit the end of the line */
-	    if (!last) prot_write(proxyd_out, buf, sl);
+	    if (!last || include_tag) prot_write(proxyd_out, buf, sl);
 	    cont = 1;
 	    continue;
 	} else {		/* we got the end of the line */
 	    int i;
 	    int litlen = 0, islit = 0;
 
-	    if (!last) prot_write(proxyd_out, buf, sl);
+	    if (!last || include_tag) prot_write(proxyd_out, buf, sl);
 
 	    /* now we have to see if this line ends with a literal */
 	    if (sl < 64) {
@@ -395,7 +416,7 @@
 			/* EOF or other error */
 			return -1;
 		    }
-		    if (!last) prot_write(proxyd_out, buf, j);
+		    if (!last || include_tag) prot_write(proxyd_out, buf, j);
 		    litlen -= j;
 		}
 
@@ -410,126 +431,34 @@
 
 	/* ok, let's read another line */
 	cont = 0;
-    }
+
+    } while (!last || cont);
 
     return r;
 }
 
-static int pipe_including_tag(struct backend *s, char *tag, int force_notfatal)
-{
+static int pipe_until_tag(struct backend *s, char *tag, int force_notfatal)
+{
+    return pipe_response(s, tag, 0, force_notfatal);
+}
+
+static int pipe_including_tag(struct backend *s, char *tag, int force_notfatal) {
     int r;
 
-    r = pipe_until_tag(s, tag, force_notfatal);
-    switch (r) {
-    case PROXY_OK:
-    case PROXY_NO:
-    case PROXY_BAD:
-	prot_printf(proxyd_out, "%s %s", tag, s->last_result);
-	break;
-    case PROXY_NOCONNECTION:
+    r = pipe_response(s, tag, 1, force_notfatal);
+    if (r == PROXY_NOCONNECTION) {
 	/* don't have to worry about downing the server, since
 	 * pipe_until_tag does that for us */
-	prot_printf(proxyd_out, "%s NO %s\r\n", tag, 
+	prot_printf(proxyd_out, "%s NO %s\r\n", tag,
 		    error_message(IMAP_SERVER_UNAVAILABLE));
-	break;
     }
     return r;
 }
 
 static int pipe_to_end_of_response(struct backend *s, int force_notfatal)
 {
-    char buf[2048];
-    char eol[128];
-    int sl;
-    int cont = 1, r = PROXY_OK;
-
-    s->timeout->mark = time(NULL) + IDLE_TIMEOUT;
-    
-    eol[0]='\0';
-
-    /* the only complication here are literals */
-    while (cont) {
-	/* if 'cont' is set, we're looking at the continuation to a very
-	   long line. */
-	if (!prot_fgets(buf, sizeof(buf), s->in)) {
-	    /* uh oh */
-	    if(s == backend_current && !force_notfatal)
-		fatal("Lost connection to selected backend", EC_UNAVAILABLE);
-	    proxyd_downserver(s);
-	    return PROXY_NOCONNECTION;
-	}
-	
-	sl = strlen(buf);
-	if (sl == (sizeof(buf) - 1) && buf[sl-1] != '\n') {
-            /* only got part of a line */
-	    /* we save the last 64 characters in case it has important
-	       literal information */
-	    strcpy(eol, buf + sl - 64);
-
-	    /* write out this part, but we have to keep reading until we
-	       hit the end of the line */
-	    prot_write(proxyd_out, buf, sl);
-	    cont = 1;
-	    continue;
-	} else {		/* we got the end of the line */
-	    int i;
-	    int litlen = 0, islit = 0;
-
-	    prot_write(proxyd_out, buf, sl);
-
-	    /* now we have to see if this line ends with a literal */
-	    if (sl < 64) {
-		strcat(eol, buf);
-	    } else {
-		strcat(eol, buf + sl - 63);
-	    }
-
-	    /* eol now contains the last characters from the line; we want
-	       to see if we've hit a literal */
-	    i = strlen(eol);
-	    if (i >= 4 &&
-		eol[i-1] == '\n' && eol[i-2] == '\r' && eol[i-3] == '}') {
-		/* possible literal */
-		i -= 4;
-		while (i > 0 && eol[i] != '{' && isdigit((int) eol[i])) {
-		    i--;
-		}
-		if (eol[i] == '{') {
-		    islit = 1;
-		    litlen = atoi(eol + i + 1);
-		}
-	    }
-
-	    /* copy the literal over */
-	    if (islit) {
-		while (litlen > 0) {
-		    int j = (litlen > sizeof(buf) ? sizeof(buf) : litlen);
-		    
-		    j = prot_read(s->in, buf, j);
-		    if(!j) {
-			/* EOF or other error */
-			return -1;
-		    }
-		    prot_write(proxyd_out, buf, j);
-		    litlen -= j;
-		}
-
-		/* none of our saved information has any relevance now */
-		eol[0] = '\0';
-		
-		/* have to keep going for the end of the line */
-		cont = 1;
-		continue;
-	    }
-	}
-
-	/* ok, if we're here, we're done */
-	cont = 0;
-    }
-
-    return r;
-}
-
+    return pipe_response(s, NULL, 0, force_notfatal);
+}
 
 /* copy our current input to 's' until we hit a true EOL.
 
@@ -700,11 +629,13 @@
 		return PROXY_NOCONNECTION;
 	    }	
 	    /* Got the end of the response */
-	    strlcpy(s->last_result, buf, sizeof(s->last_result));
-	    /* guarantee that 's->last_result' has \r\n\0 at the end */
-	    s->last_result[LAST_RESULT_LEN - 3] = '\r';
-	    s->last_result[LAST_RESULT_LEN - 2] = '\n';
-	    s->last_result[LAST_RESULT_LEN - 1] = '\0';
+	    if (s->last_result.alloc == 0) {
+		s->last_result.alloc = sizeof(buf);
+		s->last_result.s = xmalloc(s->last_result.alloc+1);
+	    }
+	    strcpy(s->last_result.s, buf);
+	    s->last_result.len = strlen(buf);
+
 	    switch (buf[0]) {
 	    case 'O': case 'o':
 		r = PROXY_OK;
@@ -893,8 +824,9 @@
 				       struct prot_waitevent *ev, void *rock)
 {
     struct backend *be = (struct backend *) rock;
-
-    if (be != backend_current) {
+    int is_active = (be->context ? *((int *) be->context) : 0);
+
+    if ((be != backend_current) && !is_active) {
 	/* server is not our current server, and idle too long.
 	 * down the backend server (removes the event as a side-effect)
 	 */
@@ -1192,6 +1124,9 @@
     i = 0;
     while (backend_cached[i]) {
 	proxyd_downserver(backend_cached[i]);
+	if (backend_cached[i]->last_result.s) {
+	    free(backend_cached[i]->last_result.s);
+	}
 	free(backend_cached[i]);
 	i++;
     }
@@ -1231,6 +1166,7 @@
     proxyd_userisadmin = 0;
     proxyd_starttls_done = 0;
     proxyd_logtime = 0;
+    plaintextloginalert = NULL;
 
     strcpy(proxyd_clienthost, "[local]");
 
@@ -1415,6 +1351,9 @@
     i = 0;
     while (backend_cached && backend_cached[i]) {
 	proxyd_downserver(backend_cached[i]);
+	if (backend_cached[i]->last_result.s) {
+	    free(backend_cached[i]->last_result.s);
+	}
 	free(backend_cached[i]);
 	i++;
     }
@@ -1534,6 +1473,12 @@
 	if(referral_kick) {
 	    kick_mupdate();
 	    referral_kick = 0;
+	}
+
+	if (plaintextloginalert) {
+	    prot_printf(proxyd_out, "* OK [ALERT] %s\r\n",
+			plaintextloginalert);
+	    plaintextloginalert = NULL;
 	}
 	
 	/* Only Authenticate/Login/Logout/Noop/Starttls 
@@ -2162,7 +2107,6 @@
     struct buf passwdbuf;
     char *passwd;
     char *reply = 0;
-    int plaintextloginpause;
     int r;
 
     if (proxyd_userid) {
@@ -2261,12 +2205,15 @@
 	       proxyd_starttls_done ? "+TLS" : "", 
 	       reply ? reply : "");
 
-	plaintextloginpause = config_getint(IMAPOPT_PLAINTEXTLOGINPAUSE);
-	if (plaintextloginpause) {
-
-	    /* Apply penalty only if not under layer */
-	    if (proxyd_starttls_done == 0)
+	/* Apply penalty only if not under layer */
+	if (!proxyd_starttls_done) {
+	    int plaintextloginpause = config_getint(IMAPOPT_PLAINTEXTLOGINPAUSE);
+	    if (plaintextloginpause) {
 		sleep(plaintextloginpause);
+	    }
+
+	    /* Fetch plaintext login nag message */
+	    plaintextloginalert = config_getstring(IMAPOPT_PLAINTEXTLOGINALERT);
 	}
     }
     
@@ -2809,7 +2756,7 @@
 void cmd_capability(char *tag)
 {
     const char *sasllist; /* the list of SASL mechanisms */
-    unsigned mechcount;
+    int mechcount;
 
     if (backend_current) {
 	char mytag[128];
@@ -2885,10 +2832,13 @@
 	if (!s) r = IMAP_SERVER_UNAVAILABLE;
     }
     if (!r) {
+	int is_active = 1;
+	s->context = (void*) &is_active;
 	prot_printf(s->out, "%s Append {%d+}\r\n%s ", tag, strlen(name), name);
-	if (!pipe_command(s, 16384)) {
+	if (!(r = pipe_command(s, 16384))) {
 	    pipe_until_tag(s, tag, 0);
 	}
+	s->context = NULL;
     } else {
 	eatline(proxyd_in, prot_getc(proxyd_in));
     }
@@ -2903,11 +2853,13 @@
     }
 
     if (r) {
-	prot_printf(proxyd_out, "%s NO %s\r\n", tag, error_message(r));
+	prot_printf(proxyd_out, "%s NO %s\r\n", tag,
+		    prot_error(proxyd_in) ? prot_error(proxyd_in) :
+		    error_message(r));
     } else {
 	/* we're allowed to reference last_result since the noop, if
 	   sent, went to a different server */
-	prot_printf(proxyd_out, "%s %s", tag, s->last_result);
+	prot_printf(proxyd_out, "%s %s", tag, s->last_result.s);
     }
 }
 
@@ -3162,7 +3114,7 @@
  */    
 void cmd_copy(char *tag, char *sequence, char *name, int usinguid)
 {
-    char *server;
+    char *server, *acl;
     char *cmd = usinguid ? "UID Copy" : "Copy";
     struct backend *s = NULL;
     char mailboxname[MAX_MAILBOX_NAME+1];
@@ -3172,7 +3124,7 @@
 
     r = (*proxyd_namespace.mboxname_tointernal)(&proxyd_namespace, name,
 						proxyd_userid, mailboxname);
-    if (!r) r = mlookup(mailboxname, &server, NULL, NULL);
+    if (!r) r = mlookup(mailboxname, &server, &acl, NULL);
     if (!r) s = proxyd_findserver(server);
 
     if (!s) {
@@ -3241,6 +3193,14 @@
 		c = chomp(backend_current->in, "exists\r");
 		if (c == '\n') { /* got EXISTS response */
 		    prot_printf(proxyd_out, "* %d EXISTS\r\n", seqno);
+		    continue;
+		}
+	    }
+	    if (c == EOF) {
+		/* XXX  the "exists" check above will eat "ex" */
+		c = chomp(backend_current->in, "punge\r");
+		if (c == '\n') { /* got EXPUNGE response */
+		    prot_printf(proxyd_out, "* %d EXPUNGE\r\n", seqno);
 		    continue;
 		}
 	    }
@@ -3374,6 +3334,14 @@
 		}
 	    }
 	    if (c == EOF) { /* not an exists response */
+		/* XXX  the "exists" check above will eat "ex" */
+		c = chomp(backend_current->in, "punge\r");
+		if (c == '\n') { /* got EXPUNGE response */
+		    prot_printf(proxyd_out, "* %d EXPUNGE\r\n", seqno);
+		    continue;
+		}
+	    }
+	    if (c == EOF) { /* not an exists response */
 		c = chomp(backend_current->in, "recent\r");
 		if (c == '\n') { /* got RECENT response */
 		    prot_printf(proxyd_out, "* %d RECENT\r\n", seqno);
@@ -3480,15 +3448,22 @@
 	    res = pipe_until_tag(s, tag, 0);
 
 	    if (res == PROXY_OK) {
-		appenduid = strchr(s->last_result, '[');
-		/* skip over APPENDUID */
-		appenduid += strlen("[appenduid ");
-		b = strchr(appenduid, ']');
-		*b = '\0';
-		prot_printf(proxyd_out, "%s OK [COPYUID %s] %s\r\n", tag,
-			    appenduid, error_message(IMAP_OK_COMPLETED));
+		int access = cyrus_acl_myrights(proxyd_authstate, acl);
+
+		if (access & ACL_READ) {
+		    appenduid = strchr(s->last_result.s, '[');
+		    /* skip over APPENDUID */
+		    appenduid += strlen("[appenduid ");
+		    b = strchr(appenduid, ']');
+		    *b = '\0';
+		    prot_printf(proxyd_out, "%s OK [COPYUID %s] %s\r\n", tag,
+				appenduid, error_message(IMAP_OK_COMPLETED));
+		} else {
+		    prot_printf(proxyd_out, "%s OK %s\r\n", tag,
+				error_message(IMAP_OK_COMPLETED));
+		}
 	    } else {
-		prot_printf(proxyd_out, "%s %s", tag, s->last_result);
+		prot_printf(proxyd_out, "%s %s", tag, s->last_result.s);
 	    }
 	} else {
 	    /* abort the append */
@@ -4532,7 +4507,7 @@
     }
 
     if (!r) {
-	prot_printf(proxyd_out, "%s %s", tag, s->last_result);
+	prot_printf(proxyd_out, "%s %s", tag, s->last_result.s);
     } else {
 	prot_printf(proxyd_out, "%s NO %s\r\n", tag, error_message(r));
     }
@@ -4578,7 +4553,7 @@
 	return 0;
     }
     
-    if (!(strncmp(name, "INBOX.", 6))) {
+    if ((!strncasecmp(name, "INBOX", 5) && (!name[5] || name[5] == '.'))) {
 	/* The user has a "personal" namespace. */
 	sawone[NAMESPACE_INBOX] = 1;
     } else if (mboxname_isusermailbox(name, 0)) {

Modified: trunk/cyrus-imapd-2.2/imap/quota.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/quota.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/quota.c (original)
+++ trunk/cyrus-imapd-2.2/imap/quota.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  *
  */
 
-/* $Id: quota.c,v 1.57 2004/06/30 19:23:26 ken3 Exp $ */
+/* $Id: quota.c,v 1.65 2005/05/27 16:49:13 ken3 Exp $ */
 
 
 #include <config.h>
@@ -97,19 +97,6 @@
 /* config.c stuff */
 const int config_need_data = CONFIG_NEED_PARTITION_DATA;
 
-/* forward declarations */
-void usage(void);
-void reportquota(void);
-int buildquotalist(char *domain, char **roots, int nroots);
-int fixquota_mailbox(char *name,
-		     int matchlen,
-		     int maycreate,
-		     void *rock);
-int fixquota(char *domain, int ispartial);
-int fixquota_fixroot(struct mailbox *mailbox,
-		     char *root);
-int fixquota_finish(int thisquota, struct txn **tid, unsigned long *count);
-
 struct fix_rock {
     char *domain;
     struct txn **tid;
@@ -123,13 +110,23 @@
     unsigned long newused;
 };
 
+/* forward declarations */
+void usage(void);
+void reportquota(void);
+int buildquotalist(char *domain, char **roots, int nroots,
+		   struct fix_rock *frock);
+int fixquota_mailbox(char *name, int matchlen, int maycreate, void *rock);
+int fixquota(struct fix_rock *frock);
+int fixquota_fixroot(struct mailbox *mailbox, char *root);
+int fixquota_finish(int thisquota, struct txn **tid, unsigned long *count);
+
 #define QUOTAGROW 300
 
 struct quotaentry *quota;
 int quota_num = 0, quota_alloc = 0;
 
-int firstquota;
-int redofix;
+int firstquota = 0;
+int redofix = 0;
 int partial;
 
 int main(int argc,char **argv)
@@ -138,6 +135,8 @@
     int fflag = 0;
     int r, code = 0;
     char *alt_config = NULL, *domain = NULL;
+    struct fix_rock frock;
+    struct txn *tid = NULL;
 
     if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
 
@@ -168,26 +167,38 @@
 	fatal(error_message(r), EC_CONFIG);
     }
 
+    /*
+     * Lock mailbox list to prevent mailbox creation/deletion
+     * during work
+     */
+    mboxlist_init(0);
+    mboxlist_open(NULL);
+
     quotadb_init(0);
     quotadb_open(NULL);
 
-    if (!r) r = buildquotalist(domain, argv+optind, argc-optind);
+    if (!r) {
+	frock.domain = domain;
+	frock.tid = &tid;
+	frock.change_count = 0;
+
+	r = buildquotalist(domain, argv+optind, argc-optind,
+			   fflag ? &frock : NULL);
+    }
 
     if (!r && fflag) {
-	mboxlist_init(0);
-	r = fixquota(domain, argc-optind);
-	mboxlist_done();
+	partial = argc-optind;
+	r = fixquota(&frock);
     }
 
     quotadb_close();
     quotadb_done();
 
-    if (!r) reportquota();
-
-    if (r) {
-	com_err("quota", r, (r == IMAP_IOERROR) ? error_message(errno) : NULL);
-	code = convert_code(r);
-    }
+    mboxlist_close();
+    mboxlist_done();
+
+    if (r) code = convert_code(r);
+    else reportquota();
 
     cyrus_done();
 
@@ -196,100 +207,123 @@
 
 void usage(void)
 {
-    fprintf(stderr, "usage: quota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
+    fprintf(stderr,
+	    "usage: quota [-C <alt_config>] [-d <domain>] [-f] [prefix]...\n");
     exit(EC_USAGE);
 }    
 
-struct find_rock {
-    char **roots;
-    int nroots;
-};
-
-static int find_p(void *rockp,
-		  const char *key, int keylen,
-		  const char *data __attribute__((unused)),
-		  int datalen __attribute__((unused)))
-{
-    struct find_rock *frock = (struct find_rock *) rockp;
-    int i;
-
-    /* If restricting our list, see if this quota root matches */
-    if (frock->nroots) {
-	const char *p;
-
-	/* skip over domain */
-	if (config_virtdomains && (p = strchr(key, '!'))) {
-	    keylen -= (++p - key);
-	    key = p;
-	}
-
- 	for (i = 0; i < frock->nroots; i++) {
-	    if (keylen >= strlen(frock->roots[i]) &&
-		!strncmp(key, frock->roots[i], strlen(frock->roots[i]))) {
-		break;
-	    }
-	}
-	if (i == frock->nroots) return 0;
-    }
-
-    return 1;
+void errmsg(const char *fmt, const char *arg, int err)
+{
+    char buf[1024];
+    int len;
+
+    len = snprintf(buf, sizeof(buf), fmt, arg);
+    if (len < sizeof(buf))
+	len += snprintf(buf+len, sizeof(buf)-len, ": %s", error_message(err));
+    if ((err == IMAP_IOERROR) && (len < sizeof(buf)))
+	len += snprintf(buf+len, sizeof(buf)-len, ": %%m");
+
+    syslog(LOG_ERR, buf);
+    fprintf(stderr, "%s\n", buf);
 }
 
 /*
- * Add a quota root to the list in 'quota'
- */
-static int find_cb(void *rockp __attribute__((unused)),
-		   const char *key, int keylen,
-		   const char *data, int datalen __attribute__((unused)))
-{
-    if (!data) return 0;
+ * A matching mailbox was found, process it.
+ */
+static int found_match(char *name, int matchlen, int maycreate, void *frock)
+{
+    int r;
 
     if (quota_num == quota_alloc) {
+	/* Create new qr list entry */
 	quota_alloc += QUOTAGROW;
 	quota = (struct quotaentry *)
-	  xrealloc((char *)quota, quota_alloc * sizeof(struct quotaentry));
-    }
-    memset(&quota[quota_num], 0, sizeof(struct quotaentry));
-    quota[quota_num].quota.root = xstrndup(key, keylen);
-    sscanf(data, "%lu %d",
-	   &quota[quota_num].quota.used, &quota[quota_num].quota.limit);
-  
-    quota_num++;
-
-    return 0;
+	    xrealloc((char *)quota, quota_alloc * sizeof(struct quotaentry));
+	memset(&quota[quota_num], 0, QUOTAGROW * sizeof(struct quotaentry));
+    }
+
+    /* See if the mailbox name corresponds to a quotaroot */
+    quota[quota_num].quota.root = name;
+    do {
+	r = quota_read(&quota[quota_num].quota, NULL, 0);
+    } while (r == IMAP_AGAIN);
+
+    switch (r) {
+    case 0:
+	/* Its a quotaroot! */
+	quota[quota_num++].quota.root = xstrdup(name);
+	break;
+    case IMAP_QUOTAROOT_NONEXISTENT:
+	if (!frock || !quota_num ||
+	    strncmp(name, quota[quota_num-1].quota.root,
+		    strlen(quota[quota_num-1].quota.root))) {
+	    /* Its not a quotaroot, and either we're not fixing quotas,
+	       or its not part of the most recent quotaroot */
+	    return 0;
+	}
+	break;
+    default:
+	return r;
+	break;
+    }
+
+    if (frock) {
+	/* Recalculate the quota (we need the subfolders too!) */
+	r = fixquota_mailbox(name, matchlen, maycreate, frock);
+    }
+
+    return r;
 }
 
 /*
  * Build the list of quota roots in 'quota'
  */
-int buildquotalist(char *domain, char **roots, int nroots)
-{
-    int i;
-    char buf[MAX_MAILBOX_NAME+1];
-    struct find_rock frock;
-
-    frock.roots = roots;
-    frock.nroots = nroots;
-
-    /* Translate separator in mailboxnames.
-     *
-     * We do this directly instead of using the mboxname_tointernal()
-     * function pointer because we know that we are using the internal
-     * namespace and so we don't have to allocate a buffer for the
-     * translated name.
+int buildquotalist(char *domain, char **roots, int nroots,
+		   struct fix_rock *frock)
+{
+    int i, r;
+    char buf[MAX_MAILBOX_NAME+1], *tail;
+    size_t domainlen = 0;
+
+    buf[0] = '\0';
+    tail = buf;
+    if (domain) {
+	domainlen = snprintf(buf, sizeof(buf), "%s!", domain);
+	tail += domainlen;
+    }
+
+    /*
+     * Walk through all given pattern(s) and resolve them to all
+     * matching mailbox names. Call found_match() for every mailbox
+     * name found. If no pattern is given, assume "*".
      */
-    for (i = 0; i < nroots; i++) {
-	mboxname_hiersep_tointernal(&quota_namespace, roots[i], 0);
-    }
-
-    buf[0] = '\0';
-    if (domain) snprintf(buf, sizeof(buf), "%s!", domain);
-
-    /* if we have exactly one root specified, narrow the search */
-    if (nroots == 1) strlcat(buf, roots[0], sizeof(buf));
-	    
-    config_quota_db->foreach(qdb, buf, strlen(buf),
-			     &find_p, &find_cb, &frock, NULL);
+    i = 0;
+    do {
+	if (nroots > 0) {
+	    /* Translate separator in quotaroot.
+	     *
+	     * We do this directly instead of using the mboxname_tointernal()
+	     * function pointer because we know that we are using the internal
+	     * namespace and so we don't have to allocate a buffer for the
+	     * translated name.
+	     */
+	    mboxname_hiersep_tointernal(&quota_namespace, roots[i], 0);
+
+	    strlcpy(tail, roots[i], sizeof(buf) - domainlen);
+	}
+	else {
+	    strlcpy(tail, "*", sizeof(buf) - domainlen);
+	}
+	i++;
+
+	r = (*quota_namespace.mboxlist_findall)(&quota_namespace, buf, 1, 0, 0,
+						&found_match, frock);
+	if (r < 0) {
+	    errmsg("failed building quota list for '%s'", buf, IMAP_IOERROR);
+	    return IMAP_IOERROR;
+	}
+
+    } while (i < nroots);
 
     return 0;
 }
@@ -300,7 +334,7 @@
 int fixquota_mailbox(char *name,
 		     int matchlen __attribute__((unused)),
 		     int maycreate __attribute__((unused)),
-		     void* rock)
+		     void *rock)
 {
     int r;
     struct mailbox mailbox;
@@ -341,7 +375,8 @@
     if (partial && thisquota == -1) return 0;
 
     r = mailbox_open_header(name, 0, &mailbox);
-    if (!r) {
+    if (r) errmsg("failed opening header for mailbox '%s'", name, r);
+    else {
 	if (thisquota == -1) {
 	    if (mailbox.quota.root) {
 		r = fixquota_fixroot(&mailbox, (char *)0);
@@ -352,8 +387,11 @@
 		strcmp(mailbox.quota.root, quota[thisquota].quota.root) != 0) {
 		r = fixquota_fixroot(&mailbox, quota[thisquota].quota.root);
 	    }
-	    if (!r) r = mailbox_open_index(&mailbox);
-   
+	    if (!r) {
+		r = mailbox_open_index(&mailbox);
+		if (r) errmsg("failed opening index for mailbox '%s'", name, r);
+	    }
+
 	    if (!r) quota[thisquota].newused += mailbox.quota_mailbox_used;
 	}
 
@@ -377,7 +415,10 @@
     redofix = 1;
 
     r = mailbox_lock_header(mailbox);
-    if (r) return r;
+    if (r) {
+	errmsg("failed locking header for mailbox '%s'", mailbox->name, r);
+	return r;
+    }
 
     printf("%s: quota root %s --> %s\n", mailbox->name,
 	   mailbox->quota.root ? mailbox->quota.root : "(none)",
@@ -393,6 +434,8 @@
 
     r = mailbox_write_header(mailbox);
     (void) mailbox_unlock_header(mailbox);
+    if (r) errmsg("failed writing header for mailbox '%s'", mailbox->name, r);
+
     return r;
 }
 
@@ -401,13 +444,17 @@
  */
 int fixquota_finish(int thisquota, struct txn **tid, unsigned long *count)
 {
-    int r;
+    int r = 0;
 
     if (!quota[thisquota].refcount) {
 	if (!quota[thisquota].deleted++) {
 	    printf("%s: removed\n", quota[thisquota].quota.root);
 	    r = quota_delete(&quota[thisquota].quota, tid);
-	    if (r) return r;
+	    if (r) {
+		errmsg("failed deleting quotaroot '%s'",
+		       quota[thisquota].quota.root, r);
+		return r;
+	    }
 	    (*count)++;
 	    free(quota[thisquota].quota.root);
 	    quota[thisquota].quota.root = NULL;
@@ -418,7 +465,11 @@
     if (quota[thisquota].quota.used != quota[thisquota].newused) {
 	/* re-read the quota with the record locked */
 	r = quota_read(&quota[thisquota].quota, tid, 1);
-	if (r) return r;
+	if (r) {
+	    errmsg("failed reading quotaroot '%s'",
+		   quota[thisquota].quota.root, r);
+	    return r;
+	}
 	(*count)++;
     }
     if (quota[thisquota].quota.used != quota[thisquota].newused) {
@@ -426,7 +477,11 @@
 	       quota[thisquota].quota.used, quota[thisquota].newused);
 	quota[thisquota].quota.used = quota[thisquota].newused;
 	r = quota_write(&quota[thisquota].quota, tid);
-	if (r) return r;
+	if (r) {
+	    errmsg("failed writing quotaroot '%s'",
+		   quota[thisquota].quota.root, r);
+	    return r;
+	}
 	(*count)++;
     }
 
@@ -436,55 +491,50 @@
 	*tid = NULL;
     }
 
-    return 0;
+    return r;
 }
 
 
 /*
  * Fix all the quota roots
  */
-int fixquota(char *domain, int ispartial)
-{
-    int r = 0;
-    static char pattern[2] = "*";
-    struct fix_rock frock;
-    struct txn *tid = NULL;
-
-    /*
-     * Lock mailbox list to prevent mailbox creation/deletion
-     * during the fix
-     */
-    mboxlist_open(NULL);
-
-    frock.domain = domain;
-    frock.tid = &tid;
-    frock.change_count = 0;
-
-    redofix = 1;
+int fixquota(struct fix_rock *frock)
+{
+    int i, r = 0;
+
     while (!r && redofix) {
+	while (!r && firstquota < quota_num) {
+	    r = fixquota_finish(firstquota++, frock->tid, &frock->change_count);
+	}
+
 	redofix = 0;
 	firstquota = 0;
-	partial = ispartial;
-
-	r = (*quota_namespace.mboxlist_findall)(&quota_namespace, pattern, 1,
-						0, 0, fixquota_mailbox, &frock);
-	while (!r && firstquota < quota_num) {
-	    r = fixquota_finish(firstquota++, &tid, &frock.change_count);
-	}
-    }
-
-    if (!r && tid) quota_commit(&tid);
+
+	/*
+	 * Loop over all qr entries and recalculate the quota.
+	 * We need the subfolders too!
+	 */
+	for (i = 0; !r && i < quota_num; i++) {
+	    r = (*quota_namespace.mboxlist_findall)(&quota_namespace,
+						    quota[i].quota.root,
+						    1, 0, 0, fixquota_mailbox,
+						    frock);
+	}
+    }
+
+    while (!r && firstquota < quota_num) {
+	r = fixquota_finish(firstquota++, frock->tid, &frock->change_count);
+    }
+
+    if (!r && *(frock->tid)) quota_commit(frock->tid);
     
-    mboxlist_close();
-
     return 0;
 }
     
 /*
  * Print out the quota report
  */
-void
-reportquota(void)
+void reportquota(void)
 {
     int i;
     char buf[MAX_MAILBOX_PATH+1];

Modified: trunk/cyrus-imapd-2.2/imap/smmapd.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/smmapd.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/smmapd.c (original)
+++ trunk/cyrus-imapd-2.2/imap/smmapd.c Fri Mar 31 20:18:13 2006
@@ -72,7 +72,7 @@
  * may contain an explanatory message.
  *
  *
- * $Id: smmapd.c,v 1.11 2004/12/17 16:32:22 ken3 Exp $
+ * $Id: smmapd.c,v 1.13 2005/04/13 15:42:04 shadow Exp $
  */
 
 #include <config.h>
@@ -199,6 +199,7 @@
     r = begin_handling();
 
     shut_down(r);
+    return 0;
 }
 
 int verify_user(const char *key, long quotacheck,
@@ -264,6 +265,14 @@
 	long aclcheck = !user ? ACL_POST : 0;
 	int type;
 	char *acl;
+        char *path;
+        char *c;
+        struct hostent *hp;
+        char *host;
+        struct sockaddr_in sin,sfrom;
+        char buf[512];
+        int soc, x, rc;
+
 	/*
 	 * check to see if mailbox exists and we can append to it:
 	 *
@@ -271,10 +280,10 @@
 	 * - don't care about ACL on INBOX (always allow post)
 	 * - don't care about message size (1 msg over quota allowed)
 	 */
-	r = mboxlist_detail(namebuf, &type, NULL, NULL, &acl, NULL);
+	r = mboxlist_detail(namebuf, &type, &path, NULL, &acl, NULL);
 	if (r == IMAP_MAILBOX_NONEXISTENT && config_mupdate_server) {
 	    kick_mupdate();
-	    r = mboxlist_detail(namebuf, &type, NULL, NULL, &acl, NULL);
+	    r = mboxlist_detail(namebuf, &type, &path, NULL, &acl, NULL);
 	}
 
 	if (!r && (type & MBTYPE_REMOTE)) {
@@ -287,9 +296,55 @@
 	    if ((access & aclcheck) != aclcheck) {
 		r = (access & ACL_LOOKUP) ?
 		    IMAP_PERMISSION_DENIED : IMAP_MAILBOX_NONEXISTENT;
+                return r;
 	    } else {
-		r = 0;
-	    }
+                r = 0;
+            }
+
+            /* proxy the request to the real backend server to 
+             * check the quota.  if this fails, just return 0
+             * (asuume under quota)
+             */
+
+            host = strdup(path);
+            c = strchr(host, '!');
+            if (c) *c = 0;
+
+            syslog(LOG_ERR, "verify_user(%s) proxying to host %s",
+                   namebuf, host);
+
+            hp = gethostbyname(host);
+            if (hp == (struct hostent*) 0) {
+               syslog(LOG_ERR, "verify_user(%s) failed: can't find host %s",
+                      namebuf, host);
+               return r;
+            }
+
+            soc = socket(PF_INET, SOCK_STREAM, 0);
+            memcpy(&sin.sin_addr.s_addr,hp->h_addr,hp->h_length);
+            sin.sin_family = AF_INET;
+
+            /* XXX port should be configurable */
+            sin.sin_port = htons(12345);
+
+            if (connect(soc,(struct sockaddr *) &sin, sizeof(sin)) < 0) { 
+                syslog(LOG_ERR, "verify_user(%s) failed: can't connect to %s", 
+                       namebuf, host);
+               return r;
+            }
+
+            sprintf(buf,"%d:cyrus %s,%c",strlen(key)+6,key,4);
+            sendto(soc,buf,strlen(buf),0,(struct sockaddr *)&sin,sizeof(sin));
+
+            x = sizeof(sfrom);
+            rc = recvfrom(soc,buf,512,0,(struct sockaddr *)&sfrom,&x);
+ 
+            buf[rc] = '\0';
+            close(soc);
+
+	    prot_printf(map_out, "%s", buf);
+            return -1;   /* tell calling function we already replied */
+
 	} else if (!r) {
 	    r = append_check(namebuf, MAILBOX_FORMAT_NORMAL, authstate,
 			     aclcheck, quotacheck > 0 ? 0 : quotacheck);
@@ -362,6 +417,10 @@
 	}
 
 	switch (r) {
+        case -1:
+            /* reply already sent */
+            break;
+
 	case 0:
 	    prot_printf(map_out, "%d:OK %s,", 3+strlen(key), key);
 	    break;

Modified: trunk/cyrus-imapd-2.2/imap/spool.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/spool.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/spool.c (original)
+++ trunk/cyrus-imapd-2.2/imap/spool.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  *
  */
 /*
- * $Id: spool.c,v 1.7 2004/10/27 20:40:50 shadow Exp $
+ * $Id: spool.c,v 1.8 2005/10/24 12:57:59 ken3 Exp $
  */
 
 #include <config.h>

Modified: trunk/cyrus-imapd-2.2/imap/tls.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/tls.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/tls.c (original)
+++ trunk/cyrus-imapd-2.2/imap/tls.c Fri Mar 31 20:18:13 2006
@@ -93,7 +93,7 @@
 *
 */
 
-/* $Id: tls.c,v 1.50 2004/05/04 19:47:34 rjs3 Exp $ */
+/* $Id: tls.c,v 1.51 2005/10/28 14:45:19 ken3 Exp $ */
 
 #include <config.h>
 
@@ -357,8 +357,7 @@
 			  const char *cert_file, const char *key_file)
 {
     if (cert_file != NULL) {
-	if (SSL_CTX_use_certificate_file(ctx, cert_file,
-					 SSL_FILETYPE_PEM) <= 0) {
+	if (SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0) {
 	    syslog(LOG_ERR, "unable to get certificate from '%s'", cert_file);
 	    return (0);
 	}

Modified: trunk/cyrus-imapd-2.2/imap/version.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/version.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/version.c (original)
+++ trunk/cyrus-imapd-2.2/imap/version.c Fri Mar 31 20:18:13 2006
@@ -37,7 +37,7 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: version.c,v 1.18 2004/06/21 15:31:13 rjs3 Exp $
+ * $Id: version.c,v 1.19 2005/02/16 20:37:58 shadow Exp $
  */
 
 #include <config.h>
@@ -159,14 +159,16 @@
     snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
 	     "; UCD-SNMP %s", VersionInfo);
 #endif
+#ifdef HAVE_NETSNMP
+    snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
+	     "; NET-SNMP");
+#endif
     snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
 	     "; mmap = %s", map_method_desc);
     snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
 	     "; lock = %s", lock_method_desc);
     snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
 	     "; nonblock = %s", nonblock_method_desc);
-    snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
-	     "; auth = %s", auth_method_desc);
 #ifdef HAVE_KRB
     snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
 	     " (%s)", krb4_version);

Modified: trunk/cyrus-imapd-2.2/imap/version.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imap/version.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imap/version.h (original)
+++ trunk/cyrus-imapd-2.2/imap/version.h Fri Mar 31 20:18:13 2006
@@ -37,10 +37,10 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: version.h,v 1.139 2005/02/14 16:43:51 shadow Exp $
+ * $Id: version.h,v 1.140 2006/03/29 19:08:06 murch Exp $
  */
 
-#define _CYRUS_VERSION "v2.2.12"
+#define _CYRUS_VERSION "v2.2.13"
 
 /* EXTRA_IDENT is a hack to add some version information for which compile
  * was used to build this version (at CMU, but we don't care what you do with

Modified: trunk/cyrus-imapd-2.2/imtest/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imtest/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imtest/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/imtest/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,4 +1,4 @@
 /.cvsignore/1.3/Wed Oct 22 18:03:01 2003//
 /Makefile.in/1.30/Fri May 28 18:03:03 2004//
-/imtest.c/1.104/Tue Dec  7 19:26:22 2004//
+/imtest.c/1.107/Fri Jan 20 20:31:23 2006//
 D

Modified: trunk/cyrus-imapd-2.2/imtest/imtest.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/imtest/imtest.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/imtest/imtest.c (original)
+++ trunk/cyrus-imapd-2.2/imtest/imtest.c Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 /* imtest.c -- IMAP/POP3/NNTP/LMTP/SMTP/MUPDATE/MANAGESIEVE test client
  * Ken Murchison (multi-protocol implementation)
  * Tim Martin (SASL implementation)
- * $Id: imtest.c,v 1.104 2004/12/07 19:26:22 ken3 Exp $
+ * $Id: imtest.c,v 1.107 2006/01/20 20:31:23 jeaton Exp $
  *
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -328,8 +328,7 @@
 static int set_cert_stuff(SSL_CTX * ctx, char *cert_file, char *key_file)
 {
     if (cert_file != NULL) {
-	if (SSL_CTX_use_certificate_file(ctx, cert_file,
-					 SSL_FILETYPE_PEM) <= 0) {
+	if (SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0) {
 	    printf("unable to get certificate from '%s'\n", cert_file);
 	    return (0);
 	}
@@ -1086,12 +1085,12 @@
 	    prot_write(pout, inbase64, inbase64len);
 
 	    out = NULL;
-	} else if(sendliteral) {
+	} else if (sendliteral) {
 	    /* If we had no response, we still need to send the
 	       empty literal in this case */
 	    printf("{0+}\r\nC: ");
 	    prot_printf(pout, "{0+}\r\n");
-	} else {
+	} else if (!initial_response) {
 	    printf("C: ");
 	}
       noinitresp:
@@ -1283,7 +1282,10 @@
     FD_SET(fd_out, &write_set);
     FD_SET(sock, &write_set);
     
-    nfds = getdtablesize();
+    nfds = fd;
+    if (nfds < sock) nfds = sock;
+    if (nfds < fd_out) nfds = fd_out;
+    nfds++;
     
     if (filename != NULL) {
 	donewritingfile = 0;

Modified: trunk/cyrus-imapd-2.2/lib/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/lib/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,27 +1,28 @@
 /.cvsignore/1.2/Wed Oct 22 18:03:03 2003//
 /Makefile.dist/1.2/Wed Oct 22 18:03:03 2003//
-/Makefile.in/1.62/Fri May 28 18:03:04 2004//
+/Makefile.in/1.64/Tue Jan 10 23:18:48 2006//
 /acl.c/1.10/Thu Feb 13 20:15:38 2003//
 /acl.h/1.16/Fri Mar  5 19:19:21 2004//
 /acl_afs.c/1.24/Fri Mar  5 19:19:21 2004//
 /assert.c/1.18/Wed Oct 22 18:50:12 2003//
 /assert.h/1.10/Thu Feb 13 20:15:38 2003//
-/auth.h/1.15/Wed Oct 22 18:50:12 2003//
-/auth_krb.c/1.40/Tue Nov 11 03:26:00 2003//
-/auth_krb5.c/1.3/Fri Jan 16 15:28:58 2004//
-/auth_pts.c/1.7/Tue Feb 24 23:11:37 2004//
+/auth.c/1.1/Wed Feb 16 20:38:01 2005//
+/auth.h/1.16/Wed Feb 16 20:38:01 2005//
+/auth_krb.c/1.41/Wed Feb 16 20:38:01 2005//
+/auth_krb5.c/1.4/Wed Feb 16 20:38:01 2005//
+/auth_pts.c/1.9/Fri Jan 20 20:34:07 2006//
 /auth_pts.h/1.2/Wed Oct 22 18:03:04 2003//
-/auth_unix.c/1.38/Mon Sep 13 22:49:29 2004//
+/auth_unix.c/1.39/Wed Feb 16 20:38:01 2005//
 /bsearch.c/1.19/Thu Feb 13 20:15:39 2003//
 /bsearch.h/1.7/Thu Feb 13 20:15:39 2003//
 /charset.c/1.44/Wed Oct 22 18:50:12 2003//
 /charset.h/1.19/Wed Oct 22 18:50:12 2003//
 /chartable.h/1.5/Thu Feb 13 20:15:39 2003//
-/cyrusdb.c/1.9/Tue Jan 20 01:11:03 2004//
-/cyrusdb.h/1.29/Thu Mar 11 18:36:44 2004//
-/cyrusdb_berkeley.c/1.9/Wed Nov 17 15:41:31 2004//
+/cyrusdb.c/1.10/Wed Jan  4 02:06:23 2006//
+/cyrusdb.h/1.30/Wed Jan  4 02:06:23 2006//
+/cyrusdb_berkeley.c/1.14/Fri Mar 17 16:12:32 2006//
 /cyrusdb_flat.c/1.35/Thu Mar 11 18:36:45 2004//
-/cyrusdb_quotalegacy.c/1.10/Wed Aug  4 13:03:19 2004//
+/cyrusdb_quotalegacy.c/1.12/Wed Apr 20 18:46:09 2005//
 /cyrusdb_skiplist.c/1.50/Tue Jun  8 19:55:17 2004//
 /exitcodes.h/1.5/Thu Feb 13 20:15:39 2003//
 /ftruncate.c/1.8/Thu Feb 13 20:15:39 2003//
@@ -36,19 +37,19 @@
 /gmtoff_tm.c/1.10/Fri Feb 27 18:17:33 2004//
 /hash.c/1.12/Mon May 24 14:32:34 2004//
 /hash.h/1.9/Wed Oct 22 18:50:12 2003//
-/imapoptions/1.30/Wed Jul 21 19:07:45 2004//
+/imapoptions/1.36/Thu Mar 30 15:49:58 2006//
 /imapurl.c/1.11/Wed May  5 22:34:18 2004//
 /imapurl.h/1.5/Thu Feb 13 20:15:40 2003//
-/imclient.c/1.84/Wed Oct 22 18:50:12 2003//
-/imclient.h/1.26/Wed Oct 22 18:50:12 2003//
+/imclient.c/1.86/Fri Oct 28 14:45:22 2005//
+/imclient.h/1.27/Mon Apr 11 05:48:25 2005//
 /imparse.c/1.12/Thu Feb 13 20:15:40 2003//
 /imparse.h/1.7/Thu Feb 13 20:15:40 2003//
 /iptostring.c/1.7/Tue Mar  9 18:08:43 2004//
 /iptostring.h/1.3/Thu Feb 13 20:15:40 2003//
-/libconfig.c/1.9/Sat May 22 03:45:54 2004//
+/libconfig.c/1.10/Wed Mar 23 19:44:59 2005//
 /libconfig.h/1.4/Mon Dec 29 20:22:55 2003//
-/libcyr_cfg.c/1.10/Tue Mar  9 15:05:58 2004//
-/libcyr_cfg.h/1.7/Tue Mar  9 15:05:58 2004//
+/libcyr_cfg.c/1.12/Wed Mar 23 19:44:59 2005//
+/libcyr_cfg.h/1.9/Wed Mar 23 19:44:59 2005//
 /lock.h/1.7/Thu Feb 13 20:15:40 2003//
 /lock_fcntl.c/1.16/Thu Feb 13 20:15:40 2003//
 /lock_flock.c/1.15/Thu Feb 13 20:15:41 2003//
@@ -62,8 +63,8 @@
 /mkchartable.c/1.25/Wed May 14 18:56:34 2003//
 /mkgmtime.c/1.10/Wed Oct 22 18:50:12 2003//
 /mkgmtime.h/1.5/Thu Feb 13 20:15:41 2003//
-/mpool.c/1.14/Wed Oct 22 18:50:12 2003//
-/mpool.h/1.10/Wed Oct 22 18:50:12 2003//
+/mpool.c/1.15/Tue Jan 10 18:14:53 2006//
+/mpool.h/1.11/Tue Jan 10 18:14:53 2006//
 /nonblock.h/1.8/Wed Oct 22 18:50:12 2003//
 /nonblock_fcntl.c/1.15/Wed Oct 22 18:50:12 2003//
 /nonblock_ioctl.c/1.11/Wed Oct 22 18:50:12 2003//
@@ -86,6 +87,10 @@
 /util.h/1.18/Fri Sep 10 13:38:41 2004//
 /wildmat.c/1.2/Wed Oct 22 18:03:05 2003//
 /wildmat.h/1.2/Wed Oct 22 18:03:05 2003//
-/xmalloc.c/1.29/Thu Feb 13 20:15:42 2003//
-/xmalloc.h/1.25/Wed Oct 22 18:50:12 2003//
+/xmalloc.c/1.30/Tue Jan 10 23:18:48 2006//
+/xmalloc.h/1.26/Tue Jan 10 23:18:48 2006//
+/xstrlcat.c/1.1/Tue Jan 10 23:18:48 2006//
+/xstrlcat.h/1.1/Tue Jan 10 23:18:48 2006//
+/xstrlcpy.c/1.1/Tue Jan 10 23:18:48 2006//
+/xstrlcpy.h/1.1/Tue Jan 10 23:18:48 2006//
 D

Modified: trunk/cyrus-imapd-2.2/lib/Makefile.in
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/Makefile.in?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2/lib/Makefile.in Fri Mar 31 20:18:13 2006
@@ -40,10 +40,10 @@
 # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: Makefile.in,v 1.62 2004/05/28 18:03:04 rjs3 Exp $
+# $Id: Makefile.in,v 1.64 2006/01/10 23:18:48 jeaton Exp $
 
 # Authorization namespace.
-AUTH=auth_ at WITH_AUTH@.o
+AUTH=auth.o auth_krb.o auth_unix.o auth_krb5.o auth_pts.o
 
 # ACL interpretation.  Only one choice for now:
 ACL=acl_afs.o
@@ -83,7 +83,7 @@
 	$(srcdir)/nonblock.h $(srcdir)/parseaddr.h $(srcdir)/prot.h \
 	$(srcdir)/retry.h $(srcdir)/sysexits.h $(srcdir)/strhash.h \
 	$(srcdir)/lsort.h $(srcdir)/stristr.h \
-	$(srcdir)/util.h $(srcdir)/xmalloc.h $(srcdir)/imapurl.h \
+	$(srcdir)/util.h $(srcdir)/xstrlcpy.h $(srcdir)/xstrlcat.h $(srcdir)/xmalloc.h $(srcdir)/imapurl.h \
 	$(srcdir)/cyrusdb.h $(srcdir)/iptostring.h $(srcdir)/rfc822date.h \
 	$(srcdir)/libcyr_cfg.h
 
@@ -93,13 +93,13 @@
 	chartable.o imapurl.o nonblock_ at WITH_NONBLOCK@.o lock_ at WITH_LOCK@.o \
 	gmtoff_ at WITH_GMTOFF@.o map_ at WITH_MAP@.o $(ACL) $(AUTH) \
 	@LIBOBJS@ @CYRUSDB_OBJS@ \
-	iptostring.o xmalloc.o wildmat.o
+	iptostring.o xstrlcpy.o xstrlcat.o xmalloc.o wildmat.o
 
-LIBCYRM_HDRS = $(srcdir)/hash.h $(srcdir)/mpool.h $(srcdir)/xmalloc.h \
-	$(srcdir)/strhash.o $(srcdir)/libconfig.h $(srcdir)/assert.h \
-	imapopts.h
-LIBCYRM_OBJS = libconfig.o imapopts.o hash.o mpool.o xmalloc.o strhash.o \
-	assert.o @IPV6_OBJS@
+LIBCYRM_HDRS = $(srcdir)/hash.h $(srcdir)/mpool.h $(srcdir)/xstrlcpy.h $(srcdir)/xstrlcat.h $(srcdir)/xmalloc.h \
+	$(srcdir)/strhash.o $(srcdir)/libconfig.h \
+	$(srcdir)/assert.h imapopts.h
+LIBCYRM_OBJS = libconfig.o imapopts.o hash.o mpool.o xstrlcpy.o xstrlcat.o xmalloc.o \
+	strhash.o assert.o @IPV6_OBJS@
 
 all: $(BUILTSOURCES) libcyrus_min.a libcyrus.a
 
@@ -149,8 +149,8 @@
 #	./mkchartable -m $(srcdir)/charset/unicode.map $(srcdir)/charset/*.t >x-chartables.h
 #	mv x-chartables.h chartables.h
 
-mkchartable: mkchartable.o xmalloc.o assert.o
-	$(CC) $(LDFLAGS) -o mkchartable mkchartable.o xmalloc.o assert.o
+mkchartable: mkchartable.o xstrlcpy.o xstrlcat.o xmalloc.o assert.o
+	$(CC) $(LDFLAGS) -o mkchartable mkchartable.o xstrlcpy.o xstrlcat.o xmalloc.o assert.o
 
 clean:
 	rm -f *.o *.a chartable.c Makefile.bak mkchartable makedepend.log \

Added: trunk/cyrus-imapd-2.2/lib/auth.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/auth.c?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/auth.c (added)
+++ trunk/cyrus-imapd-2.2/lib/auth.c Fri Mar 31 20:18:13 2006
@@ -1,0 +1,119 @@
+/* 
+ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For permission or any other legal
+ *    details, please contact  
+ *      Office of Technology Transfer
+ *      Carnegie Mellon University
+ *      5000 Forbes Avenue
+ *      Pittsburgh, PA  15213-3890
+ *      (412) 268-4387, fax: (412) 268-7395
+ *      tech-transfer at andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Computing Services
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: auth.c,v 1.1 2005/02/16 20:38:01 shadow Exp $ */
+
+#include <config.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "auth.h"
+#include "exitcodes.h"
+#include "libcyr_cfg.h"
+#include "xmalloc.h"
+
+struct auth_mech *auth_mechs[] = {
+    &auth_unix,
+    &auth_pts,
+#ifdef HAVE_KRB
+    &auth_krb,
+#endif
+#ifdef HAVE_GSSAPI_H
+    &auth_krb5,
+#endif
+    NULL };
+
+static struct auth_mech *auth_fromname()
+{
+    int i;
+    const char *name = libcyrus_config_getstring(CYRUSOPT_AUTH_MECH);
+    static struct auth_mech *auth = NULL;
+
+    if (auth)
+        return auth;
+
+    for (i = 0; auth_mechs[i]; i++) {
+	if (!strcmp(auth_mechs[i]->name, name)) {
+	    auth = auth_mechs[i]; break;
+	}
+    }
+    if (!auth) {
+	char errbuf[1024];
+	snprintf(errbuf, sizeof(errbuf),
+		 "Authorization mechanism %s not supported", name);
+	fatal(errbuf, EC_CONFIG);
+    }
+
+    return auth;
+}
+
+int auth_memberof(auth_state, identifier)
+struct auth_state *auth_state;
+const char *identifier;
+{
+    struct auth_mech *auth = auth_fromname();
+
+    return auth->memberof(auth_state, identifier);
+}
+
+char *auth_canonifyid(identifier, len)
+const char *identifier;
+size_t len;
+{
+    struct auth_mech *auth = auth_fromname();
+
+    return auth->canonifyid(identifier, len);
+}
+
+struct auth_state *auth_newstate(identifier)
+const char *identifier;
+{
+    struct auth_mech *auth = auth_fromname();
+
+    return auth->newstate(identifier);
+}
+
+void auth_freestate(auth_state)
+struct auth_state *auth_state;
+{
+    struct auth_mech *auth = auth_fromname();
+
+    auth->freestate(auth_state);
+}

Propchange: trunk/cyrus-imapd-2.2/lib/auth.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/cyrus-imapd-2.2/lib/auth.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/auth.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/auth.h (original)
+++ trunk/cyrus-imapd-2.2/lib/auth.h Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* auth.h -- Site authorization module
- * $Id: auth.h,v 1.15 2003/10/22 18:50:12 rjs3 Exp $
+ * $Id: auth.h,v 1.16 2005/02/16 20:38:01 shadow Exp $
  *
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -44,20 +44,37 @@
 #ifndef INCLUDED_AUTH_H
 #define INCLUDED_AUTH_H
 
-extern const char *auth_method_desc;
+struct auth_state;
 
-struct auth_state;
+struct auth_mech {
+    const char *name;
+
+    char *(*canonifyid)(const char *identifier, size_t len);
+    int (*memberof)(struct auth_state *auth_state, 
+             const char *identifier);
+    struct auth_state *(*newstate)(const char *identifier);
+    void (*freestate)(struct auth_state *auth_state);
+};
+
+extern struct auth_mech *auth_mechs[];
+
+/* Note that some of these may be undefined symbols
+ * if libcyrus was not built with support for them */
+extern struct auth_mech auth_unix;
+extern struct auth_mech auth_pts;
+extern struct auth_mech auth_krb;
+extern struct auth_mech auth_krb5;
 
 /* auth_canonifyid: canonify the given identifier and return a pointer
  *                  to a static buffer with the canonified ID, or NULL on
  *                  failure */
 /* identifier: id to canonify */
 /* len: length of id, or 0 to do strlen(identifier) */
-extern char *auth_canonifyid(const char *identifier, size_t len);
+char *auth_canonifyid(const char *identifier, size_t len);
 
-extern int auth_memberof(struct auth_state *auth_state, 
-			 const char *identifier);
-extern struct auth_state *auth_newstate(const char *identifier);
-extern void auth_freestate(struct auth_state *auth_state);
+int auth_memberof(struct auth_state *auth_state, 
+ 	 const char *identifier);
+struct auth_state *auth_newstate(const char *identifier);
+void auth_freestate(struct auth_state *auth_state);
 
 #endif /* INCLUDED_AUTH_H */

Modified: trunk/cyrus-imapd-2.2/lib/auth_krb.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/auth_krb.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/auth_krb.c (original)
+++ trunk/cyrus-imapd-2.2/lib/auth_krb.c Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* auth_krb.c -- Kerberos authorization
- * $Id: auth_krb.c,v 1.40 2003/11/11 03:26:00 rjs3 Exp $
+ * $Id: auth_krb.c,v 1.41 2005/02/16 20:38:01 shadow Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,12 @@
 
 #include <config.h>
 #include <stdlib.h>
+
+#include "auth.h"
+#include "exitcodes.h"
+
+#ifdef HAVE_KRB
+
 #include <limits.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -61,9 +67,6 @@
 #include <krb.h>
 
 #include "xmalloc.h"
-#include "auth.h"
-
-const char *auth_method_desc = "krb";
 
 #ifndef KRB_MAPNAME
 #define KRB_MAPNAME (SYSCONFDIR "/krb.equiv")
@@ -95,8 +98,7 @@
  *	2	User is in the group that is identifier
  *	3	User is identifer
  */
-int
-auth_memberof(auth_state, identifier)
+static int mymemberof(auth_state, identifier)
 struct auth_state *auth_state;
 const char *identifier;
 {
@@ -172,7 +174,7 @@
  * a NULL pointer is returned.
  * Eventually, this may be more sophisticated than a simple file scan.
  */
-char *auth_map_krbid(real_aname, real_inst, real_realm)
+static char *auth_map_krbid(real_aname, real_inst, real_realm)
 const char *real_aname;
 const char *real_inst;
 const char *real_realm;
@@ -247,7 +249,7 @@
  * Returns a pointer to a static buffer containing the canonical form
  * or NULL if 'identifier' is invalid.
  */
-char *auth_canonifyid(identifier, len)
+static char *mycanonifyid(identifier, len)
 const char *identifier;
 size_t len;
 {
@@ -314,8 +316,8 @@
  * points to a 16-byte binary key to cache identifier's information
  * with.
  */
-struct auth_state *
-auth_newstate(const char *identifier)
+static struct auth_state *mynewstate(identifier)
+const char *identifier;
 {
     struct auth_state *newstate;
 
@@ -331,10 +333,48 @@
     return newstate;
 }
 
-void
-auth_freestate(auth_state)
+static void myfreestate(auth_state)
 struct auth_state *auth_state;
 {
     free((char *)auth_state);
 }
 
+#else /* HAVE_KRB */
+
+static int mymemberof(
+    struct auth_state *auth_state __attribute__((unused)), 
+    const char *identifier __attribute__((unused)))
+{
+	fatal("Authentication mechanism (krb) not compiled in", EC_CONFIG);
+}
+
+static char *mycanonifyid(
+    const char *identifier __attribute__((unused)), 
+    size_t len __attribute__((unused)))
+{
+	fatal("Authentication mechanism (krb) not compiled in", EC_CONFIG);
+}
+
+static struct auth_state *mynewstate(
+    const char *identifier __attribute__((unused)))
+{
+	fatal("Authentication mechanism (krb) not compiled in", EC_CONFIG);
+}
+
+static void myfreestate(
+    struct auth_state *auth_state __attribute__((unused)))
+{
+	fatal("Authentication mechanism (krb) not compiled in", EC_CONFIG);
+}
+
+#endif
+
+struct auth_mech auth_krb = 
+{
+    "krb",		/* name */
+
+    &mycanonifyid,
+    &mymemberof,
+    &mynewstate,
+    &myfreestate,
+};

Modified: trunk/cyrus-imapd-2.2/lib/auth_krb5.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/auth_krb5.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/auth_krb5.c (original)
+++ trunk/cyrus-imapd-2.2/lib/auth_krb5.c Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* auth_krb5.c -- Kerberos V authorization for Cyrus IMAP
- * $Id: auth_krb5.c,v 1.3 2004/01/16 15:28:58 rjs3 Exp $
+ * $Id: auth_krb5.c,v 1.4 2005/02/16 20:38:01 shadow Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,12 @@
 
 #include <config.h>
 #include <stdlib.h>
+
+#include "auth.h"
+#include "exitcodes.h"
+
+#ifdef HAVE_GSSAPI_H
+
 #include <limits.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -52,8 +58,6 @@
 
 #include "auth.h"
 #include "xmalloc.h"
-
-const char *auth_method_desc = "krb5";
 
 struct auth_state {
     char *userid; /* Canonified Userid */
@@ -67,7 +71,7 @@
  *	2	User is in the group that is identifier
  *	3	User is identifer
  */
-int auth_memberof(struct auth_state *auth_state, const char *identifier)
+static int mymemberof(struct auth_state *auth_state, const char *identifier)
 {
     char *ident;
     int ret=0;
@@ -92,7 +96,7 @@
  * Returns a pointer to a static buffer containing the canonical form
  * or NULL if 'identifier' is invalid.
  */
-char *auth_canonifyid(const char *identifier, size_t len)
+static char *mycanonifyid(const char *identifier, size_t len)
 {
     static char *retbuf = NULL;
     krb5_context context;
@@ -172,7 +176,7 @@
 /*
  * Set the current user to 'identifier'.
  */
-struct auth_state *auth_newstate(const char *identifier)
+static struct auth_state *mynewstate(const char *identifier)
 {
     struct auth_state *newstate;
     char *ident;
@@ -185,7 +189,7 @@
     return newstate;
 }
 
-void auth_freestate(struct auth_state *auth_state)
+static void myfreestate(struct auth_state *auth_state)
 {
     if(!auth_state) return;
     
@@ -193,4 +197,42 @@
     free(auth_state);
 }
 
-
+#else /* HAVE_GSSAPI_H */
+
+static int mymemberof(
+    struct auth_state *auth_state __attribute__((unused)), 
+    const char *identifier __attribute__((unused)))
+{
+	fatal("Authentication mechanism (krb5) not compiled in", EC_CONFIG);
+}
+
+static char *mycanonifyid(
+    const char *identifier __attribute__((unused)), 
+    size_t len __attribute__((unused)))
+{
+	fatal("Authentication mechanism (krb5) not compiled in", EC_CONFIG);
+}
+
+static struct auth_state *mynewstate(
+    const char *identifier __attribute__((unused)))
+{
+	fatal("Authentication mechanism (krb5) not compiled in", EC_CONFIG);
+}
+
+static void myfreestate(
+    struct auth_state *auth_state __attribute__((unused)))
+{
+	fatal("Authentication mechanism (krb5) not compiled in", EC_CONFIG);
+}
+
+#endif
+
+struct auth_mech auth_krb5 = 
+{
+    "krb5",		/* name */
+
+    &mycanonifyid,
+    &mymemberof,
+    &mynewstate,
+    &myfreestate,
+};

Modified: trunk/cyrus-imapd-2.2/lib/auth_pts.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/auth_pts.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/auth_pts.c (original)
+++ trunk/cyrus-imapd-2.2/lib/auth_pts.c Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* auth_pts.c -- PTLOADER authorization
- * $Id: auth_pts.c,v 1.7 2004/02/24 23:11:37 rjs3 Exp $
+ * $Id: auth_pts.c,v 1.9 2006/01/20 20:34:07 jeaton Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -63,16 +63,116 @@
 #include "strhash.h"
 #include "xmalloc.h"
 
-const char *auth_method_desc = "pts";
-
-char *canonuser_id = NULL;
-struct auth_state *canonuser_cache = NULL;
+static char *canonuser_id = NULL;
+static struct auth_state *canonuser_cache = NULL;
+
+/* XXX should make this an imap option */
+#define PT_TIMEOUT_SEC  30
+
+#define TS_READ 1
+#define TS_WRITE 2
+#define TS_RW 3
+
+static int
+timeout_select (int sock, int op, int sec) {
+  struct timeval tv;
+  int r;
+  fd_set rfds, wfds, *rp, *wp;
+
+  FD_ZERO(&rfds);
+  FD_ZERO(&wfds);
+  rp = NULL;
+  wp = NULL;
+
+  switch (op) {
+  case TS_READ:
+    FD_SET(sock, &rfds);
+    rp = &rfds;
+    break;
+  case TS_WRITE:
+    FD_SET(sock, &wfds);
+    wp = &wfds;
+    break;
+  case TS_RW:
+    FD_SET(sock, &rfds);
+    FD_SET(sock, &wfds);
+    rp = &rfds;
+    wp = &wfds;
+  default:  /* no action */
+    break;
+  }
+
+  tv.tv_sec = sec;
+  tv.tv_usec = 0;
+
+  syslog(LOG_DEBUG, "timeout_select: sock = %d, rp = 0x%x, wp = 0x%x, sec = %d", 
+         sock, rp, wp, sec);
+
+  if ((r = select(sock+1, rp, wp, NULL, &tv)) == 0) {
+    /* r == 0 then timed out. we change this into an error */
+    errno = ETIMEDOUT;
+    r = -1;
+  }
+
+  syslog(LOG_DEBUG, "timeout_select exiting. r = %d; errno = %d", r, errno);
+  return r;
+}
+
+
+static int
+nb_connect(int s, struct sockaddr *sa, socklen_t slen, int sec) {
+  int flags, r, rc=0;
+
+  if ((flags = fcntl(s, F_GETFL,0)) == -1) {
+    syslog(LOG_ERR, "unable to get socket flags");
+    return -1;
+  }
+
+  if (fcntl(s, F_SETFL, flags|O_NONBLOCK) == -1) {
+    syslog(LOG_ERR, "unable to set socket to NON_BLOCK");
+    return -1;
+  }
+
+  if ((r = connect(s, sa, slen)) < 0) {
+    if (errno != EINPROGRESS) {
+      rc = -1;
+      goto done;
+    }
+  } else {
+    /* yay, it got through on the first shot. */
+    syslog(LOG_DEBUG, "connected with no delay");
+    rc = 0;
+    goto done;
+  }
+
+  syslog(LOG_DEBUG, "didn't immediately connect. waiting...");
+
+  if (timeout_select(s, TS_RW, sec) < 0) {
+    syslog(LOG_ERR, "timeoutselect: %m");
+    rc = -1;
+    goto done;
+  }
+
+  syslog(LOG_DEBUG, "connect: connected in time.");
+  rc = 0;
+
+ done:
+  /* set back to blocking so the reads/writes don't screw up), but why bother on an error... */
+  if (!rc && (fcntl(s, F_SETFL, flags) == -1)) {
+    syslog(LOG_ERR, "unable to set socket back to nonblocking: %m");
+    rc = -1;
+  }
+
+  return rc;
+}
 
 /* Returns 0 on successful connection to ptloader/valid cache entry,
  * complete with allocated & filled in struct auth_state.
  *
  * state must be a NULL pointer when passed in */
-int ptload(const char *identifier,struct auth_state **state);
+static int ptload(const char *identifier,struct auth_state **state);
+static void myfreestate(struct auth_state *auth_state);
+
 
 /*
  * Determine if the user is a member of 'identifier'
@@ -82,7 +182,7 @@
  *      2       User is in the group that is identifier
  *      3       User is identifer
  */
-int auth_memberof(struct auth_state *auth_state,
+static int mymemberof(struct auth_state *auth_state,
 		  const char *identifier)
 {
     int i;
@@ -110,10 +210,8 @@
     
     /* is it a group i'm a member of ? */
     for (i=0; i < auth_state->ngroups; i++)
-        if ( idhash == auth_state->groups[i].hash &&
-	        (( !strncmp(identifier, "group:", 6) && 
-                !strcmp(identifier+6, auth_state->groups[i].id) ) ||
-             !strcmp(identifier, auth_state->groups[i].id)) )
+        if (idhash == auth_state->groups[i].hash &&
+            !strcmp(identifier, auth_state->groups[i].id))
             return 2;
   
     return 0;
@@ -124,7 +222,7 @@
  * Returns a pointer to a static buffer containing the canonical form
  * or NULL if 'identifier' is invalid.
  */
-char *auth_canonifyid(const char *identifier,
+static char *mycanonifyid(const char *identifier,
 		      size_t len __attribute__((unused)))
 {
     static char retbuf[PTS_DB_KEYSIZE];
@@ -136,7 +234,7 @@
     } else if(canonuser_id) {
 	/* We've got a new one, invalidate our cache */
 	free(canonuser_id);
-	auth_freestate(canonuser_cache);
+	myfreestate(canonuser_cache);
 
 	canonuser_id = NULL;
 	canonuser_cache = NULL;
@@ -147,20 +245,30 @@
         /* we can fill this in ourselves - no cacheing */
 	strlcpy(retbuf, identifier, sizeof(retbuf));
 	return retbuf;
-    } else if(ptload(identifier, &canonuser_cache)) {
-	/* Couldn't contact ptloader/database.  Fail. */
-	return NULL;
-    } else {
-	canonuser_id = xstrdup(identifier);
-	strlcpy(retbuf, canonuser_cache->userid.id, sizeof(retbuf));
-	return retbuf;
-    }
+    }
+
+    canonuser_cache = NULL;
+    if(ptload(identifier, &canonuser_cache) < 0) {
+      if (canonuser_cache == NULL) {
+        syslog(LOG_ERR, "ptload completely failed: unable to canonify identifier: %s",
+               identifier);
+        return NULL;
+      } else {
+        syslog(LOG_ERR, "ptload failed: but canonified %s -> %s", identifier,
+               canonuser_cache->userid.id);
+      }
+    }
+
+    canonuser_id = xstrdup(identifier);
+    strlcpy(retbuf, canonuser_cache->userid.id, sizeof(retbuf));
+    syslog(LOG_DEBUG, "canonified %s -> %s", identifier, retbuf);
+    return retbuf;
 }
 
 /* 
  * Produce an auth_state structure for the given identifier
  */
-struct auth_state *auth_newstate(const char *identifier) 
+static struct auth_state *mynewstate(const char *identifier) 
 {
     struct auth_state *output = NULL;
 
@@ -173,36 +281,57 @@
 
 	output = canonuser_cache;
 	canonuser_cache = NULL;
+        return output;
+    } 
+
+    /*
+     * If anyone or anonymous, just pass through. Otherwise, try to load the
+     * groups the user is in
+     */
+    if(strcmp(identifier, "anyone") &&
+       strcmp(identifier, "anonymous")) {
+
+      if(ptload(identifier, &output) < 0) {
+        syslog(LOG_ERR, "ptload failed for %s", identifier);
+        /* Allowing this to go through is a problem if negative group access is
+         * used significantly.   Allowing this to go through is a feature when
+         * the ptserver is having problems and the user wants to get to his
+         * inbox.
+         *
+         * note that even on a failure, output should either be NULL or a
+         * correct (enough) value.
+         */
+      }
+    }
+
+    if (output == NULL) {
+      output =
+        (struct auth_state *)xzmalloc(sizeof(struct auth_state));
+      strlcpy(output->userid.id, identifier,
+              sizeof(output->userid.id));
+      output->userid.hash = strhash(identifier);
+      syslog(LOG_DEBUG, "creating empty auth_state for %s", identifier);
     } else {
-	if(!strcmp(identifier, "anyone") ||
-           !strcmp(identifier, "anonymous") ||
-	   ptload(identifier, &output)) {
-		/* Anyone/Anonymous/ptload failure; fake it */
-		output =
-		    (struct auth_state *)xzmalloc(sizeof(struct auth_state));
-		strlcpy(output->userid.id, identifier,
-			sizeof(output->userid.id));
-		output->userid.hash = strhash(identifier);
-	}
-    }
-	
+      syslog(LOG_DEBUG, "using ptloaded value of: %s", output->userid.id);
+    }
+
     return output;
 }
 
-struct cyrusdb_backend *the_ptscache_db = NULL;
+static struct cyrusdb_backend *the_ptscache_db = NULL;
 
 /* Returns 0 on success */
-int ptload(const char *identifier, struct auth_state **state) 
+static int ptload(const char *identifier, struct auth_state **state) 
 {
     struct auth_state *fetched = NULL;
     size_t id_len;
-    const char *data;
+    const char *data = NULL;
     int dsize;
     char fnamebuf[1024];
     struct db *ptdb;
     int s;
     struct sockaddr_un srvaddr;
-    int r;
+    int r, rc=0;
     static char response[1024];
     struct iovec iov[10];
     int niov, n;
@@ -226,12 +355,14 @@
     if (r != 0) {
 	syslog(LOG_ERR, "DBERROR: opening %s: %s", fnamebuf,
 	       cyrusdb_strerror(ret));
+        *state = NULL;
 	return -1;
     }
 
     id_len = strlen(identifier);
     if(id_len > PTS_DB_KEYSIZE) {
 	syslog(LOG_ERR, "identifier too long in auth_newstate");
+        *state = NULL;
 	return -1;
     }
       
@@ -242,6 +373,7 @@
         syslog(LOG_ERR, "auth_newstate: error fetching record: %s",
                cyrusdb_strerror(r));
 
+        rc = -1;
         goto done;
     }
 
@@ -254,15 +386,12 @@
 	int timeout = libcyrus_config_getint(CYRUSOPT_PTS_CACHE_TIMEOUT);
 	
 	syslog(LOG_DEBUG,
-	       "ptload(): fetched cache record " \
-	       "(mark %ld, current %ld, limit %ld)",
+	       "ptload(): fetched cache record (%s)" \
+	       "(mark %ld, current %ld, limit %ld)", identifier,
 	       fetched->mark, now, now - timeout);
 
 	if (fetched->mark > (now - timeout)) {
 	    /* not expired; let's return it */
-	    *state = (struct auth_state *)xmalloc(dsize);
-	    memcpy(*state, fetched, dsize);
-	    
 	    goto done;
 	}
     }
@@ -273,7 +402,7 @@
     if (s == -1) {
         syslog(LOG_ERR,
                "ptload(): unable to create socket for ptloader: %m");
-
+        rc = -1;
         goto done;
     }
         
@@ -287,28 +416,42 @@
     memset((char *)&srvaddr, 0, sizeof(srvaddr));
     srvaddr.sun_family = AF_UNIX;
     strcpy(srvaddr.sun_path, fnamebuf);
-    r = connect(s, (struct sockaddr *)&srvaddr, sizeof(srvaddr));
+    r = nb_connect(s, (struct sockaddr *)&srvaddr, sizeof(srvaddr), PT_TIMEOUT_SEC);
+
     if (r == -1) {
 	syslog(LOG_ERR, "ptload(): can't connect to ptloader server: %m");
 	close(s);
-
+        rc = -1;
         goto done;
     }
 
+    syslog(LOG_DEBUG, "ptload(): connected");
     niov = 0;
     WRITEV_ADD_TO_IOVEC(iov, niov, (char *) &id_len, sizeof(id_len));
     WRITEV_ADD_TO_IOVEC(iov, niov, (char *) identifier, id_len);
 
+    if (timeout_select(s, TS_WRITE, PT_TIMEOUT_SEC) < 0) {
+      syslog(LOG_ERR, "timeoutselect: writing to ptloader %m");
+      rc = -1;
+      goto done;
+    }
     retry_writev(s, iov, niov);
+    syslog(LOG_DEBUG, "ptload sent data");
         
     start = 0;
     while (start < sizeof(response) - 1) {
-	n = read(s, response+start, sizeof(response) - 1 - start);
-	if (n < 1) break;
-	start += n;
+      if (timeout_select(s, TS_READ, PT_TIMEOUT_SEC) < 0) {
+        syslog(LOG_ERR, "timeout_select: reading from ptloader: %m");
+        rc = -1;
+        goto done;
+      }
+      n = read(s, response+start, sizeof(response) - 1 - start);
+      if (n < 1) break;
+      start += n;
     }
         
     close(s);
+    syslog(LOG_DEBUG, "ptload read data back");
         
     if (start <= 1 || strncmp(response, "OK", 2)) {
        if(start > 1) {
@@ -317,6 +460,7 @@
        } else {
 	   syslog(LOG_ERR, "ptload(): empty response from ptloader server");
        }
+       rc = -1;
        goto done;
     }
 
@@ -327,25 +471,44 @@
 	syslog(LOG_ERR, "ptload(): error fetching record: %s"
 	       "(did ptloader add the record?)",
 	       cyrusdb_strerror(r));
-	
-        goto done;
-    }
-
-    /* ok, we got what we wanted */
-    fetched = (struct auth_state *) data;
-
-    /* copy it into our structure */
-    *state = (struct auth_state *)xmalloc(dsize);
-    memcpy(*state, fetched, dsize);
+      data = NULL;
+      rc = -1;
+      goto done;
+    }
 
  done:
+    /* ok, we got real data, let's use it */
+    if (data != NULL) {
+      fetched = (struct auth_state *) data;
+    }
+
+    if (fetched == NULL) {
+      *state = NULL;
+      syslog(LOG_DEBUG, "No data available at all from ptload()");
+    } else  {
+      /* copy it into our structure */
+      *state = (struct auth_state *)xmalloc(dsize);
+      memcpy(*state, fetched, dsize);
+      syslog(LOG_DEBUG, "ptload returning data");
+    }
+
     /* close and unlock the database */
     the_ptscache_db->close(ptdb);
 
-    return (*state) ? 0 : -1;
-}
-
-void auth_freestate(struct auth_state *auth_state)
+    return rc;
+}
+
+static void myfreestate(struct auth_state *auth_state)
 {
     free(auth_state);
 }
+
+struct auth_mech auth_pts = 
+{
+    "pts",		/* name */
+
+    &mycanonifyid,
+    &mymemberof,
+    &mynewstate,
+    &myfreestate,
+};

Modified: trunk/cyrus-imapd-2.2/lib/auth_unix.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/auth_unix.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/auth_unix.c (original)
+++ trunk/cyrus-imapd-2.2/lib/auth_unix.c Fri Mar 31 20:18:13 2006
@@ -41,7 +41,7 @@
  */
 
 /*
- * $Id: auth_unix.c,v 1.38 2004/09/13 22:49:29 shadow Exp $
+ * $Id: auth_unix.c,v 1.39 2005/02/16 20:38:01 shadow Exp $
  */
 
 #include <config.h>
@@ -55,8 +55,6 @@
 #include "libcyr_cfg.h"
 #include "xmalloc.h"
 
-const char *auth_method_desc = "unix";
-
 struct auth_state {
     char userid[81];
     char **group;
@@ -75,7 +73,7 @@
  *	2	User is in the group that is identifier
  *	3	User is identifer
  */
-int auth_memberof(auth_state, identifier)
+static int mymemberof(auth_state, identifier)
 struct auth_state *auth_state;
 const char *identifier;
 {
@@ -154,7 +152,7 @@
  * representations: one for getpwent calls and one for folder names.  The
  * latter canonicalizes to a MUTF7 representation.
  */
-char *auth_canonifyid(identifier, len)
+static char *mycanonifyid(identifier, len)
 const char *identifier;
 size_t len;
 {
@@ -220,14 +218,14 @@
  * points to a 16-byte binary key to cache identifier's information
  * with.
  */
-struct auth_state *auth_newstate(const char *identifier)
+static struct auth_state *mynewstate(const char *identifier)
 {
     struct auth_state *newstate;
     struct passwd *pwd;
     struct group *grp;
     char **mem;
 
-    identifier = auth_canonifyid(identifier, 0);
+    identifier = mycanonifyid(identifier, 0);
     if (!identifier) return 0;
     if (!strncmp(identifier, "group:", 6)) return 0;
     
@@ -259,8 +257,7 @@
     return newstate;
 }
 
-void
-auth_freestate(auth_state)
+static void myfreestate(auth_state)
 struct auth_state *auth_state;
 {
     if (auth_state->group) free((char *)auth_state->group);
@@ -268,3 +265,12 @@
 }
 
 
+struct auth_mech auth_unix = 
+{
+    "unix",		/* name */
+
+    &mycanonifyid,
+    &mymemberof,
+    &mynewstate,
+    &myfreestate,
+};

Modified: trunk/cyrus-imapd-2.2/lib/charset/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/charset/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/charset/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/lib/charset/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -14,7 +14,7 @@
 /iso-8859-9.t/1.5/Fri May 15 21:54:18 1998//
 /koi8-r.t/1.4/Fri May 15 21:54:21 1998//
 /unidata2.txt/1.1/Tue Mar  2 01:08:06 1999//
-/unifix.txt/1.2/Wed Feb  7 21:46:57 2001//
+/unifix.txt/1.3/Wed Mar  9 16:08:42 2005//
 /us-ascii.t/1.4/Fri May 15 21:54:29 1998//
 /windows-1252.t/1.2/Wed Jan 29 20:48:53 2003//
 /windows-1256.t/1.1/Wed May 14 18:56:36 2003//

Modified: trunk/cyrus-imapd-2.2/lib/charset/unifix.txt
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/charset/unifix.txt?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/charset/unifix.txt (original)
+++ trunk/cyrus-imapd-2.2/lib/charset/unifix.txt Fri Mar 31 20:18:13 2006
@@ -160,79 +160,10 @@
 0383;Combining Diacritical Mark;Zs;
 0384;Combining Diacritical Mark;Zs;
 0385;Combining Diacritical Mark;Zs;
-0386;Combining Diacritical Mark;Zs;
 0387;Combining Diacritical Mark;Zs;
-0388;Combining Diacritical Mark;Zs;
-0389;Combining Diacritical Mark;Zs;
-038a;Combining Diacritical Mark;Zs;
 038b;Combining Diacritical Mark;Zs;
-038c;Combining Diacritical Mark;Zs;
 038d;Combining Diacritical Mark;Zs;
-038e;Combining Diacritical Mark;Zs;
-038f;Combining Diacritical Mark;Zs;
-0390;Combining Diacritical Mark;Zs;
-0391;Combining Diacritical Mark;Zs;
-0392;Combining Diacritical Mark;Zs;
-0393;Combining Diacritical Mark;Zs;
-0394;Combining Diacritical Mark;Zs;
-0395;Combining Diacritical Mark;Zs;
-0396;Combining Diacritical Mark;Zs;
-0397;Combining Diacritical Mark;Zs;
-0398;Combining Diacritical Mark;Zs;
-0399;Combining Diacritical Mark;Zs;
-039a;Combining Diacritical Mark;Zs;
-039b;Combining Diacritical Mark;Zs;
-039c;Combining Diacritical Mark;Zs;
-039d;Combining Diacritical Mark;Zs;
-039e;Combining Diacritical Mark;Zs;
-039f;Combining Diacritical Mark;Zs;
-03a0;Combining Diacritical Mark;Zs;
-03a1;Combining Diacritical Mark;Zs;
 03a2;Combining Diacritical Mark;Zs;
-03a3;Combining Diacritical Mark;Zs;
-03a4;Combining Diacritical Mark;Zs;
-03a5;Combining Diacritical Mark;Zs;
-03a6;Combining Diacritical Mark;Zs;
-03a7;Combining Diacritical Mark;Zs;
-03a8;Combining Diacritical Mark;Zs;
-03a9;Combining Diacritical Mark;Zs;
-03aa;Combining Diacritical Mark;Zs;
-03ab;Combining Diacritical Mark;Zs;
-03ac;Combining Diacritical Mark;Zs;
-03ad;Combining Diacritical Mark;Zs;
-03ae;Combining Diacritical Mark;Zs;
-03af;Combining Diacritical Mark;Zs;
-03b0;Combining Diacritical Mark;Zs;
-03b1;Combining Diacritical Mark;Zs;
-03b2;Combining Diacritical Mark;Zs;
-03b3;Combining Diacritical Mark;Zs;
-03b4;Combining Diacritical Mark;Zs;
-03b5;Combining Diacritical Mark;Zs;
-03b6;Combining Diacritical Mark;Zs;
-03b7;Combining Diacritical Mark;Zs;
-03b8;Combining Diacritical Mark;Zs;
-03b9;Combining Diacritical Mark;Zs;
-03ba;Combining Diacritical Mark;Zs;
-03bb;Combining Diacritical Mark;Zs;
-03bc;Combining Diacritical Mark;Zs;
-03bd;Combining Diacritical Mark;Zs;
-03be;Combining Diacritical Mark;Zs;
-03bf;Combining Diacritical Mark;Zs;
-03c0;Combining Diacritical Mark;Zs;
-03c1;Combining Diacritical Mark;Zs;
-03c2;Combining Diacritical Mark;Zs;
-03c3;Combining Diacritical Mark;Zs;
-03c4;Combining Diacritical Mark;Zs;
-03c5;Combining Diacritical Mark;Zs;
-03c6;Combining Diacritical Mark;Zs;
-03c7;Combining Diacritical Mark;Zs;
-03c8;Combining Diacritical Mark;Zs;
-03c9;Combining Diacritical Mark;Zs;
-03ca;Combining Diacritical Mark;Zs;
-03cb;Combining Diacritical Mark;Zs;
-03cc;Combining Diacritical Mark;Zs;
-03cd;Combining Diacritical Mark;Zs;
-03ce;Combining Diacritical Mark;Zs;
 03cf;Combining Diacritical Mark;Zs;
 03d0;Combining Diacritical Mark;Zs;
 03d1;Combining Diacritical Mark;Zs;

Modified: trunk/cyrus-imapd-2.2/lib/cyrusdb.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/cyrusdb.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/cyrusdb.c (original)
+++ trunk/cyrus-imapd-2.2/lib/cyrusdb.c Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: cyrusdb.c,v 1.9 2004/01/20 01:11:03 ken3 Exp $ */
+/* $Id: cyrusdb.c,v 1.10 2006/01/04 02:06:23 murch Exp $ */
 
 #include <config.h>
 #include <stdlib.h>
@@ -65,6 +65,8 @@
 #ifdef HAVE_BDB
     &cyrusdb_berkeley,
     &cyrusdb_berkeley_nosync,
+    &cyrusdb_berkeley_hash,
+    &cyrusdb_berkeley_hash_nosync,
 #endif
     &cyrusdb_flat,
     &cyrusdb_skiplist,

Modified: trunk/cyrus-imapd-2.2/lib/cyrusdb.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/cyrusdb.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/cyrusdb.h (original)
+++ trunk/cyrus-imapd-2.2/lib/cyrusdb.h Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: cyrusdb.h,v 1.29 2004/03/11 18:36:44 ken3 Exp $ */
+/* $Id: cyrusdb.h,v 1.30 2006/01/04 02:06:23 murch Exp $ */
 
 #ifndef INCLUDED_CYRUSDB_H
 #define INCLUDED_CYRUSDB_H
@@ -183,6 +183,8 @@
  * if libcyrus was not built with support for them */
 extern struct cyrusdb_backend cyrusdb_berkeley;
 extern struct cyrusdb_backend cyrusdb_berkeley_nosync;
+extern struct cyrusdb_backend cyrusdb_berkeley_hash;
+extern struct cyrusdb_backend cyrusdb_berkeley_hash_nosync;
 extern struct cyrusdb_backend cyrusdb_flat;
 extern struct cyrusdb_backend cyrusdb_skiplist;
 extern struct cyrusdb_backend cyrusdb_quotalegacy;

Modified: trunk/cyrus-imapd-2.2/lib/cyrusdb_berkeley.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/cyrusdb_berkeley.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/cyrusdb_berkeley.c (original)
+++ trunk/cyrus-imapd-2.2/lib/cyrusdb_berkeley.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: cyrusdb_berkeley.c,v 1.9 2004/11/17 15:41:31 shadow Exp $ */
+/* $Id: cyrusdb_berkeley.c,v 1.14 2006/03/17 16:12:32 murch Exp $ */
 
 #include <config.h>
 
@@ -104,9 +104,20 @@
     exit(EC_TEMPFAIL);
 }
 
+#if (DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)
+static void db_err(const DB_ENV *dbenv __attribute__((unused)),
+		   const char *db_prfx, const char *buffer)
+#else
 static void db_err(const char *db_prfx, char *buffer)
+#endif
 {
     syslog(LOG_WARNING, "DBERROR %s: %s", db_prfx, buffer);
+}
+
+static void db_msg(const DB_ENV *dbenv __attribute__((unused)),
+		   const char *msg)
+{
+    syslog(LOG_INFO, "DBMSG: %s", msg);
 }
 
 static int init(const char *dbdir, int myflags)
@@ -149,6 +160,9 @@
 #endif
     }
 
+#if (DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)
+    dbenv->set_msgcall(dbenv, db_msg);
+#endif
     dbenv->set_errcall(dbenv, db_err);
     snprintf(errpfx, sizeof(errpfx), "db%d", DB_VERSION_MAJOR);
     dbenv->set_errpfx(dbenv, errpfx);
@@ -362,7 +376,7 @@
     return 0;
 }
 
-static int myopen(const char *fname, int flags, struct db **ret)
+static int myopen(const char *fname, DBTYPE type, int flags, struct db **ret)
 {
     DB *db = NULL;
     int r;
@@ -380,9 +394,9 @@
     /* xxx set comparator! */
 
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
-    r = db->open(db, NULL, fname, NULL, DB_BTREE, dbflags | DB_AUTO_COMMIT, 0664);
+    r = db->open(db, NULL, fname, NULL, type, dbflags | DB_AUTO_COMMIT, 0664);
 #else
-    r = db->open(db, fname, NULL, DB_BTREE, dbflags, 0664);
+    r = db->open(db, fname, NULL, type, dbflags, 0664);
 #endif
 
     if (r != 0) {
@@ -398,6 +412,16 @@
     *ret = (struct db *) db;
 
     return r;
+}
+
+static int open_btree(const char *fname, int flags, struct db **ret)
+{
+    return myopen(fname, DB_BTREE, flags, ret);
+}
+
+static int open_hash(const char *fname, int flags, struct db **ret)
+{
+    return myopen(fname, DB_HASH, flags, ret);
 }
 
 static int myclose(struct db *db)
@@ -957,7 +981,7 @@
     &mysync,
     &myarchive,
 
-    &myopen,
+    &open_btree,
     &myclose,
 
     &fetch,
@@ -983,7 +1007,7 @@
     &mysync,
     &myarchive,
 
-    &myopen,
+    &open_btree,
     &myclose,
 
     &fetch,
@@ -999,3 +1023,55 @@
     NULL,
     NULL
 };
+
+struct cyrusdb_backend cyrusdb_berkeley_hash = 
+{
+    "berkeley-hash",		/* name */
+
+    &init,
+    &done,
+    &mysync,
+    &myarchive,
+
+    &open_hash,
+    &myclose,
+
+    &fetch,
+    &fetchlock,
+    &foreach,
+    &create,
+    &store,
+    &delete,
+
+    &commit_txn,
+    &abort_txn,
+    
+    NULL,
+    NULL
+};
+
+struct cyrusdb_backend cyrusdb_berkeley_hash_nosync = 
+{
+    "berkeley-hash-nosync",	/* name */
+
+    &init,
+    &done,
+    &mysync,
+    &myarchive,
+
+    &open_hash,
+    &myclose,
+
+    &fetch,
+    &fetchlock,
+    &foreach,
+    &create_nosync,
+    &store_nosync,
+    &delete_nosync,
+
+    &commit_nosync,
+    &abort_txn,
+
+    NULL,
+    NULL
+};

Modified: trunk/cyrus-imapd-2.2/lib/cyrusdb_quotalegacy.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/cyrusdb_quotalegacy.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/cyrusdb_quotalegacy.c (original)
+++ trunk/cyrus-imapd-2.2/lib/cyrusdb_quotalegacy.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: cyrusdb_quotalegacy.c,v 1.10 2004/08/04 13:03:19 ken3 Exp $ */
+/* $Id: cyrusdb_quotalegacy.c,v 1.12 2005/04/20 18:46:09 ken3 Exp $ */
 
 #include <config.h>
 

Modified: trunk/cyrus-imapd-2.2/lib/imapoptions
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/imapoptions?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/imapoptions (original)
+++ trunk/cyrus-imapd-2.2/lib/imapoptions Fri Mar 31 20:18:13 2006
@@ -42,7 +42,7 @@
 .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\" 
-.\" $Id: imapoptions,v 1.30 2004/07/21 19:07:45 rjs3 Exp $
+.\" $Id: imapoptions,v 1.36 2006/03/30 15:49:58 murch Exp $
 .SH NAME
 imapd.conf \- IMAP configuration file
 .SH DESCRIPTION
@@ -144,8 +144,11 @@
    affect LMTP delivery of messages directly to mailboxes via
    plus-addressing. */
 
-{ "annotation_db", "skiplist", STRINGLIST("berkeley", "skiplist")}
+{ "annotation_db", "skiplist", STRINGLIST("berkeley", "berkeley-hash", "skiplist")}
 /* The cyrusdb backend to use for mailbox annotations. */
+
+{ "auth_mech", "unix", STRINGLIST("unix", "pts", "krb", "krb5")}
+/* The authorization mechanism to use. */
 
 { "autocreatequota", 0, INT }
 /* If nonzero, normal users may create their own IMAP accounts by
@@ -192,7 +195,7 @@
 { "deleteright", "c", STRING }
 /* The right that a user needs to delete a mailbox. */
 
-{ "duplicate_db", "berkeley-nosync", STRINGLIST("berkeley", "berkeley-nosync", "skiplist")}
+{ "duplicate_db", "berkeley-nosync", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist")}
 /* The cyrusdb backend to use for the duplicate delivery suppression
    and sieve. */
 
@@ -331,9 +334,10 @@
 
 { "ldap_member_method", "attribute", STRINGLIST("attribute", "filter") }
 /* Specify a group method.  The "attribute" method retrieves groups from 
-   a multi-valued attributed specified in ldap_member_attribute.  
-   The "filter" method uses a filter, ldap_member_filter, to find groups; 
-   ldap_member_attribute is a single-value attribute group name. */
+   a multi-valued attribute specified in ldap_member_attribute.  
+
+   The "filter" method uses a filter, specified by ldap_member_filter, to find
+   groups; ldap_member_attribute is a single-value attribute group name. */
 
 { "ldap_member_scope", "sub", STRINGLIST("sub", "one", "base") }
 /* Specify search scope for ldap_member_filter. */
@@ -455,7 +459,7 @@
    messages larger than \fImaxmessagesize\fR bytes.  If set to 0, this
    will allow messages of any size (the default). */
 
-{ "mboxlist_db", "skiplist", STRINGLIST("flat", "berkeley", "skiplist")}
+{ "mboxlist_db", "skiplist", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist")}
 /* The cyrusdb backend to use for the mailbox list. */
 
 # xxx badly worded
@@ -557,7 +561,7 @@
    IMAP mailbox names. */
 
 { "notifysocket", "{configdirectory}/socket/notify", STRING }
-/* Unix domain socket that the new mail notification daemon listens on. */
+/* Unix domain socket that the mail notification daemon listens on. */
 
 # Commented out - there's no such thing as "partition-name", but we need
 # this for the man page
@@ -572,6 +576,9 @@
    systems that support strong authentication, this permits users to  
    perceive a cost of using plaintext passwords.  (This does not
    affect the use of PLAIN in SASL authentications.) */
+
+{ "plaintextloginalert", NULL, STRING }
+/* Message to send to client after a successful plaintext login. */
 
 { "popexpiretime", -1, INT }
 /* The number of days advertised as being the minimum a message may be
@@ -587,6 +594,22 @@
 /* Set the minimum amount of time the server forces users to wait
    between successive POP logins, in minutes. */ 
 
+{ "poppollpadding", 1, INT }
+/* Create a softer minimum poll restriction.  Allows \fIpoppollpadding\fR
+   connections before the minpoll restriction is triggered.  Additionally,
+   one padding entry is recovered every \fIpopminpoll\fR minutes.
+   This allows for the occasional polling rate faster than popminpoll, 
+   (i.e. for clients that require a send/recieve to send mail) but still 
+   enforces the rate long-term.  Default is 1 (disabled).
+.br
+.sp
+   The easiest way to think of it is a queue of past connections, with one
+   slot being filled for every connection, and one slot being cleared 
+   every \fIpopminpoll\fR minutes. When the queue is full, the user
+   will not be able to check mail again until a slot is cleared.  If the 
+   user waits a sufficent amount of time, they will get back many or all
+   of the slots. */
+
 { "poptimeout", 10, INT }
 /* Set the length of the POP server's inactivity autologout timer,    
    in minutes.  The minimum value is 10, the default. */
@@ -635,11 +658,14 @@
    users, seperated by spaces.  Any user listed in this will be
    allowed to login for any other user: use with caution. */ 
 
+{ "pts_module", "afskrb", STRINGLIST("afskrb", "ldap") }
+/* The PTS module to use. */
+
 { "ptloader_sock", NULL, STRING }
 /* Unix domain socket that ptloader listens on.
    (defaults to configdir/ptclient/ptsock) */
 
-{ "ptscache_db", "berkeley", STRINGLIST("berkeley", "skiplist")}
+{ "ptscache_db", "berkeley", STRINGLIST("berkeley", "berkeley-hash", "skiplist")}
 /* The cyrusdb backend to use for the pts cache. */
 
 { "ptscache_timeout", 10800, INT }
@@ -656,7 +682,7 @@
    strip the default realm from the userid (this does not affect the stripping
    of realms specified by the afspts_localrealms option) */
 
-{ "quota_db", "quotalegacy", STRINGLIST("flat", "berkeley", "skiplist", "quotalegacy")}
+{ "quota_db", "quotalegacy", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "quotalegacy")}
 /* The cyrusdb backend to use for quotas. */
 
 { "quotawarn", 90, INT }
@@ -714,7 +740,7 @@
 /* The mechanism used by the server to verify plaintext passwords. 
    Possible values include "auxprop", "saslauthd", and "pwcheck". */
 
-{ "seenstate_db", "skiplist", STRINGLIST("flat", "berkeley", "skiplist")}
+{ "seenstate_db", "skiplist", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist")}
 /* The cyrusdb backend to use for the seen state. */
 
 { "sendmail", "/usr/lib/sendmail", STRING }
@@ -753,9 +779,9 @@
    directories: ~user/.sieve. */
 
 { "singleinstancestore", 1, SWITCH }
-/* If enabled, lmtpd and nntpd attempt to only write one copy of a message per
-   partition and create hard links, resulting in a potentially large
-   disk savings. */
+/* If enabled, imapd, lmtpd and nntpd attempt to only write one copy
+   of a message per partition and create hard links, resulting in a
+   potentially large disk savings. */
 
 { "skiplist_unsafe", 0, SWITCH }
 /* If enabled, this option forces the skiplist cyrusdb backend to
@@ -771,7 +797,7 @@
    key.  This option is passed to the SASL library and overrides its
    default setting. */
 
-{ "subscription_db", "flat", STRINGLIST("flat", "berkeley", "skiplist")}
+{ "subscription_db", "flat", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist")}
 /* The cyrusdb backend to use for the subscriptions list. */
 
 { "syslog_prefix", NULL, STRING }
@@ -792,7 +818,7 @@
    have filenames with the hashed value of the certificate (see
    openssl(XXX)). */
 
-{ "tlscache_db", "berkeley-nosync", STRINGLIST("berkeley", "berkeley-nosync", "skiplist")}
+{ "tlscache_db", "berkeley-nosync", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist")}
 /* The cyrusdb backend to use for the TLS cache. */
 
 { "tls_cert_file", NULL, STRING }

Modified: trunk/cyrus-imapd-2.2/lib/imclient.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/imclient.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/imclient.c (original)
+++ trunk/cyrus-imapd-2.2/lib/imclient.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* imclient.c -- Streaming IMxP client library
  *
- * $Id: imclient.c,v 1.84 2003/10/22 18:50:12 rjs3 Exp $
+ * $Id: imclient.c,v 1.86 2005/10/28 14:45:22 ken3 Exp $
  *
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -1570,8 +1570,7 @@
 static int set_cert_stuff(SSL_CTX * ctx, char *cert_file, char *key_file)
 {
     if (cert_file != NULL) {
-	if (SSL_CTX_use_certificate_file(ctx, cert_file,
-					 SSL_FILETYPE_PEM) <= 0) {
+	if (SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0) {
 	  printf("[ unable to get certificate from '%s' ]\n", cert_file);
 	  return (0);
 	}
@@ -1670,8 +1669,6 @@
 #endif
 }
 
-char *var_tls_CAfile="";
-char *var_tls_CApath="";
  /*
   * This is the setup routine for the SSL client. 
   *
@@ -1679,7 +1676,10 @@
   */
 
 static int tls_init_clientengine(struct imclient *imclient,
-				 int verifydepth, char *var_tls_cert_file, char *var_tls_key_file)
+				 int verifydepth, char *var_tls_cert_file,
+                                 char *var_tls_key_file,
+                                 char *var_tls_CAfile,
+                                 char *var_tls_CApath)
 {
     int     off = 0;
     int     verify_flags = SSL_VERIFY_NONE;
@@ -1707,11 +1707,11 @@
     
     /* debugging   SSL_CTX_set_info_callback(imclient->tls_ctx, apps_ssl_info_callback); */
 
-    if (strlen(var_tls_CAfile) == 0)
+    if (var_tls_CAfile == NULL || strlen(var_tls_CAfile) == 0)
 	CAfile = NULL;
     else
 	CAfile = var_tls_CAfile;
-    if (strlen(var_tls_CApath) == 0)
+    if (var_tls_CApath == NULL || strlen(var_tls_CApath) == 0)
 	CApath = NULL;
     else
 	CApath = var_tls_CApath;
@@ -1722,11 +1722,11 @@
 	    printf("[ TLS engine: cannot load CA data ]\n");
 	    return -1;
 	}
-    if (strlen(var_tls_cert_file) == 0)
+    if (var_tls_cert_file == NULL || strlen(var_tls_cert_file) == 0)
 	c_cert_file = NULL;
     else
 	c_cert_file = var_tls_cert_file;
-    if (strlen(var_tls_key_file) == 0)
+    if (var_tls_key_file == NULL || strlen(var_tls_key_file) == 0)
 	c_key_file = NULL;
     else
 	c_key_file = var_tls_key_file;
@@ -1973,13 +1973,23 @@
 	   tls_cipher_usebits, tls_cipher_algbits);*/
     return 0;
 }
+#endif /* HAVE_SSL */
+
+int imclient_havetls () {
+#ifdef HAVE_SSL
+  return 1;
+#else
+  return 0;
+#endif
+}
 
 int imclient_starttls(struct imclient *imclient,
-			     int verifydepth __attribute__((unused)),
-			     char *var_tls_cert_file, 
-			     char *var_tls_key_file,
-			     int *layer __attribute__((unused)))
-{
+			     char *cert_file,
+			     char *key_file,
+                             char *CAfile,
+                             char *CApath)
+{
+#ifdef HAVE_SSL
   int result;
   struct authresult theresult;
   unsigned ssf;
@@ -1994,7 +2004,8 @@
     imclient_processoneevent(imclient);
   }
 
-  result=tls_init_clientengine(imclient, 10, var_tls_cert_file, var_tls_key_file);
+  result=tls_init_clientengine(imclient, 10, cert_file, key_file,
+                               CAfile, CApath);
   if (result!=0)
   {
     printf("[ TLS engine failed ]\n");
@@ -2030,5 +2041,8 @@
   if (result!=SASL_OK) return 1;
 
   return 0;
-}
+#else
+  printf("[ TLS support not present (imclient_starttls) ]\n");
+  return 1;
 #endif /* HAVE_SSL */
+}

Modified: trunk/cyrus-imapd-2.2/lib/imclient.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/imclient.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/imclient.h (original)
+++ trunk/cyrus-imapd-2.2/lib/imclient.h Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* imclient.h -- Streaming IMxP client library
- * $Id: imclient.h,v 1.26 2003/10/22 18:50:12 rjs3 Exp $
+ * $Id: imclient.h,v 1.27 2005/04/11 05:48:25 shadow Exp $
  * 
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -88,14 +88,13 @@
 				 int minssf, 
 				 int maxssf);
 
+extern int imclient_have_tls (void);
 
-#ifdef HAVE_SSL
 extern int imclient_starttls(struct imclient *imclient,
-			     int verifydepth,
-			     char *var_tls_cert_file, 
-			     char *var_tls_key_file,
-			     int *layer);
-#endif /* HAVE_SSL */
+			     char *cert_file, 
+			     char *key_file,
+                             char *CAfile,
+                             char *CApath);
 
 extern void imclient_write (struct imclient *imclient,
 			    const char *s, size_t len);

Modified: trunk/cyrus-imapd-2.2/lib/libconfig.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/libconfig.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/libconfig.c (original)
+++ trunk/cyrus-imapd-2.2/lib/libconfig.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  *
  */
 
-/* $Id: libconfig.c,v 1.9 2004/05/22 03:45:54 rjs3 Exp $ */
+/* $Id: libconfig.c,v 1.10 2005/03/23 19:44:59 shadow Exp $ */
 
 #include <config.h>
 
@@ -96,7 +96,13 @@
 {
     assert(opt > IMAPOPT_ZERO && opt < IMAPOPT_LAST);
     assert(imapopts[opt].t == OPT_INT);
-
+#if (SIZEOF_LONG != 4)
+    if ((imapopts[opt].val.i > 0x7fffffff)||
+	(imapopts[opt].val.i < -0x7fffffff)) {
+	syslog(LOG_ERR, "config_getint: %s: %lld too large for type",
+	       imapopts[opt].optname, imapopts[opt].val.i);
+    }
+#endif    
     return imapopts[opt].val.i;
 }
 
@@ -104,7 +110,13 @@
 {
     assert(opt > IMAPOPT_ZERO && opt < IMAPOPT_LAST);
     assert(imapopts[opt].t == OPT_SWITCH);
-    
+#if (SIZEOF_LONG != 4)
+    if ((imapopts[opt].val.b > 0x7fffffff)||
+	(imapopts[opt].val.b < -0x7fffffff)) {
+	syslog(LOG_ERR, "config_getswitch: %s: %lld too large for type", 
+	       imapopts[opt].optname, imapopts[opt].val.b);
+    }
+#endif    
     return imapopts[opt].val.b;
 }
 

Modified: trunk/cyrus-imapd-2.2/lib/libcyr_cfg.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/libcyr_cfg.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/libcyr_cfg.c (original)
+++ trunk/cyrus-imapd-2.2/lib/libcyr_cfg.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  *
  */
 /*
- * $Id: libcyr_cfg.c,v 1.10 2004/03/09 15:05:58 ken3 Exp $
+ * $Id: libcyr_cfg.c,v 1.12 2005/03/23 19:44:59 shadow Exp $
  */
 
 #include <config.h>
@@ -48,6 +48,7 @@
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <syslog.h>
 
 #include "libcyr_cfg.h"
 #include "cyrusdb.h"
@@ -63,15 +64,15 @@
     { CYRUSOPT_ZERO, { NULL }, CYRUS_OPT_NOTOPT },
 
     { CYRUSOPT_AUTH_UNIX_GROUP_ENABLE,
-      CFGVAL(int, 1),
+      CFGVAL(long, 1),
       CYRUS_OPT_SWITCH },
 
     { CYRUSOPT_USERNAME_TOLOWER,
-      CFGVAL(int, 0),
+      CFGVAL(long, 0),
       CYRUS_OPT_SWITCH },
 
     { CYRUSOPT_SKIPLIST_UNSAFE,
-      CFGVAL(int, 0),
+      CFGVAL(long, 0),
       CYRUS_OPT_SWITCH },
 
     { CYRUSOPT_TEMP_PATH,
@@ -79,7 +80,7 @@
       CYRUS_OPT_STRING },
 
     { CYRUSOPT_PTS_CACHE_TIMEOUT,
-      CFGVAL(int, 3 * 60 * 60), /* 3 hours */
+      CFGVAL(long, 3 * 60 * 60), /* 3 hours */
       CYRUS_OPT_INT },
 
     { CYRUSOPT_CONFIG_DIR,
@@ -87,11 +88,11 @@
       CYRUS_OPT_STRING },
 
     { CYRUSOPT_DB_INIT_FLAGS,
-      CFGVAL(int, 0),
+      CFGVAL(long, 0),
       CYRUS_OPT_INT },
    
     { CYRUSOPT_FULLDIRHASH,
-      CFGVAL(int, 0),
+      CFGVAL(long, 0),
       CYRUS_OPT_SWITCH },
 
     { CYRUSOPT_PTSCACHE_DB,
@@ -103,19 +104,23 @@
       CYRUS_OPT_STRING },
 
     { CYRUSOPT_VIRTDOMAINS,
-      CFGVAL(int, 0),
+      CFGVAL(long, 0),
       CYRUS_OPT_SWITCH },
 
     { CYRUSOPT_BERKELEY_CACHESIZE,
-      CFGVAL(int, 512 * 1024), /* 512KB */
+      CFGVAL(long, 512 * 1024), /* 512KB */
       CYRUS_OPT_INT },
 
+    { CYRUSOPT_AUTH_MECH,
+      CFGVAL(const char *, "unix"),
+      CYRUS_OPT_STRING },
+
     { CYRUSOPT_BERKELEY_LOCKS_MAX,
-      CFGVAL(int, 50000),
+      CFGVAL(long, 50000),
       CYRUS_OPT_INT },
 
     { CYRUSOPT_BERKELEY_TXNS_MAX,
-      CFGVAL(int, 100),
+      CFGVAL(long, 100),
       CYRUS_OPT_INT },
 
     { CYRUSOPT_LAST, { NULL }, CYRUS_OPT_NOTOPT }
@@ -135,7 +140,11 @@
     assert(opt > CYRUSOPT_ZERO && opt < CYRUSOPT_LAST);
     assert(cyrus_options[opt].opt == opt);
     assert(cyrus_options[opt].t == CYRUS_OPT_INT);
-
+#if (SIZEOF_LONG != 4)
+    if ((cyrus_options[opt].val.i > 0x7fffffff)||(cyrus_options[opt].val.i < -0x7fffffff)) {
+	syslog(LOG_ERR, "libcyrus_config_getint: option %d: %lld too large for type", cyrus_options[opt].opt, cyrus_options[opt].val.i);
+    }
+#endif    
     return cyrus_options[opt].val.i;
 }
 
@@ -144,7 +153,11 @@
     assert(opt > CYRUSOPT_ZERO && opt < CYRUSOPT_LAST);
     assert(cyrus_options[opt].opt == opt);
     assert(cyrus_options[opt].t == CYRUS_OPT_SWITCH);
-    
+#if (SIZEOF_LONG != 4)
+    if ((cyrus_options[opt].val.b > 0x7fffffff)||(cyrus_options[opt].val.b < -0x7fffffff)) {
+	syslog(LOG_ERR, "libcyrus_config_getswitch: option %d: %lld too large for type", cyrus_options[opt].opt, cyrus_options[opt].val.b);
+    }
+#endif    
     return cyrus_options[opt].val.b;
 }
 

Modified: trunk/cyrus-imapd-2.2/lib/libcyr_cfg.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/libcyr_cfg.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/libcyr_cfg.h (original)
+++ trunk/cyrus-imapd-2.2/lib/libcyr_cfg.h Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  *
  */
 /*
- * $Id: libcyr_cfg.h,v 1.7 2004/03/09 15:05:58 ken3 Exp $
+ * $Id: libcyr_cfg.h,v 1.9 2005/03/23 19:44:59 shadow Exp $
  */
 
 #ifndef INCLUDED_LIBCYR_CFG_H
@@ -93,6 +93,8 @@
     CYRUSOPT_VIRTDOMAINS,
     /* BDB cache size (512KB) */
     CYRUSOPT_BERKELEY_CACHESIZE,
+    /* authorization mechanism (unix) */
+    CYRUSOPT_AUTH_MECH,
     /* BDB max locks (50000) */
     CYRUSOPT_BERKELEY_LOCKS_MAX,
     /* BDB max txns (100) */
@@ -104,8 +106,8 @@
 
 union cyrus_config_value {
     const char *s; /* string */
-    int i; /* int */
-    int b; /* switch */
+    long i; /* int */
+    long b; /* switch */
 };
 
 struct cyrusopt_s {

Modified: trunk/cyrus-imapd-2.2/lib/mpool.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/mpool.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/mpool.c (original)
+++ trunk/cyrus-imapd-2.2/lib/mpool.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* mpool.c memory pool management
  *
- * $Id: mpool.c,v 1.14 2003/10/22 18:50:12 rjs3 Exp $
+ * $Id: mpool.c,v 1.15 2006/01/10 18:14:53 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -169,18 +169,27 @@
     return ret;
 }
 
+char *mpool_strndup(struct mpool *pool, const char *str, size_t n) 
+{
+    char *ret;
+    
+    if(!str) return NULL;
+    
+    ret = mpool_malloc(pool, n+1);
+    strncpy(ret, str, n);
+    ret[n] = '\0';
+
+    return ret;
+}
+
+
 char *mpool_strdup(struct mpool *pool, const char *str) 
 {
-    char *ret;
     size_t len;
     
     if(!str) return NULL;
     
     len = strlen(str);
     
-    ret = mpool_malloc(pool, len+1);
-    strcpy(ret, str);
-
-    return ret;
+    return mpool_strndup(pool, str, len);
 }
-

Modified: trunk/cyrus-imapd-2.2/lib/mpool.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/mpool.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/mpool.h (original)
+++ trunk/cyrus-imapd-2.2/lib/mpool.h Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* mpool.h memory pool management
  *
- * $Id: mpool.h,v 1.10 2003/10/22 18:50:12 rjs3 Exp $
+ * $Id: mpool.h,v 1.11 2006/01/10 18:14:53 murch Exp $
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -70,5 +70,6 @@
 /* Allocate from a pool */
 void *mpool_malloc(struct mpool *pool, size_t size);
 char *mpool_strdup(struct mpool *pool, const char *str);
+char *mpool_strndup(struct mpool *pool, const char *str, size_t n);
 
 #endif /* _MPOOL_H_ */

Modified: trunk/cyrus-imapd-2.2/lib/xmalloc.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/xmalloc.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/xmalloc.c (original)
+++ trunk/cyrus-imapd-2.2/lib/xmalloc.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 /*
- * $Id: xmalloc.c,v 1.29 2003/02/13 20:15:42 rjs3 Exp $
+ * $Id: xmalloc.c,v 1.30 2006/01/10 23:18:48 jeaton Exp $
  */
 #include <config.h>
 #include <stdio.h>
@@ -100,51 +100,3 @@
     p[len] = '\0';
     return p;
 }
-
-#ifndef HAVE_STRLCPY
-/* strlcpy -- copy string smartly.
- *
- * i believe/hope this is compatible with the BSD strlcpy(). 
- */
-size_t strlcpy(char *dst, const char *src, size_t len)
-{
-    size_t n;
-
-    if (len <= 0) {
-        /* we can't do anything ! */
-        return strlen(src);
-    }
-
-    /* assert(len >= 1); */
-    for (n = 0; n < len-1; n++) {
-	if ((dst[n] = src[n]) == '\0') break;
-    }
-    if (n >= len-1) {
-	/* ran out of space */
-	dst[n] = '\0';
-	while(src[n]) n++;
-    }
-    return n;
-}
-#endif
-
-#ifndef HAVE_STRLCAT
-size_t strlcat(char *dst, const char *src, size_t len)
-{
-    size_t i, j, o;
-    
-    o = strlen(dst);
-    if (len < o + 1)
-	return o + strlen(src);
-    len -= o + 1;
-    for (i = 0, j = o; i < len; i++, j++) {
-	if ((dst[j] = src[i]) == '\0') break;
-    }
-    dst[j] = '\0';
-    if (src[i] == '\0') {
-	return j;
-    } else {
-	return j + strlen(src + i);
-    }
-}
-#endif

Modified: trunk/cyrus-imapd-2.2/lib/xmalloc.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/xmalloc.h?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/xmalloc.h (original)
+++ trunk/cyrus-imapd-2.2/lib/xmalloc.h Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 /* xmalloc.h -- Allocation package that calls fatal() when out of memory
- * $Id: xmalloc.h,v 1.25 2003/10/22 18:50:12 rjs3 Exp $
+ * $Id: xmalloc.h,v 1.26 2006/01/10 23:18:48 jeaton Exp $
  *
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
  *
@@ -55,14 +55,6 @@
 extern char *xstrdup (const char *str);
 extern char *xstrndup (const char *str, unsigned len);
 
-/* handy string manipulation functions */
-#ifndef HAVE_STRLCPY
-extern size_t strlcpy(char *dst, const char *src, size_t len);
-#endif
-#ifndef HAVE_STRLCAT
-extern size_t strlcat(char *dst, const char *src, size_t len);
-#endif
-
 /* Functions using xmalloc.h must provide a function called fatal() conforming
    to the following: */
 extern void fatal(const char *fatal_message, int fatal_code);

Added: trunk/cyrus-imapd-2.2/lib/xstrlcat.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/xstrlcat.c?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/xstrlcat.c (added)
+++ trunk/cyrus-imapd-2.2/lib/xstrlcat.c Fri Mar 31 20:18:13 2006
@@ -1,0 +1,65 @@
+/* xmalloc.c -- Allocation package that calls fatal() when out of memory
+ *
+ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For permission or any other legal
+ *    details, please contact  
+ *      Office of Technology Transfer
+ *      Carnegie Mellon University
+ *      5000 Forbes Avenue
+ *      Pittsburgh, PA  15213-3890
+ *      (412) 268-4387, fax: (412) 268-7395
+ *      tech-transfer at andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Computing Services
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/*
+ * $Id: xstrlcat.c,v 1.1 2006/01/10 23:18:48 jeaton Exp $
+ */
+#include "xstrlcat.h"
+
+#ifndef HAVE_STRLCAT
+size_t strlcat(char *dst, const char *src, size_t len)
+{
+    size_t i, j, o;
+    
+    o = strlen(dst);
+    if (len < o + 1)
+	return o + strlen(src);
+    len -= o + 1;
+    for (i = 0, j = o; i < len; i++, j++) {
+	if ((dst[j] = src[i]) == '\0') break;
+    }
+    dst[j] = '\0';
+    if (src[i] == '\0') {
+	return j;
+    } else {
+	return j + strlen(src + i);
+    }
+}
+#endif

Propchange: trunk/cyrus-imapd-2.2/lib/xstrlcat.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/cyrus-imapd-2.2/lib/xstrlcat.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/xstrlcat.h?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/xstrlcat.h (added)
+++ trunk/cyrus-imapd-2.2/lib/xstrlcat.h Fri Mar 31 20:18:13 2006
@@ -1,0 +1,56 @@
+/* xmalloc.h -- Allocation package that calls fatal() when out of memory
+ * $Id: xstrlcat.h,v 1.1 2006/01/10 23:18:48 jeaton Exp $
+ *
+ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For permission or any other legal
+ *    details, please contact  
+ *      Office of Technology Transfer
+ *      Carnegie Mellon University
+ *      5000 Forbes Avenue
+ *      Pittsburgh, PA  15213-3890
+ *      (412) 268-4387, fax: (412) 268-7395
+ *      tech-transfer at andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Computing Services
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifndef INCLUDED_XSTRLCAT_H
+#define INCLUDED_XSTRLCAT_H
+
+/* for size_t */
+#include <stdio.h>
+/* for free() */
+#include <stdlib.h>
+
+#ifndef HAVE_STRLCAT
+extern size_t strlcat(char *dst, const char *src, size_t len);
+#endif
+
+#endif /* INCLUDED_XSTRLCAT_H */

Propchange: trunk/cyrus-imapd-2.2/lib/xstrlcat.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/cyrus-imapd-2.2/lib/xstrlcpy.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/xstrlcpy.c?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/xstrlcpy.c (added)
+++ trunk/cyrus-imapd-2.2/lib/xstrlcpy.c Fri Mar 31 20:18:13 2006
@@ -1,0 +1,73 @@
+/* xmalloc.c -- Allocation package that calls fatal() when out of memory
+ *
+ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For permission or any other legal
+ *    details, please contact  
+ *      Office of Technology Transfer
+ *      Carnegie Mellon University
+ *      5000 Forbes Avenue
+ *      Pittsburgh, PA  15213-3890
+ *      (412) 268-4387, fax: (412) 268-7395
+ *      tech-transfer at andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Computing Services
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/*
+ * $Id: xstrlcpy.c,v 1.1 2006/01/10 23:18:48 jeaton Exp $
+ */
+#include "xstrlcpy.h"
+
+#include "exitcodes.h"
+
+#ifndef HAVE_STRLCPY
+/* strlcpy -- copy string smartly.
+ *
+ * i believe/hope this is compatible with the BSD strlcpy(). 
+ */
+size_t strlcpy(char *dst, const char *src, size_t len)
+{
+    size_t n;
+
+    if (len <= 0) {
+        /* we can't do anything ! */
+        return strlen(src);
+    }
+
+    /* assert(len >= 1); */
+    for (n = 0; n < len-1; n++) {
+	if ((dst[n] = src[n]) == '\0') break;
+    }
+    if (n >= len-1) {
+	/* ran out of space */
+	dst[n] = '\0';
+	while(src[n]) n++;
+    }
+    return n;
+}
+#endif

Propchange: trunk/cyrus-imapd-2.2/lib/xstrlcpy.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/cyrus-imapd-2.2/lib/xstrlcpy.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/lib/xstrlcpy.h?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/lib/xstrlcpy.h (added)
+++ trunk/cyrus-imapd-2.2/lib/xstrlcpy.h Fri Mar 31 20:18:13 2006
@@ -1,0 +1,57 @@
+/* xmalloc.h -- Allocation package that calls fatal() when out of memory
+ * $Id: xstrlcpy.h,v 1.1 2006/01/10 23:18:48 jeaton Exp $
+ *
+ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For permission or any other legal
+ *    details, please contact  
+ *      Office of Technology Transfer
+ *      Carnegie Mellon University
+ *      5000 Forbes Avenue
+ *      Pittsburgh, PA  15213-3890
+ *      (412) 268-4387, fax: (412) 268-7395
+ *      tech-transfer at andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Computing Services
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifndef INCLUDED_XSTRLCPY_H
+#define INCLUDED_XSTRLCPY_H
+
+/* for size_t */
+#include <stdio.h>
+/* for free() */
+#include <stdlib.h>
+
+/* handy string manipulation functions */
+#ifndef HAVE_STRLCPY
+extern size_t strlcpy(char *dst, const char *src, size_t len);
+#endif
+
+#endif /* INCLUDED_XSTRLCPY_H */

Propchange: trunk/cyrus-imapd-2.2/lib/xstrlcpy.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/cyrus-imapd-2.2/man/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/man/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/man/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/man/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 /.cvsignore/1.2/Wed Oct 22 18:03:08 2003//
 /Makefile.dist/1.1/Mon Mar  1 19:52:43 2004//
 /Makefile.in/1.35/Tue Mar 30 15:18:41 2004//
-/arbitron.8/1.9/Sat Aug  9 23:43:14 2003//
+/arbitron.8/1.14/Fri Jan 13 16:47:19 2006//
 /chk_cyrus.8/1.3/Sat Aug  9 23:43:14 2003//
 /ctl_cyrusdb.8/1.6/Sat Aug  9 23:43:14 2003//
 /ctl_deliver.8/1.9/Wed Oct 22 18:50:13 2003//
@@ -10,11 +10,11 @@
 /cyr_expire.8/1.2/Wed Oct 22 18:03:08 2003//
 /cyrus.conf.5/1.12/Mon Feb  9 18:26:57 2004//
 /deliver.8/1.18/Mon Jun 21 18:40:10 2004//
-/fetchnews.8/1.3/Sun Jan  4 02:42:29 2004//
+/fetchnews.8/1.4/Wed Mar 23 00:40:16 2005//
 /fud.8/1.11/Wed Oct 22 18:50:13 2003//
 /idled.8/1.4/Sat Aug  9 23:43:14 2003//
 /imapd.8/1.15/Thu Oct  3 19:02:41 2002//
-/imclient.3/1.10/Wed Oct 22 18:50:13 2003//
+/imclient.3/1.11/Mon Apr 11 05:48:28 2005//
 /imtest.1/1.14/Thu Dec 16 15:49:08 2004//
 /installsieve.1/1.5/Sat May 25 19:57:48 2002//
 /ipurge.8/1.8/Thu Nov 20 18:47:48 2003//

Modified: trunk/cyrus-imapd-2.2/man/arbitron.8
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/man/arbitron.8?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/man/arbitron.8 (original)
+++ trunk/cyrus-imapd-2.2/man/arbitron.8 Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
 .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\" 
-.\" $Id: arbitron.8,v 1.9 2003/08/09 23:43:14 rjs3 Exp $
+.\" $Id: arbitron.8,v 1.14 2006/01/13 16:47:19 murch Exp $
 
 .SH NAME
 arbitron \- arbitron mailboxes
@@ -51,14 +51,22 @@
 ] [
 .B \-o
 ] [
-.B \-d
-days
+.B \-u
+] [
+.B \-l
 ] [
 .B \-p
-months
+.I months
 ]
 .br
-         \fImailbox\fR...
+         [
+.B \-d
+.I days
+|
+.B \-D
+\fImmddyyyy\fR[\fB:\fImmddyyyy\fR]
+]
+\fImailbox\fR...
 .SH DESCRIPTION
 .I Arbitron
 collects and reports readership statistics for mailboxes on the
@@ -68,15 +76,18 @@
 .I Arbitron
 produces one line of output per mailbox, reporting the mailbox name
 followed by a space, followed by the number of
-readers, and if -o is not specified, another space and the number
-of subscribers.
+readers (and if -u is specified, followed by a colon and a
+comma-separated list of the readers userids), and if -o is not
+specified, another space and the number of subscribers (and if -u is
+specified, followed by a colon and a comma-separated list of the
+subscribers userids).
 \fBIMPORTANT: This format is subject to change in future versions.\fR
 .PP
 Each "reader" is a distinct authentication identity which has
 "s" rights to the mailbox and which has SELECTed the mailbox within
-the past
+either the past
 .I days
-days.
+days or the specified date range.
 Users are not counted as reading their own personal mailboxes.
 Personal mailboxes are not reported unless there is at least one
 reader other than the mailboxes owner.
@@ -93,11 +104,25 @@
 .BI \-o
 "old way" -- do not report subscribers.
 .TP
+.BI \-u
+Report userids in addition to the count(s).
+.TP
+.BI \-l
+Enable long reporting (comma delimited table consisting of mbox, userid,
+r/s, start time, end time).
+.TP
 .BI "\-d " days
 Count as a reader an authentication identity which has SELECTed the
 mailbox within
 .I days
 days.  Default is 30.
+.TP
+\fB\-D\fR \fImmddyyyy\fR[\fB:\fImmddyyyy\fR]
+Count as a reader an authentication identity which has SELECTed the
+mailbox within the given date range.  The start date and optional end
+date are specified as 2-digit month of the year, 2-digit day of the
+month, and 4-digit year.  If the end date is not specified, then the
+current system time is used as the end time.
 .TP
 .BI "\-p " months
 Prune \\Seen state for users who have not SELECTed the mailbox within

Modified: trunk/cyrus-imapd-2.2/man/fetchnews.8
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/man/fetchnews.8?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/man/fetchnews.8 (original)
+++ trunk/cyrus-imapd-2.2/man/fetchnews.8 Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
 .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\" 
-.\" $Id: fetchnews.8,v 1.3 2004/01/04 02:42:29 ken3 Exp $
+.\" $Id: fetchnews.8,v 1.4 2005/03/23 00:40:16 shadow Exp $
 .SH NAME
 fetchnews \- retrieve new articles from peer and feed to Cyrus
 .SH SYNOPSIS
@@ -55,6 +55,9 @@
 .br
           [
 .B \-n
+]
+[
+.B \-y
 ]
 [
 .B \-w
@@ -105,6 +108,9 @@
 will keep track of the high and low water marks for each group and use
 them to fetch new articles.
 .TP
+.B \-y
+Use 4 instead of 2 digits for year. 2-digits are rfc977- but not y2k-compliant.
+.TP
 .BI \-w " wildmat"
 Wildmat pattern specifying which newsgroups to search for new
 articles.  Defaults to "*".

Modified: trunk/cyrus-imapd-2.2/man/imclient.3
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/man/imclient.3?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/man/imclient.3 (original)
+++ trunk/cyrus-imapd-2.2/man/imclient.3 Fri Mar 31 20:18:13 2006
@@ -38,7 +38,7 @@
 .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\" 
-.\" $Id: imclient.3,v 1.10 2003/10/22 18:50:13 rjs3 Exp $
+.\" $Id: imclient.3,v 1.11 2005/04/11 05:48:28 shadow Exp $
 
 .SH NAME
 imclient library - authenticating callback interface to IMAP/IMSP servers
@@ -70,6 +70,10 @@
 .BI "void imclient_processoneevent (struct imclient *" imclient ");"
 .sp .025i
 .BI "int imclient_authenticate (struct imclient *" imclient ", struct sasl_client **" availmech ", const char *" service ", const char *" user ", int " protallowed ");"
+.sp .025i
+.BI "int imclient_havetls ();"
+.sp .025i
+.BI "int imclient_starttls (struct imclient *" imclient ", char *" cert_file ", char *" key_file ", char *" CAfile ", char *" CApath ");"
 
 .SH DESCRIPTION
 The imclient library functions are distributed with Cyrus IMAP and IMSP.
@@ -255,6 +259,32 @@
 On success, 0 is returned.  On failure (i.e., "BAD" keyboard, or no
 authentication mechanisms worked), 1 is returned. On extreme failure
 (premature "OK"), 2 is returned.
+.IP \fB\imclient_havetls() \fP5
+Returns a Boolean indicating whether the
+.B imclient
+library was compiled with TLS (SSL) support.  If so,
+.B imclient_starttls()
+may be used to secure the IMAP connection.
+.IP \fB\imclient_starttls() \fP5
+Issues a STARTTLS command on an existing IMAP connection and
+negotiates the secure link.  The
+.B cert_file
+and
+.B key_file
+arguments specify the client certificate and secret key to use to
+authenticate ourselves to the server.  If client authentication is not
+needed, set both of these arguments to NULL.
+.sp
+The
+.B CAfile
+and
+.B CApath
+arguments specify a file or directory, respectively, of CA
+certificates for validating server certificates.  (See
+.B SSL_CTX_load_verify_locations(3)
+for details.)  If both of these are NULL, the client will be unable to
+validate the server's certificate, in which case the connection may
+succeed but a warning will be printed to stdout.
 
 .SH EXAMPLES
 The following code is a possible skeletion of

Modified: trunk/cyrus-imapd-2.2/master/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/master/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/master/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/master/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -2,13 +2,13 @@
 /CYRUS-MASTER.mib/1.4/Tue Aug 14 16:11:26 2001//
 /Makefile.in/1.21/Fri Dec 17 16:32:24 2004//
 /README/1.9/Wed Oct 22 18:03:09 2003//
-/cyrusMasterMIB.c/1.11/Tue May 18 19:16:50 2004//
+/cyrusMasterMIB.c/1.12/Wed Oct 26 01:11:34 2005//
 /cyrusMasterMIB.h/1.1/Sun Nov  5 22:11:28 2000//
-/master.c/1.100/Fri Dec 17 16:32:24 2004//
+/master.c/1.103/Mon Mar  7 15:45:41 2005//
 /master.h/1.13/Fri Dec 17 16:32:24 2004//
 /masterconf.c/1.12/Tue Nov 25 17:37:19 2003//
 /masterconf.h/1.6/Wed Oct 22 18:50:14 2003//
-/service-thread.c/1.18/Wed Jun  2 17:26:38 2004//
-/service.c/1.53/Fri Dec 17 16:32:25 2004//
+/service-thread.c/1.19/Thu Dec  1 21:16:07 2005//
+/service.c/1.54/Thu Dec  1 21:16:07 2005//
 /service.h/1.16/Wed Oct 22 18:50:14 2003//
 D

Modified: trunk/cyrus-imapd-2.2/master/conf/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/master/conf/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/master/conf/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/master/conf/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /cmu-backend.conf/1.3/Wed Oct 22 18:03:10 2003//
 /cmu-frontend.conf/1.2/Wed Oct 22 18:03:10 2003//
-/normal.conf/1.11/Wed Oct 22 18:03:10 2003//
+/normal.conf/1.12/Thu Mar 30 16:01:39 2006//
 /prefork.conf/1.10/Wed Oct 22 18:03:10 2003//
 /small.conf/1.9/Tue Oct  1 20:46:01 2002//
 D

Modified: trunk/cyrus-imapd-2.2/master/conf/normal.conf
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/master/conf/normal.conf?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/master/conf/normal.conf (original)
+++ trunk/cyrus-imapd-2.2/master/conf/normal.conf Fri Mar 31 20:18:13 2006
@@ -25,7 +25,7 @@
 #  lmtp		cmd="lmtpd" listen="lmtp" prefork=0
   lmtpunix	cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=0
 
-  # this is only necessary if using notifications
+  # this is required if using notifications
 #  notify	cmd="notifyd" listen="/var/imap/socket/notify" proto="udp" prefork=1
 }
 

Modified: trunk/cyrus-imapd-2.2/master/cyrusMasterMIB.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/master/cyrusMasterMIB.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/master/cyrusMasterMIB.c (original)
+++ trunk/cyrus-imapd-2.2/master/cyrusMasterMIB.c Fri Mar 31 20:18:13 2006
@@ -212,10 +212,14 @@
 	return (unsigned char *) &long_ret;
       
     case SERVICENAME:
-	strlcpy(string, Services[index - 1].name, sizeof(string));
-	if(Services[index - 1].family == AF_INET6) {
-	    strlcat(string, "[v6]", sizeof(string));
-	}
+        if (Services[index - 1].name != NULL) {
+	   strlcpy(string, Services[index - 1].name, sizeof(string));
+	   if(Services[index - 1].family == AF_INET6) {
+	       strlcat(string, "[v6]", sizeof(string));
+	   }
+        } else {
+           strlcpy(string, "", sizeof(string));
+        }
 	*var_len = strlen(string);
 	return (unsigned char *) string;
       

Modified: trunk/cyrus-imapd-2.2/master/master.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/master/master.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/master/master.c (original)
+++ trunk/cyrus-imapd-2.2/master/master.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: master.c,v 1.100 2004/12/17 16:32:24 ken3 Exp $ */
+/* $Id: master.c,v 1.103 2005/03/07 15:45:41 shadow Exp $ */
 
 #include <config.h>
 
@@ -1286,11 +1286,11 @@
 void add_start(const char *name, struct entry *e,
 	       void *rock __attribute__((unused)))
 {
-    char *cmd = xstrdup(masterconf_getstring(e, "cmd", NULL));
+    char *cmd = xstrdup(masterconf_getstring(e, "cmd", ""));
     char buf[256];
     char **tok;
 
-    if (!cmd) {
+    if (!strcmp(cmd,"")) {
 	snprintf(buf, sizeof(buf), "unable to find command for %s", name);
 	fatal(buf, EX_CONFIG);
     }
@@ -1305,11 +1305,11 @@
 void add_service(const char *name, struct entry *e, void *rock)
 {
     int ignore_err = (int) rock;
-    char *cmd = xstrdup(masterconf_getstring(e, "cmd", NULL));
+    char *cmd = xstrdup(masterconf_getstring(e, "cmd", ""));
     int prefork = masterconf_getint(e, "prefork", 0);
     int babysit = masterconf_getswitch(e, "babysit", 0);
     int maxforkrate = masterconf_getint(e, "maxforkrate", 0);
-    char *listen = xstrdup(masterconf_getstring(e, "listen", NULL));
+    char *listen = xstrdup(masterconf_getstring(e, "listen", ""));
     char *proto = xstrdup(masterconf_getstring(e, "proto", "tcp"));
     char *max = xstrdup(masterconf_getstring(e, "maxchild", "-1"));
     rlim_t maxfds = (rlim_t) masterconf_getint(e, "maxfds", 256);
@@ -1319,7 +1319,7 @@
     if(babysit && prefork == 0) prefork = 1;
     if(babysit && maxforkrate == 0) maxforkrate = 10; /* reasonable safety */
 
-    if (!cmd || !listen) {
+    if (!strcmp(cmd,"") || !strcmp(listen,"")) {
 	char buf[256];
 	snprintf(buf, sizeof(buf),
 		 "unable to find command or port for service '%s'", name);
@@ -1439,13 +1439,13 @@
 void add_event(const char *name, struct entry *e, void *rock)
 {
     int ignore_err = (int) rock;
-    char *cmd = xstrdup(masterconf_getstring(e, "cmd", NULL));
+    char *cmd = xstrdup(masterconf_getstring(e, "cmd", ""));
     int period = 60 * masterconf_getint(e, "period", 0);
     int at = masterconf_getint(e, "at", -1), hour, min;
     time_t now = time(NULL);
     struct event *evt;
 
-    if (!cmd) {
+    if (!strcmp(cmd,"")) {
 	char buf[256];
 	snprintf(buf, sizeof(buf),
 		 "unable to find command or port for event '%s'", name);

Modified: trunk/cyrus-imapd-2.2/master/service-thread.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/master/service-thread.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/master/service-thread.c (original)
+++ trunk/cyrus-imapd-2.2/master/service-thread.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: service-thread.c,v 1.18 2004/06/02 17:26:38 rjs3 Exp $ */
+/* $Id: service-thread.c,v 1.19 2005/12/01 21:16:07 murch Exp $ */
 #include <config.h>
 
 #include <stdio.h>
@@ -104,6 +104,9 @@
     struct sockaddr_storage sin;
     socklen_t len = sizeof(sin);
     
+    /* XXX: old FreeBSD didn't fill sockaddr correctly against AF_UNIX */
+    sin.ss_family = AF_UNIX;
+
     /* is this a connection from the local host? */
     if (getpeername(fd, (struct sockaddr *) &sin, &len) == 0) {
 	if (((struct sockaddr *)&sin)->sa_family == AF_UNIX) {

Modified: trunk/cyrus-imapd-2.2/master/service.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/master/service.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/master/service.c (original)
+++ trunk/cyrus-imapd-2.2/master/service.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: service.c,v 1.53 2004/12/17 16:32:25 ken3 Exp $ */
+/* $Id: service.c,v 1.54 2005/12/01 21:16:07 murch Exp $ */
 
 #include <config.h>
 
@@ -108,7 +108,10 @@
     int a;
     struct sockaddr_storage sin;
     socklen_t len = sizeof(sin);
-    
+
+    /* XXX: old FreeBSD didn't fill sockaddr correctly against AF_UNIX */
+    sin.ss_family = AF_UNIX;
+
     /* is this a connection from the local host? */
     if (getpeername(fd, (struct sockaddr *) &sin, &len) == 0) {
 	if (((struct sockaddr *)&sin)->sa_family == AF_UNIX) {

Modified: trunk/cyrus-imapd-2.2/notifyd/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/notifyd/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/notifyd/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/notifyd/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -3,13 +3,13 @@
 /exitcodes.h/1.2/Thu Feb 13 20:15:48 2003//
 /notify_log.c/1.7/Wed Oct 22 18:50:16 2003//
 /notify_log.h/1.5/Thu Feb 13 20:15:48 2003//
-/notify_mailto.c/1.9/Thu Mar 11 15:23:19 2004//
+/notify_mailto.c/1.11/Thu Mar 30 16:00:03 2006//
 /notify_mailto.h/1.5/Thu Feb 13 20:15:48 2003//
 /notify_null.c/1.6/Thu Feb 13 20:15:48 2003//
 /notify_null.h/1.5/Thu Feb 13 20:15:48 2003//
 /notify_zephyr.c/1.4/Thu Feb 13 20:15:48 2003//
 /notify_zephyr.h/1.3/Thu Feb 13 20:15:48 2003//
-/notifyd.c/1.18/Fri Dec 17 16:32:25 2004//
+/notifyd.c/1.19/Wed Apr 13 15:42:05 2005//
 /notifyd.h/1.2/Thu Feb 13 20:15:48 2003//
 /notifytest.c/1.10/Thu Feb 13 20:15:48 2003//
 /version.h/1.2/Thu Feb 13 20:15:48 2003//

Modified: trunk/cyrus-imapd-2.2/notifyd/notify_mailto.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/notifyd/notify_mailto.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/notifyd/notify_mailto.c (original)
+++ trunk/cyrus-imapd-2.2/notifyd/notify_mailto.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: notify_mailto.c,v 1.9 2004/03/11 15:23:19 ken3 Exp $
+ * $Id: notify_mailto.c,v 1.11 2006/03/30 16:00:03 murch Exp $
  */
 
 #include <config.h>
@@ -59,9 +59,11 @@
 #include "rfc822date.h"
 #include "sieve_interface.h"
 
+static int contains_8bit(const char *msg);
+
 static int global_outgoing_count = 0;
 
-char* notify_mailto(const char *class __attribute__((unused)),
+char* notify_mailto(const char *class,
 		    const char *priority __attribute__((unused)),
 		    const char *user __attribute__((unused)),
 		    const char *mailbox __attribute__((unused)),
@@ -119,7 +121,12 @@
     fprintf(sm, "X-Sieve: %s\r\n", SIEVE_VERSION);
     fprintf(sm, "From: Mail Sieve Subsystem <%s>\r\n", config_getstring(IMAPOPT_POSTMASTER));
     fprintf(sm, "To: <%s>\r\n", options[0]);
-    fprintf(sm, "Subject: [SIEVE] New mail notification\r\n");
+    fprintf(sm, "Subject: [%s] New mail notification\r\n", class);
+    if (contains_8bit(message)) {
+	fprintf(sm, "MIME-Version: 1.0\r\n");
+	fprintf(sm, "Content-Type: text/plain; charset=UTF-8\r\n");
+	fprintf(sm, "Content-Transfer-Encoding: 8BIT\r\n");
+    }
     fprintf(sm, "\r\n");
 
     fprintf(sm, "%s\r\n", message);
@@ -133,3 +140,21 @@
 
     return strdup("OK mailto notification successful");
 }
+
+static int contains_8bit(const char * msg)
+{
+    int result = 0;
+
+    if (msg) {
+	const unsigned char *s = (const unsigned char *)msg;
+	
+	while (*s) {
+	    if (0 != (*s & 0x80)) {
+		result = 1;
+		break ;
+	    }
+	    s++;
+	}
+    }
+    return result;
+}

Modified: trunk/cyrus-imapd-2.2/notifyd/notifyd.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/notifyd/notifyd.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/notifyd/notifyd.c (original)
+++ trunk/cyrus-imapd-2.2/notifyd/notifyd.c Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: notifyd.c,v 1.18 2004/12/17 16:32:25 ken3 Exp $
+ * $Id: notifyd.c,v 1.19 2005/04/13 15:42:05 shadow Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -266,4 +266,5 @@
     r = do_notify();
 
     shut_down(r);
-}
+    return 0;
+}

Modified: trunk/cyrus-imapd-2.2/perl/imap/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/imap/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/imap/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/perl/imap/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,11 +1,11 @@
 /.cvsignore/1.1/Sun Jan  6 02:03:32 2002//
 /Changes/1.1/Wed May  3 17:30:54 2000//
-/IMAP.pm/1.19/Wed Oct 22 18:50:18 2003//
+/IMAP.pm/1.22/Mon Aug  8 15:09:09 2005//
 /IMAP.xs/1.24/Tue Nov 25 21:28:23 2003//
 /MANIFEST/1.3/Thu Dec  7 22:40:24 2000//
 /Makefile.PL/1.17/Wed Oct 22 18:50:18 2003//
 /README/1.3/Mon Nov 24 20:19:50 2003//
-/cyradm.sh/1.16/Thu Jan 15 14:35:34 2004//
+/cyradm.sh/1.17/Mon Nov 21 16:39:24 2005//
 /cyrperl.h/1.7/Thu Feb 13 20:15:49 2003//
 /typemap/1.2/Wed May  3 21:37:20 2000//
 /xsutil.c/1.5/Thu Feb 13 20:15:49 2003//

Modified: trunk/cyrus-imapd-2.2/perl/imap/IMAP.pm
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/imap/IMAP.pm?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/imap/IMAP.pm (original)
+++ trunk/cyrus-imapd-2.2/perl/imap/IMAP.pm Fri Mar 31 20:18:13 2006
@@ -37,7 +37,7 @@
 # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
-# $Id: IMAP.pm,v 1.19 2003/10/22 18:50:18 rjs3 Exp $
+# $Id: IMAP.pm,v 1.22 2005/08/08 15:09:09 ken3 Exp $
 
 package Cyrus::IMAP;
 
@@ -225,6 +225,11 @@
   $opts{-authz} = "" if (!defined($opts{-authz}));
   $rc = 0;
   if (defined($opts{-mechanism}) && lc($opts{-mechanism}) ne 'login') {
+    # This seems to be the only way to avoid a
+    # `Use of uninitialized value in subroutine entry' warning with perl -w
+    # when $opts{-password} is uninitialized (which may well be ok for e.g.
+    # the GSSAPI mechanism).
+    no warnings 'uninitialized';
     $rc = $self->_authenticate($opts{-mechanism}, $opts{-service},
 			       $opts{-authz}, $opts{-user}, $opts{-password},
 			       $opts{-minssf}, $opts{-maxssf});

Modified: trunk/cyrus-imapd-2.2/perl/imap/IMAP/Admin.pm
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/imap/IMAP/Admin.pm?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/imap/IMAP/Admin.pm (original)
+++ trunk/cyrus-imapd-2.2/perl/imap/IMAP/Admin.pm Fri Mar 31 20:18:13 2006
@@ -37,14 +37,15 @@
 # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
-# $Id: Admin.pm,v 1.45 2004/02/19 22:50:12 rjs3 Exp $
+# $Id: Admin.pm,v 1.48 2005/11/21 16:39:25 murch Exp $
 
 package Cyrus::IMAP::Admin;
 use strict;
 use Cyrus::IMAP;
 use vars qw($VERSION
 	    *create *delete *deleteacl *listacl *list *rename *setacl
-	    *subscribed *quota *quotaroot *info *setinfo *xfer);
+	    *subscribed *quota *quotaroot *info *setinfo *xfer
+	    *subscribe *unsubscribe);
 
 $VERSION = '1.00';
 
@@ -782,6 +783,7 @@
   my %values = ( "comment" => "/comment",
 		 "news2mail" => "/vendor/cmu/cyrus-imapd/news2mail",
 		 "expire" => "/vendor/cmu/cyrus-imapd/expire",
+		 "sieve" => "/vendor/cmu/cyrus-imapd/sieve",
 		 "squat" => "/vendor/cmu/cyrus-imapd/squat" );
 
   if(!$self->{support_annotatemore}) {
@@ -879,6 +881,76 @@
   }
 }
 *setinfo = *setinfoserver;
+
+sub subscribemailbox {
+  my ($self, $mbx) = @_;
+  my ($rc, $msg) = $self->send('', '', 'SUBSCRIBE %s', $mbx);
+  if ($rc eq 'OK') {
+    $self->{error} = undef;
+    1;
+  } else {
+    if($self->{support_referrals} && $msg =~ m|^\[REFERRAL\s+([^\]\s]+)\]|) {
+      my ($refserver, $box) = $self->fromURL($1);
+      my $port = 143;
+
+      if($refserver =~ /:/) {
+        $refserver =~ /([^:]+):(\d+)/;
+        $refserver = $1; $port = $2;
+      }
+
+      my $cyradm = Cyrus::IMAP::Admin->new($refserver, $port)
+        or die "cyradm: cannot connect to $refserver\n";
+      $cyradm->addcallback({-trigger => 'EOF',
+                            -callback => \&_cb_ref_eof,
+                            -rock => \$cyradm});
+      $cyradm->authenticate(@{$self->_getauthopts()})
+        or die "cyradm: cannot authenticate to $refserver\n";
+
+      my $ret = $cyradm->subscribemailbox($box);
+      $self->{error} = $cyradm->error;
+      $cyradm = undef;
+      return $ret;
+    }
+    $self->{error} = $msg;
+    undef;
+  }
+}
+*subscribe = *subscribemailbox;
+
+sub unsubscribemailbox {
+  my ($self, $mbx) = @_;
+  my ($rc, $msg) = $self->send('', '', 'UNSUBSCRIBE %s', $mbx);
+  if ($rc eq 'OK') {
+    $self->{error} = undef;
+    1;
+  } else {
+    if($self->{support_referrals} && $msg =~ m|^\[REFERRAL\s+([^\]\s]+)\]|) {
+      my ($refserver, $box) = $self->fromURL($1);
+      my $port = 143;
+
+      if($refserver =~ /:/) {
+        $refserver =~ /([^:]+):(\d+)/;
+        $refserver = $1; $port = $2;
+      }
+
+      my $cyradm = Cyrus::IMAP::Admin->new($refserver, $port)
+        or die "cyradm: cannot connect to $refserver\n";
+      $cyradm->addcallback({-trigger => 'EOF',
+                            -callback => \&_cb_ref_eof,
+                            -rock => \$cyradm});
+      $cyradm->authenticate(@{$self->_getauthopts()})
+        or die "cyradm: cannot authenticate to $refserver\n";
+
+      my $ret = $cyradm->unsubscribemailbox($box);
+      $self->{error} = $cyradm->error;
+      $cyradm = undef;
+      return $ret;
+    }
+    $self->{error} = $msg;
+    undef;
+  }
+}
+*unsubscribe = *unsubscribemailbox;
 
 sub error {
   my $self = shift;

Modified: trunk/cyrus-imapd-2.2/perl/imap/IMAP/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/imap/IMAP/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/imap/IMAP/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/perl/imap/IMAP/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,4 +1,4 @@
-/Admin.pm/1.45/Thu Feb 19 22:50:12 2004//
+/Admin.pm/1.48/Mon Nov 21 16:39:25 2005//
 /IMSP.pm/1.3/Sat May 25 19:57:49 2002//
-/Shell.pm/1.35/Thu Jan 15 14:35:35 2004//
+/Shell.pm/1.37/Thu Mar 23 15:41:56 2006//
 D

Modified: trunk/cyrus-imapd-2.2/perl/imap/IMAP/Shell.pm
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/imap/IMAP/Shell.pm?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/imap/IMAP/Shell.pm (original)
+++ trunk/cyrus-imapd-2.2/perl/imap/IMAP/Shell.pm Fri Mar 31 20:18:13 2006
@@ -37,7 +37,7 @@
 # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
-# $Id: Shell.pm,v 1.35 2004/01/15 14:35:35 ken3 Exp $
+# $Id: Shell.pm,v 1.37 2006/03/23 15:41:56 jeaton Exp $
 #
 # A shell framework for Cyrus::IMAP::Admin
 #
@@ -126,7 +126,7 @@
 		  [\&_sc_info, '[mailbox]',
 		   'display mailbox/server metadata'],
 		mboxcfg =>
-		  [\&_sc_mboxcfg, 'mailbox [comment|news2mail|expire|squat] value',
+		  [\&_sc_mboxcfg, 'mailbox [comment|news2mail|expire|sieve|squat] value',
 		   'configure mailbox'],
 		mboxconfig => 'mboxcfg',
 		reconstruct =>
@@ -159,6 +159,14 @@
 		   '[--partition partition] mailbox server [partition]',
 		   'transfer (relocate) a mailbox to a different server'],
 		xfer => 'xfermailbox',
+		subscribe =>
+		  [\&_sc_subscribe, '[mailbox]',
+                  'subscribe to a mailbox'],
+		sub => 'subscribe',
+		unsubscribe =>
+		  [\&_sc_unsubscribe, '[mailbox]',
+                  'unsubscribe from a mailbox'],
+		unsub => 'unsubscribe',
 		#? alias
 		#? unalias
 		#? load
@@ -1332,6 +1340,59 @@
   0;
 }
 
+sub _sc_subscribe {
+  my ($cyrref, $name, $fh, $lfh, @argv) = @_;
+  my (@nargv, $opt);
+  shift(@argv);
+  while (defined ($opt = shift(@argv))) {
+    # gack.  bloody tcl.
+    last if $opt eq '--';
+    if ($opt =~ /^-/) {
+      die "usage: subscribe [mailbox]\n";
+    }
+    else {
+      push(@nargv, $opt);
+      last;
+    }
+  }
+  push(@nargv, @argv);
+  if (!$cyrref || !$$cyrref) {
+    die "subscribe: no connection to server\n";
+  }
+  $$cyrref->subscribe(@nargv);
+  if (defined $$cyrref->error) {
+    $lfh->[2]->print($$cyrref->error, "\n");
+    return 1;
+  }
+  0;
+}
+sub _sc_unsubscribe {
+  my ($cyrref, $name, $fh, $lfh, @argv) = @_;
+  my (@nargv, $opt);
+  shift(@argv);
+  while (defined ($opt = shift(@argv))) {
+    # gack.  bloody tcl.
+    last if $opt eq '--';
+    if ($opt =~ /^-/) {
+      die "usage: unsubscribe [mailbox]\n";
+    }
+    else {
+      push(@nargv, $opt);
+      last;
+    }
+  }
+  push(@nargv, @argv);
+  if (!$cyrref || !$$cyrref) {
+    die "unsubscribe: no connection to server\n";
+  }
+  $$cyrref->unsubscribe(@nargv);
+  if (defined $$cyrref->error) {
+    $lfh->[2]->print($$cyrref->error, "\n");
+    return 1;
+  }
+  0;
+}
+
 sub _sc_mboxcfg {
   my ($cyrref, $name, $fh, $lfh, @argv) = @_;
   my (@nargv, $opt);
@@ -1339,7 +1400,7 @@
   while (defined ($opt = shift(@argv))) {
     last if $opt eq '--';
     if ($opt =~ /^-/) {
-      die "usage: mboxconfig mailbox [comment|news2mail|expire|squat] value\n";
+      die "usage: mboxconfig mailbox [comment|news2mail|expire|sieve|squat] value\n";
     }
     else {
       push(@nargv, $opt);
@@ -1348,7 +1409,7 @@
   }
   push(@nargv, @argv);
   if (@nargv < 2) {
-    die "usage: mboxconfig mailbox [comment|news2mail|expire|squat] value\n";
+    die "usage: mboxconfig mailbox [comment|news2mail|expire|sieve|squat] value\n";
   }
   if (!$cyrref || !$$cyrref) {
     die "mboxconfig: no connection to server\n";
@@ -1583,6 +1644,12 @@
 
 Sets the number of days after which messages will be expired from the mailbox.
 
+=item C<sieve>
+
+Indicates the name of the global sieve script that should be run when
+a message is delivered to the shared mailbox (not used for personal
+mailboxes).
+
 =item C<squat>
 
 Indicates that the mailbox should have a squat index created for it.

Modified: trunk/cyrus-imapd-2.2/perl/imap/cyradm.sh
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/imap/cyradm.sh?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/imap/cyradm.sh (original)
+++ trunk/cyrus-imapd-2.2/perl/imap/cyradm.sh Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
 # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 #
-# $Id: cyradm.sh,v 1.16 2004/01/15 14:35:34 ken3 Exp $
+# $Id: cyradm.sh,v 1.17 2005/11/21 16:39:24 murch Exp $
 case "x$BASH_VERSION" in
 x) exec perl -MCyrus::IMAP::Shell -e shell -- ${1+"$@"} ;;
 *) exec perl -MCyrus::IMAP::Shell -e shell -- "$@" ;;
@@ -216,6 +216,12 @@
 
 Sets the number of days after which messages will be expired from the mailbox.
 
+=item C<sieve>
+
+Indicates the name of the global sieve script that should be run when
+a message is delivered to the shared mailbox (not used for personal
+mailboxes).
+
 =item C<squat>
 
 Indicates that the mailbox should have a squat index created for it.

Modified: trunk/cyrus-imapd-2.2/perl/sieve/lib/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/sieve/lib/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/sieve/lib/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/perl/sieve/lib/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -2,7 +2,7 @@
 /Makefile.in/1.14/Fri May 28 18:03:07 2004//
 /codes.h/1.4/Thu Feb 13 20:15:53 2003//
 /exitcodes.h/1.3/Thu Feb 13 20:15:53 2003//
-/isieve.c/1.28/Thu Jun 17 18:06:54 2004//
+/isieve.c/1.29/Thu Apr 21 21:03:49 2005//
 /isieve.h/1.10/Thu Feb 13 20:15:53 2003//
 /lex.c/1.7/Thu Feb 13 20:15:53 2003//
 /lex.h/1.7/Thu Feb 13 20:15:53 2003//

Modified: trunk/cyrus-imapd-2.2/perl/sieve/lib/isieve.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/sieve/lib/isieve.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/sieve/lib/isieve.c (original)
+++ trunk/cyrus-imapd-2.2/perl/sieve/lib/isieve.c Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  *
  */
 
-/* $Id: isieve.c,v 1.28 2004/06/17 18:06:54 rjs3 Exp $ */
+/* $Id: isieve.c,v 1.29 2005/04/21 21:03:49 shadow Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -251,7 +251,9 @@
   while (yylex(&state,obj->pin)==STRING)
   {
       char *attr = string_DATAPTR(state.str);
-      char *val = NULL;
+      char *val;
+
+      val = NULL;
 
       if (yylex(&state,obj->pin)==' ')
       {
@@ -259,7 +261,7 @@
 	  {
 	      parseerror("STRING");
 	  }
-	  val = string_DATAPTR(state.str);
+	  val = xstrdup(string_DATAPTR(state.str));
 	  if (yylex(&state,obj->pin)!=EOL)
 	  {
 	      parseerror("EOL1");
@@ -268,7 +270,8 @@
 
       if (strcasecmp(attr,"SASL")==0)
       {
-	cap = val;
+	if (cap) free(cap);
+	cap = xstrdup(val);
       } else if (strcasecmp(attr,"SIEVE")==0) {
 
       } else if (strcasecmp(attr,"IMPLEMENTATION")==0) {
@@ -279,12 +282,13 @@
 	  obj->version = OLD_VERSION;
 	  cap = (char *) xmalloc(strlen(val));
 	  memset(cap, '\0', strlen(val));
-	  memcpy(cap, val+6, strlen(val)-7);
+	  memcpy(cap, val+5, strlen(val)-6);
 
 	  return cap;
       } else {
-	  /* unkown capability */
+	  /* unknown capability */
       }
+      if (val) { free(val); val = NULL; }
   }
 
   if (yylex(&state,obj->pin)!=EOL)

Modified: trunk/cyrus-imapd-2.2/perl/sieve/managesieve/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/sieve/managesieve/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/sieve/managesieve/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/perl/sieve/managesieve/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,8 +1,8 @@
 /.cvsignore/1.1/Sun Jan  6 02:03:32 2002//
 /MANIFEST/1.1/Tue May  9 17:22:30 2000//
-/Makefile.PL/1.12/Wed Oct 22 18:50:27 2003//
+/Makefile.PL/1.13/Thu Oct 13 20:30:03 2005//
 /managesieve.h/1.5/Thu Feb 13 20:15:55 2003//
 /managesieve.pm/1.8/Sat May 25 19:57:51 2002//
-/managesieve.xs/1.21/Wed Oct 22 18:50:27 2003//
+/managesieve.xs/1.22/Thu Apr 21 18:38:10 2005//
 /typemap/1.1/Wed May  3 17:31:02 2000//
 D

Modified: trunk/cyrus-imapd-2.2/perl/sieve/managesieve/Makefile.PL
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/sieve/managesieve/Makefile.PL?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/sieve/managesieve/Makefile.PL (original)
+++ trunk/cyrus-imapd-2.2/perl/sieve/managesieve/Makefile.PL Fri Mar 31 20:18:13 2006
@@ -37,7 +37,7 @@
 # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
-# $Id: Makefile.PL,v 1.12 2003/10/22 18:50:27 rjs3 Exp $
+# $Id: Makefile.PL,v 1.13 2005/10/13 20:30:03 jeaton Exp $
 #
 use ExtUtils::MakeMaker;
 use Config;
@@ -63,4 +63,6 @@
     'LIBS'	=> ["$BDB_LIB $SASL_LIB $OPENSSL_LIB $LIB_RT -lssl -lcrypto"], 
     'DEFINE'	=> '-DPERL_POLLUTE',     # e.g., '-DHAVE_SOMETHING' 
     'INC'	=> "-I../lib/ -I../../../lib/ $SASL_INC $OPENSSL_INC",
+    'CC'	=> $ENV{CC},
+    'LD'	=> $ENV{CC}
 );

Modified: trunk/cyrus-imapd-2.2/perl/sieve/managesieve/managesieve.xs
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/perl/sieve/managesieve/managesieve.xs?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/perl/sieve/managesieve/managesieve.xs (original)
+++ trunk/cyrus-imapd-2.2/perl/sieve/managesieve/managesieve.xs Fri Mar 31 20:18:13 2006
@@ -39,7 +39,7 @@
  *
  */
 
-/* $Id: managesieve.xs,v 1.21 2003/10/22 18:50:27 rjs3 Exp $ */
+/* $Id: managesieve.xs,v 1.22 2005/04/21 18:38:10 shadow Exp $ */
 
 #ifdef __cplusplus
 extern "C" {
@@ -330,7 +330,7 @@
 
   if(r) {
 	/* we failed */
-	free(ret->class);
+	safefree(ret->class);
 	free(ret);
 	XSRETURN_UNDEF;
   }

Modified: trunk/cyrus-imapd-2.2/ptclient/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/ptclient/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/ptclient/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/ptclient/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,12 +1,13 @@
 /.cvsignore/1.3/Tue Mar  9 18:05:40 2004//
-/Makefile.in/1.27/Fri May 28 18:03:08 2004//
+/Makefile.in/1.28/Thu Feb 17 18:41:29 2005//
 /README/1.5/Wed Oct 22 18:50:29 2003//
-/afskrb.c/1.10/Wed Jan 19 07:35:45 2005//
-/ldap.c/1.7/Thu Jun 24 19:28:39 2004//
+/afskrb.c/1.12/Thu Oct 13 20:37:10 2005//
+/ldap.c/1.9/Thu May 12 19:49:55 2005//
 /ptdump.c/1.12/Thu Mar 11 18:36:46 2004//
 /ptexpire.c/1.18/Wed May 26 16:05:59 2004//
 /ptextract.c/1.4/Thu Feb 13 20:15:56 2003//
-/ptloader.c/1.39/Fri Dec 17 16:32:26 2004//
+/ptloader.c/1.41/Thu Oct 13 20:37:10 2005//
+/ptloader.h/1.1/Wed Feb 16 20:38:04 2005//
 /test.c/1.6/Wed Oct 22 18:50:29 2003//
 /test2.c/1.6/Wed Oct 22 18:50:29 2003//
 D

Modified: trunk/cyrus-imapd-2.2/ptclient/Makefile.in
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/ptclient/Makefile.in?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/ptclient/Makefile.in (original)
+++ trunk/cyrus-imapd-2.2/ptclient/Makefile.in Fri Mar 31 20:18:13 2006
@@ -41,7 +41,7 @@
 # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
-# $Id: Makefile.in,v 1.27 2004/05/28 18:03:08 rjs3 Exp $
+# $Id: Makefile.in,v 1.28 2005/02/17 18:41:29 shadow Exp $
 # 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -96,11 +96,11 @@
 .c.o:
 	$(CC) -c $(CPPFLAGS) $(LDAP_CPPFLAGS) $(DEFS) $(CFLAGS) $<
 
-ptloader: ptloader.o @WITH_PTS at .o ../imap/mutex_fake.o $(DEPLIBS)
-	$(CC) $(LDFLAGS) -o $@ ptloader.o @WITH_PTS at .o ../imap/mutex_fake.o $(SERVICETHREAD) ${AFS_LDFLAGS} ${LDAP_LDFLAGS} $(AFS_LIBS) ${LDAP_LIBS} $(DEPLIBS) $(LIB_SASL) $(LIBS) $(LIB_WRAP) $(LIB_RT)
+ptloader: ptloader.o afskrb.o ldap.o ../imap/mutex_fake.o $(DEPLIBS)
+	$(CC) $(LDFLAGS) -o $@ ptloader.o afskrb.o ldap.o ../imap/mutex_fake.o $(SERVICETHREAD) ${AFS_LDFLAGS} ${LDAP_LDFLAGS} $(AFS_LIBS) ${LDAP_LIBS} $(DEPLIBS) $(LIB_SASL) $(LIBS) $(LIB_WRAP) $(LIB_RT)
 
-ptloader.pure: ptloader.o @WITH_PTS at .o ../imap/mutex_fake.o $(DEPLIBS)
-	$(PURIFY) $(PUREARGS) $(CC) $(LDFLAGS) -o $@ ptloader.o @WITH_PTS at .o ../imap/mutex_fake.o $(SERVICETHREAD) ${AFS_LDFLAGS} ${LDAP_LDFLAGS} $(AFS_LIBS) ${LDAP_LIBS} $(DEPLIBS) $(LIB_SASL) $(LIBS) $(LIB_WRAP) $(LIB_RT)
+ptloader.pure: ptloader.o afskrb.o ldap.o ../imap/mutex_fake.o $(DEPLIBS)
+	$(PURIFY) $(PUREARGS) $(CC) $(LDFLAGS) -o $@ ptloader.o afskrb.o ldap.o ../imap/mutex_fake.o $(SERVICETHREAD) ${AFS_LDFLAGS} ${LDAP_LDFLAGS} $(AFS_LIBS) ${LDAP_LIBS} $(DEPLIBS) $(LIB_SASL) $(LIBS) $(LIB_WRAP) $(LIB_RT)
 
 ptexpire: ptexpire.o $(DEPLIBS) $(UTIL_LIBS)
 	$(CC) $(LDFLAGS) -o $@ ptexpire.o $(UTIL_LIBS) $(DEPLIBS) $(LIB_SASL) $(LIBS) $(LIB_RT)

Modified: trunk/cyrus-imapd-2.2/ptclient/afskrb.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/ptclient/afskrb.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/ptclient/afskrb.c (original)
+++ trunk/cyrus-imapd-2.2/ptclient/afskrb.c Fri Mar 31 20:18:13 2006
@@ -41,9 +41,13 @@
  */
 
 static char rcsid[] __attribute__((unused)) = 
-      "$Id: afskrb.c,v 1.10 2005/01/19 07:35:45 shadow Exp $";
+      "$Id: afskrb.c,v 1.12 2005/10/13 20:37:10 jeaton Exp $";
 
 #include <config.h>
+#include "ptloader.h"
+#include "exitcodes.h"
+
+#ifdef HAVE_AFSKRB
 
 #include <string.h>
 #include <stdio.h>
@@ -64,7 +68,6 @@
 #endif
 
 #include "auth_pts.h"
-#include "exitcodes.h"
 #include "libconfig.h"
 #include "strhash.h"
 #include "xmalloc.h"
@@ -128,11 +131,13 @@
 static char *afspts_canonifyid(const char *identifier, size_t len)
 {
     static char *retbuf = NULL;
+    char *tmp = NULL;
     krb5_context context;
     krb5_principal princ, princ_dummy;
     char *realm;
     char *realmbegin;
     int striprealm = 0;
+    char *identifier2;
 
     if(retbuf) free(retbuf);
     retbuf = NULL;
@@ -146,14 +151,23 @@
     if (strcasecmp(identifier, "anyone") == 0) 
 	return "anyone";
 
+    identifier2 = strdup(identifier);
+    if (tmp = strchr(identifier2, '+')) {
+	syslog(LOG_DEBUG, "afspts_canonifyid stripping: %s", identifier2);
+        tmp[0] = 0;
+	syslog(LOG_DEBUG, "afspts_canonifyid stripped: %s", identifier2);
+    }
+
     if (krb5_init_context(&context))
 	return NULL;
 
-    if (krb5_parse_name(context,identifier,&princ))
+    if (krb5_parse_name(context,identifier2,&princ))
     {
 	krb5_free_context(context);
+        free(identifier2);
 	return NULL;
     }
+    free(identifier2);
 
     if(config_getswitch(IMAPOPT_PTSKRB5_STRIP_DEFAULT_REALM)) {
 	/* get local realm */
@@ -421,9 +435,8 @@
 #endif /* AFSPTS_USE_KRB5 */
 
 /* API */
-const char *ptsmodule_name = "afskrb";
-
-void ptsmodule_init(void) 
+
+static void myinit(void) 
 {
     int r = pr_Initialize (1L, AFSCONF_CLIENTNAME, config_getstring(IMAPOPT_AFSPTS_MYCELL));
     if (r) {
@@ -436,7 +449,7 @@
     return;
 }
 
-struct auth_state *ptsmodule_make_authstate(const char *identifier,
+static struct auth_state *myauthstate(const char *identifier,
 					    size_t size,
 					    const char **reply, int *dsize) 
 {
@@ -508,3 +521,29 @@
 
     return newstate;
 }
+
+#else /* HAVE_AFSKRB */
+
+static void myinit(void)
+{
+	fatal("PTS module (afskrb) not compiled in", EC_CONFIG);
+}
+
+static struct auth_state *myauthstate(
+    const char *identifier __attribute__((unused)),
+    size_t size __attribute__((unused)),
+    const char **reply __attribute__((unused)), 
+    int *dsize __attribute__((unused))) 
+{
+	fatal("PTS module (afskrb) not compiled in", EC_CONFIG);
+}
+
+#endif /* HAVE_AFSKRB */
+
+struct pts_module pts_afskrb = 
+{
+    "afskrb",		/* name */
+
+    &myinit,
+    &myauthstate,
+};

Modified: trunk/cyrus-imapd-2.2/ptclient/ldap.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/ptclient/ldap.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/ptclient/ldap.c (original)
+++ trunk/cyrus-imapd-2.2/ptclient/ldap.c Fri Mar 31 20:18:13 2006
@@ -41,9 +41,13 @@
  */
 
 static char rcsid[] __attribute__((unused)) = 
-      "$Id: ldap.c,v 1.7 2004/06/24 19:28:39 rjs3 Exp $";
+      "$Id: ldap.c,v 1.9 2005/05/12 19:49:55 shadow Exp $";
 
 #include <config.h>
+#include "ptloader.h"
+#include "exitcodes.h"
+
+#ifdef HAVE_LDAP
 
 #include <string.h>
 #include <stdio.h>
@@ -68,7 +72,6 @@
 
 /* libcyrus */
 #include "auth_pts.h"
-#include "exitcodes.h"
 #include "strhash.h"
 #include "xmalloc.h"
 
@@ -425,9 +428,8 @@
 }
 
 /* API */
-const char *ptsmodule_name = "ldap";
-
-void ptsmodule_init(void) 
+
+static void myinit(void) 
 {
     const char *p = NULL;
 
@@ -586,7 +588,7 @@
 {
 	char *s, *s1;
 	char *lasts;
-	int nt, i;
+	int nt, i, rc;
 
 	*result = NULL;
 
@@ -610,9 +612,9 @@
 	s1 = (char *)strtok_r(s, ".", &lasts);
 	while(s1) {
 		if (i == 0) {
-			*result = strdup(s1);
+			rc = ptsmodule_escape(s1, strlen(s1), result);
 			free(s);
-			return (*result == NULL ? PTSM_NOMEM : PTSM_OK);
+			return rc;
 		}
 		s1 = (char *)strtok_r(NULL, ".", &lasts);
 		i--;
@@ -783,14 +785,13 @@
     LDAPControl c;
     LDAPControl *ctrl[2];
     char *authzid;
-#else
+#endif
     char *base = NULL, *filter = NULL;
     char *attrs[] = {NULL};
     LDAPMessage *res;
     LDAPMessage *entry;
     char *attr, **vals;
     BerElement *ber;
-#endif
 
     *ret = NULL;
 
@@ -799,64 +800,68 @@
 
 #if LDAP_VENDOR_VERSION >= 20125
 
-    authzid = xmalloc(size + sizeof("u:"));
-    if (authzid == NULL)
-        return PTSM_NOMEM;
-
-    strcpy(authzid, "u:");
-    strcpy(authzid+2, canon_id);
-    c.ldctl_oid = LDAP_CONTROL_PROXY_AUTHZ;
-    c.ldctl_value.bv_val = authzid;
-    c.ldctl_value.bv_len = size + 2;
-    c.ldctl_iscritical = 1;
-
-    ctrl[0] = &c;
-    ctrl[1] = NULL;
-    rc = ldap_whoami_s(ptsm->ld, &dn, ctrl, NULL);
-    free(authzid);
-    if ( rc != LDAP_SUCCESS || !dn ) {
-        if (rc == LDAP_SERVER_DOWN) {
-            ldap_unbind(ptsm->ld);
-            ptsm->ld = NULL;
-            return PTSM_RETRY;
+    if (ptsm->sasl) {
+
+        authzid = xmalloc(size + sizeof("u:"));
+        if (authzid == NULL)
+            return PTSM_NOMEM;
+
+        strcpy(authzid, "u:");
+        strcpy(authzid+2, canon_id);
+        c.ldctl_oid = LDAP_CONTROL_PROXY_AUTHZ;
+        c.ldctl_value.bv_val = authzid;
+        c.ldctl_value.bv_len = size + 2;
+        c.ldctl_iscritical = 1;
+
+        ctrl[0] = &c;
+        ctrl[1] = NULL;
+        rc = ldap_whoami_s(ptsm->ld, &dn, ctrl, NULL);
+        free(authzid);
+        if ( rc != LDAP_SUCCESS || !dn ) {
+            if (rc == LDAP_SERVER_DOWN) {
+                ldap_unbind(ptsm->ld);
+                ptsm->ld = NULL;
+                return PTSM_RETRY;
+            }
+            return PTSM_FAIL;
         }
-        return PTSM_FAIL;
-    }
-
-    if ( dn->bv_val &&
-        !strncmp(dn->bv_val, "dn:", 3) )
-        *ret = strdup(dn->bv_val+3);
-    ber_bvfree(dn);
-
-#else
-
-    rc = ptsmodule_expand_tokens(ptsm->filter, canon_id, NULL, &filter);
-    if (rc != PTSM_OK)
-        return rc;
-
-    rc = ptsmodule_expand_tokens(ptsm->base, canon_id, NULL, &base);
-    if (rc != PTSM_OK)
-        return rc;
-
-    rc = ldap_search_st(ptsm->ld, base, ptsm->scope, filter, attrs, 0, &(ptsm->timeout), &res);
-    free(filter);
-    free(base);
-    if (rc != LDAP_SUCCESS) {
-        if (rc == LDAP_SERVER_DOWN) {
-            ldap_unbind(ptsm->ld);
-            ptsm->ld = NULL;
-            return PTSM_RETRY;
+
+        if ( dn->bv_val &&
+            !strncmp(dn->bv_val, "dn:", 3) )
+            *ret = strdup(dn->bv_val+3);
+        ber_bvfree(dn);
+
+    } else
+
+#endif
+
+    {
+        rc = ptsmodule_expand_tokens(ptsm->filter, canon_id, NULL, &filter);
+        if (rc != PTSM_OK)
+            return rc;
+
+        rc = ptsmodule_expand_tokens(ptsm->base, canon_id, NULL, &base);
+        if (rc != PTSM_OK)
+            return rc;
+
+        rc = ldap_search_st(ptsm->ld, base, ptsm->scope, filter, attrs, 0, &(ptsm->timeout), &res);
+        free(filter);
+        free(base);
+        if (rc != LDAP_SUCCESS) {
+            if (rc == LDAP_SERVER_DOWN) {
+                ldap_unbind(ptsm->ld);
+                ptsm->ld = NULL;
+                return PTSM_RETRY;
+            }
+            return PTSM_FAIL;
         }
-        return PTSM_FAIL;
-    }
-
-    if ( (entry = ldap_first_entry(ptsm->ld, res)) != NULL )
-        *ret = ldap_get_dn(ptsm->ld, entry);
-
-    ldap_msgfree(res);
-    res = NULL;
-
-#endif
+
+        if ( (entry = ldap_first_entry(ptsm->ld, res)) != NULL )
+            *ret = ldap_get_dn(ptsm->ld, entry);
+
+        ldap_msgfree(res);
+        res = NULL;
+    }
 
     return (*ret ? PTSM_OK : PTSM_FAIL);
 }
@@ -925,7 +930,8 @@
             (*newstate)->ngroups = numvals;
 
             for (i = 0; vals[i] != NULL; i++) {
-                strlcpy((*newstate)->groups[i].id, vals[i], 
+                strcpy((*newstate)->groups[i].id, "group:");
+                strlcat((*newstate)->groups[i].id, vals[i], 
                     sizeof((*newstate)->groups[i].id));
                 (*newstate)->groups[i].hash = strhash((*newstate)->groups[i].id);
             }
@@ -1053,7 +1059,8 @@
             if (vals == NULL)
                 continue;
 
-            strlcpy((*newstate)->groups[i].id, vals[0], 
+            strcpy((*newstate)->groups[i].id, "group:");
+            strlcat((*newstate)->groups[i].id, vals[0], 
                 sizeof((*newstate)->groups[i].id));
             (*newstate)->groups[i].hash = strhash((*newstate)->groups[i].id);
 
@@ -1167,7 +1174,7 @@
     return rc;
 }
 
-struct auth_state *ptsmodule_make_authstate(
+static struct auth_state *myauthstate(
     const char *identifier,
     size_t size,
     const char **reply, 
@@ -1205,3 +1212,29 @@
 
     return newstate;
 }
+
+#else /* HAVE_LDAP */
+
+static void myinit(void)
+{
+	fatal("PTS module (ldap) not compiled in", EC_CONFIG);
+}
+
+static struct auth_state *myauthstate(
+    const char *identifier __attribute__((unused)),
+    size_t size __attribute__((unused)),
+    const char **reply __attribute__((unused)), 
+    int *dsize __attribute__((unused))) 
+{
+	fatal("PTS module (ldap) not compiled in", EC_CONFIG);
+}
+
+#endif /* HAVE_LDAP */
+
+struct pts_module pts_ldap = 
+{
+    "ldap",		/* name */
+
+    &myinit,
+    &myauthstate,
+};

Modified: trunk/cyrus-imapd-2.2/ptclient/ptloader.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/ptclient/ptloader.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/ptclient/ptloader.c (original)
+++ trunk/cyrus-imapd-2.2/ptclient/ptloader.c Fri Mar 31 20:18:13 2006
@@ -64,23 +64,73 @@
 #include "lock.h"
 #include "retry.h"
 #include "xmalloc.h"
+#include "ptloader.h"
 
 static char rcsid[] __attribute__((unused)) = 
-      "$Id: ptloader.c,v 1.39 2004/12/17 16:32:26 ken3 Exp $";
-
-extern const char *ptsmodule_name;
-extern void ptsmodule_init(void);
+      "$Id: ptloader.c,v 1.41 2005/10/13 20:37:10 jeaton Exp $";
+
+struct pts_module *pts_modules[] = {
+#ifdef HAVE_LDAP
+    &pts_ldap,
+#endif
+#ifdef HAVE_AFSKRB
+    &pts_afskrb,
+#endif
+    NULL };
+
 extern void setproctitle_init(int argc, char **argv, char **envp);
-extern struct auth_state *ptsmodule_make_authstate(const char *identifier,
-						   size_t size,
-						   const char **reply,
-						   int *dsize);
+
+static struct pts_module *pts_fromname()
+{
+    int i;
+    const char *name = config_getstring(IMAPOPT_PTS_MODULE);
+    static struct pts_module *pts = NULL;
+
+    if (pts)
+        return pts;
+
+    for (i = 0; pts_modules[i]; i++) {
+	if (!strcmp(pts_modules[i]->name, name)) {
+	    pts = pts_modules[i]; break;
+	}
+    }
+
+    if (!pts) {
+	char errbuf[1024];
+	snprintf(errbuf, sizeof(errbuf),
+		 "PTS module %s not supported", name);
+	fatal(errbuf, EC_CONFIG);
+    }
+
+    return pts;
+}
+
+void ptsmodule_init(void)
+{
+    struct pts_module *pts = pts_fromname();
+
+    pts->init();
+}
+
+struct auth_state *ptsmodule_make_authstate(const char *identifier,
+					    size_t size,
+					    const char **reply, int *dsize)
+{
+    struct pts_module *pts = pts_fromname();
+
+    return pts->make_authstate(identifier, size, reply, dsize);
+}
 
 /* config.c info (libimap) */
 const int config_need_data = 0;
 
 /* Globals */
 #define DB (config_ptscache_db)
+
+/* XXXXXXXXX */
+void des_init_random_number_generator() {
+        return;
+} 
 
 static char ptclient_debug = 0;
 struct db *ptsdb = NULL;
@@ -99,8 +149,7 @@
     signal(SIGPIPE, SIG_IGN);
 
     syslog(LOG_NOTICE,
-	   "starting: $Id: ptloader.c,v 1.39 2004/12/17 16:32:26 ken3 Exp $ (%s)",
-	   ptsmodule_name);
+	   "starting: $Id: ptloader.c,v 1.41 2005/10/13 20:37:10 jeaton Exp $");
 
     while ((opt = getopt(argc, argv, "d:")) != EOF) {
 	switch (opt) {

Added: trunk/cyrus-imapd-2.2/ptclient/ptloader.h
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/ptclient/ptloader.h?rev=326&root=cyrus22&view=auto
==============================================================================
--- trunk/cyrus-imapd-2.2/ptclient/ptloader.h (added)
+++ trunk/cyrus-imapd-2.2/ptclient/ptloader.h Fri Mar 31 20:18:13 2006
@@ -1,0 +1,70 @@
+/* ptloader.h -- Site authorization module
+ * $Id: ptloader.h,v 1.1 2005/02/16 20:38:04 shadow Exp $
+ *
+ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For permission or any other legal
+ *    details, please contact  
+ *      Office of Technology Transfer
+ *      Carnegie Mellon University
+ *      5000 Forbes Avenue
+ *      Pittsburgh, PA  15213-3890
+ *      (412) 268-4387, fax: (412) 268-7395
+ *      tech-transfer at andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Computing Services
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifndef INCLUDED_PTLOADER_H
+#define INCLUDED_PTLOADER_H
+
+struct auth_state;
+
+struct pts_module {
+    const char *name;
+
+    void (*init)(void);
+    struct auth_state *(*make_authstate)(const char *identifier,
+                size_t size,
+                const char **reply, int *dsize);
+};
+
+extern struct pts_module *pts_modules[];
+
+/* Note that some of these may be undefined symbols
+ * if libcyrus was not built with support for them */
+extern struct pts_module pts_ldap;
+extern struct pts_module pts_afskrb;
+
+struct auth_state *ptsmodule_make_authstate(const char *identifier,
+					    size_t size,
+					    const char **reply, int *dsize);
+void ptsmodule_init(void);
+
+#endif /* INCLUDED_PTLOADER_H */

Propchange: trunk/cyrus-imapd-2.2/ptclient/ptloader.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/cyrus-imapd-2.2/sieve/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/sieve/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/sieve/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/sieve/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -13,7 +13,7 @@
 /bc_eval.c/1.7/Thu Jul 29 15:42:31 2004//
 /bc_generate.c/1.3/Wed Aug 11 18:43:15 2004//
 /bytecode.h/1.3/Tue Jun 22 16:54:54 2004//
-/comparator.c/1.15/Wed Oct 22 18:50:30 2003//
+/comparator.c/1.17/Sun May  8 14:35:58 2005//
 /comparator.h/1.11/Wed Oct 22 18:50:30 2003//
 /hmac-md5.h/1.2/Sat May 25 19:57:52 2002//
 /interp.c/1.23/Sun Nov  7 14:53:19 2004//
@@ -31,7 +31,7 @@
 /sieve_interface.h/1.19/Wed Oct 22 18:50:30 2003//
 /sievec.c/1.5/Thu Mar 11 15:23:20 2004//
 /sieved.c/1.5/Tue Jun 29 20:05:32 2004//
-/test.c/1.23/Wed Jun 16 13:50:46 2004//
+/test.c/1.25/Tue Mar 15 16:08:48 2005//
 /tree.c/1.11/Wed Oct 22 18:50:30 2003//
 /tree.h/1.9/Mon Aug 30 11:33:17 2004//
 D

Modified: trunk/cyrus-imapd-2.2/sieve/comparator.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/sieve/comparator.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/sieve/comparator.c (original)
+++ trunk/cyrus-imapd-2.2/sieve/comparator.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* comparator.c -- comparator functions
  * Larry Greenfield
- * $Id: comparator.c,v 1.15 2003/10/22 18:50:30 rjs3 Exp $
+ * $Id: comparator.c,v 1.17 2005/05/08 14:35:58 ken3 Exp $
  */
 /***********************************************************
         Copyright 1999 by Carnegie Mellon University
@@ -266,16 +266,78 @@
  *  number   A ? B    B > A 
  *  not-num  A > B    A == B
  */
+
+ /* From RFC 2244:
+  *
+  * The i;ascii-numeric comparator interprets strings as decimal
+  * positive integers represented as US-ASCII digits.  All values
+  * which do not begin with a US-ASCII digit are considered equal
+  * with an ordinal value higher than all non-NIL single-valued
+  * attributes.  Otherwise, all US-ASCII digits (octet values
+  * 0x30 to 0x39) are interpreted starting from the beginning of
+  * the string to the first non-digit or the end of the string.
+  */
+
 static int ascii_numeric_cmp(const char *text, const char *pat)
 {
+    unsigned text_digit_len;
+    unsigned pat_digit_len;
+
     if (isdigit((int) *pat)) {
 	if (isdigit((int) *text)) {
-	    return (atoi(text) - atoi(pat));
+	    /* Count how many digits each string has */
+	    for (text_digit_len = 0;
+		 isdigit((int) text[text_digit_len]);
+		 text_digit_len++);
+	    for (pat_digit_len = 0;
+		 isdigit((int) pat[pat_digit_len]);
+		 pat_digit_len++);
+
+	    if (text_digit_len < pat_digit_len) {
+		/* Pad "text" with leading 0s */
+		while (pat_digit_len > text_digit_len) {
+		    /* "text" can only be less or equal to "pat" */
+		    if ('0' < *pat) {
+			return (-1); 
+		    }
+		    pat++;
+		    pat_digit_len--;
+		}
+	    } else if (text_digit_len > pat_digit_len) {
+		/* Pad "pad" with leading 0s */
+		while (text_digit_len > pat_digit_len) {
+		    /* "pad" can only be greater or equal to "text" */
+		    if (*text > '0') {
+			return 1;
+		    }
+		    text++;
+		    text_digit_len--;
+		}
+	    }
+
+	    /* CLAIM: If we here, we have two non-empty digital suffixes
+	       of equal length */
+	    while (text_digit_len > 0) {
+		if (*text < *pat) {
+			return -1;
+		} else if (*text > *pat) {
+			return 1;
+		}
+		/* Characters are equal, carry on */
+		text++;
+		pat++;
+		text_digit_len--;
+	    }
+
+	    return (0);
 	} else {
 	    return 1;
 	}
-    } else if (isdigit((int) *text)) return -1;
-    else return 0; /* both not digits */
+    } else if (isdigit((int) *text)) {
+	return -1;
+    } else {
+	return 0; /* both not digits */
+    }
 }
 
 static comparator_t *lookup_rel(int relation)

Modified: trunk/cyrus-imapd-2.2/sieve/test.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/sieve/test.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/sieve/test.c (original)
+++ trunk/cyrus-imapd-2.2/sieve/test.c Fri Mar 31 20:18:13 2006
@@ -2,7 +2,7 @@
   
  * test.c -- tester for libsieve
  * Larry Greenfield
- * $Id: test.c,v 1.23 2004/06/16 13:50:46 ken3 Exp $
+ * $Id: test.c,v 1.25 2005/03/15 16:08:48 ken3 Exp $
  *
  * usage: "test message script"
  */
@@ -496,6 +496,19 @@
   { B_ASCIICASEMAP, B_IS, "a", "a", 1 },
   { B_ASCIICASEMAP, B_IS, "a", "A", 1 },
 
+  { B_ASCIINUMERIC, B_IS, "123", "123", 1 },
+  { B_ASCIINUMERIC, B_IS, "123", "-123", 0 },
+  { B_ASCIINUMERIC, B_IS, "abc", "123", 0 },
+  { B_ASCIINUMERIC, B_IS, "abc", "abc", 1 },
+  { B_ASCIINUMERIC, B_IS, "12345678900", "3755744308", 0 },    /* test for 32bit overflow */
+  { B_ASCIINUMERIC, B_IS, "1567", "1567pounds", 1 },
+  { B_ASCIINUMERIC, B_IS, "", "", 1 },
+  { B_ASCIINUMERIC, B_IS, "123456789", "567", 0 },
+  { B_ASCIINUMERIC, B_IS, "567", "123456789", 0 },
+  { B_ASCIINUMERIC, B_IS, "123456789", "00000123456789", 1 },
+  { B_ASCIINUMERIC, B_IS, "102", "1024", 0 },
+  { B_ASCIINUMERIC, B_IS, "1567M", "1567 arg", 1 },
+
   { B_OCTET, B_CONTAINS, "", "", 1 },
   { B_OCTET, B_CONTAINS, "", "a", 1 },
   { B_OCTET, B_CONTAINS, "a", "", 0 },

Modified: trunk/cyrus-imapd-2.2/snmp/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/snmp/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/snmp/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/snmp/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,3 +1,3 @@
 /.cvsignore/1.1/Sun Jan  6 02:03:33 2002//
-/snmpgen/1.17/Fri Nov 19 17:05:48 2004//
+/snmpgen/1.18/Mon Apr 11 06:08:58 2005//
 D

Modified: trunk/cyrus-imapd-2.2/snmp/snmpgen
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/snmp/snmpgen?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/snmp/snmpgen (original)
+++ trunk/cyrus-imapd-2.2/snmp/snmpgen Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
 #
 exec perl -x -S $0 ${1+"$@"} # -*-perl-*-
 #!perl -w
-# $Id: snmpgen,v 1.17 2004/11/19 17:05:48 shadow Exp $
+# $Id: snmpgen,v 1.18 2005/04/11 06:08:58 shadow Exp $
 
 if ($] !~ /^5\..*/) {
   # uh-oh. this isn't perl 5.
@@ -227,11 +227,7 @@
 #define snmp_connect()
 #define snmp_close()
 #define snmp_increment(a, b)
-#ifdef __GNUC__
-#define snmp_increment_args(args...)
-#else
-#define snmp_increment_args(args)
-#endif
+#define snmp_increment_args(a, b, c, d, e)
 #define snmp_set(a, b)
 #define snmp_set_str(a, b)
 #define snmp_set_oid(a, b)

Modified: trunk/cyrus-imapd-2.2/timsieved/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/timsieved/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/timsieved/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/timsieved/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 /.cvsignore/1.2/Wed Oct 22 18:03:46 2003//
 /Makefile.in/1.24/Fri May 28 18:03:10 2004//
 /TODO/1.5/Fri Aug  1 13:22:25 2003//
-/actions.c/1.36/Wed Oct 22 18:50:31 2003//
+/actions.c/1.38/Fri Nov 18 14:18:18 2005//
 /actions.h/1.11/Tue Jun 24 15:34:00 2003//
 /codes.h/1.6/Thu Feb 13 20:15:58 2003//
 /exitcodes.h/1.4/Thu Feb 13 20:15:59 2003//
@@ -9,9 +9,9 @@
 /lex.h/1.11/Thu Feb 13 20:15:59 2003//
 /mystring.c/1.7/Fri Feb 27 18:32:19 2004//
 /mystring.h/1.6/Thu Feb 13 20:15:59 2003//
-/parser.c/1.37/Sat May 22 03:45:59 2004//
+/parser.c/1.39/Thu Nov  3 13:41:54 2005//
 /parser.h/1.4/Thu Feb 13 20:15:59 2003//
 /scripttest.c/1.23/Thu Mar 11 15:23:21 2004//
 /scripttest.h/1.9/Wed Oct 22 18:50:31 2003//
-/timsieved.c/1.55/Thu Sep  9 16:22:06 2004//
+/timsieved.c/1.56/Fri Nov 18 14:18:35 2005//
 D

Modified: trunk/cyrus-imapd-2.2/timsieved/actions.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/timsieved/actions.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/timsieved/actions.c (original)
+++ trunk/cyrus-imapd-2.2/timsieved/actions.c Fri Mar 31 20:18:13 2006
@@ -1,6 +1,6 @@
 /* actions.c -- executes the commands for timsieved
  * Tim Martin
- * $Id: actions.c,v 1.36 2003/10/22 18:50:31 rjs3 Exp $
+ * $Id: actions.c,v 1.38 2005/11/18 14:18:18 murch Exp $
  */
 /*
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
@@ -77,6 +77,7 @@
 /* after a user has authentication, our current directory is their Sieve 
    directory! */
 
+extern int sieved_userisadmin;
 char *sieve_dir = NULL;
 
 int actions_init(void)
@@ -99,25 +100,35 @@
 
 int actions_setuser(const char *userid)
 {
-  char hash, *domain;
-  char *foo=sieve_dir;
+  char userbuf[1024], *user, *domain = NULL;
+  char *foo = sieve_dir;
+  size_t size = 1024, len;
   int result;  
 
-  sieve_dir=(char *) xmalloc(1024);
-  
-  if (config_virtdomains && (domain = strchr(userid, '@'))) {
-      char d = (char) dir_hash_c(domain+1);
-      *domain = '\0';  /* split user at domain */
-      hash = (char) dir_hash_c(userid);
-      snprintf(sieve_dir, 1023, "%s%s%c/%s/%c/%s",
-	       foo, FNAME_DOMAINDIR, d, domain+1,
-	       hash, userid);
-      *domain = '@';  /* reassemble user at domain */
+  sieve_dir = (char *) xzmalloc(size+1);
+  
+  user = (char *) userid;
+  if (config_virtdomains && strchr(user, '@')) {
+      /* split the user and domain */
+      strlcpy(userbuf, userid, sizeof(userbuf));
+      user = userbuf;
+      if ((domain = strrchr(user, '@'))) *domain++ = '\0';
+  }
+
+  len = strlcpy(sieve_dir, foo, size);
+
+  if (domain) {
+      char dhash = (char) dir_hash_c(domain);
+      len += snprintf(sieve_dir+len, size-len, "%s%c/%s",
+		      FNAME_DOMAINDIR, dhash, domain);
+  }
+
+  if (sieved_userisadmin) {
+      strlcat(sieve_dir, "/global", size);
   }
   else {
-      hash = (char) dir_hash_c(userid);
-    
-      snprintf(sieve_dir, 1023, "%s/%c/%s", foo, hash,userid);
+      char hash = (char) dir_hash_c(user);
+      snprintf(sieve_dir+len, size-len, "/%c/%s", hash, user);
   }
 
   result = chdir(sieve_dir);
@@ -163,7 +174,7 @@
 		 int starttls_done, int authenticated)
 {
     const char *sasllist;
-    unsigned mechcount;
+    int mechcount;
 
     /* implementation */
     prot_printf(conn, "\"IMPLEMENTATION\" \"Cyrus timsieved %s\"\r\n",

Modified: trunk/cyrus-imapd-2.2/timsieved/parser.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/timsieved/parser.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/timsieved/parser.c (original)
+++ trunk/cyrus-imapd-2.2/timsieved/parser.c Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 /* parser.c -- parser used by timsieved
  * Tim Martin
  * 9/21/99
- * $Id: parser.c,v 1.37 2004/05/22 03:45:59 rjs3 Exp $
+ * $Id: parser.c,v 1.39 2005/11/03 13:41:54 murch Exp $
  */
 /*
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
@@ -72,6 +72,7 @@
 
 extern char sieved_clienthost[250];
 extern int sieved_domainfromip;
+extern int sieved_userisadmin;
 
 /* xxx these are both leaked, but we only handle one connection at a
  * time... */
@@ -648,7 +649,7 @@
       struct namespace sieved_namespace;
       char inboxname[MAX_MAILBOX_NAME];
       char *server;
-      int type, r;
+      int type = 0, r;
       
       /* Set namespace */
       if ((r = mboxname_init_namespace(&sieved_namespace, 0)) != 0) {
@@ -666,10 +667,16 @@
 
       r = mboxlist_detail(inboxname, &type, &server, NULL, NULL, NULL);
       
-      if(r) {
+      if(r && !sieved_userisadmin) {
 	  /* mboxlist_detail error */
-	  *errmsg = "mailbox unknown";
-	  return FALSE;
+	  syslog(LOG_ERR, error_message(r));
+
+	  if(reset_saslconn(&sieved_saslconn, ssf, authid) != SASL_OK)
+	      fatal("could not reset the sasl_conn_t after failure",
+		    EC_TEMPFAIL);
+
+	  ret = FALSE;
+	  goto cleanup;
       }
 
       if(type & MBTYPE_REMOTE) {

Modified: trunk/cyrus-imapd-2.2/timsieved/timsieved.c
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/timsieved/timsieved.c?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/timsieved/timsieved.c (original)
+++ trunk/cyrus-imapd-2.2/timsieved/timsieved.c Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 /* timsieved.c -- main file for timsieved (sieve script accepting program)
  * Tim Martin
  * 9/21/99
- * $Id: timsieved.c,v 1.55 2004/09/09 16:22:06 shadow Exp $
+ * $Id: timsieved.c,v 1.56 2005/11/18 14:18:35 murch Exp $
  */
 /*
  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
@@ -135,6 +135,10 @@
     if (sieved_in) prot_free(sieved_in);
 
     if (sieved_logfd != -1) close(sieved_logfd);
+
+#ifdef HAVE_SSL
+    tls_shutdown_serverengine();
+#endif
 
     cyrus_done();
 

Modified: trunk/cyrus-imapd-2.2/tools/CVS/Entries
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/CVS/Entries?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/CVS/Entries (original)
+++ trunk/cyrus-imapd-2.2/tools/CVS/Entries Fri Mar 31 20:18:13 2006
@@ -1,15 +1,15 @@
 /arbitronsort.pl/1.2/Mon Aug  4 17:13:24 2003//
-/config2header/1.9/Tue Jun 22 19:02:31 2004//
+/config2header/1.12/Tue Apr 19 18:54:32 2005//
 /config2man/1.3/Tue Dec  9 18:33:52 2003//
 /convert-sieve.pl/1.2/Wed Oct 22 18:03:47 2003//
-/dohash/1.10/Fri Feb 23 04:43:01 2001//
-/masssievec/1.4/Mon Jun 21 18:44:11 2004//
-/mkimap/1.16/Tue Jun 29 18:16:54 2004//
+/dohash/1.11/Thu Dec  1 22:01:12 2005//
+/masssievec/1.5/Thu Dec  1 22:01:12 2005//
+/mkimap/1.17/Thu Dec  1 19:12:34 2005//
 /mknewsgroups/1.2/Wed Oct 22 18:03:47 2003//
 /mupdate-loadgen.pl/1.2/Wed Oct 22 18:03:47 2003//
 /not-mkdep/1.3/Tue May 23 20:56:53 2000//
-/rehash/1.7/Wed Oct 22 18:50:32 2003//
-/translatesieve/1.6/Tue May  7 20:49:42 2002//
-/undohash/1.7/Sat May 25 19:57:53 2002//
-/upgradesieve/1.6/Fri Feb 23 04:46:56 2001//
+/rehash/1.8/Thu Dec  1 22:01:12 2005//
+/translatesieve/1.7/Thu Dec  1 22:01:12 2005//
+/undohash/1.8/Thu Dec  1 22:01:13 2005//
+/upgradesieve/1.7/Thu Dec  1 22:01:13 2005//
 D

Modified: trunk/cyrus-imapd-2.2/tools/config2header
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/config2header?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/config2header (original)
+++ trunk/cyrus-imapd-2.2/tools/config2header Fri Mar 31 20:18:13 2006
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: config2header,v 1.9 2004/06/22 19:02:31 rjs3 Exp $
+# $Id: config2header,v 1.12 2005/04/19 18:54:32 shadow Exp $
 #
 # Copyright (c) 2001 Carnegie Mellon University.  All rights reserved.
 #
@@ -84,7 +84,7 @@
 open HFILE, ">$hfile";
 
 my $blank = "";
-my $version = "\$Revision: 1.9 $blank";
+my $version = "\$Revision: 1.12 $blank";
 $version =~ s/.Revision: (.*) /$1/;
 print HFILE "/* auto-generated by config2header $version */\n";
 print CFILE "/* auto-generated by config2header $version */\n";
@@ -200,7 +200,7 @@
 	    if ($count > $enum_size) { $enum_size = $count; }
 	} else {
 	    $def = $use_gcc_extension
-			? "(union config_value)((int) $2)"
+			? "(union config_value)((long) $2)"
 			: "{(void*)$2}";
 	}
 
@@ -214,7 +214,6 @@
 print HFILE <<EOF
   IMAPOPT_LAST
 };
-extern struct imapopt_s imapopts[];
 
 enum enum_value {
   IMAP_ENUM_ZERO = 0,
@@ -237,8 +236,8 @@
 union config_value {
        $dummy_field
        const char *s;
-       int i;
-       int b;
+       long i;
+       long b;
        enum enum_value e;
 };
 
@@ -260,6 +259,9 @@
 
 print HFILE <<EOF
 };
+
+extern struct imapopt_s imapopts[];
+
 #endif /* INCLUDED_IMAPOPTIONS_H */
 EOF
     ;

Modified: trunk/cyrus-imapd-2.2/tools/dohash
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/dohash?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/dohash (original)
+++ trunk/cyrus-imapd-2.2/tools/dohash Fri Mar 31 20:18:13 2006
@@ -42,7 +42,7 @@
 #!perl -w
 # script to upgrade from versions of imapd previous to 1.6.2
 # make sure you run it as the cyrus user
-# $Id: dohash,v 1.10 2001/02/23 04:43:01 leg Exp $
+# $Id: dohash,v 1.11 2005/12/01 22:01:12 murch Exp $
 
 if ($] !~ /^5\..*/) {
   # uh-oh. this isn't perl 5.
@@ -89,38 +89,54 @@
     }
 }
 
+sub read_conf {
+    my $file = shift;
+
+    open CONF, $file or die "can't open $file";
+    while (<CONF>) {
+	if (/^#/) { 
+	    next; 
+	}
+	if (/\@include:\s+(.*)$/) {
+	    push @configs, $1;
+	}
+	if (/^configdirectory:\s+(.*)$/) {
+	    $confdir = $1;
+	}
+	if (/^partition-.*:\s+(.*)$/) {
+	    if (grep /$1/, @parts) {
+		next;
+	    }
+	    push @parts, $1;
+	}
+	if (/^hashimapspool:\s*(1|t|yes|on)/) {
+	    $hashispool = 1;
+	    print "i will also hash partitions.\n";
+	}
+    }
+    close CONF;
+}
+
 $imapdconf = shift || "/etc/imapd.conf";
 
 $yn = "y";
 $hashispool = 0;
 
-open CONF, $imapdconf or die "can't open $imapdconf";
-while (<CONF>) {
-    if (/^configdirectory:\s*(.*)$/) {
-	$conf = $1;
-    }
-    if (/^partition-.*:\s*(.*)$/) {
-	if (grep /$1/, @parts) {
-	    next;
-	}
-	push @parts, $1;
-    }
-    if (/^hashimapspool:\s*(1|t|yes|on)/) {
-	$hashispool = 1;
-	print "i will also hash partitions.\n";
-    }
-}
-close CONF;
-
-if (! $conf) { $conf = "/var/imap"; }
+push @configs, $imapdconf;
+
+while ($conf = shift @configs) {
+    read_conf($conf);
+}
+
+if (! $confdir) { $confdir = "/var/imap"; }
 
 if ($interactive) {
-    print "upgrade $conf? ";
+    print "upgrade $confdir? ";
     $yn = <STDIN>;
 }
 if ($yn =~ /^y/) {
-    print "upgrading configuration directory $conf...";
-    chdir $conf or die "couldn't change to $conf";
+    print "upgrading configuration directory $confdir...";
+    chdir $confdir or die "couldn't change to $confdir";
     
     # *** user subdirectory; holds subscription files
     print "user ";

Modified: trunk/cyrus-imapd-2.2/tools/masssievec
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/masssievec?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/masssievec (original)
+++ trunk/cyrus-imapd-2.2/tools/masssievec Fri Mar 31 20:18:13 2006
@@ -43,7 +43,7 @@
 #
 # Script for mass compilation of sieve scripts.
 #
-# $Id: masssievec,v 1.4 2004/06/21 18:44:11 rjs3 Exp $
+# $Id: masssievec,v 1.5 2005/12/01 22:01:12 murch Exp $
 
 if ($] !~ /^5\..*/) {
   # uh-oh. this isn't perl 5.
@@ -89,18 +89,34 @@
     exit;
 }
 
-open CONF, $imapdconf or die "can't open $imapdconf";
-while (<CONF>) {
-    if (/^sieveusehomedir:\s+(1|t|yes|on)/) {
-	$nosievedir = 1;
-	print "you are storing sieve scripts in user's home directories, this script cannot deal with that\n";
-	exit;
+sub read_conf {
+    my $file = shift;
+
+    open CONF, $file or die "can't open $file";
+    while (<CONF>) {
+	if (/^#/) { 
+	    next; 
+	}
+	if (/\@include:\s+(.*)$/) {
+	    push @configs, $1;
+	}
+	if (/^sieveusehomedir:\s+(1|t|yes|on)/) {
+	    $nosievedir = 1;
+	    print "you are storing sieve scripts in user's home directories, this script cannot deal with that\n";
+	    exit;
+	}
+	if (/^sievedir:\s+(.*)$/) {
+	    $sievedir = $1;
+	}
     }
-    if (/^sievedir:\s+(.*)$/) {
-	$sievedir = $1;
-    }
+    close CONF;
 }
-close CONF;
+
+push @configs, $imapdconf;
+
+while ($conf = shift @configs) {
+    read_conf($conf);
+}
 
 print "you are using $sievedir as your sieve directory.\n";
 

Modified: trunk/cyrus-imapd-2.2/tools/mkimap
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/mkimap?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/mkimap (original)
+++ trunk/cyrus-imapd-2.2/tools/mkimap Fri Mar 31 20:18:13 2006
@@ -40,7 +40,7 @@
 #
 exec perl -x -S $0 ${1+"$@"} # -*-perl-*-
 #!perl -w
-# $Id: mkimap,v 1.16 2004/06/29 18:16:54 rjs3 Exp $
+# $Id: mkimap,v 1.17 2005/12/01 19:12:34 murch Exp $
 
 if ($] !~ /^5\..*/) {
   # uh-oh. this isn't perl 5.
@@ -59,30 +59,44 @@
 __END__
 require 5;
 
+sub read_conf {
+    my $file = shift;
+
+    open CONF, $file or die "can't open $file";
+    print "reading configure file $file...\n";
+    while (<CONF>) {
+	if (/^#/) { 
+	    next; 
+	}
+	if (/\@include:\s+(.*)$/) {
+	    print "i will include configure file $1.\n";
+	    push @configs, $1;
+	}
+	if (/^configdirectory:\s+(.*)$/) {
+	    $confdir = $1;
+	    print "i will configure directory $confdir.\n";
+	}
+	if (/^partition-.*:\s+(.*)$/) {
+	    if (grep /$1/, @parts) {
+		next;
+	    }
+	    print "i saw partition $1.\n";
+	    push @parts, $1;
+	}
+    }
+    print "done\n";
+    close CONF;
+}
+
 $imapdconf = shift || "/etc/imapd.conf";
 
-open CONF, $imapdconf or die "can't open $imapdconf";
-print "reading configure file...\n";
-while (<CONF>) {
-    if (/^#/) { 
-	next; 
-    }
-    if (/^configdirectory:\s+(.*)$/) {
-	$conf = $1;
-	print "i will configure directory $conf.\n";
-    }
-    if (/^partition-.*:\s+(.*)$/) {
-	if (grep /$1/, @parts) {
-	    next;
-	}
-	print "i saw partition $1.\n";
-	push @parts, $1;
-    }
+push @configs, $imapdconf;
+
+while ($conf = shift @configs) {
+    read_conf($conf);
 }
-print "done\n";
-close CONF;
 
-$d = $conf;
+$d = $confdir;
 
 print "configuring $d...\n";
 

Modified: trunk/cyrus-imapd-2.2/tools/rehash
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/rehash?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/rehash (original)
+++ trunk/cyrus-imapd-2.2/tools/rehash Fri Mar 31 20:18:13 2006
@@ -45,7 +45,7 @@
 #
 # Written by Gary Mills <mills at cc.UManitoba.CA>
 #
-# $Id: rehash,v 1.7 2003/10/22 18:50:32 rjs3 Exp $
+# $Id: rehash,v 1.8 2005/12/01 22:01:12 murch Exp $
 
 if ($] !~ /^5\..*/) {
   # uh-oh. this isn't perl 5.
@@ -140,6 +140,46 @@
     }
 }
 
+sub read_conf {
+    my $file = shift;
+
+    open CONF, $file or die "can't open $file";
+    while (<CONF>) {
+	if (/^#/) { 
+	    next; 
+	}
+	if (/\@include:\s+(.*)$/) {
+	    push @configs, $1;
+	}
+	if (/^configdirectory:\s+(.*)$/) {
+	    $confdir = $1;
+	}
+	if (/^partition-.*:\s+(.*)$/) {
+	    if (grep /$1/, @parts) {
+		next;
+	    }
+	    push @parts, $1;
+	}
+	if (/^hashimapspool:\s*(1|t|yes|on)/) {
+	    $hashispool = 1;
+	    print "i will also hash partitions.\n";
+	}
+        if (/^sieveusehomedir:\s+(1|t|yes|on)/) {
+	    $nosievedir = 1;
+	    print "you are storing sieve scripts in user's home directories.\n";
+        }
+        if (/^sievedir:\s+(.*)$/) {
+	    $sievedir = $1;
+	    print "you are using $sievedir as your sieve directory.\n";
+        }
+        if (/^virtdomains:\s+(1|t|yes|on)/) {
+	    $virtdomains = 1;
+	    print "i will deal with virtual domains.\n";
+        }
+    }
+    close CONF;
+}
+
 $imapdconf = shift || "/etc/imapd.conf";
 
 $yn = "y";
@@ -148,48 +188,24 @@
 $hashispool = 0;
 $virtdomains = 0;
 
-open CONF, $imapdconf or die "can't open $imapdconf";
-while (<CONF>) {
-    if (/^configdirectory:\s*(.*)$/) {
-	$conf = $1;
-    }
-    if (/^sieveusehomedir:\s+(1|t|yes|on)/) {
-	$nosievedir = 1;
-	print "you are storing sieve scripts in user's home directories.\n";
-    }
-    if (/^sievedir:\s+(.*)$/) {
-	$sievedir = $1;
-	print "you are using $sievedir as your sieve directory.\n";
-    }
-    if (/^partition-.*:\s*(.*)$/) {
-	if (grep /$1/, @parts) {
-	    next;
-	}
-	push @parts, $1;
-    }
-    if (/^hashimapspool:\s*(1|t|yes|on)/) {
-	$hashispool = 1;
-	print "i will also hash partitions.\n";
-    }    
-    if (/^virtdomains:\s+(1|t|yes|on)/) {
-	$virtdomains = 1;
-	print "i will deal with virtual domains.\n";
-    }
-}
-close CONF;
-
-if (! $conf) { $conf = "/var/imap"; }
+push @configs, $imapdconf;
+
+while ($conf = shift @configs) {
+    read_conf($conf);
+}
+
+if (! $confdir) { $confdir = "/var/imap"; }
 
 if ($interactive) {
-    print "upgrade $conf? ";
+    print "upgrade $confdir? ";
     $yn = <STDIN>;
 }
 if ($yn =~ /^y/) {
-    unless (-d $conf) {	print "creating $conf...\n";
-	mkdir $conf, 0755;
-    }
-    print "converting configuration directory $conf...";
-    chdir $conf or die "couldn't change to $conf";
+    unless (-d $confdir) {	print "creating $confdir...\n";
+	mkdir $confdir, 0755;
+    }
+    print "converting configuration directory $confdir...";
+    chdir $confdir or die "couldn't change to $confdir";
     
     foreach $i ("user", "proc", "db", "socket", "log", "msg", "quota") {
 	unless (-d $i) {

Modified: trunk/cyrus-imapd-2.2/tools/translatesieve
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/translatesieve?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/translatesieve (original)
+++ trunk/cyrus-imapd-2.2/tools/translatesieve Fri Mar 31 20:18:13 2006
@@ -4,7 +4,7 @@
 # script to translate sieve scripts to use unixhierarchysep and/or altnamespace
 # make sure you run it as the cyrus user
 #!/usr/bin/perl
-# $Id: translatesieve,v 1.6 2002/05/07 20:49:42 rjs3 Exp $
+# $Id: translatesieve,v 1.7 2005/12/01 22:01:12 murch Exp $
 # 
 # Copyright (c) 2001 Carnegie Mellon University.  All rights reserved.
 #
@@ -85,6 +85,39 @@
     }
 }
 
+sub read_conf {
+    my $file = shift;
+
+    open CONF, $file or die "can't open $file";
+    while (<CONF>) {
+	if (/^#/) { 
+	    next; 
+	}
+	if (/\@include:\s+(.*)$/) {
+	    push @configs, $1;
+	}
+        if (/^sievedir:\s+(.*)$/) {
+	    $sievedir = $1;
+	    print "you are using $sievedir as your sieve directory.\n";
+        }
+	if (/^unixhierarchysep:\s*(1|t|yes|on)/) {
+	    $unixhierarchysep = 1;
+	}
+	if (/^altnamespace:\s*(1|t|yes|on)/) {
+	    $altnamespace = 1;
+	}
+	if (/^userprefix:\s*(.*)$/) {
+	    $userprefix = $1;
+	    print "you are using $userprefix as your other users prefix.\n";
+	}
+	if (/^sharedprefix:\s*(.*)$/) {
+	    $sharedprefix = $1;
+	    print "you are using $sharedprefix as your shared prefix.\n";
+	}
+    }
+    close CONF;
+}
+
 $imapdconf = shift || "/etc/imapd.conf";
 
 $sievedir = "/usr/sieve";
@@ -93,28 +126,11 @@
 $userprefix = "Other Users";
 $sharedprefix = "Shared Folders";
 
-open CONF, $imapdconf or die "can't open $imapdconf";
-while (<CONF>) {
-    if (/^sievedir:\s*(.*)$/) {
-	$sievedir = $1;
-	print "you are using $sievedir as your sieve directory.\n";
-    }
-    if (/^unixhierarchysep:\s*(1|t|yes|on)/) {
-	$unixhierarchysep = 1;
-    }
-    if (/^altnamespace:\s*(1|t|yes|on)/) {
-	$altnamespace = 1;
-    }
-    if (/^userprefix:\s*(.*)$/) {
-	$userprefix = $1;
-	print "you are using $userprefix as your other users prefix.\n";
-    }
-    if (/^sharedprefix:\s*(.*)$/) {
-	$sharedprefix = $1;
-	print "you are using $sharedprefix as your shared prefix.\n";
-    }
-}
-close CONF;
+push @configs, $imapdconf;
+
+while ($conf = shift @configs) {
+    read_conf($conf);
+}
 
 unless ($unixhierarchysep || $altnamespace) {
     ouch "you are not using the Unix hierarchy separator or the alternate namespace";

Modified: trunk/cyrus-imapd-2.2/tools/undohash
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/undohash?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/undohash (original)
+++ trunk/cyrus-imapd-2.2/tools/undohash Fri Mar 31 20:18:13 2006
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # script to downgrade from cyrus imapd 1.6.2+ to earlier.
 # do NOT run this script while imapd's are running
-# $Id: undohash,v 1.7 2002/05/25 19:57:53 leg Exp $
+# $Id: undohash,v 1.8 2005/12/01 22:01:13 murch Exp $
 # 
 # Copyright (c) 2000 Carnegie Mellon University.  All rights reserved.
 #
@@ -45,30 +45,45 @@
 
 $| = 1;
 
+sub read_conf {
+    my $file = shift;
+
+    open CONF, $file or die "can't open $file";
+    while (<CONF>) {
+	if (/^#/) { 
+	    next; 
+	}
+	if (/\@include:\s+(.*)$/) {
+	    push @configs, $1;
+	}
+	if (/^configdirectory:\s+(.*)$/) {
+	    $confdir = $1;
+	}
+	if (/^partition-.*:\s+(.*)$/) {
+	    if (grep /$1/, @parts) {
+		next;
+	    }
+	    push @parts, $1;
+	}
+	if (/^hashimapspool:\s*(1|t|yes|on)/) {
+	    $hashispool = 1;
+	    print "i will also hash partitions.\n";
+	}
+    }
+    close CONF;
+}
+
 $imapdconf = shift || "/etc/imapd.conf";
 $hashispool = 0;
 
-open CONF, $imapdconf or die "can't open $imapdconf";
-while (<CONF>) {
-    print;
-    if (/^configdirectory:\s(.*)$/) {
-	$conf = $1;
-    }
-    if (/^partition-.*:\s(.*)$/) {
-	if (grep /$1/, @parts) {
-	    next;
-	}
-	push @parts, $1;
-    }
-    if (/^hashimapspool:\s(1|t|yes|on)/) {
-	$hashispool = 1;
-	print "i will also unhash partitions.\n";
-    }
+push @configs, $imapdconf;
+
+while ($conf = shift @configs) {
+    read_conf($conf);
 }
-close CONF;
 
-print "downgrading configuration directory $conf...";
-chdir $conf or die "couldn't change to $conf";
+print "downgrading configuration directory $confdir...";
+chdir $confdir or die "couldn't change to $confdir";
 
 # *** user subdirectory; holds subscription files
 print "user ";

Modified: trunk/cyrus-imapd-2.2/tools/upgradesieve
URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2/tools/upgradesieve?rev=326&root=cyrus22&r1=324&r2=326&view=diff
==============================================================================
--- trunk/cyrus-imapd-2.2/tools/upgradesieve (original)
+++ trunk/cyrus-imapd-2.2/tools/upgradesieve Fri Mar 31 20:18:13 2006
@@ -4,7 +4,7 @@
 # script to upgrade sievedir from imapd 1.6.13
 # make sure you run it as the cyrus user
 #!/usr/bin/perl
-# $Id: upgradesieve,v 1.6 2001/02/23 04:46:56 leg Exp $
+# $Id: upgradesieve,v 1.7 2005/12/01 22:01:13 murch Exp $
 # 
 # Copyright (c) 2000 Carnegie Mellon University.  All rights reserved.
 #
@@ -85,18 +85,34 @@
     }
 }
 
+sub read_conf {
+    my $file = shift;
+
+    open CONF, $file or die "can't open $file";
+    while (<CONF>) {
+	if (/^#/) { 
+	    next; 
+	}
+	if (/\@include:\s+(.*)$/) {
+	    push @configs, $1;
+	}
+        if (/^sievedir:\s+(.*)$/) {
+	    $sievedir = $1;
+	    print "you are using $sievedir as your sieve directory.\n";
+        }
+    }
+    close CONF;
+}
+
 $imapdconf = shift || "/etc/imapd.conf";
 
 $sievedir = "/usr/sieve";
 
-open CONF, $imapdconf or die "can't open $imapdconf";
-while (<CONF>) {
-    if (/^sievedir:\s*(.*)$/) {
-	$sievedir = $1;
-	print "you are using $sievedir as your sieve directory.\n";
-    }
+push @configs, $imapdconf;
+
+while ($conf = shift @configs) {
+    read_conf($conf);
 }
-close CONF;
 
 print "upgrading sievedir $sievedir...";
 chdir $sievedir or die "couldn't change to $sievedir";




More information about the Pkg-Cyrus-imapd-Debian-devel mailing list