From 17b4826d52fe07c56d2b5730876dcc33d556a795 Mon Sep 17 00:00:00 2001
From: Kurt Zeilenga <kurt@openldap.org>
Date: Thu, 14 Jan 1999 02:02:03 +0000
Subject: [PATCH] Import latest from -devel: 	build environment changes (for
 VPATH, lib orderring) 	test script changes (for VPATH) 	doc updates

---
 INSTALL                           |   7 +-
 Makefile.in                       |   2 +
 acconfig.h                        |  18 +
 build/db.2.64.patch               |  36 --
 build/db.2.64.patch.README        |  18 -
 build/db.2.x.README               |  30 ++
 build/man.mk                      |   2 +
 build/mkdep                       |  79 +--
 build/top.mk                      |  36 +-
 clients/fax500/Makefile.in        |   3 +
 clients/finger/Makefile.in        |   3 +
 clients/gopher/Makefile.in        |   5 +-
 clients/mail500/Makefile.in       |   3 +
 clients/rcpt500/Makefile.in       |   5 +-
 clients/tools/Makefile.in         |   5 +-
 clients/ud/Makefile.in            |   3 +-
 configure                         | 830 ++++++++++++++++++------------
 configure.in                      |  34 +-
 doc/devel/todo                    |   4 +
 doc/install/hints/Linux           |   4 +
 include/Makefile.in               |  10 +-
 include/portable.h.in             |  21 +
 libraries/Makefile.in             |   7 +
 libraries/libavl/Makefile.in      |   3 +-
 libraries/liblber/Makefile.in     |   3 +-
 libraries/libldap/Makefile.in     |  11 +-
 libraries/libldbm/Makefile.in     |  17 +
 libraries/liblthread/Makefile.in  |  15 +
 servers/ldapd/Makefile.in         |   7 +-
 servers/slapd/Makefile.in         |  14 +-
 servers/slapd/tools/Makefile.in   |  15 +-
 servers/slurpd/Makefile.in        |   7 +-
 tests/Makefile.in                 |   9 +-
 tests/scripts/all                 |  15 +-
 tests/scripts/defines.sh          |  33 +-
 tests/scripts/test001-ldif2ldbm   |  11 +-
 tests/scripts/test002-populate    |  20 +-
 tests/scripts/test003-search      |  12 +-
 tests/scripts/test004-modify      |  12 +-
 tests/scripts/test005-modrdn      |   9 +-
 tests/scripts/test006-acls        |  15 +-
 tests/scripts/test007-replication |   8 +-
 42 files changed, 881 insertions(+), 520 deletions(-)
 delete mode 100644 build/db.2.64.patch
 delete mode 100644 build/db.2.64.patch.README
 create mode 100644 build/db.2.x.README
 create mode 100644 doc/install/hints/Linux
 create mode 100644 libraries/Makefile.in
 create mode 100644 libraries/libldbm/Makefile.in
 create mode 100644 libraries/liblthread/Makefile.in

diff --git a/INSTALL b/INSTALL
index e0f066d764..5466685abf 100644
--- a/INSTALL
+++ b/INSTALL
@@ -37,7 +37,8 @@ these steps:
 		CC			C Compiler	(cc, ecgs)
 		CFLAGS		C Flags		(-ansi)
 		CPPFLAGS	CPP Flags	(-I/path/include -Ddef)
-		LDFLAGS		LDFLAGS		(-L/path/lib -llib)
+		LDFLAGS		LDFLAGS		(-L/path/lib)
+		LIBS		LIBS		(-llib)
 
 	See the 'USING ENVIRONMENT VARIABLES' section for information
 	on how to use the variables. 
@@ -154,8 +155,8 @@ Supported Environmental Variables
 	CC			C compiler		(cc, egcc)
 	CFLAGS		C flags			(-ansi)
 	CPPFLAGS	cpp flags		(-I/path/include -Ddef)
-	LDFLAGS		ld flags		(-s)
-	LIBS		libraries		(-L/usr/local/lib -llib)
+	LDFLAGS		ld flags		(-L/usr/local/lib)
+	LIBS		libraries		(-llib)
 	PATH		command path	/usr/local/bin:/usr/bin:/bin
 
 * Including alternative compilers
diff --git a/Makefile.in b/Makefile.in
index f564426626..153c641cdd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -46,3 +46,5 @@ clean-local: FORCE
 
 veryclean-local: FORCE
 	$(RM) config.cache config.status libtool stamp-h stamp-h.in
+
+distclean: veryclean FORCE
diff --git a/acconfig.h b/acconfig.h
index d5d43c58e2..ca0d26bafc 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -10,14 +10,26 @@
 
 
 /* define this if needed to get reentrant functions */
+#ifndef REENTRANT
 #undef REENTRANT
+#endif
+#ifndef _REENTRANT
 #undef _REENTRANT
+#endif
 
 /* define this if needed to get threadsafe functions */
+#ifndef THREADSAFE
 #undef THREADSAFE
+#endif
+#ifndef _THREADSAFE
 #undef _THREADSAFE
+#endif
+#ifndef THREAD_SAFE
 #undef THREAD_SAFE
+#endif
+#ifndef _THREAD_SAFE
 #undef _THREAD_SAFE
+#endif
 
 /* define this if cross compiling */
 #undef CROSS_COMPILING
@@ -85,6 +97,12 @@
 /* define if you have ptrdiff_t */
 #undef HAVE_PTRDIFF_T
 
+/* define if you have res_search() */
+#ifdef __notdef__
+/* see second res_search define */
+#undef HAVE_RES_SEARCH
+#endif
+
 /* define if you have sched_yield() */
 #ifdef __notdef__
 /* see second sched_yield define */
diff --git a/build/db.2.64.patch b/build/db.2.64.patch
deleted file mode 100644
index d777593b7b..0000000000
--- a/build/db.2.64.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-*** db/db.c.sleepy	Sun Jan  3 20:02:51 1999
---- db/db.c	Sun Jan  3 20:28:25 1999
-*************** db_open(fname, type, flags, mode, dbenv,
-*** 106,112 ****
-  	DB_PGINFO pginfo;
-  	HASHHDR *hashm;
-  	size_t cachesize;
-! 	ssize_t nr;
-  	u_int32_t iopsize;
-  	int fd, ftype, need_fileid, restore, ret, retry_cnt, swapped;
-  	char *real_name, mbuf[512];
---- 106,112 ----
-  	DB_PGINFO pginfo;
-  	HASHHDR *hashm;
-  	size_t cachesize;
-! 	ssize_t nr = (ssize_t) 0;
-  	u_int32_t iopsize;
-  	int fd, ftype, need_fileid, restore, ret, retry_cnt, swapped;
-  	char *real_name, mbuf[512];
-*************** open_retry:	if (LF_ISSET(DB_CREATE)) {
-*** 337,343 ****
-  		if (nr != sizeof(mbuf)) {
-  			if (nr != 0) {
-  				__db_err(dbenv,
-! 				    "%s: unexpected file format", fname);
-  				goto einval;
-  			}
-  			/*
---- 337,343 ----
-  		if (nr != sizeof(mbuf)) {
-  			if (nr != 0) {
-  				__db_err(dbenv,
-! 				    "%s: unexpected file format, %d bytes read", fname, nr);
-  				goto einval;
-  			}
-  			/*
diff --git a/build/db.2.64.patch.README b/build/db.2.64.patch.README
deleted file mode 100644
index 5417244953..0000000000
--- a/build/db.2.64.patch.README
+++ /dev/null
@@ -1,18 +0,0 @@
-
-A bug in Sleepycatæ„€ Berkeley DB (version 2.3.16 up to 2.6.4 beta),
-was detected, that caused failure during opening of database files
-when running a threaded slapd on a linux box, kernel version 2.0.35,
-gcc 2.7.2.1, linux threads via libpthreads.so.1.60.4.
-
-THE BUG OCCURS ONLY WHEN SLAPD IS RUN WITH THREADS ENABLED AND MAY
-ONLY OCCUR ON THE PLATFORM SPECIFIED.
-
-SINCE THE CODE OF DB_OPEN() IS THE SAME IN VERSION 2.3.16 AND 2.6.4
-WITH REPECT TO THE BUG DETECTED, DB 2.3.16 SHOULD BE PATCHED AS WELL.
-
-Apply the supported patch at the root directory of Sleepycatæ„€ code.
-Since the bug was reported to Sleepycat, it may not appear in DB
-versions, later than 2.6.4 beta.
-
-Jan 7 1999, /KSp (ksp@openldap.org)
-
diff --git a/build/db.2.x.README b/build/db.2.x.README
new file mode 100644
index 0000000000..4d902fb1aa
--- /dev/null
+++ b/build/db.2.x.README
@@ -0,0 +1,30 @@
+Berkeley DB version 2.x and OpenLDAP running threads
+====================================================
+
+Special care has to be taken when building Berkeley DB 2.x
+for use with OpenLDAP as an slapd backend.  If OpenLDAP is with
+threads, so must Berkeley DB.   If OpenLDAP is built without
+threads, so must Berkeley DB.
+
+The configuration tool of Sleepycat's Berkeley DB will automatically
+set appropriate options on IRIX, OSF/1, and SUN Solaris platforms
+(version 2.3.16), as well as FreeBSD (version 2.6.4).  The options
+must be manually defined on other plaforms, e.g. on LINUX.
+
+On PC-LINUX (kernel version 2.0.35, linux kernel threads as imple-
+mented by libpthreads.so.1.60.4) with gcc as the standard compiler
+the environment variable CPPFLAGS must define -D_REENTRANT, while
+building the Berkeley DB package.
+
+DO NOT USE THE -ansi CFLAG, SINCE THEN THE DB PACKAGE'S CONFIGURE
+CANNOT FIND THE X86/GCC SPINLOCKS, WHICH ARE NEEDED FOR THREAD-
+SUPPORT WITH THE BERKELEY DB.
+
+Please check carefully if your platform is not mentioned above.
+
+The OpenLDAP configure tool will most probably find the correct
+configuration itself.   No special action has to be taken
+while building the OpenLDAP package.
+
+Jan, 9th, 1999, /KSp (ksp@openldap.org)
+
diff --git a/build/man.mk b/build/man.mk
index 159bf0eee5..3a4e6186d1 100644
--- a/build/man.mk
+++ b/build/man.mk
@@ -12,9 +12,11 @@ install-common: FORCE
 	-$(MKDIR) -p $(MANDIR)
 	@TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \
 	VERSION=`$(CAT) $(VERSIONFILE)`; \
+	cd $(srcdir); \
 	for page in *.$(MANSECT); do \
 		$(SED) -e "s%LDVERSION%$$VERSION%" \
 			-e 's%ETCDIR%$(sysconfdir)%' \
+			-e 's%LOCALSTATEDIR%$(localstatedir)%' \
 			-e 's%SYSCONFDIR%$(sysconfdir)%' \
 			-e 's%DATADIR%$(datadir)%' \
 			-e 's%SBINDIR%$(sbindir)%' \
diff --git a/build/mkdep b/build/mkdep
index fbaea123b4..102b932ebc 100755
--- a/build/mkdep
+++ b/build/mkdep
@@ -26,14 +26,26 @@ set -e				# exit immediately if any errors occur
 MAKE=Makefile			# default makefile name is "Makefile"
 NOSLASH="no"			# by default, / dependencies are included
 CC=${CC-cc}				# default compiler is cc
+SRCDIR=""
+SED=cat
 
 while :
 	do case "$1" in
+		# the -s flag removes dependencies to files that begin with /
+		-s)
+			NOSLASH=yes;
+			shift ;;
+
 		# -f allows you to select a makefile name
 		-f)
 			MAKE=$2
 			shift; shift ;;
 
+		# -d allows you to select a VPATH directory
+		-d)
+			SRCDIR=$2
+			shift; shift ;;
+
 		# -c allows you to select a compiler to use (default is cc)
 		-c)
 			CC=$2
@@ -42,18 +54,13 @@ while :
 		# the -p flag produces "program: program.c" style dependencies
 		# so .o's don't get produced
 		-p)
-			SED='s;\.o;;'
+			SED='sed -e s;\.o;;'
 			shift ;;
 
 
 		# the -l flag produces libtool compatible dependencies
 		-l)
-			SED='s;\.o:;.lo:;'
-			shift ;;
-
-		# the -s flag removes dependencies to files that begin with /
-		-s)
-			NOSLASH=yes;
+			SED='sed -e s;\.o:;.lo:;'
 			shift ;;
 
 #		-*)	shift ;;
@@ -64,7 +71,7 @@ while :
 done
 
 if [ $# = 0 ] ; then
-	echo 'usage: mkdep [-p] [-s] [-c cc] [-f makefile] [flags] file ...'
+	echo 'usage: mkdep [-p] [-s] [-c cc] [-f makefile] [-d srcdir] [flags] file ...'
 	exit 1
 fi
 
@@ -95,10 +102,34 @@ _EOF_
 # egrep '^#include[ 	]*".*"' /dev/null $* |
 # sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' |
 
-$CC -M $* |
-sed "
-	s; \./; ;g
-	$SED" |
+if test "x$SRCDIR" = "x" ; then
+	files=$*
+else
+	files=
+	for i in $* ; do
+		if test -f $i ; then
+			files="$files $i"
+		elif test -f $SRCDIR/$i ; then
+			files="$files $SRCDIR/$i"
+		else
+			files="$files $i"
+		fi
+	done
+	CC="$CC -I$SRCDIR"
+fi
+
+cat << _EOF_ >> $TMP
+
+#
+# files: $*
+# command: $CC -M $files
+#
+
+_EOF_
+
+$CC -M $files | \
+	sed -e 's; \./; ;g' | \
+	$SED | \
 awk '
 $1 ~ /:/ {
 	filenm=$1
@@ -108,25 +139,13 @@ $1 !~ /:/ {
 	dep=$1
 }
 /.*/ {
-	if ( noslash = "yes" && dep ~ /^\// ) next
-	if (filenm != prev) {
-		if (rec != "")
-			print rec;
-		rec = filenm " " dep;
-		prev = filenm;
-	}
-	else {
-		if (length(rec dep) > 78) {
-			print rec;
-			rec = filenm " " dep;
-		}
-		else
-			rec = rec " " dep
-	}
+	if (( noslash == "yes") && (dep ~ /^\// )) next
+	if ( length(dep) < 2 ) next
+	rec = filenm " " dep;
+	print rec;
     }
-END {
-	print rec
-}' noslash="$NOSLASH" >> $TMP
+' noslash="$NOSLASH" >> $TMP
+
 
 cat << _EOF_ >> $TMP
 
diff --git a/build/top.mk b/build/top.mk
index c0516a8e2d..6a5843e86b 100644
--- a/build/top.mk
+++ b/build/top.mk
@@ -49,11 +49,11 @@ AR = ar
 
 LINT = lint
 5LINT = 5lint
-MKDEP = $(top_srcdir)/build/mkdep $(MKDEPFLAG) -c "$(CC)"
+MKDEP = $(top_srcdir)/build/mkdep $(MKDEPFLAG) -d "$(srcdir)" -c "$(CC)"
 
 LIBTOOL = @LIBTOOL@
 LIBVERSION = 1:0:0
-LTLINK  = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LFLAGS) $(LTVERSION)
+LTLINK  = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LTVERSION)
 LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) 
 
 # Misc UNIX commands used in makefiles
@@ -85,32 +85,40 @@ LDAP_INCPATH= -I$(LDAP_INCDIR) -I$(INCLUDEDIR)
 LDAP_LIBADIR= $(top_builddir)/libraries
 LDAP_LIBPATH= -L$(LDAP_LIBADIR)
 
-LDAP_LIBLBER = $(LDAP_LIBADIR)/liblber/liblber.la
-LDAP_LIBLDAP = $(LDAP_LIBADIR)/libldap/libldap.la
+LUTIL_LIBS = @LUTIL_LIBS@
+LDBM_LIBS = @LDBM_LIBS@
+LTHREAD_LIBS = @LTHREAD_LIBS@
 
 LDAP_LIBLBER_DEPEND = $(LDAP_LIBDIR)/liblber/liblber.la
 LDAP_LIBLDAP_DEPEND = $(LDAP_LIBDIR)/libldap/libldap.la
+LDAP_LIBLDIF_DEPEND = $(LDAP_LIBDIR)/libldif/libldif.a
+LDAP_LIBLUTIL_DEPEND = $(LDAP_LIBDIR)/liblutil/liblutil.a
+LDAP_LIBLDBM_DEPEND = $(LDAP_LIBDIR)/libldbm/libldbm.a
+LDAP_LIBLTHREAD_DEPEND = $(LDAP_LIBDIR)/liblthread/liblthread.a
 
-LDAP_LIBS = $(LDAP_LIBPATH) -lldif $(LDAP_LIBLDAP) $(LDAP_LIBLBER)
-LDAP_LIBDEPEND = $(LDAP_LIBDIR)/libldif.a $(LDAP_LIBLDAP) $(LDAP_LIBLBER)
+LDAP_LIBDEPEND = $(LDAP_LIBLDAP_DEPEND) $(LDAP_LIBLBER_DEPEND) \
+	$(LDAP_LIBLDIF_DEPEND) $(LDAP_LIBLUTIL_DEPEND)
 
 # AutoConfig generated 
 AC_CC	= @CC@
-AC_DEFS = @CPPFLAGS@ @DEFS@
-AC_LIBS = @LDFLAGS@ @LIBS@
 AC_CFLAGS = @CFLAGS@
-AC_LDFLAGS =
+AC_DEFS = @CPPFLAGS@ @DEFS@
+AC_LDFLAGS = @LDFLAGS@
+AC_LIBS = @LIBS@
 
 KRB_LIBS = @KRB_LIBS@
 TERMCAP_LIBS = @TERMCAP_LIBS@
 
+LDAPD_LIBS = @LDAPD_LIBS@
+SLAPD_LIBS = @SLAPD_LIBS@
+SLURPD_LIBS = @SLURPD_LIBS@
+
 # Our Defaults
 CC = $(AC_CC)
-DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) 
-LIBS = $(LDAP_LIBS) $(XLIBS) $(AC_LIBS)
-
-CFLAGS = $(AC_CFLAGS) $(DEFS) $(DEFINES)
-LDFLAGS = $(AC_LDFLAGS)
+DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES)
+LIBS = $(LDAP_LIBPATH) $(XLIBS) $(XXLIBS) $(AC_LIBS) $(XXXLIBS)
+CFLAGS = $(AC_CFLAGS) $(DEFS)
+LDFLAGS = $(AC_LDFLAGS) $(XLDFLAGS)
 
 all:		all-common all-local FORCE
 install:	install-common install-local FORCE
diff --git a/clients/fax500/Makefile.in b/clients/fax500/Makefile.in
index eee5f6b526..1499ab5a7c 100644
--- a/clients/fax500/Makefile.in
+++ b/clients/fax500/Makefile.in
@@ -9,6 +9,9 @@ RPOBJS =  rp500.o faxtotpc.o
 LDAP_INCDIR= ../../include
 LDAP_LIBDIR= ../../libraries
 
+XLIBS =  -lldap -llber -llutil
+XXLIBS	= $(KRB_LIBS) $(LUTIL_LIBS)
+
 rp500 : rpversion.o
 	$(LTLINK) -o $@ $(RPOBJS) rpversion.o $(LIBS)
 
diff --git a/clients/finger/Makefile.in b/clients/finger/Makefile.in
index 32429851dc..20a1e0334b 100644
--- a/clients/finger/Makefile.in
+++ b/clients/finger/Makefile.in
@@ -6,6 +6,9 @@ PROGRAMS= in.xfingerd
 LDAP_INCDIR= ../../include
 LDAP_LIBDIR= ../../libraries
 
+XLIBS =  -lldap -llber -llutil
+XXLIBS	= $(KRB_LIBS) $(LUTIL_LIBS)
+
 in.xfingerd : version.o
 	$(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
 
diff --git a/clients/gopher/Makefile.in b/clients/gopher/Makefile.in
index 7d487761b2..588d958f20 100644
--- a/clients/gopher/Makefile.in
+++ b/clients/gopher/Makefile.in
@@ -11,7 +11,8 @@ GWOBJS =  go500gw.o
 LDAP_INCDIR= ../../include
 LDAP_LIBDIR= ../../libraries
 
-XLIBS = -llutil @LUTIL_LIBS@
+XLIBS =  -lldap -llber -llutil
+XXLIBS	= $(KRB_LIBS) $(LUTIL_LIBS)
 
 go500 : goversion.o
 	$(LTLINK) -o $@ $(GOOBJS) goversion.o $(LIBS)
@@ -40,4 +41,4 @@ install-local: $(PROGRAMS) go500gw.help FORCE
 	$(LTINSTALL) $(INSTALLFLAGS) -m 755 go500	$(libexecdir)
 	$(LTINSTALL) $(INSTALLFLAGS) -m 755 go500gw $(libexecdir)
 	-$(MV) $(datadir)/go500gw.help $(datadir)/go500gw.help-
-	$(INSTALL) $(INSTALLFLAGS) -m 644 go500gw.help $(datadir)
+	$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/go500gw.help $(datadir)
diff --git a/clients/mail500/Makefile.in b/clients/mail500/Makefile.in
index 0c5c2f4c27..0ee8742bfb 100644
--- a/clients/mail500/Makefile.in
+++ b/clients/mail500/Makefile.in
@@ -7,6 +7,9 @@ OBJS=	main.o
 LDAP_INCDIR= ../../include
 LDAP_LIBDIR= ../../libraries
 
+XLIBS =  -lldap -llber -llutil
+XXLIBS	= $(KRB_LIBS) $(LUTIL_LIBS)
+
 mail500 : version.o
 	$(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
 
diff --git a/clients/rcpt500/Makefile.in b/clients/rcpt500/Makefile.in
index 541b8374ab..d81d5327e3 100644
--- a/clients/rcpt500/Makefile.in
+++ b/clients/rcpt500/Makefile.in
@@ -7,6 +7,9 @@ HDRS= rcpt500.h
 LDAP_INCDIR= ../../include       
 LDAP_LIBDIR= ../../libraries
 
+XLIBS =  -lldap -llber -llutil
+XXLIBS	= $(KRB_LIBS) $(LUTIL_LIBS)
+
 rcpt500 : version.o
 	$(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
 
@@ -22,4 +25,4 @@ install-local: $(PROGRAMS) rcpt500.help FORCE
 	-$(MKDIR) $(libexecdir) $(datadir)
 	$(LTINSTALL) $(INSTALLFLAGS) -m 755 rcpt500 $(libexecdir)
 	-$(MV) $(datadir)/rcpt500.help $(datadir)/rcpt500.help-
-	$(INSTALL) $(INSTALLFLAGS) -m 644 rcpt500.help $(datadir)
+	$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/rcpt500.help $(datadir)
diff --git a/clients/tools/Makefile.in b/clients/tools/Makefile.in
index dc0a10e679..069969a15b 100644
--- a/clients/tools/Makefile.in
+++ b/clients/tools/Makefile.in
@@ -4,11 +4,12 @@
 SRCS	= ldapsearch.c ldapmodify.c ldapdelete.c ldapmodrdn.c
 OBJS	= ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o
 
-XLIBS	= $(KRB_LIBS)
-
 LDAP_INCDIR= ../../include       
 LDAP_LIBDIR= ../../libraries
 
+XLIBS =  -lldif -lldap -llber -llutil
+XXLIBS	= $(KRB_LIBS) $(LUTIL_LIBS)
+
 XSRCS	= ldsversion.c ldmversion.c lddversion.c ldrversion.c
 
 PROGRAMS = ldapsearch ldapmodify ldapdelete ldapmodrdn ldapadd
diff --git a/clients/ud/Makefile.in b/clients/ud/Makefile.in
index f1ec3b01b9..a6b94a0ae4 100644
--- a/clients/ud/Makefile.in
+++ b/clients/ud/Makefile.in
@@ -9,7 +9,8 @@ PROGRAMS= ud
 LDAP_INCDIR= ../../include       
 LDAP_LIBDIR= ../../libraries
 
-XLIBS = $(TERMCAP_LIBS) $(KRB_LIBS)
+XLIBS =  -lldif -lldap -llber -llutil
+XXLIBS	= $(TERMCAP_LIBS) $(KRB_LIBS) $(LUTIL_LIBS)
 
 ud : version.o
 	$(LTLINK) -o $@ version.o $(OBJS) $(LIBS)
diff --git a/configure b/configure
index f52324057e..4f52799d4a 100755
--- a/configure
+++ b/configure
@@ -754,9 +754,9 @@ else
 fi
 
 
-PACKAGE=OpenLDAP
+PACKAGE=openldap
 
-VERSION=1.1-beta
+VERSION=1.1
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -2694,8 +2694,117 @@ fi
 fi
 
 
-echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:2699: checking for res_search in -lresolv" >&5
+for ac_func in res_search
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2701: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2706 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+if test $ac_cv_func_res_search = "no" ; then 
+	echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
+echo "configure:2755: checking for res_search in -lbind" >&5
+ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lbind  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2763 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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();
+
+int main() {
+res_search()
+; return 0; }
+EOF
+if { (eval echo configure:2774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lbind $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+	if test $ac_cv_libac_cv_lib_bind_res_search = "yes" ; then
+		cat >> confdefs.h <<\EOF
+#define HAVE_RES_SEARCH 1
+EOF
+
+	else
+		echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
+echo "configure:2808: checking for res_search in -lresolv" >&5
 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2703,7 +2812,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2707 "configure"
+#line 2816 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2714,7 +2823,7 @@ int main() {
 res_search()
 ; return 0; }
 EOF
-if { (eval echo configure:2718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2741,9 +2850,17 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+		if test $ac_cv_libac_cv_lib_resolv_res_search = "yes" ; then
+			cat >> confdefs.h <<\EOF
+#define HAVE_RES_SEARCH 1
+EOF
+
+		fi
+	fi
+fi
 
 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:2747: checking for sigset in -lV3" >&5
+echo "configure:2864: checking for sigset in -lV3" >&5
 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2751,7 +2868,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2755 "configure"
+#line 2872 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2762,7 +2879,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:2766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2794,7 +2911,7 @@ fi
 ol_link_isode=no
 if test $ol_enable_ldapd != no ; then
 		echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
-echo "configure:2798: checking for main in -lxtpp" >&5
+echo "configure:2915: checking for main in -lxtpp" >&5
 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2802,14 +2919,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2806 "configure"
+#line 2923 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2838,7 +2955,7 @@ else
 fi
 
 	echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
-echo "configure:2842: checking for main in -ldsap" >&5
+echo "configure:2959: checking for main in -ldsap" >&5
 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2846,14 +2963,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldsap -lisode $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2850 "configure"
+#line 2967 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2882,7 +2999,7 @@ else
 fi
 
 	echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
-echo "configure:2886: checking for main in -lisode" >&5
+echo "configure:3003: checking for main in -lisode" >&5
 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2890,14 +3007,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lisode  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2894 "configure"
+#line 3011 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2929,7 +3046,7 @@ fi
 
 if test $ol_link_isode != no; then
 	echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
-echo "configure:2933: checking for main in -lpp" >&5
+echo "configure:3050: checking for main in -lpp" >&5
 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2937,14 +3054,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2941 "configure"
+#line 3058 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2975,7 +3092,7 @@ fi
 	# Extract the first word of "pepsy", so it can be a program name with args.
 set dummy pepsy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2979: checking for $ac_word" >&5
+echo "configure:3096: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3012,17 +3129,17 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3016: checking for $ac_hdr" >&5
+echo "configure:3133: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3021 "configure"
+#line 3138 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3051,7 +3168,7 @@ done
 
 	if test $ac_cv_header_kerberosIV_krb_h = yes ; then
 		echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:3055: checking for main in -lkrb4" >&5
+echo "configure:3172: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3059,14 +3176,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3063 "configure"
+#line 3180 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3106,17 +3223,17 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3110: checking for $ac_hdr" >&5
+echo "configure:3227: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3115 "configure"
+#line 3232 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3145,7 +3262,7 @@ done
 
 	if test $ac_cv_header_krb_h = yes ; then
 		echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
-echo "configure:3149: checking for main in -lkrb" >&5
+echo "configure:3266: checking for main in -lkrb" >&5
 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3153,14 +3270,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3157 "configure"
+#line 3274 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3204,17 +3321,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3208: checking for $ac_hdr" >&5
+echo "configure:3325: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3213 "configure"
+#line 3330 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3243,13 +3360,13 @@ done
 
 	if test $ac_cv_header_pthread_h = yes ; then
 		echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:3247: checking POSIX thread version" >&5
+echo "configure:3364: checking POSIX thread version" >&5
 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 3253 "configure"
+#line 3370 "configure"
 #include "confdefs.h"
 
 #		include <pthread.h>
@@ -3271,7 +3388,7 @@ rm -f conftest*
 
 
 	cat > conftest.$ac_ext <<EOF
-#line 3275 "configure"
+#line 3392 "configure"
 #include "confdefs.h"
 
 #		include <pthread.h>
@@ -3324,7 +3441,7 @@ EOF
 
 		
 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:3328: checking for LinuxThreads" >&5
+echo "configure:3445: checking for LinuxThreads" >&5
 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3350,12 +3467,12 @@ EOF
 
 		
 				echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
-echo "configure:3354: checking for pthread_create" >&5
+echo "configure:3471: checking for pthread_create" >&5
 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3359 "configure"
+#line 3476 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_create(); below.  */
@@ -3378,7 +3495,7 @@ pthread_create();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_pthread_create=yes"
 else
@@ -3400,7 +3517,7 @@ fi
 
 		if test $ol_link_threads = no ; then
 						echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
-echo "configure:3404: checking for pthread_create with -pthread" >&5
+echo "configure:3521: checking for pthread_create with -pthread" >&5
 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3408,7 +3525,7 @@ else
 								save_LIBS="$LIBS"
 				LIBS="-pthread $LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 3412 "configure"
+#line 3529 "configure"
 #include "confdefs.h"
 char pthread();
 int main() {
@@ -3417,7 +3534,7 @@ int main() {
 					
 ; return 0; }
 EOF
-if { (eval echo configure:3421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_pthread_flag=yes
 else
@@ -3441,7 +3558,7 @@ echo "$ac_t""$ol_cv_pthread_flag" 1>&6
 
 		if test $ol_link_threads = no ; then
 						echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
-echo "configure:3445: checking for pthread_create with -pthreads" >&5
+echo "configure:3562: checking for pthread_create with -pthreads" >&5
 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3449,7 +3566,7 @@ else
 								save_LIBS="$LIBS"
 				LIBS="-pthreads $LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 3453 "configure"
+#line 3570 "configure"
 #include "confdefs.h"
 char pthread();
 int main() {
@@ -3458,7 +3575,7 @@ int main() {
 					
 ; return 0; }
 EOF
-if { (eval echo configure:3462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_pthreads_flag=yes
 else
@@ -3482,7 +3599,7 @@ echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
 
 		if test $ol_link_threads = no ; then
 						echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
-echo "configure:3486: checking for pthread_create with -thread" >&5
+echo "configure:3603: checking for pthread_create with -thread" >&5
 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3490,7 +3607,7 @@ else
 								save_LIBS="$LIBS"
 				LIBS="-thread $LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 3494 "configure"
+#line 3611 "configure"
 #include "confdefs.h"
 char pthread();
 int main() {
@@ -3499,7 +3616,7 @@ int main() {
 					
 ; return 0; }
 EOF
-if { (eval echo configure:3503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_thread_flag=yes
 else
@@ -3523,27 +3640,27 @@ echo "$ac_t""$ol_cv_thread_flag" 1>&6
 
 		if test $ol_link_threads = no ; then
 						save_LIBS="$LIBS"
-			echo $ac_n "checking for pthread_join in -lpthread""... $ac_c" 1>&6
-echo "configure:3528: checking for pthread_join in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_join | sed 'y%./+-%__p_%'`
+			echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
+echo "configure:3645: checking for pthread_mutex_lock in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread -lexc $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3536 "configure"
+#line 3653 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char pthread_join();
+char pthread_mutex_lock();
 
 int main() {
-pthread_join()
+pthread_mutex_lock()
 ; return 0; }
 EOF
-if { (eval echo configure:3547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3574,27 +3691,27 @@ fi
 
 		if test $ol_link_threads = no ; then
 						save_LIBS="$LIBS"
-			echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
-echo "configure:3579: checking for pthread_join in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
+			echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
+echo "configure:3696: checking for pthread_mutex_unlock in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3587 "configure"
+#line 3704 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char pthread_join();
+char pthread_mutex_unlock();
 
 int main() {
-pthread_join()
+pthread_mutex_unlock()
 ; return 0; }
 EOF
-if { (eval echo configure:3598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3626,7 +3743,7 @@ fi
 		if test $ol_link_threads = no ; then
 						save_LIBS="$LIBS"
 			echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:3630: checking for pthread_create in -lpthread" >&5
+echo "configure:3747: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3634,7 +3751,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3638 "configure"
+#line 3755 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3645,7 +3762,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:3649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3673,7 +3790,7 @@ fi
 		if test $ol_link_threads = no ; then
 						save_LIBS="$LIBS"
 			echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:3677: checking for pthread_create in -lc_r" >&5
+echo "configure:3794: checking for pthread_create in -lc_r" >&5
 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3681,7 +3798,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3685 "configure"
+#line 3802 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3692,7 +3809,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3720,7 +3837,7 @@ fi
 		if test $ol_link_threads = no ; then
 						save_LIBS="$LIBS"
 			echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:3724: checking for pthread_create in -lpthreads" >&5
+echo "configure:3841: checking for pthread_create in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3728,7 +3845,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3732 "configure"
+#line 3849 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3739,7 +3856,54 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:3743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+				ol_link_threads=posix
+				LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+			LIBS="$save_LIBS"
+		fi
+
+				if test $ol_link_threads = no ; then
+						save_LIBS="$LIBS"
+			echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
+echo "configure:3888: checking for pthread_join in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpthreads  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3896 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char pthread_join();
+
+int main() {
+pthread_join()
+; return 0; }
+EOF
+if { (eval echo configure:3907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3757,8 +3921,10 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   
 				ol_link_threads=posix
 				LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
+				
 else
   echo "$ac_t""no" 1>&6
+-Wl,-woff,85
 fi
 
 			LIBS="$save_LIBS"
@@ -3768,14 +3934,14 @@ fi
 			save_LIBS="$LIBS"
 			LIBS="$LIBS -lpthread"
 			echo $ac_n "checking for pthread_create() in HP-UX -lpthread""... $ac_c" 1>&6
-echo "configure:3772: checking for pthread_create() in HP-UX -lpthread" >&5
+echo "configure:3938: checking for pthread_create() in HP-UX -lpthread" >&5
 			ol_try_pthread_hpux_11=no
 			if eval "test \"`echo '$''{'ol_cv_pthread_hpux_11'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 				cat > conftest.$ac_ext <<EOF
-#line 3779 "configure"
+#line 3945 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -3788,7 +3954,7 @@ int main() {
 pthread_create(NULL, NULL, NULL, NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:3792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_try_pthread_hpux_11=yes
 					ol_cv_pthread_hpux_11=yes
@@ -3826,12 +3992,12 @@ EOF
 												for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3830: checking for $ac_func" >&5
+echo "configure:3996: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3835 "configure"
+#line 4001 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3854,7 +4020,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3882,7 +4048,7 @@ done
 			if test $ac_cv_func_sched_yield = no -a \
 				$ac_cv_func_pthread_yield = no ; then
 								echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:3886: checking for sched_yield in -lrt" >&5
+echo "configure:4052: checking for sched_yield in -lrt" >&5
 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3890,7 +4056,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3894 "configure"
+#line 4060 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3901,7 +4067,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3931,7 +4097,7 @@ fi
 			if test $ac_cv_func_sched_yield = no -a \
 				$ac_cv_func_pthread_yield = no ; then
 								echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:3935: checking for sched_yield in -lposix4" >&5
+echo "configure:4101: checking for sched_yield in -lposix4" >&5
 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3939,7 +4105,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3943 "configure"
+#line 4109 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3950,7 +4116,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:3954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3986,12 +4152,12 @@ fi
 						for ac_func in pthread_kill
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3990: checking for $ac_func" >&5
+echo "configure:4156: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3995 "configure"
+#line 4161 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4014,7 +4180,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4045,12 +4211,12 @@ done
 			
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4049: checking for $ac_func" >&5
+echo "configure:4215: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4054 "configure"
+#line 4220 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4073,7 +4239,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4104,12 +4270,12 @@ done
 			
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4108: checking for $ac_func" >&5
+echo "configure:4274: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4113 "configure"
+#line 4279 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4132,7 +4298,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4158,7 +4324,7 @@ done
 
 
 			echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:4162: checking if pthread_create() works" >&5
+echo "configure:4328: checking if pthread_create() works" >&5
 			if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4167,7 +4333,7 @@ else
   				ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 4171 "configure"
+#line 4337 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -4190,7 +4356,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:4194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create_works=yes
 else
@@ -4212,7 +4378,7 @@ fi
 
 						if test $ol_with_yielding_select = auto ; then
 				echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:4216: checking if select yields when using pthreads" >&5
+echo "configure:4382: checking if select yields when using pthreads" >&5
 				if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4222,7 +4388,7 @@ else
 				{ echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 4226 "configure"
+#line 4392 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -4294,7 +4460,7 @@ int main(argc, argv)
 	exit(2);
 }
 EOF
-if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_select_yields=no
 else
@@ -4334,17 +4500,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4338: checking for $ac_hdr" >&5
+echo "configure:4504: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4343 "configure"
+#line 4509 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4374,12 +4540,12 @@ done
 		ol_with_threads=found
 
 				echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:4378: checking for cthread_fork" >&5
+echo "configure:4544: checking for cthread_fork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4383 "configure"
+#line 4549 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -4402,7 +4568,7 @@ cthread_fork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_cthread_fork=yes"
 else
@@ -4424,7 +4590,7 @@ fi
 
 		if test $ol_link_threads = no ; then
 									echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
-echo "configure:4428: checking for cthread_fork with -all_load" >&5
+echo "configure:4594: checking for cthread_fork with -all_load" >&5
 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4432,7 +4598,7 @@ else
 								save_LIBS="$LIBS"
 				LIBS="-all_load $LIBS"
 				cat > conftest.$ac_ext <<EOF
-#line 4436 "configure"
+#line 4602 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -4441,7 +4607,7 @@ int main() {
 					
 ; return 0; }
 EOF
-if { (eval echo configure:4445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_cthread_all_load=yes
 else
@@ -4486,17 +4652,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4490: checking for $ac_hdr" >&5
+echo "configure:4656: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4495 "configure"
+#line 4661 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4524,7 +4690,7 @@ done
 
 	if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
 		echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
-echo "configure:4528: checking for thr_create in -lthread" >&5
+echo "configure:4694: checking for thr_create in -lthread" >&5
 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4532,7 +4698,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4536 "configure"
+#line 4702 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4543,7 +4709,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:4547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4583,17 +4749,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4587: checking for $ac_hdr" >&5
+echo "configure:4753: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4592 "configure"
+#line 4758 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4621,7 +4787,7 @@ done
 
 	if test $ac_cv_header_lwp_lwp_h = yes ; then
 		echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
-echo "configure:4625: checking for lwp_create in -llwp" >&5
+echo "configure:4791: checking for lwp_create in -llwp" >&5
 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4629,7 +4795,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4633 "configure"
+#line 4799 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4640,7 +4806,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:4644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4693,17 +4859,17 @@ if test $ol_with_threads = manual ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4697: checking for $ac_hdr" >&5
+echo "configure:4863: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4702 "configure"
+#line 4868 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4732,12 +4898,12 @@ done
 	for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4736: checking for $ac_func" >&5
+echo "configure:4902: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4741 "configure"
+#line 4907 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4760,7 +4926,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4786,7 +4952,7 @@ done
 
 	
 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:4790: checking for LinuxThreads" >&5
+echo "configure:4956: checking for LinuxThreads" >&5
 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4807,17 +4973,17 @@ echo "$ac_t""$ol_cv_linux_threads" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4811: checking for $ac_hdr" >&5
+echo "configure:4977: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4816 "configure"
+#line 4982 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4847,17 +5013,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4851: checking for $ac_hdr" >&5
+echo "configure:5017: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4856 "configure"
+#line 5022 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4887,17 +5053,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4891: checking for $ac_hdr" >&5
+echo "configure:5057: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4896 "configure"
+#line 5062 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4952,13 +5118,13 @@ EOF
 
 
 					echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:4956: checking for thread specific errno" >&5
+echo "configure:5122: checking for thread specific errno" >&5
 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 4962 "configure"
+#line 5128 "configure"
 #include "confdefs.h"
 
 #include <errno.h>
@@ -4969,7 +5135,7 @@ int x = errno;
 			
 ; return 0; }
 EOF
-if { (eval echo configure:4973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_errno_thread_specific=yes
 else
@@ -5002,12 +5168,12 @@ echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
 	
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5006: checking for $ac_func" >&5
+echo "configure:5172: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5011 "configure"
+#line 5177 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5030,7 +5196,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5079,13 +5245,13 @@ fi
 ol_link_ldbm=no 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
 	echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
-echo "configure:5083: checking for DB2 library" >&5
+echo "configure:5249: checking for DB2 library" >&5
 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   	ol_LIBS="$LIBS"
 	echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
-echo "configure:5089: checking for db_open in -ldb" >&5
+echo "configure:5255: checking for db_open in -ldb" >&5
 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5093,7 +5259,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5097 "configure"
+#line 5263 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5104,7 +5270,7 @@ int main() {
 db_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5135,17 +5301,17 @@ for ac_hdr in db.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5139: checking for $ac_hdr" >&5
+echo "configure:5305: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5144 "configure"
+#line 5310 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5173,13 +5339,13 @@ done
 
 if test $ac_cv_header_db_h = yes ; then
 	echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
-echo "configure:5177: checking if db.h is DB2" >&5
+echo "configure:5343: checking if db.h is DB2" >&5
 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 5183 "configure"
+#line 5349 "configure"
 #include "confdefs.h"
 
 #			include <db.h>
@@ -5211,7 +5377,7 @@ fi
 
  
  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
-echo "configure:5215: checking for Berkeley DB2" >&5
+echo "configure:5381: checking for Berkeley DB2" >&5
 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5257,18 +5423,18 @@ fi
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
 	echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
-echo "configure:5261: checking for Berkeley DB library" >&5
+echo "configure:5427: checking for Berkeley DB library" >&5
 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   	ol_LIBS="$LIBS"
 	echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:5267: checking for dbopen" >&5
+echo "configure:5433: checking for dbopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5272 "configure"
+#line 5438 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -5291,7 +5457,7 @@ dbopen();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -5310,7 +5476,7 @@ else
   echo "$ac_t""no" 1>&6
 
 		echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:5314: checking for dbopen in -ldb" >&5
+echo "configure:5480: checking for dbopen in -ldb" >&5
 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5318,7 +5484,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5322 "configure"
+#line 5488 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5329,7 +5495,7 @@ int main() {
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:5333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5364,17 +5530,17 @@ for ac_hdr in db_185.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5368: checking for $ac_hdr" >&5
+echo "configure:5534: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5373 "configure"
+#line 5539 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5410,7 +5576,7 @@ fi
 
  
  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
-echo "configure:5414: checking for Berkeley DB" >&5
+echo "configure:5580: checking for Berkeley DB" >&5
 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5463,17 +5629,17 @@ if test $ol_with_ldbm_api = manual ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5467: checking for $ac_hdr" >&5
+echo "configure:5633: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5472 "configure"
+#line 5638 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5508,18 +5674,18 @@ fi
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
 	echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
-echo "configure:5512: checking for GDBM library" >&5
+echo "configure:5678: checking for GDBM library" >&5
 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   	ol_LIBS="$LIBS"
 	echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
-echo "configure:5518: checking for gdbm_open" >&5
+echo "configure:5684: checking for gdbm_open" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5523 "configure"
+#line 5689 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -5542,7 +5708,7 @@ gdbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gdbm_open=yes"
 else
@@ -5561,7 +5727,7 @@ else
   echo "$ac_t""no" 1>&6
 
 		echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:5565: checking for gdbm_open in -lgdbm" >&5
+echo "configure:5731: checking for gdbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5569,7 +5735,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5573 "configure"
+#line 5739 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5580,7 +5746,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5615,17 +5781,17 @@ echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5619: checking for $ac_hdr" >&5
+echo "configure:5785: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5624 "configure"
+#line 5790 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5652,7 +5818,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:5656: checking for db" >&5
+echo "configure:5822: checking for db" >&5
 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5688,18 +5854,18 @@ if test $ol_with_ldbm_api = auto ; then
 	echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
 elif test $ol_with_ldbm_api = ndbm ; then
 	echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:5692: checking for NDBM library" >&5
+echo "configure:5858: checking for NDBM library" >&5
 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   	ol_LIBS="$LIBS"
 	echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:5698: checking for dbm_open" >&5
+echo "configure:5864: checking for dbm_open" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5703 "configure"
+#line 5869 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -5722,7 +5888,7 @@ dbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -5741,7 +5907,7 @@ else
   echo "$ac_t""no" 1>&6
 
 		echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:5745: checking for dbm_open in -lndbm" >&5
+echo "configure:5911: checking for dbm_open in -lndbm" >&5
 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5749,7 +5915,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5753 "configure"
+#line 5919 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5760,7 +5926,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5780,7 +5946,7 @@ else
   echo "$ac_t""no" 1>&6
 
 			echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:5784: checking for dbm_open in -ldbm" >&5
+echo "configure:5950: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5788,7 +5954,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5792 "configure"
+#line 5958 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5799,7 +5965,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5836,17 +6002,17 @@ echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5840: checking for $ac_hdr" >&5
+echo "configure:6006: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5845 "configure"
+#line 6011 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5873,7 +6039,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:5877: checking for db" >&5
+echo "configure:6043: checking for db" >&5
 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5917,7 +6083,7 @@ fi
 
 if test $ol_enable_wrappers = yes ; then
 	echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
-echo "configure:5921: checking for main in -lwrap" >&5
+echo "configure:6087: checking for main in -lwrap" >&5
 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5925,14 +6091,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lwrap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5929 "configure"
+#line 6095 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5978,17 +6144,17 @@ for ac_hdr in termcap.h ncurses.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5982: checking for $ac_hdr" >&5
+echo "configure:6148: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5987 "configure"
+#line 6153 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6017,7 +6183,7 @@ done
 
 if test $ol_link_termcap = no ; then
 	echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:6021: checking for tputs in -ltermcap" >&5
+echo "configure:6187: checking for tputs in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6025,7 +6191,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6029 "configure"
+#line 6195 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6036,7 +6202,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:6040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6069,7 +6235,7 @@ fi
 
 if test $ol_link_termcap = no ; then
 	echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:6073: checking for initscr in -lncurses" >&5
+echo "configure:6239: checking for initscr in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6077,7 +6243,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6081 "configure"
+#line 6247 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6088,7 +6254,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:6092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6130,12 +6296,12 @@ fi
 # FreeBSD (and others) have crypt(3) in -lcrypt
 if test $ol_enable_crypt != no ; then
 	echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:6134: checking for crypt" >&5
+echo "configure:6300: checking for crypt" >&5
 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6139 "configure"
+#line 6305 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -6158,7 +6324,7 @@ crypt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -6177,7 +6343,7 @@ else
   echo "$ac_t""no" 1>&6
 
 		echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:6181: checking for crypt in -lcrypt" >&5
+echo "configure:6347: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6185,7 +6351,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6189 "configure"
+#line 6355 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6196,7 +6362,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:6200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6240,12 +6406,12 @@ fi
 # FreeBSD (and others) have setproctitle(3) in -lutil
 if test $ol_enable_proctitle != no ; then
 	echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:6244: checking for setproctitle" >&5
+echo "configure:6410: checking for setproctitle" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6249 "configure"
+#line 6415 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -6268,7 +6434,7 @@ setproctitle();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_setproctitle=yes"
 else
@@ -6287,7 +6453,7 @@ else
   echo "$ac_t""no" 1>&6
 
 		echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:6291: checking for setproctitle in -lutil" >&5
+echo "configure:6457: checking for setproctitle in -lutil" >&5
 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6295,7 +6461,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6299 "configure"
+#line 6465 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6306,7 +6472,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:6310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6341,12 +6507,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:6345: checking for ANSI C header files" >&5
+echo "configure:6511: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6350 "configure"
+#line 6516 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -6354,7 +6520,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6371,7 +6537,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 6375 "configure"
+#line 6541 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -6389,7 +6555,7 @@ fi
 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 <<EOF
-#line 6393 "configure"
+#line 6559 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -6410,7 +6576,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 6414 "configure"
+#line 6580 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -6421,7 +6587,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:6425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -6454,12 +6620,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:6458: checking for $ac_hdr that defines DIR" >&5
+echo "configure:6624: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6463 "configure"
+#line 6629 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -6467,7 +6633,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:6471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -6492,7 +6658,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:6496: checking for opendir in -ldir" >&5
+echo "configure:6662: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6500,7 +6666,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6504 "configure"
+#line 6670 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6511,7 +6677,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:6515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6533,7 +6699,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:6537: checking for opendir in -lx" >&5
+echo "configure:6703: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6541,7 +6707,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6545 "configure"
+#line 6711 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6552,7 +6718,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:6556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6575,12 +6741,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:6579: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:6745: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6584 "configure"
+#line 6750 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -6596,7 +6762,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -6617,12 +6783,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:6621: checking POSIX termios" >&5
+echo "configure:6787: checking POSIX termios" >&5
 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6626 "configure"
+#line 6792 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -6632,7 +6798,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:6636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   am_cv_sys_posix_termios=yes
 else
@@ -6648,7 +6814,7 @@ echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
 
 
  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:6652: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:6818: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6657,7 +6823,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 6661 "configure"
+#line 6827 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -6677,7 +6843,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 6681 "configure"
+#line 6847 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -6747,17 +6913,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6751: checking for $ac_hdr" >&5
+echo "configure:6917: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6756 "configure"
+#line 6922 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6785,12 +6951,12 @@ done
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:6789: checking for uid_t in sys/types.h" >&5
+echo "configure:6955: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6794 "configure"
+#line 6960 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -6819,7 +6985,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:6823: checking type of array argument to getgroups" >&5
+echo "configure:6989: checking type of array argument to getgroups" >&5
 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6827,7 +6993,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 6831 "configure"
+#line 6997 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -6852,7 +7018,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:6856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
     ac_cv_type_getgroups=gid_t
 else
@@ -6866,7 +7032,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 6870 "configure"
+#line 7036 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -6889,12 +7055,12 @@ cat >> confdefs.h <<EOF
 EOF
 
  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:6893: checking for mode_t" >&5
+echo "configure:7059: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6898 "configure"
+#line 7064 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6922,12 +7088,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:6926: checking for off_t" >&5
+echo "configure:7092: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6931 "configure"
+#line 7097 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6955,12 +7121,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6959: checking for pid_t" >&5
+echo "configure:7125: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6964 "configure"
+#line 7130 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6988,19 +7154,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:6992: checking for ptrdiff_t" >&5
+echo "configure:7158: checking for ptrdiff_t" >&5
 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6997 "configure"
+#line 7163 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:7004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -7021,12 +7187,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:7025: checking return type of signal handlers" >&5
+echo "configure:7191: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7030 "configure"
+#line 7196 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -7043,7 +7209,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:7047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -7062,12 +7228,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:7066: checking for size_t" >&5
+echo "configure:7232: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7071 "configure"
+#line 7237 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7095,12 +7261,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:7099: checking for st_blksize in struct stat" >&5
+echo "configure:7265: checking for st_blksize in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7104 "configure"
+#line 7270 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -7108,7 +7274,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:7112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -7129,12 +7295,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:7133: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:7299: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7138 "configure"
+#line 7304 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -7143,7 +7309,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:7147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -7164,12 +7330,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:7168: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:7334: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7173 "configure"
+#line 7339 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -7177,7 +7343,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:7181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -7200,7 +7366,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:7204: checking if toupper() requires islower()" >&5
+echo "configure:7370: checking if toupper() requires islower()" >&5
 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7209,7 +7375,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 7213 "configure"
+#line 7379 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -7221,7 +7387,7 @@ main()
 		exit(1);
 }
 EOF
-if { (eval echo configure:7225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ol_cv_c_upper_lower=no
 else
@@ -7244,12 +7410,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:7248: checking for working const" >&5
+echo "configure:7414: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7253 "configure"
+#line 7419 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -7298,7 +7464,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -7326,14 +7492,14 @@ EOF
 
 else
 	echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:7330: checking whether byte ordering is bigendian" >&5
+echo "configure:7496: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 7337 "configure"
+#line 7503 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -7344,11 +7510,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 7352 "configure"
+#line 7518 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -7359,7 +7525,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -7379,7 +7545,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7383 "configure"
+#line 7549 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -7392,7 +7558,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:7396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -7416,7 +7582,7 @@ EOF
 fi
 
 	echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:7420: checking size of short" >&5
+echo "configure:7586: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7424,7 +7590,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7428 "configure"
+#line 7594 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7435,7 +7601,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -7455,7 +7621,7 @@ EOF
 
  
 	echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:7459: checking size of int" >&5
+echo "configure:7625: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7463,7 +7629,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7467 "configure"
+#line 7633 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7474,7 +7640,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -7494,7 +7660,7 @@ EOF
 
  
 	echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:7498: checking size of long" >&5
+echo "configure:7664: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7502,7 +7668,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7506 "configure"
+#line 7672 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7513,7 +7679,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -7535,7 +7701,7 @@ EOF
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:7539: checking for 8-bit clean memcmp" >&5
+echo "configure:7705: checking for 8-bit clean memcmp" >&5
 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7543,7 +7709,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 7547 "configure"
+#line 7713 "configure"
 #include "confdefs.h"
 
 main()
@@ -7553,7 +7719,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:7557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -7571,12 +7737,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:7575: checking for strftime" >&5
+echo "configure:7741: checking for strftime" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7580 "configure"
+#line 7746 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -7599,7 +7765,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -7621,7 +7787,7 @@ else
   echo "$ac_t""no" 1>&6
 # strftime is in -lintl on SCO UNIX.
 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:7625: checking for strftime in -lintl" >&5
+echo "configure:7791: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7629,7 +7795,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7633 "configure"
+#line 7799 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7640,7 +7806,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:7644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7667,12 +7833,12 @@ fi
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:7671: checking for vprintf" >&5
+echo "configure:7837: checking for vprintf" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7676 "configure"
+#line 7842 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -7695,7 +7861,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
@@ -7719,12 +7885,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:7723: checking for _doprnt" >&5
+echo "configure:7889: checking for _doprnt" >&5
 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7728 "configure"
+#line 7894 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -7747,7 +7913,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -7776,12 +7942,12 @@ if test $ac_cv_func_vprintf = yes ; then
 		for ac_func in vsnprintf vsprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7780: checking for $ac_func" >&5
+echo "configure:7946: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7785 "configure"
+#line 7951 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7804,7 +7970,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7831,7 +7997,7 @@ done
 fi
 
 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
-echo "configure:7835: checking for wait3 that fills in rusage" >&5
+echo "configure:8001: checking for wait3 that fills in rusage" >&5
 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7839,7 +8005,7 @@ else
   ac_cv_func_wait3_rusage=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 7843 "configure"
+#line 8009 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -7870,7 +8036,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:7874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_wait3_rusage=yes
 else
@@ -7904,7 +8070,6 @@ for ac_func in \
 	memcpy			\
 	memmove			\
 	mkstemp			\
-	res_search		\
 	select			\
 	setpwfile		\
 	setsid			\
@@ -7925,12 +8090,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7929: checking for $ac_func" >&5
+echo "configure:8094: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7934 "configure"
+#line 8099 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7953,7 +8118,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7981,12 +8146,12 @@ done
 for ac_func in getopt strdup tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7985: checking for $ac_func" >&5
+echo "configure:8150: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7990 "configure"
+#line 8155 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8009,7 +8174,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8039,13 +8204,13 @@ done
 # Check Configuration
 
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:8043: checking declaration of sys_errlist" >&5
+echo "configure:8208: checking declaration of sys_errlist" >&5
 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	cat > conftest.$ac_ext <<EOF
-#line 8049 "configure"
+#line 8214 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8055,7 +8220,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:8059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
 else
@@ -8076,20 +8241,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then
 EOF
 
 	echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:8080: checking existence of sys_errlist" >&5
+echo "configure:8245: checking existence of sys_errlist" >&5
 	if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 		cat > conftest.$ac_ext <<EOF
-#line 8086 "configure"
+#line 8251 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:8093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_have_sys_errlist=yes
 else
@@ -8234,7 +8399,6 @@ fi
 
 
 
-
 
 
 trap '' 1 2 15
diff --git a/configure.in b/configure.in
index a4edb53a72..f15b656679 100644
--- a/configure.in
+++ b/configure.in
@@ -270,8 +270,19 @@ dnl
 	AC_CHECK_LIB(gen, main)
 ])
 
-dnl Check for resolv
-AC_CHECK_LIB(resolv, res_search)
+dnl Check for resolver routines
+AC_CHECK_FUNCS(res_search)
+if test $ac_cv_func_res_search = "no" ; then 
+	AC_CHECK_LIB(bind, res_search)
+	if test $ac_cv_libac_cv_lib_bind_res_search = "yes" ; then
+		AC_DEFINE(HAVE_RES_SEARCH,1)
+	else
+		AC_CHECK_LIB(resolv, res_search)
+		if test $ac_cv_libac_cv_lib_resolv_res_search = "yes" ; then
+			AC_DEFINE(HAVE_RES_SEARCH,1)
+		fi
+	fi
+fi
 
 dnl HP-UX requires -lV3
 AC_CHECK_LIB(V3, sigset)
@@ -445,7 +456,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 		if test $ol_link_threads = no ; then
 			dnl try DEC Threads -lpthread -lexc
 			save_LIBS="$LIBS"
-			AC_CHECK_LIB(pthread, pthread_join, [
+			AC_CHECK_LIB(pthread, pthread_mutex_lock, [
 				ol_link_threads=posix
 				LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
 				if test $ol_with_yielding_select = auto ; then
@@ -458,7 +469,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 		if test $ol_link_threads = no ; then
 			dnl try DEC Threads -lpthreads -lmach -lexc -lc_r
 			save_LIBS="$LIBS"
-			AC_CHECK_LIB(pthreads, pthread_join, [
+			AC_CHECK_LIB(pthreads, pthread_mutex_unlock, [
 				ol_link_threads=posix
 				LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
 				if test $ol_with_yielding_select = auto ; then
@@ -495,7 +506,18 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 			LIBS="$save_LIBS"
 		fi
 
-		dnl HP-UX 11 check
+		dnl IRIX Pthread check
+		if test $ol_link_threads = no ; then
+			dnl try IRIX Pthreads -Wl,-woff,85 -lpthreads
+			save_LIBS="$LIBS"
+			AC_CHECK_LIB(pthreads, pthread_join, [
+				ol_link_threads=posix
+				LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
+				],[-Wl,-woff,85])
+			LIBS="$save_LIBS"
+		fi
+
+		dnl HP-UX 11 Pthread check
 		if test $ol_link_threads = no; then
 			save_LIBS="$LIBS"
 			LIBS="$LIBS -lpthread"
@@ -1144,7 +1166,6 @@ AC_CHECK_FUNCS(		\
 	memcpy			\
 	memmove			\
 	mkstemp			\
-	res_search		\
 	select			\
 	setpwfile		\
 	setsid			\
@@ -1251,7 +1272,6 @@ AC_SUBST(BUILD_SLAPD)
   AC_SUBST(BUILD_SHELL)
 AC_SUBST(BUILD_SLURPD)
 
-
 AC_SUBST(LDAP_LIBS)
 AC_SUBST(LDAPD_LIBS)
 AC_SUBST(SLAPD_LIBS)
diff --git a/doc/devel/todo b/doc/devel/todo
index 724ee8ebc8..966c30263d 100644
--- a/doc/devel/todo
+++ b/doc/devel/todo
@@ -41,6 +41,7 @@ Modify -llthread to hide thread implementation <bart@openldap.org>
 Modify libraries to use application specified logging routines
 Modify libraries to use application specified memory allocation routines
 Modify servers to use reentrant library functions
+Extend slapd to support identd (RFC1413) information in ACLs.
 Extend configure.in to support autodetect of ISODE features.
 Remove ldapconfig.h.edit dependencies.
 Update SLAPD/SLURD Admin Guide
@@ -51,7 +52,10 @@ Small projects
 --------------
 Create ldapurl (from ldapsearch?) to support searching by URL
 Create ldapquery (from ldapsearch?) to support searching using ldap_getfilter(3)
+Extend gateways to support tcp_wrappers.
+Extend slapd/tcp_wrapper to support identd.
 Extend configure.in to support autodetect of Kerberos features.
 Extend mail500 (and other daemons) to use ldap_getfilter(3)
+Update back-passwd (see ITS#40)
 Add useful information to our FAQ http://www.openldap.org/faq/
 Update any manual page
diff --git a/doc/install/hints/Linux b/doc/install/hints/Linux
new file mode 100644
index 0000000000..4bf8fca36a
--- /dev/null
+++ b/doc/install/hints/Linux
@@ -0,0 +1,4 @@
+If Berkeley DB 2.x should be used with thread support activated, read the
+file build/db.2.x.README carefully. The Berkeley package must be build
+appropriately to support threaded applications as expected.
+
diff --git a/include/Makefile.in b/include/Makefile.in
index 3c9f76a788..9fa4ea4fe9 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -7,11 +7,11 @@ all-local: ldapconfig.h FORCE
 
 install-local: FORCE
 		-$(MKDIR) -p $(includedir)
-		$(INSTALL) $(INSTALLFLAGS) -m 644 ldap.h $(includedir)
-		$(INSTALL) $(INSTALLFLAGS) -m 644 lber.h $(includedir)
-		$(INSTALL) $(INSTALLFLAGS) -m 644 ldap_cdefs.h $(includedir)
-		$(INSTALL) $(INSTALLFLAGS) -m 644 disptmpl.h $(includedir)
-		$(INSTALL) $(INSTALLFLAGS) -m 644 srchpref.h $(includedir)
+		$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/ldap.h $(includedir)
+		$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/lber.h $(includedir)
+		$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/ldap_cdefs.h $(includedir)
+		$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/disptmpl.h $(includedir)
+		$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/srchpref.h $(includedir)
 
 clean-local: FORCE 
 	$(RM) ldapconfig.h
diff --git a/include/portable.h.in b/include/portable.h.in
index 3a3c3f58c1..e534b18151 100644
--- a/include/portable.h.in
+++ b/include/portable.h.in
@@ -92,14 +92,26 @@
 #undef WORDS_BIGENDIAN
 
 /* define this if needed to get reentrant functions */
+#ifndef REENTRANT
 #undef REENTRANT
+#endif
+#ifndef _REENTRANT
 #undef _REENTRANT
+#endif
 
 /* define this if needed to get threadsafe functions */
+#ifndef THREADSAFE
 #undef THREADSAFE
+#endif
+#ifndef _THREADSAFE
 #undef _THREADSAFE
+#endif
+#ifndef THREAD_SAFE
 #undef THREAD_SAFE
+#endif
+#ifndef _THREAD_SAFE
 #undef _THREAD_SAFE
+#endif
 
 /* define this if cross compiling */
 #undef CROSS_COMPILING
@@ -167,6 +179,12 @@
 /* define if you have ptrdiff_t */
 #undef HAVE_PTRDIFF_T
 
+/* define if you have res_search() */
+#ifdef __notdef__
+/* see second res_search define */
+#undef HAVE_RES_SEARCH
+#endif
+
 /* define if you have sched_yield() */
 #ifdef __notdef__
 /* see second sched_yield define */
@@ -572,6 +590,9 @@
 /* Define if you have the V3 library (-lV3).  */
 #undef HAVE_LIBV3
 
+/* Define if you have the bind library (-lbind).  */
+#undef HAVE_LIBBIND
+
 /* Define if you have the gen library (-lgen).  */
 #undef HAVE_LIBGEN
 
diff --git a/libraries/Makefile.in b/libraries/Makefile.in
new file mode 100644
index 0000000000..4235f0db53
--- /dev/null
+++ b/libraries/Makefile.in
@@ -0,0 +1,7 @@
+## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved.
+## COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+##
+## Libraries Makefile for OpenLDAP
+
+SUBDIRS= liblutil libavl libldif liblber libldap libldbm liblthread
+
diff --git a/libraries/libavl/Makefile.in b/libraries/libavl/Makefile.in
index 814d5e1cf0..893c780639 100644
--- a/libraries/libavl/Makefile.in
+++ b/libraries/libavl/Makefile.in
@@ -11,6 +11,7 @@ LDAP_LIBDIR= ../../libraries
 
 LIBRARY = libavl.a
 PROGRAMS	= testavl
+XLIBS = -lavl
 
 testavl:	$(LIBRARY) testavl.o
-	$(LTLINK) $(LDFLAGS) -o $@ testavl.o $(LDAP_LIBPATH) -lavl
+	$(LTLINK) $(LDFLAGS) -o $@ testavl.o $(LIBS)
diff --git a/libraries/liblber/Makefile.in b/libraries/liblber/Makefile.in
index 40b08df2e8..49478ebc59 100644
--- a/libraries/liblber/Makefile.in
+++ b/libraries/liblber/Makefile.in
@@ -16,7 +16,8 @@ PROGRAMS= dtest etest idtest
 LDAP_INCDIR= ../../include       
 LDAP_LIBDIR= ../../libraries       
 
-LIBS = $(LDAP_LIBPATH) $(LDAP_LIBLBER) $(AC_LIBS)
+XLIBS = -llber
+XXLIBS = 
 
 dtest:    $(LIBRARY) dtest.o
 	$(LTLINK) $(LDFLAGS) -o $@ dtest.o $(LIBS)
diff --git a/libraries/libldap/Makefile.in b/libraries/libldap/Makefile.in
index 818e4f2be9..3b9a200fc3 100644
--- a/libraries/libldap/Makefile.in
+++ b/libraries/libldap/Makefile.in
@@ -25,7 +25,8 @@ OBJS	= bind.lo open.lo result.lo error.lo compare.lo search.lo \
 LDAP_INCDIR= ../../include       
 LDAP_LIBDIR= ../../libraries
 
-LIBS = $(LDAP_LIBPATH) $(LDAP_LIBLDAP) $(LDAP_LIBLBER) $(AC_LIBS)
+XLIBS = -lldap -llber
+XXLIBS = 
 
 ltest:	$(LIBRARY) test.o $(LDAP_LIBLBER_DEPEND)
 	$(LTLINK) $(LDFLAGS) -o $@ test.o $(LIBS)
@@ -41,14 +42,14 @@ install-local: $(CFFILES) FORCE
 	@for i in $(CFFILES); do \
 		if test ! -f $(sysconfdir)/$$i; then \
 			echo "installing $$i in $(sysconfdir)"; \
-			echo "$(INSTALL) $(INSTALLFLAGS) -m 644 $$i $(sysconfdir)/$$i"; \
-			$(INSTALL) $(INSTALLFLAGS) -m 644 $$i $(sysconfdir)/$$i; \
+			echo "$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(sysconfdir)/$$i"; \
+			$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(sysconfdir)/$$i; \
 		else \
 			echo "PRESERVING EXISTING CONFIGURATION FILE $(sysconfdir)/$$i" ; \
 		fi; \
-		$(INSTALL) $(INSTALLFLAGS) -m 644 $$i $(sysconfdir)/$$i.default; \
+		$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(sysconfdir)/$$i.default; \
 	done
 	-$(MKDIR) $(datadir)
 	-$(MV) $(datadir)/ldapfriendly $(datadir)/ldapfriendly-
-	$(INSTALL) $(INSTALLFLAGS) -m 644 ldapfriendly $(datadir)/ldapfriendly
+	$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/ldapfriendly $(datadir)/ldapfriendly
 
diff --git a/libraries/libldbm/Makefile.in b/libraries/libldbm/Makefile.in
new file mode 100644
index 0000000000..c27b26042f
--- /dev/null
+++ b/libraries/libldbm/Makefile.in
@@ -0,0 +1,17 @@
+##
+## Makefile for -lldbm
+##
+
+LIBRARY		= libldbm.a
+XPROGRAMS	= testldbm
+SRCS		= ldbm.c
+OBJS		= ldbm.o
+
+LDAP_INCDIR= ../../include       
+LDAP_LIBDIR= ../../libraries
+
+XLIBS		= -lldbm -lavl
+XXLIBS		= $(LDBM_LIBS)
+
+testldbm:	libldbm.a testldbm.o
+	$(CC) $(LDFLAGS) -o $@ testldbm.o $(LIBS)
diff --git a/libraries/liblthread/Makefile.in b/libraries/liblthread/Makefile.in
new file mode 100644
index 0000000000..63da618a70
--- /dev/null
+++ b/libraries/liblthread/Makefile.in
@@ -0,0 +1,15 @@
+##
+## Makefile for -llthread
+##
+
+LIBRARY	= liblthread.a
+XSRCS	= version.c
+SRCS	= rdwr.c thread.c stack.c
+OBJS	= rdwr.o thread.o stack.o
+
+LDAP_INCDIR= ../../include       
+LDAP_LIBDIR= ../../libraries
+
+XLIBS = -lthread
+XXLIBS	= $(LTHREAD_LIBS)
+
diff --git a/servers/ldapd/Makefile.in b/servers/ldapd/Makefile.in
index 23a7c1e082..1584054cea 100644
--- a/servers/ldapd/Makefile.in
+++ b/servers/ldapd/Makefile.in
@@ -18,15 +18,16 @@ LDAP_LIBDIR= ../../libraries
 BUILD_OPT = "--enable-ldapd"
 BUILD_SRV = @BUILD_LDAPD@
 
-XLIBS= @LDAPD_LIBS@ $(KRB_LIBS) -llutil @LUTIL_LIBS@
+XLIBS= -llber -llutil
+XXLIBS= $(LDAPD_LIBS) $(KRB_LIBS) $(LUTIL_LIBS)
 
 ldapd:	version.o
 	$(LDLINK) -o $@ $(OBJS) version.o $(LIBS)
 
 sldapd:	version.o
-	$(LDLINK) -static -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) -lresolv
+	$(LDLINK) -static -o $@ $(OBJS) version.o $(LIBS)
 
-version.c: $(OBJS) $(LDAP_LIBDIR)/liblber/liblber.a
+version.c: $(OBJS) $(LDAP_LIBLBER_DEPEND)
 	$(RM) $@
 	(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
 	 t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
diff --git a/servers/slapd/Makefile.in b/servers/slapd/Makefile.in
index 5b0c6ed0d4..7e84bc69be 100644
--- a/servers/slapd/Makefile.in
+++ b/servers/slapd/Makefile.in
@@ -22,6 +22,12 @@ OBJS	= main.o daemon.o connection.o search.o filter.o add.o charray.o \
 LDAP_INCDIR= ../../include
 LDAP_LIBDIR= ../../libraries
 
+# $(LTHREAD_LIBS) must be last
+XLIBS = libbackends.a -lavl -lldbm -lldif -lldap -llber -llthread -llutil
+XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) \
+	$(KRB_LIBS) $(LUTIL_LIBS)
+XXXLIBS = $(LTHREAD_LIBS)
+
 BUILD_OPT = "--enable-slapd"
 BUILD_SRV = @BUILD_SLAPD@
 
@@ -30,10 +36,6 @@ all-local-srv: FORCE
 	$(MAKE) $(MFLAGS) slapd
 	(cd tools; $(MAKE) $(MFLAGS) all)
 
-XLIBS = @SLAPD_LIBS@ libbackends.a \
-	-lavl -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@ \
-	$(KRB_LIBS) -llutil @LUTIL_LIBS@
-
 slapd: version.o
 	$(LTLINK) -o $@ $(OBJS) version.o $(LIBS)
 
@@ -115,7 +117,7 @@ install-conf: FORCE
 	@-$(MKDIR) $(sysconfdir)
 	@for i in $(CFFILES); do \
 		tmpcf=/tmp/$$i.$$ ; \
-		$(SED) -e 's;%SYSCONFDIR%;$(sysconfdir);' $$i > $$tmpcf ; \
+		$(SED) -e 's;%SYSCONFDIR%;$(sysconfdir);' $(srcdir)/$$i > $$tmpcf ; \
 		if test ! -f $(sysconfdir)/$$i; then \
 			echo "installing $$i in $(sysconfdir)"; \
 			echo "$(INSTALL) $(INSTALLFLAGS) -m 644 $$tmpcf $(sysconfdir)/$$i"; \
@@ -124,7 +126,7 @@ install-conf: FORCE
 			echo "PRESERVING EXISTING CONFIGURATION FILE $(sysconfdir)/$$i" ; \
 		fi; \
 		$(INSTALL) $(INSTALLFLAGS) -m 644 $$tmpcf $(sysconfdir)/$$i.default; \
-		$(RM) -f /tmp/slapd.$$ ; \
+		$(RM) -f $$tmpcf ; \
 	done
 
 install-tools: FORCE
diff --git a/servers/slapd/tools/Makefile.in b/servers/slapd/tools/Makefile.in
index 2045682f6f..b9fd8e41ce 100644
--- a/servers/slapd/tools/Makefile.in
+++ b/servers/slapd/tools/Makefile.in
@@ -18,6 +18,11 @@ BUILD_LDBM = @BUILD_LDBM@
 LDAP_INCDIR= ../../../include       
 LDAP_LIBDIR= ../../../libraries
 
+XLIBS = -lavl -lldif -lldap -llber -lldbm -llthread -llutil
+XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \
+	$(LDBM_LIBS) $(KRB_LIBS) $(LUTIL_LIBS)
+XXXLIBS = $(LTHREAD_LIBS)
+
 PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry \
 	ldif2id2children centipede ldbmtest ldif
 
@@ -46,9 +51,6 @@ build-ldbm: FORCE
 
 ldbm-tools: $(PROGRAMS)
 
-XLIBS = @SLAPD_LIBS@ -lavl -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@ \
-	$(KRB_LIBS) -llutil @LUTIL_LIBS@
-
 build-edb2ldif:	FORCE
 	@if [ "$(HAVE_ISODE)" = "yes" ]; then \
 		$(MAKE) $(MFLAGS) edb2ldif; \
@@ -93,14 +95,13 @@ ldbmcat:	ldbmcat.o
 	$(LTLINK) -o $@ ldbmcat.o $(LIBS)
 
 ldif:		ldif.o
-	$(LTLINK) -o $@ ldif.o $(LIBS) $(LIBS2)
+	$(LTLINK) -o $@ ldif.o $(LIBS)
 
 centipede:	centipede.o 
-	$(LTLINK) -o $@ centipede.o $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
+	$(LTLINK) -o $@ centipede.o $(LIBS)
 
 sizecount:	sizecount.o ../phonetic.o ../ch_malloc.o
-	$(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o \
-		$(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
+	$(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o $(LIBS)
 
 ldbmtest:	ldbmtest.o ../libbackends.a $(OBJS2)
 	$(LTLINK) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS)
diff --git a/servers/slurpd/Makefile.in b/servers/slurpd/Makefile.in
index 2e50c374b0..335ff224d6 100644
--- a/servers/slurpd/Makefile.in
+++ b/servers/slurpd/Makefile.in
@@ -24,7 +24,10 @@ BUILD_SRV = @BUILD_SLURPD@
 
 all-local-srv: 	slurpd
 
-XLIBS = @SLURPD_LIBS@ -llthread @LTHREAD_LIBS@ $(KRB_LIBS) -llutil @LUTIL_LIBS@
+# $(LTHREAD_LIBS) must be last!
+XLIBS = -lldif -lldap -llber -llthread -llutil
+XXLIBS = $(SLURPD_LIBS) $(KRB_LIBS) $(LUTIL_LIBS)
+XXXLIBS = $(LTHREAD_LIBS)
 
 slurpd:	version.o
 	$(LTLINK) -o $@ $(OBJS) version.o $(LIBS)
@@ -32,7 +35,7 @@ slurpd:	version.o
 sslurpd:	version.o
 	$(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS)
 
-version.c: $(OBJS) $(LDAP_LIBDEPEND)
+version.c: $(OBJS) $(LDAP_LIBDEPEND) $(LDAP_LIBTHREAD_DEPEND)
 	$(RM) $@
 	(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
 	t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 8bfc599a3c..2c8adfc82d 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -3,17 +3,16 @@
 ##
 ## tests Makefile.in for OpenLDAP
 
-
-SCRIPTSDIR=./scripts
-
 all-local:	FORCE
+	@-$(LN_S) $(srcdir)/data .
 	@echo "Initiating LDAP tests..."; \
-	$(MKDIR) -p test-db test-repl ; \
-	$(SCRIPTSDIR)/all $(SCRIPTSDIR)
+	$(MKDIR) test-db test-repl ; \
+	$(srcdir)/scripts/all $(srcdir)
 
 clean-local:	FORCE
 	$(RM) test-db/[!C]* test-repl/[!C]* *core
 
 veryclean-local: FORCE
+	$(RM) -f data
 	$(RM) -r test-db test-repl
 
diff --git a/tests/scripts/all b/tests/scripts/all
index 451c739caa..5dbdc61b2a 100755
--- a/tests/scripts/all
+++ b/tests/scripts/all
@@ -3,15 +3,16 @@
 echo ">>>>> Executing all LDAP tests..."
 
 if [ $# -eq 0 ]; then
-	SCRIPTDIR="."
+	SRCDIR="."
 else
-	SCRIPTDIR=$1; shift
+	SRCDIR=$1; shift
 fi
 
-for i in $SCRIPTDIR/test*; do
-	CMD=$i $*
-	echo ">>>>> Starting $CMD ..."
-	$CMD
+echo ">>>>> Test Directory: $SRCDIR"
+
+for CMD in $SRCDIR/scripts/test*; do
+	echo ">>>>> Starting `basename $CMD` ..."
+	$CMD $SRCDIR
 	RC=$?
 	if [ $RC -eq 0 ]; then
 		echo ">>>>> $CMD completed OK."
@@ -19,5 +20,7 @@ for i in $SCRIPTDIR/test*; do
 		echo ">>>>> $CMD failed (exit $RC)"
 		exit $RC
 	fi
+	echo ">>>>> waiting 5 seconds for things to exit"
+	sleep 5
 	echo
 done
diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh
index 6d8bf2f391..f16d201317 100755
--- a/tests/scripts/defines.sh
+++ b/tests/scripts/defines.sh
@@ -1,3 +1,5 @@
+DATADIR=$SRCDIR/data
+
 LDIF2LDBM=../servers/slapd/tools/ldif2ldbm
 SLAPD=../servers/slapd/slapd
 SLURPD=../servers/slurpd/slurpd
@@ -8,26 +10,31 @@ PORT=9009
 SLAVEPORT=9010
 DBDIR=./test-db
 REPLDIR=./test-repl
-CONF=./data/slapd-master.conf
-ACLCONF=./data/slapd-acl.conf
-MASTERCONF=./data/slapd-repl-master.conf
-SLAVECONF=./data/slapd-repl-slave.conf
-LDIF=./data/test.ldif
-LDIFORDERED=./data/test-ordered.ldif
+CONF=$DATADIR/slapd-master.conf
+ACLCONF=$DATADIR/slapd-acl.conf
+MASTERCONF=$DATADIR/slapd-repl-master.conf
+SLAVECONF=$DATADIR/slapd-repl-slave.conf
+LDIF=$DATADIR/test.ldif
+LDIFORDERED=$DATADIR/test-ordered.ldif
 BASEDN="o=University of Michigan, c=US"
 MANAGERDN="cn=Manager, o=University of Michigan, c=US"
 PASSWD=secret
 BABSDN="cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US"
 BJORNSDN="cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US"
 JAJDN="cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US"
+MASTERLOG=$DBDIR/master.log
+SLAVELOG=$DBDIR/slave.log
+SLURPLOG=$DBDIR/slurp.log
 SEARCHOUT=$DBDIR/ldapsearch.out
+SEARCHFLT=$DBDIR/ldapsearch.flt
+LDIFFLT=$DBDIR/ldif.flt
 MASTEROUT=$DBDIR/master.out
 SLAVEOUT=$DBDIR/slave.out
 TESTOUT=$DBDIR/ldapsearch.out
-SEARCHOUTMASTER=./data/search.out.master
-MODIFYOUTMASTER=./data/modify.out.master
-ADDDELOUTMASTER=./data/adddel.out.master
-MODRDNOUTMASTER=./data/modrdn.out.master
-ACLOUTMASTER=./data/acl.out.master
-REPLOUTMASTER=./data/repl.out.master
-MODSRCHFILTERS=./data/modify.search.filters
+SEARCHOUTMASTER=$DATADIR/search.out.master
+MODIFYOUTMASTER=$DATADIR/modify.out.master
+ADDDELOUTMASTER=$DATADIR/adddel.out.master
+MODRDNOUTMASTER=$DATADIR/modrdn.out.master
+ACLOUTMASTER=$DATADIR/acl.out.master
+REPLOUTMASTER=$DATADIR/repl.out.master
+MODSRCHFILTERS=$DATADIR/modify.search.filters
diff --git a/tests/scripts/test001-ldif2ldbm b/tests/scripts/test001-ldif2ldbm
index 26d10fff94..49f00671b1 100755
--- a/tests/scripts/test001-ldif2ldbm
+++ b/tests/scripts/test001-ldif2ldbm
@@ -1,7 +1,16 @@
 #!/bin/sh
 
-. scripts/defines.sh
+if [ $# -eq 0 ]; then
+	SRCDIR="."
+else
+	SRCDIR=$1; shift
+fi
+
+echo "running defines.sh $SRCDIR"
+
+. $SRCDIR/scripts/defines.sh $SRCDIR
 
+echo "Datadir is $DATADIR"
 
 echo "Cleaning up in $DBDIR..."
 
diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate
index c04d1f5f65..d5f659b71d 100755
--- a/tests/scripts/test002-populate
+++ b/tests/scripts/test002-populate
@@ -1,14 +1,19 @@
 #!/bin/sh
 
-. scripts/defines.sh
+if [ $# -eq 0 ]; then
+	SRCDIR="."
+else
+	SRCDIR=$1; shift
+fi
 
+. $SRCDIR/scripts/defines.sh $SRCDIR
 
 echo "Cleaning up in $DBDIR..."
 
-rm -f $DBDIR/*
+rm -f $DBDIR/[!C]*
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 &
+$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Using ldapsearch to check that slapd is running..."
@@ -44,8 +49,13 @@ if [ $RC != 0 ]; then
 	exit $RC
 fi
 
-echo "Comparing retrieved entries to LDIF file used to create database"
-cmp $SEARCHOUT $LDIF
+echo "Filtering ldapsearch results..."
+. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
+echo "Comparing filter output..."
+cmp $SEARCHFLT $LDIFFLT
+
 if [ $? != 0 ]; then
 	echo "comparison failed - database was not created correctly"
 	exit 1
diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search
index 0912550608..661ccc219f 100755
--- a/tests/scripts/test003-search
+++ b/tests/scripts/test003-search
@@ -1,10 +1,16 @@
 #!/bin/sh
 
-. scripts/defines.sh
+if [ $# -eq 0 ]; then
+	SRCDIR="."
+else
+	SRCDIR=$1; shift
+fi
+
+. $SRCDIR/scripts/defines.sh $SRCDIR
 
 echo "Cleaning up in $DBDIR..."
 
-rm -f $DBDIR/*
+rm -f $DBDIR/[!C]*
 
 echo "Running ldif2ldbm to build slapd database..."
 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
@@ -15,7 +21,7 @@ if [ $RC != 0 ]; then
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 &
+$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Testing slapd searching..."
diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify
index 09a4fdfee1..46d813e7e7 100755
--- a/tests/scripts/test004-modify
+++ b/tests/scripts/test004-modify
@@ -1,10 +1,16 @@
 #!/bin/sh
 
-. scripts/defines.sh
+if [ $# -eq 0 ]; then
+	SRCDIR="."
+else
+	SRCDIR=$1; shift
+fi
+
+. $SRCDIR/scripts/defines.sh $SRCDIR
 
 echo "Cleaning up in $DBDIR..."
 
-rm -f $DBDIR/*
+rm -f $DBDIR/[!C]*
 
 echo "Running ldif2ldbm to build slapd database..."
 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
@@ -15,7 +21,7 @@ if [ $RC != 0 ]; then
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 &
+$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Testing slapd modify operations..."
diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn
index 0211ada5ca..510f898554 100755
--- a/tests/scripts/test005-modrdn
+++ b/tests/scripts/test005-modrdn
@@ -1,5 +1,12 @@
 #!/bin/sh
 
-echo "modrdn test not yet written"
+if [ $# -eq 0 ]; then
+	SRCDIR="."
+else
+	SRCDIR=$1; shift
+fi
+
+. $SRCDIR/scripts/defines.sh $SRCDIR
 
+echo "modrdn test not yet written"
 exit 0
diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls
index ec1c964d10..6979cf27fa 100755
--- a/tests/scripts/test006-acls
+++ b/tests/scripts/test006-acls
@@ -1,10 +1,16 @@
 #!/bin/sh
 
-. scripts/defines.sh
+if [ $# -eq 0 ]; then
+	SRCDIR="."
+else
+	SRCDIR=$1; shift
+fi
+
+. $SRCDIR/scripts/defines.sh $SRCDIR
 
 echo "Cleaning up in $DBDIR..."
 
-rm -f $DBDIR/*
+rm -f $DBDIR/[!C]*
 
 echo "Running ldif2ldbm to build slapd database..."
 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
@@ -15,7 +21,7 @@ if [ $RC != 0 ]; then
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $ACLCONF -p $PORT -d 1 > /dev/null 2>&1 &
+$SLAPD -f $ACLCONF -p $PORT -d 1 > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Testing slapd access control..."
@@ -96,8 +102,7 @@ EOMODS4
 
 echo "Using ldapsearch to retrieve all the entries..."
 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-	    'objectClass=*' | egrep -iv '^modifytimestamp|^modifiersname' \
-	    >> $SEARCHOUT 2>&1
+	    'objectClass=*' | . $SRCDIR/scripts/acfilter.sh >> $SEARCHOUT 2>&1
 RC=$?
 kill -HUP $PID
 if [ $RC != 0 ]; then
diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication
index 10190728fc..58bcfec0a1 100755
--- a/tests/scripts/test007-replication
+++ b/tests/scripts/test007-replication
@@ -10,7 +10,13 @@
 # - retrieve database over ldap and compare against expected results
 #
 
-. scripts/defines.sh
+if [ $# -eq 0 ]; then
+	SRCDIR="."
+else
+	SRCDIR=$1; shift
+fi
+
+. $SRCDIR/scripts/defines.sh $SRCDIR
 
 if test ! -x $SLURPD ; then
 	echo ">>>>> $SLURPD is not executable or do not exist."
-- 
GitLab