]> git.sur5r.net Git - openldap/blobdiff - configure
Update
[openldap] / configure
index aff1b9a483936f752be773a3801b009b96caa111..8fcf94b08baf6ee76a5242b2e99f3c851ec608c8 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,4 +1,16 @@
 #! /bin/sh
+# $OpenLDAP$
+# from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.9 2000/08/18 02:32:52 kurt Exp  
+
+# Copyright 1998-2000 The OpenLDAP Foundation.  All Rights Reserved.
+# 
+# Redistribution and use in source and binary forms are permitted only
+# as authorized by the OpenLDAP Public License.  A copy of this
+# license is available at http://www.OpenLDAP.org/license.html or
+# in file LICENSE in the top-level directory of the distribution.
+
+echo "Copyright 1998-2000 The OpenLDAP Foundation,  All Rights Reserved."
+echo "Restrictions apply, see COPYRIGHT and LICENSE files."
 
 # Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version 2.13.1 
@@ -15,93 +27,95 @@ ac_default_prefix=/usr/local
 ac_help="$ac_help
   --with-subdir=DIR change default subdirectory used for installs"
 ac_help="$ac_help
-  --enable-debug       enable debugging (yes)"
+  --enable-debug         enable debugging (yes)"
 ac_help="$ac_help
-  --enable-syslog      enable syslog support (auto)"
+  --enable-syslog        enable syslog support (auto)"
 ac_help="$ac_help
-  --enable-proctitle   enable proctitle support (yes)"
+  --enable-proctitle     enable proctitle support (yes)"
 ac_help="$ac_help
-  --enable-cache       enable caching (yes)"
+  --enable-cache         enable caching (yes)"
 ac_help="$ac_help
-  --enable-dns         enable V2 DNS  extension (no)"
+  --enable-referrals     enable V2 Referrals extension (yes)"
 ac_help="$ac_help
-  --enable-referrals   enable V2 Referrals extension (yes)"
+  --enable-kbind         enable V2 Kerberos IV bind (auto)"
 ac_help="$ac_help
-  --enable-cldap       enable connectionless ldap (no)"
+  --enable-ipv6          enable IPv6 support (auto)"
 ac_help="$ac_help
-  --enable-x-compile   enable cross compiling (no)"
+  --enable-local         enable AF_LOCAL (AF_UNIX) socket support (auto)"
 ac_help="$ac_help
-  --enable-dmalloc     enable debug malloc support (no)"
+  --enable-x-compile     enable cross compiling (no)"
 ac_help="$ac_help
-  --with-cyrus-sasl  with Cyrus SASL support (auto)"
+  --with-cyrus-sasl      with Cyrus SASL support (auto)"
 ac_help="$ac_help
-  --with-fetch  with fetch URL support (auto)"
+  --with-fetch           with fetch URL support (auto)"
 ac_help="$ac_help
-  --with-kerberos      with Kerberos support (auto)"
+  --with-kerberos        with support (auto)"
 ac_help="$ac_help
-  --with-readline  with readline support (auto)"
+  --with-readline        with readline support (auto)"
 ac_help="$ac_help
-  --with-threads       use threads (auto)"
+  --with-threads         with threads (auto)"
 ac_help="$ac_help
-  --with-tls  with TLS/SSL support (auto)"
+  --with-tls             with TLS/SSL support (auto)"
 ac_help="$ac_help
-  --with-yielding-select       with implicitly yielding select (auto)"
+  --with-yielding-select  with implicitly yielding select (auto)"
 ac_help="$ac_help
-SLAPD Options:"
+SLAPD (Standalone LDAP Daemon) Options:"
 ac_help="$ac_help
-  --enable-slapd       enable building slapd (yes)"
+  --enable-slapd         enable building slapd (yes)"
 ac_help="$ac_help
-    --enable-cleartext enable cleartext passwords (yes)"
+    --enable-cleartext   enable cleartext passwords (yes)"
 ac_help="$ac_help
-    --enable-crypt     enable crypt(3) passwords (auto)"
+    --enable-crypt       enable crypt(3) passwords (auto)"
 ac_help="$ac_help
-    --enable-modules   enable dynamic module support (no)"
+    --enable-kpasswd     enable kerberos password verification (no)"
 ac_help="$ac_help
-    --enable-multimaster       enable multimaster replication (no)"
+    --enable-spasswd     enable (Cyrus) SASL password verification (no)"
 ac_help="$ac_help
-    --enable-phonetic  enable phonetic/soundex (no)"
+    --enable-modules     enable dynamic module support (no)"
 ac_help="$ac_help
-    --enable-quipu     build quipu migration tools (no)"
+    --enable-multimaster  enable multimaster replication (no)"
 ac_help="$ac_help
-    --enable-rlookups  enable reverse lookups (auto)"
+    --enable-phonetic    enable phonetic/soundex (no)"
 ac_help="$ac_help
-    --enable-wrappers  enable tcp wrapper support (no)"
+    --enable-rlookups    enable reverse lookups (auto)"
 ac_help="$ac_help
-    --enable-bdb2      enable bdb2 backend (no)"
+    --enable-aci         enable per-object ACIs (no)"
 ac_help="$ac_help
-      --with-bdb2-module       module type (static)"
+    --enable-wrappers    enable tcp wrapper support (no)"
 ac_help="$ac_help
-    --enable-ldap      enable ldap backend (no)"
+    --enable-dynamic     enable linking built binaries with dynamic libs (no)"
 ac_help="$ac_help
-      --with-ldap-module       module type (static)"
+    --enable-dnssrv      enable dnssrv backend (no)"
 ac_help="$ac_help
-    --enable-ldbm      enable ldbm backend (yes)"
+    --with-dnssrv-module  module type (static)"
 ac_help="$ac_help
-      --with-ldbm-module       module type (static)"
+    --enable-ldap        enable ldap backend (no)"
 ac_help="$ac_help
-      --with-ldbm-api  use LDBM API (auto)"
+    --with-ldap-module   module type (static)"
 ac_help="$ac_help
-      --with-ldbm-type use LDBM type (auto)"
+    --enable-ldbm        enable ldbm backend (yes)"
 ac_help="$ac_help
-    --enable-passwd    enable passwd backend (no)"
+    --with-ldbm-api       with LDBM API (auto)"
 ac_help="$ac_help
-      --with-passwd-module     module type (static)"
+    --with-ldbm-module   module type (static)"
 ac_help="$ac_help
-    --enable-perl      enable perl backend (no)"
+    --with-ldbm-type     use LDBM type (auto)"
 ac_help="$ac_help
-      --with-perl-module       module type (static)"
+    --enable-passwd      enable passwd backend (no)"
 ac_help="$ac_help
-    --enable-shell     enable shell backend (no)"
+    --with-passwd-module  module type (static)"
 ac_help="$ac_help
-      --with-shell-module      module type (static)"
+    --enable-shell       enable shell backend (no)"
 ac_help="$ac_help
-    --enable-tcl       enable tcl backend (no)"
+    --with-shell-module          module type (static)"
 ac_help="$ac_help
-      --with-tcl-module        module type (static)"
+    --enable-sql         enable sql backend (no)"
 ac_help="$ac_help
-SLURPD Options:"
+    --with-sql-module    module type (static)"
 ac_help="$ac_help
-  --enable-slurpd      enable building slurpd (auto)"
+SLURPD (Replication Daemon) Options:"
+ac_help="$ac_help
+  --enable-slurpd        enable building slurpd (auto)"
 ac_help="$ac_help
 Library Generation & Linking Options"
 ac_help="$ac_help
@@ -616,6 +630,16 @@ else
   ac_n= ac_c='\c' ac_t=
 fi
 
+
+# set unset (borrowed from autoconf 2.14a)
+if (unset FOO) >/dev/null 2>&1; then
+  ol_unset=unset
+else
+  ol_unset=false
+fi
+# unset CDPATH
+$ol_unset CDPATH || test "${CDPATH+set}" != set || CDPATH=: && export CDPATH
+
 ac_aux_dir=
 for ac_dir in build $srcdir/build; do
   if test -f $ac_dir/install-sh; then
@@ -626,6 +650,10 @@ for ac_dir in build $srcdir/build; do
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
   fi
 done
 if test -z "$ac_aux_dir"; then
@@ -640,9 +668,11 @@ if test -z "$OL_VERSION"; then
        { echo "configure: error: could not determine version" 1>&2; exit 1; }
 fi
 
+echo "Configuring OpenLDAP $OL_VERSION ..."
+
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:646: checking host system type" >&5
+echo "configure:676: checking host system type" >&5
 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
 
 # Make sure we can run config.sub.
@@ -683,7 +713,7 @@ host_os=$ac_cv_host_os
 
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:687: checking target system type" >&5
+echo "configure:717: checking target system type" >&5
 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
 
 # Make sure we can run config.sub.
@@ -723,7 +753,7 @@ target_os=$ac_cv_target_os
 
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:727: checking build system type" >&5
+echo "configure:757: checking build system type" >&5
 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
 
 # Make sure we can run config.sub.
@@ -800,7 +830,7 @@ test "$host_alias" != "$target_alias" &&
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:804: checking for a BSD compatible install" >&5
+echo "configure:834: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -857,7 +887,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:861: checking whether build environment is sane" >&5
+echo "configure:891: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -918,7 +948,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:922: checking for $ac_word" >&5
+echo "configure:952: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -948,7 +978,7 @@ test -n "$AWK" && break
 done
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:952: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:982: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -988,7 +1018,7 @@ fi
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:992: checking for working aclocal" >&5
+echo "configure:1022: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1001,7 +1031,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1005: checking for working autoconf" >&5
+echo "configure:1035: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1014,7 +1044,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1018: checking for working automake" >&5
+echo "configure:1048: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1027,7 +1057,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1031: checking for working autoheader" >&5
+echo "configure:1061: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1040,7 +1070,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1044: checking for working makeinfo" >&5
+echo "configure:1074: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1060,7 +1090,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1064: checking for $ac_word" >&5
+echo "configure:1094: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1111,7 +1141,7 @@ EOF
 
 
 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
-echo "configure:1115: checking configure arguments" >&5
+echo "configure:1145: checking configure arguments" >&5
 
 
 top_builddir=`pwd`
@@ -1217,10 +1247,10 @@ else
        ol_enable_cache="yes"
 fi
 # end --enable-cache
-# OpenLDAP --enable-dns
-       # Check whether --enable-dns or --disable-dns was given.
-if test "${enable_dns+set}" = set; then
-  enableval="$enable_dns"
+# OpenLDAP --enable-referrals
+       # Check whether --enable-referrals or --disable-referrals was given.
+if test "${enable_referrals+set}" = set; then
+  enableval="$enable_referrals"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1229,18 +1259,18 @@ if test "${enable_dns+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
        fi
-       ol_enable_dns="$ol_arg"
+       ol_enable_referrals="$ol_arg"
 
 else
-       ol_enable_dns="no"
+       ol_enable_referrals="yes"
 fi
-# end --enable-dns
-# OpenLDAP --enable-referrals
-       # Check whether --enable-referrals or --disable-referrals was given.
-if test "${enable_referrals+set}" = set; then
-  enableval="$enable_referrals"
+# end --enable-referrals
+# OpenLDAP --enable-kbind
+       # Check whether --enable-kbind or --disable-kbind was given.
+if test "${enable_kbind+set}" = set; then
+  enableval="$enable_kbind"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1249,18 +1279,18 @@ if test "${enable_referrals+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
        fi
-       ol_enable_referrals="$ol_arg"
+       ol_enable_kbind="$ol_arg"
 
 else
-       ol_enable_referrals="yes"
+       ol_enable_kbind="auto"
 fi
-# end --enable-referrals
-# OpenLDAP --enable-cldap
-       # Check whether --enable-cldap or --disable-cldap was given.
-if test "${enable_cldap+set}" = set; then
-  enableval="$enable_cldap"
+# end --enable-kbind
+# OpenLDAP --enable-ipv6
+       # Check whether --enable-ipv6 or --disable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then
+  enableval="$enable_ipv6"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1269,55 +1299,55 @@ if test "${enable_cldap+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
        fi
-       ol_enable_cldap="$ol_arg"
+       ol_enable_ipv6="$ol_arg"
 
 else
-       ol_enable_cldap="no"
+       ol_enable_ipv6="auto"
 fi
-# end --enable-cldap
-# OpenLDAP --enable-x_compile
-       # Check whether --enable-x_compile or --disable-x_compile was given.
-if test "${enable_x_compile+set}" = set; then
-  enableval="$enable_x_compile"
+# end --enable-ipv6
+# OpenLDAP --enable-local
+       # Check whether --enable-local or --disable-local was given.
+if test "${enable_local+set}" = set; then
+  enableval="$enable_local"
   
        ol_arg=invalid
-       for ol_val in yes no ; do
+       for ol_val in auto yes no ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
        fi
-       ol_enable_x_compile="$ol_arg"
+       ol_enable_local="$ol_arg"
 
 else
-       ol_enable_x_compile="no"
+       ol_enable_local="auto"
 fi
-# end --enable-x_compile
-
-# OpenLDAP --enable-dmalloc
-       # Check whether --enable-dmalloc or --disable-dmalloc was given.
-if test "${enable_dmalloc+set}" = set; then
-  enableval="$enable_dmalloc"
+# end --enable-local
+# OpenLDAP --enable-x_compile
+       # Check whether --enable-x_compile or --disable-x_compile was given.
+if test "${enable_x_compile+set}" = set; then
+  enableval="$enable_x_compile"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in yes no ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
        fi
-       ol_enable_dmalloc="$ol_arg"
+       ol_enable_x_compile="$ol_arg"
 
 else
-       ol_enable_dmalloc="no"
+       ol_enable_x_compile="no"
 fi
-# end --enable-dmalloc
+# end --enable-x_compile
+
 
 # OpenLDAP --with-cyrus_sasl
        # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
@@ -1367,7 +1397,7 @@ if test "${with_kerberos+set}" = set; then
   withval="$with_kerberos"
   
        ol_arg=invalid
-       for ol_val in auto k5 k4 afs yes no ; do
+       for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
                if test "$withval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -1409,7 +1439,7 @@ if test "${with_threads+set}" = set; then
   withval="$with_threads"
   
        ol_arg=invalid
-       for ol_val in auto posix mach lwp yes no manual  ; do
+       for ol_val in auto nt posix mach pth lwp yes no manual  ; do
                if test "$withval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -1534,6 +1564,46 @@ else
        ol_enable_crypt="auto"
 fi
 # end --enable-crypt
+# OpenLDAP --enable-kpasswd
+       # Check whether --enable-kpasswd or --disable-kpasswd was given.
+if test "${enable_kpasswd+set}" = set; then
+  enableval="$enable_kpasswd"
+  
+       ol_arg=invalid
+       for ol_val in auto yes no ; do
+               if test "$enableval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
+       fi
+       ol_enable_kpasswd="$ol_arg"
+
+else
+       ol_enable_kpasswd="no"
+fi
+# end --enable-kpasswd
+# OpenLDAP --enable-spasswd
+       # Check whether --enable-spasswd or --disable-spasswd was given.
+if test "${enable_spasswd+set}" = set; then
+  enableval="$enable_spasswd"
+  
+       ol_arg=invalid
+       for ol_val in auto yes no ; do
+               if test "$enableval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
+       fi
+       ol_enable_spasswd="$ol_arg"
+
+else
+       ol_enable_spasswd="no"
+fi
+# end --enable-spasswd
 # OpenLDAP --enable-modules
        # Check whether --enable-modules or --disable-modules was given.
 if test "${enable_modules+set}" = set; then
@@ -1594,10 +1664,10 @@ else
        ol_enable_phonetic="no"
 fi
 # end --enable-phonetic
-# OpenLDAP --enable-quipu
-       # Check whether --enable-quipu or --disable-quipu was given.
-if test "${enable_quipu+set}" = set; then
-  enableval="$enable_quipu"
+# OpenLDAP --enable-rlookups
+       # Check whether --enable-rlookups or --disable-rlookups was given.
+if test "${enable_rlookups+set}" = set; then
+  enableval="$enable_rlookups"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1606,18 +1676,18 @@ if test "${enable_quipu+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-quipu" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
        fi
-       ol_enable_quipu="$ol_arg"
+       ol_enable_rlookups="$ol_arg"
 
 else
-       ol_enable_quipu="no"
+       ol_enable_rlookups="auto"
 fi
-# end --enable-quipu
-# OpenLDAP --enable-rlookups
-       # Check whether --enable-rlookups or --disable-rlookups was given.
-if test "${enable_rlookups+set}" = set; then
-  enableval="$enable_rlookups"
+# end --enable-rlookups
+# OpenLDAP --enable-aci
+       # Check whether --enable-aci or --disable-aci was given.
+if test "${enable_aci+set}" = set; then
+  enableval="$enable_aci"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1626,14 +1696,14 @@ if test "${enable_rlookups+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
        fi
-       ol_enable_rlookups="$ol_arg"
+       ol_enable_aci="$ol_arg"
 
 else
-       ol_enable_rlookups="auto"
+       ol_enable_aci="no"
 fi
-# end --enable-rlookups
+# end --enable-aci
 # OpenLDAP --enable-wrappers
        # Check whether --enable-wrappers or --disable-wrappers was given.
 if test "${enable_wrappers+set}" = set; then
@@ -1654,11 +1724,31 @@ else
        ol_enable_wrappers="no"
 fi
 # end --enable-wrappers
+# OpenLDAP --enable-dynamic
+       # Check whether --enable-dynamic or --disable-dynamic was given.
+if test "${enable_dynamic+set}" = set; then
+  enableval="$enable_dynamic"
+  
+       ol_arg=invalid
+       for ol_val in auto yes no ; do
+               if test "$enableval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
+       fi
+       ol_enable_dynamic="$ol_arg"
+
+else
+       ol_enable_dynamic="no"
+fi
+# end --enable-dynamic
 
-# OpenLDAP --enable-bdb2
-       # Check whether --enable-bdb2 or --disable-bdb2 was given.
-if test "${enable_bdb2+set}" = set; then
-  enableval="$enable_bdb2"
+# OpenLDAP --enable-dnssrv
+       # Check whether --enable-dnssrv or --disable-dnssrv was given.
+if test "${enable_dnssrv+set}" = set; then
+  enableval="$enable_dnssrv"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1667,18 +1757,18 @@ if test "${enable_bdb2+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
        fi
-       ol_enable_bdb2="$ol_arg"
+       ol_enable_dnssrv="$ol_arg"
 
 else
-       ol_enable_bdb2="no"
+       ol_enable_dnssrv="no"
 fi
-# end --enable-bdb2
-# OpenLDAP --with-bdb2_module
-       # Check whether --with-bdb2_module or --without-bdb2_module was given.
-if test "${with_bdb2_module+set}" = set; then
-  withval="$with_bdb2_module"
+# end --enable-dnssrv
+# OpenLDAP --with-dnssrv_module
+       # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
+if test "${with_dnssrv_module+set}" = set; then
+  withval="$with_dnssrv_module"
   
        ol_arg=invalid
        for ol_val in static dynamic ; do
@@ -1687,14 +1777,14 @@ if test "${with_bdb2_module+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
+               { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
        fi
-       ol_with_bdb2_module="$ol_arg"
+       ol_with_dnssrv_module="$ol_arg"
 
 else
-       ol_with_bdb2_module="static"
+       ol_with_dnssrv_module="static"
 fi
-# end --with-bdb2_module
+# end --with-dnssrv_module
 
 # OpenLDAP --enable-ldap
        # Check whether --enable-ldap or --disable-ldap was given.
@@ -1757,47 +1847,47 @@ else
        ol_enable_ldbm="yes"
 fi
 # end --enable-ldbm
-# OpenLDAP --with-ldbm_module
-       # Check whether --with-ldbm_module or --without-ldbm_module was given.
-if test "${with_ldbm_module+set}" = set; then
-  withval="$with_ldbm_module"
+# OpenLDAP --with-ldbm_api
+       # Check whether --with-ldbm_api or --without-ldbm_api was given.
+if test "${with_ldbm_api+set}" = set; then
+  withval="$with_ldbm_api"
   
        ol_arg=invalid
-       for ol_val in static dynamic ; do
+       for ol_val in auto berkeley bcompat mdbm gdbm ; do
                if test "$withval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
+               { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
        fi
-       ol_with_ldbm_module="$ol_arg"
+       ol_with_ldbm_api="$ol_arg"
 
 else
-       ol_with_ldbm_module="static"
+       ol_with_ldbm_api="auto"
 fi
-# end --with-ldbm_module
+# end --with-ldbm_api
 
-# OpenLDAP --with-ldbm_api
-       # Check whether --with-ldbm_api or --without-ldbm_api was given.
-if test "${with_ldbm_api+set}" = set; then
-  withval="$with_ldbm_api"
+# OpenLDAP --with-ldbm_module
+       # Check whether --with-ldbm_module or --without-ldbm_module was given.
+if test "${with_ldbm_module+set}" = set; then
+  withval="$with_ldbm_module"
   
        ol_arg=invalid
-       for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
+       for ol_val in static dynamic ; do
                if test "$withval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
+               { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
        fi
-       ol_with_ldbm_api="$ol_arg"
+       ol_with_ldbm_module="$ol_arg"
 
 else
-       ol_with_ldbm_api="auto"
+       ol_with_ldbm_module="static"
 fi
-# end --with-ldbm_api
+# end --with-ldbm_module
 
 # OpenLDAP --with-ldbm_type
        # Check whether --with-ldbm_type or --without-ldbm_type was given.
@@ -1820,7 +1910,6 @@ else
 fi
 # end --with-ldbm_type
 
-
 # OpenLDAP --enable-passwd
        # Check whether --enable-passwd or --disable-passwd was given.
 if test "${enable_passwd+set}" = set; then
@@ -1862,47 +1951,6 @@ else
 fi
 # end --with-passwd_module
 
-# OpenLDAP --enable-perl
-       # Check whether --enable-perl or --disable-perl was given.
-if test "${enable_perl+set}" = set; then
-  enableval="$enable_perl"
-  
-       ol_arg=invalid
-       for ol_val in auto yes no ; do
-               if test "$enableval" = "$ol_val" ; then
-                       ol_arg="$ol_val"
-               fi
-       done
-       if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
-       fi
-       ol_enable_perl="$ol_arg"
-
-else
-       ol_enable_perl="no"
-fi
-# end --enable-perl
-# OpenLDAP --with-perl_module
-       # Check whether --with-perl_module or --without-perl_module was given.
-if test "${with_perl_module+set}" = set; then
-  withval="$with_perl_module"
-  
-       ol_arg=invalid
-       for ol_val in static dynamic ; do
-               if test "$withval" = "$ol_val" ; then
-                       ol_arg="$ol_val"
-               fi
-       done
-       if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
-       fi
-       ol_with_perl_module="$ol_arg"
-
-else
-       ol_with_perl_module="static"
-fi
-# end --with-perl_module
-
 # OpenLDAP --enable-shell
        # Check whether --enable-shell or --disable-shell was given.
 if test "${enable_shell+set}" = set; then
@@ -1944,10 +1992,10 @@ else
 fi
 # end --with-shell_module
 
-# OpenLDAP --enable-tcl
-       # Check whether --enable-tcl or --disable-tcl was given.
-if test "${enable_tcl+set}" = set; then
-  enableval="$enable_tcl"
+# OpenLDAP --enable-sql
+       # Check whether --enable-sql or --disable-sql was given.
+if test "${enable_sql+set}" = set; then
+  enableval="$enable_sql"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1956,18 +2004,18 @@ if test "${enable_tcl+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
        fi
-       ol_enable_tcl="$ol_arg"
+       ol_enable_sql="$ol_arg"
 
 else
-       ol_enable_tcl="no"
+       ol_enable_sql="no"
 fi
-# end --enable-tcl
-# OpenLDAP --with-tcl_module
-       # Check whether --with-tcl_module or --without-tcl_module was given.
-if test "${with_tcl_module+set}" = set; then
-  withval="$with_tcl_module"
+# end --enable-sql
+# OpenLDAP --with-sql_module
+       # Check whether --with-sql_module or --without-sql_module was given.
+if test "${with_sql_module+set}" = set; then
+  withval="$with_sql_module"
   
        ol_arg=invalid
        for ol_val in static dynamic ; do
@@ -1976,14 +2024,14 @@ if test "${with_tcl_module+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
+               { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
        fi
-       ol_with_tcl_module="$ol_arg"
+       ol_with_sql_module="$ol_arg"
 
 else
-       ol_with_tcl_module="static"
+       ol_with_sql_module="static"
 fi
-# end --with-tcl_module
+# end --with-sql_module
 
 
 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
@@ -2066,20 +2114,11 @@ else
 fi
 
 
-# validate options
-if test $ol_enable_dns = yes ; then
-       if test $ol_enable_referrals = no ; then
-               { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
-       fi
-       if test $ol_enable_referrals = auto ; then
-               echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
-               ol_enable_referrals=yes
-       fi
-fi
 
+# validate options
 if test $ol_enable_slapd = no ; then
-               if test $ol_enable_bdb2 = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
+               if test $ol_enable_dnssrv = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
        fi
        if test $ol_enable_ldap = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
@@ -2090,14 +2129,11 @@ if test $ol_enable_slapd = no ; then
        if test $ol_enable_passwd = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
        fi
-       if test $ol_enable_perl = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
-       fi
        if test $ol_enable_shell = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
        fi
-       if test $ol_enable_tcl = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
+       if test $ol_enable_sql = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
        fi
        if test $ol_enable_modules = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
@@ -2111,20 +2147,20 @@ if test $ol_enable_slapd = no ; then
        if test $ol_enable_phonetic = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
        fi
-       if test $ol_enable_quipu = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
-       fi
        if test $ol_enable_rlookups = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
        fi
+       if test $ol_enable_aci = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
+       fi
        if test $ol_with_ldbm_api != auto ; then
                echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
        fi
        if test $ol_with_ldbm_type != auto ; then
                echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
        fi
-       if test $ol_with_bdb2_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
+       if test $ol_with_dnssrv_module != static ; then
+               echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
        fi
        if test $ol_with_ldap_module != static ; then
                echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
@@ -2135,45 +2171,41 @@ if test $ol_enable_slapd = no ; then
        if test $ol_with_passwd_module != static ; then
                echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
        fi
-       if test $ol_with_perl_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
-       fi
        if test $ol_with_shell_module != static ; then
                echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
        fi
-       if test $ol_with_tcl_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
+       if test $ol_with_sql_module != static ; then
+               echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
        fi
        if test $ol_enable_slurpd = yes ; then
                { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
        fi
 
        # force settings to no
-       ol_enable_bdb2=no
+       ol_enable_dnssrv=no
        ol_enable_ldap=no
        ol_enable_ldbm=no
        ol_enable_passwd=no
-       ol_enable_perl=no
        ol_enable_shell=no
-       ol_enable_tcl=no
+       ol_enable_sql=no
 
        ol_enable_modules=no
        ol_enable_multimaster=no
        ol_enable_phonetic=no
-       ol_enable_quipu=no
        ol_enable_rlookups=no
+       ol_enable_aci=no
        ol_enable_wrappers=no
+       ol_enable_dynamic=no
 
        ol_with_ldbm_api=no
        ol_with_ldbm_type=no
 
-       ol_with_bdb2_module=static
+       ol_with_dnssrv_module=static
        ol_with_ldap_module=static
        ol_with_ldbm_module=static
        ol_with_passwd_module=static
-       ol_with_perl_module=static
        ol_with_shell_module=static
-       ol_with_tcl_module=static
+       ol_with_sql_module=static
 
        ol_enable_slurpd=no
 
@@ -2191,16 +2223,12 @@ elif test $ol_enable_ldbm = no ; then
                echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
        fi
 
-       if test $ol_enable_bdb2 = yes ; then
-               { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
-       fi
-
        if test $ol_enable_modules != yes -a \
+               $ol_enable_dnssrv = no -a \
                $ol_enable_ldap = no -a \
                $ol_enable_passwd = no -a \
-               $ol_enable_perl = no -a \
                $ol_enable_shell = no -a \
-               $ol_enable_tcl = no ; then
+               $ol_enable_sql = no ; then
                { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
        fi
 
@@ -2208,26 +2236,8 @@ elif test $ol_enable_ldbm = no ; then
        ol_with_ldbm_type=no
        ol_with_ldbm_module=static
 
-elif test $ol_enable_bdb2 = yes ; then
-       
-       if test $ol_with_ldbm_api != auto -a \
-               $ol_with_ldbm_api != db2 ; then
-               { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
-       fi
-
-       ol_with_ldbm_api=db2
-
 else
-       
-       if test $ol_enable_bdb2 != no ; then
-               if test $ol_with_ldbm_api != auto -a \
-                       $ol_with_ldbm_api != db2 ; then
-                       echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
-                       ol_enable_bdb2=no
-               fi
-       fi
-
-       if test $ol_with_ldbm_api = gdbm -a \
+               if test $ol_with_ldbm_api = gdbm -a \
                $ol_with_ldbm_type = btree ; then
                { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
        fi
@@ -2247,9 +2257,27 @@ if test $ol_enable_slurpd = yes ; then
        fi
 fi
 
+if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
+       if test $ol_with_kerberos = no ; then
+               { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
+       fi
+elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
+       if test $ol_with_kerberos != auto ; then
+               echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
+       else
+               ol_with_kerberos=no
+       fi
+fi
+
+if test $ol_enable_spasswd = yes ; then
+       if test $ol_with_cyrus_sasl = no ; then
+               { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
+       fi
+       ol_link_spasswd=yes
+fi
+
 echo "$ac_t""done" 1>&6
 
-## Initialize vars
 LDAP_LIBS=
 LDIF_LIBS=
 LDBM_LIBS=
@@ -2262,37 +2290,38 @@ SLURPD_LIBS=
 BUILD_SLAPD=no
 BUILD_SLURPD=no
 
-BUILD_BDB2=no
+BUILD_THREAD=no
+
+BUILD_DNSSRV=no
 BUILD_LDAP=no
 BUILD_LDBM=no
 BUILD_PASSWD=no
-BUILD_PERL=no
-BUILD_QUIPU=no
 BUILD_SHELL=no
-BUILD_TCL=no
-BUILD_THREAD=no
+BUILD_SQL=no
 
-BUILD_BDB2_DYNAMIC=static
+BUILD_DNSSRV_DYNAMIC=static
 BUILD_LDAP_DYNAMIC=static
 BUILD_LDBM_DYNAMIC=static
 BUILD_PASSWD_DYNAMIC=static
-BUILD_PERL_DYNAMIC=static
 BUILD_SHELL_DYNAMIC=static
-BUILD_TCL_DYNAMIC=static
+BUILD_SQL_DYNAMIC=static
 
 SLAPD_MODULES_LDFLAGS=
 SLAPD_MODULES_CPPFLAGS=
 SLAPD_MODULES_LIST=
 
-SLAPD_PERL_LDFLAGS=
-SLAPD_PERL_CPPFLAGS=
+SLAPD_SQL_LDFLAGS=
+SLAPD_SQL_LIBS=
+SLAPD_SQL_INCLUDES=
 
-KRB_LIBS=
+KRB4_LIBS=
+KRB5_LIBS=
 READLINE_LIBS=
 SASL_LIBS=
 TERMCAP_LIBS=
 TLS_LIBS=
 MODULES_LIBS=
+AUTH_LIBS=
 
 
 
@@ -2303,7 +2332,6 @@ EOF
 
 
 
-
 ol_aix_threads=no
 case "$target" in
 *-*-aix*)      if test -z "$CC" ; then
@@ -2321,7 +2349,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2325: checking for $ac_word" >&5
+echo "configure:2353: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2373,7 +2401,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2377: checking for $ac_word" >&5
+echo "configure:2405: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2406,6 +2434,7 @@ fi
 
 
 
+
 # Check whether --enable-fast-install or --disable-fast-install was given.
 if test "${enable_fast_install+set}" = set; then
   enableval="$enable_fast_install"
@@ -2432,7 +2461,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2436: checking for $ac_word" >&5
+echo "configure:2465: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2462,7 +2491,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2466: checking for $ac_word" >&5
+echo "configure:2495: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2492,7 +2521,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2496: checking for $ac_word" >&5
+echo "configure:2525: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2543,7 +2572,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2547: checking for $ac_word" >&5
+echo "configure:2576: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2575,7 +2604,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2579: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+echo "configure:2608: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2586,12 +2615,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2590 "configure"
+#line 2619 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2617,12 +2646,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2621: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2650: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2626: checking whether we are using GNU C" >&5
+echo "configure:2655: checking whether we are using GNU C" >&5
 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2631,7 +2660,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2650,7 +2679,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2654: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2683: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2693,7 +2722,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:2697: checking for ld used by GCC" >&5
+echo "configure:2726: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -2717,10 +2746,10 @@ echo "configure:2697: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:2721: checking for GNU ld" >&5
+echo "configure:2750: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:2724: checking for non-GNU ld" >&5
+echo "configure:2753: checking for non-GNU ld" >&5
 fi
 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2754,9 +2783,8 @@ else
   echo "$ac_t""no" 1>&6
 fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
-
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:2760: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:2788: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2772,7 +2800,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:2776: checking for BSD-compatible nm" >&5
+echo "configure:2804: checking for BSD-compatible nm" >&5
 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2807,9 +2835,8 @@ fi
 NM="$ac_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
-
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2813: checking whether ln -s works" >&5
+echo "configure:2840: checking whether ln -s works" >&5
 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2829,6 +2856,17 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+
+case "$target" in
+NONE) lt_target="$host" ;;
+*) lt_target="$target" ;;
+esac
 
 # Check for any special flags to pass to ltconfig.
 libtool_flags="--cache-file=$cache_file"
@@ -2838,7 +2876,7 @@ test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast
 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 libtool_flags="$libtool_flags --enable-dlopen"
-
+libtool_flags="$libtool_flags --enable-win32-dll"
 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then
   enableval="$enable_libtool_lock"
@@ -2850,11 +2888,11 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
-case "$host" in
+case "$lt_target" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2857 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2895 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -2875,19 +2913,19 @@ case "$host" in
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2879: checking whether the C compiler needs -belf" >&5
+echo "configure:2917: checking whether the C compiler needs -belf" >&5
 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2884 "configure"
+#line 2922 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -2906,86 +2944,289 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
   fi
   ;;
 
-
-esac
-
-
-# Save cache, so that ltconfig can load it
-
-
-# Actually configure libtool.  ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
-|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
-
-# Reload cache, that may have been modified by ltconfig
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
-
-
-for ac_prog in mawk gawk nawk awk
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+*-*-cygwin* | *-*-mingw*)
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2945: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
+echo "configure:2952: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
 else
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_AWK="$ac_prog"
+      ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-AWK="$ac_cv_prog_AWK"
-if test -n "$AWK"; then
-  echo "$ac_t""$AWK" 1>&6
+DLLTOOL="$ac_cv_prog_DLLTOOL"
+if test -n "$DLLTOOL"; then
+  echo "$ac_t""$DLLTOOL" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
-test -n "$AWK" && break
-done
 
-# test for ln hardlink support
-echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:2976: checking whether ln works" >&5
-if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
+if test -z "$ac_cv_prog_DLLTOOL"; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2984: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  rm -f conftest.src conftest.dst
-echo "conftest" > conftest.src
-if ln conftest.src conftest.dst 2>/dev/null
-then
-  ol_cv_prog_LN_H="ln"
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
 else
-  ol_cv_prog_LN_H="cp"
-fi
-rm -f conftest.src conftest.dst
-
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_DLLTOOL="dlltool"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
+fi
+fi
+DLLTOOL="$ac_cv_prog_DLLTOOL"
+if test -n "$DLLTOOL"; then
+  echo "$ac_t""$DLLTOOL" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+  DLLTOOL="false"
+fi
+fi
+
+  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3019: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AS="${ac_tool_prefix}as"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+AS="$ac_cv_prog_AS"
+if test -n "$AS"; then
+  echo "$ac_t""$AS" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_AS"; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3051: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AS="as"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
+fi
+fi
+AS="$ac_cv_prog_AS"
+if test -n "$AS"; then
+  echo "$ac_t""$AS" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+  AS="false"
+fi
+fi
+
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3086: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+OBJDUMP="$ac_cv_prog_OBJDUMP"
+if test -n "$OBJDUMP"; then
+  echo "$ac_t""$OBJDUMP" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_OBJDUMP"; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3118: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_OBJDUMP="objdump"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
+fi
+fi
+OBJDUMP="$ac_cv_prog_OBJDUMP"
+if test -n "$OBJDUMP"; then
+  echo "$ac_t""$OBJDUMP" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+  OBJDUMP="false"
+fi
+fi
+
+  ;;
+
+esac
+
+
+# Save cache, so that ltconfig can load it
+
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+# Reload cache, that may have been modified by ltconfig
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+for ac_prog in mawk gawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3186: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AWK="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+  echo "$ac_t""$AWK" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
+# test for ln hardlink support
+echo $ac_n "checking whether ln works""... $ac_c" 1>&6
+echo "configure:3217: checking whether ln works" >&5
+if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftest.src conftest.dst
+echo "conftest" > conftest.src
+if ln conftest.src conftest.dst 2>/dev/null
+then
+  ol_cv_prog_LN_H="ln"
+else
+  ol_cv_prog_LN_H="cp"
+fi
+rm -f conftest.src conftest.dst
+
 fi
 LN_H="$ol_cv_prog_LN_H"
 if test "$ol_cv_prog_LN_H" = "ln"; then
@@ -2995,7 +3236,7 @@ else
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2999: checking whether ln -s works" >&5
+echo "configure:3240: checking whether ln -s works" >&5
 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3023,7 +3264,7 @@ fi
 # Extract the first word of "sendmail", so it can be a program name with args.
 set dummy sendmail; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3027: checking for $ac_word" >&5
+echo "configure:3268: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3031,7 +3272,7 @@ else
   /*)
   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
   ;;
-  ?:/*)                         
+  ?:/*)
   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
   ;;
   *)
@@ -3059,7 +3300,7 @@ fi
 # Extract the first word of "vi", so it can be a program name with args.
 set dummy vi; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3063: checking for $ac_word" >&5
+echo "configure:3304: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3067,7 +3308,7 @@ else
   /*)
   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
   ;;
-  ?:/*)                         
+  ?:/*)
   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
   ;;
   *)
@@ -3095,7 +3336,7 @@ fi
 # Extract the first word of "finger", so it can be a program name with args.
 set dummy finger; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3099: checking for $ac_word" >&5
+echo "configure:3340: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3103,7 +3344,7 @@ else
   /*)
   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
   ;;
-  ?:/*)                         
+  ?:/*)
   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
   ;;
   *)
@@ -3129,60 +3370,8 @@ else
 fi
 
 
-ol_link_perl=no
-if test $ol_enable_perl != no ; then
-       # Extract the first word of "perl", so it can be a program name with args.
-set dummy perl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3138: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$PERLBIN" in
-  /*)
-  ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
-  ;;
-  ?:/*)                         
-  ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_PERLBIN="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
-  ;;
-esac
-fi
-PERLBIN="$ac_cv_path_PERLBIN"
-if test -n "$PERLBIN"; then
-  echo "$ac_t""$PERLBIN" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-       if test "no$PERLBIN" = "no" ; then
-               if test $ol_enable_perl = yes ; then
-                       { echo "configure: error: could not locate perl" 1>&2; exit 1; }
-               fi
-
-       else
-               SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
-               SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
-
-                               ol_link_perl=yes
-       fi
-fi
-
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3186: checking how to run the C preprocessor" >&5
+echo "configure:3375: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3197,13 +3386,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 3201 "configure"
+#line 3390 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3214,13 +3403,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 3218 "configure"
+#line 3407 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3231,13 +3420,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 3235 "configure"
+#line 3424 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3275,9 +3464,9 @@ elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
 fi
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:3279: checking for AIX" >&5
+echo "configure:3468: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3281 "configure"
+#line 3470 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -3299,7 +3488,7 @@ rm -f conftest*
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:3303: checking for POSIXized ISC" >&5
+echo "configure:3492: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -3321,17 +3510,17 @@ fi
 
 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:3325: checking for minix/config.h" >&5
+echo "configure:3514: checking for minix/config.h" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3330 "configure"
+#line 3519 "configure"
 #include "confdefs.h"
 #include <minix/config.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3370,12 +3559,12 @@ fi
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3374: checking for Cygwin environment" >&5
+echo "configure:3563: checking for Cygwin environment" >&5
 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3379 "configure"
+#line 3568 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3386,7 +3575,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -3402,19 +3591,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:3406: checking for mingw32 environment" >&5
+echo "configure:3595: checking for mingw32 environment" >&5
 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3411 "configure"
+#line 3600 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3430,19 +3619,19 @@ echo "$ac_t""$ac_cv_mingw32" 1>&6
 MINGW32=
 test "$ac_cv_mingw32" = yes && MINGW32=yes
 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
-echo "configure:3434: checking for EMX OS/2 environment" >&5
+echo "configure:3623: checking for EMX OS/2 environment" >&5
 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3439 "configure"
+#line 3628 "configure"
 #include "confdefs.h"
 
 int main() {
 return __EMX__;
 ; return 0; }
 EOF
-if { (eval echo configure:3446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_emxos2=yes
 else
@@ -3461,7 +3650,7 @@ test "$ac_cv_emxos2" = yes && EMXOS2=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3465: checking for executable suffix" >&5
+echo "configure:3654: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3471,7 +3660,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -3492,13 +3681,13 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6
 ac_exeext=$EXEEXT
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:3496: checking for object suffix" >&5
+echo "configure:3685: checking for object suffix" >&5
 if eval "test \"\${ac_cv_objext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:3502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -3522,7 +3711,7 @@ EOF
 
 
 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
-echo "configure:3526: checking for be_app in -lbe" >&5
+echo "configure:3715: checking for be_app in -lbe" >&5
 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3530,7 +3719,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbe -lroot -lnet $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3534 "configure"
+#line 3723 "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
@@ -3541,7 +3730,7 @@ int main() {
 be_app()
 ; return 0; }
 EOF
-if { (eval echo configure:3545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3567,7 +3756,7 @@ fi
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:3571: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:3760: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3584,7 +3773,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
 do
   CC="$ac_save_CC $ac_arg"
   cat > conftest.$ac_ext <<EOF
-#line 3588 "configure"
+#line 3777 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -3621,7 +3810,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:3625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_prog_cc_stdc="$ac_arg"; break
 else
@@ -3655,7 +3844,7 @@ if test -z "${MKDEP}"; then
        OL_MKDEP="${CC-cc}"
        if test -z "${MKDEP_FLAGS}"; then
                echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
-echo "configure:3659: checking for ${OL_MKDEP} depend flag" >&5
+echo "configure:3848: checking for ${OL_MKDEP} depend flag" >&5
 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3665,7 +3854,7 @@ else
                                cat > conftest.c <<EOF
  noCode;
 EOF
-                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
+                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
                                        | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
                                then
                                        if test ! -f conftest."${ac_object}" ; then
@@ -3697,56 +3886,216 @@ if test "${ol_cv_mkdep}" = no ; then
        echo "configure: warning: do not know how to generate dependencies" 1>&2
 fi
 
-ol_link_modules=no
-if test $ol_enable_modules != no ; then
-       for ac_hdr in ltdl.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3707: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
+echo "configure:3891: checking for afopen in -ls" >&5
+ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3712 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-ls  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3899 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+/* 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 afopen();
+
+int main() {
+afopen()
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:3910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+  
+       AUTH_LIBS=-ls
+       cat >> confdefs.h <<\EOF
+#define HAVE_AIX_SECURITY 1
 EOF
+
+
 else
   echo "$ac_t""no" 1>&6
 fi
-done
 
 
-       if test $ac_cv_header_ltdl_h = no ; then
-               { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
 
+for ac_func in getaddrinfo 
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3941: checking for $ac_func" >&5
+if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3946 "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();
+char (*f)();
+
+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
+f = $ac_func;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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_getaddrinfo = no ; then
+       if test $ol_enable_ipv6 = yes ; then
+               { echo "configure: error: IPv6 support requires getaddrinfo()" 1>&2; exit 1; }
+       fi
+       ol_enable_ipv6=no
+fi
+
+if test $ol_enable_local != no ; then
+       for ac_hdr in sys/un.h 
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4007: checking for $ac_hdr" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4012 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+       if test $ol_enable_local = auto ; then
+               ol_enable_local=$ac_cv_header_sys_un_h
+       elif test $ac_cv_header_sys_un_h = no ; then
+               { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
+       fi
+fi
+
+ol_link_modules=no
+if test $ol_enable_modules != no ; then
+       for ac_hdr in ltdl.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4057: checking for $ac_hdr" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4062 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+       if test $ac_cv_header_ltdl_h = no ; then
+               { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
        fi
 
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:3750: checking for lt_dlinit in -lltdl" >&5
+echo "configure:4099: checking for lt_dlinit in -lltdl" >&5
 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3754,7 +4103,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3758 "configure"
+#line 4107 "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
@@ -3765,7 +4114,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:3769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3780,41 +4129,40 @@ 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 ltdl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+  
+           MODULES_LIBS=-lltdl
+           cat >> confdefs.h <<\EOF
+#define HAVE_LIBLTDL 1
 EOF
 
-  LIBS="-lltdl $LIBS"
-
+       
 else
   echo "$ac_t""no" 1>&6
 fi
 
+
        if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
                { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
        fi
        ol_link_modules=yes
 else
-       ol_with_bdb2_module=static
+       ol_with_dnssrv_module=static
        ol_with_ldap_module=static
        ol_with_ldbm_module=static
        ol_with_passwd_module=static
-       ol_with_perl_module=static
        ol_with_shell_module=static
-       ol_with_tcl_module=static
+       ol_with_sql_module=static
 fi
 
 # test for EBCDIC
 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
-echo "configure:3812: checking for EBCDIC" >&5
+echo "configure:4160: checking for EBCDIC" >&5
 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 3818 "configure"
+#line 4166 "configure"
 #include "confdefs.h"
 
 #if !('M' == 0xd4)
@@ -3823,7 +4171,7 @@ else
 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3847,12 +4195,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3851: checking for ANSI C header files" >&5
+echo "configure:4199: checking for ANSI C header files" >&5
 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3856 "configure"
+#line 4204 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3860,7 +4208,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3877,7 +4225,7 @@ rm -f conftest*
 if test $ol_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3881 "configure"
+#line 4229 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -3895,7 +4243,7 @@ fi
 if test $ol_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3899 "configure"
+#line 4247 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -3916,7 +4264,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 3920 "configure"
+#line 4268 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #ifndef HAVE_EBCDIC
@@ -3934,7 +4282,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:3938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -3968,12 +4316,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:3972: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4320: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3977 "configure"
+#line 4325 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -3981,7 +4329,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:3985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4006,7 +4354,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:4010: checking for opendir in -ldir" >&5
+echo "configure:4358: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4014,7 +4362,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4018 "configure"
+#line 4366 "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
@@ -4025,7 +4373,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4047,7 +4395,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4051: checking for opendir in -lx" >&5
+echo "configure:4399: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4055,7 +4403,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4059 "configure"
+#line 4407 "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
@@ -4066,7 +4414,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4089,12 +4437,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4093: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:4441: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4098 "configure"
+#line 4446 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -4110,7 +4458,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:4114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -4131,12 +4479,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:4135: checking POSIX termios" >&5
+echo "configure:4483: checking POSIX termios" >&5
 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4140 "configure"
+#line 4488 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -4146,7 +4494,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_sys_posix_termios=yes
 else
@@ -4162,7 +4510,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:4166: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:4514: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4171,7 +4519,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 4175 "configure"
+#line 4523 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -4191,7 +4539,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 4195 "configure"
+#line 4543 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -4230,12 +4578,15 @@ for ac_hdr in \
        arpa/inet.h             \
        arpa/nameser.h  \
        assert.h                \
+       conio.h                 \
        crypt.h                 \
+       direct.h                \
        errno.h                 \
        fcntl.h                 \
        filio.h                 \
        getopt.h                \
        grp.h                   \
+       io.h                    \
        libutil.h               \
        limits.h                \
        locale.h                \
@@ -4244,10 +4595,10 @@ for ac_hdr in \
        memory.h                \
        psap.h                  \
        pwd.h                   \
+       process.h               \
        resolv.h                \
        sgtty.h                 \
        shadow.h                \
-       stdarg.h                \
        stddef.h                \
        string.h                \
        strings.h               \
@@ -4266,21 +4617,22 @@ for ac_hdr in \
        syslog.h                \
        termios.h               \
        unistd.h                \
+       winsock.h               \
 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4274: checking for $ac_hdr" >&5
+echo "configure:4626: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4279 "configure"
+#line 4631 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4309,13 +4661,107 @@ done
 
 
 
+echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
+echo "configure:4666: checking for sigset in -lV3" >&5
+ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lV3  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4674 "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 sigset();
+
+int main() {
+sigset()
+; return 0; }
+EOF
+if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lV3 $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test $ac_cv_header_winsock_h = yes; then
+       echo $ac_n "checking for winsock""... $ac_c" 1>&6
+echo "configure:4715: checking for winsock" >&5
+if eval "test \"\${ol_cv_winsock+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4720 "configure"
+#include "confdefs.h"
+#include <winsock.h>
+int main() {
+
+                       socket(0,0,0);
+                       select(0,NULL,NULL,NULL,NULL);
+                       closesocket(0);
+                       gethostname(NULL,0);
+       
+; return 0; }
+EOF
+if { (eval echo configure:4732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_winsock=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_winsock=no
+fi
+rm -f conftest*]
+fi
+
+echo "$ac_t""$ol_cv_winsock" 1>&6
+
+       if test $ol_cv_winsock = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_WINSOCK 1
+EOF
+
+               ac_cv_func_socket=yes
+               ac_cv_func_select=yes
+               ac_cv_func_closesocket=yes
+               ac_cv_func_gethostname=yes
+       fi
+fi
+
+
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:4314: checking for socket" >&5
+echo "configure:4760: checking for socket" >&5
 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4319 "configure"
+#line 4765 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -4339,7 +4785,7 @@ f = socket;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -4358,7 +4804,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:4362: checking for main in -lsocket" >&5
+echo "configure:4808: checking for main in -lsocket" >&5
 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4366,14 +4812,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4370 "configure"
+#line 4816 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4401,7 +4847,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:4405: checking for main in -lnet" >&5
+echo "configure:4851: checking for main in -lnet" >&5
 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4409,14 +4855,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4413 "configure"
+#line 4859 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4443,27 +4889,23 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-       echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
-echo "configure:4448: checking for socket in -lnet" >&5
-ac_lib_var=`echo net'_'socket | sed 'y%./+-:%__p__%'`
+       echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
+echo "configure:4894: checking for main in -lnsl_s" >&5
+ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lnet  $LIBS"
+LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4456 "configure"
+#line 4902 "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 socket();
 
 int main() {
-socket()
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4478,35 +4920,35 @@ 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 net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lnet $LIBS"
+  LIBS="-lnsl_s $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-       echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:4495: checking for main in -lnsl_s" >&5
-ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
+       echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
+echo "configure:4937: checking for main in -lnsl" >&5
+ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lnsl_s  $LIBS"
+LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4503 "configure"
+#line 4945 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4521,35 +4963,39 @@ 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 nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lnsl_s $LIBS"
+  LIBS="-lnsl $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
-       echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:4538: checking for main in -lnsl" >&5
-ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
+       echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
+echo "configure:4980: checking for socket in -linet" >&5
+ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lnsl  $LIBS"
+LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4546 "configure"
+#line 4988 "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 socket();
 
 int main() {
-main()
+socket()
 ; return 0; }
 EOF
-if { (eval echo configure:4553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4564,54 +5010,7 @@ 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 nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lnsl $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-       echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:4581: checking for socket in -linet" >&5
-ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-linet  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4589 "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 socket();
-
-int main() {
-socket()
-; return 0; }
-EOF
-if { (eval echo configure:4600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
@@ -4624,7 +5023,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:4628: checking for main in -lgen" >&5
+echo "configure:5027: checking for main in -lgen" >&5
 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4632,14 +5031,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4636 "configure"
+#line 5035 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4671,12 +5070,12 @@ fi
 
 
 echo $ac_n "checking for select""... $ac_c" 1>&6
-echo "configure:4675: checking for select" >&5
+echo "configure:5074: checking for select" >&5
 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4680 "configure"
+#line 5079 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char select(); below.  */
@@ -4700,7 +5099,7 @@ f = select;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_select=yes"
 else
@@ -4721,8 +5120,9 @@ else
 fi
 
 
-echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
-echo "configure:4726: checking types of arguments for select()" >&5
+if test "${ac_cv_header_winsock_h}" != yes; then
+                echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
+echo "configure:5126: checking types of arguments for select()" >&5
  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4736,7 +5136,7 @@ else
      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
        cat > conftest.$ac_ext <<EOF
-#line 4740 "configure"
+#line 5140 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -4755,7 +5155,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
           ac_not_found=no ; break 3
 else
@@ -4793,23 +5193,24 @@ EOF
 EOF
 
 
+fi
 
 
 for ac_hdr in regex.h 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4803: checking for $ac_hdr" >&5
+echo "configure:5204: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4808 "configure"
+#line 5209 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4839,12 +5240,12 @@ if test "$ac_cv_header_regex_h" != yes ; then
        { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
 fi
 echo $ac_n "checking for regfree""... $ac_c" 1>&6
-echo "configure:4843: checking for regfree" >&5
+echo "configure:5244: checking for regfree" >&5
 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4848 "configure"
+#line 5249 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char regfree(); below.  */
@@ -4868,7 +5269,7 @@ f = regfree;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_regfree=yes"
 else
@@ -4891,7 +5292,7 @@ fi
 
 
 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
-echo "configure:4895: checking for compatible POSIX regex" >&5
+echo "configure:5296: checking for compatible POSIX regex" >&5
 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4900,7 +5301,7 @@ else
   ol_cv_c_posix_regex=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 4904 "configure"
+#line 5305 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -4926,7 +5327,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:4930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_c_posix_regex=yes
 else
@@ -4946,70 +5347,22 @@ if test "$ol_cv_c_posix_regex" = no ; then
        { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
 fi
 
-
-echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:4952: checking for sigset in -lV3" >&5
-ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lV3  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4960 "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 sigset();
-
-int main() {
-sigset()
-; return 0; }
-EOF
-if { (eval echo configure:4971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lV3 $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-echo $ac_n "checking for res_search""... $ac_c" 1>&6
-echo "configure:5000: checking for res_search" >&5
-if eval "test \"\${ac_cv_func_res_search+set}\" = set"; then
+ol_link_dnssrv=no
+echo $ac_n "checking for res_query""... $ac_c" 1>&6
+echo "configure:5353: checking for res_query" >&5
+if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5005 "configure"
+#line 5358 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char res_search(); below.  */
+    which can conflict with char res_query(); 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 res_search();
+char res_query();
 char (*f)();
 
 int main() {
@@ -5017,55 +5370,55 @@ 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_res_search) || defined (__stub___res_search)
+#if defined (__stub_res_query) || defined (__stub___res_query)
 choke me
 #else
-f = res_search;
+f = res_query;
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:5029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_res_search=yes"
+  eval "ac_cv_func_res_query=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_res_search=no"
+  eval "ac_cv_func_res_query=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
 fi
 
-if test $ac_cv_func_res_search = no ; then 
-       echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
-echo "configure:5050: checking for res_search in -lbind" >&5
-ac_lib_var=`echo bind'_'res_search | sed 'y%./+-:%__p__%'`
+if test $ac_cv_func_res_query = no ; then 
+       echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
+echo "configure:5403: checking for res_query in -lbind" >&5
+ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${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 5058 "configure"
+#line 5411 "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();
+char res_query();
 
 int main() {
-res_search()
+res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5092,31 +5445,31 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-       ac_cv_func_res_search=$ac_cv_lib_bind_res_search
+       ac_cv_func_res_query=$ac_cv_lib_bind_res_query
 fi
 
-if test $ac_cv_func_res_search = no ; then 
-       echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6
-echo "configure:5101: checking for __res_search in -lbind" >&5
-ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-:%__p__%'`
+if test $ac_cv_func_res_query = no ; then 
+       echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
+echo "configure:5454: checking for __res_query in -lbind" >&5
+ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${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 5109 "configure"
+#line 5462 "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();
+char __res_query();
 
 int main() {
-__res_search()
+__res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5143,31 +5496,31 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-       ac_cv_func_res_search=$ac_cv_lib_bind___res_search
+       ac_cv_func_res_query=$ac_cv_lib_bind___res_query
 fi
 
-if test $ac_cv_func_res_search = no ; then 
-       echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:5152: checking for res_search in -lresolv" >&5
-ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-:%__p__%'`
+if test $ac_cv_func_res_query = no ; then 
+       echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
+echo "configure:5505: checking for res_query in -lresolv" >&5
+ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5160 "configure"
+#line 5513 "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();
+char res_query();
 
 int main() {
-res_search()
+res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5194,38 +5547,47 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-       ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
+       ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
 fi
 
-if test "$ac_cv_func_res_search" = yes ; then
+if test "$ac_cv_func_res_query" = yes ; then
        cat >> confdefs.h <<\EOF
-#define HAVE_RES_SEARCH 1
+#define HAVE_RES_QUERY 1
 EOF
 
-elif test $ol_enable_dns = yes ; then
-       { echo "configure: error: --enable-dns requires res_search" 1>&2; exit 1; }
-elif test $ol_enable_dns != no ; then
-       echo "configure: warning: no res_search, disabling DNS support" 1>&2
+
+       if test $ol_enable_dnssrv != no ; then
+               ol_link_dnssrv=yes
+       fi
+fi
+
+if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
+       { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
 fi
 
+ol_link_kbind=no
+ol_link_kpasswd=no
+ol_link_krb5=no
+ol_link_krb4=no
 
-# QUIPU
-if test $ol_enable_quipu != no ; then
-       for ac_hdr in quipu/commonarg.h
+if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
+       -o $ol_with_kerberos = k5only -o $ol_with_kerberos = k425 ; then
+
+       for ac_hdr in krb5.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5219: checking for $ac_hdr" >&5
+echo "configure:5581: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5224 "configure"
+#line 5586 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 done
 
 
-       if test $ac_cv_header_quipu_commonarg_h = yes ; then
-               BUILD_QUIPU=yes
-       elif test $ol_enable_quipu = auto ; then
-               echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
-       else
-               { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
+       if test $ac_cv_header_krb5_h = yes ; then
+                               for ac_hdr in heim_err.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5623: checking for $ac_hdr" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5628 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+               if test $ac_cv_header_heim_err_h = yes ; then
+                       krb5_impl=heimdal
+               else
+                       krb5_impl=mit
+               fi
+
+               if test $krb5_impl = mit; then
+                       echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
+echo "configure:5667: checking for main in -lkrb5" >&5
+ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5675 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:5682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
+  have_krb5=yes
+                               KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
+else
+  echo "$ac_t""no" 1>&6
+have_krb5=no
+fi
+
+
+               elif test $krb5_impl = heimdal; then
+                       echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
+echo "configure:5707: checking for main in -lkrb5" >&5
+ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5715 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:5722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
+  have_krb5=yes
+                               KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
+else
+  echo "$ac_t""no" 1>&6
+have_krb5=no
+fi
+
+
+                       cat >> confdefs.h <<\EOF
+#define HAVE_HEIMDAL_KERBEROS 1
+EOF
+
+               else
+                       have_krb5=no
+                       echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
+               fi
+
+               if test $have_krb5 = yes ; then
+                       ol_link_krb5=yes
+
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KRB5 1
+EOF
+
+
+                       if test $ol_enable_kpasswd != no ; then
+                               ol_link_kpasswd=yes;
+                       fi
+
+                       if test $ol_with_kerberos = k5only ; then
+                               ol_with_kerberos=found
+                       fi
+
+               elif test $ol_with_kerberos != auto ; then
+                       { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
+               fi
+
        fi
 fi
 
-ol_link_kerberos=no
+if test $ol_link_krb5 = yes -a \
+       \( $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
 
-if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
        for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5272: checking for $ac_hdr" >&5
+echo "configure:5784: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5277 "configure"
+#line 5789 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5306,23 +5818,64 @@ 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:5311: checking for main in -lkrb4" >&5
+               if test $krb5_impl = mit; then
+                       echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
+echo "configure:5824: checking for main in -lkrb4" >&5
+ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5832 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:5839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
+  have_k425=yes
+                               KRB4_LIBS="-lkrb4 -ldes425"
+else
+  echo "$ac_t""no" 1>&6
+have_k425=no
+fi
+
+
+               elif test $krb5_impl = heimdal; then
+                       echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
+echo "configure:5864: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
+LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5319 "configure"
+#line 5872 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5337,31 +5890,42 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_k5=yes
+  have_k425=yes
+                               KRB4_LIBS="-lkrb4"
 else
   echo "$ac_t""no" 1>&6
-have_k5=no
+have_k425=no
 fi
 
 
-               if test $have_k5 = yes ; then
+               else
+                       have_425=no
+                       echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
+               fi
+
+               if test $have_k425 = yes ; then
                        ol_with_kerberos=found
-                       ol_link_kerberos=yes
+                       ol_link_krb4=yes
+
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KRB425 1
+EOF
 
-                       KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KRB4 1
+EOF
 
-                       LIBS="$KRB_LIBS $LIBS"
 
                        echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:5357: checking for des_debug in Kerberos libraries" >&5
+echo "configure:5921: checking for des_debug in Kerberos libraries" >&5
 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                                                                save_LIBS="$LIBS"
-                               LIBS="$KRB_LIBS $LIBS"
+                               LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 5365 "configure"
+#line 5929 "configure"
 #include "confdefs.h"
 
 #include <kerberosIV/krb.h>
@@ -5374,7 +5938,7 @@ des_debug = 1;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_var_des_debug=yes
 else
@@ -5402,22 +5966,28 @@ EOF
        fi
 fi
 
-if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
-       for ac_hdr in krb.h des.h
+if test $ol_link_krb5 = yes ; then
+       ol_with_kerberos=found
+fi
+
+if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
+       -o $ol_with_kerberos = kth ; then
+
+       for ac_hdr in krb.h des.h krb-archaeology.h 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5411: checking for $ac_hdr" >&5
+echo "configure:5981: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5416 "configure"
+#line 5986 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5446,7 +6016,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:5450: checking for main in -lkrb" >&5
+echo "configure:6020: checking for main in -lkrb" >&5
 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5454,14 +6024,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5458 "configure"
+#line 6028 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5485,38 +6055,56 @@ fi
 
                if test $have_k4 = yes ; then
                        ol_with_kerberos=found
-                       ol_link_kerberos=yes
+                       ol_link_krb4=yes
 
-                       KRB_LIBS="-lkrb -ldes"
-               fi
-       fi
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KRB4 1
+EOF
+
+
+                       KRB4_LIBS="-lkrb -ldes"
+
+                       if test $ac_cv_header_krb_archaeology_h = yes ; then
+                               cat >> confdefs.h <<\EOF
+#define HAVE_KTH_KERBEROS 1
+EOF
+
+                       fi
+               fi
+       fi
+fi
+
+if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
+       ol_link_kpasswd=yes;
 fi
 
-if test $ol_link_kerberos = yes ; then
+if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
        cat >> confdefs.h <<\EOF
 #define HAVE_KERBEROS 1
 EOF
 
+
+elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
+       { echo "configure: error: Kerberos detection failed." 1>&2; exit 1; }
 fi
 
 ol_link_tls=no
 if test $ol_with_tls != no ; then
-       
        for ac_hdr in openssl/ssl.h ssl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5510: checking for $ac_hdr" >&5
+echo "configure:6098: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5515 "configure"
+#line 6103 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5545,7 +6133,7 @@ done
        
        if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
                echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
-echo "configure:5549: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
+echo "configure:6137: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5553,7 +6141,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5557 "configure"
+#line 6145 "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
@@ -5564,7 +6152,7 @@ int main() {
 SSLeay_add_ssl_algorithms()
 ; return 0; }
 EOF
-if { (eval echo configure:5568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5589,7 +6177,7 @@ fi
                        
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
-echo "configure:5593: checking for SSL_library_init in -lssl" >&5
+echo "configure:6181: checking for SSL_library_init in -lssl" >&5
 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5597,7 +6185,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5601 "configure"
+#line 6189 "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
@@ -5608,7 +6196,7 @@ int main() {
 SSL_library_init()
 ; return 0; }
 EOF
-if { (eval echo configure:5612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5634,7 +6222,7 @@ fi
 
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
-echo "configure:5638: checking for ssl3_accept in -lssl" >&5
+echo "configure:6226: checking for ssl3_accept in -lssl" >&5
 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5642,7 +6230,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5646 "configure"
+#line 6234 "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
@@ -5653,7 +6241,7 @@ int main() {
 ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:5657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5698,6 +6286,9 @@ EOF
                        fi
                fi
        fi
+
+else
+       echo "configure: warning: TLS privacy protection not supported!" 1>&2
 fi
 
 if test $ol_link_tls = yes ; then
@@ -5705,7 +6296,14 @@ if test $ol_link_tls = yes ; then
 #define HAVE_TLS 1
 EOF
 
-fi     
+
+elif test $ol_with_tls = auto ; then
+       echo "configure: warning: Could not locate TLS/SSL package" 1>&2
+       echo "configure: warning: TLS privacy protection not supported!" 1>&2
+
+elif test $ol_with_tls != no ; then
+       { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
+fi
 
 for ac_func in \
        ctime_r                 \
@@ -5713,12 +6311,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5717: checking for $ac_func" >&5
+echo "configure:6315: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5722 "configure"
+#line 6320 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5742,7 +6340,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5771,50 +6369,68 @@ if test "$ac_cv_func_ctime_r" = no ; then
        ol_cv_func_ctime_r_nargs=0
 else
        echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
-echo "configure:5775: checking number of arguments of ctime_r" >&5
+echo "configure:6373: checking number of arguments of ctime_r" >&5
 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5780 "configure"
+#line 6378 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
 ; return 0; }
 EOF
-if { (eval echo configure:5787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs=3
+  ol_cv_func_ctime_r_nargs3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cat > conftest.$ac_ext <<EOF
-#line 5795 "configure"
+  ol_cv_func_ctime_r_nargs3=no
+fi
+rm -f conftest*
+
+       cat > conftest.$ac_ext <<EOF
+#line 6397 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t ti; char *buffer; ctime_r(&ti,buffer);
 ; return 0; }
 EOF
-if { (eval echo configure:5802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs=2
+  ol_cv_func_ctime_r_nargs2=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs=0
-fi
-rm -f conftest*
+  ol_cv_func_ctime_r_nargs2=no
 fi
 rm -f conftest*
+
+       if test $ol_cv_func_ctime_r_nargs3 = yes -a \
+               $ol_cv_func_ctime_r_nargs2 = no ; then
+
+               ol_cv_func_ctime_r_nargs=3
+
+       elif test $ol_cv_func_ctime_r_nargs3 = no -a \
+               $ol_cv_func_ctime_r_nargs2 = yes ; then
+
+               ol_cv_func_ctime_r_nargs=2
+
+       else
+               ol_cv_func_ctime_r_nargs=0
+       fi
+  
 fi
 
 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
+
   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
-    cat >> confdefs.h <<EOF
+       cat >> confdefs.h <<EOF
 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
 EOF
 
@@ -5824,12 +6440,12 @@ fi
 
 if test "$ac_cv_func_gethostbyname_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
-echo "configure:5828: checking number of arguments of gethostbyname_r" >&5
+echo "configure:6444: checking number of arguments of gethostbyname_r" >&5
 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5833 "configure"
+#line 6449 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -5843,15 +6459,19 @@ struct hostent hent; char buffer[BUFSIZE];
                        buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:5847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs=5
+  ol_cv_func_gethostbyname_r_nargs5=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cat > conftest.$ac_ext <<EOF
-#line 5855 "configure"
+  ol_cv_func_gethostbyname_r_nargs5=no
+fi
+rm -f conftest*
+
+       cat > conftest.$ac_ext <<EOF
+#line 6475 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -5860,24 +6480,37 @@ else
 #define BUFSIZE (sizeof(struct hostent)+10)
 int main() {
 struct hostent hent;struct hostent *rhent;
-                       char buffer[BUFSIZE];
-                       int bufsize=BUFSIZE;int h_errno;
-                       (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
-                               &rhent, &h_errno);
+               char buffer[BUFSIZE];
+               int bufsize=BUFSIZE;int h_errno;
+               (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
+                       &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:5870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs=6
+  ol_cv_func_gethostbyname_r_nargs6=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs=0
-fi
-rm -f conftest*
+  ol_cv_func_gethostbyname_r_nargs6=no
 fi
 rm -f conftest*
+
+       if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
+               $ol_cv_func_gethostbyname_r_nargs6 = no ; then
+
+               ol_cv_func_gethostbyname_r_nargs=5
+
+       elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
+               $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
+
+               ol_cv_func_gethostbyname_r_nargs=6
+
+       else
+               ol_cv_func_gethostbyname_r_nargs=0
+       fi
+  
 fi
 
 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
@@ -5894,12 +6527,12 @@ fi
  
 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
-echo "configure:5898: checking number of arguments of gethostbyaddr_r" >&5
+echo "configure:6531: checking number of arguments of gethostbyaddr_r" >&5
 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5903 "configure"
+#line 6536 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -5915,15 +6548,19 @@ struct hostent hent; char buffer[BUFSIZE];
                        alen, AF_INET, &hent, buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:5919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs=7
+  ol_cv_func_gethostbyaddr_r_nargs7=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cat > conftest.$ac_ext <<EOF
-#line 5927 "configure"
+  ol_cv_func_gethostbyaddr_r_nargs7=no
+fi
+rm -f conftest*
+
+       cat > conftest.$ac_ext <<EOF
+#line 6564 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -5932,27 +6569,40 @@ else
 #define BUFSIZE (sizeof(struct hostent)+10)
 int main() {
 struct hostent hent;
-                       struct hostent *rhent; char buffer[BUFSIZE]; 
-                       struct in_addr add;
-                       size_t alen=sizeof(struct in_addr);
-                       int bufsize=BUFSIZE;int h_errno;
-                       (void)gethostbyaddr_r( (void *)&(add.s_addr),
-                               alen, AF_INET, &hent, buffer, bufsize, 
-                               &rhent, &h_errno);
+               struct hostent *rhent; char buffer[BUFSIZE]; 
+               struct in_addr add;
+               size_t alen=sizeof(struct in_addr);
+               int bufsize=BUFSIZE;int h_errno;
+               (void)gethostbyaddr_r( (void *)&(add.s_addr),
+                       alen, AF_INET, &hent, buffer, bufsize, 
+                       &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:5945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs=8
+  ol_cv_func_gethostbyaddr_r_nargs8=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs=0
-fi
-rm -f conftest*
+  ol_cv_func_gethostbyaddr_r_nargs8=no
 fi
 rm -f conftest*
+
+       if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
+               $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
+
+               ol_cv_func_gethostbyaddr_r_nargs=7
+
+       elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
+               $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
+
+               ol_cv_func_gethostbyaddr_r_nargs=8
+
+       else
+               ol_cv_func_gethostbyaddr_r_nargs=0
+       fi
+  
 fi
 
 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
@@ -5985,24 +6635,118 @@ EOF
 fi
 
 ol_link_threads=no
+
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+       -o $ol_with_threads = nt ; then
+
+       
+       echo $ac_n "checking for NT Threads""... $ac_c" 1>&6
+echo "configure:6645: checking for NT Threads" >&5
+if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+               echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
+echo "configure:6651: checking for _beginthread" >&5
+if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6656 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char _beginthread(); 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 _beginthread();
+char (*f)();
+
+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__beginthread) || defined (__stub____beginthread)
+choke me
+#else
+f = _beginthread;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func__beginthread=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func__beginthread=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_cv_nt_threads=yes
+else
+  echo "$ac_t""no" 1>&6
+ol_cv_nt_threads=no
+fi
+
+       
+fi
+
+echo "$ac_t""$ol_cv_nt_threads" 1>&6
+
+       if test $ol_cv_nt_threads = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_THREADS 1
+EOF
+
+       fi
+
+
+       if test "$ol_cv_nt_threads" = yes ; then
+       ol_link_threads=nt
+       ol_with_threads=found
+       ol_with_yielding_select=yes
+
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_SERVICE_MANAGER 1
+EOF
+
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_EVENT_LOG 1
+EOF
+
+       fi
+
+       if test $ol_with_threads = nt ; then
+               { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
+       fi
+fi
+
 if test $ol_with_threads = auto -o $ol_with_threads = yes \
        -o $ol_with_threads = posix ; then
 
-       for ac_hdr in pthread.h sched.h
+       for ac_hdr in pthread.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5996: checking for $ac_hdr" >&5
+echo "configure:6740: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6001 "configure"
+#line 6745 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6031,19 +6775,19 @@ done
 
        if test $ac_cv_header_pthread_h = yes ; then
                echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:6035: checking POSIX thread version" >&5
+echo "configure:6779: checking POSIX thread version" >&5
 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 6041 "configure"
+#line 6785 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
                /* this check could be improved */
 #              ifdef PTHREAD_ONCE_INIT
-                       pthread_version_final
+                       pthread_version_final;
 #              endif
        
 EOF
@@ -6059,13 +6803,13 @@ rm -f conftest*
 
 
        cat > conftest.$ac_ext <<EOF
-#line 6063 "configure"
+#line 6807 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
                /* this check could be improved */
 #              ifdef pthread_once_init
-                       pthread_version_draft4
+                       pthread_version_draft4;
 #              endif
        
 EOF
@@ -6112,12 +6856,12 @@ EOF
 
                
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:6116: checking for LinuxThreads pthread.h" >&5
+echo "configure:6860: checking for LinuxThreads pthread.h" >&5
 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6121 "configure"
+#line 6865 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -6142,17 +6886,90 @@ EOF
 
        fi
 
+               
+       echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
+echo "configure:6892: checking for GNU Pth pthread.h" >&5
+if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6897 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+       __gnu_pth__;
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__gnu_pth__" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_header_gnu_pth_pthread_h=yes
+else
+  rm -rf conftest*
+  ol_cv_header_gnu_pth_pthread_h=no
+fi
+rm -f conftest*
+
+               
+fi
+
+echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
+
+
+               if test $ol_cv_header_gnu_pth_pthread_h = no ; then
+                       for ac_hdr in sched.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:6926: checking for $ac_hdr" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6931 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+               fi
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
-echo "configure:6149: checking for pthread_create in default libraries" >&5
+echo "configure:6966: checking for pthread_create in default libraries" >&5
 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 6156 "configure"
+#line 6973 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6171,14 +6988,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6196,7 +7025,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_create=yes
 else
@@ -6208,7 +7037,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 6212 "configure"
+#line 7041 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6231,14 +7060,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6257,7 +7098,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:6261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create=yes
 else
@@ -6282,7 +7123,7 @@ echo "$ac_t""$ol_cv_pthread_create" 1>&6
 if test "$ol_link_threads" = no ; then
        # try -kthread
        echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
-echo "configure:6286: checking for pthread link with -kthread" >&5
+echo "configure:7127: checking for pthread link with -kthread" >&5
 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6293,7 +7134,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 6297 "configure"
+#line 7138 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6312,14 +7153,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6337,7 +7190,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_kthread=yes
 else
@@ -6349,7 +7202,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 6353 "configure"
+#line 7206 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6372,14 +7225,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6398,7 +7263,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:6402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_kthread=yes
 else
@@ -6428,7 +7293,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -pthread
        echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
-echo "configure:6432: checking for pthread link with -pthread" >&5
+echo "configure:7297: checking for pthread link with -pthread" >&5
 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6439,7 +7304,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 6443 "configure"
+#line 7308 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6458,14 +7323,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6483,7 +7360,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthread=yes
 else
@@ -6495,7 +7372,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 6499 "configure"
+#line 7376 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6518,14 +7395,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6544,7 +7433,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:6548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_pthread=yes
 else
@@ -6574,7 +7463,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -pthreads
        echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
-echo "configure:6578: checking for pthread link with -pthreads" >&5
+echo "configure:7467: checking for pthread link with -pthreads" >&5
 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6585,7 +7474,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 6589 "configure"
+#line 7478 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6604,17 +7493,29 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
-#else
-       status = pthread_create(&t, NULL, task, NULL);
-#endif
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
 
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
        if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
+#define        ATTR    &attr
+#else
+#if HAVE_PTHREADS_D4
+#define        ATTR    pthread_attr_default
+#else
+#define        ATTR    NULL
+#endif
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
+       if( status ) exit( status );
+
+       /* make sure pthread_detach() isn't just a stub */
 #if HAVE_PTHREADS_D4
        status = pthread_detach( &t );
 #else
@@ -6629,7 +7530,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthreads=yes
 else
@@ -6641,7 +7542,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 6645 "configure"
+#line 7546 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6664,14 +7565,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6690,7 +7603,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:6694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_pthreads=yes
 else
@@ -6720,7 +7633,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -mthreads
        echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
-echo "configure:6724: checking for pthread link with -mthreads" >&5
+echo "configure:7637: checking for pthread link with -mthreads" >&5
 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6731,7 +7644,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 6735 "configure"
+#line 7648 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6750,14 +7663,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6775,7 +7700,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_mthreads=yes
 else
@@ -6787,7 +7712,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 6791 "configure"
+#line 7716 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6810,14 +7735,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6836,7 +7773,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:6840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_mthreads=yes
 else
@@ -6866,7 +7803,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -thread
        echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
-echo "configure:6870: checking for pthread link with -thread" >&5
+echo "configure:7807: checking for pthread link with -thread" >&5
 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6877,7 +7814,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 6881 "configure"
+#line 7818 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6896,14 +7833,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6921,7 +7870,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:6925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_thread=yes
 else
@@ -6933,7 +7882,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 6937 "configure"
+#line 7886 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6956,14 +7905,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -6982,7 +7943,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:6986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_thread=yes
 else
@@ -7013,7 +7974,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -lmach -lexc -lc_r
        echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
-echo "configure:7017: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+echo "configure:7978: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7024,7 +7985,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7028 "configure"
+#line 7989 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7043,14 +8004,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7068,7 +8041,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
@@ -7080,7 +8053,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7084 "configure"
+#line 8057 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7103,14 +8076,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7129,7 +8114,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
@@ -7159,7 +8144,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -lmach -lexc
        echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
-echo "configure:7163: checking for pthread link with -lpthread -lmach -lexc" >&5
+echo "configure:8148: checking for pthread link with -lpthread -lmach -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7170,7 +8155,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7174 "configure"
+#line 8159 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7189,14 +8174,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7214,7 +8211,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread_lmach_lexc=yes
 else
@@ -7226,7 +8223,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7230 "configure"
+#line 8227 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7249,14 +8246,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7275,7 +8284,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread_lmach_lexc=yes
 else
@@ -7306,7 +8315,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -Wl,-woff,85
        echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
-echo "configure:7310: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+echo "configure:8319: checking for pthread link with -lpthread -Wl,-woff,85" >&5
 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7317,7 +8326,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7321 "configure"
+#line 8330 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7336,14 +8345,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7361,7 +8382,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -7373,7 +8394,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7377 "configure"
+#line 8398 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7396,14 +8417,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7422,7 +8455,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -7453,7 +8486,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread
        echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
-echo "configure:7457: checking for pthread link with -lpthread" >&5
+echo "configure:8490: checking for pthread link with -lpthread" >&5
 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7464,7 +8497,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7468 "configure"
+#line 8501 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7483,14 +8516,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7508,7 +8553,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread=yes
 else
@@ -7520,7 +8565,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7524 "configure"
+#line 8569 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7543,14 +8588,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7569,7 +8626,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread=yes
 else
@@ -7599,7 +8656,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lc_r
        echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
-echo "configure:7603: checking for pthread link with -lc_r" >&5
+echo "configure:8660: checking for pthread link with -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7610,7 +8667,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7614 "configure"
+#line 8671 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7629,14 +8686,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7654,7 +8723,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lc_r=yes
 else
@@ -7666,7 +8735,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7670 "configure"
+#line 8739 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7689,14 +8758,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7715,7 +8796,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lc_r=yes
 else
@@ -7746,7 +8827,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -threads
        echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
-echo "configure:7750: checking for pthread link with -threads" >&5
+echo "configure:8831: checking for pthread link with -threads" >&5
 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7757,7 +8838,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7761 "configure"
+#line 8842 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7776,14 +8857,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7801,7 +8894,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_threads=yes
 else
@@ -7813,7 +8906,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7817 "configure"
+#line 8910 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7836,14 +8929,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7862,7 +8967,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:7866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_threads=yes
 else
@@ -7893,7 +8998,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lmach -lexc -lc_r
        echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
-echo "configure:7897: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+echo "configure:9002: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7904,7 +9009,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7908 "configure"
+#line 9013 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7923,14 +9028,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -7948,7 +9065,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:7952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
@@ -7960,7 +9077,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7964 "configure"
+#line 9081 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7983,14 +9100,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -8009,7 +9138,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
@@ -8039,7 +9168,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lmach -lexc
        echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
-echo "configure:8043: checking for pthread link with -lpthreads -lmach -lexc" >&5
+echo "configure:9172: checking for pthread link with -lpthreads -lmach -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8050,7 +9179,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8054 "configure"
+#line 9183 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8069,14 +9198,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -8094,7 +9235,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
@@ -8106,7 +9247,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8110 "configure"
+#line 9251 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8129,14 +9270,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -8155,7 +9308,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
@@ -8185,7 +9338,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lexc
        echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
-echo "configure:8189: checking for pthread link with -lpthreads -lexc" >&5
+echo "configure:9342: checking for pthread link with -lpthreads -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8196,7 +9349,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8200 "configure"
+#line 9353 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8215,14 +9368,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -8240,7 +9405,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lexc=yes
 else
@@ -8252,7 +9417,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8256 "configure"
+#line 9421 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8275,14 +9440,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -8301,7 +9478,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lexc=yes
 else
@@ -8332,7 +9509,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads
        echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
-echo "configure:8336: checking for pthread link with -lpthreads" >&5
+echo "configure:9513: checking for pthread link with -lpthreads" >&5
 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8343,7 +9520,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8347 "configure"
+#line 9524 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8362,14 +9539,26 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -8387,7 +9576,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthreads=yes
 else
@@ -8399,7 +9588,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8403 "configure"
+#line 9592 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8422,14 +9611,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
+
+#define        ATTR    &attr
+#else
 #if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
+#define        ATTR    pthread_attr_default
 #else
-       status = pthread_create(&t, NULL, task, NULL);
+#define        ATTR    NULL
 #endif
-
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -8448,7 +9649,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lib_lpthreads=yes
 else
@@ -8490,12 +9691,12 @@ EOF
                                                                                                for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8494: checking for $ac_func" >&5
+echo "configure:9695: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8499 "configure"
+#line 9700 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8519,7 +9720,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8547,7 +9748,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:8551: checking for sched_yield in -lrt" >&5
+echo "configure:9752: checking for sched_yield in -lrt" >&5
 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8555,7 +9756,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8559 "configure"
+#line 9760 "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
@@ -8566,7 +9767,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:8570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8598,12 +9799,12 @@ fi
                                                                                                for ac_func in thr_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8602: checking for $ac_func" >&5
+echo "configure:9803: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8607 "configure"
+#line 9808 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8627,7 +9828,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8658,15 +9859,15 @@ done
                                echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
                        fi
 
-                                               for ac_func in pthread_kill
+                                               for ac_func in pthread_kill pthread_rwlock_destroy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8665: checking for $ac_func" >&5
+echo "configure:9866: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8670 "configure"
+#line 9871 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8690,7 +9891,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8716,13 +9917,13 @@ done
 
 
                                                                        echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:8720: checking for pthread_detach with <pthread.h>" >&5
+echo "configure:9921: checking for pthread_detach with <pthread.h>" >&5
 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                                                                cat > conftest.$ac_ext <<EOF
-#line 8726 "configure"
+#line 9927 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -8734,7 +9935,7 @@ int main() {
 pthread_detach(NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:8738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_func_pthread_detach=yes
 else
@@ -8766,12 +9967,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8770: checking for $ac_func" >&5
+echo "configure:9971: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8775 "configure"
+#line 9976 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8795,7 +9996,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8821,21 +10022,23 @@ done
 
 
                        
-       echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
-echo "configure:8826: checking for pthread_kill_other_threads_np" >&5
-if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
+       for ac_func in pthread_kill_other_threads_np
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:10029: checking for $ac_func" >&5
+if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8831 "configure"
+#line 10034 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char pthread_kill_other_threads_np(); below.  */
+    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 pthread_kill_other_threads_np();
+char $ac_func();
 char (*f)();
 
 int main() {
@@ -8843,35 +10046,40 @@ 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_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = pthread_kill_other_threads_np;
+f = $ac_func;
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:8855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_pthread_kill_other_threads_np=yes"
+  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_pthread_kill_other_threads_np=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
+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
 
        echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
-echo "configure:8875: checking for LinuxThreads implementation" >&5
+echo "configure:10083: checking for LinuxThreads implementation" >&5
 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8884,7 +10092,7 @@ echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
        
        
        echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
-echo "configure:8888: checking for LinuxThreads consistency" >&5
+echo "configure:10096: checking for LinuxThreads consistency" >&5
 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8909,7 +10117,7 @@ echo "$ac_t""$ol_cv_linux_threads" 1>&6
                        fi
 
                        echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:8913: checking if pthread_create() works" >&5
+echo "configure:10121: checking if pthread_create() works" >&5
 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8918,7 +10126,7 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 8922 "configure"
+#line 10130 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8941,14 +10149,26 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
+#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
+       /* This system (e.g. AIX) defaults detached; must override */
+       pthread_attr_t attr;
 
-       /* make sure pthread_create() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_create(&t, pthread_attr_default, task, NULL);
-#else
-       status = pthread_create(&t, NULL, task, NULL);
-#endif
+       status = pthread_attr_init(&attr);
+       if( status ) exit( status );
+
+       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+       if( status ) exit( status );
 
+#define        ATTR    &attr
+#else
+#if HAVE_PTHREADS_D4
+#define        ATTR    pthread_attr_default
+#else
+#define        ATTR    NULL
+#endif
+#endif
+       /* make sure pthread_create() isn't just a stub */
+       status = pthread_create(&t, ATTR, task, NULL);
        if( status ) exit( status );
 
        /* make sure pthread_detach() isn't just a stub */
@@ -8967,7 +10187,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:8971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create_works=yes
 else
@@ -8989,7 +10209,7 @@ echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
 
                                                if test $ol_with_yielding_select = auto ; then
                                echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:8993: checking if select yields when using pthreads" >&5
+echo "configure:10213: checking if select yields when using pthreads" >&5
 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8998,7 +10218,7 @@ else
   ol_cv_pthread_select_yields=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9002 "configure"
+#line 10222 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9074,7 +10294,7 @@ int main(argc, argv)
        exit(2);
 }
 EOF
-if { (eval echo configure:9078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_select_yields=no
 else
@@ -9118,17 +10338,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:9122: checking for $ac_hdr" >&5
+echo "configure:10342: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9127 "configure"
+#line 10347 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9158,12 +10378,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:9162: checking for cthread_fork" >&5
+echo "configure:10382: checking for cthread_fork" >&5
 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9167 "configure"
+#line 10387 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -9187,7 +10407,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_cthread_fork=yes"
 else
@@ -9209,7 +10429,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:9213: checking for cthread_fork with -all_load" >&5
+echo "configure:10433: checking for cthread_fork with -all_load" >&5
 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9217,7 +10437,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 9221 "configure"
+#line 10441 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -9226,7 +10446,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:9230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_cthread_all_load=yes
 else
@@ -9264,6 +10484,108 @@ EOF
        fi
 fi
 
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+       -o $ol_with_threads = pth ; then
+
+       for ac_hdr in pth.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:10495: checking for $ac_hdr" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10500 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:10505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+       if test $ac_cv_header_pth_h = yes ; then
+               echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
+echo "configure:10534: checking for pth_version in -lpth" >&5
+ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpth  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 10542 "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 pth_version();
+
+int main() {
+pth_version()
+; return 0; }
+EOF
+if { (eval echo configure:10553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
+  have_pth=yes
+else
+  echo "$ac_t""no" 1>&6
+have_pth=no
+fi
+
+
+               if test $have_pth = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_GNU_PTH 1
+EOF
+
+                       LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
+                       ol_link_threads=pth
+
+                       if test $ol_with_yielding_select = auto ; then
+                               ol_with_yielding_select=yes
+                       fi
+               fi
+       fi
+fi
+
 if test $ol_with_threads = auto -o $ol_with_threads = yes \
        -o $ol_with_threads = lwp ; then
 
@@ -9271,17 +10593,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:9275: checking for $ac_hdr" >&5
+echo "configure:10597: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9280 "configure"
+#line 10602 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9309,7 +10631,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:9313: checking for thr_create in -lthread" >&5
+echo "configure:10635: checking for thr_create in -lthread" >&5
 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9317,7 +10639,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9321 "configure"
+#line 10643 "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
@@ -9328,7 +10650,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:9332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9368,12 +10690,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9372: checking for $ac_func" >&5
+echo "configure:10694: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9377 "configure"
+#line 10699 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9397,7 +10719,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9428,17 +10750,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9432: checking for $ac_hdr" >&5
+echo "configure:10754: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9437 "configure"
+#line 10759 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9466,7 +10788,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:9470: checking for lwp_create in -llwp" >&5
+echo "configure:10792: checking for lwp_create in -llwp" >&5
 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9474,7 +10796,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9478 "configure"
+#line 10800 "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
@@ -9485,7 +10807,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:9489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9538,17 +10860,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:9542: checking for $ac_hdr" >&5
+echo "configure:10864: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9547 "configure"
+#line 10869 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9577,12 +10899,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9581: checking for $ac_func" >&5
+echo "configure:10903: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9586 "configure"
+#line 10908 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9606,7 +10928,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9632,12 +10954,12 @@ done
 
        
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:9636: checking for LinuxThreads pthread.h" >&5
+echo "configure:10958: checking for LinuxThreads pthread.h" >&5
 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9641 "configure"
+#line 10963 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -9667,17 +10989,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9671: checking for $ac_hdr" >&5
+echo "configure:10993: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9676 "configure"
+#line 10998 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9707,17 +11029,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9711: checking for $ac_hdr" >&5
+echo "configure:11033: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9716 "configure"
+#line 11038 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9747,17 +11069,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9751: checking for $ac_hdr" >&5
+echo "configure:11073: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9756 "configure"
+#line 11078 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9785,7 +11107,7 @@ done
 
 fi
 
-if test $ol_link_threads != no ; then  
+if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
                        cat >> confdefs.h <<\EOF
 #define REENTRANT 1
 EOF
@@ -9816,20 +11138,20 @@ EOF
 
 
                        echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:9820: checking for thread specific errno" >&5
+echo "configure:11142: checking for thread specific errno" >&5
 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 9826 "configure"
+#line 11148 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_errno_thread_specific=yes
 else
 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
 
                        echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
-echo "configure:9849: checking for thread specific h_errno" >&5
+echo "configure:11171: checking for thread specific h_errno" >&5
 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 9855 "configure"
+#line 11177 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 h_errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_h_errno_thread_specific=yes
 else
@@ -9905,77 +11227,29 @@ EOF
 
 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:9913: checking for DB2 library" >&5
-if eval "test \"\${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:9919: checking for db_open in -ldb" >&5
-ac_lib_var=`echo db'_'db_open | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldb  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9927 "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 db_open();
-
-int main() {
-db_open()
-; return 0; }
-EOF
-if { (eval echo configure:9938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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_cv_lib_db2=-ldb
-else
-  echo "$ac_t""no" 1>&6
-ol_cv_lib_db2=no
-fi
 
-       LIBS="$ol_LIBS"
-
-fi
-
-echo "$ac_t""$ol_cv_lib_db2" 1>&6
+if test $ol_with_ldbm_api = auto \
+       -o $ol_with_ldbm_api = berkeley \
+       -o $ol_with_ldbm_api = bcompat ; then
 
-for ac_hdr in db.h
+       if test $ol_with_ldbm_api = bcompat; then \
+               ol_cv_berkeley_db=no
+for ac_hdr in db_185.h db.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9969: checking for $ac_hdr" >&5
+echo "configure:11243: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9974 "configure"
+#line 11248 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 fi
 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:10007: checking if db.h is DB2" >&5
-if eval "test \"\${ol_cv_header_db2+set}\" = set"; then
+if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
+       echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
+echo "configure:11281: checking if Berkeley DB header compatibility" >&5
+if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 10013 "configure"
+#line 11287 "configure"
 #include "confdefs.h"
 
-#                      include <db.h>
-                       /* this check could be improved */
-#                      ifdef DB_VERSION_MAJOR
-#                              if DB_VERSION_MAJOR == 2
-                                       __db_version_2
-#                              endif
-#                      endif
-               
+#if HAVE_DB_185_H
+#      include <db_185.h>
+#else
+#      include <db.h>
+#endif
+
+ /* this check could be improved */
+#ifndef DB_VERSION_MAJOR
+#      define DB_VERSION_MAJOR 1
+#endif
+
+#if DB_VERSION_MAJOR == 1 
+       __db_version_1
+#endif
+
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "__db_version_2" >/dev/null 2>&1; then
+  egrep "__db_version_1" >/dev/null 2>&1; then
   rm -rf conftest*
-  ol_cv_header_db2=yes
+  ol_cv_header_db1=yes
 else
   rm -rf conftest*
-  ol_cv_header_db2=no
+  ol_cv_header_db1=no
 fi
 rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_header_db2" 1>&6
-else
-       ol_cv_header_db2=no
-fi
-
+echo "$ac_t""$ol_cv_header_db1" 1>&6
 
- echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
-echo "configure:10045: checking for Berkeley DB2" >&5
-if eval "test \"\${ol_cv_berkeley_db2+set}\" = set"; then
+       if test ol_cv_header_db1=yes ; then
+               ol_cv_lib_db=no
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
+echo "configure:11324: checking for Berkeley DB link (default)" >&5
+if eval "test \"\${ol_cv_db_none+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
-               ol_cv_berkeley_db2=no
-       else
-               ol_cv_berkeley_db2=yes
-       fi
+       ol_DB_LIB=
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
 
-fi
+       cat > conftest.$ac_ext <<EOF
+#line 11334 "configure"
+#include "confdefs.h"
 
-echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
- if test $ol_cv_berkeley_db2 = yes ; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_BERKELEY_DB2 1
-EOF
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
 
- fi
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
 
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
 
-       if test $ol_cv_berkeley_db2 = yes ; then
-               ol_link_ldbm=db2
-               ol_with_ldbm_api=db2
+int main() {
 
-               if test $ol_with_ldbm_type = hash ; then
-                       cat >> confdefs.h <<\EOF
-#define LDBM_USE_DBHASH 1
-EOF
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
 
-               else
-                       cat >> confdefs.h <<\EOF
-#define LDBM_USE_DBBTREE 1
+; return 0; }
 EOF
+if { (eval echo configure:11363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_none=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_none=no
+fi
+rm -f conftest*
 
-               fi
+       LIBS="$ol_LIBS"
 
-                                               if test $ol_cv_lib_db2 != yes ; then
-                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
-               fi
-       fi
 fi
 
-ol_link_bdb2=no
-if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
-       ol_link_bdb2=yes
+echo "$ac_t""$ol_cv_db_none" 1>&6
+
+       if test $ol_cv_db_none = yes ; then
+               ol_cv_lib_db=yes
+       fi
 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:10096: checking for Berkeley DB library" >&5
-if eval "test \"\${ol_cv_lib_db+set}\" = set"; then
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
+echo "configure:11387: checking for Berkeley DB link (-ldb)" >&5
+if eval "test \"\${ol_cv_db_db+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       for ac_hdr in db1/db.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10105: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 10110 "configure"
+       ol_DB_LIB=-ldb
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 11397 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
+int main() {
+
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:11426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ol_cv_db_db=yes
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  ol_cv_db_db=no
 fi
 rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
+
+echo "$ac_t""$ol_cv_db_db" 1>&6
+
+       if test $ol_cv_db_db = yes ; then
+               ol_cv_lib_db=-ldb
+       fi
 fi
-done
 
-       ol_LIBS="$LIBS"
-       echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:10143: checking for dbopen" >&5
-if eval "test \"\${ac_cv_func_dbopen+set}\" = set"; then
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
+echo "configure:11450: checking for Berkeley DB link (-ldb3)" >&5
+if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 10148 "configure"
+  
+       ol_DB_LIB=-ldb3
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 11460 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dbopen(); 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 dbopen();
-char (*f)();
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
 
 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_dbopen) || defined (__stub___dbopen)
-choke me
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
 #else
-f = dbopen;
+       (void) dbopen( NULL, 0, 0, 0, NULL);
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:10172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_dbopen=yes"
+  ol_cv_db_db3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_dbopen=no"
+  ol_cv_db_db3=no
 fi
 rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
 fi
 
-if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  ol_cv_lib_db=yes
-else
-  echo "$ac_t""no" 1>&6
+echo "$ac_t""$ol_cv_db_db3" 1>&6
 
-               echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
-echo "configure:10191: checking for dbopen in -ldb1" >&5
-ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+       if test $ol_cv_db_db3 = yes ; then
+               ol_cv_lib_db=-ldb3
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
+echo "configure:11513: checking for Berkeley DB link (-ldb2)" >&5
+if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldb1  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10199 "configure"
+  
+       ol_DB_LIB=-ldb2
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 11523 "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 dbopen();
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
 
 int main() {
-dbopen()
+
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:10210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_db_db2=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_db_db2=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
+
+       LIBS="$ol_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  ol_cv_lib_db=-ldb1
-else
-  echo "$ac_t""no" 1>&6
 
-                       echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:10230: checking for dbopen in -ldb" >&5
-ac_lib_var=`echo db'_'dbopen | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+echo "$ac_t""$ol_cv_db_db2" 1>&6
+
+       if test $ol_cv_db_db2 = yes ; then
+               ol_cv_lib_db=-ldb2
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
+echo "configure:11576: checking for Berkeley DB link (-ldb1)" >&5
+if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldb  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10238 "configure"
+  
+       ol_DB_LIB=-ldb1
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 11586 "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 dbopen();
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
 
 int main() {
-dbopen()
+
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:10249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_db_db1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_db_db1=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_cv_lib_db=-ldb
-else
-  echo "$ac_t""no" 1>&6
-ol_cv_lib_db=no
-fi
 
-               
-fi
+       LIBS="$ol_LIBS"
 
-       
 fi
 
-       LIBS="$ol_LIBS"
+echo "$ac_t""$ol_cv_db_db1" 1>&6
 
+       if test $ol_cv_db_db1 = yes ; then
+               ol_cv_lib_db=-ldb1
+       fi
 fi
 
-echo "$ac_t""$ol_cv_lib_db" 1>&6
 
+               if test "$ol_cv_lib_db" != no ; then
+                       ol_cv_berkeley_db=yes
+               fi
+       fi
+fi
 
-for ac_hdr in db_185.h
+       else
+               ol_cv_berkeley_db=no
+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:10287: checking for $ac_hdr" >&5
+echo "configure:11650: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10292 "configure"
+#line 11655 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 fi
 done
 
-if test "$ol_cv_header_db2" = yes ; then
-       
-       ol_cv_header_db=$ac_cv_header_db_185_h
+if test $ac_cv_header_db_h = yes; then
+       ol_cv_lib_db=no
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
+echo "configure:11690: checking for Berkeley DB link (default)" >&5
+if eval "test \"\${ol_cv_db_none+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 11700 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
+int main() {
+
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:11729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_none=yes
 else
-       ol_cv_header_db=$ac_cv_header_db_h
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_none=no
 fi
+rm -f conftest*
 
+       LIBS="$ol_LIBS"
 
- echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
-echo "configure:10333: checking for Berkeley DB" >&5
-if eval "test \"\${ol_cv_berkeley_db+set}\" = set"; then
+fi
+
+echo "$ac_t""$ol_cv_db_none" 1>&6
+
+       if test $ol_cv_db_none = yes ; then
+               ol_cv_lib_db=yes
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
+echo "configure:11753: checking for Berkeley DB link (-ldb)" >&5
+if eval "test \"\${ol_cv_db_db+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
-               ol_cv_berkeley_db=no
-       else
-               ol_cv_berkeley_db=yes
-       fi
+       ol_DB_LIB=-ldb
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
 
-fi
+       cat > conftest.$ac_ext <<EOF
+#line 11763 "configure"
+#include "confdefs.h"
 
-echo "$ac_t""$ol_cv_berkeley_db" 1>&6
- if test $ol_cv_berkeley_db = yes ; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_BERKELEY_DB 1
-EOF
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
 
- fi
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
 
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
 
-       if test $ol_cv_berkeley_db = yes ; then
-               ol_link_ldbm=db
-               ol_with_ldbm_api=db
+int main() {
 
-               if test $ol_with_ldbm_type = hash ; then
-                       cat >> confdefs.h <<\EOF
-#define LDBM_USE_DBHASH 1
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
+; return 0; }
 EOF
+if { (eval echo configure:11792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db=no
+fi
+rm -f conftest*
 
-               else
-                       cat >> confdefs.h <<\EOF
-#define LDBM_USE_DBBTREE 1
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db" 1>&6
+
+       if test $ol_cv_db_db = yes ; then
+               ol_cv_lib_db=-ldb
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
+echo "configure:11816: checking for Berkeley DB link (-ldb3)" >&5
+if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb3
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 11826 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
+int main() {
+
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
+; return 0; }
 EOF
+if { (eval echo configure:11855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db3=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db3=no
+fi
+rm -f conftest*
 
-               fi
+       LIBS="$ol_LIBS"
 
-                                               if test $ol_cv_lib_db != yes ; then
-                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
-               fi
+fi
+
+echo "$ac_t""$ol_cv_db_db3" 1>&6
+
+       if test $ol_cv_db_db3 = yes ; then
+               ol_cv_lib_db=-ldb3
        fi
 fi
 
-if test $ol_with_ldbm_api = manual ; then
-               ol_link_ldbm=yes
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
+echo "configure:11879: checking for Berkeley DB link (-ldb2)" >&5
+if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb2
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
 
-       echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
+       cat > conftest.$ac_ext <<EOF
+#line 11889 "configure"
+#include "confdefs.h"
 
-       for ac_hdr in db.h db_185.h gdbm.h ndbm.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10386: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
+int main() {
+
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:11918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db2=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db2=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db2" 1>&6
+
+       if test $ol_cv_db_db2 = yes ; then
+               ol_cv_lib_db=-ldb2
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
+echo "configure:11942: checking for Berkeley DB link (-ldb1)" >&5
+if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 10391 "configure"
+  
+       ol_DB_LIB=-ldb1
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 11952 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
+int main() {
+
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:11981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ol_cv_db_db1=yes
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  ol_cv_db_db1=no
 fi
 rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+
+echo "$ac_t""$ol_cv_db_db1" 1>&6
+
+       if test $ol_cv_db_db1 = yes ; then
+               ol_cv_lib_db=-ldb1
+       fi
+fi
+
+
+       if test "$ol_cv_lib_db" != no ; then
+               ol_cv_berkeley_db=yes
+               echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
+echo "configure:12007: checking for Berkeley DB thread support" >&5
+if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_LIBS="$LIBS"
+       if test $ol_cv_lib_db != yes ; then
+               LIBS="$ol_cv_lib_db"
+       fi
+
+       if test "$cross_compiling" = yes; then
+  ol_cv_berkeley_db_thread=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 12021 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_DB_185_H
+       choke me;
+#else
+#include <db.h>
+#endif
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+main()
+{
+       int rc;
+       u_int32_t flags = DB_CREATE | DB_THREAD;
+
+#if DB_VERSION_MAJOR > 2
+       DB_ENV *env = NULL;
+
+       rc = db_env_create( &env, 0 );
+
+       if( rc == 0 ) {
+#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
+               rc = env->open( env, NULL, flags, 0 );
+#else
+               rc = env->open( env, NULL, NULL, flags, 0 );
+#endif
+       }
+
+#else
+       DB_ENV env;
+       memset( &env, '\0', sizeof(env) );
+
+       rc = db_appinit( NULL, NULL, &env, flags );
+
+       if( rc == 0 ) {
+               db_appexit( &env );
+       }
+#endif
+#if DB_VERSION_MAJOR > 2
+#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
+       env->remove( env, NULL, DB_FORCE);
+#else
+       env->remove( env, NULL, NULL, DB_FORCE);
+#endif
+#endif
+
+       return rc;
+}
+EOF
+if { (eval echo configure:12071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ol_cv_berkeley_db_thread=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_cv_berkeley_db_thread=no
+fi
+rm -fr conftest*
+fi
+
+
+       LIBS="$ol_LIBS"
+
+       if test $ol_cv_berkeley_db_thread != no ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_BERKELEY_DB_THREAD 1
+EOF
+
+       fi
+
+fi
+
+echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
+       fi
+fi
+
+       fi
+
+       if test $ol_cv_berkeley_db != no ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_BERKELEY_DB 1
+EOF
+
+
+               ol_link_ldbm=berkeley
+               ol_with_ldbm_api=db
+
+               if test $ol_with_ldbm_type = hash ; then
+                       cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBHASH 1
+EOF
+
+               else
+                       cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBBTREE 1
 EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
+               fi
+
+                                               if test $ol_cv_lib_db != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
+               fi
+       fi
 fi
 
 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
        echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
-echo "configure:10431: checking for MDBM library" >&5
+echo "configure:12135: checking for MDBM library" >&5
 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
-echo "configure:10437: checking for mdbm_set_chain" >&5
+echo "configure:12141: checking for mdbm_set_chain" >&5
 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10442 "configure"
+#line 12146 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mdbm_set_chain(); below.  */
@@ -10462,7 +12166,7 @@ f = mdbm_set_chain;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_mdbm_set_chain=yes"
 else
@@ -10481,7 +12185,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
-echo "configure:10485: checking for mdbm_set_chain in -lmdbm" >&5
+echo "configure:12189: checking for mdbm_set_chain in -lmdbm" >&5
 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10489,7 +12193,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10493 "configure"
+#line 12197 "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
@@ -10500,7 +12204,7 @@ int main() {
 mdbm_set_chain()
 ; return 0; }
 EOF
-if { (eval echo configure:10504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10535,17 +12239,17 @@ echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10539: checking for $ac_hdr" >&5
+echo "configure:12243: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10544 "configure"
+#line 12248 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10572,7 +12276,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:10576: checking for db" >&5
+echo "configure:12280: checking for db" >&5
 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 
 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:10609: checking for GDBM library" >&5
+echo "configure:12313: checking for GDBM library" >&5
 if eval "test \"\${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:10615: checking for gdbm_open" >&5
+echo "configure:12319: checking for gdbm_open" >&5
 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10620 "configure"
+#line 12324 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -10640,7 +12344,7 @@ f = gdbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gdbm_open=yes"
 else
@@ -10659,7 +12363,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:10663: checking for gdbm_open in -lgdbm" >&5
+echo "configure:12367: checking for gdbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10667,7 +12371,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10671 "configure"
+#line 12375 "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
@@ -10678,7 +12382,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10713,17 +12417,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:10717: checking for $ac_hdr" >&5
+echo "configure:12421: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10722 "configure"
+#line 12426 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10750,7 +12454,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:10754: checking for db" >&5
+echo "configure:12458: checking for db" >&5
 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10782,22 +12486,20 @@ EOF
        fi
 fi
 
-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
+if test $ol_with_ldbm_api = ndbm ; then
        echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:10790: checking for NDBM library" >&5
+echo "configure:12492: checking for NDBM library" >&5
 if eval "test \"\${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:10796: checking for dbm_open" >&5
+echo "configure:12498: checking for dbm_open" >&5
 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10801 "configure"
+#line 12503 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -10821,7 +12523,7 @@ f = dbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -10840,7 +12542,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:10844: checking for dbm_open in -lndbm" >&5
+echo "configure:12546: checking for dbm_open in -lndbm" >&5
 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10848,7 +12550,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10852 "configure"
+#line 12554 "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
@@ -10859,7 +12561,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10879,7 +12581,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:10883: checking for dbm_open in -ldbm" >&5
+echo "configure:12585: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10887,7 +12589,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10891 "configure"
+#line 12593 "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
@@ -10898,7 +12600,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10935,17 +12637,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:10939: checking for $ac_hdr" >&5
+echo "configure:12641: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10944 "configure"
+#line 12646 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10972,7 +12674,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:10976: checking for db" >&5
+echo "configure:12678: checking for db" >&5
 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11014,22 +12716,28 @@ if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
        ol_enable_ldbm=no
 fi
 
+if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
+       LINK_BINS_DYNAMIC="yes"
+else
+       LINK_BINS_DYNAMIC="no"
+fi
+
 if test $ol_enable_wrappers != no ; then
        for ac_hdr in tcpd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11023: checking for $ac_hdr" >&5
+echo "configure:12731: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11028 "configure"
+#line 12736 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11059,43 +12767,27 @@ done
        if test $ac_cv_header_tcpd_h != yes ; then
                have_wrappers=no
        else
-               echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
-echo "configure:11064: checking for main in -lwrap" >&5
-ac_lib_var=`echo wrap'_'main | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lwrap  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 11072 "configure"
+               cat > conftest.$ac_ext <<EOF
+#line 12772 "configure"
 #include "confdefs.h"
 
+int allow_severity = 0;
+int deny_severity  = 0;
+               
 int main() {
-main()
+hosts_access()
 ; return 0; }
 EOF
-if { (eval echo configure:11079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  have_wrappers=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  have_wrappers=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
-  have_wrappers=yes
-else
-  echo "$ac_t""no" 1>&6
-have_wrappers=no
-fi
-
        fi
 
        if test $have_wrappers = yes ; then
 #define HAVE_TCPD 1
 EOF
 
-               SLAPD_LIBS="$SLAPD_LIBS -lwrap"
+               WRAP_LIBS="-lwrap"
 
                                                echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:11110: checking for main in -lnsl" >&5
+echo "configure:12802: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11114,14 +12806,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11118 "configure"
+#line 12810 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:11125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
                echo "configure: warning: disabling wrappers support" 1>&2
                ol_enable_wrappers=no
+               WRAP_LIBS=""
        fi
 fi
 
 if test $ol_enable_syslog != no ; then
        echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:11165: checking for openlog" >&5
+echo "configure:12858: checking for openlog" >&5
 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11170 "configure"
+#line 12863 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -11190,7 +12883,7 @@ f = openlog;
 
 ; return 0; }
 EOF
-if { (eval echo configure:11194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_openlog=yes"
 else
 
 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-       if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
-               { echo "configure: error: could not find syslog" 1>&2; exit 1; }
-       fi
-       ol_enable_syslog=$ac_cv_func_openlog
-fi
-
-if test $ol_enable_dmalloc != no ; then
-       for ac_hdr in dmalloc.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11224: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 11229 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-       echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
-echo "configure:11261: checking for dmalloc_shutdown in -ldmalloc" >&5
-ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldmalloc  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 11269 "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 dmalloc_shutdown();
-
-int main() {
-dmalloc_shutdown()
-; return 0; }
-EOF
-if { (eval echo configure:11280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-ldmalloc $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-if test $ol_enable_tcl != no ; then
-       for ac_hdr in tcl.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11314: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 11319 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-       if test $ac_cv_header_tcl_h != yes ; then
-               have_tcl=no
-       else
-               echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
-echo "configure:11355: checking for main in -ltcl" >&5
-ac_lib_var=`echo tcl'_'main | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ltcl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 11363 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:11370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
-  have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
-else
-  echo "$ac_t""no" 1>&6
-have_tcl=no
-fi
-
-
-               if test $have_tcl != yes; then
-                       echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
-echo "configure:11394: checking for main in -ltcl7.6" >&5
-ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ltcl7.6  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 11402 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:11409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
-  have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
-else
-  echo "$ac_t""no" 1>&6
-have_tcl=no
-fi
-
-               fi
-
-               if test $have_tcl != yes; then
-                       echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
-echo "configure:11434: checking for main in -ltcl8.0" >&5
-ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ltcl8.0  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 11442 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:11449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
-  have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
-else
-  echo "$ac_t""no" 1>&6
-have_tcl=no
-fi
-
-               fi
-       fi
-
-       if test $have_tcl != yes ; then
-               echo "configure: warning: could not find -ltcl" 1>&2
-               if test $ol_enable_tcl = yes ; then
-                       { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
-               fi
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
 
-               ol_enable_tcl=no
+       if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
+               { echo "configure: error: could not find syslog" 1>&2; exit 1; }
        fi
+       ol_enable_syslog=$ac_cv_func_openlog
 fi
 
-# ud needs termcap (should insert check here)
 ol_link_termcap=no
 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:11489: checking for $ac_hdr" >&5
+echo "configure:12917: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11494 "configure"
+#line 12922 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11524,7 +12952,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:11528: checking for tputs in -ltermcap" >&5
+echo "configure:12956: checking for tputs in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11532,7 +12960,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11536 "configure"
+#line 12964 "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
@@ -11543,7 +12971,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:11547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11576,7 +13004,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:11580: checking for initscr in -lncurses" >&5
+echo "configure:13008: checking for initscr in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11584,7 +13012,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11588 "configure"
+#line 13016 "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
@@ -11595,7 +13023,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:11599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11635,20 +13063,21 @@ EOF
 fi
 
 ol_link_sasl=no
+ol_link_spasswd=no
 if test $ol_with_cyrus_sasl != no ; then
        ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
-echo "configure:11642: checking for sasl.h" >&5
+echo "configure:13071: checking for sasl.h" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11647 "configure"
+#line 13076 "configure"
 #include "confdefs.h"
 #include <sasl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11672,7 +13101,7 @@ fi
 
        if test $ac_cv_header_sasl_h = yes ; then
                echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
-echo "configure:11676: checking for sasl_client_init in -lsasl" >&5
+echo "configure:13105: checking for sasl_client_init in -lsasl" >&5
 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11680,7 +13109,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11684 "configure"
+#line 13113 "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
@@ -11691,7 +13120,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:11695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11723,23 +13152,58 @@ EOF
                fi
        fi
 
-       if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
-               { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
+       if test $ol_link_sasl = no ; then
+               if test $ol_with_cyrus_sasl != auto ; then
+                       { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
+               else
+                       echo "configure: warning: Could not locate Cyrus SASL" 1>&2
+                       echo "configure: warning: SASL authentication not supported!" 1>&2
+                       if test $ol_link_tls = no ; then
+                               echo "configure: warning: Strong authentication not supported!" 1>&2
+                       fi
+               fi
+       fi
+else
+       echo "configure: warning: SASL authentication not supported!" 1>&2
+       if test $ol_link_tls = no ; then
+               echo "configure: warning: Strong authentication not supported!" 1>&2
+       fi
+fi
+
+if test $cross_compiling != yes ; then
+       dev=no
+       if test -r /dev/urandom ; then
+               dev="/dev/urandom";
+       elif test -r /idev/urandom ; then
+               dev="/idev/urandom";
+       elif test -r /dev/srandom ; then
+               dev="/dev/srandom";
+       elif test -r /dev/random ; then
+               dev="/dev/random";
+       elif test -r /idev/random ; then
+               dev="/idev/random";
+       fi
+
+       if test $dev != no ; then
+               cat >> confdefs.h <<EOF
+#define URANDOM_DEVICE "$dev"
+EOF
+
        fi
 fi
 
 ol_link_fetch=no
 if test $ol_with_fetch != no ; then
-       ol=$LIBS
+       ol_LIBS=$LIBS
 LIBS="-lfetch -lcom_err $LIBS"
 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
-echo "configure:11737: checking fetch(3) library" >&5
+echo "configure:13201: checking fetch(3) library" >&5
 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 11743 "configure"
+#line 13207 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -11749,7 +13213,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:11753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_lib_fetch=yes
 else
@@ -11787,17 +13251,17 @@ if test $ol_with_readline != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11791: checking for $ac_hdr" >&5
+echo "configure:13255: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11796 "configure"
+#line 13260 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11828,7 +13292,7 @@ done
                save_LIBS="$LIBS"
                LIBS="$TERMCAP_LIBS $LIBS"
                echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:11832: checking for readline in -lreadline" >&5
+echo "configure:13296: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11836,7 +13300,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11840 "configure"
+#line 13304 "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
@@ -11847,7 +13311,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:11851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11887,15 +13351,14 @@ EOF
 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:11894: checking for crypt" >&5
+echo "configure:13357: checking for crypt" >&5
 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11899 "configure"
+#line 13362 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -11919,7 +13382,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:11923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -11938,7 +13401,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:11942: checking for crypt in -lcrypt" >&5
+echo "configure:13405: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11946,7 +13409,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11950 "configure"
+#line 13413 "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
@@ -11957,7 +13420,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:11961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11998,15 +13461,14 @@ EOF
        fi
 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:12005: checking for setproctitle" >&5
+echo "configure:13467: checking for setproctitle" >&5
 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12010 "configure"
+#line 13472 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -12030,7 +13492,7 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_setproctitle=yes"
 else
@@ -12049,7 +13511,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:12053: checking for setproctitle in -lutil" >&5
+echo "configure:13515: checking for setproctitle in -lutil" >&5
 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12057,7 +13519,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12061 "configure"
+#line 13523 "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
@@ -12068,7 +13530,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:12072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12089,6 +13551,7 @@ else
   echo "$ac_t""no" 1>&6
 have_setproctitle=no
                        LIBOBJS="$LIBOBJS setproctitle.o"
+                       LIBSRCS="$LIBSRCS setproctitle.c"
 fi
 
 fi
        fi
 fi
 
-echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:12107: checking for uid_t in sys/types.h" >&5
-if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 12112 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "uid_t" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_uid_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_uid_t=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_type_uid_t" 1>&6
-if test $ac_cv_type_uid_t = no; then
-  cat >> confdefs.h <<\EOF
-#define uid_t int
-EOF
-
-  cat >> confdefs.h <<\EOF
-#define gid_t int
-EOF
-
-fi
-
-echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:12141: checking type of array argument to getgroups" >&5
-if eval "test \"\${ac_cv_type_getgroups+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_type_getgroups=cross
-else
-  cat > conftest.$ac_ext <<EOF
-#line 12149 "configure"
-#include "confdefs.h"
-
-/* Thanks to Mike Rendell for this test.  */
-#include <sys/types.h>
-#define NGID 256
-#undef MAX
-#define MAX(x, y) ((x) > (y) ? (x) : (y))
-main()
-{
-  gid_t gidset[NGID];
-  int i, n;
-  union { gid_t gval; long lval; }  val;
-
-  val.lval = -1;
-  for (i = 0; i < NGID; i++)
-    gidset[i] = val.gval;
-  n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
-                 gidset);
-  /* Exit non-zero if getgroups seems to require an array of ints.  This
-     happens when gid_t is short but getgroups modifies an array of ints.  */
-  exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
-}
-
-EOF
-if { (eval echo configure:12174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-    ac_cv_type_getgroups=gid_t
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_type_getgroups=int
-fi
-rm -fr conftest*
-fi
-
-if test $ac_cv_type_getgroups = cross; then
-        cat > conftest.$ac_ext <<EOF
-#line 12188 "configure"
-#include "confdefs.h"
-#include <unistd.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_getgroups=gid_t
-else
-  rm -rf conftest*
-  ac_cv_type_getgroups=int
-fi
-rm -f conftest*
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_type_getgroups" 1>&6
-cat >> confdefs.h <<EOF
-#define GETGROUPS_T $ac_cv_type_getgroups
-EOF
-
- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:12211: checking for ANSI C header files" >&5
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:13570: checking for ANSI C header files" >&5
 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12216 "configure"
+#line 13575 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -12220,7 +13579,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12237,7 +13596,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 12241 "configure"
+#line 13600 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -12255,7 +13614,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 12259 "configure"
+#line 13618 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -12276,18 +13635,25 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 12280 "configure"
+#line 13639 "configure"
 #include "confdefs.h"
 #include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+#define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+#define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int main () { int i; for (i = 0; i < 256; i++)
 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:12291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -12311,18 +13677,19 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:12315: checking for mode_t" >&5
+echo "configure:13681: checking for mode_t" >&5
 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12320 "configure"
+#line 13686 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
 #endif
+
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
@@ -12346,18 +13713,19 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:12350: checking for off_t" >&5
+echo "configure:13717: checking for off_t" >&5
 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12355 "configure"
+#line 13722 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
 #endif
+
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
@@ -12381,18 +13749,19 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:12385: checking for pid_t" >&5
+echo "configure:13753: checking for pid_t" >&5
 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12390 "configure"
+#line 13758 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
 #endif
+
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
@@ -12416,19 +13785,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:12420: checking for ptrdiff_t" >&5
+echo "configure:13789: checking for ptrdiff_t" >&5
 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12425 "configure"
+#line 13794 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:12432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -12449,12 +13818,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:12453: checking return type of signal handlers" >&5
+echo "configure:13822: checking return type of signal handlers" >&5
 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12458 "configure"
+#line 13827 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -12471,7 +13840,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:12475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -12489,81 +13858,123 @@ cat >> confdefs.h <<EOF
 EOF
 
 
-echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:12494: checking for sig_atomic_t" >&5
-if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:13863: checking for size_t" >&5
+if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12499 "configure"
+#line 13868 "configure"
 #include "confdefs.h"
-#include <signal.h>
-int main() {
-sig_atomic_t atomic;
-; return 0; }
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+
 EOF
-if { (eval echo configure:12506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
-  ol_cv_type_sig_atomic_t=yes
+  eval "ac_cv_type_size_t=yes"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_type_sig_atomic_t=no
+  eval "ac_cv_type_size_t=no"
 fi
 rm -f conftest*
+
 fi
+if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+  cat >> confdefs.h <<EOF
+#define size_t unsigned
+EOF
 
-echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
-  if test $ol_cv_type_sig_atomic_t = no; then
-    cat >> confdefs.h <<\EOF
-#define sig_atomic_t int
+fi
+
+
+echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
+echo "configure:13900: checking for ssize_t" >&5
+if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 13905 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  eval "ac_cv_type_ssize_t=yes"
+else
+  rm -rf conftest*
+  eval "ac_cv_type_ssize_t=no"
+fi
+rm -f conftest*
+
+fi
+if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+  cat >> confdefs.h <<EOF
+#define ssize_t signed int
 EOF
 
-  fi
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:12527: checking for size_t" >&5
-if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
+fi
+
+echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
+echo "configure:13936: checking for caddr_t" >&5
+if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12532 "configure"
+#line 13941 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
 #endif
+
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
-  eval "ac_cv_type_size_t=yes"
+  eval "ac_cv_type_caddr_t=yes"
 else
   rm -rf conftest*
-  eval "ac_cv_type_size_t=no"
+  eval "ac_cv_type_caddr_t=no"
 fi
 rm -f conftest*
 
 fi
-if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
+if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
   echo "$ac_t""yes" 1>&6
 else
   echo "$ac_t""no" 1>&6
   cat >> confdefs.h <<EOF
-#define size_t unsigned
+#define caddr_t char *
 EOF
 
 fi
 
+
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:12562: checking for socklen_t" >&5
+echo "configure:13973: checking for socklen_t" >&5
 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12567 "configure"
+#line 13978 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -12577,7 +13988,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:12581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_socklen_t=yes
 else
@@ -12598,12 +14009,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:12602: checking for member st_blksize in aggregate type struct stat" >&5
+echo "configure:14013: checking for member st_blksize in aggregate type struct stat" >&5
 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12607 "configure"
+#line 14018 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -12611,7 +14022,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:12615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_struct_member_st_blksize=yes
 else
@@ -12633,12 +14044,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:12637: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:14048: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12642 "configure"
+#line 14053 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -12647,7 +14058,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:12651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -12668,12 +14079,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:12672: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:14083: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12677 "configure"
+#line 14088 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -12681,7 +14092,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:12685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -12701,15 +14112,84 @@ EOF
 
 fi
 
+echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
+echo "configure:14117: checking for uid_t in sys/types.h" >&5
+if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 14122 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "uid_t" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_uid_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_type_uid_t" 1>&6
+if test $ac_cv_type_uid_t = no; then
+  cat >> confdefs.h <<\EOF
+#define uid_t int
+EOF
+
+  cat >> confdefs.h <<\EOF
+#define gid_t int
+EOF
+
+fi
+
+echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
+echo "configure:14151: checking for sig_atomic_t" >&5
+if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 14156 "configure"
+#include "confdefs.h"
+#include <signal.h>
+int main() {
+sig_atomic_t atomic;
+; return 0; }
+EOF
+if { (eval echo configure:14163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_type_sig_atomic_t=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_type_sig_atomic_t=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
+  if test $ol_cv_type_sig_atomic_t = no; then
+    cat >> confdefs.h <<\EOF
+#define sig_atomic_t int
+EOF
+
+  fi
+
+
 # test for pw_gecos in struct passwd
 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
-echo "configure:12707: checking struct passwd for pw_gecos" >&5
+echo "configure:14187: checking struct passwd for pw_gecos" >&5
 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 12713 "configure"
+#line 14193 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -12719,7 +14199,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_gecos=yes
 else
 
 # test for pw_passwd in struct passwd
 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
-echo "configure:12745: checking struct passwd for pw_passwd" >&5
+echo "configure:14225: checking struct passwd for pw_passwd" >&5
 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 12751 "configure"
+#line 14231 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -12757,7 +14237,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_passwd=yes
 else
@@ -12779,7 +14259,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:12783: checking if toupper() requires islower()" >&5
+echo "configure:14263: checking if toupper() requires islower()" >&5
 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12788,7 +14268,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 12792 "configure"
+#line 14272 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -12800,7 +14280,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:12804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_c_upper_lower=no
 else
@@ -12823,12 +14303,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:12827: checking for working const" >&5
+echo "configure:14307: checking for working const" >&5
 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12832 "configure"
+#line 14312 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -12877,7 +14357,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -12898,12 +14378,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:12902: checking if compiler understands volatile" >&5
+echo "configure:14382: checking if compiler understands volatile" >&5
 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12907 "configure"
+#line 14387 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -12912,7 +14392,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:12916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -12940,30 +14420,16 @@ if test $cross_compiling = yes ; then
 #define CROSS_COMPILING 1
 EOF
 
-
-       cat >> confdefs.h <<\EOF
-#define LBER_INT_T long
-EOF
-
-       cat >> confdefs.h <<\EOF
-#define LBER_TAG_T long
-EOF
-
-       cat >> confdefs.h <<\EOF
-#define LBER_SOCKET_T int
-EOF
-
-
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:12960: checking whether byte ordering is bigendian" >&5
+echo "configure:14426: checking whether byte ordering is bigendian" >&5
 if eval "test \"\${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 12967 "configure"
+#line 14433 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -12974,11 +14440,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:12978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14444: \"$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 12982 "configure"
+#line 14448 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -12989,7 +14455,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:12993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -13009,7 +14475,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 13013 "configure"
+#line 14479 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -13022,7 +14488,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:13026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
 
 fi
 
-       echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:13050: checking size of short" >&5
+fi
+
+echo $ac_n "checking size of short""... $ac_c" 1>&6
+echo "configure:14518: checking size of short" >&5 
 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
-else
+  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 13058 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-main()
-{
-  FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
-  fprintf(f, "%d\n", sizeof(short));
-  exit(0);
-}
+#line 14524 "configure"
+#include "confdefs.h"
+#include "confdefs.h" 
+#include <sys/types.h> 
+
+int main() {
+switch (0) case 0: case (sizeof (short) == $ac_size):;
+; return 0; }
 EOF
-if { (eval echo configure:13069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_sizeof_short=`cat conftestval`
+if { (eval echo configure:14534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_sizeof_short=$ac_size
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_sizeof_short=0
-fi
-rm -fr conftest*
 fi
+rm -f conftest* 
+  if test x$ac_cv_sizeof_short != x ; then break; fi 
+done 
 
 fi
-echo "$ac_t""$ac_cv_sizeof_short" 1>&6
+if test x$ac_cv_sizeof_short = x ; then 
+  { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
+fi 
+echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
 cat >> confdefs.h <<EOF
 #define SIZEOF_SHORT $ac_cv_sizeof_short
 EOF
-
  
-       echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:13089: checking size of int" >&5
+echo $ac_n "checking size of int""... $ac_c" 1>&6
+echo "configure:14557: checking size of int" >&5 
 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
-else
+  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 13097 "configure"
+#line 14563 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-main()
-{
-  FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
-  fprintf(f, "%d\n", sizeof(int));
-  exit(0);
-}
+#include "confdefs.h" 
+#include <sys/types.h> 
+
+int main() {
+switch (0) case 0: case (sizeof (int) == $ac_size):;
+; return 0; }
 EOF
-if { (eval echo configure:13108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_sizeof_int=`cat conftestval`
+if { (eval echo configure:14573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_sizeof_int=$ac_size
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_sizeof_int=0
-fi
-rm -fr conftest*
 fi
+rm -f conftest* 
+  if test x$ac_cv_sizeof_int != x ; then break; fi 
+done 
 
 fi
-echo "$ac_t""$ac_cv_sizeof_int" 1>&6
+if test x$ac_cv_sizeof_int = x ; then 
+  { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
+fi 
+echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
 cat >> confdefs.h <<EOF
 #define SIZEOF_INT $ac_cv_sizeof_int
 EOF
-
  
-       echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:13128: checking size of long" >&5
+echo $ac_n "checking size of long""... $ac_c" 1>&6
+echo "configure:14596: checking size of long" >&5 
 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test "$cross_compiling" = yes; then
-    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
-else
+  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 13136 "configure"
+#line 14602 "configure"
 #include "confdefs.h"
-#include <stdio.h>
-main()
-{
-  FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
-  fprintf(f, "%d\n", sizeof(long));
-  exit(0);
-}
+#include "confdefs.h" 
+#include <sys/types.h> 
+
+int main() {
+switch (0) case 0: case (sizeof (long) == $ac_size):;
+; return 0; }
 EOF
-if { (eval echo configure:13147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_sizeof_long=`cat conftestval`
+if { (eval echo configure:14612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_sizeof_long=$ac_size
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_sizeof_long=0
-fi
-rm -fr conftest*
 fi
+rm -f conftest* 
+  if test x$ac_cv_sizeof_long != x ; then break; fi 
+done 
 
 fi
-echo "$ac_t""$ac_cv_sizeof_long" 1>&6
+if test x$ac_cv_sizeof_long = x ; then 
+  { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
+fi 
+echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
 cat >> confdefs.h <<EOF
 #define SIZEOF_LONG $ac_cv_sizeof_long
 EOF
 
 
+if test "$ac_cv_sizeof_int" -lt 4 ; then
+       echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
 
-       if test "$ac_cv_sizeof_int" -lt 4 ; then
-               echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
-
-               cat >> confdefs.h <<\EOF
+       cat >> confdefs.h <<\EOF
 #define LBER_INT_T long
 EOF
 
-               cat >> confdefs.h <<\EOF
-#define LBER_TAG_T long
-EOF
-
-               cat >> confdefs.h <<\EOF
-#define LBER_SOCKET_T int
-EOF
-
-       else
-               cat >> confdefs.h <<\EOF
+else
+       cat >> confdefs.h <<\EOF
 #define LBER_INT_T int
 EOF
 
-               cat >> confdefs.h <<\EOF
-#define LBER_TAG_T long
+fi
+
+cat >> confdefs.h <<\EOF
+#define LBER_LEN_T long
 EOF
 
-               cat >> confdefs.h <<\EOF
+cat >> confdefs.h <<\EOF
 #define LBER_SOCKET_T int
 EOF
 
-       fi
-fi
-
 cat >> confdefs.h <<\EOF
-#define LBER_LEN_T long
+#define LBER_TAG_T long
 EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:13204: checking for 8-bit clean memcmp" >&5
+echo "configure:14663: checking for 8-bit clean memcmp" >&5
 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13208,7 +14667,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 13212 "configure"
+#line 14671 "configure"
 #include "confdefs.h"
 
 main()
@@ -13218,7 +14677,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:13222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -13236,12 +14695,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:13240: checking for strftime" >&5
+echo "configure:14699: checking for strftime" >&5
 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13245 "configure"
+#line 14704 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -13265,7 +14724,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -13287,7 +14746,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:13291: checking for strftime in -lintl" >&5
+echo "configure:14750: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13295,7 +14754,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13299 "configure"
+#line 14758 "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
@@ -13306,7 +14765,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:13310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 
 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
-echo "configure:13338: checking for inet_aton()" >&5
+echo "configure:14797: checking for inet_aton()" >&5
 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13343 "configure"
+#line 14802 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -13361,7 +14820,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:13365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_func_inet_aton=yes
 else
   fi
  
 
+echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
+echo "configure:14846: checking for _spawnlp" >&5
+if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 14851 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char _spawnlp(); 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 _spawnlp();
+char (*f)();
+
+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__spawnlp) || defined (__stub____spawnlp)
+choke me
+#else
+f = _spawnlp;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:14875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func__spawnlp=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func__spawnlp=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_SPAWNLP 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
+echo "configure:14899: checking for _snprintf" >&5
+if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 14904 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char _snprintf(); 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 _snprintf();
+char (*f)();
+
+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__snprintf) || defined (__stub____snprintf)
+choke me
+#else
+f = _snprintf;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:14928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func__snprintf=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func__snprintf=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ac_cv_func_snprintf=yes
+       cat >> confdefs.h <<\EOF
+#define snprintf _snprintf
+EOF
+
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
+echo "configure:14954: checking for _vsnprintf" >&5
+if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 14959 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char _vsnprintf(); 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 _vsnprintf();
+char (*f)();
+
+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__vsnprintf) || defined (__stub____vsnprintf)
+choke me
+#else
+f = _vsnprintf;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:14983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func__vsnprintf=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func__vsnprintf=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ac_cv_func_vsnprintf=yes
+       cat >> confdefs.h <<\EOF
+#define vsnprintf _vsnprintf
+EOF
+
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:13387: checking for vprintf" >&5
+echo "configure:15009: checking for vprintf" >&5
 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13392 "configure"
+#line 15014 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -13412,7 +15034,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:13440: checking for _doprnt" >&5
+echo "configure:15062: checking for _doprnt" >&5
 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13445 "configure"
+#line 15067 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -13465,7 +15087,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -13494,12 +15116,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:13498: checking for $ac_func" >&5
+echo "configure:15120: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13503 "configure"
+#line 15125 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -13523,7 +15145,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -13552,6 +15174,7 @@ fi
 for ac_func in \
        bcopy                   \
        closesocket             \
+       chroot                  \
        endgrent                \
        endpwent                \
        flock                   \
@@ -13559,6 +15182,7 @@ for ac_func in \
        getgrgid                \
        gethostname             \
        getpass                 \
+       getpassphrase   \
        getpwuid                \
        getpwnam                \
        getspnam                \
@@ -13568,6 +15192,7 @@ for ac_func in \
        memcpy                  \
        memmove                 \
        mkstemp                 \
+       pipe                    \
        read                    \
        recv                    \
        recvfrom                \
@@ -13577,6 +15202,7 @@ for ac_func in \
        setsid                  \
        setuid                  \
        seteuid                 \
+       sigaction               \
        signal                  \
        sigset                  \
        snprintf                \
@@ -13598,12 +15224,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13602: checking for $ac_func" >&5
+echo "configure:15228: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13607 "configure"
+#line 15233 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -13627,7 +15253,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -13655,12 +15281,12 @@ done
 for ac_func in getopt tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13659: checking for $ac_func" >&5
+echo "configure:15285: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 13664 "configure"
+#line 15290 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -13684,7 +15310,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -13711,25 +15337,36 @@ done
 
 
 
+if test "$ac_cv_func_getopt" != yes; then
+    LIBSRCS="$LIBSRCS getopt.c"
+fi
+
+if test "$ac_cv_func_tempnam" != yes; then
+    LIBSRCS="$LIBSRCS tempnam.c"
+fi
+
 # Check Configuration
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:13717: checking declaration of sys_errlist" >&5
+echo "configure:15351: checking declaration of sys_errlist" >&5
 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 13723 "configure"
+#line 15357 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
 #include <sys/types.h>
-#include <errno.h> 
+#include <errno.h>
+#ifdef WINNT
+#include <stdlib.h>
+#endif 
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:13733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
        ol_cv_have_sys_errlist=yes
@@ -13752,20 +15389,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:13756: checking existence of sys_errlist" >&5
+echo "configure:15393: checking existence of sys_errlist" >&5
 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 13762 "configure"
+#line 15399 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:13769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_have_sys_errlist=yes
 else
@@ -13812,9 +15449,9 @@ if test "$ol_enable_cache" = no ; then
 EOF
 
 fi
-if test "$ol_enable_dns" != no ; then
+if test "$ol_link_kbind" != no ; then
        cat >> confdefs.h <<\EOF
-#define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
+#define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
 EOF
 
 fi
@@ -13830,22 +15467,39 @@ if test "$ol_enable_referrals" != no ; then
 EOF
 
 fi
-if test "$ol_enable_cldap" != no ; then
+if test "$ol_enable_local" != no; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_PF_LOCAL 1
+EOF
+
+fi
+if test "$ol_enable_ipv6" != no; then
        cat >> confdefs.h <<\EOF
-#define LDAP_CONNECTIONLESS 1
+#define LDAP_PF_INET6 1
 EOF
 
 fi
+if test "$ol_enable_cleartext" != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_CLEARTEXT 1
+EOF
 
+fi
 if test "$ol_enable_crypt" != no ; then
        cat >> confdefs.h <<\EOF
 #define SLAPD_CRYPT 1
 EOF
 
 fi
-if test "$ol_enable_cleartext" != no ; then
+if test "$ol_link_kpasswd" != no ; then
        cat >> confdefs.h <<\EOF
-#define SLAPD_CLEARTEXT 1
+#define SLAPD_KPASSWD 1
+EOF
+
+fi
+if test "$ol_link_spasswd" != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_SPASSWD 1
 EOF
 
 fi
@@ -13866,6 +15520,12 @@ if test "$ol_enable_rlookups" != no ; then
 #define SLAPD_RLOOKUPS 1
 EOF
 
+fi
+if test "$ol_enable_aci" != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_ACI_ENABLED 1
+EOF
+
 fi
 
 if test "$ol_link_modules" != no ; then
@@ -13874,25 +15534,24 @@ if test "$ol_link_modules" != no ; then
 EOF
 
        BUILD_SLAPD=yes
-       MODULES_LIBS=-lltdl
        SLAPD_MODULES_LDFLAGS="-dlopen self"
 fi
 
-if test "$ol_link_bdb2" != no ; then
+if test "$ol_link_dnssrv" != no ; then
        cat >> confdefs.h <<\EOF
-#define SLAPD_BDB2 1
+#define SLAPD_DNSSRV 1
 EOF
 
        BUILD_SLAPD=yes
-       BUILD_BDB2=yes
-       if test "$ol_with_bdb2_module" != static ; then
+       BUILD_DNSSRV=yes
+       if test "$ol_with_dnssrv_module" != static ; then
                cat >> confdefs.h <<\EOF
-#define SLAPD_BDB2_DYNAMIC 1
+#define SLAPD_DNSSRV_DYNAMIC 1
 EOF
 
-               BUILD_BDB2=mod
-               BUILD_BDB2_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb2/back_bdb2.la"
+               BUILD_DNSSRV=mod
+               BUILD_DNSSRV_DYNAMIC=shared
+               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
        fi
 fi
 
@@ -13950,24 +15609,6 @@ EOF
        fi
 fi
 
-if test "$ol_link_perl" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_PERL 1
-EOF
-
-       BUILD_SLAPD=yes
-       BUILD_PERL=yes
-       if test "$ol_with_perl_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_PERL_DYNAMIC 1
-EOF
-
-               BUILD_PERL=mod
-               BUILD_PERL_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
-       fi
-fi
-
 if test "$ol_enable_shell" != no ; then
        cat >> confdefs.h <<\EOF
 #define SLAPD_SHELL 1
@@ -13986,21 +15627,22 @@ EOF
        fi
 fi
 
-if test "$ol_enable_tcl" != no ; then
+if test "$ol_enable_sql" != no ; then
        cat >> confdefs.h <<\EOF
-#define SLAPD_TCL 1
+#define SLAPD_SQL 1
 EOF
 
        BUILD_SLAPD=yes
-       BUILD_TCL=yes
-       if test "$ol_with_tcl_module" != static; then
+       BUILD_SQL=yes
+       SLAPD_SQL_LIBS=-liodbc
+       if test "$ol_with_sql_module" != static; then
                cat >> confdefs.h <<\EOF
-#define SLAPD_TCL_DYNAMIC 1
+#define SLAPD_SQL_DYNAMIC 1
 EOF
 
-               BUILD_TCL=mod
-               BUILD_TCL_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
+               BUILD_SQL=mod
+               BUILD_SQL_DYNAMIC=shared
+               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
        fi
 fi
 
@@ -14010,6 +15652,29 @@ if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
 fi
 
 
+if test "$LINK_BINS_DYNAMIC" = yes; then
+    LIB_LINKAGE=DYN
+    LT_LIB_LINKAGE=shared
+else
+    LIB_LINKAGE=STAT
+    LT_LIB_LINKAGE=static
+fi
+
+if test "$ac_cv_mingw32" = yes ; then
+    PLAT=NT
+    DYN_EXT=dll
+else
+    PLAT=UNIX
+    DYN_EXT=so
+fi
+
+
+
+
+
+
+
+
 
   
   
   
   
   
-  
-  
-  
+
+
+
+
+
 
 
 
@@ -14121,6 +15788,7 @@ clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
+clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
 include/Makefile:build/top.mk:include/Makefile.in \
 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk     \
@@ -14130,16 +15798,16 @@ libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.
 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk     \
 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \
 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \
+libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk \
 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk       \
 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
-servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
+servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
-servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
-servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
+servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
@@ -14214,37 +15882,39 @@ s%@top_builddir@%$top_builddir%g
 s%@ldap_subdir@%$ldap_subdir%g
 s%@CC@%$CC%g
 s%@RANLIB@%$RANLIB%g
-s%@LD@%$LD%g
-s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
+s%@DLLTOOL@%$DLLTOOL%g
+s%@AS@%$AS%g
+s%@OBJDUMP@%$OBJDUMP%g
 s%@LIBTOOL@%$LIBTOOL%g
 s%@LN_H@%$LN_H%g
 s%@SENDMAIL@%$SENDMAIL%g
 s%@EDITOR@%$EDITOR%g
 s%@FINGER@%$FINGER%g
-s%@PERLBIN@%$PERLBIN%g
 s%@CPP@%$CPP%g
 s%@EXEEXT@%$EXEEXT%g
 s%@OBJEXT@%$OBJEXT%g
 s%@OL_MKDEP@%$OL_MKDEP%g
 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
 s%@LIBOBJS@%$LIBOBJS%g
+s%@LIBSRCS@%$LIBSRCS%g
+s%@PLAT@%$PLAT%g
+s%@LIB_LINKAGE@%$LIB_LINKAGE%g
+s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
+s%@DYN_EXT@%$DYN_EXT%g
 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
-s%@BUILD_BDB2@%$BUILD_BDB2%g
+s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
 s%@BUILD_LDAP@%$BUILD_LDAP%g
 s%@BUILD_LDBM@%$BUILD_LDBM%g
 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
-s%@BUILD_PERL@%$BUILD_PERL%g
-s%@BUILD_QUIPU@%$BUILD_QUIPU%g
 s%@BUILD_SHELL@%$BUILD_SHELL%g
-s%@BUILD_TCL@%$BUILD_TCL%g
-s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
+s%@BUILD_SQL@%$BUILD_SQL%g
+s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
-s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
-s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
+s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
 s%@LDAP_LIBS@%$LDAP_LIBS%g
 s%@LDIF_LIBS@%$LDIF_LIBS%g
@@ -14253,17 +15923,22 @@ s%@SLURPD_LIBS@%$SLURPD_LIBS%g
 s%@LDBM_LIBS@%$LDBM_LIBS%g
 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
+s%@WRAP_LIBS@%$WRAP_LIBS%g
+s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
-s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
-s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
-s%@KRB_LIBS@%$KRB_LIBS%g
+s%@KRB4_LIBS@%$KRB4_LIBS%g
+s%@KRB5_LIBS@%$KRB5_LIBS%g
 s%@READLINE_LIBS@%$READLINE_LIBS%g
 s%@SASL_LIBS@%$SASL_LIBS%g
 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
 s%@TLS_LIBS@%$TLS_LIBS%g
 s%@MODULES_LIBS@%$MODULES_LIBS%g
+s%@AUTH_LIBS@%$AUTH_LIBS%g
+s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
+s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
+s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
 
 CEOF
 EOF
@@ -14320,6 +15995,7 @@ clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
+clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
 include/Makefile:build/top.mk:include/Makefile.in \
 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk     \
@@ -14329,16 +16005,16 @@ libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.
 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk     \
 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \
 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \
+libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk \
 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk       \
 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
-servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/mod.mk \
+servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
-servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
-servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
+servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
@@ -14391,7 +16067,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
   rm -f "$ac_file"
   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
   case "$ac_file" in
-  *Makefile*) ac_comsub="1i\\
+  *[Mm]akefile*) ac_comsub="1i\\
 # $configure_input" ;;
   *) ac_comsub= ;;
   esac