]> git.sur5r.net Git - openldap/blobdiff - configure
add (optional) concurrency test for back-sql
[openldap] / configure
index de0e5f1847189b04b882519d8a3ca3fb665f6736..2c711fceb237447114a9d2dcb9740f28e0b15c7b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,10 +1,10 @@
 #! /bin/sh
 # $OpenLDAP$
-# from OpenLDAP: pkg/ldap/configure.in,v 1.507 2003/12/14 05:46:35 kurt Exp  
+# from OpenLDAP: pkg/ldap/configure.in,v 1.586 2005/08/07 16:08:02 hallvard Exp  
 
 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
 #
-# Copyright 1998-2004 The OpenLDAP Foundation.
+# Copyright 1998-2005 The OpenLDAP Foundation.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
 # top-level directory of the distribution or, alternatively, at
 # <http://www.OpenLDAP.org/license.html>.
 
-echo "Copyright 1998-2004 The OpenLDAP Foundation. All rights reserved."
+echo "Copyright 1998-2005 The OpenLDAP Foundation. All rights reserved."
 echo " Restrictions apply, see COPYRIGHT and LICENSE files."
 
 # Guess values for system-dependent variables and create Makefiles.
@@ -44,8 +44,6 @@ ac_help="$ac_help
   --enable-ipv6          enable IPv6 support [auto]"
 ac_help="$ac_help
   --enable-local         enable AF_LOCAL (AF_UNIX) socket support [auto]"
-ac_help="$ac_help
-  --enable-x-compile     enable cross compiling [no]"
 ac_help="$ac_help
   --with-cyrus-sasl      with Cyrus SASL support [auto]"
 ac_help="$ac_help
@@ -57,6 +55,10 @@ ac_help="$ac_help
 ac_help="$ac_help
   --with-yielding-select  with implicitly yielding select [auto]"
 ac_help="$ac_help
+  --with-multiple-precision
+                          multiple precision support for statistics
+                         auto|bignum|gmp [auto]"
+ac_help="$ac_help
 
 SLAPD (Standalone LDAP Daemon) Options:"
 ac_help="$ac_help
@@ -74,7 +76,7 @@ ac_help="$ac_help
 ac_help="$ac_help
     --enable-modules     enable dynamic module support [no]"
 ac_help="$ac_help
-    --enable-rewrite     enable DN rewriting in back-ldap and back-meta [no]"
+    --enable-rewrite     enable DN rewriting in back-ldap and rwm overlay [auto]"
 ac_help="$ac_help
     --enable-rlookups    enable reverse lookups of client hostnames [no]"
 ac_help="$ac_help
@@ -84,66 +86,73 @@ ac_help="$ac_help
 ac_help="$ac_help
     --enable-wrappers    enable tcp wrapper support [no]"
 ac_help="$ac_help
-    --enable-bdb         enable Berkeley DB backend [yes]"
+
+SLAPD Backend Options:"
+ac_help="$ac_help
+    --enable-backends    enable all available backends no|yes|mod"
 ac_help="$ac_help
-    --with-bdb-module     module type static|dynamic [static]"
+    --enable-bdb         enable Berkeley DB backend no|yes|mod [${ol_dflt_backends-yes}]"
 ac_help="$ac_help
-    --enable-dnssrv      enable dnssrv backend [no]"
+    --enable-dnssrv      enable dnssrv backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --with-dnssrv-module  module type static|dynamic [static]"
+    --enable-hdb         enable Hierarchical DB backend no|yes|mod [${ol_dflt_backends-yes}]"
 ac_help="$ac_help
-    --enable-hdb         enable Hierarchical DB backend [no]"
+    --enable-ldap        enable ldap backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --with-hdb-module     module type static|dynamic [static]"
+    --enable-ldbm        enable ldbm backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --enable-ldap        enable ldap backend [no]"
+      --with-ldbm-api     with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
 ac_help="$ac_help
-    --with-ldap-module   module type static|dynamic [static]"
+      --with-ldbm-type   use LDBM type auto|btree|hash [auto]"
 ac_help="$ac_help
-    --enable-ldbm        enable ldbm backend [no]"
+    --enable-meta        enable metadirectory backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
+    --enable-monitor     enable monitor backend no|yes|mod [${ol_dflt_backends-yes}]"
 ac_help="$ac_help
-    --with-ldbm-module   module type static|dynamic [static]"
+    --enable-null        enable null backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --with-ldbm-type     use LDBM type auto|btree|hash [auto]"
+    --enable-passwd      enable passwd backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --enable-meta        enable metadirectory backend [no]"
+    --enable-perl        enable perl backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --with-meta-module   module type static|dynamic [static]"
+    --enable-relay       enable relay backend no|yes|mod [${ol_dflt_backends-yes}]"
 ac_help="$ac_help
-    --enable-monitor     enable monitor backend [yes]"
+    --enable-shell       enable shell backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --with-monitor-module module type static|dynamic [static]"
+    --enable-sql         enable sql backend no|yes|mod [${ol_dflt_backends-no}]"
 ac_help="$ac_help
-    --enable-null        enable null backend [no]"
+
+SLAPD Overlay Options:"
 ac_help="$ac_help
-    --with-null-module   module type static|dynamic [static]"
+    --enable-overlays    enable all available overlays no|yes|mod"
 ac_help="$ac_help
-    --enable-passwd      enable passwd backend [no]"
+    --enable-accesslog   In-Directory Access Logging overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --with-passwd-module  module type static|dynamic [static]"
+    --enable-denyop      Deny Operation overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --enable-perl        enable perl backend [no]"
+    --enable-dyngroup    Dynamic Group overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --with-perl-module   module type static|dynamic [static]"
+    --enable-dynlist     Dynamic List overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --enable-shell       enable shell backend [no]"
+    --enable-glue        Backend Glue overlay no|yes|mod [${ol_dflt_overlays-yes}]"
 ac_help="$ac_help
-    --with-shell-module          module type static|dynamic [static]"
+    --enable-lastmod     Last Modification overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --enable-sql         enable sql backend [no]"
+    --enable-ppolicy     Password Policy overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --with-sql-module    module type static|dynamic [static]"
+    --enable-proxycache          Proxy Cache overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-
-SLAPD Overlay Options:"
+    --enable-refint      Referential Integrity overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --with-dyngroup      Dynamic Group overlay no|yes|mod [no]"
+    --enable-retcode     Return Code testing overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --with-proxycache    Proxy Cache overlay no|yes|mod [no]"
+    --enable-rwm                 Rewrite/Remap overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
-    --with-rwm           Rewrite/Remap overlay no|yes|mod [no]"
+    --enable-syncprov    Syncrepl Provider overlay no|yes|mod [${ol_dflt_overlays-yes}]"
+ac_help="$ac_help
+    --enable-translucent  Translucent Proxy overlay no|yes|mod [${ol_dflt_overlays-no}]"
+ac_help="$ac_help
+    --enable-unique       Attribute Uniqueness overlay no|yes|mod [${ol_dflt_overlays-no}]"
 ac_help="$ac_help
 
 SLURPD (Replication Daemon) Options:"
@@ -886,7 +895,7 @@ echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
 
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:890: checking host system type" >&5
+echo "configure:899: 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.
@@ -927,7 +936,7 @@ host_os=$ac_cv_host_os
 
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:931: checking target system type" >&5
+echo "configure:940: 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.
@@ -967,7 +976,7 @@ target_os=$ac_cv_target_os
 
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:971: checking build system type" >&5
+echo "configure:980: 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.
@@ -1044,7 +1053,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:1048: checking for a BSD compatible install" >&5
+echo "configure:1057: 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
@@ -1101,7 +1110,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:1105: checking whether build environment is sane" >&5
+echo "configure:1114: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -1162,7 +1171,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:1166: checking for $ac_word" >&5
+echo "configure:1175: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1192,7 +1201,7 @@ test -n "$AWK" && break
 done
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1196: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1205: 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
@@ -1232,7 +1241,7 @@ fi
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1236: checking for working aclocal" >&5
+echo "configure:1245: 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.
@@ -1245,7 +1254,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1249: checking for working autoconf" >&5
+echo "configure:1258: 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.
@@ -1258,7 +1267,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1262: checking for working automake" >&5
+echo "configure:1271: 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.
@@ -1271,7 +1280,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1275: checking for working autoheader" >&5
+echo "configure:1284: 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.
@@ -1284,7 +1293,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1288: checking for working makeinfo" >&5
+echo "configure:1297: 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.
@@ -1304,7 +1313,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:1308: checking for $ac_word" >&5
+echo "configure:1317: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1367,14 +1376,16 @@ cat >> confdefs.h <<EOF
 EOF
 
 
-OPENLDAP_LIBVERSION=$OL_API_LIB
+OPENLDAP_LIBRELEASE=$OL_API_LIB_RELEASE
+
+OPENLDAP_LIBVERSION=$OL_API_LIB_VERSION
 
 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
 
 
 
 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
-echo "configure:1378: checking configure arguments" >&5
+echo "configure:1389: checking configure arguments" >&5
 
 
 top_builddir=`pwd`
@@ -1522,26 +1533,6 @@ else
        ol_enable_local="auto"
 fi
 # 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 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; }
-       fi
-       ol_enable_x_compile="$ol_arg"
-
-else
-       ol_enable_x_compile="no"
-fi
-# end --enable-x_compile
 
 
 # OpenLDAP --with-cyrus_sasl
@@ -1650,6 +1641,27 @@ else
 fi
 # end --with-yielding_select
 
+# OpenLDAP --with-multiple_precision
+       # Check whether --with-multiple_precision or --without-multiple_precision was given.
+if test "${with_multiple_precision+set}" = set; then
+  withval="$with_multiple_precision"
+  
+       ol_arg=invalid
+       for ol_val in auto bignum gmp yes no  ; 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-multiple_precision" 1>&2; exit 1; }
+       fi
+       ol_with_multiple_precision="$ol_arg"
+
+else
+       ol_with_multiple_precision="auto"
+fi
+# end --with-multiple_precision
+
 
 
 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
@@ -1738,7 +1750,6 @@ else
        ol_enable_crypt="no"
 fi
 # end --enable-crypt
-ol_enable_kpasswd=${ol_enable_kpasswd-no}
 # OpenLDAP --enable-lmpasswd
        # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
 if test "${enable_lmpasswd+set}" = set; then
@@ -1817,7 +1828,7 @@ if test "${enable_rewrite+set}" = set; then
        ol_enable_rewrite="$ol_arg"
 
 else
-       ol_enable_rewrite="no"
+       ol_enable_rewrite="auto"
 fi
 # end --enable-rewrite
 # OpenLDAP --enable-rlookups
@@ -1901,55 +1912,62 @@ else
 fi
 # end --enable-wrappers
 
+Backends="bdb dnssrv hdb ldap ldbm meta monitor null \
+       passwd perl relay shell sql"
 
-# OpenLDAP --enable-bdb
-       # Check whether --enable-bdb or --disable-bdb was given.
-if test "${enable_bdb+set}" = set; then
-  enableval="$enable_bdb"
+# Check whether --with-xxslapbackends or --without-xxslapbackends was given.
+if test "${with_xxslapbackends+set}" = set; then
+  withval="$with_xxslapbackends"
+  :
+fi
+
+
+# OpenLDAP --enable-backends
+       # Check whether --enable-backends or --disable-backends was given.
+if test "${enable_backends+set}" = set; then
+  enableval="$enable_backends"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; 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-bdb" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-backends" 1>&2; exit 1; }
        fi
-       ol_enable_bdb="$ol_arg"
+       ol_enable_backends="$ol_arg"
 
-else
-       ol_enable_bdb="yes"
 fi
-# end --enable-bdb
-# OpenLDAP --with-bdb_module
-       # Check whether --with-bdb_module or --without-bdb_module was given.
-if test "${with_bdb_module+set}" = set; then
-  withval="$with_bdb_module"
+# end --enable-backends
+test -n "$ol_enable_backends" && ol_dflt_backends="$ol_enable_backends"
+# OpenLDAP --enable-bdb
+       # Check whether --enable-bdb or --disable-bdb was given.
+if test "${enable_bdb+set}" = set; then
+  enableval="$enable_bdb"
   
        ol_arg=invalid
-       for ol_val in static dynamic ; do
-               if test "$withval" = "$ol_val" ; then
+       for ol_val in no yes mod ; do
+               if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
        fi
-       ol_with_bdb_module="$ol_arg"
+       ol_enable_bdb="$ol_arg"
 
 else
-       ol_with_bdb_module="static"
+       ol_enable_bdb="${ol_dflt_backends-yes}"
 fi
-# end --with-bdb_module
-
+# end --enable-bdb
 # 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
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -1960,37 +1978,16 @@ if test "${enable_dnssrv+set}" = set; then
        ol_enable_dnssrv="$ol_arg"
 
 else
-       ol_enable_dnssrv="no"
+       ol_enable_dnssrv="${ol_dflt_backends-no}"
 fi
 # 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
-               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-dnssrv_module" 1>&2; exit 1; }
-       fi
-       ol_with_dnssrv_module="$ol_arg"
-
-else
-       ol_with_dnssrv_module="static"
-fi
-# end --with-dnssrv_module
-
 # OpenLDAP --enable-hdb
        # Check whether --enable-hdb or --disable-hdb was given.
 if test "${enable_hdb+set}" = set; then
   enableval="$enable_hdb"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2001,37 +1998,16 @@ if test "${enable_hdb+set}" = set; then
        ol_enable_hdb="$ol_arg"
 
 else
-       ol_enable_hdb="no"
+       ol_enable_hdb="${ol_dflt_backends-yes}"
 fi
 # end --enable-hdb
-# OpenLDAP --with-hdb_module
-       # Check whether --with-hdb_module or --without-hdb_module was given.
-if test "${with_hdb_module+set}" = set; then
-  withval="$with_hdb_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-hdb_module" 1>&2; exit 1; }
-       fi
-       ol_with_hdb_module="$ol_arg"
-
-else
-       ol_with_hdb_module="static"
-fi
-# end --with-hdb_module
-
 # OpenLDAP --enable-ldap
        # Check whether --enable-ldap or --disable-ldap was given.
 if test "${enable_ldap+set}" = set; then
   enableval="$enable_ldap"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2042,37 +2018,16 @@ if test "${enable_ldap+set}" = set; then
        ol_enable_ldap="$ol_arg"
 
 else
-       ol_enable_ldap="no"
+       ol_enable_ldap="${ol_dflt_backends-no}"
 fi
 # end --enable-ldap
-# OpenLDAP --with-ldap_module
-       # Check whether --with-ldap_module or --without-ldap_module was given.
-if test "${with_ldap_module+set}" = set; then
-  withval="$with_ldap_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-ldap_module" 1>&2; exit 1; }
-       fi
-       ol_with_ldap_module="$ol_arg"
-
-else
-       ol_with_ldap_module="static"
-fi
-# end --with-ldap_module
-
 # OpenLDAP --enable-ldbm
        # Check whether --enable-ldbm or --disable-ldbm was given.
 if test "${enable_ldbm+set}" = set; then
   enableval="$enable_ldbm"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2083,7 +2038,7 @@ if test "${enable_ldbm+set}" = set; then
        ol_enable_ldbm="$ol_arg"
 
 else
-       ol_enable_ldbm="no"
+       ol_enable_ldbm="${ol_dflt_backends-no}"
 fi
 # end --enable-ldbm
 # OpenLDAP --with-ldbm_api
@@ -2107,27 +2062,6 @@ else
 fi
 # end --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 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_module" 1>&2; exit 1; }
-       fi
-       ol_with_ldbm_module="$ol_arg"
-
-else
-       ol_with_ldbm_module="static"
-fi
-# end --with-ldbm_module
-
 # OpenLDAP --with-ldbm_type
        # Check whether --with-ldbm_type or --without-ldbm_type was given.
 if test "${with_ldbm_type+set}" = set; then
@@ -2155,7 +2089,7 @@ if test "${enable_meta+set}" = set; then
   enableval="$enable_meta"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2166,37 +2100,16 @@ if test "${enable_meta+set}" = set; then
        ol_enable_meta="$ol_arg"
 
 else
-       ol_enable_meta="no"
+       ol_enable_meta="${ol_dflt_backends-no}"
 fi
 # end --enable-meta
-# OpenLDAP --with-meta_module
-       # Check whether --with-meta_module or --without-meta_module was given.
-if test "${with_meta_module+set}" = set; then
-  withval="$with_meta_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-meta_module" 1>&2; exit 1; }
-       fi
-       ol_with_meta_module="$ol_arg"
-
-else
-       ol_with_meta_module="static"
-fi
-# end --with-meta_module
-
 # OpenLDAP --enable-monitor
        # Check whether --enable-monitor or --disable-monitor was given.
 if test "${enable_monitor+set}" = set; then
   enableval="$enable_monitor"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2207,37 +2120,16 @@ if test "${enable_monitor+set}" = set; then
        ol_enable_monitor="$ol_arg"
 
 else
-       ol_enable_monitor="yes"
+       ol_enable_monitor="${ol_dflt_backends-yes}"
 fi
 # end --enable-monitor
-# OpenLDAP --with-monitor_module
-       # Check whether --with-monitor_module or --without-monitor_module was given.
-if test "${with_monitor_module+set}" = set; then
-  withval="$with_monitor_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-monitor_module" 1>&2; exit 1; }
-       fi
-       ol_with_monitor_module="$ol_arg"
-
-else
-       ol_with_monitor_module="static"
-fi
-# end --with-monitor_module
-
 # OpenLDAP --enable-null
        # Check whether --enable-null or --disable-null was given.
 if test "${enable_null+set}" = set; then
   enableval="$enable_null"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2248,37 +2140,16 @@ if test "${enable_null+set}" = set; then
        ol_enable_null="$ol_arg"
 
 else
-       ol_enable_null="no"
+       ol_enable_null="${ol_dflt_backends-no}"
 fi
 # end --enable-null
-# OpenLDAP --with-null_module
-       # Check whether --with-null_module or --without-null_module was given.
-if test "${with_null_module+set}" = set; then
-  withval="$with_null_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-null_module" 1>&2; exit 1; }
-       fi
-       ol_with_null_module="$ol_arg"
-
-else
-       ol_with_null_module="static"
-fi
-# end --with-null_module
-
 # OpenLDAP --enable-passwd
        # Check whether --enable-passwd or --disable-passwd was given.
 if test "${enable_passwd+set}" = set; then
   enableval="$enable_passwd"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2289,37 +2160,16 @@ if test "${enable_passwd+set}" = set; then
        ol_enable_passwd="$ol_arg"
 
 else
-       ol_enable_passwd="no"
+       ol_enable_passwd="${ol_dflt_backends-no}"
 fi
 # end --enable-passwd
-# OpenLDAP --with-passwd_module
-       # Check whether --with-passwd_module or --without-passwd_module was given.
-if test "${with_passwd_module+set}" = set; then
-  withval="$with_passwd_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-passwd_module" 1>&2; exit 1; }
-       fi
-       ol_with_passwd_module="$ol_arg"
-
-else
-       ol_with_passwd_module="static"
-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
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2330,37 +2180,36 @@ if test "${enable_perl+set}" = set; then
        ol_enable_perl="$ol_arg"
 
 else
-       ol_enable_perl="no"
+       ol_enable_perl="${ol_dflt_backends-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"
+# OpenLDAP --enable-relay
+       # Check whether --enable-relay or --disable-relay was given.
+if test "${enable_relay+set}" = set; then
+  enableval="$enable_relay"
   
        ol_arg=invalid
-       for ol_val in static dynamic ; do
-               if test "$withval" = "$ol_val" ; then
+       for ol_val in no yes mod ; do
+               if test "$enableval" = "$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; }
+               { echo "configure: error: bad value $enableval for --enable-relay" 1>&2; exit 1; }
        fi
-       ol_with_perl_module="$ol_arg"
+       ol_enable_relay="$ol_arg"
 
 else
-       ol_with_perl_module="static"
+       ol_enable_relay="${ol_dflt_backends-yes}"
 fi
-# end --with-perl_module
-
+# end --enable-relay
 # OpenLDAP --enable-shell
        # Check whether --enable-shell or --disable-shell was given.
 if test "${enable_shell+set}" = set; then
   enableval="$enable_shell"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; do
                if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -2371,171 +2220,384 @@ if test "${enable_shell+set}" = set; then
        ol_enable_shell="$ol_arg"
 
 else
-       ol_enable_shell="no"
+       ol_enable_shell="${ol_dflt_backends-no}"
 fi
 # end --enable-shell
-# OpenLDAP --with-shell_module
-       # Check whether --with-shell_module or --without-shell_module was given.
-if test "${with_shell_module+set}" = set; then
-  withval="$with_shell_module"
+# 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 static dynamic ; do
-               if test "$withval" = "$ol_val" ; then
+       for ol_val in no yes mod ; do
+               if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
        fi
-       ol_with_shell_module="$ol_arg"
+       ol_enable_sql="$ol_arg"
 
 else
-       ol_with_shell_module="static"
+       ol_enable_sql="${ol_dflt_backends-no}"
 fi
-# end --with-shell_module
+# end --enable-sql
 
-# OpenLDAP --enable-sql
-       # Check whether --enable-sql or --disable-sql was given.
-if test "${enable_sql+set}" = set; then
-  enableval="$enable_sql"
+Overlays="accesslog denyop dyngroup dynlist glue lastmod ppolicy proxycache \
+       refint retcode rwm syncprov translucent unique"
+
+# Check whether --with-xxslapoverlays or --without-xxslapoverlays was given.
+if test "${with_xxslapoverlays+set}" = set; then
+  withval="$with_xxslapoverlays"
+  :
+fi
+
+
+# OpenLDAP --enable-overlays
+       # Check whether --enable-overlays or --disable-overlays was given.
+if test "${enable_overlays+set}" = set; then
+  enableval="$enable_overlays"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; 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-sql" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-overlays" 1>&2; exit 1; }
        fi
-       ol_enable_sql="$ol_arg"
+       ol_enable_overlays="$ol_arg"
 
-else
-       ol_enable_sql="no"
 fi
-# 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"
+# end --enable-overlays
+test -n "$ol_enable_overlays" && ol_dflt_overlays="$ol_enable_overlays"
+# OpenLDAP --enable-accesslog
+       # Check whether --enable-accesslog or --disable-accesslog was given.
+if test "${enable_accesslog+set}" = set; then
+  enableval="$enable_accesslog"
   
        ol_arg=invalid
-       for ol_val in static dynamic ; do
-               if test "$withval" = "$ol_val" ; then
+       for ol_val in no yes mod ; do
+               if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-accesslog" 1>&2; exit 1; }
        fi
-       ol_with_sql_module="$ol_arg"
+       ol_enable_accesslog="$ol_arg"
 
 else
-       ol_with_sql_module="static"
+       ol_enable_accesslog="${ol_dflt_overlays-no}"
 fi
-# end --with-sql_module
+# end --enable-accesslog
 
+# OpenLDAP --enable-denyop
+       # Check whether --enable-denyop or --disable-denyop was given.
+if test "${enable_denyop+set}" = set; then
+  enableval="$enable_denyop"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-denyop" 1>&2; exit 1; }
+       fi
+       ol_enable_denyop="$ol_arg"
 
-# Check whether --with-xxslapoverlays or --without-xxslapoverlays was given.
-if test "${with_xxslapoverlays+set}" = set; then
-  withval="$with_xxslapoverlays"
-  :
+else
+       ol_enable_denyop="${ol_dflt_overlays-no}"
 fi
+# end --enable-denyop
 
-# OpenLDAP --with-dyngroup
-       # Check whether --with-dyngroup or --without-dyngroup was given.
-if test "${with_dyngroup+set}" = set; then
-  withval="$with_dyngroup"
+# OpenLDAP --enable-dyngroup
+       # Check whether --enable-dyngroup or --disable-dyngroup was given.
+if test "${enable_dyngroup+set}" = set; then
+  enableval="$enable_dyngroup"
   
        ol_arg=invalid
        for ol_val in no yes mod ; do
-               if test "$withval" = "$ol_val" ; then
+               if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-dyngroup" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-dyngroup" 1>&2; exit 1; }
        fi
-       ol_with_dyngroup="$ol_arg"
+       ol_enable_dyngroup="$ol_arg"
 
 else
-       ol_with_dyngroup="no"
+       ol_enable_dyngroup="${ol_dflt_overlays-no}"
 fi
-# end --with-dyngroup
+# end --enable-dyngroup
 
-# OpenLDAP --with-proxycache
-       # Check whether --with-proxycache or --without-proxycache was given.
-if test "${with_proxycache+set}" = set; then
-  withval="$with_proxycache"
+# OpenLDAP --enable-dynlist
+       # Check whether --enable-dynlist or --disable-dynlist was given.
+if test "${enable_dynlist+set}" = set; then
+  enableval="$enable_dynlist"
   
        ol_arg=invalid
        for ol_val in no yes mod ; do
-               if test "$withval" = "$ol_val" ; then
+               if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-proxycache" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-dynlist" 1>&2; exit 1; }
        fi
-       ol_with_proxycache="$ol_arg"
+       ol_enable_dynlist="$ol_arg"
 
 else
-       ol_with_proxycache="no"
+       ol_enable_dynlist="${ol_dflt_overlays-no}"
 fi
-# end --with-proxycache
+# end --enable-dynlist
 
-# OpenLDAP --with-rwm
-       # Check whether --with-rwm or --without-rwm was given.
-if test "${with_rwm+set}" = set; then
-  withval="$with_rwm"
+# OpenLDAP --enable-glue
+       # Check whether --enable-glue or --disable-glue was given.
+if test "${enable_glue+set}" = set; then
+  enableval="$enable_glue"
   
        ol_arg=invalid
        for ol_val in no yes mod ; do
-               if test "$withval" = "$ol_val" ; then
+               if test "$enableval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $withval for --with-rwm" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-glue" 1>&2; exit 1; }
        fi
-       ol_with_rwm="$ol_arg"
+       ol_enable_glue="$ol_arg"
 
 else
-       ol_with_rwm="no"
+       ol_enable_glue="${ol_dflt_overlays-yes}"
 fi
-# end --with-rwm
+# end --enable-glue
 
+# OpenLDAP --enable-lastmod
+       # Check whether --enable-lastmod or --disable-lastmod was given.
+if test "${enable_lastmod+set}" = set; then
+  enableval="$enable_lastmod"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-lastmod" 1>&2; exit 1; }
+       fi
+       ol_enable_lastmod="$ol_arg"
 
-# Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
-if test "${with_xxslurpdoptions+set}" = set; then
-  withval="$with_xxslurpdoptions"
-  :
+else
+       ol_enable_lastmod="${ol_dflt_overlays-no}"
 fi
+# end --enable-lastmod
 
-# OpenLDAP --enable-slurpd
-       # Check whether --enable-slurpd or --disable-slurpd was given.
-if test "${enable_slurpd+set}" = set; then
-  enableval="$enable_slurpd"
+# OpenLDAP --enable-ppolicy
+       # Check whether --enable-ppolicy or --disable-ppolicy was given.
+if test "${enable_ppolicy+set}" = set; then
+  enableval="$enable_ppolicy"
   
        ol_arg=invalid
-       for ol_val in auto yes no ; do
+       for ol_val in no yes mod ; 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-slurpd" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-ppolicy" 1>&2; exit 1; }
        fi
-       ol_enable_slurpd="$ol_arg"
+       ol_enable_ppolicy="$ol_arg"
 
 else
-       ol_enable_slurpd="auto"
+       ol_enable_ppolicy="${ol_dflt_overlays-no}"
 fi
-# end --enable-slurpd
+# end --enable-ppolicy
 
-# Check whether --with-xxliboptions or --without-xxliboptions was given.
-if test "${with_xxliboptions+set}" = set; then
+# OpenLDAP --enable-proxycache
+       # Check whether --enable-proxycache or --disable-proxycache was given.
+if test "${enable_proxycache+set}" = set; then
+  enableval="$enable_proxycache"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-proxycache" 1>&2; exit 1; }
+       fi
+       ol_enable_proxycache="$ol_arg"
+
+else
+       ol_enable_proxycache="${ol_dflt_overlays-no}"
+fi
+# end --enable-proxycache
+
+# OpenLDAP --enable-refint
+       # Check whether --enable-refint or --disable-refint was given.
+if test "${enable_refint+set}" = set; then
+  enableval="$enable_refint"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-refint" 1>&2; exit 1; }
+       fi
+       ol_enable_refint="$ol_arg"
+
+else
+       ol_enable_refint="${ol_dflt_overlays-no}"
+fi
+# end --enable-refint
+
+# OpenLDAP --enable-retcode
+       # Check whether --enable-retcode or --disable-retcode was given.
+if test "${enable_retcode+set}" = set; then
+  enableval="$enable_retcode"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-retcode" 1>&2; exit 1; }
+       fi
+       ol_enable_retcode="$ol_arg"
+
+else
+       ol_enable_retcode="${ol_dflt_overlays-no}"
+fi
+# end --enable-retcode
+
+# OpenLDAP --enable-rwm
+       # Check whether --enable-rwm or --disable-rwm was given.
+if test "${enable_rwm+set}" = set; then
+  enableval="$enable_rwm"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-rwm" 1>&2; exit 1; }
+       fi
+       ol_enable_rwm="$ol_arg"
+
+else
+       ol_enable_rwm="${ol_dflt_overlays-no}"
+fi
+# end --enable-rwm
+
+# OpenLDAP --enable-syncprov
+       # Check whether --enable-syncprov or --disable-syncprov was given.
+if test "${enable_syncprov+set}" = set; then
+  enableval="$enable_syncprov"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-syncprov" 1>&2; exit 1; }
+       fi
+       ol_enable_syncprov="$ol_arg"
+
+else
+       ol_enable_syncprov="${ol_dflt_overlays-yes}"
+fi
+# end --enable-syncprov
+
+# OpenLDAP --enable-translucent
+       # Check whether --enable-translucent or --disable-translucent was given.
+if test "${enable_translucent+set}" = set; then
+  enableval="$enable_translucent"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-translucent" 1>&2; exit 1; }
+       fi
+       ol_enable_translucent="$ol_arg"
+
+else
+       ol_enable_translucent="${ol_dflt_overlays-no}"
+fi
+# end --enable-translucent
+
+# OpenLDAP --enable-unique
+       # Check whether --enable-unique or --disable-unique was given.
+if test "${enable_unique+set}" = set; then
+  enableval="$enable_unique"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; 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-unique" 1>&2; exit 1; }
+       fi
+       ol_enable_unique="$ol_arg"
+
+else
+       ol_enable_unique="${ol_dflt_overlays-no}"
+fi
+# end --enable-unique
+
+
+
+# Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
+if test "${with_xxslurpdoptions+set}" = set; then
+  withval="$with_xxslurpdoptions"
+  :
+fi
+
+# OpenLDAP --enable-slurpd
+       # Check whether --enable-slurpd or --disable-slurpd was given.
+if test "${enable_slurpd+set}" = set; then
+  enableval="$enable_slurpd"
+  
+       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-slurpd" 1>&2; exit 1; }
+       fi
+       ol_enable_slurpd="$ol_arg"
+
+else
+       ol_enable_slurpd="auto"
+fi
+# end --enable-slurpd
+
+# Check whether --with-xxliboptions or --without-xxliboptions was given.
+if test "${with_xxliboptions+set}" = set; then
   withval="$with_xxliboptions"
   :
 fi
@@ -2593,42 +2655,16 @@ if test $ol_enable_slapd = no ; then
                if test $ol_enable_slapi = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-slapi argument" 1>&2
        fi
-       if test $ol_enable_bdb = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
-       fi
-       if test $ol_enable_dnssrv = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
-       fi
-       if test $ol_enable_hdb = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-hdb argument" 1>&2
-       fi
-       if test $ol_enable_ldap = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
-       fi
-       if test $ol_enable_ldbm = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
-       fi
-       if test $ol_enable_meta = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
-       fi
-       if test $ol_enable_monitor = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
-       fi
-       if test $ol_enable_null = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-null argument" 1>&2
-       fi
-       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_sql = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
-       fi
+       case "$ol_enable_backends" in yes | mod)
+               echo "configure: warning: slapd disabled, ignoring --enable-backends argument" 1>&2
+       esac
+       for i in $Backends; do
+               eval "ol_tmp=\$ol_enable_$i"
+               if test $ol_tmp != no ; then
+                       echo "configure: warning: slapd disabled, ignoring --enable-$i argument" 1>&2
+                       eval "ol_enable_$i=no"
+               fi
+       done
        if test $ol_enable_modules = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
        fi
@@ -2650,73 +2686,28 @@ if test $ol_enable_slapd = no ; then
        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_bdb_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
-       fi
-       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_hdb_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-hdb-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
-       fi
-       if test $ol_with_ldbm_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
-       fi
-       if test $ol_with_meta_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
-       fi
-       if test $ol_with_monitor_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
-       fi
-       if test $ol_with_null_module != static ; then
-               echo "configure: warning: slapd disabled, ignoring --with-null-module argument" 1>&2
-       fi
-       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_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
        if test $ol_enable_rewrite = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
        fi
-       if test $ol_with_dyngroup != no ; then
-               echo "configure: warning: slapd disabled, ignoring --with-dyngroup argument" 1>&2
-       fi
-       if test $ol_with_proxycache != no ; then
-               echo "configure: warning: slapd disabled, ignoring --with-proxycache argument" 1>&2
-       fi
-       if test $ol_with_rwm != no ; then
-               echo "configure: warning: slapd disabled, ignoring --with-rwm argument" 1>&2
-       fi
+               case "$ol_enable_overlays" in yes | mod)
+               echo "configure: warning: slapd disabled, ignoring --enable-overlays argument" 1>&2
+       esac
+       for i in $Overlays; do
+               eval "ol_tmp=\$ol_enable_$i"
+               if test $ol_tmp != no ; then
+                       echo "configure: warning: slapd disabled, ignoring --enable-$i argument" 1>&2
+                       eval "ol_enable_$i=no"
+               fi
+       done
 
        # force settings to no
        ol_enable_slapi=no
-       ol_enable_bdb=no
-       ol_enable_dnssrv=no
-       ol_enable_hdb=no
-       ol_enable_ldap=no
-       ol_enable_ldbm=no
-       ol_enable_meta=no
-       ol_enable_monitor=no
-       ol_enable_null=no
-       ol_enable_passwd=no
-       ol_enable_perl=no
-       ol_enable_shell=no
-       ol_enable_sql=no
 
+       ol_enable_backends=
+       ol_enable_overlays=
        ol_enable_modules=no
        ol_enable_multimaster=no
        ol_enable_rlookups=no
@@ -2726,27 +2717,10 @@ if test $ol_enable_slapd = no ; then
        ol_with_ldbm_api=no
        ol_with_ldbm_type=no
 
-       ol_with_bdb_module=static
-       ol_with_dnssrv_module=static
-       ol_with_hdb_module=static
-       ol_with_ldap_module=static
-       ol_with_ldbm_module=static
-       ol_with_meta_module=static
-       ol_with_monitor_module=static
-       ol_with_null_module=static
-       ol_with_passwd_module=static
-       ol_with_perl_module=static
-       ol_with_shell_module=static
-       ol_with_sql_module=static
-
        ol_enable_slurpd=no
 
        ol_enable_rewrite=no
 
-       ol_with_dyngroup=no
-       ol_with_proxycache=no
-       ol_with_rwm=no
-
 elif test $ol_enable_ldbm = no ; then
        
        if test $ol_with_ldbm_api != auto ; then
@@ -2757,10 +2731,6 @@ elif test $ol_enable_ldbm = no ; then
                echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
        fi
 
-       if test $ol_with_ldbm_module != static ; then
-               echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
-       fi
-
        if test $ol_enable_modules != yes -a \
                $ol_enable_bdb = no -a \
                $ol_enable_dnssrv = no -a \
@@ -2771,6 +2741,7 @@ elif test $ol_enable_ldbm = no ; then
                $ol_enable_null = no -a \
                $ol_enable_passwd = no -a \
                $ol_enable_perl = no -a \
+               $ol_enable_relay = no -a \
                $ol_enable_shell = no -a \
                $ol_enable_sql = no ; then
 
@@ -2784,7 +2755,6 @@ elif test $ol_enable_ldbm = no ; then
 
        ol_with_ldbm_api=no
        ol_with_ldbm_type=no
-       ol_with_ldbm_module=static
 
        if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
                ol_with_ldbm_api=berkeley
@@ -2804,22 +2774,19 @@ else
                { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
        fi
 
-       if test $ol_enable_bdb = yes -o $ol_enable_hdb = yes ; then
+       if test $ol_enable_bdb != no -o $ol_enable_hdb != no ; then
                if test $ol_with_ldbm_api = auto ; then
                        ol_with_ldbm_api=berkeley
                elif test $ol_with_ldbm_api != berkeley ; then
                        { echo "configure: error: LDBM API not compatible with BDB/HDB" 1>&2; exit 1; }
                fi
-
-       elif test $ol_enable_bdb = auto ; then
-               if test $ol_with_ldbm_api != berkeley \
-                       -o $ol_with_ldbm_api != auto ; then
-                       echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
-                       ol_enable_bdb=no
-               fi
        fi
 fi
 
+if test $ol_enable_meta = yes -a $ol_enable_ldap = no ; then
+       { echo "configure: error: --enable-meta requires --enable-ldap" 1>&2; exit 1; }
+fi
+
 if test $ol_enable_slurpd = yes ; then
                if test $ol_with_threads = no ; then
                { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
@@ -2832,14 +2799,14 @@ if test $ol_enable_lmpasswd = yes ; then
        fi
 fi
 
-if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
+if test $ol_enable_kbind = yes ; then
        if test $ol_with_kerberos = no ; then
                { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
        elif test $ol_with_kerberos = auto ; then
                ol_with_kerberos=yes
        fi
 
-elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
+elif test $ol_enable_kbind = no ; then
        if test $ol_with_kerberos = auto ; then
                ol_with_kerberos=no
        elif test $ol_with_kerberos != no ; then
@@ -2883,32 +2850,32 @@ BUILD_MONITOR=no
 BUILD_NULL=no
 BUILD_PASSWD=no
 BUILD_PERL=no
+BUILD_RELAY=no
 BUILD_SHELL=no
 BUILD_SQL=no
 
-BUILD_BDB_DYNAMIC=static
-BUILD_DNSSRV_DYNAMIC=static
-BUILD_HDB_DYNAMIC=static
-BUILD_LDAP_DYNAMIC=static
-BUILD_LDBM_DYNAMIC=static
-BUILD_META_DYNAMIC=static
-BUILD_MONITOR_DYNAMIC=static
-BUILD_NULL_DYNAMIC=static
-BUILD_PASSWD_DYNAMIC=static
-BUILD_PERL_DYNAMIC=static
-BUILD_SHELL_DYNAMIC=static
-BUILD_SQL_DYNAMIC=static
-
+BUILD_ACCESSLOG=no
+BUILD_DENYOP=no
 BUILD_DYNGROUP=no
+BUILD_DYNLIST=no
+BUILD_GLUE=no
+BUILD_LASTMOD=no
+BUILD_PPOLICY=no
 BUILD_PROXYCACHE=no
+BUILD_REFINT=no
+BUILD_RETCODE=no
 BUILD_RWM=no
+BUILD_SYNCPROV=no
+BUILD_TRANSLUCENT=no
+BUILD_UNIQUE=no
 
+SLAPD_STATIC_OVERLAYS=
 SLAPD_DYNAMIC_OVERLAYS=
 
 SLAPD_MODULES_LDFLAGS=
 SLAPD_MODULES_CPPFLAGS=
 
-SLAPD_STATIC_BACKENDS=
+SLAPD_STATIC_BACKENDS=back-ldif
 SLAPD_DYNAMIC_BACKENDS=
 
 SLAPD_PERL_LDFLAGS=
@@ -2930,75 +2897,7 @@ LIBSLAPITOOLS=
 AUTH_LIBS=
 
 SLAPD_SLP_LIBS=
-
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./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:2948: 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
-else
-    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS=":"
-  for ac_dir in $PATH; do
-    # Account for people who put trailing slashes in PATH elements.
-    case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
-    *)
-      # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
-        if test -f $ac_dir/$ac_prog; then
-         if test $ac_prog = install &&
-            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
-           # AIX install.  It has an incompatible calling convention.
-           :
-         elif test $ac_prog = install &&
-           grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
-           # program-specific install script used by HP pwplus--don't use.
-           :
-         else
-           ac_cv_path_install="$ac_dir/$ac_prog -c"
-           break 2
-         fi
-       fi
-      done
-      ;;
-    esac
-  done
-  IFS="$ac_save_IFS"
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL="$ac_cv_path_install"
-  else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
-    INSTALL="$ac_install_sh"
-  fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+SLAPD_GMP_LIBS=
 
 
 cat >> confdefs.h <<\EOF
@@ -3025,7 +2924,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:3029: checking for $ac_word" >&5
+echo "configure:2928: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3077,7 +2976,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:3081: checking for $ac_word" >&5
+echo "configure:2980: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3119,7 +3018,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:3123: checking for $ac_word" >&5
+echo "configure:3022: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3169,12 +3068,12 @@ if test "X${PATH_SEPARATOR+set}" != Xset; then
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3173: checking for Cygwin environment" >&5
+echo "configure:3072: 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 3178 "configure"
+#line 3077 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3185,7 +3084,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -3201,19 +3100,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:3205: checking for mingw32 environment" >&5
+echo "configure:3104: 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 3210 "configure"
+#line 3109 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3229,19 +3128,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:3233: checking for EMX OS/2 environment" >&5
+echo "configure:3132: 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 3238 "configure"
+#line 3137 "configure"
 #include "confdefs.h"
 
 int main() {
 return __EMX__;
 ; return 0; }
 EOF
-if { (eval echo configure:3245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_emxos2=yes
 else
@@ -3257,7 +3156,7 @@ echo "$ac_t""$ac_cv_emxos2" 1>&6
 EMXOS2=
 test "$ac_cv_emxos2" = yes && EMXOS2=yes
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3261: checking how to run the C preprocessor" >&5
+echo "configure:3160: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3272,13 +3171,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 3276 "configure"
+#line 3175 "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:3282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3181: \"$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
   :
@@ -3289,13 +3188,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 3293 "configure"
+#line 3192 "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:3299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3198: \"$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
   :
@@ -3306,13 +3205,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 3310 "configure"
+#line 3209 "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:3316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3215: \"$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
   :
@@ -3362,7 +3261,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:3366: checking for $ac_word" >&5
+echo "configure:3265: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3392,7 +3291,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:3396: checking for $ac_word" >&5
+echo "configure:3295: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3443,7 +3342,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:3447: checking for $ac_word" >&5
+echo "configure:3346: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3475,7 +3374,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:3479: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+echo "configure:3378: 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.
@@ -3486,12 +3385,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 3490 "configure"
+#line 3389 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:3495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3394: \"$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
@@ -3517,12 +3416,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:3521: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:3420: 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:3526: checking whether we are using GNU C" >&5
+echo "configure:3425: 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
@@ -3531,7 +3430,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3535: \"$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:3434: \"$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
@@ -3550,7 +3449,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:3554: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:3453: 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
@@ -3593,7 +3492,7 @@ ac_prog=ld
 if test "$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:3597: checking for ld used by GCC" >&5
+echo "configure:3496: checking for ld used by GCC" >&5
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -3623,10 +3522,10 @@ echo "configure:3597: 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:3627: checking for GNU ld" >&5
+echo "configure:3526: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:3630: checking for non-GNU ld" >&5
+echo "configure:3529: checking for non-GNU ld" >&5
 fi
 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3661,7 +3560,7 @@ else
 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:3665: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:3564: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3678,7 +3577,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:3682: checking for $LD option to reload object files" >&5
+echo "configure:3581: checking for $LD option to reload object files" >&5
 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3690,7 +3589,7 @@ reload_flag=$lt_cv_ld_reload_flag
 test -n "$reload_flag" && reload_flag=" $reload_flag"
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:3694: checking for BSD-compatible nm" >&5
+echo "configure:3593: checking for BSD-compatible nm" >&5
 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3728,7 +3627,7 @@ NM="$lt_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
-echo "configure:3732: checking for a sed that does not truncate output" >&5
+echo "configure:3631: checking for a sed that does not truncate output" >&5
 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3812,7 +3711,7 @@ fi
 echo "$ac_t""$SED" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3816: checking whether ln -s works" >&5
+echo "configure:3715: 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
@@ -3833,7 +3732,7 @@ else
 fi
 
 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
-echo "configure:3837: checking how to recognise dependent libraries" >&5
+echo "configure:3736: checking how to recognise dependent libraries" >&5
 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3967,6 +3866,10 @@ openbsd*)
   fi
   ;;
 
+openedition*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
 osf3* | osf4* | osf5*)
   # this will be overridden with pass_all, but let us keep it just in case
   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
@@ -4019,13 +3922,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:4023: checking for object suffix" >&5
+echo "configure:3926: 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:4029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -4046,7 +3949,7 @@ ac_objext=$ac_cv_objext
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4050: checking for executable suffix" >&5
+echo "configure:3953: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4056,7 +3959,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:4060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -4087,7 +3990,7 @@ fi
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:4091: checking command to parse $NM output" >&5
+echo "configure:3994: checking command to parse $NM output" >&5
 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4170,10 +4073,10 @@ void nm_test_func(){}
 int main(){nm_test_var='a';nm_test_func();return(0);}
 EOF
 
-  if { (eval echo configure:4174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:4077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     # Now try to grab the symbols.
     nlist=conftest.nm
-    if { (eval echo configure:4177: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
+    if { (eval echo configure:4080: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
       # Try sorting and uniquifying the output.
       if sort "$nlist" | uniq > "$nlist"T; then
        mv -f "$nlist"T "$nlist"
@@ -4224,7 +4127,7 @@ EOF
          save_CFLAGS="$CFLAGS"
          LIBS="conftstm.$ac_objext"
          CFLAGS="$CFLAGS$no_builtin_flag"
-         if { (eval echo configure:4228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
+         if { (eval echo configure:4131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
            pipe_works=yes
          fi
          LIBS="$save_LIBS"
@@ -4273,17 +4176,17 @@ for ac_hdr in dlfcn.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4277: checking for $ac_hdr" >&5
+echo "configure:4180: 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 4282 "configure"
+#line 4185 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4190: \"$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*
@@ -4319,7 +4222,7 @@ case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:4323: checking for ${ac_tool_prefix}file" >&5
+echo "configure:4226: checking for ${ac_tool_prefix}file" >&5
 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4381,7 +4284,7 @@ fi
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
     echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:4385: checking for file" >&5
+echo "configure:4288: checking for file" >&5
 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4452,7 +4355,7 @@ esac
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4456: checking for $ac_word" >&5
+echo "configure:4359: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4484,7 +4387,7 @@ if test -n "$ac_tool_prefix"; then
   # 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:4488: checking for $ac_word" >&5
+echo "configure:4391: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4519,7 +4422,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4523: checking for $ac_word" >&5
+echo "configure:4426: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4551,7 +4454,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4555: checking for $ac_word" >&5
+echo "configure:4458: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4600,8 +4503,8 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4604 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:4605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 4507 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:4508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case `/usr/bin/file conftest.$ac_objext` in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -4622,7 +4525,7 @@ 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:4626: checking whether the C compiler needs -belf" >&5
+echo "configure:4529: 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
@@ -4635,14 +4538,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
 cross_compiling=$ac_cv_prog_cc_cross
 
      cat > conftest.$ac_ext <<EOF
-#line 4639 "configure"
+#line 4542 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4549: \"$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
@@ -4672,7 +4575,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
   # 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:4676: checking for $ac_word" >&5
+echo "configure:4579: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4704,7 +4607,7 @@ 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:4708: checking for $ac_word" >&5
+echo "configure:4611: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4739,7 +4642,7 @@ 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:4743: checking for $ac_word" >&5
+echo "configure:4646: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4771,7 +4674,7 @@ 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:4775: checking for $ac_word" >&5
+echo "configure:4678: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4806,7 +4709,7 @@ 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:4810: checking for $ac_word" >&5
+echo "configure:4713: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4838,7 +4741,7 @@ 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:4842: checking for $ac_word" >&5
+echo "configure:4745: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4874,12 +4777,12 @@ fi
   # recent cygwin and mingw systems supply a stub DllMain which the user
   # can override, but on older systems we have to supply one
   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
-echo "configure:4878: checking if libtool should supply DllMain function" >&5
+echo "configure:4781: checking if libtool should supply DllMain function" >&5
 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4883 "configure"
+#line 4786 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4887,7 +4790,7 @@ extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
       DllMain (0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_need_dllmain=no
 else
@@ -4908,19 +4811,19 @@ echo "$ac_t""$lt_cv_need_dllmain" 1>&6
     SAVE_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS -mdll"
     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
-echo "configure:4912: checking how to link DLLs" >&5
+echo "configure:4815: checking how to link DLLs" >&5
 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4917 "configure"
+#line 4820 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_dll_switch=-mdll
 else
@@ -5034,7 +4937,7 @@ set dummy $CC
 compiler="$2"
 
 echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:5038: checking for objdir" >&5
+echo "configure:4941: checking for objdir" >&5
 rm -f .libs 2>/dev/null
 mkdir .libs 2>/dev/null
 if test -d .libs; then
@@ -5061,7 +4964,7 @@ test -z "$pic_mode" && pic_mode=default
 # in isolation, and that seeing it set (from the cache) indicates that
 # the associated values are set (in the cache) correctly too.
 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
-echo "configure:5065: checking for $compiler option to produce PIC" >&5
+echo "configure:4968: checking for $compiler option to produce PIC" >&5
 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5151,6 +5054,10 @@ else
       lt_cv_prog_cc_pic='-KPIC'
       lt_cv_prog_cc_static='-Bstatic'
       ;;
+    
+    openedition)
+      # XPLINK code is PIC by default
+      ;;
 
     osf3* | osf4* | osf5*)
       # All OSF/1 code is PIC.
@@ -5209,21 +5116,21 @@ else
 
   # Check to make sure the pic_flag actually works.
   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
-echo "configure:5213: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
+echo "configure:5120: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
       save_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
     cat > conftest.$ac_ext <<EOF
-#line 5220 "configure"
+#line 5127 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
         case $host_os in
       hpux9* | hpux10* | hpux11*)
@@ -5275,7 +5182,7 @@ if test -n "$lt_cv_prog_cc_shlib"; then
 fi
 
 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
-echo "configure:5279: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
+echo "configure:5186: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5283,14 +5190,14 @@ else
   save_LDFLAGS="$LDFLAGS"
   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
   cat > conftest.$ac_ext <<EOF
-#line 5287 "configure"
+#line 5194 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_prog_cc_static_works=yes
 else
@@ -5317,7 +5224,7 @@ can_build_shared="$lt_cv_prog_cc_can_build_shared"
 
 # Check to see if options -o and -c are simultaneously supported by compiler
 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
-echo "configure:5321: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo "configure:5228: checking if $compiler supports -c -o file.$ac_objext" >&5
 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5336,7 +5243,7 @@ chmod -w .
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
 compiler_c_o=no
-if { (eval echo configure:5340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:5247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
   # The compiler can only warn and ignore the option if not recognized
   # So say no if there are warnings
   if test -s out/conftest.err; then
@@ -5365,7 +5272,7 @@ echo "$ac_t""$compiler_c_o" 1>&6
 if test x"$compiler_c_o" = x"yes"; then
   # Check to see if we can write to a .lo
   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
-echo "configure:5369: checking if $compiler supports -c -o file.lo" >&5
+echo "configure:5276: checking if $compiler supports -c -o file.lo" >&5
   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5376,14 +5283,14 @@ else
   save_objext="$ac_objext"
   ac_objext=lo
   cat > conftest.$ac_ext <<EOF
-#line 5380 "configure"
+#line 5287 "configure"
 #include "confdefs.h"
 
 int main() {
 int some_variable = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
       # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings
@@ -5414,7 +5321,7 @@ hard_links="nottested"
 if test "$compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
-echo "configure:5418: checking if we can lock with hard links" >&5
+echo "configure:5325: checking if we can lock with hard links" >&5
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
@@ -5433,20 +5340,20 @@ fi
 if test "$GCC" = yes; then
   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
-echo "configure:5437: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo "configure:5344: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
   echo "int some_variable = 0;" > conftest.$ac_ext
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
   compiler_rtti_exceptions=no
   cat > conftest.$ac_ext <<EOF
-#line 5443 "configure"
+#line 5350 "configure"
 #include "confdefs.h"
 
 int main() {
 int some_variable = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
       # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings
@@ -5473,7 +5380,7 @@ fi
 
 # See if the linker supports building shared libraries.
 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
-echo "configure:5477: checking whether the linker ($LD) supports shared libraries" >&5
+echo "configure:5384: checking whether the linker ($LD) supports shared libraries" >&5
 
 allow_undefined_flag=
 no_undefined_flag=
@@ -5976,6 +5883,12 @@ else
     fi
     ;;
 
+  openedition*)
+    archive_cmds="\$CC -Wl,DLL \$libobjs \$deplibs \$compiler_flags -o \$lib &&
+       cp \$linknames \$output_objdir && linknames=''"
+    export_dynamic_flag_spec="-Wl,DLL"
+    ;;
+
   os2*)
     hardcode_libdir_flag_spec='-L$libdir'
     hardcode_minus_L=yes
@@ -6172,7 +6085,7 @@ test "$ld_shlibs" = no && can_build_shared=no
 
 # Check hardcoding attributes.
 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
-echo "configure:6176: checking how to hardcode library paths into programs" >&5
+echo "configure:6089: checking how to hardcode library paths into programs" >&5
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" || \
    test -n "$runpath_var"; then
@@ -6200,7 +6113,7 @@ echo "$ac_t""$hardcode_action" 1>&6
 striplib=
 old_striplib=
 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
-echo "configure:6204: checking whether stripping libraries is possible" >&5
+echo "configure:6117: checking whether stripping libraries is possible" >&5
 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
@@ -6214,7 +6127,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 # PORTME Fill in your ld.so characteristics
 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
-echo "configure:6218: checking dynamic linker characteristics" >&5
+echo "configure:6131: checking dynamic linker characteristics" >&5
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -6516,6 +6429,17 @@ openbsd*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
+openedition*)
+  need_lib_prefix=no
+  need_version=no
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=LIBPATH
+  postinstall_cmds="rm \$destdir/\$linkname; cp \$linkname \$destdir; chmod a+x \$lib"
+  # the library's exports are in libname.x; this is the file that must
+  # actually be linked with to use a DLL.
+  library_names_spec="\${libname}\${release}.so\$versuffix \${libname}.x"
+  ;;
+
 os2*)
   libname_spec='$name'
   need_lib_prefix=no
@@ -6625,11 +6549,11 @@ test "$dynamic_linker" = no && can_build_shared=no
 
 # Report the final consequences.
 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
-echo "configure:6629: checking if libtool supports shared libraries" >&5
+echo "configure:6553: checking if libtool supports shared libraries" >&5
 echo "$ac_t""$can_build_shared" 1>&6
 
 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
-echo "configure:6633: checking whether to build shared libraries" >&5
+echo "configure:6557: checking whether to build shared libraries" >&5
 test "$can_build_shared" = "no" && enable_shared=no
 
 # On AIX, shared libraries and static libraries use the same namespace, and
@@ -6652,7 +6576,7 @@ esac
 echo "$ac_t""$enable_shared" 1>&6
 
 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
-echo "configure:6656: checking whether to build static libraries" >&5
+echo "configure:6580: checking whether to build static libraries" >&5
 # Make sure either enable_shared or enable_static is yes.
 test "$enable_shared" = yes || enable_static=yes
 echo "$ac_t""$enable_static" 1>&6
@@ -6692,21 +6616,21 @@ else
    ;;
 
   *)
-    echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:6697: checking for shl_load" >&5
-if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
+    echo $ac_n "checking for dllload""... $ac_c" 1>&6
+echo "configure:6621: checking for dllload" >&5
+if eval "test \"\${ac_cv_func_dllload+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6702 "configure"
+#line 6626 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load(); below.  */
+    which can conflict with char dllload(); 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 shl_load();
+char dllload();
 char (*f)();
 
 int main() {
@@ -6714,33 +6638,80 @@ 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_shl_load) || defined (__stub___shl_load)
+#if defined (__stub_dllload) || defined (__stub___dllload)
 choke me
 #else
-f = shl_load;
+f = dllload;
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:6726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_shl_load=yes"
+  eval "ac_cv_func_dllload=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_shl_load=no"
+  eval "ac_cv_func_dllload=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'dllload`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  lt_cv_dlopen="dllload"
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for shl_load""... $ac_c" 1>&6
+echo "configure:6668: checking for shl_load" >&5
+if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6673 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load(); 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 shl_load();
+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_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+f = shl_load;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_shl_load=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_shl_load=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   lt_cv_dlopen="shl_load"
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:6744: checking for shl_load in -ldld" >&5
+echo "configure:6715: checking for shl_load in -ldld" >&5
 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6748,7 +6719,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6752 "configure"
+#line 6723 "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
@@ -6759,7 +6730,7 @@ int main() {
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:6763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6734: \"$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
@@ -6778,12 +6749,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:6782: checking for dlopen" >&5
+echo "configure:6753: checking for dlopen" >&5
 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6787 "configure"
+#line 6758 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen(); below.  */
@@ -6807,7 +6778,7 @@ f = dlopen;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dlopen=yes"
 else
@@ -6825,7 +6796,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6829: checking for dlopen in -ldl" >&5
+echo "configure:6800: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6833,7 +6804,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6837 "configure"
+#line 6808 "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
@@ -6844,7 +6815,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:6848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6819: \"$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
@@ -6863,7 +6834,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:6867: checking for dlopen in -lsvld" >&5
+echo "configure:6838: checking for dlopen in -lsvld" >&5
 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6871,7 +6842,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsvld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6875 "configure"
+#line 6846 "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
@@ -6882,7 +6853,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:6886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6857: \"$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
@@ -6901,7 +6872,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:6905: checking for dld_link in -ldld" >&5
+echo "configure:6876: checking for dld_link in -ldld" >&5
 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6909,7 +6880,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6913 "configure"
+#line 6884 "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
@@ -6920,7 +6891,7 @@ int main() {
 dld_link()
 ; return 0; }
 EOF
-if { (eval echo configure:6924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6895: \"$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
@@ -6953,6 +6924,9 @@ fi
 fi
 
       
+fi
+
+    
 fi
 
     ;;
@@ -6976,7 +6950,7 @@ fi
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
-echo "configure:6980: checking whether a program can dlopen itself" >&5
+echo "configure:6954: checking whether a program can dlopen itself" >&5
 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6986,7 +6960,7 @@ else
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 6990 "configure"
+#line 6964 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -7047,7 +7021,7 @@ int main ()
     exit (status);
 }
 EOF
-  if { (eval echo configure:7051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  if { (eval echo configure:7025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -7070,7 +7044,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
     if test "x$lt_cv_dlopen_self" = xyes; then
       LDFLAGS="$LDFLAGS $link_static_flag"
       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
-echo "configure:7074: checking whether a statically linked program can dlopen itself" >&5
+echo "configure:7048: checking whether a statically linked program can dlopen itself" >&5
 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7080,7 +7054,7 @@ else
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 7084 "configure"
+#line 7058 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -7141,7 +7115,7 @@ int main ()
     exit (status);
 }
 EOF
-  if { (eval echo configure:7145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  if { (eval echo configure:7119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -7190,14 +7164,14 @@ if test "$enable_shared" = yes && test "$GCC" = yes; then
     # systems, -lgcc has to come before -lc. If gcc already passes -lc
     # to ld, don't add -lc before -lgcc.
     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
-echo "configure:7194: checking whether -lc should be explicitly linked in" >&5
+echo "configure:7168: checking whether -lc should be explicitly linked in" >&5
     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   $rm conftest*
     echo 'static int dummy;' > conftest.$ac_ext
 
-    if { (eval echo configure:7201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+    if { (eval echo configure:7175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
       soname=conftest
       lib=conftest
       libobjs=conftest.$ac_objext
@@ -7210,7 +7184,7 @@ else
       libname=conftest
       save_allow_undefined_flag=$allow_undefined_flag
       allow_undefined_flag=
-      if { (eval echo configure:7214: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
+      if { (eval echo configure:7188: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
       then
        lt_cv_archive_cmds_need_lc=no
       else
@@ -7795,58 +7769,12 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
-# test for ln hardlink support
-echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:7801: 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
-       echo "$ac_t""yes" 1>&6
-else
-       echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:7824: 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
-  rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
-  rm -f conftestdata
-  ac_cv_prog_LN_S="ln -s"
-else
-  ac_cv_prog_LN_S=ln
-fi
-fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
-  echo "$ac_t""yes" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-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:7850: checking for $ac_word" >&5
+echo "configure:7778: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7889,7 +7817,7 @@ fi
                PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
                PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e 's/ -lc / /' -e 's/ -lc$//'`"
 
-               if test x"$ol_with_perl_module" = "xstatic" ; then
+               if test x"$ol_enable_perl" = "xyes" ; then
                        SLAPD_PERL_LDFLAGS="$PERL_LDFLAGS"
                else
                        MOD_PERL_LDFLAGS="$PERL_LDFLAGS"
@@ -7899,7 +7827,7 @@ fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:7903: checking how to run the C preprocessor" >&5
+echo "configure:7831: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -7914,13 +7842,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 7918 "configure"
+#line 7846 "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:7924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7852: \"$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
   :
@@ -7931,13 +7859,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 7935 "configure"
+#line 7863 "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:7941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7869: \"$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
   :
@@ -7948,13 +7876,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 7952 "configure"
+#line 7880 "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:7958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7886: \"$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
   :
@@ -7979,26 +7907,14 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 
-if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
-       echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
-
-elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
-       echo "configure: warning: programs compiled here do run here..." 1>&2
-       { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
-
-elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
-       echo "configure: warning: programs compiled here do not run here..." 1>&2
-       { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
-fi
-
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:7997: checking for Cygwin environment" >&5
+echo "configure:7913: 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 8002 "configure"
+#line 7918 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -8009,7 +7925,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:8013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -8025,19 +7941,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:8029: checking for mingw32 environment" >&5
+echo "configure:7945: 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 8034 "configure"
+#line 7950 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:8041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -8056,7 +7972,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:8060: checking for executable suffix" >&5
+echo "configure:7976: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8066,7 +7982,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:8070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:7986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -8087,13 +8003,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:8091: checking for object suffix" >&5
+echo "configure:8007: 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:8097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -8117,7 +8033,7 @@ EOF
 
 
 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
-echo "configure:8121: checking for be_app in -lbe" >&5
+echo "configure:8037: 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
@@ -8125,7 +8041,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbe -lroot -lnet $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8129 "configure"
+#line 8045 "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
@@ -8136,7 +8052,7 @@ int main() {
 be_app()
 ; return 0; }
 EOF
-if { (eval echo configure:8140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8056: \"$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
@@ -8162,7 +8078,7 @@ fi
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:8166: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:8082: 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
@@ -8179,7 +8095,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 8183 "configure"
+#line 8099 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -8216,7 +8132,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:8220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_prog_cc_stdc="$ac_arg"; break
 else
@@ -8250,7 +8166,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:8254: checking for ${OL_MKDEP} depend flag" >&5
+echo "configure:8170: 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
@@ -8260,7 +8176,7 @@ else
                                cat > conftest.c <<EOF
  noCode;
 EOF
-                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
+                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8180: \"$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
@@ -8293,7 +8209,7 @@ if test "${ol_cv_mkdep}" = no ; then
 fi
 
 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
-echo "configure:8297: checking for afopen in -ls" >&5
+echo "configure:8213: 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
@@ -8301,7 +8217,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ls  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8305 "configure"
+#line 8221 "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
@@ -8312,7 +8228,7 @@ int main() {
 afopen()
 ; return 0; }
 EOF
-if { (eval echo configure:8316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8232: \"$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
@@ -8350,22 +8266,23 @@ EOF
 esac
 
 ol_link_modules=no
+WITH_MODULES_ENABLED=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:8359: checking for $ac_hdr" >&5
+echo "configure:8276: 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 8364 "configure"
+#line 8281 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8286: \"$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*
@@ -8397,7 +8314,7 @@ done
        fi
 
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:8401: checking for lt_dlinit in -lltdl" >&5
+echo "configure:8318: 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
@@ -8405,7 +8322,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8409 "configure"
+#line 8326 "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
@@ -8416,7 +8333,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:8420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8337: \"$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
@@ -8447,42 +8364,34 @@ fi
                { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
        fi
        ol_link_modules=yes
+       WITH_MODULES_ENABLED=yes
+
 else
-       ol_with_bdb_module=static
-       ol_with_dnssrv_module=static
-       ol_with_hdb_module=static
-       ol_with_ldap_module=static
-       ol_with_ldbm_module=static
-       ol_with_meta_module=static
-       ol_with_monitor_module=static
-       ol_with_null_module=static
-       ol_with_passwd_module=static
-       ol_with_perl_module=static
-       ol_with_shell_module=static
-       ol_with_sql_module=static
-       if test $ol_with_dyngroup = mod ; then
-               echo "configure: warning: building static dyngroup overlay" 1>&2
-               ol_with_dyngroup = yes
-       fi
-       if test $ol_with_proxycache = mod ; then
-               echo "configure: warning: building static proxycache overlay" 1>&2
-               ol_with_proxycache = yes
-       fi
-       if test $ol_with_rwm = mod ; then
-               echo "configure: warning: building static rwm overlay" 1>&2
-               ol_with_rwm = yes
-       fi
+       for i in $Backends; do
+               eval "ol_tmp=\$ol_enable_$i"
+               if test $ol_tmp = mod ; then
+                       echo "configure: warning: building static $i backend" 1>&2
+                       eval "ol_enable_$i=yes"
+               fi
+       done
+       for i in $Overlays; do
+               eval "ol_tmp=\$ol_enable_$i"
+               if test $ol_tmp = mod ; then
+                       echo "configure: warning: building static $i overlay" 1>&2
+                       eval "ol_enable_$i=yes"
+               fi
+       done
 fi
 
 # test for EBCDIC
 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
-echo "configure:8480: checking for EBCDIC" >&5
+echo "configure:8389: 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 8486 "configure"
+#line 8395 "configure"
 #include "confdefs.h"
 
 #if !('M' == 0xd4)
@@ -8491,7 +8400,7 @@ else
 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8404: \"$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*
@@ -8515,12 +8424,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:8519: checking for ANSI C header files" >&5
+echo "configure:8428: 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 8524 "configure"
+#line 8433 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -8528,7 +8437,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8441: \"$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*
@@ -8545,7 +8454,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 8549 "configure"
+#line 8458 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -8563,7 +8472,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 8567 "configure"
+#line 8476 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -8584,7 +8493,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 8588 "configure"
+#line 8497 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #ifndef HAVE_EBCDIC
@@ -8602,7 +8511,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:8606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   :
 else
@@ -8636,12 +8545,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:8640: checking for $ac_hdr that defines DIR" >&5
+echo "configure:8549: 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 8645 "configure"
+#line 8554 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -8649,7 +8558,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -8674,7 +8583,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:8678: checking for opendir in -ldir" >&5
+echo "configure:8587: 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
@@ -8682,7 +8591,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8686 "configure"
+#line 8595 "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
@@ -8693,7 +8602,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:8697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8606: \"$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
@@ -8715,7 +8624,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:8719: checking for opendir in -lx" >&5
+echo "configure:8628: 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
@@ -8723,7 +8632,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8727 "configure"
+#line 8636 "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
@@ -8734,7 +8643,7 @@ int main() {
 opendir()
 ; 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:8647: \"$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
@@ -8757,12 +8666,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:8761: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:8670: 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 8766 "configure"
+#line 8675 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -8778,7 +8687,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:8782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -8799,12 +8708,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:8803: checking POSIX termios" >&5
+echo "configure:8712: 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 8808 "configure"
+#line 8717 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -8814,7 +8723,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:8818: \"$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*
   am_cv_sys_posix_termios=yes
 else
@@ -8830,7 +8739,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:8834: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:8743: 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
@@ -8839,7 +8748,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 8843 "configure"
+#line 8752 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -8859,7 +8768,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 8863 "configure"
+#line 8772 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -8896,9 +8805,9 @@ fi
 
 for ac_hdr in \
        arpa/inet.h             \
-       arpa/nameser.h  \
+       arpa/nameser.h          \
        assert.h                \
-       bits/types.h    \
+       bits/types.h            \
        conio.h                 \
        crypt.h                 \
        direct.h                \
@@ -8911,7 +8820,7 @@ for ac_hdr in \
        libutil.h               \
        limits.h                \
        locale.h                \
-       netinet/tcp.h   \
+       netinet/tcp.h           \
        malloc.h                \
        memory.h                \
        psap.h                  \
@@ -8929,11 +8838,11 @@ for ac_hdr in \
        sys/errno.h             \
        sys/ioctl.h             \
        sys/param.h             \
-       sys/resource.h  \
-       sys/select.h    \
-       sys/socket.h    \
+       sys/resource.h          \
+       sys/select.h            \
+       sys/socket.h            \
        sys/stat.h              \
-       sys/syslog.h    \
+       sys/syslog.h            \
        sys/time.h              \
        sys/types.h             \
        sys/ucred.h             \
@@ -8941,23 +8850,24 @@ for ac_hdr in \
        syslog.h                \
        termios.h               \
        unistd.h                \
+       utime.h                 \
        winsock.h               \
        winsock2.h              \
 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8951: checking for $ac_hdr" >&5
+echo "configure:8861: 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 8956 "configure"
+#line 8866 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8871: \"$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*
@@ -8985,22 +8895,23 @@ done
 
 
 
-
-echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:8991: checking for dlopen" >&5
-if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
+for ac_func in sigaction sigset 
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:8902: 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 8996 "configure"
+#line 8907 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen(); 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 dlopen();
+char $ac_func();
 char (*f)();
 
 int main() {
@@ -9008,83 +8919,42 @@ 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_dlopen) || defined (__stub___dlopen)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = dlopen;
+f = $ac_func;
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:9020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_dlopen=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_dlopen=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:9038: checking for dlopen in -ldl" >&5
-ac_lib_var=`echo dl'_'dlopen | 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="-ldl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9046 "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 dlopen();
-
-int main() {
-dlopen()
-; return 0; }
-EOF
-if { (eval echo configure:9057: \"$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
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
   cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+#define $ac_tr_func 1
 EOF
-
-  LIBS="-ldl $LIBS"
-
 else
   echo "$ac_t""no" 1>&6
 fi
-
-fi
+done
 
 
-echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:9088: checking for sigset in -lV3" >&5
+if test $ac_cv_func_sigaction = no && test $ac_cv_func_sigaction = no ; then
+       echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
+echo "configure:8958: 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
@@ -9092,7 +8962,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9096 "configure"
+#line 8966 "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
@@ -9103,7 +8973,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:9107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8977: \"$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
@@ -9130,42 +9000,43 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+fi
 
+if test "$ac_cv_cygwin" != yes && test "$ac_cv_header_winsock_h" = yes; then
 echo $ac_n "checking for winsock""... $ac_c" 1>&6
-echo "configure:9136: checking for winsock" >&5
-save_LIBS="$LIBS"
+echo "configure:9008: checking for winsock" >&5
+if eval "test \"\${ol_cv_winsock+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  save_LIBS="$LIBS"
 for curlib in ws2_32 wsock32; do
        LIBS="$LIBS -l$curlib"
        cat > conftest.$ac_ext <<EOF
-#line 9141 "configure"
+#line 9016 "configure"
 #include "confdefs.h"
-
-                       char socket@12();
-                       char select@20();
-                       char closesocket@4();
-                       char gethostname@8();
+#include <winsock.h>
                        
 int main() {
 
-                       socket@12();
-                       select@20();
-                       closesocket@4();
-                       gethostname@8();
+                       socket(0,0,0);
+                       select(0,NULL,NULL,NULL,NULL);
+                       closesocket(0);
+                       gethostname(NULL,0);
                        
 ; return 0; }
 EOF
-if { (eval echo configure:9158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  have_winsock=yes
+  ol_cv_winsock=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  have_winsock=no
+  ol_cv_winsock=no
 fi
 rm -f conftest*
 
-       if test $have_winsock = yes; then
+       if test $ol_cv_winsock = yes; then
                cat >> confdefs.h <<\EOF
 #define HAVE_WINSOCK 1
 EOF
@@ -9175,7 +9046,7 @@ EOF
                ac_cv_func_closesocket=yes
                ac_cv_func_gethostname=yes
                if test $curlib = ws2_32; then
-                       have_winsock=winsock2
+                       ol_cv_winsock=winsock2
                        cat >> confdefs.h <<\EOF
 #define HAVE_WINSOCK2 1
 EOF
@@ -9185,16 +9056,19 @@ EOF
        fi
        LIBS="$save_LIBS"
 done
-echo "$ac_t""$have_winsock" 1>&6
+fi
+
+echo "$ac_t""$ol_cv_winsock" 1>&6
+fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:9193: checking for socket" >&5
+echo "configure:9067: 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 9198 "configure"
+#line 9072 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -9218,7 +9092,7 @@ f = socket;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9096: \"$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
@@ -9237,7 +9111,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:9241: checking for main in -lsocket" >&5
+echo "configure:9115: 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
@@ -9245,14 +9119,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9249 "configure"
+#line 9123 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9130: \"$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
@@ -9280,7 +9154,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:9284: checking for main in -lnet" >&5
+echo "configure:9158: 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
@@ -9288,14 +9162,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9292 "configure"
+#line 9166 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9173: \"$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
@@ -9323,7 +9197,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:9327: checking for main in -lnsl_s" >&5
+echo "configure:9201: 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
@@ -9331,14 +9205,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9335 "configure"
+#line 9209 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9216: \"$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
@@ -9366,7 +9240,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:9370: checking for main in -lnsl" >&5
+echo "configure:9244: 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
@@ -9374,14 +9248,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9378 "configure"
+#line 9252 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9259: \"$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
@@ -9409,7 +9283,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:9413: checking for socket in -linet" >&5
+echo "configure:9287: 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
@@ -9417,7 +9291,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9421 "configure"
+#line 9295 "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
@@ -9428,7 +9302,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:9432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9306: \"$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
@@ -9456,7 +9330,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:9460: checking for main in -lgen" >&5
+echo "configure:9334: 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
@@ -9464,14 +9338,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9468 "configure"
+#line 9342 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9349: \"$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
@@ -9503,12 +9377,12 @@ fi
 
 
 echo $ac_n "checking for select""... $ac_c" 1>&6
-echo "configure:9507: checking for select" >&5
+echo "configure:9381: 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 9512 "configure"
+#line 9386 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char select(); below.  */
@@ -9532,7 +9406,7 @@ f = select;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9410: \"$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
@@ -9555,7 +9429,7 @@ fi
 
 if test "${ac_cv_header_winsock_h}" != yes; then
                                echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
-echo "configure:9559: checking types of arguments for select()" >&5
+echo "configure:9433: 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
@@ -9569,7 +9443,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 9573 "configure"
+#line 9447 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -9588,7 +9462,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
           ac_not_found=no ; break 3
 else
@@ -9629,21 +9503,77 @@ EOF
 fi
 
 
-for ac_hdr in regex.h 
+for ac_func in poll 
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:9510: 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 9515 "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:9539: \"$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
+
+for ac_hdr in poll.h 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9637: checking for $ac_hdr" >&5
+echo "configure:9567: 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 9642 "configure"
+#line 9572 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9577: \"$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*
@@ -9669,300 +9599,174 @@ else
 fi
 done
 
-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 library containing regfree""... $ac_c" 1>&6
-echo "configure:9678: checking for library containing regfree" >&5
-if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
+for ac_hdr in sys/epoll.h 
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:9608: 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
-  ac_func_search_save_LIBS="$LIBS"
-ac_cv_search_regfree="no"
-cat > conftest.$ac_ext <<EOF
-#line 9685 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 9613 "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 regfree();
-
-int main() {
-regfree()
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:9696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:9618: \"$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*
-  ac_cv_search_regfree="none required"
+  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*
-test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
-LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9707 "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 regfree();
-
-int main() {
-regfree()
-; return 0; }
+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
-if { (eval echo configure:9718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_search_regfree="-l$ac_lib"
-break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$ac_t""no" 1>&6
 fi
-rm -f conftest*
 done
-LIBS="$ac_func_search_save_LIBS"
-fi
-
-echo "$ac_t""$ac_cv_search_regfree" 1>&6
-if test "$ac_cv_search_regfree" != "no"; then
-  test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
-  :
-else :
-  { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
-fi
 
-
-echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
-echo "configure:9741: 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
-  
-       if test "$cross_compiling" = yes; then
-  ol_cv_c_posix_regex=cross
+if test "${ac_cv_header_sys_epoll_h}" = yes; then
+echo $ac_n "checking for epoll system call""... $ac_c" 1>&6
+echo "configure:9646: checking for epoll system call" >&5
+if test "$cross_compiling" = yes; then
+  echo "$ac_t""no" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9750 "configure"
+#line 9651 "configure"
 #include "confdefs.h"
-
-#include <sys/types.h>
-#include <regex.h>
-static char *pattern, *string;
-main()
+int main(int argc, char *argv)
 {
-       int rc;
-       regex_t re;
-
-       pattern = "^A";
-
-       if(regcomp(&re, pattern, 0)) {
-               return -1;
-       }
-       
-       string = "ALL MATCH";
-       
-       rc = regexec(&re, string, 0, (void*)0, 0);
-
-       regfree(&re);
-
-       return rc;
+       int epfd = epoll_create(256);
+       exit (epfd == -1 ? 1 : 0);
 }
 EOF
-if { (eval echo configure:9776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_c_posix_regex=yes
+  echo "$ac_t""yes" 1>&6
+cat >> confdefs.h <<\EOF
+#define HAVE_EPOLL 1
+EOF
+
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_c_posix_regex=no
+  echo "$ac_t""no" 1>&6
 fi
 rm -fr conftest*
 fi
 
 fi
 
-echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
-
-if test "$ol_cv_c_posix_regex" = no ; then
-       { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
-fi
-
-
-have_uuid=no
-for ac_hdr in sys/uuid.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9802: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+# strerror checks
+echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
+echo "configure:9679: 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 9807 "configure"
+  
+       cat > conftest.$ac_ext <<EOF
+#line 9685 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h>
+#ifdef WINNT
+#include <stdlib.h>
+#endif 
+int main() {
+char *c = (char *) *sys_errlist
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9812: \"$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:9698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ol_cv_dcl_sys_errlist=yes
+       ol_cv_have_sys_errlist=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_dcl_sys_errlist=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
+
+echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
+#
+# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
+if test $ol_cv_dcl_sys_errlist = no ; then
+       cat >> confdefs.h <<\EOF
+#define DECL_SYS_ERRLIST 1
 EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
-if test $ac_cv_header_sys_uuid_h = yes ; then
-       save_LIBS="$LIBS"
-       
-echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
-echo "configure:9842: checking for library containing uuid_to_str" >&5
-if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
+
+       echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
+echo "configure:9721: 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
-  ac_func_search_save_LIBS="$LIBS"
-ac_cv_search_uuid_to_str="no"
-cat > conftest.$ac_ext <<EOF
-#line 9849 "configure"
+  
+               cat > conftest.$ac_ext <<EOF
+#line 9727 "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 uuid_to_str();
-
+#include <errno.h>
 int main() {
-uuid_to_str()
+char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:9860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_search_uuid_to_str="none required"
+  ol_cv_have_sys_errlist=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
-LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9871 "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 uuid_to_str();
-
-int main() {
-uuid_to_str()
-; return 0; }
-EOF
-if { (eval echo configure:9882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_search_uuid_to_str="-l$ac_lib"
-break
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  ol_cv_have_sys_errlist=no
 fi
 rm -f conftest*
-done
-LIBS="$ac_func_search_save_LIBS"
 fi
 
-echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
-if test "$ac_cv_search_uuid_to_str" != "no"; then
-  test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
-  have_uuid=yes
-else :
-  :
+echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
 fi
-       LIBS="$save_LIBS"
-
-       if test have_uuid = yes ; then
-               cat >> confdefs.h <<\EOF
-#define HAVE_UUID_TO_STR 1
+if test $ol_cv_have_sys_errlist = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_SYS_ERRLIST 1
 EOF
 
-
-               test "$ac_cv_search_uuid_to_str" = "none required" || \
-                       SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
-       fi
-fi
-
-if test $have_uuid = no ; then
-       echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
-echo "configure:9917: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
-       save_LIBS="$LIBS"
-       LIBS="$LIBS -lrpcrt4"
-       cat > conftest.$ac_ext <<EOF
-#line 9921 "configure"
-#include "confdefs.h"
-
-               char UuidCreate@4();
-               char UuidToStringA@8();
-               
-int main() {
-
-               UuidCreate@4();
-               UuidToStringA@8();
-               
-; return 0; }
-EOF
-if { (eval echo configure:9934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  need_rpcrt=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  need_rpcrt=no
-fi
-rm -f conftest*
-       if test $need_rpcrt = yes; then
-               SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
-       fi
-       LIBS="$save_LIBS"
-       echo "$ac_t""$need_rpcrt" 1>&6
 fi
-
-ol_link_dnssrv=no
-echo $ac_n "checking for res_query""... $ac_c" 1>&6
-echo "configure:9953: checking for res_query" >&5
-if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
+ for ac_func in strerror strerror_r
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:9757: 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 9958 "configure"
+#line 9762 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char res_query(); 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 res_query();
+char $ac_func();
 char (*f)();
 
 int main() {
@@ -9970,460 +9774,385 @@ 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_query) || defined (__stub___res_query)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = res_query;
+f = $ac_func;
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:9982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_res_query=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_res_query=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'res_query`\" = 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
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for __res_query""... $ac_c" 1>&6
-echo "configure:10003: checking for __res_query" >&5
-if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
+ol_cv_func_strerror_r=no
+if test "${ac_cv_func_strerror_r}" = yes ; then
+       echo $ac_n "checking non-posix strerror_r""... $ac_c" 1>&6
+echo "configure:9813: checking non-posix strerror_r" >&5
+if eval "test \"\${ol_cv_nonposix_strerror_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 10008 "configure"
+  
+       cat > conftest.$ac_ext <<EOF
+#line 9819 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    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_query();
-char (*f)();
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "strerror_r" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_decl_strerror_r=yes
+else
+  rm -rf conftest*
+  ol_decl_strerror_r=no
+fi
+rm -f conftest*
 
+       if test $ol_decl_strerror_r = yes ; then
+               cat > conftest.$ac_ext <<EOF
+#line 9835 "configure"
+#include "confdefs.h"
+#include <string.h>
 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_query) || defined (__stub_____res_query)
-choke me
-#else
-f = __res_query;
-#endif
-
+   /* from autoconf 2.59 */
+                               char buf[100];
+                               char x = *strerror_r (0, buf, sizeof buf);
+                               char *p = strerror_r (0, buf, sizeof buf);
+                       
 ; return 0; }
 EOF
-if { (eval echo configure:10032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_func___res_query=yes"
+  ol_cv_nonposix_strerror_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func___res_query=no"
+  ol_cv_nonposix_strerror_r=no
 fi
 rm -f conftest*
-fi
+       else
+               if test "$cross_compiling" = yes; then
+  ol_cv_nonposix_strerror=no
+else
+  cat > conftest.$ac_ext <<EOF
+#line 9861 "configure"
+#include "confdefs.h"
 
-if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
+                       main() {
+                               char buf[100];
+                               buf[0] = 0;
+                               strerror_r( 1, buf, sizeof buf );
+                               exit( buf[0] == 0 );
+                       }
+                       
+EOF
+if { (eval echo configure:9872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+then
+  ol_cv_nonposix_strerror_r=yes
 else
-  echo "$ac_t""no" 1>&6
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_cv_nonposix_strerror=no
+fi
+rm -fr conftest*
 fi
 
-       ac_cv_func_res_query=$ac_cv_func___res_query
+       fi
+       
 fi
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
-echo "configure:10056: 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_t""$ol_cv_nonposix_strerror_r" 1>&6
+if test $ol_cv_nonposix_strerror_r = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_NONPOSIX_STRERROR_R 1
+EOF
+
+fi
+
+elif test "${ac_cv_func_strerror}" = no ; then
+       echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
+echo "configure:9898: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lbind  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10064 "configure"
+  
+       cat > conftest.$ac_ext <<EOF
+#line 9904 "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_query();
 
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h>
+#ifdef WINNT
+#include <stdlib.h>
+#endif 
 int main() {
-res_query()
+char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:10075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_dcl_sys_errlist=yes
+       ol_cv_have_sys_errlist=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_dcl_sys_errlist=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lbind $LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
-fi
+echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
+#
+# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
+if test $ol_cv_dcl_sys_errlist = no ; then
+       cat >> confdefs.h <<\EOF
+#define DECL_SYS_ERRLIST 1
+EOF
 
-       ac_cv_func_res_query=$ac_cv_lib_bind_res_query
-fi
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
-echo "configure:10107: 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 "checking existence of sys_errlist""... $ac_c" 1>&6
+echo "configure:9940: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lbind  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10115 "configure"
+  
+               cat > conftest.$ac_ext <<EOF
+#line 9946 "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_query();
-
+#include <errno.h>
 int main() {
-__res_query()
+char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:10126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9953: \"$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_have_sys_errlist=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_have_sys_errlist=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
+fi
 
+echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+if test $ol_cv_have_sys_errlist = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_SYS_ERRLIST 1
 EOF
 
-  LIBS="-lbind $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-       ac_cv_func_res_query=$ac_cv_lib_bind___res_query
 fi
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
-echo "configure:10158: 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
+
+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:9981: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lresolv  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10166 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 9986 "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_query();
-
-int main() {
-res_query()
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:10177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:9991: \"$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_lib_$ac_lib_var=yes"
+  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_lib_$ac_lib_var=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
   cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+#define $ac_tr_hdr 1
 EOF
-
-  LIBS="-lresolv $LIBS"
-
 else
   echo "$ac_t""no" 1>&6
 fi
+done
 
-       ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
+if test "$ac_cv_header_regex_h" != yes ; then
+       { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
 fi
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
-echo "configure:10209: 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 "checking for library containing regfree""... $ac_c" 1>&6
+echo "configure:10022: checking for library containing regfree" >&5
+if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lresolv  $LIBS"
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_regfree="no"
 cat > conftest.$ac_ext <<EOF
-#line 10217 "configure"
+#line 10029 "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_query();
+char regfree();
 
 int main() {
-__res_query()
+regfree()
 ; return 0; }
 EOF
-if { (eval echo configure:10228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10040: \"$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"
+  ac_cv_search_regfree="none required"
 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 resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lresolv $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-       ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
-fi
-
-if test "$ac_cv_func_res_query" = yes ; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_RES_QUERY 1
-EOF
-
-
-       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
-
-for ac_func in getaddrinfo getnameinfo gai_strerror inet_ntop 
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10276: 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 10281 "configure"
+test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
+LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 10051 "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)();
+char regfree();
 
 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
-
+regfree()
 ; return 0; }
 EOF
-if { (eval echo configure:10305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10062: \"$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"
+  ac_cv_search_regfree="-l$ac_lib"
+break
 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*
+done
+LIBS="$ac_func_search_save_LIBS"
 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
+echo "$ac_t""$ac_cv_search_regfree" 1>&6
+if test "$ac_cv_search_regfree" != "no"; then
+  test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
+  :
+else :
+  { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
 fi
-done
 
 
-ol_link_ipv6=no
-if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
-       if test $ol_enable_ipv6 = yes ; then
-               { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
-       fi
-elif test $ol_enable_ipv6 != no ; then
-       echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
-echo "configure:10337: checking INET6_ADDRSTRLEN" >&5
-if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
+echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
+echo "configure:10085: 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
   
-               cat > conftest.$ac_ext <<EOF
-#line 10343 "configure"
-#include "confdefs.h"
-
-#                      include <netinet/in.h>
-#                      ifdef INET6_ADDRSTRLEN
-                               __has_inet6_addrstrlen__;
-#                      endif
-               
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ol_cv_inet6_addrstrlen=yes
-else
-  rm -rf conftest*
-  ol_cv_inet6_addrstrlen=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
-
-
-       echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
-echo "configure:10368: checking struct sockaddr_storage" >&5
-if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-               cat > conftest.$ac_ext <<EOF
-#line 10374 "configure"
+       if test "$cross_compiling" = yes; then
+  ol_cv_c_posix_regex=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10094 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
-#include <sys/socket.h>
+#include <regex.h>
+static char *pattern, *string;
+main()
+{
+       int rc;
+       regex_t re;
 
-int main() {
+       pattern = "^A";
 
-                       struct sockaddr_storage ss;
+       if(regcomp(&re, pattern, 0)) {
+               return -1;
+       }
+       
+       string = "ALL MATCH";
+       
+       rc = regexec(&re, string, 0, (void*)0, 0);
 
-; return 0; }
+       regfree(&re);
+
+       return rc;
+}
 EOF
-if { (eval echo configure:10386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ol_cv_struct_sockaddr_storage=yes
+if { (eval echo configure:10120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+then
+  ol_cv_c_posix_regex=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_struct_sockaddr_storage=no
+  rm -fr conftest*
+  ol_cv_c_posix_regex=no
 fi
-rm -f conftest*
+rm -fr conftest*
 fi
 
-echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
+fi
 
-       if test $ol_cv_inet6_addrstrlen = yes \
-               -a $ol_cv_struct_sockaddr_storage = yes ; then
-               ol_link_ipv6=yes
-       elif test $ol_enable_ipv6 = yes \
-                       -a $ol_cv_inet6_addrstrlen = no ; then
-               { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
-       elif test $ol_enable_ipv6 = yes \
-                       -a $ol_cv_struct_sockaddr_storage = no ; then
-               { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
-       fi
+echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
+
+if test "$ol_cv_c_posix_regex" = no ; then
+       { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
 fi
 
-if test $ol_enable_local != no ; then
-       for ac_hdr in sys/un.h 
+
+have_uuid=no
+for ac_hdr in sys/uuid.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10417: checking for $ac_hdr" >&5
+echo "configure:10146: 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 10422 "configure"
+#line 10151 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10156: \"$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_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_kbind=no
-ol_link_kpasswd=no
-ol_link_krb5=no
-ol_link_krb4=no
-
-if test $ol_with_kerberos = yes -o $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:10474: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+if test $ac_cv_header_sys_uuid_h = yes ; then
+       save_LIBS="$LIBS"
+       
+echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
+echo "configure:10186: checking for library containing uuid_to_str" >&5
+if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 10479 "configure"
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_uuid_to_str="no"
+cat > conftest.$ac_ext <<EOF
+#line 10193 "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 uuid_to_str();
+
+int main() {
+uuid_to_str()
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10484: \"$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:10204: \"$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"
+  ac_cv_search_uuid_to_str="none required"
 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
+test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
+LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 10215 "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 uuid_to_str();
+
+int main() {
+uuid_to_str()
+; return 0; }
 EOF
+if { (eval echo configure:10226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_uuid_to_str="-l$ac_lib"
+break
 else
-  echo "$ac_t""no" 1>&6
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
 fi
+rm -f conftest*
 done
+LIBS="$ac_func_search_save_LIBS"
+fi
 
+echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
+if test "$ac_cv_search_uuid_to_str" != "no"; then
+  test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
+  have_uuid=yes
+else :
+  :
+fi
+       LIBS="$save_LIBS"
 
-       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:10516: 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 10521 "configure"
+       if test have_uuid = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_UUID_TO_STR 1
+EOF
+
+
+               test "$ac_cv_search_uuid_to_str" = "none required" || \
+                       SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
+       fi
+fi
+
+if test $have_uuid = no ; then
+       echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
+echo "configure:10261: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
+       save_LIBS="$LIBS"
+       LIBS="$LIBS -lrpcrt4"
+       cat > conftest.$ac_ext <<EOF
+#line 10265 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+
+               int __stdcall UuidCreate(void *);
+               int __stdcall UuidToStringA(void *,void **);
+               
+int main() {
+
+               UuidCreate(0);
+               UuidToStringA(0,0);
+               
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10526: \"$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:10278: \"$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"
+  need_rpcrt=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"
+  need_rpcrt=no
 fi
 rm -f conftest*
+       if test $need_rpcrt = yes; then
+               SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
+       fi
+       LIBS="$save_LIBS"
+       echo "$ac_t""$need_rpcrt" 1>&6
 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 -lk5crypto""... $ac_c" 1>&6
-echo "configure:10560: checking for main in -lk5crypto" >&5
-ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+ol_cv_lib_resolver=no
+if test $ol_cv_lib_resolver = no ; then
+       echo $ac_n "checking for resolver link (default)""... $ac_c" 1>&6
+echo "configure:10298: checking for resolver link (default)" >&5
+if eval "test \"\${ol_cv_resolver_none+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lk5crypto  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10568 "configure"
+  
+       ol_RESOLVER_LIB=
+       ol_LIBS=$LIBS
+       LIBS="$ol_RESOLVER_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 10308 "configure"
 #include "confdefs.h"
 
+#ifdef HAVE_SYS_TYPES_H
+#      include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+#      include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#      include <resolv.h>
+#endif
+
 int main() {
-main()
+{
+       int len, status;
+       char *request = NULL;
+       unsigned char reply[64*1024];
+       unsigned char host[64*1024];
+       unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
+#else
+       /* Bind 4 interface */
+# ifndef T_SRV
+#  define T_SRV 33
+# endif
+       len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+       p = reply;
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+       /* Bind 4 interface w/ HFIXEDSZ */
+       p += HFIXEDSZ;
+#else
+       /* Bind 4 interface w/o HFIXEDSZ */
+       p += sizeof(HEADER);
+#endif
+       status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}
 ; return 0; }
 EOF
-if { (eval echo configure:10575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10355: \"$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_resolver_none=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_resolver_none=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
-  krb5crypto=k5crypto
-else
-  echo "$ac_t""no" 1>&6
-krb5crypto=crypto
+       LIBS="$ol_LIBS"
+
 fi
 
+echo "$ac_t""$ol_cv_resolver_none" 1>&6
 
-                       echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:10598: 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 -l$krb5crypto -lcom_err $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10606 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:10613: \"$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 -l$krb5crypto -lcom_err"
-else
-  echo "$ac_t""no" 1>&6
-have_krb5=no
+       if test $ol_cv_resolver_none = yes ; then
+               ol_cv_lib_resolver=yes
+       fi
 fi
 
-
-               elif test $krb5_impl = heimdal; then
-                       echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
-echo "configure:10638: checking for main in -ldes" >&5
-ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if test $ol_cv_lib_resolver = no ; then
+       echo $ac_n "checking for resolver link (-lresolv)""... $ac_c" 1>&6
+echo "configure:10379: checking for resolver link (-lresolv)" >&5
+if eval "test \"\${ol_cv_resolver_resolv+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldes  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10646 "configure"
+  
+       ol_RESOLVER_LIB=-lresolv
+       ol_LIBS=$LIBS
+       LIBS="$ol_RESOLVER_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 10389 "configure"
 #include "confdefs.h"
 
+#ifdef HAVE_SYS_TYPES_H
+#      include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+#      include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#      include <resolv.h>
+#endif
+
 int main() {
-main()
+{
+       int len, status;
+       char *request = NULL;
+       unsigned char reply[64*1024];
+       unsigned char host[64*1024];
+       unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
+#else
+       /* Bind 4 interface */
+# ifndef T_SRV
+#  define T_SRV 33
+# endif
+       len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+       p = reply;
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+       /* Bind 4 interface w/ HFIXEDSZ */
+       p += HFIXEDSZ;
+#else
+       /* Bind 4 interface w/o HFIXEDSZ */
+       p += sizeof(HEADER);
+#endif
+       status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}
 ; return 0; }
 EOF
-if { (eval echo configure:10653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10436: \"$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_resolver_resolv=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_resolver_resolv=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
-  krb5crypto=des
-else
-  echo "$ac_t""no" 1>&6
-krb5crypto=crypto
+       LIBS="$ol_LIBS"
+
 fi
 
+echo "$ac_t""$ol_cv_resolver_resolv" 1>&6
 
-                       echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:10676: 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
+       if test $ol_cv_resolver_resolv = yes ; then
+               ol_cv_lib_resolver=-lresolv
+       fi
+fi
+
+if test $ol_cv_lib_resolver = no ; then
+       echo $ac_n "checking for resolver link (-lbind)""... $ac_c" 1>&6
+echo "configure:10460: checking for resolver link (-lbind)" >&5
+if eval "test \"\${ol_cv_resolver_bind+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10684 "configure"
+  
+       ol_RESOLVER_LIB=-lbind
+       ol_LIBS=$LIBS
+       LIBS="$ol_RESOLVER_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 10470 "configure"
 #include "confdefs.h"
 
+#ifdef HAVE_SYS_TYPES_H
+#      include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+#      include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#      include <resolv.h>
+#endif
+
 int main() {
-main()
+{
+       int len, status;
+       char *request = NULL;
+       unsigned char reply[64*1024];
+       unsigned char host[64*1024];
+       unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
+#else
+       /* Bind 4 interface */
+# ifndef T_SRV
+#  define T_SRV 33
+# endif
+       len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+       p = reply;
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+       /* Bind 4 interface w/ HFIXEDSZ */
+       p += HFIXEDSZ;
+#else
+       /* Bind 4 interface w/o HFIXEDSZ */
+       p += sizeof(HEADER);
+#endif
+       status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}
 ; return 0; }
 EOF
-if { (eval echo configure:10691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10517: \"$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_resolver_bind=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_resolver_bind=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 -l$krb5crypto -lasn1 -lroken -lcom_err"
-else
-  echo "$ac_t""no" 1>&6
-have_krb5=no
-fi
+       LIBS="$ol_LIBS"
 
+fi
 
-                       cat >> confdefs.h <<\EOF
-#define HAVE_HEIMDAL_KERBEROS 1
-EOF
+echo "$ac_t""$ol_cv_resolver_bind" 1>&6
 
+       if test $ol_cv_resolver_bind = yes ; then
+               ol_cv_lib_resolver=-lbind
+       fi
+fi
 
-               else
-                       have_krb5=no
-                       echo "configure: warning: Unrecognized Kerberos5 Implementation" 1>&2
-               fi
 
-               if test $have_krb5 = yes ; then
-                       ol_link_krb5=yes
 
-                       cat >> confdefs.h <<\EOF
-#define HAVE_KRB5 1
+ol_link_dnssrv=no
+if test "$ol_cv_lib_resolver" != no ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_RES_QUERY 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
+       if test "$ol_enable_dnssrv" != no ; then
+               ol_link_dnssrv=yes
+       fi
 
+       if test "$ol_cv_lib_resolver" != yes ; then
+               LIBS="$ol_cv_lib_resolver $LIBS"
        fi
 fi
 
-if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
-       $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
+if test "$ol_enable_dnssrv" = yes -o "$ol_enable_dnssrv" = mod ; then
+       if test "$ol_link_dnssrv" = no ; then
+               { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
+       fi
+else
+       ol_enable_dnssrv=no
+fi
 
-       for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
+for ac_func in hstrerror 
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10754: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:10568: 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 10759 "configure"
+#line 10573 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+/* 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
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (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
+if { (eval echo configure:10597: \"$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_func_$ac_func=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_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
   cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+#define $ac_tr_func 1
 EOF
  
 else
 done
 
 
-       if test $ac_cv_header_kerberosIV_krb_h = yes ; then
-               if test $krb5_impl = mit; then
-                       echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:10794: 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
+for ac_func in getaddrinfo getnameinfo gai_strerror inet_ntop 
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:10625: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10802 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 10630 "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() {
-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:10809: \"$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"
+  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_lib_$ac_lib_var=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_k425=yes
-                               KRB4_LIBS="-lkrb4 -ldes425"
+    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
-have_k425=no
 fi
+done
 
 
-               elif test $krb5_impl = heimdal; then
-                       echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:10834: 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
+ol_link_ipv6=no
+if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
+       if test $ol_enable_ipv6 = yes ; then
+               { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
+       fi
+elif test $ol_enable_ipv6 != no ; then
+       echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
+echo "configure:10686: checking INET6_ADDRSTRLEN" >&5
+if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10842 "configure"
+  
+               cat > conftest.$ac_ext <<EOF
+#line 10692 "configure"
 #include "confdefs.h"
 
-int main() {
-main()
-; return 0; }
+#                      include <netinet/in.h>
+#                      ifdef INET6_ADDRSTRLEN
+                               __has_inet6_addrstrlen__;
+#                      endif
+               
 EOF
-if { (eval echo configure:10849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_inet6_addrstrlen=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_inet6_addrstrlen=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"
-else
-  echo "$ac_t""no" 1>&6
-have_k425=no
-fi
-
-
-               else
-                       have_425=no
-                       echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
-               fi
-
-               if test $have_k425 = yes ; then
-                       ol_with_kerberos=found
-                       ol_link_krb4=yes
 
-                       cat >> confdefs.h <<\EOF
-#define HAVE_KRB425 1
-EOF
-
-                       cat >> confdefs.h <<\EOF
-#define HAVE_KRB4 1
-EOF
+echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
 
 
-                       echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:10891: checking for des_debug in Kerberos libraries" >&5
-if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
+       echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
+echo "configure:10717: checking struct sockaddr_storage" >&5
+if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-                                                               save_LIBS="$LIBS"
-                               LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 10899 "configure"
+               cat > conftest.$ac_ext <<EOF
+#line 10723 "configure"
 #include "confdefs.h"
 
-#include <kerberosIV/krb.h>
-#include <kerberosIV/des.h>
-extern int des_debug;
+#include <sys/types.h>
+#include <sys/socket.h>
 
 int main() {
 
-des_debug = 1;
+                       struct sockaddr_storage ss;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_var_des_debug=yes
+  ol_cv_struct_sockaddr_storage=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_var_des_debug=no
+  ol_cv_struct_sockaddr_storage=no
 fi
 rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
 fi
 
-echo "$ac_t""$ol_cv_var_des_debug" 1>&6
-
-                       if test $ol_cv_var_des_debug = yes ; then
-                               cat >> confdefs.h <<\EOF
-#define HAVE_DES_DEBUG 1
-EOF
-
-                       fi
+echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
 
-                       LIBS="$save_LIBS"
-               fi
+       if test $ol_cv_inet6_addrstrlen = yes \
+               -a $ol_cv_struct_sockaddr_storage = yes ; then
+               ol_link_ipv6=yes
+       elif test $ol_enable_ipv6 = yes \
+                       -a $ol_cv_inet6_addrstrlen = no ; then
+               { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
+       elif test $ol_enable_ipv6 = yes \
+                       -a $ol_cv_struct_sockaddr_storage = no ; then
+               { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
        fi
 fi
 
-if test $ol_link_krb5 = yes ; then
-       ol_with_kerberos=found
-fi
-
-if test $ol_with_kerberos = yes -o $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 
+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:10951: checking for $ac_hdr" >&5
+echo "configure:10766: 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 10956 "configure"
+#line 10771 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10776: \"$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_krb_h = yes ; then
-               echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
-echo "configure:10990: 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
+       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_kbind=no
+ol_link_krb5=no
+ol_link_krb4=no
+
+if test $ol_with_kerberos = yes -o $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:10822: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lkrb -ldes $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10998 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 10827 "configure"
 #include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:11005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:10832: \"$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_lib_$ac_lib_var=yes"
+  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_lib_$ac_lib_var=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_k4=yes
+    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
-have_k4=no
-fi
-
-
-               if test $have_k4 = yes ; then
-                       ol_with_kerberos=found
-                       ol_link_krb4=yes
-
-                       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_krb4 = yes -a $ol_enable_kbind != no ; then
-       ol_link_kbind=yes
-
-elif test $ol_enable_kbind = yes ; then
-       { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
 fi
+done
 
-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
+       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:11075: 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 11080 "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:11085: \"$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*
@@ -11107,30 +10896,30 @@ else
 fi
 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:11115: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
-ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
+               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 -lk5crypto""... $ac_c" 1>&6
+echo "configure:10908: checking for main in -lk5crypto" >&5
+ac_lib_var=`echo k5crypto'_'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="-lssl -lcrypto $LIBS"
+LIBS="-lk5crypto  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11123 "configure"
+#line 10916 "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 SSLeay_add_ssl_algorithms();
 
 int main() {
-SSLeay_add_ssl_algorithms()
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:11134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10923: \"$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
@@ -11145,36 +10934,30 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_ssleay=yes
-                       need_rsaref=no
+  krb5crypto=k5crypto
 else
   echo "$ac_t""no" 1>&6
-have_ssleay=no
+krb5crypto=crypto
 fi
 
-                       
-               if test $have_ssleay = no ; then
-                       echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
-echo "configure:11159: checking for SSL_library_init in -lssl" >&5
-ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
+
+                       echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
+echo "configure:10946: 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="-lssl -lcrypto $LIBS"
+LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11167 "configure"
+#line 10954 "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 SSL_library_init();
 
 int main() {
-SSL_library_init()
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:11178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10961: \"$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
@@ -11189,37 +10972,32 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_ssleay=yes
-                               need_rsaref=no
+  have_krb5=yes
+                               KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
 else
   echo "$ac_t""no" 1>&6
-have_ssleay=no
+have_krb5=no
 fi
 
-               fi
 
-               if test $have_ssleay = no ; then
-                       echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
-echo "configure:11204: checking for ssl3_accept in -lssl" >&5
-ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
+               elif test $krb5_impl = heimdal; then
+                       echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
+echo "configure:10986: checking for main in -ldes" >&5
+ac_lib_var=`echo des'_'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="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
+LIBS="-ldes  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11212 "configure"
+#line 10994 "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 ssl3_accept();
 
 int main() {
-ssl3_accept()
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:11223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11001: \"$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
@@ -11234,171 +11012,99 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_ssleay=yes
-                               need_rsaref=yes
+  krb5crypto=des
 else
   echo "$ac_t""no" 1>&6
-have_ssleay=no
-fi
-
-               fi
-
-               if test $have_ssleay = yes ; then
-                       ol_with_tls=found
-                       ol_link_tls=yes
-
-                       cat >> confdefs.h <<\EOF
-#define HAVE_SSLEAY 1
-EOF
-
-
-                       if test $need_rsaref = yes; then
-                               cat >> confdefs.h <<\EOF
-#define HAVE_RSAREF 1
-EOF
-
-
-                               TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
-                       else
-                               TLS_LIBS="-lssl -lcrypto"
-                       fi
-               fi
-       fi
-
-else
-       echo "configure: warning: TLS data protection not supported!" 1>&2
-fi
-
-WITH_TLS=no
-if test $ol_link_tls = yes ; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_TLS 1
-EOF
-
-       WITH_TLS=yes
-
-elif test $ol_with_tls = auto ; then
-       echo "configure: warning: Could not locate TLS/SSL package" 1>&2
-       echo "configure: warning: TLS data 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
-
-if test $ol_enable_lmpasswd != no; then
-       if test $ol_link_tls != yes ; then
-               { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
-       fi
-
-       cat >> confdefs.h <<\EOF
-#define SLAPD_LMHASH 1
-EOF
-
+krb5crypto=crypto
 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 _beginthread""... $ac_c" 1>&6
-echo "configure:11307: checking for _beginthread" >&5
-if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
+                       echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
+echo "configure:11024: 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
-  cat > conftest.$ac_ext <<EOF
-#line 11312 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11032 "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
-
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:11336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func__beginthread=yes"
+  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_func__beginthread=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
+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 -l$krb5crypto -lasn1 -lroken -lcom_err"
 else
   echo "$ac_t""no" 1>&6
+have_krb5=no
 fi
 
 
-       if test $ac_cv_func__beginthread = yes ; then
-               cat >> confdefs.h <<\EOF
-#define HAVE_NT_THREADS 1
+                       cat >> confdefs.h <<\EOF
+#define HAVE_HEIMDAL_KERBEROS 1
 EOF
 
-               ol_cv_nt_threads=yes
-       fi
 
+               else
+                       have_krb5=no
+                       echo "configure: warning: Unrecognized Kerberos5 Implementation" 1>&2
+               fi
 
-       if test "$ol_cv_nt_threads" = yes ; then
-               ol_link_threads=nt
-               ol_with_threads=found
-               ol_with_yielding_select=yes
+               if test $have_krb5 = yes ; then
+                       ol_link_krb5=yes
 
-               cat >> confdefs.h <<\EOF
-#define HAVE_NT_SERVICE_MANAGER 1
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KRB5 1
 EOF
 
-               cat >> confdefs.h <<\EOF
-#define HAVE_NT_EVENT_LOG 1
-EOF
 
-       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
 
-       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
+if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
+       $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
 
-       for ac_hdr in pthread.h
+       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:11392: checking for $ac_hdr" >&5
+echo "configure:11098: 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 11397 "configure"
+#line 11103 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11108: \"$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_pthread_h = yes ; then
-               echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:11431: checking POSIX thread version" >&5
-if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
+       if test $ac_cv_header_kerberosIV_krb_h = yes ; then
+               if test $krb5_impl = mit; then
+                       echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
+echo "configure:11138: 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
-  
-       cat > conftest.$ac_ext <<EOF
-#line 11437 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11146 "configure"
 #include "confdefs.h"
 
-#              include <pthread.h>
-       
 int main() {
-
-               int i = PTHREAD_CREATE_JOINABLE;
-       
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:11448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  
-       cat > conftest.$ac_ext <<EOF
-#line 11452 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pthread_detach" >/dev/null 2>&1; then
+if { (eval echo configure:11153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_version=10
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_version=8
+  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 "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-       cat > conftest.$ac_ext <<EOF
-#line 11472 "configure"
-#include "confdefs.h"
+  echo "$ac_t""no" 1>&6
+have_k425=no
+fi
 
-#              include <pthread.h>
-#              ifdef PTHREAD_CREATE_UNDETACHED
-               draft7
-#              endif
-       
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "draft7" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ol_cv_pthread_version=7
-else
-  rm -rf conftest*
-  
-       cat > conftest.$ac_ext <<EOF
-#line 11489 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pthread_attr_init" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ol_cv_pthread_version=6
+
+               elif test $krb5_impl = heimdal; then
+                       echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
+echo "configure:11178: 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
-  rm -rf conftest*
-  
-       cat > conftest.$ac_ext <<EOF
-#line 11501 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11186 "configure"
 #include "confdefs.h"
 
-#              include <pthread.h>
-#ifdef         PTHREAD_MUTEX_INITIALIZER
-               draft5
-#endif
-       
+int main() {
+main()
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "draft5" >/dev/null 2>&1; then
+if { (eval echo configure:11193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_version=5
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_version=4
-fi
-rm -f conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
 fi
-rm -f conftest*
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_k425=yes
+                               KRB4_LIBS="-lkrb4"
+else
+  echo "$ac_t""no" 1>&6
+have_k425=no
 fi
-rm -f conftest*
 
-fi
 
-echo "$ac_t""$ol_cv_pthread_version" 1>&6
+               else
+                       have_425=no
+                       echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
+               fi
 
+               if test $have_k425 = yes ; then
+                       ol_with_kerberos=found
+                       ol_link_krb4=yes
 
-               if test $ol_cv_pthread_version != 0 ; then
-                       cat >> confdefs.h <<EOF
-#define HAVE_PTHREADS $ol_cv_pthread_version
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KRB425 1
 EOF
 
-               else
-                       { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
-               fi
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KRB4 1
+EOF
 
-               # consider threads found
-               ol_with_threads=found
 
-               
-       echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:11548: checking for LinuxThreads pthread.h" >&5
-if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
+                       echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
+echo "configure:11235: 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
-  cat > conftest.$ac_ext <<EOF
-#line 11553 "configure"
+  
+                                                               save_LIBS="$LIBS"
+                               LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
+                               cat > conftest.$ac_ext <<EOF
+#line 11243 "configure"
 #include "confdefs.h"
-#include <pthread.h>
+
+#include <kerberosIV/krb.h>
+#include <kerberosIV/des.h>
+extern int des_debug;
+
+int main() {
+
+des_debug = 1;
+
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
+if { (eval echo configure:11256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_header_linux_threads=yes
+  ol_cv_var_des_debug=yes
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_header_linux_threads=no
+  ol_cv_var_des_debug=no
 fi
 rm -f conftest*
-
-               
+                                                               LIBS="$save_LIBS"
+                       
 fi
 
-echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
-       if test $ol_cv_header_linux_threads = yes; then
-               cat >> confdefs.h <<\EOF
-#define HAVE_LINUX_THREADS 1
-EOF
+echo "$ac_t""$ol_cv_var_des_debug" 1>&6
 
-       fi
+                       if test $ol_cv_var_des_debug = yes ; then
+                               cat >> confdefs.h <<\EOF
+#define HAVE_DES_DEBUG 1
+EOF
 
-               
-       echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
-echo "configure:11580: 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 11585 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-#ifdef _POSIX_THREAD_IS_GNU_PTH
-       __gnu_pth__;
-#endif
+                       fi
 
-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
+                       LIBS="$save_LIBS"
+               fi
+       fi
 fi
-rm -f conftest*
 
-               
+if test $ol_link_krb5 = yes ; then
+       ol_with_kerberos=found
 fi
 
-echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
-
+if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
+       -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
 
-               if test $ol_cv_header_gnu_pth_pthread_h = no ; then
-                       for ac_hdr in sched.h
+       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:11614: checking for $ac_hdr" >&5
+echo "configure:11295: 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 11619 "configure"
+#line 11300 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11624: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11305: \"$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
 
-               fi
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
-                               echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
-echo "configure:11654: checking for pthread_create in default libraries" >&5
-if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
+       if test $ac_cv_header_krb_h = yes ; then
+               echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
+echo "configure:11334: 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
 else
-  
-               if test "$cross_compiling" = yes; then
-  cat > conftest.$ac_ext <<EOF
-#line 11661 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb -ldes $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11342 "configure"
 #include "confdefs.h"
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-       void *p;
-{
-       return (void *) (p == NULL);
-}
 
 int main() {
-
-       /* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define        PTHREAD_CREATE_DETACHED 1
-#endif
-       pthread_t t;
-       int status;
-       int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-       /* Final pthreads */
-       pthread_attr_t attr;
-
-       status = pthread_attr_init(&attr);
-       if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-       status = pthread_attr_setdetachstate(&attr, &detach);
-       if( status < 0 ) status = errno;
-#else
-       status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-       if( status ) return status;
-       status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-       if( status < 0 ) status = errno;
-#endif
-       if( status ) return status;
-#else
-       /* Draft 4 pthreads */
-       status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return errno;
-
-       /* give thread a chance to complete */
-       /* it should remain joinable and hence detachable */
-       sleep( 1 );
-
-       status = pthread_detach( &t );
-       if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
-#endif
-
-       return 0;
-
+main()
 ; return 0; }
 EOF
-if { (eval echo configure:11728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_create=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_create=no
+  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_k4=yes
 else
-  cat > conftest.$ac_ext <<EOF
-#line 11740 "configure"
-#include "confdefs.h"
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
+  echo "$ac_t""no" 1>&6
+have_k4=no
+fi
 
-static void *task(p)
-       void *p;
-{
-       return (void *) (p == NULL);
-}
 
+               if test $have_k4 = yes ; then
+                       ol_with_kerberos=found
+                       ol_link_krb4=yes
 
-int main(argc, argv)
-       int argc;
-       char **argv;
-{
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KRB4 1
+EOF
 
-       /* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define        PTHREAD_CREATE_DETACHED 1
-#endif
-       pthread_t t;
-       int status;
-       int detach = PTHREAD_CREATE_DETACHED;
 
-#if HAVE_PTHREADS > 4
-       /* Final pthreads */
-       pthread_attr_t attr;
+                       KRB4_LIBS="-lkrb -ldes"
 
-       status = pthread_attr_init(&attr);
-       if( status ) return status;
+                       if test $ac_cv_header_krb_archaeology_h = yes ; then
+                               cat >> confdefs.h <<\EOF
+#define HAVE_KTH_KERBEROS 1
+EOF
 
-#if HAVE_PTHREADS < 7
-       status = pthread_attr_setdetachstate(&attr, &detach);
-       if( status < 0 ) status = errno;
-#else
-       status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-       if( status ) return status;
-       status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-       if( status < 0 ) status = errno;
-#endif
-       if( status ) return status;
-#else
-       /* Draft 4 pthreads */
-       status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return errno;
+                       fi
+               fi
+       fi
+fi
 
-       /* give thread a chance to complete */
-       /* it should remain joinable and hence detachable */
-       sleep( 1 );
+if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
+       ol_link_kbind=yes
 
-       status = pthread_detach( &t );
-       if( status ) return errno;
-#endif
+elif test $ol_enable_kbind = yes ; then
+       { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
+fi
 
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
-#endif
+if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_KERBEROS 1
+EOF
 
-       return 0;
 
-}
+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:11416: 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 11421 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:11812: \"$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
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:11426: \"$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 -fr conftest*
-  ol_cv_pthread_create=no
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
-rm -fr conftest*
+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_t""$ol_cv_pthread_create" 1>&6
 
-               if test $ol_cv_pthread_create != no ; then
-                       ol_link_threads=posix
-                       ol_link_pthreads=""
-               fi
-               
-               # Pthread try link: -kthread (ol_cv_pthread_kthread)
-if test "$ol_link_threads" = no ; then
-       # try -kthread
-       echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
-echo "configure:11837: checking for pthread link with -kthread" >&5
-if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
+       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:11456: 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
 else
-  
-               # save the flags
-               ol_LIBS="$LIBS"
-               LIBS="-kthread $LIBS"
-
-               if test "$cross_compiling" = yes; then
-  cat > conftest.$ac_ext <<EOF
-#line 11848 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lssl -lcrypto $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11464 "configure"
 #include "confdefs.h"
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-       void *p;
-{
-       return (void *) (p == NULL);
-}
+/* 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 SSLeay_add_ssl_algorithms();
 
 int main() {
+SSLeay_add_ssl_algorithms()
+; return 0; }
+EOF
+if { (eval echo configure:11475: \"$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"
 
-       /* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define        PTHREAD_CREATE_DETACHED 1
-#endif
-       pthread_t t;
-       int status;
-       int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-       /* Final pthreads */
-       pthread_attr_t attr;
-
-       status = pthread_attr_init(&attr);
-       if( status ) return status;
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_ssleay=yes
+                       need_rsaref=no
+else
+  echo "$ac_t""no" 1>&6
+have_ssleay=no
+fi
 
-#if HAVE_PTHREADS < 7
-       status = pthread_attr_setdetachstate(&attr, &detach);
-       if( status < 0 ) status = errno;
-#else
-       status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-       if( status ) return status;
-       status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-       if( status < 0 ) status = errno;
-#endif
-       if( status ) return status;
-#else
-       /* Draft 4 pthreads */
-       status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return errno;
+                       
+               if test $have_ssleay = no ; then
+                       echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
+echo "configure:11500: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lssl -lcrypto $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11508 "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 SSL_library_init();
 
-       /* give thread a chance to complete */
-       /* it should remain joinable and hence detachable */
-       sleep( 1 );
+int main() {
+SSL_library_init()
+; return 0; }
+EOF
+if { (eval echo configure:11519: \"$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"
 
-       status = pthread_detach( &t );
-       if( status ) return errno;
-#endif
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_ssleay=yes
+                               need_rsaref=no
+else
+  echo "$ac_t""no" 1>&6
+have_ssleay=no
+fi
 
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
-#endif
+               fi
 
-       return 0;
+               if test $have_ssleay = no ; then
+                       echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
+echo "configure:11545: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 11553 "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 ssl3_accept();
 
+int main() {
+ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:11915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_kthread=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_kthread=no
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-else
-  cat > conftest.$ac_ext <<EOF
-#line 11927 "configure"
-#include "confdefs.h"
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
+LIBS="$ac_save_LIBS"
 
-static void *task(p)
-       void *p;
-{
-       return (void *) (p == NULL);
-}
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_ssleay=yes
+                               need_rsaref=yes
+else
+  echo "$ac_t""no" 1>&6
+have_ssleay=no
+fi
 
+               fi
 
-int main(argc, argv)
-       int argc;
-       char **argv;
-{
+               if test $have_ssleay = yes ; then
+                       ol_with_tls=found
+                       ol_link_tls=yes
 
-       /* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define        PTHREAD_CREATE_DETACHED 1
-#endif
-       pthread_t t;
-       int status;
-       int detach = PTHREAD_CREATE_DETACHED;
+                       cat >> confdefs.h <<\EOF
+#define HAVE_SSLEAY 1
+EOF
 
-#if HAVE_PTHREADS > 4
-       /* Final pthreads */
-       pthread_attr_t attr;
 
-       status = pthread_attr_init(&attr);
-       if( status ) return status;
+                       if test $need_rsaref = yes; then
+                               cat >> confdefs.h <<\EOF
+#define HAVE_RSAREF 1
+EOF
 
-#if HAVE_PTHREADS < 7
-       status = pthread_attr_setdetachstate(&attr, &detach);
-       if( status < 0 ) status = errno;
-#else
-       status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-       if( status ) return status;
-       status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-       if( status < 0 ) status = errno;
-#endif
-       if( status ) return status;
-#else
-       /* Draft 4 pthreads */
-       status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return errno;
 
-       /* give thread a chance to complete */
-       /* it should remain joinable and hence detachable */
-       sleep( 1 );
+                               TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
+                       else
+                               TLS_LIBS="-lssl -lcrypto"
+                       fi
+               fi
+               echo $ac_n "checking OpenSSL library version (CRL checking capability)""... $ac_c" 1>&6
+echo "configure:11609: checking OpenSSL library version (CRL checking capability)" >&5
+if eval "test \"\${ol_cv_ssl_crl_compat+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cat > conftest.$ac_ext <<EOF
+#line 11615 "configure"
+#include "confdefs.h"
 
-       status = pthread_detach( &t );
-       if( status ) return errno;
+#ifdef HAVE_OPENSSL_SSL_H
+#include <openssl/ssl.h>
+#else
+#include <ssl.h>
 #endif
 
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
+/* Require 0.9.7d+ */
+#if OPENSSL_VERSION_NUMBER >= 0x0090704fL
+       char *__ssl_compat = "0.9.7d";
 #endif
+       
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__ssl_compat" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_ssl_crl_compat=yes
+else
+  rm -rf conftest*
+  ol_cv_ssl_crl_compat=no
+fi
+rm -f conftest*
 
-       return 0;
+fi
 
-}
+echo "$ac_t""$ol_cv_ssl_crl_compat" 1>&6
 
+               if test $ol_cv_ssl_crl_compat = no ; then
+                       ol_link_ssl=no
+                else 
+                       cat >> confdefs.h <<\EOF
+#define HAVE_OPENSSL_CRL 1
 EOF
-if { (eval echo configure:11999: \"$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
+
+               fi
+       fi
+
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ol_cv_pthread_kthread=no
-fi
-rm -fr conftest*
+       echo "configure: warning: TLS data protection not supported!" 1>&2
 fi
 
+WITH_TLS=no
+if test $ol_link_tls = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_TLS 1
+EOF
 
-               # restore the LIBS
-               LIBS="$ol_LIBS"
-       
-fi
+       WITH_TLS=yes
 
-echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
+elif test $ol_with_tls = auto ; then
+       echo "configure: warning: Could not locate TLS/SSL package" 1>&2
+       echo "configure: warning: TLS data protection not supported!" 1>&2
 
-       if test $ol_cv_pthread_kthread = yes ; then
-               ol_link_pthreads="-kthread"
-               ol_link_threads=posix
+elif test $ol_with_tls != no ; then
+       { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
+fi
+
+if test $ol_enable_lmpasswd != no; then
+       if test $ol_link_tls != yes ; then
+               { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
        fi
+
+       cat >> confdefs.h <<\EOF
+#define SLAPD_LMHASH 1
+EOF
+
 fi
 
-               # Pthread try link: -pthread (ol_cv_pthread_pthread)
-if test "$ol_link_threads" = no ; then
-       # try -pthread
-       echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
-echo "configure:12029: checking for pthread link with -pthread" >&5
-if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
+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 _beginthread""... $ac_c" 1>&6
+echo "configure:11692: checking for _beginthread" >&5
+if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-               # save the flags
-               ol_LIBS="$LIBS"
-               LIBS="-pthread $LIBS"
-
-               if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12040 "configure"
+#line 11697 "configure"
 #include "confdefs.h"
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-       void *p;
-{
-       return (void *) (p == NULL);
-}
+/* 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() {
 
-       /* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define        PTHREAD_CREATE_DETACHED 1
-#endif
-       pthread_t t;
-       int status;
-       int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-       /* Final pthreads */
-       pthread_attr_t attr;
-
-       status = pthread_attr_init(&attr);
-       if( status ) return status;
-
-#if HAVE_PTHREADS < 7
-       status = pthread_attr_setdetachstate(&attr, &detach);
-       if( status < 0 ) status = errno;
-#else
-       status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-       if( status ) return status;
-       status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-       if( status < 0 ) status = errno;
-#endif
-       if( status ) return status;
+/* 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
-       /* Draft 4 pthreads */
-       status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return errno;
-
-       /* give thread a chance to complete */
-       /* it should remain joinable and hence detachable */
-       sleep( 1 );
-
-       status = pthread_detach( &t );
-       if( status ) return errno;
-#endif
-
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
+f = _beginthread;
 #endif
 
-       return 0;
-
 ; return 0; }
 EOF
-if { (eval echo configure:12107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_pthread=yes
+  eval "ac_cv_func__beginthread=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_pthread=no
+  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
+  :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 12119 "configure"
-#include "confdefs.h"
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
+  echo "$ac_t""no" 1>&6
+fi
 
-static void *task(p)
-       void *p;
-{
-       return (void *) (p == NULL);
-}
 
+       if test $ac_cv_func__beginthread = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_THREADS 1
+EOF
 
-int main(argc, argv)
-       int argc;
-       char **argv;
-{
+               ol_cv_nt_threads=yes
+       fi
 
-       /* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define        PTHREAD_CREATE_DETACHED 1
-#endif
-       pthread_t t;
-       int status;
-       int detach = PTHREAD_CREATE_DETACHED;
 
-#if HAVE_PTHREADS > 4
-       /* Final pthreads */
-       pthread_attr_t attr;
+       if test "$ol_cv_nt_threads" = yes ; then
+               ol_link_threads=nt
+               ol_with_threads=found
+               ol_with_yielding_select=yes
 
-       status = pthread_attr_init(&attr);
-       if( status ) return status;
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_SERVICE_MANAGER 1
+EOF
 
-#if HAVE_PTHREADS < 7
-       status = pthread_attr_setdetachstate(&attr, &detach);
-       if( status < 0 ) status = errno;
-#else
-       status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-       if( status ) return status;
-       status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-       if( status < 0 ) status = errno;
-#endif
-       if( status ) return status;
-#else
-       /* Draft 4 pthreads */
-       status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return errno;
-
-       /* give thread a chance to complete */
-       /* it should remain joinable and hence detachable */
-       sleep( 1 );
-
-       status = pthread_detach( &t );
-       if( status ) return errno;
-#endif
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_EVENT_LOG 1
+EOF
 
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
-#endif
+       fi
 
-       return 0;
+       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
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:11777: 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 11782 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:12191: \"$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
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:11787: \"$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 -fr conftest*
-  ol_cv_pthread_pthread=no
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
-rm -fr conftest*
+rm -f conftest*
 fi
-
-
-               # restore the LIBS
-               LIBS="$ol_LIBS"
-       
+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_t""$ol_cv_pthread_pthread" 1>&6
-
-       if test $ol_cv_pthread_pthread = yes ; then
-               ol_link_pthreads="-pthread"
-               ol_link_threads=posix
-       fi
-fi
 
-               # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
-if test "$ol_link_threads" = no ; then
-       # try -pthreads
-       echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
-echo "configure:12221: checking for pthread link with -pthreads" >&5
-if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
+       if test $ac_cv_header_pthread_h = yes ; then
+               echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
+echo "configure:11816: checking POSIX thread version" >&5
+if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-               # save the flags
-               ol_LIBS="$LIBS"
-               LIBS="-pthreads $LIBS"
+       cat > conftest.$ac_ext <<EOF
+#line 11822 "configure"
+#include "confdefs.h"
 
-               if test "$cross_compiling" = yes; then
-  cat > conftest.$ac_ext <<EOF
-#line 12232 "configure"
+#              include <pthread.h>
+       
+int main() {
+
+               int i = PTHREAD_CREATE_JOINABLE;
+       
+; return 0; }
+EOF
+if { (eval echo configure:11833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  
+       cat > conftest.$ac_ext <<EOF
+#line 11837 "configure"
 #include "confdefs.h"
-/* pthread test headers */
 #include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pthread_detach" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_pthread_version=10
+else
+  rm -rf conftest*
+  ol_cv_pthread_version=8
+fi
+rm -f conftest*
 
-static void *task(p)
-       void *p;
-{
-       return (void *) (p == NULL);
-}
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+       cat > conftest.$ac_ext <<EOF
+#line 11857 "configure"
+#include "confdefs.h"
 
-int main() {
+#              include <pthread.h>
+#              ifdef PTHREAD_CREATE_UNDETACHED
+               draft7
+#              endif
+       
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "draft7" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_pthread_version=7
+else
+  rm -rf conftest*
+  
+       cat > conftest.$ac_ext <<EOF
+#line 11874 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pthread_attr_init" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_pthread_version=6
+else
+  rm -rf conftest*
+  
+       cat > conftest.$ac_ext <<EOF
+#line 11886 "configure"
+#include "confdefs.h"
 
-       /* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define        PTHREAD_CREATE_DETACHED 1
+#              include <pthread.h>
+#ifdef         PTHREAD_MUTEX_INITIALIZER
+               draft5
 #endif
-       pthread_t t;
-       int status;
-       int detach = PTHREAD_CREATE_DETACHED;
-
-#if HAVE_PTHREADS > 4
-       /* Final pthreads */
-       pthread_attr_t attr;
+       
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "draft5" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_pthread_version=5
+else
+  rm -rf conftest*
+  ol_cv_pthread_version=4
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
 
-       status = pthread_attr_init(&attr);
-       if( status ) return status;
+fi
 
-#if HAVE_PTHREADS < 7
-       status = pthread_attr_setdetachstate(&attr, &detach);
-       if( status < 0 ) status = errno;
-#else
-       status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-       if( status ) return status;
-       status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-       if( status < 0 ) status = errno;
-#endif
-       if( status ) return status;
-#else
-       /* Draft 4 pthreads */
-       status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return errno;
+echo "$ac_t""$ol_cv_pthread_version" 1>&6
 
-       /* give thread a chance to complete */
-       /* it should remain joinable and hence detachable */
-       sleep( 1 );
 
-       status = pthread_detach( &t );
-       if( status ) return errno;
-#endif
+               if test $ol_cv_pthread_version != 0 ; then
+                       cat >> confdefs.h <<EOF
+#define HAVE_PTHREADS $ol_cv_pthread_version
+EOF
 
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
-#endif
+               else
+                       { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
+               fi
 
-       return 0;
+               # consider threads found
+               ol_with_threads=found
 
-; return 0; }
+               
+       echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
+echo "configure:11933: 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 11938 "configure"
+#include "confdefs.h"
+#include <pthread.h>
 EOF
-if { (eval echo configure:12299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
   rm -rf conftest*
-  ol_cv_pthread_pthreads=yes
+  ol_cv_header_linux_threads=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_pthreads=no
+  ol_cv_header_linux_threads=no
 fi
 rm -f conftest*
-else
-  cat > conftest.$ac_ext <<EOF
-#line 12311 "configure"
-#include "confdefs.h"
-/* pthread test headers */
-#include <pthread.h>
-#if HAVE_PTHREADS < 7
-#include <errno.h>
-#endif
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
-       void *p;
-{
-       return (void *) (p == NULL);
-}
-
-
-int main(argc, argv)
-       int argc;
-       char **argv;
-{
 
-       /* pthread test function */
-#ifndef PTHREAD_CREATE_DETACHED
-#define        PTHREAD_CREATE_DETACHED 1
-#endif
-       pthread_t t;
-       int status;
-       int detach = PTHREAD_CREATE_DETACHED;
+               
+fi
 
-#if HAVE_PTHREADS > 4
-       /* Final pthreads */
-       pthread_attr_t attr;
+echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
+       if test $ol_cv_header_linux_threads = yes; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_LINUX_THREADS 1
+EOF
 
-       status = pthread_attr_init(&attr);
-       if( status ) return status;
+       fi
 
-#if HAVE_PTHREADS < 7
-       status = pthread_attr_setdetachstate(&attr, &detach);
-       if( status < 0 ) status = errno;
-#else
-       status = pthread_attr_setdetachstate(&attr, detach);
-#endif
-       if( status ) return status;
-       status = pthread_create( &t, &attr, task, NULL );
-#if HAVE_PTHREADS < 7
-       if( status < 0 ) status = errno;
+               
+       echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
+echo "configure:11965: 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 11970 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+       __gnu_pth__;
 #endif
-       if( status ) return status;
-#else
-       /* Draft 4 pthreads */
-       status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return errno;
 
-       /* give thread a chance to complete */
-       /* it should remain joinable and hence detachable */
-       sleep( 1 );
-
-       status = pthread_detach( &t );
-       if( status ) return errno;
-#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*
 
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
-#endif
+               
+fi
 
-       return 0;
+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:11999: 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 12004 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:12383: \"$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
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:12009: \"$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 -fr conftest*
-  ol_cv_pthread_pthreads=no
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
 fi
-rm -fr conftest*
+rm -f conftest*
 fi
-
-
-               # restore the LIBS
-               LIBS="$ol_LIBS"
-       
+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_t""$ol_cv_pthread_pthreads" 1>&6
-
-       if test $ol_cv_pthread_pthreads = yes ; then
-               ol_link_pthreads="-pthreads"
-               ol_link_threads=posix
-       fi
-fi
+               fi
 
-               # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
-if test "$ol_link_threads" = no ; then
-       # try -mthreads
-       echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
-echo "configure:12413: checking for pthread link with -mthreads" >&5
-if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+                               echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
+echo "configure:12039: 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
   
-               # save the flags
-               ol_LIBS="$LIBS"
-               LIBS="-mthreads $LIBS"
-
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12424 "configure"
+#line 12046 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12487,19 +12109,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_mthreads=yes
+  ol_cv_pthread_create=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_mthreads=no
+  ol_cv_pthread_create=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12503 "configure"
+#line 12125 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12571,48 +12193,43 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_mthreads=yes
+  ol_cv_pthread_create=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_mthreads=no
+  ol_cv_pthread_create=no
 fi
 rm -fr conftest*
 fi
 
-
-               # restore the LIBS
-               LIBS="$ol_LIBS"
-       
 fi
 
-echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
-
-       if test $ol_cv_pthread_mthreads = yes ; then
-               ol_link_pthreads="-mthreads"
-               ol_link_threads=posix
-       fi
-fi
+echo "$ac_t""$ol_cv_pthread_create" 1>&6
 
-               # Pthread try link: -thread (ol_cv_pthread_thread)
+               if test $ol_cv_pthread_create != no ; then
+                       ol_link_threads=posix
+                       ol_link_pthreads=""
+               fi
+               
+               # Pthread try link: -kthread (ol_cv_pthread_kthread)
 if test "$ol_link_threads" = no ; then
-       # try -thread
-       echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
-echo "configure:12605: checking for pthread link with -thread" >&5
-if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
+       # try -kthread
+       echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
+echo "configure:12222: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-thread $LIBS"
+               LIBS="-kthread $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12616 "configure"
+#line 12233 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12679,19 +12296,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_thread=yes
+  ol_cv_pthread_kthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_thread=no
+  ol_cv_pthread_kthread=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12695 "configure"
+#line 12312 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12763,14 +12380,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_thread=yes
+  ol_cv_pthread_kthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_thread=no
+  ol_cv_pthread_kthread=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_thread" 1>&6
+echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
 
-       if test $ol_cv_pthread_thread = yes ; then
-               ol_link_pthreads="-thread"
+       if test $ol_cv_pthread_kthread = yes ; then
+               ol_link_pthreads="-kthread"
                ol_link_threads=posix
        fi
 fi
 
-
-               # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
+               # Pthread try link: -pthread (ol_cv_pthread_pthread)
 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:12798: 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
+       # try -pthread
+       echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
+echo "configure:12414: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
+               LIBS="-pthread $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12809 "configure"
+#line 12425 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12872,19 +12488,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12492: \"$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
+  ol_cv_pthread_pthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+  ol_cv_pthread_pthread=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12888 "configure"
+#line 12504 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12956,14 +12572,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
+  ol_cv_pthread_pthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
+  ol_cv_pthread_pthread=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
+echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
 
-       if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
-               ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
+       if test $ol_cv_pthread_pthread = yes ; then
+               ol_link_pthreads="-pthread"
                ol_link_threads=posix
        fi
 fi
 
-               # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
+               # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
 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:12990: checking for pthread link with -lpthread -lmach -lexc" >&5
-if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
+       # try -pthreads
+       echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
+echo "configure:12606: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lpthread -lmach -lexc $LIBS"
+               LIBS="-pthreads $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13001 "configure"
+#line 12617 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13064,19 +12680,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12684: \"$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
+  ol_cv_pthread_pthreads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lpthread_lmach_lexc=no
+  ol_cv_pthread_pthreads=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13080 "configure"
+#line 12696 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13148,14 +12764,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lpthread_lmach_lexc=yes
+  ol_cv_pthread_pthreads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lpthread_lmach_lexc=no
+  ol_cv_pthread_pthreads=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
+echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
 
-       if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
-               ol_link_pthreads="-lpthread -lmach -lexc"
+       if test $ol_cv_pthread_pthreads = yes ; then
+               ol_link_pthreads="-pthreads"
                ol_link_threads=posix
        fi
 fi
 
-
-               # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
+               # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
 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:13183: checking for pthread link with -lpthread -Wl,-woff,85" >&5
-if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
+       # try -mthreads
+       echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
+echo "configure:12798: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lpthread -Wl,-woff,85 $LIBS"
+               LIBS="-mthreads $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13194 "configure"
+#line 12809 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13257,19 +12872,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12876: \"$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
+  ol_cv_pthread_mthreads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lib_lpthread_woff=no
+  ol_cv_pthread_mthreads=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13273 "configure"
+#line 12888 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13341,14 +12956,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lib_lpthread_woff=yes
+  ol_cv_pthread_mthreads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lib_lpthread_woff=no
+  ol_cv_pthread_mthreads=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
+echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
 
-       if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
-               ol_link_pthreads="-lpthread -Wl,-woff,85"
+       if test $ol_cv_pthread_mthreads = yes ; then
+               ol_link_pthreads="-mthreads"
                ol_link_threads=posix
        fi
 fi
 
-
-               # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
+               # Pthread try link: -thread (ol_cv_pthread_thread)
 if test "$ol_link_threads" = no ; then
-       # try -lpthread
-       echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
-echo "configure:13376: checking for pthread link with -lpthread" >&5
-if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
+       # try -thread
+       echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
+echo "configure:12990: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lpthread $LIBS"
+               LIBS="-thread $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13387 "configure"
+#line 13001 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13450,19 +13064,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_lpthread=yes
+  ol_cv_pthread_thread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lpthread=no
+  ol_cv_pthread_thread=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13466 "configure"
+#line 13080 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13534,14 +13148,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lpthread=yes
+  ol_cv_pthread_thread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lpthread=no
+  ol_cv_pthread_thread=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
+echo "$ac_t""$ol_cv_pthread_thread" 1>&6
 
-       if test $ol_cv_pthread_lpthread = yes ; then
-               ol_link_pthreads="-lpthread"
+       if test $ol_cv_pthread_thread = yes ; then
+               ol_link_pthreads="-thread"
                ol_link_threads=posix
        fi
 fi
 
-               # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
+
+               # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
 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:13568: checking for pthread link with -lc_r" >&5
-if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; 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:13183: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lc_r $LIBS"
+               LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13579 "configure"
+#line 13194 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13642,19 +13257,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_lc_r=yes
+  ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lc_r=no
+  ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13658 "configure"
+#line 13273 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13726,14 +13341,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lc_r=yes
+  ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lc_r=no
+  ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
+echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
 
-       if test $ol_cv_pthread_lc_r = yes ; then
-               ol_link_pthreads="-lc_r"
+       if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
+               ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
                ol_link_threads=posix
        fi
 fi
 
-
-               # Pthread try link: -threads (ol_cv_pthread_threads)
+               # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
 if test "$ol_link_threads" = no ; then
-       # try -threads
-       echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
-echo "configure:13761: checking for pthread link with -threads" >&5
-if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
+       # try -lpthread -lmach -lexc
+       echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
+echo "configure:13375: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-threads $LIBS"
+               LIBS="-lpthread -lmach -lexc $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13772 "configure"
+#line 13386 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13835,19 +13449,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_threads=yes
+  ol_cv_pthread_lpthread_lmach_lexc=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_threads=no
+  ol_cv_pthread_lpthread_lmach_lexc=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13851 "configure"
+#line 13465 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13919,14 +13533,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_threads=yes
+  ol_cv_pthread_lpthread_lmach_lexc=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_threads=no
+  ol_cv_pthread_lpthread_lmach_lexc=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_threads" 1>&6
+echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
 
-       if test $ol_cv_pthread_threads = yes ; then
-               ol_link_pthreads="-threads"
+       if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
+               ol_link_pthreads="-lpthread -lmach -lexc"
                ol_link_threads=posix
        fi
 fi
 
 
-               # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
+               # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
 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:13954: 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
+       # try -lpthread -Wl,-woff,85
+       echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
+echo "configure:13568: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
+               LIBS="-lpthread -Wl,-woff,85 $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13965 "configure"
+#line 13579 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14028,19 +13642,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13646: \"$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
+  ol_cv_pthread_lib_lpthread_woff=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
+  ol_cv_pthread_lib_lpthread_woff=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14044 "configure"
+#line 13658 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14112,14 +13726,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
+  ol_cv_pthread_lib_lpthread_woff=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
+  ol_cv_pthread_lib_lpthread_woff=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
+echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
 
-       if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
-               ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
+       if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
+               ol_link_pthreads="-lpthread -Wl,-woff,85"
                ol_link_threads=posix
        fi
 fi
 
-               # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
+
+               # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
 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:14146: checking for pthread link with -lpthreads -lmach -lexc" >&5
-if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
+       # try -lpthread
+       echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
+echo "configure:13761: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lpthreads -lmach -lexc $LIBS"
+               LIBS="-lpthread $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14157 "configure"
+#line 13772 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14220,19 +13835,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13839: \"$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
+  ol_cv_pthread_lpthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lpthreads_lmach_lexc=no
+  ol_cv_pthread_lpthread=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14236 "configure"
+#line 13851 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14304,14 +13919,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lpthreads_lmach_lexc=yes
+  ol_cv_pthread_lpthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lpthreads_lmach_lexc=no
+  ol_cv_pthread_lpthread=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
+echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
 
-       if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
-               ol_link_pthreads="-lpthreads -lmach -lexc"
+       if test $ol_cv_pthread_lpthread = yes ; then
+               ol_link_pthreads="-lpthread"
                ol_link_threads=posix
        fi
 fi
 
-               # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
+               # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
 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:14338: checking for pthread link with -lpthreads -lexc" >&5
-if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
+       # try -lc_r
+       echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
+echo "configure:13953: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lpthreads -lexc $LIBS"
+               LIBS="-lc_r $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14349 "configure"
+#line 13964 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14412,19 +14027,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_lpthreads_lexc=yes
+  ol_cv_pthread_lc_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lpthreads_lexc=no
+  ol_cv_pthread_lc_r=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14428 "configure"
+#line 14043 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14496,14 +14111,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lpthreads_lexc=yes
+  ol_cv_pthread_lc_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lpthreads_lexc=no
+  ol_cv_pthread_lc_r=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
+echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
 
-       if test $ol_cv_pthread_lpthreads_lexc = yes ; then
-               ol_link_pthreads="-lpthreads -lexc"
+       if test $ol_cv_pthread_lc_r = yes ; then
+               ol_link_pthreads="-lc_r"
                ol_link_threads=posix
        fi
 fi
 
 
-               # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
+               # Pthread try link: -threads (ol_cv_pthread_threads)
 if test "$ol_link_threads" = no ; then
-       # try -lpthreads
-       echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
-echo "configure:14531: checking for pthread link with -lpthreads" >&5
-if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
+       # try -threads
+       echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
+echo "configure:14146: 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
   
                # save the flags
                ol_LIBS="$LIBS"
-               LIBS="-lpthreads $LIBS"
+               LIBS="-threads $LIBS"
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14542 "configure"
+#line 14157 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14605,19 +14220,19 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_lib_lpthreads=yes
+  ol_cv_pthread_threads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_lib_lpthreads=no
+  ol_cv_pthread_threads=no
 fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14621 "configure"
+#line 14236 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14689,14 +14304,14 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_lib_lpthreads=yes
+  ol_cv_pthread_threads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_lib_lpthreads=no
+  ol_cv_pthread_threads=no
 fi
 rm -fr conftest*
 fi
        
 fi
 
-echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
+echo "$ac_t""$ol_cv_pthread_threads" 1>&6
 
-       if test $ol_cv_pthread_lib_lpthreads = yes ; then
-               ol_link_pthreads="-lpthreads"
+       if test $ol_cv_pthread_threads = yes ; then
+               ol_link_pthreads="-threads"
                ol_link_threads=posix
        fi
 fi
 
 
-               if test $ol_link_threads != no ; then
-                       LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
-
-                                               save_CPPFLAGS="$CPPFLAGS"
-                       save_LIBS="$LIBS"
-                       LIBS="$LTHREAD_LIBS $LIBS"
-
-                                                                                               for ac_func in sched_yield pthread_yield thr_yield
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14730: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+               # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
+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:14339: 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
+  
+               # save the flags
+               ol_LIBS="$LIBS"
+               LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
+
+               if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14735 "configure"
+#line 14350 "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)();
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+       void *p;
+{
+       return (void *) (p == NULL);
+}
 
 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
+       /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
+       pthread_t t;
+       int status;
+       int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+       /* Final pthreads */
+       pthread_attr_t attr;
+
+       status = pthread_attr_init(&attr);
+       if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-f = $ac_func;
+       status = pthread_attr_setdetachstate(&attr, detach);
 #endif
+       if( status ) return status;
+       status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
+       if( status ) return status;
+#else
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return errno;
 
-; return 0; }
-EOF
-if { (eval echo configure:14759: \"$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
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-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
+       status = pthread_detach( &t );
+       if( status ) return errno;
+#endif
 
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
 
-                       if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no -a \
-                               $ac_cv_func_thr_yield = no ; then
-                                                               echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:14788: 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
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lrt  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 14796 "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 sched_yield();
+       return 0;
 
-int main() {
-sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:14807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14417: \"$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_pthread_lpthreads_lmach_lexc_lc_r=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_pthread_lpthreads_lmach_lexc_lc_r=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
+else
+  cat > conftest.$ac_ext <<EOF
+#line 14429 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
-                                       cat >> confdefs.h <<\EOF
-#define HAVE_SCHED_YIELD 1
-EOF
+static void *task(p)
+       void *p;
+{
+       return (void *) (p == NULL);
+}
 
-                                       ac_cv_func_sched_yield=yes
-else
-  echo "$ac_t""no" 1>&6
-ac_cv_func_sched_yield=no
-fi
 
-                       fi
-                       if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no -a \
-                               "$ac_cv_func_thr_yield" = no ; then
-                               echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
-                       fi
+int main(argc, argv)
+       int argc;
+       char **argv;
+{
 
-                                               for ac_func in pthread_kill pthread_rwlock_destroy
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14843: 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 14848 "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)();
+       /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
+       pthread_t t;
+       int status;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-int main() {
+#if HAVE_PTHREADS > 4
+       /* Final pthreads */
+       pthread_attr_t attr;
 
-/* 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
+       status = pthread_attr_init(&attr);
+       if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-f = $ac_func;
+       status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+       if( status ) return status;
+       status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
+       if( status ) return status;
+#else
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return errno;
+
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
+
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
-; return 0; }
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
+       return 0;
+
+}
+
 EOF
-if { (eval echo configure:14872: \"$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"
+if { (eval echo configure:14501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+then
+  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  rm -fr conftest*
+  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
 fi
-rm -f conftest*
+rm -fr 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
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+       
 fi
-done
 
+echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
 
-                                                                       echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:14898: checking for pthread_detach with <pthread.h>" >&5
-if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
+       if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
+               ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
+               ol_link_threads=posix
+       fi
+fi
+
+               # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
+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:14531: 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
   
-                                                               cat > conftest.$ac_ext <<EOF
-#line 14904 "configure"
-#include "confdefs.h"
+               # save the flags
+               ol_LIBS="$LIBS"
+               LIBS="-lpthreads -lmach -lexc $LIBS"
 
-#include <pthread.h>
-#ifndef NULL
+               if test "$cross_compiling" = yes; then
+  cat > conftest.$ac_ext <<EOF
+#line 14542 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
 #define NULL (void*)0
 #endif
 
-int main() {
-pthread_detach(NULL);
-; return 0; }
-EOF
-if { (eval echo configure:14916: \"$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
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_func_pthread_detach=no
-fi
-rm -f conftest*
-                       
-fi
-
-echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
-
-                       if test $ol_cv_func_pthread_detach = no ; then
-                               { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
-                       fi
-
-                       cat >> confdefs.h <<\EOF
-#define HAVE_PTHREAD_DETACH 1
-EOF
-
-
-                                               for ac_func in \
-                               pthread_setconcurrency \
-                               pthread_getconcurrency \
-                               thr_setconcurrency \
-                               thr_getconcurrency \
-                       
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14948: 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 14953 "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)();
+static void *task(p)
+       void *p;
+{
+       return (void *) (p == NULL);
+}
 
 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;
+       /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
 #endif
+       pthread_t t;
+       int status;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-; return 0; }
-EOF
-if { (eval echo configure:14977: \"$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 HAVE_PTHREADS > 4
+       /* Final pthreads */
+       pthread_attr_t attr;
 
-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
+       status = pthread_attr_init(&attr);
+       if( status ) return status;
 
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
+#else
+       status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+       if( status ) return status;
+       status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
+       if( status ) return status;
+#else
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return errno;
 
-                       
-       for ac_func in pthread_kill_other_threads_np
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15006: 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 15011 "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)();
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-int main() {
+       status = pthread_detach( &t );
+       if( status ) return errno;
+#endif
 
-/* 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;
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
 #endif
 
+       return 0;
+
 ; return 0; }
 EOF
-if { (eval echo configure:15035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14609: \"$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"
+  ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  ol_cv_pthread_lpthreads_lmach_lexc=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
-
-       echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
-echo "configure:15060: 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
-  ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
-fi
-
-echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
-
-                       
-       
-       
-       echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
-echo "configure:15073: checking for LinuxThreads consistency" >&5
-if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-               if test $ol_cv_header_linux_threads = yes -a \
-                       $ol_cv_sys_linux_threads = yes; then
-                       ol_cv_linux_threads=yes
-               elif test $ol_cv_header_linux_threads = no -a \
-                       $ol_cv_sys_linux_threads = no; then
-                       ol_cv_linux_threads=no
-               else
-                       ol_cv_linux_threads=error
-               fi
-       
-fi
-
-echo "$ac_t""$ol_cv_linux_threads" 1>&6
-
-
-                       if test $ol_cv_linux_threads = error; then
-                               { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
-                       fi
-
-                       echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:15098: 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
-  
-                       if test "$cross_compiling" = yes; then
-                               ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 15107 "configure"
+#line 14621 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -15175,169 +14689,1360 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:15179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
-  ol_cv_pthread_create_works=yes
+  ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ol_cv_pthread_create_works=no
+  ol_cv_pthread_lpthreads_lmach_lexc=no
 fi
 rm -fr conftest*
 fi
 
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+       
 fi
 
-echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
+echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
 
-                       if test $ol_cv_pthread_create_works = no ; then
-                               { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
-                       fi
+       if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
+               ol_link_pthreads="-lpthreads -lmach -lexc"
+               ol_link_threads=posix
+       fi
+fi
 
-                                               if test $ol_with_yielding_select = auto ; then
-                               echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:15201: checking if select yields when using pthreads" >&5
-if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
+               # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
+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:14723: 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
   
-                               if test "$cross_compiling" = yes; then
-  ol_cv_pthread_select_yields=cross
-else
+               # save the flags
+               ol_LIBS="$LIBS"
+               LIBS="-lpthreads -lexc $LIBS"
+
+               if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 15210 "configure"
+#line 14734 "configure"
 #include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
+/* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
-#define NULL (void*) 0
+#define NULL (void*)0
 #endif
 
-static int fildes[2];
-
 static void *task(p)
        void *p;
 {
-       int i;
-       struct timeval tv;
+       return (void *) (p == NULL);
+}
 
-       fd_set rfds;
+int main() {
 
-       tv.tv_sec=10;
-       tv.tv_usec=0;
+       /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
+       pthread_t t;
+       int status;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-       FD_ZERO(&rfds);
-       FD_SET(fildes[0], &rfds);
+#if HAVE_PTHREADS > 4
+       /* Final pthreads */
+       pthread_attr_t attr;
 
-       /* we're not interested in any fds */
-       i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
+       status = pthread_attr_init(&attr);
+       if( status ) return status;
 
-       if(i < 0) {
-               perror("select");
-               exit(10);
-       }
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
+#else
+       status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+       if( status ) return status;
+       status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
+       if( status ) return status;
+#else
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return errno;
 
-       exit(0); /* if we exit here, the select blocked the whole process */
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
+
+       status = pthread_detach( &t );
+       if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
+       return 0;
+
+; return 0; }
+EOF
+if { (eval echo configure:14801: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_pthread_lpthreads_lexc=no
+fi
+rm -f conftest*
+else
+  cat > conftest.$ac_ext <<EOF
+#line 14813 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+       void *p;
+{
+       return (void *) (p == NULL);
 }
 
+
 int main(argc, argv)
        int argc;
        char **argv;
 {
+
+       /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
+       int status;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-       /* create a pipe to select */
-       if(pipe(&fildes[0])) {
-               perror("select");
-               exit(1);
-       }
+#if HAVE_PTHREADS > 4
+       /* Final pthreads */
+       pthread_attr_t attr;
 
-#ifdef HAVE_PTHREAD_SETCONCURRENCY
-       (void) pthread_setconcurrency(2);
+       status = pthread_attr_init(&attr);
+       if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-#ifdef HAVE_THR_SETCONCURRENCY
-       /* Set Solaris LWP concurrency to 2 */
-       thr_setconcurrency(2);
+       status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+       if( status ) return status;
+       status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
+       if( status ) return status;
+#else
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return errno;
+
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
+
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
+
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
 #endif
 
-#if HAVE_PTHREADS < 6
-       pthread_create(&t, pthread_attr_default, task, NULL);
+       return 0;
+
+}
+
+EOF
+if { (eval echo configure:14885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+then
+  ol_cv_pthread_lpthreads_lexc=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_cv_pthread_lpthreads_lexc=no
+fi
+rm -fr conftest*
+fi
+
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+       
+fi
+
+echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
+
+       if test $ol_cv_pthread_lpthreads_lexc = yes ; then
+               ol_link_pthreads="-lpthreads -lexc"
+               ol_link_threads=posix
+       fi
+fi
+
+
+               # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
+if test "$ol_link_threads" = no ; then
+       # try -lpthreads
+       echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
+echo "configure:14916: 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
+  
+               # save the flags
+               ol_LIBS="$LIBS"
+               LIBS="-lpthreads $LIBS"
+
+               if test "$cross_compiling" = yes; then
+  cat > conftest.$ac_ext <<EOF
+#line 14927 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+       void *p;
+{
+       return (void *) (p == NULL);
+}
+
+int main() {
+
+       /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
+       pthread_t t;
+       int status;
+       int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+       /* Final pthreads */
+       pthread_attr_t attr;
+
+       status = pthread_attr_init(&attr);
+       if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-       pthread_create(&t, NULL, task, NULL);
+       status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+       if( status ) return status;
+       status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
+       if( status ) return status;
+#else
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return errno;
 
-       /* make sure task runs first */
-#if HAVE_THR_YIELD
-       thr_yield();
-#elif defined( HAVE_SCHED_YIELD )
-       sched_yield();
-#elif defined( HAVE_PTHREAD_YIELD )
-       pthread_yield();
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
+
+       status = pthread_detach( &t );
+       if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
 #endif
 
-       exit(2);
-}
+       return 0;
+
+; return 0; }
+EOF
+if { (eval echo configure:14994: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_pthread_lib_lpthreads=no
+fi
+rm -f conftest*
+else
+  cat > conftest.$ac_ext <<EOF
+#line 15006 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+       void *p;
+{
+       return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+       int argc;
+       char **argv;
+{
+
+       /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
+       pthread_t t;
+       int status;
+       int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+       /* Final pthreads */
+       pthread_attr_t attr;
+
+       status = pthread_attr_init(&attr);
+       if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
+#else
+       status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+       if( status ) return status;
+       status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
+       if( status ) return status;
+#else
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return errno;
+
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
+
+       status = pthread_detach( &t );
+       if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
+       return 0;
+
+}
+
+EOF
+if { (eval echo configure:15078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+then
+  ol_cv_pthread_lib_lpthreads=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_cv_pthread_lib_lpthreads=no
+fi
+rm -fr conftest*
+fi
+
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+       
+fi
+
+echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
+
+       if test $ol_cv_pthread_lib_lpthreads = yes ; then
+               ol_link_pthreads="-lpthreads"
+               ol_link_threads=posix
+       fi
+fi
+
+
+               if test $ol_link_threads != no ; then
+                       LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
+
+                                               save_CPPFLAGS="$CPPFLAGS"
+                       save_LIBS="$LIBS"
+                       LIBS="$LTHREAD_LIBS $LIBS"
+
+                                                                                               for ac_func in sched_yield pthread_yield thr_yield
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:15115: 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 15120 "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:15144: \"$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_sched_yield = no -a \
+                               $ac_cv_func_pthread_yield = no -a \
+                               $ac_cv_func_thr_yield = no ; then
+                                                               echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
+echo "configure:15173: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lrt  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 15181 "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 sched_yield();
+
+int main() {
+sched_yield()
+; return 0; }
+EOF
+if { (eval echo configure:15192: \"$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
+  LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
+                                       cat >> confdefs.h <<\EOF
+#define HAVE_SCHED_YIELD 1
+EOF
+
+                                       ac_cv_func_sched_yield=yes
+else
+  echo "$ac_t""no" 1>&6
+ac_cv_func_sched_yield=no
+fi
+
+                       fi
+                       if test $ac_cv_func_sched_yield = no -a \
+                               $ac_cv_func_pthread_yield = no -a \
+                               "$ac_cv_func_thr_yield" = no ; then
+                               echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
+                       fi
+
+                                               for ac_func in pthread_kill pthread_rwlock_destroy
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+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 15233 "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: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
+  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
+
+
+                                                                       echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
+echo "configure:15283: 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 15289 "configure"
+#include "confdefs.h"
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+int main() {
+pthread_detach(NULL);
+; return 0; }
+EOF
+if { (eval echo configure:15301: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_func_pthread_detach=no
+fi
+rm -f conftest*
+                       
+fi
+
+echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
+
+                       if test $ol_cv_func_pthread_detach = no ; then
+                               { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
+                       fi
+
+                       cat >> confdefs.h <<\EOF
+#define HAVE_PTHREAD_DETACH 1
+EOF
+
+
+                                               for ac_func in \
+                               pthread_setconcurrency \
+                               pthread_getconcurrency \
+                               thr_setconcurrency \
+                               thr_getconcurrency \
+                       
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:15333: 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 15338 "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:15362: \"$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
+
+
+                       
+       for ac_func in pthread_kill_other_threads_np
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:15391: 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 15396 "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:15420: \"$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
+
+       echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
+echo "configure:15445: 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
+  ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
+fi
+
+echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
+
+                       
+       
+       
+       echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
+echo "configure:15458: checking for LinuxThreads consistency" >&5
+if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+               if test $ol_cv_header_linux_threads = yes -a \
+                       $ol_cv_sys_linux_threads = yes; then
+                       ol_cv_linux_threads=yes
+               elif test $ol_cv_header_linux_threads = no -a \
+                       $ol_cv_sys_linux_threads = no; then
+                       ol_cv_linux_threads=no
+               else
+                       ol_cv_linux_threads=error
+               fi
+       
+fi
+
+echo "$ac_t""$ol_cv_linux_threads" 1>&6
+
+
+                       if test $ol_cv_linux_threads = error; then
+                               { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
+                       fi
+
+                       echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
+echo "configure:15483: 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
+  
+                       if test "$cross_compiling" = yes; then
+                               ol_cv_pthread_create_works=yes
+else
+  cat > conftest.$ac_ext <<EOF
+#line 15492 "configure"
+#include "confdefs.h"
+/* pthread test headers */
+#include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+       void *p;
+{
+       return (void *) (p == NULL);
+}
+
+
+int main(argc, argv)
+       int argc;
+       char **argv;
+{
+
+       /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
+       pthread_t t;
+       int status;
+       int detach = PTHREAD_CREATE_DETACHED;
+
+#if HAVE_PTHREADS > 4
+       /* Final pthreads */
+       pthread_attr_t attr;
+
+       status = pthread_attr_init(&attr);
+       if( status ) return status;
+
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
+#else
+       status = pthread_attr_setdetachstate(&attr, detach);
+#endif
+       if( status ) return status;
+       status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
+       if( status ) return status;
+#else
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return errno;
+
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
+
+       status = pthread_detach( &t );
+       if( status ) return errno;
+#endif
+
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
+       return 0;
+
+}
+
+EOF
+if { (eval echo configure:15564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+then
+  ol_cv_pthread_create_works=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_cv_pthread_create_works=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
+
+                       if test $ol_cv_pthread_create_works = no ; then
+                               { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
+                       fi
+
+                                               if test $ol_with_yielding_select = auto ; then
+                               echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
+echo "configure:15586: 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
+  
+                               if test "$cross_compiling" = yes; then
+  ol_cv_pthread_select_yields=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 15595 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*) 0
+#endif
+
+static int fildes[2];
+
+static void *task(p)
+       void *p;
+{
+       int i;
+       struct timeval tv;
+
+       fd_set rfds;
+
+       tv.tv_sec=10;
+       tv.tv_usec=0;
+
+       FD_ZERO(&rfds);
+       FD_SET(fildes[0], &rfds);
+
+       /* we're not interested in any fds */
+       i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
+
+       if(i < 0) {
+               perror("select");
+               exit(10);
+       }
+
+       exit(0); /* if we exit here, the select blocked the whole process */
+}
+
+int main(argc, argv)
+       int argc;
+       char **argv;
+{
+       pthread_t t;
+
+       /* create a pipe to select */
+       if(pipe(&fildes[0])) {
+               perror("select");
+               exit(1);
+       }
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+       (void) pthread_setconcurrency(2);
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
+       /* Set Solaris LWP concurrency to 2 */
+       thr_setconcurrency(2);
+#endif
+#endif
+
+#if HAVE_PTHREADS < 6
+       pthread_create(&t, pthread_attr_default, task, NULL);
+#else
+       pthread_create(&t, NULL, task, NULL);
+#endif
+
+       /* make sure task runs first */
+#if HAVE_THR_YIELD
+       thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+       sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+       pthread_yield();
+#endif
+
+       exit(2);
+}
+EOF
+if { (eval echo configure:15672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+then
+  ol_cv_pthread_select_yields=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_cv_pthread_select_yields=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
+
+                               if test $ol_cv_pthread_select_yields = cross ; then
+                                       { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
+                               fi
+
+                               if test $ol_cv_pthread_select_yields = yes ; then
+                                       ol_with_yielding_select=yes
+                               fi
+                       fi
+
+                                               CPPFLAGS="$save_CPPFLAGS"
+                       LIBS="$save_LIBS"
+               else
+                       { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
+               fi
+       fi
+
+       if test $ol_with_threads = posix ; then
+               { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
+       fi
+fi
+
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+       -o $ol_with_threads = mach ; then
+
+               for ac_hdr in mach/cthreads.h cthreads.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:15716: 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 15721 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:15726: \"$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_mach_cthreads_h = yes ; then
+               ol_with_threads=found
+
+                               echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
+echo "configure:15756: 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 15761 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char cthread_fork(); 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 cthread_fork();
+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_cthread_fork) || defined (__stub___cthread_fork)
+choke me
+#else
+f = cthread_fork;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:15785: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_cthread_fork=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_link_threads=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+               if test $ol_link_threads = no ; then
+                                                                       echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
+echo "configure:15807: 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
+  
+                                                               save_LIBS="$LIBS"
+                               LIBS="-all_load $LIBS"
+                               cat > conftest.$ac_ext <<EOF
+#line 15815 "configure"
+#include "confdefs.h"
+#include <mach/cthreads.h>
+int main() {
+
+                                       cthread_fork((void *)0, (void *)0);
+                                       
+; return 0; }
+EOF
+if { (eval echo configure:15824: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_cthread_all_load=no
+fi
+rm -f conftest*
+                                                               LIBS="$save_LIBS"
+                       
+fi
+
+echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
+
+                       if test $ol_cv_cthread_all_load = yes ; then
+                               LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
+                               ol_link_threads=mach
+                               ol_with_threads=found
+                       fi
+               fi
+
+       elif test $ac_cv_header_cthreads_h = yes ; then
+                               
+               ol_with_threads=found
+                               save_LIBS="$LIBS"
+               LIBS="$LIBS -lthreads"
+               echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
+echo "configure:15854: 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 15859 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char cthread_fork(); 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 cthread_fork();
+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_cthread_fork) || defined (__stub___cthread_fork)
+choke me
+#else
+f = cthread_fork;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:15883: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_cthread_fork=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_link_threads=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+               LIBS="$save_LIBS"
+
+               if test $ol_link_threads = yes ; then
+                       LTHREAD_LIBS="-lthreads"
+                       ol_link_threads=mach
+                       ol_with_threads=found
+               else
+                       { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
+               fi
+
+       elif test $ol_with_threads = mach ; then
+               { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
+       fi
+
+       if test $ol_link_threads = mach ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_MACH_CTHREADS 1
+EOF
+
+       elif test $ol_with_threads = found ; then
+               { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
+       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:15933: 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 15938 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:15943: \"$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:15972: 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 15980 "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:15287: \"$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
+if { (eval echo configure:15991: \"$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 -fr conftest*
-  ol_cv_pthread_select_yields=yes
-fi
-rm -fr conftest*
+  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
 
-echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
 
-                               if test $ol_cv_pthread_select_yields = cross ; then
-                                       { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
-                               fi
+               if test $have_pth = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_GNU_PTH 1
+EOF
 
-                               if test $ol_cv_pthread_select_yields = yes ; then
-                                       ol_with_yielding_select=yes
-                               fi
-                       fi
+                       LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
+                       ol_link_threads=pth
+                       ol_with_threads=found
 
-                                               CPPFLAGS="$save_CPPFLAGS"
-                       LIBS="$save_LIBS"
-               else
-                       { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
+                       if test $ol_with_yielding_select = auto ; then
+                               ol_with_yielding_select=yes
+                       fi
                fi
        fi
-
-       if test $ol_with_threads = posix ; then
-               { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
-       fi
 fi
 
 if test $ol_with_threads = auto -o $ol_with_threads = yes \
-       -o $ol_with_threads = mach ; then
+       -o $ol_with_threads = lwp ; then
 
-               for ac_hdr in mach/cthreads.h cthreads.h
+               for ac_hdr in thread.h synch.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:15331: checking for $ac_hdr" >&5
+echo "configure:16036: 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 15336 "configure"
+#line 16041 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16046: \"$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*
@@ -15363,24 +16068,81 @@ else
 fi
 done
 
-       if test $ac_cv_header_mach_cthreads_h = yes ; then
-               ol_with_threads=found
+       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:16074: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lthread  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 16082 "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 thr_create();
 
-                               echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:15371: checking for cthread_fork" >&5
-if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
+int main() {
+thr_create()
+; return 0; }
+EOF
+if { (eval echo configure:16093: \"$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_thr=yes
+else
+  echo "$ac_t""no" 1>&6
+have_thr=no
+fi
+
+
+               if test $have_thr = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_THR 1
+EOF
+
+                       LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
+                       ol_link_threads=thr
+
+                       if test $ol_with_yielding_select = auto ; then
+                               ol_with_yielding_select=yes
+                       fi
+
+                                               for ac_func in \
+                               thr_setconcurrency \
+                               thr_getconcurrency \
+                       
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:16133: 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 15376 "configure"
+#line 16138 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char cthread_fork(); 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 cthread_fork();
+char $ac_func();
 char (*f)();
 
 int main() {
@@ -15388,97 +16150,208 @@ 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_cthread_fork) || defined (__stub___cthread_fork)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = cthread_fork;
+f = $ac_func;
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:15400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16162: \"$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"
+  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_cthread_fork=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  ol_link_threads=yes
+    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
 
+               fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                                                       echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
-echo "configure:15422: checking for cthread_fork with -all_load" >&5
-if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
+               for ac_hdr in lwp/lwp.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:16193: 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
-  
-                                                               save_LIBS="$LIBS"
-                               LIBS="-all_load $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 15430 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 16198 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:16203: \"$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_lwp_lwp_h = yes ; then
+               echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
+echo "configure:16231: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-llwp  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 16239 "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 lwp_create();
+
+int main() {
+lwp_create()
+; return 0; }
+EOF
+if { (eval echo configure:16250: \"$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_lwp=yes
+else
+  echo "$ac_t""no" 1>&6
+have_lwp=no
+fi
+
+
+               if test $have_lwp = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_LWP 1
+EOF
+
+                       LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+                       ol_link_threads=lwp
+
+                       if test $ol_with_yielding_select = auto ; then
+                               ol_with_yielding_select=no
+                       fi
+               fi
+       fi
+fi
+
+if test $ol_with_yielding_select = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_YIELDING_SELECT 1
+EOF
+
+fi
+
+if test $ol_with_threads = manual ; then
+               ol_link_threads=yes
+
+       echo "configure: warning: thread defines and link options must be set manually" 1>&2
+
+       for ac_hdr in pthread.h sched.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:16303: 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 16308 "configure"
 #include "confdefs.h"
-#include <mach/cthreads.h>
-int main() {
-
-                                       cthread_fork((void *)0, (void *)0);
-                                       
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:15439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:16313: \"$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*
-  ol_cv_cthread_all_load=yes
+  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*
-  ol_cv_cthread_all_load=no
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
 fi
-
-echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
-
-                       if test $ol_cv_cthread_all_load = yes ; then
-                               LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
-                               ol_link_threads=mach
-                               ol_with_threads=found
-                       fi
-               fi
-
-       elif test $ac_cv_header_cthreads_h = yes ; then
-                               
-               ol_with_threads=found
+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
  
-                               save_LIBS="$LIBS"
-               LIBS="$LIBS -lthreads"
-               echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:15469: checking for cthread_fork" >&5
-if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+       for ac_func in sched_yield pthread_yield
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:16342: 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 15474 "configure"
+#line 16347 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char cthread_fork(); 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 cthread_fork();
+char $ac_func();
 char (*f)();
 
 int main() {
@@ -15486,75 +16359,86 @@ 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_cthread_fork) || defined (__stub___cthread_fork)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = cthread_fork;
+f = $ac_func;
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:15498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16371: \"$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"
+  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_cthread_fork=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  ol_link_threads=yes
+    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
 
-               LIBS="$save_LIBS"
-
-               if test $ol_link_threads = yes ; then
-                       LTHREAD_LIBS="-lthreads"
-                       ol_link_threads=mach
-                       ol_with_threads=found
-               else
-                       { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
-               fi
+       
+       echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
+echo "configure:16397: 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 16402 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_header_linux_threads=yes
+else
+  rm -rf conftest*
+  ol_cv_header_linux_threads=no
+fi
+rm -f conftest*
 
-       elif test $ol_with_threads = mach ; then
-               { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
-       fi
+               
+fi
 
-       if test $ol_link_threads = mach ; then
+echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
+       if test $ol_cv_header_linux_threads = yes; then
                cat >> confdefs.h <<\EOF
-#define HAVE_MACH_CTHREADS 1
+#define HAVE_LINUX_THREADS 1
 EOF
 
-       elif test $ol_with_threads = found ; then
-               { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
        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
+       for ac_hdr in mach/cthreads.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:15548: checking for $ac_hdr" >&5
+echo "configure:16432: 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 15553 "configure"
+#line 16437 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16442: \"$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*
@@ -15580,84 +16464,61 @@ else
 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:15587: 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
+       for ac_hdr in lwp/lwp.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:16472: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lpth  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 15595 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 16477 "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; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:15606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:16482: \"$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_lib_$ac_lib_var=yes"
+  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_lib_$ac_lib_var=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_pth=yes
+    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
-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
-                       ol_with_threads=found
-
-                       if test $ol_with_yielding_select = auto ; then
-                               ol_with_yielding_select=yes
-                       fi
-               fi
-       fi
 fi
+done
 
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
-       -o $ol_with_threads = lwp ; then
-
-               for ac_hdr in thread.h synch.h
+       for ac_hdr in thread.h synch.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:15651: checking for $ac_hdr" >&5
+echo "configure:16512: 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 15656 "configure"
+#line 16517 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16522: \"$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*
@@ -15683,73 +16544,140 @@ else
 fi
 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:15689: 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
+fi
+
+if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
+                       cat >> confdefs.h <<\EOF
+#define REENTRANT 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define THREAD_SAFE 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define _THREAD_SAFE 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define THREADSAFE 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define _THREADSAFE 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define _SGI_MP_SOURCE 1
+EOF
+
+
+                       echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
+echo "configure:16581: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lthread  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 15697 "configure"
+  
+               cat > conftest.$ac_ext <<EOF
+#line 16587 "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 thr_create();
+#include <errno.h>
+int main() {
+errno = 0;
+; return 0; }
+EOF
+if { (eval echo configure:16594: \"$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 "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_errno_thread_specific=no
+fi
+rm -f conftest*
+       
+fi
+
+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:16610: 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 16616 "configure"
+#include "confdefs.h"
+#include <netdb.h>
 int main() {
-thr_create()
+h_errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:15708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16623: \"$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_h_errno_thread_specific=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_h_errno_thread_specific=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_thr=yes
-else
-  echo "$ac_t""no" 1>&6
-have_thr=no
+       
 fi
 
+echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
+
+       if test $ol_cv_errno_thread_specific != yes \
+               -o $ol_cv_h_errno_thread_specific != yes ; then
+               LIBS="$LTHREAD_LIBS $LIBS"
+               LTHREAD_LIBS=""
+       fi
 
-               if test $have_thr = yes ; then
-                       cat >> confdefs.h <<\EOF
-#define HAVE_THR 1
+fi  
+
+if test $ol_link_threads = no ; then
+       if test $ol_with_threads = yes ; then
+               { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
+       fi
+
+       if test $ol_with_threads = auto ; then
+               echo "configure: warning: no suitable thread support, disabling threads" 1>&2
+               ol_with_threads=no
+       fi
+
+       cat >> confdefs.h <<\EOF
+#define NO_THREADS 1
 EOF
 
-                       LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
-                       ol_link_threads=thr
+       LTHREAD_LIBS=""
+fi
 
-                       if test $ol_with_yielding_select = auto ; then
-                               ol_with_yielding_select=yes
-                       fi
+if test $ol_link_threads != no ; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
+EOF
+
+fi
+
+for ac_func in \
+       ctime_r                 \
+       gethostbyname_r gethostbyaddr_r \
 
-                                               for ac_func in \
-                               thr_setconcurrency \
-                               thr_getconcurrency \
-                       
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15748: checking for $ac_func" >&5
+echo "configure:16676: 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 15753 "configure"
+#line 16681 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15773,7 +16701,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16705: \"$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
 fi
 done
 
-               fi
-       fi
 
-               for ac_hdr in lwp/lwp.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:15808: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+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:16734: 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 15813 "configure"
+#line 16739 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+#include <time.h>
+int main() {
+time_t ti; char *buffer; ctime_r(&ti,buffer,32);
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15818: \"$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:16746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ol_cv_func_ctime_r_nargs3=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_func_ctime_r_nargs3=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_lwp_lwp_h = yes ; then
-               echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
-echo "configure:15846: 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
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-llwp  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 15854 "configure"
+       cat > conftest.$ac_ext <<EOF
+#line 16758 "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 lwp_create();
-
+#include <time.h>
 int main() {
-lwp_create()
+time_t ti; char *buffer; ctime_r(&ti,buffer);
 ; return 0; }
 EOF
-if { (eval echo configure:15865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_func_ctime_r_nargs2=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_func_ctime_r_nargs2=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_lwp=yes
-else
-  echo "$ac_t""no" 1>&6
-have_lwp=no
-fi
+       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
 
-               if test $have_lwp = yes ; then
-                       cat >> confdefs.h <<\EOF
-#define HAVE_LWP 1
-EOF
+       elif test $ol_cv_func_ctime_r_nargs3 = no -a \
+               $ol_cv_func_ctime_r_nargs2 = yes ; then
 
-                       LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
-                       ol_link_threads=lwp
+               ol_cv_func_ctime_r_nargs=2
 
-                       if test $ol_with_yielding_select = auto ; then
-                               ol_with_yielding_select=no
-                       fi
-               fi
+       else
+               ol_cv_func_ctime_r_nargs=0
        fi
+  
 fi
 
-if test $ol_with_yielding_select = yes ; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_YIELDING_SELECT 1
-EOF
+echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
 
-fi
+  if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
+       cat >> confdefs.h <<EOF
+#define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
+EOF
 
-if test $ol_with_threads = manual ; then
-               ol_link_threads=yes
+  fi
 
-       echo "configure: warning: thread defines and link options must be set manually" 1>&2
+fi
 
-       for ac_hdr in pthread.h sched.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:15918: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+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:16805: 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 15923 "configure"
+#line 16810 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)
+int main() {
+struct hostent hent; char buffer[BUFSIZE];
+               int bufsize=BUFSIZE;int h_errno;
+               (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
+                       buffer, bufsize, &h_errno);
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15928: \"$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:16824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ol_cv_func_gethostbyname_r_nargs5=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_func_gethostbyname_r_nargs5=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
 
-       for ac_func in sched_yield pthread_yield
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15957: 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 15962 "configure"
+       cat > conftest.$ac_ext <<EOF
+#line 16836 "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)();
-
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)
 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
-
+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);
 ; return 0; }
 EOF
-if { (eval echo configure:15986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+  ol_cv_func_gethostbyname_r_nargs6=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  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
 
-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
+echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
+  if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
+       cat >> confdefs.h <<EOF
+#define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
 EOF
+
+  fi
+
 else
-  echo "$ac_t""no" 1>&6
+       ol_cv_func_gethostbyname_r_nargs=0
 fi
-done
-
-       
-       echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:16012: checking for LinuxThreads pthread.h" >&5
-if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
+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:16892: 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 16017 "configure"
+#line 16897 "configure"
 #include "confdefs.h"
-#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)
+int main() {
+struct hostent hent; 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, &h_errno);
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
+if { (eval echo configure:16913: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_header_linux_threads=yes
+  ol_cv_func_gethostbyaddr_r_nargs7=yes
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_header_linux_threads=no
+  ol_cv_func_gethostbyaddr_r_nargs7=no
 fi
 rm -f conftest*
 
-               
-fi
-
-echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
-       if test $ol_cv_header_linux_threads = yes; then
-               cat >> confdefs.h <<\EOF
-#define HAVE_LINUX_THREADS 1
-EOF
-
-       fi
-
-
-       for ac_hdr in mach/cthreads.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16047: 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 16052 "configure"
+       cat > conftest.$ac_ext <<EOF
+#line 16925 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#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);
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16057: \"$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:16943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ol_cv_func_gethostbyaddr_r_nargs8=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_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
-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_func_gethostbyaddr_r_nargs" 1>&6
+  if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
+    cat >> confdefs.h <<EOF
+#define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
 EOF
+
+  fi
+
 else
-  echo "$ac_t""no" 1>&6
+       ol_cv_func_gethostbyaddr_r_nargs=0
 fi
-done
 
-       for ac_hdr in lwp/lwp.h
+ol_link_ldbm=no 
+
+if test $ol_with_ldbm_api = auto \
+       -o $ol_with_ldbm_api = berkeley \
+       -o $ol_with_ldbm_api = bcompat ; then
+
+       if test $ol_with_ldbm_api = bcompat; then \
+               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:16087: checking for $ac_hdr" >&5
+echo "configure:16993: 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 16092 "configure"
+#line 16998 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:17003: \"$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
 
-       for ac_hdr in thread.h synch.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16127: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+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:17031: 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 16132 "configure"
+  
+               cat > conftest.$ac_ext <<EOF
+#line 17037 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+
+#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
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16137: \"$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 "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__db_version_1" >/dev/null 2>&1; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ol_cv_header_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_header_db1=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
+
+echo "$ac_t""$ol_cv_header_db1" 1>&6
+
+       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:17074: 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
-  echo "$ac_t""no" 1>&6
-fi
-done
+  
+       ol_DB_LIB=
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
-fi
+       cat > conftest.$ac_ext <<EOF
+#line 17084 "configure"
+#include "confdefs.h"
 
-if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
-                       cat >> confdefs.h <<\EOF
-#define REENTRANT 1
-EOF
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
 
-       cat >> confdefs.h <<\EOF
-#define _REENTRANT 1
-EOF
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
 
-       cat >> confdefs.h <<\EOF
-#define THREAD_SAFE 1
-EOF
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
 
-       cat >> confdefs.h <<\EOF
-#define _THREAD_SAFE 1
-EOF
+int main() {
 
-       cat >> confdefs.h <<\EOF
-#define THREADSAFE 1
-EOF
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
 
-       cat >> confdefs.h <<\EOF
-#define _THREADSAFE 1
-EOF
+               version = db_version( &major, &minor, &patch );
 
-       cat >> confdefs.h <<\EOF
-#define _SGI_MP_SOURCE 1
-EOF
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\theader: %s\n\tlibrary: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
 
+#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
 
-                       echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:16196: 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 16202 "configure"
-#include "confdefs.h"
-#include <errno.h>
-int main() {
-errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:16209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_errno_thread_specific=yes
+  ol_cv_db_none=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_errno_thread_specific=no
+  ol_cv_db_none=no
 fi
 rm -f conftest*
-       
+
+       LIBS="$ol_LIBS"
+
 fi
 
-echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
+echo "$ac_t""$ol_cv_db_none" 1>&6
 
-                       echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
-echo "configure:16225: checking for thread specific h_errno" >&5
-if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
+       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 (-ldb43)""... $ac_c" 1>&6
+echo "configure:17155: checking for Berkeley DB link (-ldb43)" >&5
+if eval "test \"\${ol_cv_db_db43+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-               cat > conftest.$ac_ext <<EOF
-#line 16231 "configure"
+       ol_DB_LIB=-ldb43
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17165 "configure"
 #include "confdefs.h"
-#include <netdb.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() {
-h_errno = 0;
+
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
+
+               version = db_version( &major, &minor, &patch );
+
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\theader: %s\n\tlibrary: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
+#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:16238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17212: \"$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
+  ol_cv_db_db43=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_h_errno_thread_specific=no
+  ol_cv_db_db43=no
 fi
 rm -f conftest*
-       
-fi
 
-echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
+       LIBS="$ol_LIBS"
 
-       if test $ol_cv_errno_thread_specific != yes \
-               -o $ol_cv_h_errno_thread_specific != yes ; then
-               LIBS="$LTHREAD_LIBS $LIBS"
-               LTHREAD_LIBS=""
-       fi
+fi
 
-fi  
+echo "$ac_t""$ol_cv_db_db43" 1>&6
 
-if test $ol_link_threads = no ; then
-       if test $ol_with_threads = yes ; then
-               { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
+       if test $ol_cv_db_db43 = yes ; then
+               ol_cv_lib_db=-ldb43
        fi
+fi
 
-       if test $ol_with_threads = auto ; then
-               echo "configure: warning: no suitable thread support, disabling threads" 1>&2
-               ol_with_threads=no
-       fi
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-43)""... $ac_c" 1>&6
+echo "configure:17236: checking for Berkeley DB link (-ldb-43)" >&5
+if eval "test \"\${ol_cv_db_db_43+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb-43
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
-       cat >> confdefs.h <<\EOF
-#define NO_THREADS 1
-EOF
+       cat > conftest.$ac_ext <<EOF
+#line 17246 "configure"
+#include "confdefs.h"
 
-       LTHREAD_LIBS=""
-fi
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
 
-if test $ol_link_threads != no ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
-EOF
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
 
-fi
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
 
-for ac_func in \
-       ctime_r                 \
-       gethostbyname_r gethostbyaddr_r \
+int main() {
 
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16291: 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 16296 "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)();
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
 
-int main() {
+               version = db_version( &major, &minor, &patch );
 
-/* 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
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\theader: %s\n\tlibrary: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
+#if DB_VERSION_MAJOR > 2
+       db_env_create( NULL, 0 );
+#elif DB_VERSION_MAJOR > 1
+       db_appexit( NULL );
 #else
-f = $ac_func;
+       (void) dbopen( NULL, 0, 0, 0, NULL);
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:16320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17293: \"$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"
+  ol_cv_db_db_43=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  ol_cv_db_db_43=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
+       LIBS="$ol_LIBS"
+
 fi
-done
 
+echo "$ac_t""$ol_cv_db_db_43" 1>&6
 
-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:16349: checking number of arguments of ctime_r" >&5
-if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
+       if test $ol_cv_db_db_43 = yes ; then
+               ol_cv_lib_db=-ldb-43
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4.3)""... $ac_c" 1>&6
+echo "configure:17317: checking for Berkeley DB link (-ldb-4.3)" >&5
+if eval "test \"\${ol_cv_db_db_4_dot_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 16354 "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:16361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ol_cv_func_ctime_r_nargs3=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_func_ctime_r_nargs3=no
-fi
-rm -f conftest*
+  
+       ol_DB_LIB=-ldb-4.3
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 16373 "configure"
+#line 17327 "configure"
 #include "confdefs.h"
-#include <time.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() {
-time_t ti; char *buffer; ctime_r(&ti,buffer);
+
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
+
+               version = db_version( &major, &minor, &patch );
+
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\theader: %s\n\tlibrary: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
+#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:16380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:17374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs2=yes
+  ol_cv_db_db_4_dot_3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs2=no
+  ol_cv_db_db_4_dot_3=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
+       LIBS="$ol_LIBS"
 
-       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
-#define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
-EOF
-
-  fi
+echo "$ac_t""$ol_cv_db_db_4_dot_3" 1>&6
 
+       if test $ol_cv_db_db_4_dot_3 = yes ; then
+               ol_cv_lib_db=-ldb-4.3
+       fi
 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:16420: checking number of arguments of gethostbyname_r" >&5
-if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4-3)""... $ac_c" 1>&6
+echo "configure:17398: checking for Berkeley DB link (-ldb-4-3)" >&5
+if eval "test \"\${ol_cv_db_db_4_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 16425 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)
-int main() {
-struct hostent hent; char buffer[BUFSIZE];
-               int bufsize=BUFSIZE;int h_errno;
-               (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
-                       buffer, bufsize, &h_errno);
-; return 0; }
-EOF
-if { (eval echo configure:16439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs5=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs5=no
-fi
-rm -f conftest*
+  
+       ol_DB_LIB=-ldb-4-3
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 16451 "configure"
+#line 17408 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)
+
+#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() {
-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);
+
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
+
+               version = db_version( &major, &minor, &patch );
+
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\theader: %s\n\tlibrary: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
+#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:16466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:17455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs6=yes
+  ol_cv_db_db_4_3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs6=no
+  ol_cv_db_db_4_3=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
+       LIBS="$ol_LIBS"
 
-       elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
-               $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
+fi
 
-               ol_cv_func_gethostbyname_r_nargs=6
+echo "$ac_t""$ol_cv_db_db_4_3" 1>&6
 
-       else
-               ol_cv_func_gethostbyname_r_nargs=0
+       if test $ol_cv_db_db_4_3 = yes ; then
+               ol_cv_lib_db=-ldb-4-3
        fi
-  
 fi
 
-echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
-  if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
-       cat >> confdefs.h <<EOF
-#define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
-EOF
-
-  fi
-
-else
-       ol_cv_func_gethostbyname_r_nargs=0
-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:16507: checking number of arguments of gethostbyaddr_r" >&5
-if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
+echo "configure:17479: checking for Berkeley DB link (-ldb42)" >&5
+if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 16512 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)
-int main() {
-struct hostent hent; 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, &h_errno);
-; return 0; }
-EOF
-if { (eval echo configure:16528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs7=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs7=no
-fi
-rm -f conftest*
+  
+       ol_DB_LIB=-ldb42
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 16540 "configure"
+#line 17489 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)
+
+#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() {
-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);
+
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
+
+               version = db_version( &major, &minor, &patch );
+
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\theader: %s\n\tlibrary: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
+#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:16558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:17536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs8=yes
+  ol_cv_db_db42=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs8=no
+  ol_cv_db_db42=no
 fi
 rm -f conftest*
 
-       if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
-               $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
+       LIBS="$ol_LIBS"
 
-               ol_cv_func_gethostbyaddr_r_nargs=7
+fi
 
-       elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
-               $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
+echo "$ac_t""$ol_cv_db_db42" 1>&6
+
+       if test $ol_cv_db_db42 = yes ; then
+               ol_cv_lib_db=-ldb42
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
+echo "configure:17560: checking for Berkeley DB link (-ldb-42)" >&5
+if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb-42
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17570 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
 
-               ol_cv_func_gethostbyaddr_r_nargs=8
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
 
-       else
-               ol_cv_func_gethostbyaddr_r_nargs=0
-       fi
-  
-fi
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
 
-echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
-  if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
-    cat >> confdefs.h <<EOF
-#define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
-EOF
+int main() {
 
-  fi
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
 
-else
-       ol_cv_func_gethostbyaddr_r_nargs=0
-fi
+               version = db_version( &major, &minor, &patch );
 
-ol_link_ldbm=no 
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\theader: %s\n\tlibrary: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
 
-if test $ol_with_ldbm_api = auto \
-       -o $ol_with_ldbm_api = berkeley \
-       -o $ol_with_ldbm_api = bcompat ; then
+#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
 
-       if test $ol_with_ldbm_api = bcompat; then \
-               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:16608: 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 16613 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16618: \"$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:17617: \"$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_42=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_42=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_42" 1>&6
+
+       if test $ol_cv_db_db_42 = yes ; then
+               ol_cv_lib_db=-ldb-42
+       fi
 fi
-done
 
-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:16646: checking if Berkeley DB header compatibility" >&5
-if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
+echo "configure:17641: checking for Berkeley DB link (-ldb-4.2)" >&5
+if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-               cat > conftest.$ac_ext <<EOF
-#line 16652 "configure"
+       ol_DB_LIB=-ldb-4.2
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17651 "configure"
 #include "confdefs.h"
 
-#if HAVE_DB_185_H
-#      include <db_185.h>
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
 #else
-#      include <db.h>
+# include <db.h>
 #endif
 
- /* this check could be improved */
 #ifndef DB_VERSION_MAJOR
-#      define DB_VERSION_MAJOR 1
+# define DB_VERSION_MAJOR 1
 #endif
 
-#if DB_VERSION_MAJOR == 1 
-       __db_version_1
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
+int main() {
+
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
+
+               version = db_version( &major, &minor, &patch );
+
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\theader: %s\n\tlibrary: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
+#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 "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "__db_version_1" >/dev/null 2>&1; then
+if { (eval echo configure:17698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_header_db1=yes
+  ol_cv_db_db_4_dot_2=yes
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_header_db1=no
+  ol_cv_db_db_4_dot_2=no
 fi
 rm -f conftest*
 
+       LIBS="$ol_LIBS"
+
 fi
 
-echo "$ac_t""$ol_cv_header_db1" 1>&6
+echo "$ac_t""$ol_cv_db_db_4_dot_2" 1>&6
+
+       if test $ol_cv_db_db_4_dot_2 = yes ; then
+               ol_cv_lib_db=-ldb-4.2
+       fi
+fi
 
-       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:16689: checking for Berkeley DB link (default)" >&5
-if eval "test \"\${ol_cv_db_none+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
+echo "configure:17722: checking for Berkeley DB link (-ldb-4-2)" >&5
+if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=
+       ol_DB_LIB=-ldb-4-2
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 16699 "configure"
+#line 17732 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -16725,7 +17758,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -16742,14 +17775,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:16746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_none=yes
+  ol_cv_db_db_4_2=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_none=no
+  ol_cv_db_db_4_2=no
 fi
 rm -f conftest*
 
@@ -16757,26 +17790,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_none" 1>&6
+echo "$ac_t""$ol_cv_db_db_4_2" 1>&6
 
-       if test $ol_cv_db_none = yes ; then
-               ol_cv_lib_db=yes
+       if test $ol_cv_db_db_4_2 = yes ; then
+               ol_cv_lib_db=-ldb-4-2
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
-echo "configure:16770: checking for Berkeley DB link (-ldb42)" >&5
-if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
+echo "configure:17803: checking for Berkeley DB link (-ldb-4)" >&5
+if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb42
+       ol_DB_LIB=-ldb-4
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 16780 "configure"
+#line 17813 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -16806,7 +17839,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -16823,14 +17856,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:16827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db42=yes
+  ol_cv_db_db_4=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db42=no
+  ol_cv_db_db_4=no
 fi
 rm -f conftest*
 
@@ -16838,26 +17871,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db42" 1>&6
+echo "$ac_t""$ol_cv_db_db_4" 1>&6
 
-       if test $ol_cv_db_db42 = yes ; then
-               ol_cv_lib_db=-ldb42
+       if test $ol_cv_db_db_4 = yes ; then
+               ol_cv_lib_db=-ldb-4
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
-echo "configure:16851: checking for Berkeley DB link (-ldb-42)" >&5
-if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
+echo "configure:17884: checking for Berkeley DB link (-ldb4)" >&5
+if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb-42
+       ol_DB_LIB=-ldb4
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 16861 "configure"
+#line 17894 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -16887,7 +17920,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -16904,14 +17937,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:16908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_42=yes
+  ol_cv_db_db4=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_42=no
+  ol_cv_db_db4=no
 fi
 rm -f conftest*
 
@@ -16919,26 +17952,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_42" 1>&6
+echo "$ac_t""$ol_cv_db_db4" 1>&6
 
-       if test $ol_cv_db_db_42 = yes ; then
-               ol_cv_lib_db=-ldb-42
+       if test $ol_cv_db_db4 = yes ; then
+               ol_cv_lib_db=-ldb4
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
-echo "configure:16932: checking for Berkeley DB link (-ldb-4.2)" >&5
-if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
+echo "configure:17965: 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
   
-       ol_DB_LIB=-ldb-4.2
+       ol_DB_LIB=-ldb
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 16942 "configure"
+#line 17975 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -16968,7 +18001,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -16985,14 +18018,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:16989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_4_dot_2=yes
+  ol_cv_db_db=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_4_dot_2=no
+  ol_cv_db_db=no
 fi
 rm -f conftest*
 
@@ -17000,26 +18033,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_4_dot_2" 1>&6
+echo "$ac_t""$ol_cv_db_db" 1>&6
 
-       if test $ol_cv_db_db_4_dot_2 = yes ; then
-               ol_cv_lib_db=-ldb-4.2
+       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 (-ldb-4-2)""... $ac_c" 1>&6
-echo "configure:17013: checking for Berkeley DB link (-ldb-4-2)" >&5
-if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
+echo "configure:18046: checking for Berkeley DB link (-ldb41)" >&5
+if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb-4-2
+       ol_DB_LIB=-ldb41
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17023 "configure"
+#line 18056 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17049,7 +18082,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17066,14 +18099,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_4_2=yes
+  ol_cv_db_db41=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_4_2=no
+  ol_cv_db_db41=no
 fi
 rm -f conftest*
 
@@ -17081,26 +18114,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_4_2" 1>&6
+echo "$ac_t""$ol_cv_db_db41" 1>&6
 
-       if test $ol_cv_db_db_4_2 = yes ; then
-               ol_cv_lib_db=-ldb-4-2
+       if test $ol_cv_db_db41 = yes ; then
+               ol_cv_lib_db=-ldb41
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
-echo "configure:17094: checking for Berkeley DB link (-ldb-4)" >&5
-if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
+echo "configure:18127: checking for Berkeley DB link (-ldb-41)" >&5
+if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb-4
+       ol_DB_LIB=-ldb-41
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17104 "configure"
+#line 18137 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17130,7 +18163,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17147,14 +18180,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_4=yes
+  ol_cv_db_db_41=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_4=no
+  ol_cv_db_db_41=no
 fi
 rm -f conftest*
 
@@ -17162,26 +18195,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_4" 1>&6
+echo "$ac_t""$ol_cv_db_db_41" 1>&6
 
-       if test $ol_cv_db_db_4 = yes ; then
-               ol_cv_lib_db=-ldb-4
+       if test $ol_cv_db_db_41 = yes ; then
+               ol_cv_lib_db=-ldb-41
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
-echo "configure:17175: checking for Berkeley DB link (-ldb4)" >&5
-if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
+echo "configure:18208: checking for Berkeley DB link (-ldb-4.1)" >&5
+if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb4
+       ol_DB_LIB=-ldb-4.1
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17185 "configure"
+#line 18218 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17211,7 +18244,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17228,14 +18261,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db4=yes
+  ol_cv_db_db_4_dot_1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db4=no
+  ol_cv_db_db_4_dot_1=no
 fi
 rm -f conftest*
 
@@ -17243,26 +18276,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db4" 1>&6
+echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
 
-       if test $ol_cv_db_db4 = yes ; then
-               ol_cv_lib_db=-ldb4
+       if test $ol_cv_db_db_4_dot_1 = yes ; then
+               ol_cv_lib_db=-ldb-4.1
        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:17256: checking for Berkeley DB link (-ldb)" >&5
-if eval "test \"\${ol_cv_db_db+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
+echo "configure:18289: checking for Berkeley DB link (-ldb-4-1)" >&5
+if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb
+       ol_DB_LIB=-ldb-4-1
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17266 "configure"
+#line 18299 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17292,7 +18325,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17309,14 +18342,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db=yes
+  ol_cv_db_db_4_1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db=no
+  ol_cv_db_db_4_1=no
 fi
 rm -f conftest*
 
@@ -17324,26 +18357,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db" 1>&6
+echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
 
-       if test $ol_cv_db_db = yes ; then
-               ol_cv_lib_db=-ldb
+       if test $ol_cv_db_db_4_1 = yes ; then
+               ol_cv_lib_db=-ldb-4-1
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
-echo "configure:17337: checking for Berkeley DB link (-ldb41)" >&5
-if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
+echo "configure:18370: 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=-ldb41
+       ol_DB_LIB=-ldb3
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17347 "configure"
+#line 18380 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17373,7 +18406,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17390,14 +18423,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db41=yes
+  ol_cv_db_db3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db41=no
+  ol_cv_db_db3=no
 fi
 rm -f conftest*
 
@@ -17405,26 +18438,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db41" 1>&6
+echo "$ac_t""$ol_cv_db_db3" 1>&6
 
-       if test $ol_cv_db_db41 = yes ; then
-               ol_cv_lib_db=-ldb41
+       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 (-ldb-41)""... $ac_c" 1>&6
-echo "configure:17418: checking for Berkeley DB link (-ldb-41)" >&5
-if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
+echo "configure:18451: checking for Berkeley DB link (-ldb-3)" >&5
+if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb-41
+       ol_DB_LIB=-ldb-3
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17428 "configure"
+#line 18461 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17454,7 +18487,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17471,14 +18504,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_41=yes
+  ol_cv_db_db_3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_41=no
+  ol_cv_db_db_3=no
 fi
 rm -f conftest*
 
@@ -17486,26 +18519,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_41" 1>&6
+echo "$ac_t""$ol_cv_db_db_3" 1>&6
 
-       if test $ol_cv_db_db_41 = yes ; then
-               ol_cv_lib_db=-ldb-41
+       if test $ol_cv_db_db_3 = yes ; then
+               ol_cv_lib_db=-ldb-3
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
-echo "configure:17499: checking for Berkeley DB link (-ldb-4.1)" >&5
-if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
+echo "configure:18532: 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=-ldb-4.1
+       ol_DB_LIB=-ldb2
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17509 "configure"
+#line 18542 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17535,7 +18568,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17552,14 +18585,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_4_dot_1=yes
+  ol_cv_db_db2=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_4_dot_1=no
+  ol_cv_db_db2=no
 fi
 rm -f conftest*
 
@@ -17567,26 +18600,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_4_dot_1" 1>&6
+echo "$ac_t""$ol_cv_db_db2" 1>&6
 
-       if test $ol_cv_db_db_4_dot_1 = yes ; then
-               ol_cv_lib_db=-ldb-4.1
+       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 (-ldb-4-1)""... $ac_c" 1>&6
-echo "configure:17580: checking for Berkeley DB link (-ldb-4-1)" >&5
-if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
+echo "configure:18613: checking for Berkeley DB link (-ldb-2)" >&5
+if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb-4-1
+       ol_DB_LIB=-ldb-2
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17590 "configure"
+#line 18623 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17616,7 +18649,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17633,14 +18666,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_4_1=yes
+  ol_cv_db_db_2=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_4_1=no
+  ol_cv_db_db_2=no
 fi
 rm -f conftest*
 
@@ -17648,26 +18681,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_4_1" 1>&6
+echo "$ac_t""$ol_cv_db_db_2" 1>&6
 
-       if test $ol_cv_db_db_4_1 = yes ; then
-               ol_cv_lib_db=-ldb-4-1
+       if test $ol_cv_db_db_2 = yes ; then
+               ol_cv_lib_db=-ldb-2
        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:17661: checking for Berkeley DB link (-ldb3)" >&5
-if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
+echo "configure:18694: 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
   
-       ol_DB_LIB=-ldb3
+       ol_DB_LIB=-ldb1
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17671 "configure"
+#line 18704 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17697,7 +18730,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17714,14 +18747,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db3=yes
+  ol_cv_db_db1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db3=no
+  ol_cv_db_db1=no
 fi
 rm -f conftest*
 
@@ -17729,26 +18762,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db3" 1>&6
+echo "$ac_t""$ol_cv_db_db1" 1>&6
 
-       if test $ol_cv_db_db3 = yes ; then
-               ol_cv_lib_db=-ldb3
+       if test $ol_cv_db_db1 = yes ; then
+               ol_cv_lib_db=-ldb1
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
-echo "configure:17742: checking for Berkeley DB link (-ldb-3)" >&5
-if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
+echo "configure:18775: checking for Berkeley DB link (-ldb-1)" >&5
+if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb-3
+       ol_DB_LIB=-ldb-1
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17752 "configure"
+#line 18785 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17778,7 +18811,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17795,14 +18828,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_3=yes
+  ol_cv_db_db_1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_3=no
+  ol_cv_db_db_1=no
 fi
 rm -f conftest*
 
@@ -17810,26 +18843,77 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_3" 1>&6
+echo "$ac_t""$ol_cv_db_db_1" 1>&6
 
-       if test $ol_cv_db_db_3 = yes ; then
-               ol_cv_lib_db=-ldb-3
+       if test $ol_cv_db_db_1 = yes ; then
+               ol_cv_lib_db=-ldb-1
+       fi
+fi
+
+
+               if test "$ol_cv_lib_db" != no ; then
+                       ol_cv_berkeley_db=yes
+               fi
        fi
 fi
 
+       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:18867: 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 18872 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:18877: \"$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_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 (-ldb2)""... $ac_c" 1>&6
-echo "configure:17823: checking for Berkeley DB link (-ldb2)" >&5
-if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
+echo "configure:18907: 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=-ldb2
+       ol_DB_LIB=
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17833 "configure"
+#line 18917 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17859,7 +18943,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17876,14 +18960,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db2=yes
+  ol_cv_db_none=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db2=no
+  ol_cv_db_none=no
 fi
 rm -f conftest*
 
@@ -17891,26 +18975,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db2" 1>&6
+echo "$ac_t""$ol_cv_db_none" 1>&6
 
-       if test $ol_cv_db_db2 = yes ; then
-               ol_cv_lib_db=-ldb2
+       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-2)""... $ac_c" 1>&6
-echo "configure:17904: checking for Berkeley DB link (-ldb-2)" >&5
-if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb43)""... $ac_c" 1>&6
+echo "configure:18988: checking for Berkeley DB link (-ldb43)" >&5
+if eval "test \"\${ol_cv_db_db43+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb-2
+       ol_DB_LIB=-ldb43
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17914 "configure"
+#line 18998 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17940,7 +19024,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -17957,14 +19041,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_2=yes
+  ol_cv_db_db43=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_2=no
+  ol_cv_db_db43=no
 fi
 rm -f conftest*
 
@@ -17972,26 +19056,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db_2" 1>&6
+echo "$ac_t""$ol_cv_db_db43" 1>&6
 
-       if test $ol_cv_db_db_2 = yes ; then
-               ol_cv_lib_db=-ldb-2
+       if test $ol_cv_db_db43 = yes ; then
+               ol_cv_lib_db=-ldb43
        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:17985: checking for Berkeley DB link (-ldb1)" >&5
-if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-43)""... $ac_c" 1>&6
+echo "configure:19069: checking for Berkeley DB link (-ldb-43)" >&5
+if eval "test \"\${ol_cv_db_db_43+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb1
+       ol_DB_LIB=-ldb-43
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17995 "configure"
+#line 19079 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18021,7 +19105,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18038,14 +19122,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db1=yes
+  ol_cv_db_db_43=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db1=no
+  ol_cv_db_db_43=no
 fi
 rm -f conftest*
 
@@ -18053,26 +19137,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db1" 1>&6
+echo "$ac_t""$ol_cv_db_db_43" 1>&6
 
-       if test $ol_cv_db_db1 = yes ; then
-               ol_cv_lib_db=-ldb1
+       if test $ol_cv_db_db_43 = yes ; then
+               ol_cv_lib_db=-ldb-43
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
-echo "configure:18066: checking for Berkeley DB link (-ldb-1)" >&5
-if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4.3)""... $ac_c" 1>&6
+echo "configure:19150: checking for Berkeley DB link (-ldb-4.3)" >&5
+if eval "test \"\${ol_cv_db_db_4_dot_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb-1
+       ol_DB_LIB=-ldb-4.3
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18076 "configure"
+#line 19160 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18102,7 +19186,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18119,92 +19203,41 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db_1=yes
+  ol_cv_db_db_4_dot_3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db_1=no
+  ol_cv_db_db_4_dot_3=no
 fi
 rm -f conftest*
 
        LIBS="$ol_LIBS"
 
 fi
-
-echo "$ac_t""$ol_cv_db_db_1" 1>&6
-
-       if test $ol_cv_db_db_1 = yes ; then
-               ol_cv_lib_db=-ldb-1
-       fi
-fi
-
-
-               if test "$ol_cv_lib_db" != no ; then
-                       ol_cv_berkeley_db=yes
-               fi
-       fi
-fi
-
-       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:18158: 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 18163 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:18168: \"$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
+
+echo "$ac_t""$ol_cv_db_db_4_dot_3" 1>&6
+
+       if test $ol_cv_db_db_4_dot_3 = yes ; then
+               ol_cv_lib_db=-ldb-4.3
+       fi
 fi
-done
 
-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:18198: checking for Berkeley DB link (default)" >&5
-if eval "test \"\${ol_cv_db_none+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4-3)""... $ac_c" 1>&6
+echo "configure:19231: checking for Berkeley DB link (-ldb-4-3)" >&5
+if eval "test \"\${ol_cv_db_db_4_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=
+       ol_DB_LIB=-ldb-4-3
        ol_LIBS=$LIBS
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18208 "configure"
+#line 19241 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18234,7 +19267,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18251,14 +19284,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_none=yes
+  ol_cv_db_db_4_3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_none=no
+  ol_cv_db_db_4_3=no
 fi
 rm -f conftest*
 
@@ -18266,16 +19299,16 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_none" 1>&6
+echo "$ac_t""$ol_cv_db_db_4_3" 1>&6
 
-       if test $ol_cv_db_none = yes ; then
-               ol_cv_lib_db=yes
+       if test $ol_cv_db_db_4_3 = yes ; then
+               ol_cv_lib_db=-ldb-4-3
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
-echo "configure:18279: checking for Berkeley DB link (-ldb42)" >&5
+echo "configure:19312: checking for Berkeley DB link (-ldb42)" >&5
 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18285,7 +19318,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18289 "configure"
+#line 19322 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18315,7 +19348,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18332,7 +19365,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db42=yes
 else
@@ -18356,7 +19389,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
-echo "configure:18360: checking for Berkeley DB link (-ldb-42)" >&5
+echo "configure:19393: checking for Berkeley DB link (-ldb-42)" >&5
 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18366,7 +19399,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18370 "configure"
+#line 19403 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18396,7 +19429,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18413,7 +19446,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_42=yes
 else
@@ -18437,7 +19470,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
-echo "configure:18441: checking for Berkeley DB link (-ldb-4.2)" >&5
+echo "configure:19474: checking for Berkeley DB link (-ldb-4.2)" >&5
 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18447,7 +19480,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18451 "configure"
+#line 19484 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18477,7 +19510,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18494,7 +19527,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_dot_2=yes
 else
@@ -18518,7 +19551,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
-echo "configure:18522: checking for Berkeley DB link (-ldb-4-2)" >&5
+echo "configure:19555: checking for Berkeley DB link (-ldb-4-2)" >&5
 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18528,7 +19561,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18532 "configure"
+#line 19565 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18558,7 +19591,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18575,7 +19608,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_2=yes
 else
@@ -18599,7 +19632,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
-echo "configure:18603: checking for Berkeley DB link (-ldb-4)" >&5
+echo "configure:19636: checking for Berkeley DB link (-ldb-4)" >&5
 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18609,7 +19642,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18613 "configure"
+#line 19646 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18639,7 +19672,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18656,7 +19689,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4=yes
 else
@@ -18680,7 +19713,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
-echo "configure:18684: checking for Berkeley DB link (-ldb4)" >&5
+echo "configure:19717: checking for Berkeley DB link (-ldb4)" >&5
 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18690,7 +19723,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18694 "configure"
+#line 19727 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18720,7 +19753,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18737,7 +19770,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db4=yes
 else
@@ -18761,7 +19794,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
-echo "configure:18765: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:19798: 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
@@ -18771,7 +19804,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18775 "configure"
+#line 19808 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18801,7 +19834,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18818,7 +19851,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -18842,7 +19875,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
-echo "configure:18846: checking for Berkeley DB link (-ldb41)" >&5
+echo "configure:19879: checking for Berkeley DB link (-ldb41)" >&5
 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18852,7 +19885,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18856 "configure"
+#line 19889 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18882,7 +19915,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18899,7 +19932,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db41=yes
 else
@@ -18923,7 +19956,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
-echo "configure:18927: checking for Berkeley DB link (-ldb-41)" >&5
+echo "configure:19960: checking for Berkeley DB link (-ldb-41)" >&5
 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18933,7 +19966,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18937 "configure"
+#line 19970 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18963,7 +19996,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -18980,7 +20013,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_41=yes
 else
@@ -19004,7 +20037,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
-echo "configure:19008: checking for Berkeley DB link (-ldb-4.1)" >&5
+echo "configure:20041: checking for Berkeley DB link (-ldb-4.1)" >&5
 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19014,7 +20047,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19018 "configure"
+#line 20051 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19044,7 +20077,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -19061,7 +20094,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_dot_1=yes
 else
@@ -19085,7 +20118,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
-echo "configure:19089: checking for Berkeley DB link (-ldb-4-1)" >&5
+echo "configure:20122: checking for Berkeley DB link (-ldb-4-1)" >&5
 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19095,7 +20128,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19099 "configure"
+#line 20132 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19125,7 +20158,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -19142,7 +20175,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_1=yes
 else
@@ -19166,7 +20199,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:19170: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:20203: 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
@@ -19176,7 +20209,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19180 "configure"
+#line 20213 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19206,7 +20239,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -19223,7 +20256,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -19247,7 +20280,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
-echo "configure:19251: checking for Berkeley DB link (-ldb-3)" >&5
+echo "configure:20284: checking for Berkeley DB link (-ldb-3)" >&5
 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19257,7 +20290,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19261 "configure"
+#line 20294 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19287,7 +20320,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -19304,7 +20337,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_3=yes
 else
@@ -19328,7 +20361,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
-echo "configure:19332: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:20365: 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
@@ -19338,7 +20371,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19342 "configure"
+#line 20375 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19368,7 +20401,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -19385,7 +20418,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -19409,7 +20442,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
-echo "configure:19413: checking for Berkeley DB link (-ldb-2)" >&5
+echo "configure:20446: checking for Berkeley DB link (-ldb-2)" >&5
 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19419,7 +20452,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19423 "configure"
+#line 20456 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19449,7 +20482,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -19466,7 +20499,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_2=yes
 else
@@ -19490,7 +20523,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
-echo "configure:19494: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:20527: 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
@@ -19500,7 +20533,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19504 "configure"
+#line 20537 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19530,7 +20563,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -19547,7 +20580,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -19571,7 +20604,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
-echo "configure:19575: checking for Berkeley DB link (-ldb-1)" >&5
+echo "configure:20608: checking for Berkeley DB link (-ldb-1)" >&5
 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19581,7 +20614,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19585 "configure"
+#line 20618 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19611,7 +20644,7 @@ int main() {
                        minor < DB_VERSION_MINOR )
                {
                        printf("Berkeley DB version mismatch\n"
-                               "\texpected: %s\n\tgot: %s\n",
+                               "\theader: %s\n\tlibrary: %s\n",
                                DB_VERSION_STRING, version);
                        return 1;
                }
@@ -19628,7 +20661,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_1=yes
 else
 
        if test "$ol_cv_lib_db" != no ; then
                ol_cv_berkeley_db=yes
+               echo $ac_n "checking for Berkeley DB version match""... $ac_c" 1>&6
+echo "configure:20691: checking for Berkeley DB version match" >&5
+if eval "test \"\${ol_cv_berkeley_db_version+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_LIBS="$LIBS"
+       LIBS="$LTHREAD_LIBS $LIBS"
+       if test $ol_cv_lib_db != yes ; then
+               LIBS="$ol_cv_lib_db $LIBS"
+       fi
+
+       if test "$cross_compiling" = yes; then
+  ol_cv_berkeley_db_version=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 20706 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_DB_185_H
+       choke me;
+#else
+#include <db.h>
+#endif
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+main()
+{
+#if DB_VERSION_MAJOR > 1
+       char *version;
+       int major, minor, patch;
+
+       version = db_version( &major, &minor, &patch );
+
+       if( major != DB_VERSION_MAJOR ||
+               minor != DB_VERSION_MINOR ||
+               patch != DB_VERSION_PATCH )
+       {
+               printf("Berkeley DB version mismatch\n"
+                       "\theader: %s\n\tlibrary: %s\n",
+                       DB_VERSION_STRING, version);
+               return 1;
+       }
+#endif
+
+       return 0;
+}
+EOF
+if { (eval echo configure:20742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+then
+  ol_cv_berkeley_db_version=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_cv_berkeley_db_version=no
+fi
+rm -fr conftest*
+fi
+
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_berkeley_db_version" 1>&6
+
+       if test $ol_cv_berkeley_db_version = no ; then
+               { echo "configure: error: Berkeley DB version mismatch" 1>&2; exit 1; }
+       fi
+
                echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
-echo "configure:19658: checking for Berkeley DB thread support" >&5
+echo "configure:20766: 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
@@ -19669,7 +20777,7 @@ else
   ol_cv_berkeley_db_thread=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 19673 "configure"
+#line 20781 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19736,7 +20844,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:19740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:20848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_berkeley_db_thread=yes
 else
@@ -19794,17 +20902,18 @@ EOF
        fi
 fi
 
-if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
-       { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
-elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
-       echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
-echo "configure:19802: checking Berkeley DB version for BDB backend" >&5
+if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
+       if test $ol_link_ldbm != berkeley ; then
+               { echo "configure: error: BDB/HDB: BerkeleyDB not available" 1>&2; exit 1; }
+       else
+               echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
+echo "configure:20911: checking Berkeley DB version for BDB backend" >&5
 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 19808 "configure"
+#line 20917 "configure"
 #include "confdefs.h"
 
 #include <db.h>
 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
 
 
-       if test $ol_cv_bdb_compat = yes ; then
-               ol_enable_bdb=yes
-       elif test $ol_enable_bdb = yes ; then
-               { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
-       else
-               ol_enable_bdb=no
+               if test $ol_cv_bdb_compat != yes ; then
+                       { echo "configure: error: BDB/HDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
+               fi
        fi
 fi
-if test $ol_enable_hdb = yes -a $ol_link_ldbm != berkeley ; then
-       { echo "configure: error: HDB: BerkeleyDB not available" 1>&2; exit 1; }
-fi
 
 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
        echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
 
 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:19861: checking for MDBM library" >&5
+echo "configure:20964: 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:19867: checking for mdbm_set_chain" >&5
+echo "configure:20970: 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 19872 "configure"
+#line 20975 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mdbm_set_chain(); below.  */
@@ -19892,7 +20995,7 @@ f = mdbm_set_chain;
 
 ; return 0; }
 EOF
-if { (eval echo configure:19896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20999: \"$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
@@ -19911,7 +21014,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
-echo "configure:19915: checking for mdbm_set_chain in -lmdbm" >&5
+echo "configure:21018: 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
@@ -19919,7 +21022,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19923 "configure"
+#line 21026 "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
@@ -19930,7 +21033,7 @@ int main() {
 mdbm_set_chain()
 ; return 0; }
 EOF
-if { (eval echo configure:19934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21037: \"$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
@@ -19965,17 +21068,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:19969: checking for $ac_hdr" >&5
+echo "configure:21072: 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 19974 "configure"
+#line 21077 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:19979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21082: \"$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*
@@ -20002,7 +21105,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:20006: checking for db" >&5
+echo "configure:21109: 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:20039: checking for GDBM library" >&5
+echo "configure:21142: 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:20045: checking for gdbm_open" >&5
+echo "configure:21148: 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 20050 "configure"
+#line 21153 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -20070,7 +21173,7 @@ f = gdbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:20074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21177: \"$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
@@ -20089,7 +21192,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:20093: checking for gdbm_open in -lgdbm" >&5
+echo "configure:21196: 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
@@ -20097,7 +21200,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20101 "configure"
+#line 21204 "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
@@ -20108,7 +21211,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:20112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21215: \"$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
@@ -20143,17 +21246,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:20147: checking for $ac_hdr" >&5
+echo "configure:21250: 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 20152 "configure"
+#line 21255 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:20157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21260: \"$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*
@@ -20180,7 +21283,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:20184: checking for db" >&5
+echo "configure:21287: checking for db" >&5
 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 
 if test $ol_with_ldbm_api = ndbm ; then
        echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:20218: checking for NDBM library" >&5
+echo "configure:21321: 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:20224: checking for dbm_open" >&5
+echo "configure:21327: 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 20229 "configure"
+#line 21332 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -20249,7 +21352,7 @@ f = dbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:20253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21356: \"$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
@@ -20268,7 +21371,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:20272: checking for dbm_open in -lndbm" >&5
+echo "configure:21375: 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
@@ -20276,7 +21379,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20280 "configure"
+#line 21383 "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
@@ -20287,7 +21390,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:20291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21394: \"$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
@@ -20307,7 +21410,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:20311: checking for dbm_open in -ldbm" >&5
+echo "configure:21414: 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
@@ -20315,7 +21418,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20319 "configure"
+#line 21422 "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
@@ -20326,7 +21429,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:20330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21433: \"$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
@@ -20363,17 +21466,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:20367: checking for $ac_hdr" >&5
+echo "configure:21470: 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 20372 "configure"
+#line 21475 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:20377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21480: \"$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*
@@ -20400,7 +21503,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:20404: checking for db" >&5
+echo "configure:21507: checking for db" >&5
 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20433,13 +21536,13 @@ EOF
 fi
 
 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
-       echo "configure: warning: could not find suitable LDBM backend" 1>&2
-       if test $ol_enable_ldbm = yes ; then
-               { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
-       fi
+       { echo "configure: error: could not find suitable LDBM backend" 1>&2; exit 1; }
+fi
 
-       echo "configure: warning: disabling LDBM" 1>&2
-       ol_enable_ldbm=no
+if test $ol_enable_bdb = yes -o \
+       $ol_enable_hdb = yes -o \
+       $ol_enable_ldbm = yes ; then
+       SLAPD_LIBS="$SLAPD_LIBS \$(LDBM_LIBS)"
 fi
 
 
@@ -20460,17 +21563,17 @@ if test $ol_enable_wrappers != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:20464: checking for $ac_hdr" >&5
+echo "configure:21567: 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 20469 "configure"
+#line 21572 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:20474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21577: \"$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*
@@ -20492,11 +21595,11 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
                echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
-echo "configure:20496: checking for TCP wrappers library" >&5
+echo "configure:21599: checking for TCP wrappers library" >&5
                save_LIBS="$LIBS"
                LIBS="$LIBS -lwrap"
                cat > conftest.$ac_ext <<EOF
-#line 20500 "configure"
+#line 21603 "configure"
 #include "confdefs.h"
 
 #include <tcpd.h>
@@ -20511,7 +21614,7 @@ hosts_access(req)
                
 ; return 0; }
 EOF
-if { (eval echo configure:20515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""-lwrap" 1>&6
                have_wrappers=yes
@@ -20523,7 +21626,7 @@ else
   
                                LIBS="$LIBS -lnsl"
                cat > conftest.$ac_ext <<EOF
-#line 20527 "configure"
+#line 21630 "configure"
 #include "confdefs.h"
 
 #include <tcpd.h>
@@ -20538,7 +21641,7 @@ hosts_access(req)
                
 ; return 0; }
 EOF
-if { (eval echo configure:20542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""-lwrap -lnsl" 1>&6
                have_wrappers=yes
 
 if test $ol_enable_syslog != no ; then
        echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:20582: checking for openlog" >&5
+echo "configure:21685: 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 20587 "configure"
+#line 21690 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -20607,7 +21710,7 @@ f = openlog;
 
 ; return 0; }
 EOF
-if { (eval echo configure:20611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21714: \"$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
@@ -20639,17 +21742,17 @@ if test $ol_enable_sql != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:20643: checking for $ac_hdr" >&5
+echo "configure:21746: 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 20648 "configure"
+#line 21751 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:20653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21756: \"$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
 
 
+       sql_LIBS="$LIBS"
+       LIBS="$LTHREAD_LIBS"
+
        echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
-echo "configure:20683: checking for SQLDriverConnect in -liodbc" >&5
+echo "configure:21789: checking for SQLDriverConnect in -liodbc" >&5
 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -20687,7 +21793,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-liodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20691 "configure"
+#line 21797 "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
@@ -20698,7 +21804,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:20702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21808: \"$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
@@ -20723,7 +21829,7 @@ fi
                ol_link_sql="-liodbc"
        else
                echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
-echo "configure:20727: checking for SQLDriverConnect in -lodbc" >&5
+echo "configure:21833: checking for SQLDriverConnect in -lodbc" >&5
 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -20731,7 +21837,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20735 "configure"
+#line 21841 "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
@@ -20742,7 +21848,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:20746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21852: \"$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
@@ -20768,6 +21874,8 @@ fi
                fi
        fi
 
+       LIBS="$sql_LIBS"
+
        if test $ol_link_sql != no ; then
                SLAPD_SQL_LIBS="$ol_link_sql"
 
@@ -20776,6 +21884,7 @@ fi
        fi
 fi
 
+WITH_SASL=no
 ol_link_sasl=no
 ol_link_spasswd=no
 if test $ol_with_cyrus_sasl != no ; then
@@ -20783,17 +21892,17 @@ if test $ol_with_cyrus_sasl != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:20787: checking for $ac_hdr" >&5
+echo "configure:21896: 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 20792 "configure"
+#line 21901 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:20797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21906: \"$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*
@@ -20822,7 +21931,7 @@ done
 
        if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
                echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
-echo "configure:20826: checking for sasl_client_init in -lsasl2" >&5
+echo "configure:21935: checking for sasl_client_init in -lsasl2" >&5
 ac_lib_var=`echo sasl2'_'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
@@ -20830,7 +21939,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl2  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20834 "configure"
+#line 21943 "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
@@ -20841,7 +21950,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:20845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21954: \"$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
@@ -20860,7 +21969,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
-echo "configure:20864: checking for sasl_client_init in -lsasl" >&5
+echo "configure:21973: 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
@@ -20868,7 +21977,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 20872 "configure"
+#line 21981 "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
@@ -20879,7 +21988,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:20883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21992: \"$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
                fi
        else
                echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
-echo "configure:20919: checking Cyrus SASL library version" >&5
+echo "configure:22028: checking Cyrus SASL library version" >&5
 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 20925 "configure"
+#line 22034 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SASL_SASL_H
@@ -20955,7 +22064,7 @@ echo "$ac_t""$ol_cv_sasl_compat" 1>&6
 
                if test $ol_cv_sasl_compat = no ; then
                        ol_link_sasl=no
-                       { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
+                       { echo "configure: error: Cyrus SASL library located but is incompatible" 1>&2; exit 1; }
                fi
 
                cat >> confdefs.h <<\EOF
@@ -20970,12 +22079,12 @@ EOF
                ac_save_LIBS="$LIBS"
                LIBS="$LIBS $ol_link_sasl"
                echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
-echo "configure:20974: checking for sasl_version" >&5
+echo "configure:22083: checking for sasl_version" >&5
 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 20979 "configure"
+#line 22088 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char sasl_version(); below.  */
@@ -20999,7 +22108,7 @@ f = sasl_version;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_sasl_version=yes"
 else
@@ -21022,6 +22131,8 @@ else
 fi
 
                LIBS="$ac_save_LIBS"
+
+               WITH_SASL=yes
        fi
 
 else
@@ -21058,13 +22169,13 @@ if test $ol_with_fetch != no ; then
        ol_LIBS=$LIBS
 LIBS="-lfetch -lcom_err $LIBS"
 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
-echo "configure:21062: checking fetch(3) library" >&5
+echo "configure:22173: 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 21068 "configure"
+#line 22179 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -21074,7 +22185,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:21078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_lib_fetch=yes
 else
@@ -21111,12 +22222,12 @@ if test $ol_enable_crypt != no ; then
        LIBS="$TLS_LIBS $LIBS"
 
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:21115: checking for crypt" >&5
+echo "configure:22226: 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 21120 "configure"
+#line 22231 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -21140,7 +22251,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22255: \"$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
@@ -21160,7 +22271,7 @@ else
 
                LIBS="$save_LIBS"
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:21164: checking for crypt in -lcrypt" >&5
+echo "configure:22275: 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
@@ -21168,7 +22279,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21172 "configure"
+#line 22283 "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
@@ -21179,7 +22290,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:21183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22294: \"$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
@@ -21214,7 +22325,7 @@ EOF
        else
                echo "configure: warning: could not find crypt" 1>&2
                if test $ol_enable_crypt = yes ; then
-                       { echo "configure: error: could not find crypt" 1>&2; exit 1; }
+                       { echo "configure: error: could not find crypt, select appropriate options or disable" 1>&2; exit 1; }
                fi
 
                echo "configure: warning: disabling crypt support" 1>&2
 
 if test $ol_enable_proctitle != no ; then
        echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:21228: checking for setproctitle" >&5
+echo "configure:22339: 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 21233 "configure"
+#line 22344 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -21253,95 +22364,275 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22368: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_setproctitle=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_setproctitle=yes
+else
+  echo "$ac_t""no" 1>&6
+
+               echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
+echo "configure:22387: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lutil  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 22395 "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 setproctitle();
+
+int main() {
+setproctitle()
+; return 0; }
+EOF
+if { (eval echo configure:22406: \"$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_setproctitle=yes
+                       LUTIL_LIBS="$LUTIL_LIBS -lutil"
+else
+  echo "$ac_t""no" 1>&6
+have_setproctitle=no
+                       LIBOBJS="$LIBOBJS setproctitle.o"
+                       LIBSRCS="$LIBSRCS setproctitle.c"
+fi
+
+fi
+
+
+       if test $have_setproctitle = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_SETPROCTITLE 1
+EOF
+
+       fi
+fi
+
+if test $ol_enable_slp != no ; then
+       for ac_hdr in slp.h 
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:22446: 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 22451 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:22456: \"$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_slp_h = yes ; then
+               echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
+echo "configure:22485: checking for SLPOpen in -lslp" >&5
+ac_lib_var=`echo slp'_'SLPOpen | 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="-lslp  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 22493 "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 SLPOpen();
+
+int main() {
+SLPOpen()
+; return 0; }
+EOF
+if { (eval echo configure:22504: \"$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_slp=yes
+else
+  echo "$ac_t""no" 1>&6
+have_slp=no
+fi
+
+               if test $have_slp = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_SLP 1
+EOF
+
+                       SLAPD_SLP_LIBS=-lslp
+               fi
+
+       elif test $ol_enable_slp = yes ; then
+               { echo "configure: error: SLP not found" 1>&2; exit 1; }
+       fi
+fi
+
+if test "$ol_with_multiple_precision" != "no" ; then
+       ol_have_bignum=no
+       ol_have_gmp=no
+
+       for ac_hdr in openssl/bn.h bn.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:22546: 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 22551 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:22556: \"$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_func_setproctitle=yes"
+  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_func_setproctitle=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
-
-if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_setproctitle=yes
+    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 setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:21276: 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
+       for ac_hdr in openssl/crypto.h crypto.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:22586: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lutil  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 21284 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 22591 "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 setproctitle();
-
-int main() {
-setproctitle()
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:21295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:22596: \"$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_lib_$ac_lib_var=yes"
+  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_lib_$ac_lib_var=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_setproctitle=yes
-                       LUTIL_LIBS="$LUTIL_LIBS -lutil"
+    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
-have_setproctitle=no
-                       LIBOBJS="$LIBOBJS setproctitle.o"
-                       LIBSRCS="$LIBSRCS setproctitle.c"
-fi
-
-fi
-
-
-       if test $have_setproctitle = yes ; then
-               cat >> confdefs.h <<\EOF
-#define HAVE_SETPROCTITLE 1
-EOF
-
-       fi
 fi
+done
 
-if test $ol_enable_slp != no ; then
-       for ac_hdr in slp.h 
+       for ac_hdr in gmp.h 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21335: checking for $ac_hdr" >&5
+echo "configure:22626: 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 21340 "configure"
+#line 22631 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:22636: \"$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_slp_h = yes ; then
-               echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
-echo "configure:21374: checking for SLPOpen in -lslp" >&5
-ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
+       if test "$ol_with_tls" = "found" ; then
+               ol_have_bn_h=no
+               ol_have_crypto_h=no
+
+               if test "$ac_cv_header_openssl_bn_h" = "yes" \
+                               -o "$ac_cv_header_bn_h" = "yes" ; then
+                       ol_have_bn_h=yes
+               fi
+
+               if test "$ac_cv_header_openssl_crypto_h" = "yes" \
+                               -o "$ac_cv_header_crypto_h" = "yes" ; then
+                       ol_have_crypto_h=yes
+               fi
+
+               if test "$ol_have_bn_h" = "yes" \
+                               -a "$ol_have_crypto_h" = "yes" ; then
+                       ol_have_bignum=yes
+               fi
+       fi
+
+       if test $ac_cv_header_gmp_h = yes ; then
+               echo $ac_n "checking for __gmpz_add_ui in -lgmp""... $ac_c" 1>&6
+echo "configure:22685: checking for __gmpz_add_ui in -lgmp" >&5
+ac_lib_var=`echo gmp'_'__gmpz_add_ui | 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="-lslp  $LIBS"
+LIBS="-lgmp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21382 "configure"
+#line 22693 "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 SLPOpen();
+char __gmpz_add_ui();
 
 int main() {
-SLPOpen()
+__gmpz_add_ui()
 ; return 0; }
 EOF
-if { (eval echo configure:21393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22704: \"$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
@@ -21404,41 +22715,91 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_slp=yes
+  have_gmp=yes
 else
   echo "$ac_t""no" 1>&6
-have_slp=no
+have_gmp=no
 fi
 
-               if test $have_slp = yes ; then
-                       cat >> confdefs.h <<\EOF
-#define HAVE_SLP 1
-EOF
+               if test $have_gmp = yes ; then
+                       ol_have_gmp=yes
+               fi
+       fi
 
-                       SLAPD_SLP_LIBS=-lslp
+       echo $ac_n "checking for multiple precision support""... $ac_c" 1>&6
+echo "configure:22731: checking for multiple precision support" >&5
+
+       ol_mp_support="none"
+       case "$ol_with_multiple_precision" in
+       auto)
+                                                                               if test "$ol_have_bignum" = "yes" ; then
+                       ol_mp_support="bignum"
+               else
+                       if test "$ol_have_gmp" = "yes" ; then
+                               ol_mp_support="gmp"
+                       fi
+               fi
+               ;;
+       bignum)
+               if test "$ol_have_bignum" != "yes" ; then
+                       { echo "configure: error: OpenSSL's BIGNUM not available" 1>&2; exit 1; }
+               fi
+               ol_mp_support="bignum"
+               ;;
+       gmp)
+               if test "$ol_have_gmp" != "yes" ; then
+                       { echo "configure: error: GMP not available" 1>&2; exit 1; }
+               fi
+               ol_mp_support="gmp"
+               ;;
+       yes)
+               if test "$ol_have_bignum" = "yes" ; then
+                       ol_mp_support="bignum"
+               elif test "$ol_have_gmp" = "yes" ; then
+                       ol_mp_support="gmp"
+               else
+                       { echo "configure: error: not available" 1>&2; exit 1; }
                fi
+               ;;
+       esac
 
-       elif test $ol_enable_slp = yes ; then
-               { echo "configure: error: SLP not found" 1>&2; exit 1; }
-       fi
+       case "$ol_mp_support" in
+       bignum)
+               cat >> confdefs.h <<\EOF
+#define HAVE_BIGNUM 1
+EOF
+
+               ;;
+       gmp)
+               cat >> confdefs.h <<\EOF
+#define HAVE_GMP 1
+EOF
+
+               SLAPD_GMP_LIBS=-lgmp
+               ;;
+       none)
+               ;;
+       esac
+
+       echo "$ac_t""$ol_mp_support" 1>&6
 fi
 
 
 echo $ac_n "checking long long""... $ac_c" 1>&6
-echo "configure:21429: checking long long" >&5
+echo "configure:22790: checking long long" >&5
 if eval "test \"\${ol_cv_type_long_long+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 21435 "configure"
+#line 22796 "configure"
 #include "confdefs.h"
 
 int main() {
 long long x;
 ; return 0; }
 EOF
-if { (eval echo configure:21442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:22803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_long_long=yes
 else
@@ -21459,12 +22820,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:21463: checking for ANSI C header files" >&5
+echo "configure:22824: 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 21468 "configure"
+#line 22829 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -21472,7 +22833,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:22837: \"$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*
@@ -21489,7 +22850,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 21493 "configure"
+#line 22854 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -21507,7 +22868,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 21511 "configure"
+#line 22872 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -21528,7 +22889,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 21532 "configure"
+#line 22893 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -21546,7 +22907,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:21550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:22911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   :
 else
@@ -21570,12 +22931,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:21574: checking for mode_t" >&5
+echo "configure:22935: 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 21579 "configure"
+#line 22940 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -21606,12 +22967,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:21610: checking for off_t" >&5
+echo "configure:22971: 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 21615 "configure"
+#line 22976 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -21642,12 +23003,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:21646: checking for pid_t" >&5
+echo "configure:23007: 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 21651 "configure"
+#line 23012 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -21678,19 +23039,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:21682: checking for ptrdiff_t" >&5
+echo "configure:23043: 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 21687 "configure"
+#line 23048 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:21694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -21711,12 +23072,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:21715: checking return type of signal handlers" >&5
+echo "configure:23076: 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 21720 "configure"
+#line 23081 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -21733,7 +23094,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:21737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -21752,12 +23113,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:21756: checking for size_t" >&5
+echo "configure:23117: 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 21761 "configure"
+#line 23122 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:21793: checking for ssize_t" >&5
+echo "configure:23154: 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 21798 "configure"
+#line 23159 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -21825,12 +23186,12 @@ EOF
 fi
 
 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
-echo "configure:21829: checking for caddr_t" >&5
+echo "configure:23190: 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 21834 "configure"
+#line 23195 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:21866: checking for socklen_t" >&5
+echo "configure:23227: 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 21871 "configure"
+#line 23232 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -21881,7 +23242,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:21885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_socklen_t=yes
 else
@@ -21902,12 +23263,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:21906: checking for member st_blksize in aggregate type struct stat" >&5
+echo "configure:23267: 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 21911 "configure"
+#line 23272 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -21915,7 +23276,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:21919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_struct_member_st_blksize=yes
 else
@@ -21937,12 +23298,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:21941: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:23302: 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 21946 "configure"
+#line 23307 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -21951,7 +23312,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:21955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -21972,12 +23333,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:21976: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:23337: 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 21981 "configure"
+#line 23342 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -21985,7 +23346,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:21989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -22006,12 +23367,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:22010: checking for uid_t in sys/types.h" >&5
+echo "configure:23371: 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 22015 "configure"
+#line 23376 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -22040,19 +23401,19 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:22044: checking for sig_atomic_t" >&5
+echo "configure:23405: 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 22049 "configure"
+#line 23410 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:22056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_sig_atomic_t=yes
 else
@@ -22076,13 +23437,13 @@ EOF
 
 # test for pw_gecos in struct passwd
 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
-echo "configure:22080: checking struct passwd for pw_gecos" >&5
+echo "configure:23441: 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 22086 "configure"
+#line 23447 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -22092,7 +23453,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:22096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23457: \"$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:22118: checking struct passwd for pw_passwd" >&5
+echo "configure:23479: 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 22124 "configure"
+#line 23485 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -22130,7 +23491,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:22134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_passwd=yes
 else
@@ -22152,7 +23513,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:22156: checking if toupper() requires islower()" >&5
+echo "configure:23517: 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
@@ -22161,7 +23522,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 22165 "configure"
+#line 23526 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -22173,7 +23534,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:22177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:23538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_c_upper_lower=no
 else
@@ -22196,12 +23557,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:22200: checking for working const" >&5
+echo "configure:23561: 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 22205 "configure"
+#line 23566 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -22250,7 +23611,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -22271,12 +23632,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:22275: checking if compiler understands volatile" >&5
+echo "configure:23636: 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 22280 "configure"
+#line 23641 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -22285,7 +23646,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:22289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -22309,20 +23670,21 @@ EOF
  
 
 if test $cross_compiling = yes ; then
+       echo "configure: warning: Crossing compiling... all bets are off!" 1>&2
        cat >> confdefs.h <<\EOF
 #define CROSS_COMPILING 1
 EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:22319: checking whether byte ordering is bigendian" >&5
+echo "configure:23681: 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 22326 "configure"
+#line 23688 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -22333,11 +23695,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:22337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23699: \"$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 22341 "configure"
+#line 23703 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -22348,7 +23710,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:22352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -22368,7 +23730,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 22372 "configure"
+#line 23734 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -22381,7 +23743,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:22385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:23747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ac_cv_c_bigendian=no
 else
 fi
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:22411: checking size of short" >&5 
+echo "configure:23773: checking size of short" >&5 
 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 22417 "configure"
+#line 23779 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
+#include <stdlib.h>
 #include <sys/types.h> 
  
 
@@ -22423,7 +23786,7 @@ int main() {
 switch (0) case 0: case (sizeof (short) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:22427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_short=$ac_size
 else
@@ -22446,15 +23809,16 @@ EOF
  
  
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:22450: checking size of int" >&5 
+echo "configure:23813: checking size of int" >&5 
 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 22456 "configure"
+#line 23819 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
+#include <stdlib.h>
 #include <sys/types.h> 
  
 
@@ -22462,7 +23826,7 @@ int main() {
 switch (0) case 0: case (sizeof (int) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:22466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_int=$ac_size
 else
@@ -22485,15 +23849,16 @@ EOF
  
  
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:22489: checking size of long" >&5 
+echo "configure:23853: checking size of long" >&5 
 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 22495 "configure"
+#line 23859 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
+#include <stdlib.h>
 #include <sys/types.h> 
  
 
@@ -22501,7 +23866,7 @@ int main() {
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:22505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long=$ac_size
 else
@@ -22523,6 +23888,46 @@ cat >> confdefs.h <<EOF
 EOF
  
 
+echo $ac_n "checking size of wchar_t""... $ac_c" 1>&6
+echo "configure:23893: checking size of wchar_t" >&5 
+if eval "test \"\${ac_cv_sizeof_wchar_t+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
+  cat > conftest.$ac_ext <<EOF
+#line 23899 "configure"
+#include "confdefs.h"
+#include "confdefs.h" 
+#include <stdlib.h>
+#include <sys/types.h> 
+
+int main() {
+switch (0) case 0: case (sizeof (wchar_t) == $ac_size):;
+; return 0; }
+EOF
+if { (eval echo configure:23910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_sizeof_wchar_t=$ac_size
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest* 
+  if test x$ac_cv_sizeof_wchar_t != x ; then break; fi 
+done 
+
+fi
+if test x$ac_cv_sizeof_wchar_t = x ; then 
+  { echo "configure: error: cannot determine a size for wchar_t" 1>&2; exit 1; } 
+fi 
+echo "$ac_t""$ac_cv_sizeof_wchar_t" 1>&6 
+cat >> confdefs.h <<EOF
+#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
+EOF
+
 
 if test "$ac_cv_sizeof_int" -lt 4 ; then
        echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
@@ -22552,7 +23957,7 @@ EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:22556: checking for 8-bit clean memcmp" >&5
+echo "configure:23961: 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
@@ -22560,7 +23965,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 22564 "configure"
+#line 23969 "configure"
 #include "confdefs.h"
 
 main()
@@ -22570,7 +23975,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:22574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:23979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ac_cv_func_memcmp_clean=yes
 else
 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
+
+if test $ac_cv_func_memcmp_clean = no ; then
+       cat >> confdefs.h <<\EOF
+#define NEED_MEMCMP_REPLACEMENT 1
+EOF
+
+fi
+
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:22592: checking for strftime" >&5
+echo "configure:24005: 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 22597 "configure"
+#line 24010 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -22617,7 +24030,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24034: \"$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
@@ -22639,7 +24052,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:22643: checking for strftime in -lintl" >&5
+echo "configure:24056: 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
@@ -22647,7 +24060,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 22651 "configure"
+#line 24064 "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
@@ -22658,7 +24071,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:22662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24075: \"$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:22690: checking for inet_aton()" >&5
+echo "configure:24103: 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 22695 "configure"
+#line 24108 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -22713,7 +24126,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:22717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24130: \"$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
@@ -22735,12 +24148,12 @@ EOF
  
 
 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
-echo "configure:22739: checking for _spawnlp" >&5
+echo "configure:24152: 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 22744 "configure"
+#line 24157 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _spawnlp(); below.  */
@@ -22764,7 +24177,7 @@ f = _spawnlp;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24181: \"$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 $ac_n "checking for _snprintf""... $ac_c" 1>&6
-echo "configure:22792: checking for _snprintf" >&5
+echo "configure:24205: 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 22797 "configure"
+#line 24210 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _snprintf(); below.  */
@@ -22817,7 +24230,7 @@ f = _snprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24234: \"$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 $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
-echo "configure:22847: checking for _vsnprintf" >&5
+echo "configure:24260: 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 22852 "configure"
+#line 24265 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _vsnprintf(); below.  */
@@ -22872,7 +24285,7 @@ f = _vsnprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24289: \"$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 $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:22902: checking for vprintf" >&5
+echo "configure:24315: 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 22907 "configure"
+#line 24320 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -22927,7 +24340,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24344: \"$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:22955: checking for _doprnt" >&5
+echo "configure:24368: 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 22960 "configure"
+#line 24373 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -22980,7 +24393,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24397: \"$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
@@ -23009,12 +24422,12 @@ if test $ac_cv_func_vprintf = yes ; then
                for ac_func in snprintf vsnprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:23013: checking for $ac_func" >&5
+echo "configure:24426: 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 23018 "configure"
+#line 24431 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -23038,7 +24451,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:23042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24455: \"$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
@@ -23098,11 +24511,8 @@ for ac_func in \
        setsid                  \
        setuid                  \
        seteuid                 \
-       sigaction               \
        signal                  \
-       sigset                  \
        strdup                  \
-       strerror                \
        strpbrk                 \
        strrchr                 \
        strsep                  \
@@ -23124,12 +24534,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:23128: checking for $ac_func" >&5
+echo "configure:24538: 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 23133 "configure"
+#line 24543 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -23153,7 +24563,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:23157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24567: \"$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
@@ -23181,12 +24591,12 @@ done
 for ac_func in getopt getpeereid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:23185: checking for $ac_func" >&5
+echo "configure:24595: 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 23190 "configure"
+#line 24600 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -23210,7 +24620,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:23214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24624: \"$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
@@ -23242,19 +24652,19 @@ if test "$ac_cv_func_getopt" != yes; then
 fi
 if test "$ac_cv_func_getpeereid" != yes; then
        echo $ac_n "checking for msg_accrights in msghdr""... $ac_c" 1>&6
-echo "configure:23246: checking for msg_accrights in msghdr" >&5
+echo "configure:24656: checking for msg_accrights in msghdr" >&5
 if eval "test \"\${ol_cv_msghdr_msg_accrights+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23251 "configure"
+#line 24661 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 int main() {
 struct msghdr m; m.msg_accrightslen=0
 ; return 0; }
 EOF
-if { (eval echo configure:23258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:24668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_msghdr_msg_accrights=yes
 else
 
   fi
 
-       LIBSRCS="$LIBSRCS getpeereid.c"
-fi
-if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
-       if test "$ac_cv_func_snprintf" != yes; then
-               cat >> confdefs.h <<\EOF
-#define snprintf ber_pvt_snprintf
-EOF
-
-       fi
-       if test "$ac_cv_func_vsnprintf" != yes; then
-               cat >> confdefs.h <<\EOF
-#define vsnprintf ber_pvt_vsnprintf
-EOF
-
-       fi
-fi
-
-# Check Configuration
-echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:23298: checking declaration of sys_errlist" >&5
-if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
+       if test "$ac_cv_func_getpeereid" != yes; then
+               echo $ac_n "checking for msg_control in msghdr""... $ac_c" 1>&6
+echo "configure:24691: checking for msg_control in msghdr" >&5
+if eval "test \"\${ol_cv_msghdr_msg_control+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-       cat > conftest.$ac_ext <<EOF
-#line 23304 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 24696 "configure"
 #include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <errno.h>
-#ifdef WINNT
-#include <stdlib.h>
-#endif 
+#include <sys/socket.h>
 int main() {
-char *c = (char *) *sys_errlist
+struct msghdr m; m.msg_control=(struct cmsghdr *)0
 ; return 0; }
 EOF
-if { (eval echo configure:23317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:24703: \"$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
+  ol_cv_msghdr_msg_control=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_dcl_sys_errlist=no
+  ol_cv_msghdr_msg_control=no
 fi
 rm -f conftest*
+       
 fi
 
-echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
-#
-# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
-if test $ol_cv_dcl_sys_errlist = no ; then
+echo "$ac_t""$ol_cv_msghdr_msg_control" 1>&6
+  if test $ol_cv_msghdr_msg_control = "yes" ; then
        cat >> confdefs.h <<\EOF
-#define DECL_SYS_ERRLIST 1
+#define HAVE_MSGHDR_MSG_CONTROL 1
 EOF
 
+  fi
 
-       echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:23340: 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 23346 "configure"
-#include "confdefs.h"
-#include <errno.h>
-int main() {
-char *c = (char *) *sys_errlist
-; return 0; }
-EOF
-if { (eval echo configure:23353: \"$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
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_have_sys_errlist=no
-fi
-rm -f conftest*
+       fi
+       LIBSRCS="$LIBSRCS getpeereid.c"
 fi
+if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
+       if test "$ac_cv_func_snprintf" != yes; then
+               cat >> confdefs.h <<\EOF
+#define snprintf ber_pvt_snprintf
+EOF
 
-echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
-fi
-if test $ol_cv_have_sys_errlist = yes ; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_SYS_ERRLIST 1
+       fi
+       if test "$ac_cv_func_vsnprintf" != yes; then
+               cat >> confdefs.h <<\EOF
+#define vsnprintf ber_pvt_vsnprintf
 EOF
 
+       fi
 fi
 
 
-
 if test "$ol_enable_slapi" != 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:23381: checking for $ac_hdr" >&5
+echo "configure:24748: 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 23386 "configure"
+#line 24753 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:23391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:24758: \"$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*
@@ -23418,7 +24785,7 @@ done
                { echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
        fi
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:23422: checking for lt_dlinit in -lltdl" >&5
+echo "configure:24789: 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
@@ -23426,7 +24793,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 23430 "configure"
+#line 24797 "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
@@ -23437,7 +24804,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:23441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24808: \"$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
@@ -23526,12 +24893,6 @@ if test "$ol_enable_crypt" != no ; then
 #define SLAPD_CRYPT 1
 EOF
 
-fi
-if test "$ol_link_kpasswd" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_KPASSWD 1
-EOF
-
 fi
 if test "$ol_link_spasswd" != no ; then
        cat >> confdefs.h <<\EOF
@@ -23576,263 +24937,256 @@ cat >> confdefs.h <<\EOF
 EOF
 
 
-if test "$ol_enable_bdb" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_BDB 1
-EOF
-
-       BUILD_SLAPD=yes
-       BUILD_BDB=yes
-       if test "$ol_with_bdb_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_BDB_DYNAMIC 1
-EOF
-
-               BUILD_BDB=mod
-               BUILD_BDB_DYNAMIC=shared
+if test "$ol_enable_bdb" != no ; then
+       BUILD_SLAPD=yes
+       BUILD_BDB=$ol_enable_bdb
+       if test "$ol_enable_bdb" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
+               MFLAG=SLAPD_MOD_STATIC
        fi
-fi
-
-if test "$ol_link_dnssrv" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_DNSSRV 1
+       cat >> confdefs.h <<EOF
+#define SLAPD_BDB $MFLAG
 EOF
 
-       BUILD_SLAPD=yes
-       BUILD_DNSSRV=yes
-       if test "$ol_with_dnssrv_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_DNSSRV_DYNAMIC 1
-EOF
+fi
 
-               BUILD_DNSSRV=mod
-               BUILD_DNSSRV_DYNAMIC=shared
+if test "$ol_enable_dnssrv" != no ; then
+       BUILD_SLAPD=yes
+       BUILD_DNSSRV=$ol_enable_dnssrv
+       if test "$ol_enable_dnssrv" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_DNSSRV $MFLAG
+EOF
+
 fi
 
 if test "$ol_enable_hdb" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_HDB 1
-EOF
-
        BUILD_SLAPD=yes
-       BUILD_HDB=yes
-       if test "$ol_with_hdb_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_HDB_DYNAMIC 1
-EOF
-
-               BUILD_HDB=mod
-               BUILD_HDB_DYNAMIC=shared
+       BUILD_HDB=$ol_enable_hdb
+       if test "$ol_enable_hdb" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-hdb"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-hdb"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_HDB $MFLAG
+EOF
+
 fi
 
 if test "$ol_enable_ldap" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_LDAP 1
-EOF
-
        BUILD_SLAPD=yes
-       BUILD_LDAP=yes
-       if test "$ol_with_ldap_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_LDAP_DYNAMIC 1
-EOF
-
-               BUILD_LDAP=mod
-               BUILD_LDAP_DYNAMIC=shared
+       BUILD_LDAP=$ol_enable_ldap
+       if test "$ol_enable_ldap" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_LDAP $MFLAG
+EOF
+
 fi
 
 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_LDBM 1
-EOF
-
        BUILD_SLAPD=yes
-       BUILD_LDBM=yes
-       if test "$ol_with_ldbm_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_LDBM_DYNAMIC 1
-EOF
-
-               BUILD_LDBM=mod
-               BUILD_LDBM_DYNAMIC=shared
+       BUILD_LDBM=$ol_enable_ldbm
+       if test "$ol_enable_ldbm" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_LDBM $MFLAG
+EOF
+
 fi
 
 if test "$ol_enable_meta" != no ; then
-       if test "$ol_enable_ldap" = no ; then
-               { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
-       fi
-       if test "$ol_enable_rewrite" = no ; then
-               { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
-       fi
-       cat >> confdefs.h <<\EOF
-#define SLAPD_META 1
-EOF
-
        BUILD_SLAPD=yes
-       BUILD_META=yes
+       BUILD_META=$ol_enable_meta
        BUILD_REWRITE=yes
-       if test "$ol_with_meta_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_META_DYNAMIC 1
-EOF
-
-               BUILD_META=mod
-               BUILD_META_DYNAMIC=shared
+       if test "$ol_enable_meta" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_META $MFLAG
+EOF
+
 fi
 
 if test "$ol_enable_monitor" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_MONITOR 1
-EOF
-
        BUILD_SLAPD=yes
-       BUILD_MONITOR=yes
-       if test "$ol_with_monitor_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_MONITOR_DYNAMIC 1
-EOF
-
-               BUILD_MONITOR=mod
-               BUILD_MONITOR_DYNAMIC=shared
+       BUILD_MONITOR=$ol_enable_monitor
+       if test "$ol_enable_monitor" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_MONITOR $MFLAG
+EOF
+
 fi
 
 if test "$ol_enable_null" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_NULL 1
-EOF
-
        BUILD_SLAPD=yes
-       BUILD_NULL=yes
-       if test "$ol_with_null_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_NULL_DYNAMIC 1
-EOF
-
-               BUILD_NULL=mod
-               BUILD_NULL_DYNAMIC=shared
+       BUILD_NULL=$ol_enable_null
+       if test "$ol_enable_null" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_NULL $MFLAG
+EOF
+
 fi
 
 if test "$ol_enable_passwd" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_PASSWD 1
-EOF
-
        BUILD_SLAPD=yes
-       BUILD_PASSWD=yes
-       if test "$ol_with_passwd_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_PASSWD_DYNAMIC 1
-EOF
-
-               BUILD_PASSWD=mod
-               BUILD_PASSWD_DYNAMIC=shared
+       BUILD_PASSWD=$ol_enable_passwd
+       if test "$ol_enable_passwd" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_PASSWD $MFLAG
+EOF
+
 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
+       BUILD_PERL=$ol_enable_perl
+       if test "$ol_enable_perl" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
+               MFLAG=SLAPD_MOD_STATIC
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_PERL $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_relay" != no ; then
+       BUILD_SLAPD=yes
+       BUILD_RELAY=$ol_enable_relay
+       if test "$ol_enable_relay" = mod ; then
+               SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-relay"
+               MFLAG=SLAPD_MOD_DYNAMIC
+       else
+               SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-relay"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_RELAY $MFLAG
+EOF
+
 fi
 
 if test "$ol_enable_shell" != no ; then
        if test "$ol_link_thread" != no ; then
                echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
        fi
-       cat >> confdefs.h <<\EOF
-#define SLAPD_SHELL 1
-EOF
-
        BUILD_SLAPD=yes
-       BUILD_SHELL=yes
-       if test "$ol_with_shell_module" != static ; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_SHELL_DYNAMIC 1
-EOF
-
-               BUILD_SHELL=mod
-               BUILD_SHELL_DYNAMIC=shared
+       BUILD_SHELL=$ol_enable_shell
+       if test "$ol_enable_shell" = mod ; then
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
+               MFLAG=SLAPD_MOD_DYNAMIC
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
+               MFLAG=SLAPD_MOD_STATIC
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_SHELL $MFLAG
+EOF
+
 fi
 
 if test "$ol_link_sql" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_SQL 1
+       BUILD_SLAPD=yes
+       BUILD_SQL=$ol_enable_sql
+       if test "$ol_enable_sql" = mod; then
+               SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
+               MFLAG=SLAPD_MOD_DYNAMIC
+       else
+               SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
+               MFLAG=SLAPD_MOD_STATIC
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_SQL $MFLAG
 EOF
 
-       BUILD_SLAPD=yes
-       BUILD_SQL=yes
-       if test "$ol_with_sql_module" != static; then
-               cat >> confdefs.h <<\EOF
-#define SLAPD_SQL_DYNAMIC 1
+fi
+
+if test "$ol_enable_accesslog" != no ; then
+       BUILD_ACCESSLOG=$ol_enable_accesslog
+       if test "$ol_enable_accesslog" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS accesslog.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS accesslog.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_ACCESSLOG $MFLAG
 EOF
 
-               BUILD_SQL=mod
-               BUILD_SQL_DYNAMIC=shared
-               SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
+fi
+
+if test "$ol_enable_denyop" != no ; then
+       BUILD_DENYOP=$ol_enable_denyop
+       if test "$ol_enable_denyop" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS denyop.la"
        else
-               SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS denyop.o"
        fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_DENYOP $MFLAG
+EOF
+
 fi
 
-if test "$ol_with_dyngroup" != no ; then
-       BUILD_DYNGROUP=$ol_with_dyngroup
-       if test "$ol_with_dyngroup" = mod ; then
+if test "$ol_enable_dyngroup" != no ; then
+       BUILD_DYNGROUP=$ol_enable_dyngroup
+       if test "$ol_enable_dyngroup" = mod ; then
                MFLAG=SLAPD_MOD_DYNAMIC
                SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
        else
                MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dyngroup.o"
        fi
        cat >> confdefs.h <<EOF
 #define SLAPD_OVER_DYNGROUP $MFLAG
@@ -23840,13 +25194,74 @@ EOF
 
 fi
 
-if test "$ol_with_proxycache" != no ; then
-       BUILD_PROXYCACHE=$ol_with_proxycache
-       if test "$ol_with_proxycache" = mod ; then
+if test "$ol_enable_dynlist" != no ; then
+       BUILD_DYNLIST=$ol_enable_dynlist
+       if test "$ol_enable_dynlist" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dynlist.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dynlist.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_DYNLIST $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_glue" != no ; then
+       BUILD_GLUE=$ol_enable_glue
+       if test "$ol_enable_glue" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS glue.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS glue.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_GLUE $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_lastmod" != no ; then
+       BUILD_LASTMOD=$ol_enable_lastmod
+       if test "$ol_enable_lastmod" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS lastmod.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS lastmod.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_LASTMOD $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_ppolicy" != no ; then
+       BUILD_PPOLICY=$ol_enable_ppolicy
+       if test "$ol_enable_ppolicy" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS ppolicy.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS ppolicy.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_PPOLICY $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_proxycache" != no ; then
+       BUILD_PROXYCACHE=$ol_enable_proxycache
+       if test "$ol_enable_proxycache" = mod ; then
                MFLAG=SLAPD_MOD_DYNAMIC
                SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
        else
                MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS pcache.o"
        fi
        cat >> confdefs.h <<EOF
 #define SLAPD_OVER_PROXYCACHE $MFLAG
@@ -23854,14 +25269,45 @@ EOF
 
 fi
 
-if test "$ol_with_rwm " != no ; then
+if test "$ol_enable_refint" != no ; then
+       BUILD_REFINT=$ol_enable_refint
+       if test "$ol_enable_refint" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS refint.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS refint.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_REFINT $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_retcode" != no ; then
+       BUILD_RETCODE=$ol_enable_retcode
+       if test "$ol_enable_retcode" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS retcode.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS retcode.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_RETCODE $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_rwm" != no ; then
        BUILD_REWRITE=yes
-       BUILD_RWM=$ol_with_rwm
-       if test "$ol_with_rwm" = mod ; then
+       BUILD_RWM=$ol_enable_rwm
+       if test "$ol_enable_rwm" = mod ; then
                MFLAG=SLAPD_MOD_DYNAMIC
                SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS rwm.la"
        else
                MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS rwm_x.o"
        fi
        cat >> confdefs.h <<EOF
 #define SLAPD_OVER_RWM $MFLAG
@@ -23869,6 +25315,51 @@ EOF
 
 fi
 
+if test "$ol_enable_syncprov" != no ; then
+       BUILD_SYNCPROV=$ol_enable_syncprov
+       if test "$ol_enable_syncprov" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS syncprov.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS syncprov.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_SYNCPROV $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_translucent" != no ; then
+       BUILD_TRANSLUCENT=$ol_enable_translucent
+       if test "$ol_enable_translucent" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS translucent.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS translucent.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_TRANSLUCENT $MFLAG
+EOF
+
+fi
+
+if test "$ol_enable_unique" != no ; then
+       BUILD_UNIQUE=$ol_enable_unique
+       if test "$ol_enable_unique" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS unique.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+               SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS unique.o"
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_UNIQUE $MFLAG
+EOF
+
+fi
+
 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
        $BUILD_SLAPD = yes ; then
        BUILD_SLURPD=yes
@@ -23900,11 +25391,7 @@ else
        PLAT=UNIX
 fi
 
-if test -z "$SLAPD_STATIC_BACKENDS"; then
-       SLAPD_NO_STATIC='#'
-else
-       SLAPD_NO_STATIC=
-fi
+
 
 
 
@@ -23976,6 +25463,8 @@ fi
 
 
 
+
+
 
 
 
@@ -24059,7 +25548,7 @@ 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/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       \
-libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
+libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-shared.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-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
@@ -24067,17 +25556,18 @@ servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefi
 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/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-ldif/Makefile:build/top.mk:servers/slapd/back-ldif/Makefile.in:build/mod.mk \
 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/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-relay/Makefile:build/top.mk:servers/slapd/back-relay/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-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/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.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 \
 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
 tests/run \
@@ -24144,6 +25634,7 @@ s%@AMTAR@%$AMTAR%g
 s%@AWK@%$AWK%g
 s%@AMTARFLAGS@%$AMTARFLAGS%g
 s%@SET_MAKE@%$SET_MAKE%g
+s%@OPENLDAP_LIBRELEASE@%$OPENLDAP_LIBRELEASE%g
 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
 s%@top_builddir@%$top_builddir%g
@@ -24161,7 +25652,6 @@ s%@AS@%$AS%g
 s%@OBJDUMP@%$OBJDUMP%g
 s%@CPP@%$CPP%g
 s%@LIBTOOL@%$LIBTOOL%g
-s%@LN_H@%$LN_H%g
 s%@PERLBIN@%$PERLBIN%g
 s%@OL_MKDEP@%$OL_MKDEP%g
 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
@@ -24169,7 +25659,9 @@ s%@LTSTATIC@%$LTSTATIC%g
 s%@LIBOBJS@%$LIBOBJS%g
 s%@LIBSRCS@%$LIBSRCS%g
 s%@PLAT@%$PLAT%g
+s%@WITH_SASL@%$WITH_SASL%g
 s%@WITH_TLS@%$WITH_TLS%g
+s%@WITH_MODULES_ENABLED@%$WITH_MODULES_ENABLED%g
 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
 s%@BUILD_SLAPI@%$BUILD_SLAPI%g
@@ -24183,24 +25675,24 @@ s%@BUILD_META@%$BUILD_META%g
 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
 s%@BUILD_NULL@%$BUILD_NULL%g
 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
+s%@BUILD_RELAY@%$BUILD_RELAY%g
 s%@BUILD_PERL@%$BUILD_PERL%g
 s%@BUILD_SHELL@%$BUILD_SHELL%g
 s%@BUILD_SQL@%$BUILD_SQL%g
-s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
-s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
-s%@BUILD_HDB_DYNAMIC@%$BUILD_HDB_DYNAMIC%g
-s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
-s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
-s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
-s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
-s%@BUILD_NULL_DYNAMIC@%$BUILD_NULL_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_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
+s%@BUILD_ACCESSLOG@%$BUILD_ACCESSLOG%g
+s%@BUILD_DENYOP@%$BUILD_DENYOP%g
 s%@BUILD_DYNGROUP@%$BUILD_DYNGROUP%g
+s%@BUILD_DYNLIST@%$BUILD_DYNLIST%g
+s%@BUILD_GLUE@%$BUILD_GLUE%g
+s%@BUILD_LASTMOD@%$BUILD_LASTMOD%g
+s%@BUILD_PPOLICY@%$BUILD_PPOLICY%g
 s%@BUILD_PROXYCACHE@%$BUILD_PROXYCACHE%g
+s%@BUILD_REFINT@%$BUILD_REFINT%g
+s%@BUILD_RETCODE@%$BUILD_RETCODE%g
 s%@BUILD_RWM@%$BUILD_RWM%g
+s%@BUILD_SYNCPROV@%$BUILD_SYNCPROV%g
+s%@BUILD_TRANSLUCENT@%$BUILD_TRANSLUCENT%g
+s%@BUILD_UNIQUE@%$BUILD_UNIQUE%g
 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
 s%@LDAP_LIBS@%$LDAP_LIBS%g
 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
@@ -24214,6 +25706,7 @@ s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
 s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
+s%@SLAPD_STATIC_OVERLAYS@%$SLAPD_STATIC_OVERLAYS%g
 s%@SLAPD_DYNAMIC_OVERLAYS@%$SLAPD_DYNAMIC_OVERLAYS%g
 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
@@ -24228,6 +25721,7 @@ s%@LIBSLAPI@%$LIBSLAPI%g
 s%@LIBSLAPITOOLS@%$LIBSLAPITOOLS%g
 s%@AUTH_LIBS@%$AUTH_LIBS%g
 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
+s%@SLAPD_GMP_LIBS@%$SLAPD_GMP_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
@@ -24289,7 +25783,7 @@ 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/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       \
-libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
+libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-shared.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-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
@@ -24297,17 +25791,18 @@ servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefi
 servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/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-ldif/Makefile:build/top.mk:servers/slapd/back-ldif/Makefile.in:build/mod.mk \
 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/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-relay/Makefile:build/top.mk:servers/slapd/back-relay/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-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/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
 servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.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 \
 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
 tests/run \
@@ -24480,12 +25975,64 @@ fi; done
 
 EOF
 cat >> $CONFIG_STATUS <<EOF
-
+STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 
 chmod +x tests/run
 date > stamp-h
+BACKENDSC="servers/slapd/backends.c"
+echo "Making $BACKENDSC"
+rm -f $BACKENDSC
+cat > $BACKENDSC << ENDX
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2005 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* This file is automatically generated by configure; please do not edit. */
+
+#include "portable.h"
+#include "slap.h"
+
+ENDX
+if test "${STATIC_BACKENDS}"; then
+       for b in config ${STATIC_BACKENDS}; do
+               bb=`echo "${b}" | sed -e 's/back-//'`
+               cat >> $BACKENDSC << ENDX
+extern BI_init ${bb}_back_initialize;
+ENDX
+       done
+
+       cat >> $BACKENDSC << ENDX
+
+BackendInfo slap_binfo[] = {
+ENDX
+
+       for b in config ${STATIC_BACKENDS}; do
+               bb=`echo "${b}" | sed -e 's/back-//'`
+               echo "    Add ${bb} ..."
+               cat >> $BACKENDSC << ENDX
+       { "${bb}", ${bb}_back_initialize },
+ENDX
+       done
+
+       cat >> $BACKENDSC << ENDX
+       { NULL, NULL },
+};
+
+/* end of generated file */
+ENDX
+fi
+
 echo Please run \"make depend\" to build dependencies
 
 exit 0