]> git.sur5r.net Git - openldap/blobdiff - configure
Prepare for release
[openldap] / configure
index 66b7b14b5d8fa861d0fd29e10be7cd7e7cbf6b73..abbc879967d78a4d791a7f66bd545b2b064aa15e 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,16 +1,17 @@
 #! /bin/sh
 # $OpenLDAP$
-# from OpenLDAP 
+# from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.36 2001/12/04 18:15:24 kurt Exp  
 
-# Copyright 1998-2000 The OpenLDAP Foundation.  All Rights Reserved.
+# Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
 # 
-# Redistribution and use in source and binary forms are permitted only
-# as authorized by the OpenLDAP Public License.  A copy of this
-# license is available at http://www.OpenLDAP.org/license.html or
-# in file LICENSE in the top-level directory of the distribution.
+# 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 at
+# http://www.OpenLDAP.org/license.html or in file LICENSE in the
+# top-level directory of the distribution.
 
-echo "Copyright 1998-2000 The OpenLDAP Foundation,  All Rights Reserved."
-echo "Copying restrictions apply, see COPYRIGHT file."
+echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
+echo "Restrictions apply, see COPYRIGHT and LICENSE files."
 
 # Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version 2.13.1 
@@ -25,97 +26,95 @@ ac_default_prefix=/usr/local
 # Any additions from configure.in:
 ac_default_prefix=/usr/local
 ac_help="$ac_help
-  --with-subdir=DIR change default subdirectory used for installs"
+  --with-subdir=DIR      change default subdirectory used for installs"
 ac_help="$ac_help
-  --enable-debug       enable debugging (yes)"
+  --enable-debug         enable debugging [yes]"
 ac_help="$ac_help
-  --enable-syslog      enable syslog support (auto)"
+  --enable-syslog        enable syslog support [auto]"
 ac_help="$ac_help
-  --enable-proctitle   enable proctitle support (yes)"
+  --enable-proctitle     enable proctitle support [yes]"
 ac_help="$ac_help
-  --enable-cache       enable caching (yes)"
+  --enable-cache         enable caching (experimental) [no]"
 ac_help="$ac_help
-  --enable-referrals   enable V2 Referrals extension (yes)"
+  --enable-referrals     enable LDAPv2+ Referrals (experimental) [no]"
 ac_help="$ac_help
-  --enable-kbind       enable V2 Kerberos IV bind (auto)"
+  --enable-kbind         enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
 ac_help="$ac_help
-  --enable-cldap       enable connectionless ldap (no)"
+  --enable-ipv6          enable IPv6 support [auto]"
 ac_help="$ac_help
-  --enable-ipv6        enable IPv6 support (auto)"
+  --enable-local         enable AF_LOCAL (AF_UNIX) socket support [auto]"
 ac_help="$ac_help
-  --enable-unix                enable UNIX domain socket support (auto)"
+  --enable-x-compile     enable cross compiling [no]"
 ac_help="$ac_help
-  --enable-x-compile   enable cross compiling (no)"
+  --with-cyrus-sasl      with Cyrus SASL support [auto]"
 ac_help="$ac_help
-  --with-cyrus-sasl    with Cyrus SASL support (auto)"
+  --with-fetch           with fetch URL support [auto]"
 ac_help="$ac_help
-  --with-fetch         with fetch URL support (auto)"
+  --with-kerberos        with Kerberos support [auto]"
 ac_help="$ac_help
-  --with-kerberos      with support (auto)"
+  --with-readline        with readline support [auto]"
 ac_help="$ac_help
-  --with-readline      with readline support (auto)"
+  --with-threads         with threads [auto]"
 ac_help="$ac_help
-  --with-threads       use threads (auto)"
+  --with-tls             with TLS/SSL support [auto]"
 ac_help="$ac_help
-  --with-tls           with TLS/SSL support (auto)"
-ac_help="$ac_help
-  --with-yielding-select       with implicitly yielding select (auto)"
+  --with-yielding-select  with implicitly yielding select [auto]"
 ac_help="$ac_help
 SLAPD (Standalone LDAP Daemon) Options:"
 ac_help="$ac_help
-  --enable-slapd       enable building slapd (yes)"
+  --enable-slapd         enable building slapd [yes]"
 ac_help="$ac_help
-    --enable-cleartext enable cleartext passwords (yes)"
+    --enable-cleartext   enable cleartext passwords [yes]"
 ac_help="$ac_help
-    --enable-crypt     enable crypt(3) passwords (auto)"
+    --enable-crypt       enable crypt(3) passwords [auto]"
 ac_help="$ac_help
-    --enable-kpasswd   enable kerberos password verification (no)"
+    --enable-kpasswd     enable kerberos password verification [no]"
 ac_help="$ac_help
-    --enable-spasswd   enable (Cyrus) SASL password verification (no)"
+    --enable-spasswd     enable (Cyrus) SASL password verification [no]"
 ac_help="$ac_help
-    --enable-modules   enable dynamic module support (no)"
+    --enable-modules     enable dynamic module support [no]"
 ac_help="$ac_help
-    --enable-multimaster       enable multimaster replication (no)"
+    --enable-phonetic    enable phonetic/soundex [no]"
 ac_help="$ac_help
-    --enable-phonetic  enable phonetic/soundex (no)"
+    --enable-rlookups    enable reverse lookups [no]"
 ac_help="$ac_help
-    --enable-quipu     build quipu migration tools (no)"
+    --enable-aci         enable per-object ACIs [no]"
 ac_help="$ac_help
-    --enable-rlookups  enable reverse lookups (auto)"
+    --enable-wrappers    enable tcp wrapper support [no]"
 ac_help="$ac_help
-    --enable-aci       enable per-object ACIs (no)"
+    --enable-dynamic     enable linking built binaries with dynamic libs [no]"
 ac_help="$ac_help
-    --enable-wrappers  enable tcp wrapper support (no)"
+    --enable-dnssrv      enable dnssrv backend [no]"
 ac_help="$ac_help
-    --enable-dynamic   enable linking built binaries with dynamic libs (no)"
+    --with-dnssrv-module  module type [static]"
 ac_help="$ac_help
-    --enable-dnssrv    enable dnssrv backend (no)"
+    --enable-ldap        enable ldap backend [no]"
 ac_help="$ac_help
-      --with-dnssrv-module     module type (static)"
+    --with-ldap-module   module type [static]"
 ac_help="$ac_help
-    --enable-ldap      enable ldap backend (no)"
+    --enable-ldbm        enable ldbm backend [yes]"
 ac_help="$ac_help
-      --with-ldap-module       module type (static)"
+    --with-ldbm-api       with LDBM API [auto]"
 ac_help="$ac_help
-    --enable-ldbm      enable ldbm backend (yes)"
+    --with-ldbm-module   module type [static]"
 ac_help="$ac_help
-      --with-ldbm-api  use LDBM API (auto)"
+    --with-ldbm-type     use LDBM type [auto]"
 ac_help="$ac_help
-      --with-ldbm-module       module type (static)"
+    --enable-passwd      enable passwd backend [no]"
 ac_help="$ac_help
-      --with-ldbm-type use LDBM type (auto)"
+    --with-passwd-module  module type [static]"
 ac_help="$ac_help
-    --enable-passwd    enable passwd backend (no)"
+    --enable-shell       enable shell backend [no]"
 ac_help="$ac_help
-      --with-passwd-module     module type (static)"
+    --with-shell-module          module type [static]"
 ac_help="$ac_help
-    --enable-shell     enable shell backend (no)"
+    --enable-sql         enable sql backend [no]"
 ac_help="$ac_help
-      --with-shell-module      module type (static)"
+    --with-sql-module    module type [static]"
 ac_help="$ac_help
 SLURPD (Replication Daemon) Options:"
 ac_help="$ac_help
-  --enable-slurpd      enable building slurpd (auto)"
+  --enable-slurpd        enable building slurpd [auto]"
 ac_help="$ac_help
 Library Generation & Linking Options"
 ac_help="$ac_help
@@ -631,14 +630,14 @@ else
 fi
 
 
-# set unset (borrowed from autoconf 2.14a)
-if (unset FOO) >/dev/null 2>&1; then
+# set unset (borrowed from autoconf 2.49c)
+if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
   ol_unset=unset
 else
   ol_unset=false
 fi
 # unset CDPATH
-$ol_unset CDPATH || test "${CDPATH+set}" != set || CDPATH=: && export CDPATH
+$ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
 
 ac_aux_dir=
 for ac_dir in build $srcdir/build; do
@@ -672,7 +671,7 @@ echo "Configuring OpenLDAP $OL_VERSION ..."
 
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:676: checking host system type" >&5
+echo "configure:675: 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.
@@ -713,7 +712,7 @@ host_os=$ac_cv_host_os
 
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:717: checking target system type" >&5
+echo "configure:716: 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.
@@ -753,7 +752,7 @@ target_os=$ac_cv_target_os
 
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:757: checking build system type" >&5
+echo "configure:756: 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.
@@ -830,7 +829,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:834: checking for a BSD compatible install" >&5
+echo "configure:833: 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
@@ -887,7 +886,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:891: checking whether build environment is sane" >&5
+echo "configure:890: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -948,7 +947,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:952: checking for $ac_word" >&5
+echo "configure:951: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -978,7 +977,7 @@ test -n "$AWK" && break
 done
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:982: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:981: 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
@@ -1018,7 +1017,7 @@ fi
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1022: checking for working aclocal" >&5
+echo "configure:1021: 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.
@@ -1031,7 +1030,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1035: checking for working autoconf" >&5
+echo "configure:1034: 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.
@@ -1044,7 +1043,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1048: checking for working automake" >&5
+echo "configure:1047: 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.
@@ -1057,7 +1056,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1061: checking for working autoheader" >&5
+echo "configure:1060: 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.
@@ -1070,7 +1069,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1074: checking for working makeinfo" >&5
+echo "configure:1073: 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.
@@ -1090,7 +1089,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:1094: checking for $ac_word" >&5
+echo "configure:1093: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1127,8 +1126,6 @@ if test -n "$AMTAR"; then
   fi
 fi
 
-
-
 cat >> confdefs.h <<EOF
 #define OPENLDAP_PACKAGE "$PACKAGE"
 EOF
@@ -1141,7 +1138,7 @@ EOF
 
 
 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
-echo "configure:1145: checking configure arguments" >&5
+echo "configure:1142: checking configure arguments" >&5
 
 
 top_builddir=`pwd`
@@ -1244,7 +1241,7 @@ if test "${enable_cache+set}" = set; then
        ol_enable_cache="$ol_arg"
 
 else
-       ol_enable_cache="yes"
+       ol_enable_cache="no"
 fi
 # end --enable-cache
 # OpenLDAP --enable-referrals
@@ -1264,7 +1261,7 @@ if test "${enable_referrals+set}" = set; then
        ol_enable_referrals="$ol_arg"
 
 else
-       ol_enable_referrals="yes"
+       ol_enable_referrals="no"
 fi
 # end --enable-referrals
 # OpenLDAP --enable-kbind
@@ -1284,29 +1281,9 @@ if test "${enable_kbind+set}" = set; then
        ol_enable_kbind="$ol_arg"
 
 else
-       ol_enable_kbind="auto"
+       ol_enable_kbind="no"
 fi
 # end --enable-kbind
-# OpenLDAP --enable-cldap
-       # Check whether --enable-cldap or --disable-cldap was given.
-if test "${enable_cldap+set}" = set; then
-  enableval="$enable_cldap"
-  
-       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-cldap" 1>&2; exit 1; }
-       fi
-       ol_enable_cldap="$ol_arg"
-
-else
-       ol_enable_cldap="no"
-fi
-# end --enable-cldap
 # OpenLDAP --enable-ipv6
        # Check whether --enable-ipv6 or --disable-ipv6 was given.
 if test "${enable_ipv6+set}" = set; then
@@ -1327,10 +1304,10 @@ else
        ol_enable_ipv6="auto"
 fi
 # end --enable-ipv6
-# OpenLDAP --enable-unix
-       # Check whether --enable-unix or --disable-unix was given.
-if test "${enable_unix+set}" = set; then
-  enableval="$enable_unix"
+# OpenLDAP --enable-local
+       # Check whether --enable-local or --disable-local was given.
+if test "${enable_local+set}" = set; then
+  enableval="$enable_local"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1339,14 +1316,14 @@ if test "${enable_unix+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-unix" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
        fi
-       ol_enable_unix="$ol_arg"
+       ol_enable_local="$ol_arg"
 
 else
-       ol_enable_unix="auto"
+       ol_enable_local="auto"
 fi
-# end --enable-unix
+# 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
@@ -1644,26 +1621,6 @@ else
        ol_enable_modules="no"
 fi
 # end --enable-modules
-# OpenLDAP --enable-multimaster
-       # Check whether --enable-multimaster or --disable-multimaster was given.
-if test "${enable_multimaster+set}" = set; then
-  enableval="$enable_multimaster"
-  
-       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-multimaster" 1>&2; exit 1; }
-       fi
-       ol_enable_multimaster="$ol_arg"
-
-else
-       ol_enable_multimaster="no"
-fi
-# end --enable-multimaster
 # OpenLDAP --enable-phonetic
        # Check whether --enable-phonetic or --disable-phonetic was given.
 if test "${enable_phonetic+set}" = set; then
@@ -1684,26 +1641,6 @@ else
        ol_enable_phonetic="no"
 fi
 # end --enable-phonetic
-# OpenLDAP --enable-quipu
-       # Check whether --enable-quipu or --disable-quipu was given.
-if test "${enable_quipu+set}" = set; then
-  enableval="$enable_quipu"
-  
-       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-quipu" 1>&2; exit 1; }
-       fi
-       ol_enable_quipu="$ol_arg"
-
-else
-       ol_enable_quipu="no"
-fi
-# end --enable-quipu
 # OpenLDAP --enable-rlookups
        # Check whether --enable-rlookups or --disable-rlookups was given.
 if test "${enable_rlookups+set}" = set; then
@@ -1721,7 +1658,7 @@ if test "${enable_rlookups+set}" = set; then
        ol_enable_rlookups="$ol_arg"
 
 else
-       ol_enable_rlookups="auto"
+       ol_enable_rlookups="no"
 fi
 # end --enable-rlookups
 # OpenLDAP --enable-aci
@@ -2032,6 +1969,47 @@ else
 fi
 # end --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 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-sql" 1>&2; exit 1; }
+       fi
+       ol_enable_sql="$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"
+  
+       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-sql_module" 1>&2; exit 1; }
+       fi
+       ol_with_sql_module="$ol_arg"
+
+else
+       ol_with_sql_module="static"
+fi
+# end --with-sql_module
+
 
 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
 if test "${with_xxslurpdoptions+set}" = set; then
@@ -2131,21 +2109,18 @@ if test $ol_enable_slapd = no ; then
        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
        if test $ol_enable_modules = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
        fi
-       if test $ol_enable_multimaster = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
-       fi
        if test $ol_enable_wrappers = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
        fi
        if test $ol_enable_phonetic = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
        fi
-       if test $ol_enable_quipu = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
-       fi
        if test $ol_enable_rlookups = yes ; then
                echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
        fi
@@ -2173,6 +2148,9 @@ if test $ol_enable_slapd = no ; then
        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
@@ -2183,11 +2161,10 @@ if test $ol_enable_slapd = no ; then
        ol_enable_ldbm=no
        ol_enable_passwd=no
        ol_enable_shell=no
+       ol_enable_sql=no
 
        ol_enable_modules=no
-       ol_enable_multimaster=no
        ol_enable_phonetic=no
-       ol_enable_quipu=no
        ol_enable_rlookups=no
        ol_enable_aci=no
        ol_enable_wrappers=no
@@ -2201,6 +2178,7 @@ if test $ol_enable_slapd = no ; then
        ol_with_ldbm_module=static
        ol_with_passwd_module=static
        ol_with_shell_module=static
+       ol_with_sql_module=static
 
        ol_enable_slurpd=no
 
@@ -2222,7 +2200,8 @@ elif test $ol_enable_ldbm = no ; then
                $ol_enable_dnssrv = no -a \
                $ol_enable_ldap = no -a \
                $ol_enable_passwd = no -a \
-               $ol_enable_shell = no ; then
+               $ol_enable_shell = no -a \
+               $ol_enable_sql = no ; then
                { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
        fi
 
@@ -2254,11 +2233,15 @@ fi
 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
        if test $ol_with_kerberos = no ; then
                { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
+       elif test $ol_with_kerberos = auto ; then
+               ol_with_kerberos=yes
        fi
+
 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
-       if test $ol_with_kerberos != auto ; then
+       if test $ol_with_kerberos = auto ; then
+               ol_with_kerberos=no
+       elif test $ol_with_kerberos != no ; then
                echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
-       else
                ol_with_kerberos=no
        fi
 fi
@@ -2267,7 +2250,7 @@ if test $ol_enable_spasswd = yes ; then
        if test $ol_with_cyrus_sasl = no ; then
                { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
        fi
-       ol_link_spasswd=yes
+       ol_with_cyrus_sasl=yes
 fi
 
 echo "$ac_t""done" 1>&6
@@ -2278,14 +2261,12 @@ LDBM_LIBS=
 LTHREAD_LIBS=
 LUTIL_LIBS=
 
-QUIPU_LIBS=
 SLAPD_LIBS=
 SLURPD_LIBS=
 
 BUILD_SLAPD=no
 BUILD_SLURPD=no
 
-BUILD_QUIPU=no
 BUILD_THREAD=no
 
 BUILD_DNSSRV=no
@@ -2293,17 +2274,23 @@ BUILD_LDAP=no
 BUILD_LDBM=no
 BUILD_PASSWD=no
 BUILD_SHELL=no
+BUILD_SQL=no
 
 BUILD_DNSSRV_DYNAMIC=static
 BUILD_LDAP_DYNAMIC=static
 BUILD_LDBM_DYNAMIC=static
 BUILD_PASSWD_DYNAMIC=static
 BUILD_SHELL_DYNAMIC=static
+BUILD_SQL_DYNAMIC=static
 
 SLAPD_MODULES_LDFLAGS=
 SLAPD_MODULES_CPPFLAGS=
 SLAPD_MODULES_LIST=
 
+SLAPD_SQL_LDFLAGS=
+SLAPD_SQL_LIBS=
+SLAPD_SQL_INCLUDES=
+
 KRB4_LIBS=
 KRB5_LIBS=
 READLINE_LIBS=
@@ -2339,7 +2326,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:2343: checking for $ac_word" >&5
+echo "configure:2330: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2391,7 +2378,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:2395: checking for $ac_word" >&5
+echo "configure:2382: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2423,6 +2410,41 @@ done
 fi
 
 
+for ac_prog in ar gar
+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:2419: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AR="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+  echo "$ac_t""$AR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AR" && break
+done
+
+
 
 
 # Check whether --enable-fast-install or --disable-fast-install was given.
@@ -2451,7 +2473,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2455: checking for $ac_word" >&5
+echo "configure:2477: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2481,7 +2503,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:2485: checking for $ac_word" >&5
+echo "configure:2507: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2511,7 +2533,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:2515: checking for $ac_word" >&5
+echo "configure:2537: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2562,7 +2584,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:2566: checking for $ac_word" >&5
+echo "configure:2588: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2594,7 +2616,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2598: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+echo "configure:2620: 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.
@@ -2605,12 +2627,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2609 "configure"
+#line 2631 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2636: \"$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
@@ -2636,12 +2658,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:2640: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2662: 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:2645: checking whether we are using GNU C" >&5
+echo "configure:2667: 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
@@ -2650,7 +2672,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2654: \"$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:2676: \"$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
@@ -2669,7 +2691,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:2673: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2695: 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
@@ -2712,7 +2734,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:2716: checking for ld used by GCC" >&5
+echo "configure:2738: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -2736,10 +2758,10 @@ echo "configure:2716: 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:2740: checking for GNU ld" >&5
+echo "configure:2762: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:2743: checking for non-GNU ld" >&5
+echo "configure:2765: checking for non-GNU ld" >&5
 fi
 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2774,7 +2796,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:2778: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:2800: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2790,7 +2812,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:2794: checking for BSD-compatible nm" >&5
+echo "configure:2816: checking for BSD-compatible nm" >&5
 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2826,7 +2848,7 @@ NM="$ac_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2830: checking whether ln -s works" >&5
+echo "configure:2852: 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
@@ -2881,8 +2903,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
 case "$lt_target" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2885 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2907 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -2903,19 +2925,19 @@ case "$lt_target" in
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2907: checking whether the C compiler needs -belf" >&5
+echo "configure:2929: checking whether the C compiler needs -belf" >&5
 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2912 "configure"
+#line 2934 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2941: \"$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
@@ -2938,7 +2960,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:2942: checking for $ac_word" >&5
+echo "configure:2964: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2970,7 +2992,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:2974: checking for $ac_word" >&5
+echo "configure:2996: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3005,7 +3027,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:3009: checking for $ac_word" >&5
+echo "configure:3031: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3037,7 +3059,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:3041: checking for $ac_word" >&5
+echo "configure:3063: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3072,7 +3094,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:3076: checking for $ac_word" >&5
+echo "configure:3098: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3104,7 +3126,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:3108: checking for $ac_word" >&5
+echo "configure:3130: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3172,7 +3194,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:3176: checking for $ac_word" >&5
+echo "configure:3198: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3203,7 +3225,7 @@ done
 
 # test for ln hardlink support
 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:3207: checking whether ln works" >&5
+echo "configure:3229: 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
@@ -3226,7 +3248,7 @@ else
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3230: checking whether ln -s works" >&5
+echo "configure:3252: 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
@@ -3254,7 +3276,7 @@ fi
 # Extract the first word of "sendmail", so it can be a program name with args.
 set dummy sendmail; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3258: checking for $ac_word" >&5
+echo "configure:3280: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3290,7 +3312,7 @@ fi
 # Extract the first word of "vi", so it can be a program name with args.
 set dummy vi; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3294: checking for $ac_word" >&5
+echo "configure:3316: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3326,7 +3348,7 @@ fi
 # Extract the first word of "finger", so it can be a program name with args.
 set dummy finger; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3330: checking for $ac_word" >&5
+echo "configure:3352: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3361,7 +3383,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3365: checking how to run the C preprocessor" >&5
+echo "configure:3387: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3376,13 +3398,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 3380 "configure"
+#line 3402 "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:3386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3408: \"$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
   :
@@ -3393,13 +3415,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 3397 "configure"
+#line 3419 "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:3403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3425: \"$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
   :
@@ -3410,13 +3432,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 3414 "configure"
+#line 3436 "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:3420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3442: \"$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
   :
@@ -3454,9 +3476,9 @@ elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
 fi
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:3458: checking for AIX" >&5
+echo "configure:3480: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3460 "configure"
+#line 3482 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -3478,7 +3500,7 @@ rm -f conftest*
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:3482: checking for POSIXized ISC" >&5
+echo "configure:3504: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -3500,17 +3522,17 @@ fi
 
 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:3504: checking for minix/config.h" >&5
+echo "configure:3526: checking for minix/config.h" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3509 "configure"
+#line 3531 "configure"
 #include "confdefs.h"
 #include <minix/config.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3536: \"$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*
@@ -3549,12 +3571,12 @@ fi
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3553: checking for Cygwin environment" >&5
+echo "configure:3575: 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 3558 "configure"
+#line 3580 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3565,7 +3587,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -3581,19 +3603,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:3585: checking for mingw32 environment" >&5
+echo "configure:3607: 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 3590 "configure"
+#line 3612 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3609,19 +3631,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:3613: checking for EMX OS/2 environment" >&5
+echo "configure:3635: 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 3618 "configure"
+#line 3640 "configure"
 #include "confdefs.h"
 
 int main() {
 return __EMX__;
 ; return 0; }
 EOF
-if { (eval echo configure:3625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_emxos2=yes
 else
@@ -3640,7 +3662,7 @@ test "$ac_cv_emxos2" = yes && EMXOS2=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3644: checking for executable suffix" >&5
+echo "configure:3666: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3650,7 +3672,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -3671,13 +3693,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:3675: checking for object suffix" >&5
+echo "configure:3697: 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:3681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -3701,7 +3723,7 @@ EOF
 
 
 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
-echo "configure:3705: checking for be_app in -lbe" >&5
+echo "configure:3727: 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
@@ -3709,7 +3731,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbe -lroot -lnet $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3713 "configure"
+#line 3735 "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
@@ -3720,7 +3742,7 @@ int main() {
 be_app()
 ; return 0; }
 EOF
-if { (eval echo configure:3724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3746: \"$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
@@ -3746,7 +3768,7 @@ fi
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:3750: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:3772: 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
@@ -3763,7 +3785,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 3767 "configure"
+#line 3789 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -3800,7 +3822,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:3804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_prog_cc_stdc="$ac_arg"; break
 else
@@ -3834,7 +3856,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:3838: checking for ${OL_MKDEP} depend flag" >&5
+echo "configure:3860: 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
@@ -3844,7 +3866,7 @@ else
                                cat > conftest.c <<EOF
  noCode;
 EOF
-                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
+                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3870: \"$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
@@ -3877,7 +3899,7 @@ if test "${ol_cv_mkdep}" = no ; then
 fi
 
 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
-echo "configure:3881: checking for afopen in -ls" >&5
+echo "configure:3903: 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
@@ -3885,7 +3907,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ls  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3889 "configure"
+#line 3911 "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
@@ -3896,7 +3918,7 @@ int main() {
 afopen()
 ; return 0; }
 EOF
-if { (eval echo configure:3900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3922: \"$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
 
 
 
-for ac_func in getaddrinfo 
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3931: 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 3936 "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:3960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-if test $ac_cv_func_getaddrinfo = no ; then
-       if test $ol_enable_ipv6 = yes ; then
-               { echo "configure: error: IPv6 support requires getaddrinfo()" 1>&2; exit 1; }
-       fi
-       ol_enable_ipv6=no
-fi
-
-if test $ol_enable_unix != 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:3997: 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 4002 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-       if test $ol_enable_unix = auto ; then
-               ol_enable_unix=$ac_cv_header_sys_un_h
-       elif test $ac_cv_header_sys_un_h = no ; then
-               { echo "configure: error: UNIX domain support requires sys/un.h" 1>&2; exit 1; }
-       fi
-fi
-
 ol_link_modules=no
 if test $ol_enable_modules != no ; then
        for ac_hdr in ltdl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4047: checking for $ac_hdr" >&5
+echo "configure:3956: 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 4052 "configure"
+#line 3961 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3966: \"$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*
@@ -4085,7 +3994,7 @@ done
        fi
 
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:4089: checking for lt_dlinit in -lltdl" >&5
+echo "configure:3998: 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
@@ -4093,7 +4002,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4097 "configure"
+#line 4006 "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
@@ -4104,7 +4013,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:4108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4017: \"$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
@@ -4141,17 +4050,18 @@ else
        ol_with_ldbm_module=static
        ol_with_passwd_module=static
        ol_with_shell_module=static
+       ol_with_sql_module=static
 fi
 
 # test for EBCDIC
 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
-echo "configure:4149: checking for EBCDIC" >&5
+echo "configure:4059: 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 4155 "configure"
+#line 4065 "configure"
 #include "confdefs.h"
 
 #if !('M' == 0xd4)
@@ -4160,7 +4070,7 @@ else
 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4074: \"$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*
@@ -4184,12 +4094,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4188: checking for ANSI C header files" >&5
+echo "configure:4098: 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 4193 "configure"
+#line 4103 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4197,7 +4107,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4111: \"$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*
@@ -4214,7 +4124,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 4218 "configure"
+#line 4128 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4232,7 +4142,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 4236 "configure"
+#line 4146 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4253,7 +4163,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4257 "configure"
+#line 4167 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #ifndef HAVE_EBCDIC
@@ -4271,7 +4181,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:4275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -4305,12 +4215,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:4309: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4219: 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 4314 "configure"
+#line 4224 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4318,7 +4228,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4343,7 +4253,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:4347: checking for opendir in -ldir" >&5
+echo "configure:4257: 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
@@ -4351,7 +4261,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4355 "configure"
+#line 4265 "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
@@ -4362,7 +4272,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4276: \"$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
@@ -4384,7 +4294,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4388: checking for opendir in -lx" >&5
+echo "configure:4298: 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
@@ -4392,7 +4302,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4396 "configure"
+#line 4306 "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
@@ -4403,7 +4313,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4317: \"$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
@@ -4426,12 +4336,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4430: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:4340: 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 4435 "configure"
+#line 4345 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -4447,7 +4357,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:4451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -4468,12 +4378,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:4472: checking POSIX termios" >&5
+echo "configure:4382: 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 4477 "configure"
+#line 4387 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -4483,7 +4393,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4397: \"$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
@@ -4499,7 +4409,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:4503: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:4413: 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
@@ -4508,7 +4418,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 4512 "configure"
+#line 4422 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -4528,7 +4438,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 4532 "configure"
+#line 4442 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -4611,17 +4521,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4615: checking for $ac_hdr" >&5
+echo "configure:4525: 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 4620 "configure"
+#line 4530 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4535: \"$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*
@@ -4650,27 +4560,74 @@ done
 
 
 
-echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:4655: checking for sigset in -lV3" >&5
-ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
+echo $ac_n "checking for dlopen""... $ac_c" 1>&6
+echo "configure:4565: 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 4570 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen(); 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 (*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_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+f = dlopen;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4594: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_dlopen=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:4612: 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="-lV3  $LIBS"
+LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4663 "configure"
+#line 4620 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char sigset();
+char dlopen();
 
 int main() {
-sigset()
+dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:4674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4631: \"$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
@@ -4685,39 +4642,89 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
   cat >> confdefs.h <<EOF
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lV3 $LIBS"
+  LIBS="-ldl $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
 fi
 
+fi
 
-if test $ac_cv_header_winsock_h = yes; then
-       echo $ac_n "checking for winsock""... $ac_c" 1>&6
-echo "configure:4704: checking for winsock" >&5
-if eval "test \"\${ol_cv_winsock+set}\" = set"; then
+
+echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
+echo "configure:4662: checking for sigset in -lV3" >&5
+ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 4709 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lV3  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4670 "configure"
 #include "confdefs.h"
-#include <winsock.h>
-int main() {
-
-                       socket(0,0,0);
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char sigset();
+
+int main() {
+sigset()
+; return 0; }
+EOF
+if { (eval echo configure:4681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lV3 $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test $ac_cv_header_winsock_h = yes; then
+       echo $ac_n "checking for winsock""... $ac_c" 1>&6
+echo "configure:4711: checking for winsock" >&5
+if eval "test \"\${ol_cv_winsock+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4716 "configure"
+#include "confdefs.h"
+#include <winsock.h>
+int main() {
+
+                       socket(0,0,0);
                        select(0,NULL,NULL,NULL,NULL);
                        closesocket(0);
                        gethostname(NULL,0);
        
 ; return 0; }
 EOF
-if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_winsock=yes
 else
@@ -4726,7 +4733,7 @@ else
   rm -rf conftest*
   ol_cv_winsock=no
 fi
-rm -f conftest*]
+rm -f conftest*
 fi
 
 echo "$ac_t""$ol_cv_winsock" 1>&6
@@ -4745,12 +4752,12 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:4749: checking for socket" >&5
+echo "configure:4756: 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 4754 "configure"
+#line 4761 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -4774,7 +4781,7 @@ f = socket;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4785: \"$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
@@ -4793,7 +4800,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:4797: checking for main in -lsocket" >&5
+echo "configure:4804: 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
@@ -4801,14 +4808,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4805 "configure"
+#line 4812 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4819: \"$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
@@ -4836,7 +4843,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:4840: checking for main in -lnet" >&5
+echo "configure:4847: 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
@@ -4844,14 +4851,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4848 "configure"
+#line 4855 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4862: \"$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
@@ -4879,7 +4886,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:4883: checking for main in -lnsl_s" >&5
+echo "configure:4890: 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
@@ -4887,14 +4894,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4891 "configure"
+#line 4898 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4905: \"$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
@@ -4922,7 +4929,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:4926: checking for main in -lnsl" >&5
+echo "configure:4933: 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
@@ -4930,14 +4937,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4934 "configure"
+#line 4941 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4948: \"$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
@@ -4965,7 +4972,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:4969: checking for socket in -linet" >&5
+echo "configure:4976: 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
@@ -4973,7 +4980,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4977 "configure"
+#line 4984 "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
@@ -4984,7 +4991,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:4988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4995: \"$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
@@ -5012,7 +5019,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:5016: checking for main in -lgen" >&5
+echo "configure:5023: 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
@@ -5020,14 +5027,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5024 "configure"
+#line 5031 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5038: \"$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
@@ -5059,12 +5066,12 @@ fi
 
 
 echo $ac_n "checking for select""... $ac_c" 1>&6
-echo "configure:5063: checking for select" >&5
+echo "configure:5070: 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 5068 "configure"
+#line 5075 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char select(); below.  */
@@ -5088,7 +5095,7 @@ f = select;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5099: \"$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
@@ -5111,7 +5118,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:5115: checking types of arguments for select()" >&5
+echo "configure:5122: 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
@@ -5125,7 +5132,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 5129 "configure"
+#line 5136 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -5144,7 +5151,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
           ac_not_found=no ; break 3
 else
@@ -5189,17 +5196,17 @@ 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:5193: checking for $ac_hdr" >&5
+echo "configure:5200: 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 5198 "configure"
+#line 5205 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5210: \"$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*
@@ -5229,12 +5236,12 @@ if test "$ac_cv_header_regex_h" != yes ; then
        { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
 fi
 echo $ac_n "checking for regfree""... $ac_c" 1>&6
-echo "configure:5233: checking for regfree" >&5
+echo "configure:5240: checking for regfree" >&5
 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5238 "configure"
+#line 5245 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char regfree(); below.  */
@@ -5258,7 +5265,7 @@ f = regfree;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_regfree=yes"
 else
@@ -5281,7 +5288,7 @@ fi
 
 
 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
-echo "configure:5285: checking for compatible POSIX regex" >&5
+echo "configure:5292: 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
@@ -5290,7 +5297,7 @@ else
   ol_cv_c_posix_regex=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 5294 "configure"
+#line 5301 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5316,7 +5323,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:5320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_c_posix_regex=yes
 else
@@ -5338,12 +5345,12 @@ fi
 
 ol_link_dnssrv=no
 echo $ac_n "checking for res_query""... $ac_c" 1>&6
-echo "configure:5342: checking for res_query" >&5
+echo "configure:5349: checking for res_query" >&5
 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5347 "configure"
+#line 5354 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char res_query(); below.  */
@@ -5367,7 +5374,7 @@ f = res_query;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5378: \"$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"
 else
@@ -5386,9 +5393,62 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+if test $ac_cv_func_res_query = no ; then 
+       echo $ac_n "checking for __res_query""... $ac_c" 1>&6
+echo "configure:5399: checking for __res_query" >&5
+if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5404 "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)();
+
+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
+
+; return 0; }
+EOF
+if { (eval echo configure:5428: \"$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"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func___res_query=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       ac_cv_func_res_query=$ac_cv_func___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:5392: checking for res_query in -lbind" >&5
+echo "configure:5452: checking for res_query in -lbind" >&5
 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5396,7 +5456,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5400 "configure"
+#line 5460 "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
@@ -5407,7 +5467,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5471: \"$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
@@ -5439,7 +5499,7 @@ 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:5443: checking for __res_query in -lbind" >&5
+echo "configure:5503: checking for __res_query in -lbind" >&5
 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5447,7 +5507,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5451 "configure"
+#line 5511 "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
@@ -5458,7 +5518,7 @@ int main() {
 __res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5522: \"$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
@@ -5490,7 +5550,7 @@ 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:5494: checking for res_query in -lresolv" >&5
+echo "configure:5554: checking for res_query in -lresolv" >&5
 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5498,7 +5558,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5502 "configure"
+#line 5562 "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
@@ -5509,7 +5569,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5573: \"$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
@@ -5539,6 +5599,57 @@ fi
        ac_cv_func_res_query=$ac_cv_lib_resolv_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:5605: checking for __res_query in -lresolv" >&5
+ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lresolv  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5613 "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; }
+EOF
+if { (eval echo configure:5624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo 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
@@ -5554,22 +5665,179 @@ if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
        { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
 fi
 
-if test $ol_enable_quipu != no ; then
-       for ac_hdr in quipu/commonarg.h
+for ac_func in getaddrinfo inet_ntop 
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5672: 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 5677 "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:5701: \"$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
+
+
+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
+else
+       for ac_func in gai_strerror 
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5735: 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 5740 "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:5764: \"$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 INET6_ADDRSTRLEN""... $ac_c" 1>&6
+echo "configure:5790: checking INET6_ADDRSTRLEN" >&5
+if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+               cat > conftest.$ac_ext <<EOF
+#line 5796 "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
+
+       if test $ol_cv_inet6_addrstrlen = yes ; then
+               ol_link_ipv6=yes
+       elif test $ol_enable_ipv6 = yes ; then
+               { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
+       fi
+fi
+
+if test $ol_enable_local != no ; then
+       for ac_hdr in sys/un.h 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5563: checking for $ac_hdr" >&5
+echo "configure:5831: 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 5568 "configure"
+#line 5836 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5573: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5841: \"$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*
@@ -5596,12 +5864,10 @@ fi
 done
 
 
-       if test $ac_cv_header_quipu_commonarg_h = yes ; then
-               BUILD_QUIPU=yes
-       elif test $ol_enable_quipu = auto ; then
-               echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
-       else
-               { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
+       if test $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
 
@@ -5610,24 +5876,25 @@ ol_link_kpasswd=no
 ol_link_krb5=no
 ol_link_krb4=no
 
-if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
-       -o $ol_with_kerberos = k5only -o $ol_with_kerberos = k425 ; then
+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:5621: checking for $ac_hdr" >&5
+echo "configure:5888: 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 5626 "configure"
+#line 5893 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5898: \"$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*
@@ -5659,17 +5926,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5663: checking for $ac_hdr" >&5
+echo "configure:5930: 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 5668 "configure"
+#line 5935 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5940: \"$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*
@@ -5702,23 +5969,61 @@ done
                fi
 
                if test $krb5_impl = mit; then
+                       echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
+echo "configure:5974: 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="-lk5crypto  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5982 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:5989: \"$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
+  krb5crypto=k5crypto
+else
+  echo "$ac_t""no" 1>&6
+krb5crypto=crypto
+fi
+
+
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:5707: checking for main in -lkrb5" >&5
+echo "configure:6012: checking for main in -lkrb5" >&5
 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
+LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5715 "configure"
+#line 6020 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6027: \"$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
@@ -5734,7 +6039,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   have_krb5=yes
-                               KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
+                               KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
 else
   echo "$ac_t""no" 1>&6
 have_krb5=no
@@ -5743,7 +6048,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:5747: checking for main in -lkrb5" >&5
+echo "configure:6052: 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
@@ -5751,14 +6056,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5755 "configure"
+#line 6060 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6067: \"$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
@@ -5785,9 +6090,10 @@ fi
 #define HAVE_HEIMDAL_KERBEROS 1
 EOF
 
+
                else
                        have_krb5=no
-                       echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
+                       echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
                fi
 
                if test $have_krb5 = yes ; then
@@ -5813,24 +6119,24 @@ EOF
        fi
 fi
 
-if test $ol_link_krb5 = yes -a \
-       \( $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; 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 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:5824: checking for $ac_hdr" >&5
+echo "configure:6130: 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 5829 "configure"
+#line 6135 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6140: \"$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*
@@ -5860,22 +6166,22 @@ 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:5864: checking for main in -lkrb4" >&5
+echo "configure:6170: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
+LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5872 "configure"
+#line 6178 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6185: \"$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
@@ -5900,7 +6206,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:5904: checking for main in -lkrb4" >&5
+echo "configure:6210: 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
@@ -5908,14 +6214,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5912 "configure"
+#line 6218 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6225: \"$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
@@ -5957,7 +6263,7 @@ EOF
 
 
                        echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:5961: checking for des_debug in Kerberos libraries" >&5
+echo "configure:6267: 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
@@ -5965,7 +6271,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 5969 "configure"
+#line 6275 "configure"
 #include "confdefs.h"
 
 #include <kerberosIV/krb.h>
@@ -5978,7 +6284,7 @@ des_debug = 1;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_var_des_debug=yes
 else
@@ -6010,24 +6316,24 @@ if test $ol_link_krb5 = yes ; then
        ol_with_kerberos=found
 fi
 
-if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
-       -o $ol_with_kerberos = kth ; then
+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 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6021: checking for $ac_hdr" >&5
+echo "configure:6327: 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 6026 "configure"
+#line 6332 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6337: \"$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*
@@ -6056,7 +6362,7 @@ done
 
        if test $ac_cv_header_krb_h = yes ; then
                echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
-echo "configure:6060: checking for main in -lkrb" >&5
+echo "configure:6366: 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
@@ -6064,14 +6370,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6068 "configure"
+#line 6374 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:6075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6381: \"$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
@@ -6115,7 +6421,14 @@ EOF
 fi
 
 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
-       ol_link_kpasswd=yes;
+       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
 
 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
@@ -6125,27 +6438,26 @@ EOF
 
 
 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
-       { echo "configure: error: Kerberos detection failed." 1>&2; exit 1; }
+       { 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:6139: checking for $ac_hdr" >&5
+echo "configure:6451: 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 6144 "configure"
+#line 6456 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6461: \"$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*
@@ -6174,7 +6486,7 @@ done
        
        if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
                echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
-echo "configure:6178: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
+echo "configure:6490: 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
@@ -6182,7 +6494,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6186 "configure"
+#line 6498 "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
@@ -6193,7 +6505,7 @@ int main() {
 SSLeay_add_ssl_algorithms()
 ; return 0; }
 EOF
-if { (eval echo configure:6197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6509: \"$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
@@ -6218,7 +6530,7 @@ fi
                        
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
-echo "configure:6222: checking for SSL_library_init in -lssl" >&5
+echo "configure:6534: 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
@@ -6226,7 +6538,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6230 "configure"
+#line 6542 "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
@@ -6237,7 +6549,7 @@ int main() {
 SSL_library_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6553: \"$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
@@ -6263,7 +6575,7 @@ fi
 
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
-echo "configure:6267: checking for ssl3_accept in -lssl" >&5
+echo "configure:6579: 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
@@ -6271,7 +6583,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6275 "configure"
+#line 6587 "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
@@ -6282,7 +6594,7 @@ int main() {
 ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:6286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6598: \"$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
@@ -6327,6 +6639,9 @@ EOF
                        fi
                fi
        fi
+
+else
+       echo "configure: warning: TLS privacy protection not supported!" 1>&2
 fi
 
 if test $ol_link_tls = yes ; then
@@ -6334,7 +6649,14 @@ if test $ol_link_tls = yes ; then
 #define HAVE_TLS 1
 EOF
 
-fi     
+
+elif test $ol_with_tls = auto ; then
+       echo "configure: warning: Could not locate TLS/SSL package" 1>&2
+       echo "configure: warning: TLS privacy protection not supported!" 1>&2
+
+elif test $ol_with_tls != no ; then
+       { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
+fi
 
 for ac_func in \
        ctime_r                 \
@@ -6342,12 +6664,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6346: checking for $ac_func" >&5
+echo "configure:6668: 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 6351 "configure"
+#line 6673 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6371,7 +6693,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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_$ac_func=yes"
 else
@@ -6400,19 +6722,19 @@ 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:6404: checking number of arguments of ctime_r" >&5
+echo "configure:6726: 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 6409 "configure"
+#line 6731 "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:6416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs3=yes
 else
@@ -6424,14 +6746,14 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6428 "configure"
+#line 6750 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t ti; char *buffer; ctime_r(&ti,buffer);
 ; return 0; }
 EOF
-if { (eval echo configure:6435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs2=yes
 else
@@ -6471,12 +6793,12 @@ fi
 
 if test "$ac_cv_func_gethostbyname_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
-echo "configure:6475: checking number of arguments of gethostbyname_r" >&5
+echo "configure:6797: 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 6480 "configure"
+#line 6802 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6490,7 +6812,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs5=yes
 else
@@ -6502,7 +6824,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6506 "configure"
+#line 6828 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6517,7 +6839,7 @@ struct hostent hent;struct hostent *rhent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs6=yes
 else
@@ -6558,12 +6880,12 @@ fi
  
 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
-echo "configure:6562: checking number of arguments of gethostbyaddr_r" >&5
+echo "configure:6884: 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 6567 "configure"
+#line 6889 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6579,7 +6901,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        alen, AF_INET, &hent, buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs7=yes
 else
@@ -6591,7 +6913,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6595 "configure"
+#line 6917 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6609,7 +6931,7 @@ struct hostent hent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs8=yes
 else
@@ -6671,19 +6993,13 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
        -o $ol_with_threads = nt ; then
 
        
-       echo $ac_n "checking for NT Threads""... $ac_c" 1>&6
-echo "configure:6676: checking for NT Threads" >&5
-if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-               echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
-echo "configure:6682: checking for _beginthread" >&5
+       echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
+echo "configure:6998: checking for _beginthread" >&5
 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6687 "configure"
+#line 7003 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _beginthread(); below.  */
@@ -6707,7 +7023,7 @@ f = _beginthread;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__beginthread=yes"
 else
@@ -6721,18 +7037,13 @@ fi
 
 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  ol_cv_nt_threads=yes
+  :
 else
   echo "$ac_t""no" 1>&6
-ol_cv_nt_threads=no
-fi
-
-       
 fi
 
-echo "$ac_t""$ol_cv_nt_threads" 1>&6
 
-       if test $ol_cv_nt_threads = yes ; then
+       if test $ac_cv_func__beginthread = yes ; then
                cat >> confdefs.h <<\EOF
 #define HAVE_NT_THREADS 1
 EOF
@@ -6767,17 +7078,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6771: checking for $ac_hdr" >&5
+echo "configure:7082: 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 6776 "configure"
+#line 7087 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7092: \"$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*
@@ -6806,13 +7117,13 @@ done
 
        if test $ac_cv_header_pthread_h = yes ; then
                echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:6810: checking POSIX thread version" >&5
+echo "configure:7121: checking POSIX thread version" >&5
 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 6816 "configure"
+#line 7127 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -6834,7 +7145,7 @@ rm -f conftest*
 
 
        cat > conftest.$ac_ext <<EOF
-#line 6838 "configure"
+#line 7149 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -6887,12 +7198,12 @@ EOF
 
                
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:6891: checking for LinuxThreads pthread.h" >&5
+echo "configure:7202: 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 6896 "configure"
+#line 7207 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -6919,12 +7230,12 @@ EOF
 
                
        echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
-echo "configure:6923: checking for GNU Pth pthread.h" >&5
+echo "configure:7234: 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 6928 "configure"
+#line 7239 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 #ifdef _POSIX_THREAD_IS_GNU_PTH
@@ -6953,17 +7264,17 @@ echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6957: checking for $ac_hdr" >&5
+echo "configure:7268: 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 6962 "configure"
+#line 7273 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7278: \"$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*
@@ -6993,14 +7304,14 @@ done
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
-echo "configure:6997: checking for pthread_create in default libraries" >&5
+echo "configure:7308: checking for pthread_create in default libraries" >&5
 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7004 "configure"
+#line 7315 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7019,44 +7330,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_create=yes
 else
@@ -7068,7 +7404,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7072 "configure"
+#line 7408 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7091,45 +7427,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:7133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create=yes
 else
@@ -7154,7 +7515,7 @@ echo "$ac_t""$ol_cv_pthread_create" 1>&6
 if test "$ol_link_threads" = no ; then
        # try -kthread
        echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
-echo "configure:7158: checking for pthread link with -kthread" >&5
+echo "configure:7519: 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
@@ -7165,7 +7526,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7169 "configure"
+#line 7530 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7184,44 +7545,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_kthread=yes
 else
@@ -7233,7 +7619,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7237 "configure"
+#line 7623 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7256,45 +7642,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:7298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_kthread=yes
 else
@@ -7324,7 +7735,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -pthread
        echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
-echo "configure:7328: checking for pthread link with -pthread" >&5
+echo "configure:7739: 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
@@ -7335,7 +7746,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7339 "configure"
+#line 7750 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7354,44 +7765,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthread=yes
 else
@@ -7403,7 +7839,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7407 "configure"
+#line 7843 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7426,45 +7862,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:7468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_pthread=yes
 else
@@ -7494,7 +7955,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -pthreads
        echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
-echo "configure:7498: checking for pthread link with -pthreads" >&5
+echo "configure:7959: 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
@@ -7505,7 +7966,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7509 "configure"
+#line 7970 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7524,44 +7985,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthreads=yes
 else
@@ -7573,7 +8059,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7577 "configure"
+#line 8063 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7596,45 +8082,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:7638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_pthreads=yes
 else
@@ -7664,7 +8175,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -mthreads
        echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
-echo "configure:7668: checking for pthread link with -mthreads" >&5
+echo "configure:8179: 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
@@ -7675,7 +8186,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7679 "configure"
+#line 8190 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7694,44 +8205,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_mthreads=yes
 else
@@ -7743,7 +8279,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7747 "configure"
+#line 8283 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7766,45 +8302,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_mthreads=yes
 else
@@ -7834,7 +8395,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -thread
        echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
-echo "configure:7838: checking for pthread link with -thread" >&5
+echo "configure:8399: 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
@@ -7845,7 +8406,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7849 "configure"
+#line 8410 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7864,44 +8425,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_thread=yes
 else
@@ -7913,7 +8499,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7917 "configure"
+#line 8503 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7936,45 +8522,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:7978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_thread=yes
 else
@@ -8005,7 +8616,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -lmach -lexc -lc_r
        echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
-echo "configure:8009: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+echo "configure:8620: 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
@@ -8016,7 +8627,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8020 "configure"
+#line 8631 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8035,44 +8646,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
@@ -8084,7 +8720,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8088 "configure"
+#line 8724 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8107,45 +8743,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:8149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
@@ -8175,7 +8836,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -lmach -lexc
        echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
-echo "configure:8179: checking for pthread link with -lpthread -lmach -lexc" >&5
+echo "configure:8840: 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
@@ -8186,7 +8847,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8190 "configure"
+#line 8851 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8205,44 +8866,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread_lmach_lexc=yes
 else
@@ -8254,7 +8940,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8258 "configure"
+#line 8944 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8277,45 +8963,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:8319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread_lmach_lexc=yes
 else
@@ -8346,7 +9057,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -Wl,-woff,85
        echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
-echo "configure:8350: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+echo "configure:9061: 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
@@ -8357,7 +9068,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8361 "configure"
+#line 9072 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8376,44 +9087,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -8425,7 +9161,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8429 "configure"
+#line 9165 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8448,45 +9184,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:8490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -8517,7 +9278,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread
        echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
-echo "configure:8521: checking for pthread link with -lpthread" >&5
+echo "configure:9282: 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
@@ -8528,7 +9289,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8532 "configure"
+#line 9293 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8547,44 +9308,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread=yes
 else
@@ -8596,7 +9382,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8600 "configure"
+#line 9386 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8619,45 +9405,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:8661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthread=yes
 else
@@ -8687,7 +9498,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lc_r
        echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
-echo "configure:8691: checking for pthread link with -lc_r" >&5
+echo "configure:9502: 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
@@ -8698,7 +9509,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8702 "configure"
+#line 9513 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8717,44 +9528,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lc_r=yes
 else
@@ -8766,7 +9602,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8770 "configure"
+#line 9606 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8789,45 +9625,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:8831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lc_r=yes
 else
@@ -8858,7 +9719,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -threads
        echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
-echo "configure:8862: checking for pthread link with -threads" >&5
+echo "configure:9723: 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
@@ -8869,7 +9730,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8873 "configure"
+#line 9734 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8888,44 +9749,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_threads=yes
 else
@@ -8937,7 +9823,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8941 "configure"
+#line 9827 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8960,45 +9846,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_threads=yes
 else
@@ -9029,7 +9940,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lmach -lexc -lc_r
        echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
-echo "configure:9033: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+echo "configure:9944: 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
@@ -9040,7 +9951,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9044 "configure"
+#line 9955 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9059,44 +9970,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
@@ -9108,7 +10044,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9112 "configure"
+#line 10048 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9131,45 +10067,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
@@ -9199,7 +10160,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lmach -lexc
        echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
-echo "configure:9203: checking for pthread link with -lpthreads -lmach -lexc" >&5
+echo "configure:10164: 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
@@ -9210,7 +10171,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9214 "configure"
+#line 10175 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9229,44 +10190,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
@@ -9278,7 +10264,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9282 "configure"
+#line 10268 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9301,45 +10287,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
@@ -9369,7 +10380,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lexc
        echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
-echo "configure:9373: checking for pthread link with -lpthreads -lexc" >&5
+echo "configure:10384: 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
@@ -9380,7 +10391,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9384 "configure"
+#line 10395 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9399,44 +10410,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10476: \"$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
@@ -9448,7 +10484,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9452 "configure"
+#line 10488 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9471,45 +10507,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lpthreads_lexc=yes
 else
@@ -9540,7 +10601,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads
        echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
-echo "configure:9544: checking for pthread link with -lpthreads" >&5
+echo "configure:10605: 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
@@ -9551,7 +10612,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9555 "configure"
+#line 10616 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9570,44 +10631,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10697: \"$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
@@ -9619,7 +10705,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9623 "configure"
+#line 10709 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9642,45 +10728,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_lib_lpthreads=yes
 else
@@ -9722,12 +10833,12 @@ EOF
                                                                                                for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9726: checking for $ac_func" >&5
+echo "configure:10837: 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 9731 "configure"
+#line 10842 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9751,7 +10862,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10866: \"$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
@@ -9779,7 +10890,7 @@ done
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no ; then
                                                                echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:9783: checking for sched_yield in -lrt" >&5
+echo "configure:10894: 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
@@ -9787,7 +10898,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9791 "configure"
+#line 10902 "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
@@ -9798,7 +10909,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:9802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10913: \"$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
                                                                                                for ac_func in thr_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9834: checking for $ac_func" >&5
+echo "configure:10945: 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 9839 "configure"
+#line 10950 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9859,7 +10970,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10974: \"$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
@@ -9893,12 +11004,12 @@ done
                                                for ac_func in pthread_kill pthread_rwlock_destroy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9897: checking for $ac_func" >&5
+echo "configure:11008: 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 9902 "configure"
+#line 11013 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9922,7 +11033,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11037: \"$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
@@ -9948,13 +11059,13 @@ done
 
 
                                                                        echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:9952: checking for pthread_detach with <pthread.h>" >&5
+echo "configure:11063: 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 9958 "configure"
+#line 11069 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -9966,7 +11077,7 @@ int main() {
 pthread_detach(NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:9970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11081: \"$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
@@ -9998,12 +11109,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10002: checking for $ac_func" >&5
+echo "configure:11113: 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 10007 "configure"
+#line 11118 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10027,7 +11138,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11142: \"$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
@@ -10056,12 +11167,12 @@ done
        for ac_func in pthread_kill_other_threads_np
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10060: checking for $ac_func" >&5
+echo "configure:11171: 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 10065 "configure"
+#line 11176 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10085,7 +11196,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11200: \"$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
@@ -10110,7 +11221,7 @@ fi
 done
 
        echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
-echo "configure:10114: checking for LinuxThreads implementation" >&5
+echo "configure:11225: 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
@@ -10123,7 +11234,7 @@ echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
        
        
        echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
-echo "configure:10127: checking for LinuxThreads consistency" >&5
+echo "configure:11238: checking for LinuxThreads consistency" >&5
 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10148,7 +11259,7 @@ echo "$ac_t""$ol_cv_linux_threads" 1>&6
                        fi
 
                        echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:10152: checking if pthread_create() works" >&5
+echo "configure:11263: 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
@@ -10157,7 +11268,7 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 10161 "configure"
+#line 11272 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -10180,45 +11291,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
+       if( status ) return status;
 
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
-
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:10222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create_works=yes
 else
@@ -10240,7 +11376,7 @@ echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
 
                                                if test $ol_with_yielding_select = auto ; then
                                echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:10244: checking if select yields when using pthreads" >&5
+echo "configure:11380: 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
@@ -10249,7 +11385,7 @@ else
   ol_cv_pthread_select_yields=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10253 "configure"
+#line 11389 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10325,7 +11461,7 @@ int main(argc, argv)
        exit(2);
 }
 EOF
-if { (eval echo configure:10329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_select_yields=no
 else
@@ -10353,7 +11489,7 @@ echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
                                                CPPFLAGS="$save_CPPFLAGS"
                        LIBS="$save_LIBS"
                else
-                       { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
+                       { echo "configure: error: could not locate usable 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
+               for ac_hdr in mach/cthreads.h cthread.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10373: checking for $ac_hdr" >&5
+echo "configure:11509: 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 10378 "configure"
+#line 11514 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11519: \"$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*
@@ -10409,12 +11545,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:10413: checking for cthread_fork" >&5
+echo "configure:11549: 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 10418 "configure"
+#line 11554 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -10438,7 +11574,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11578: \"$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
@@ -10460,7 +11596,7 @@ fi
 
                if test $ol_link_threads = no ; then
                                                                        echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
-echo "configure:10464: checking for cthread_fork with -all_load" >&5
+echo "configure:11600: 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
@@ -10468,7 +11604,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 10472 "configure"
+#line 11608 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -10477,7 +11613,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:10481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11617: \"$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
@@ -10499,20 +11635,82 @@ echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
                        fi
                fi
 
-               if test $ol_link_threads != no ; then
-                       : check for cthread specific functionality here
-                       cat >> confdefs.h <<\EOF
-#define HAVE_MACH_CTHREADS 1
+    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:11646: 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 11651 "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:11675: \"$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
                else
                        { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
                fi
-       fi
 
-       if test $ol_with_threads = mach ; then
+       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 \
@@ -10522,17 +11720,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10526: checking for $ac_hdr" >&5
+echo "configure:11724: 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 10531 "configure"
+#line 11729 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11734: \"$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*
@@ -10561,7 +11759,7 @@ 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:10565: checking for pth_version in -lpth" >&5
+echo "configure:11763: 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
@@ -10569,7 +11767,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10573 "configure"
+#line 11771 "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
@@ -10580,7 +11778,7 @@ int main() {
 pth_version()
 ; return 0; }
 EOF
-if { (eval echo configure:10584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11782: \"$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
@@ -10624,17 +11822,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10628: checking for $ac_hdr" >&5
+echo "configure:11826: 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 10633 "configure"
+#line 11831 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11836: \"$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*
@@ -10662,7 +11860,7 @@ done
 
        if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
                echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
-echo "configure:10666: checking for thr_create in -lthread" >&5
+echo "configure:11864: 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
@@ -10670,7 +11868,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10674 "configure"
+#line 11872 "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
@@ -10681,7 +11879,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:10685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11883: \"$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
@@ -10721,12 +11919,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10725: checking for $ac_func" >&5
+echo "configure:11923: 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 10730 "configure"
+#line 11928 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10750,7 +11948,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11952: \"$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
@@ -10781,17 +11979,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10785: checking for $ac_hdr" >&5
+echo "configure:11983: 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 10790 "configure"
+#line 11988 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11993: \"$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*
@@ -10819,7 +12017,7 @@ done
 
        if test $ac_cv_header_lwp_lwp_h = yes ; then
                echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
-echo "configure:10823: checking for lwp_create in -llwp" >&5
+echo "configure:12021: 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
@@ -10827,7 +12025,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10831 "configure"
+#line 12029 "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
@@ -10838,7 +12036,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:10842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12040: \"$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
@@ -10891,17 +12089,17 @@ if test $ol_with_threads = manual ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10895: checking for $ac_hdr" >&5
+echo "configure:12093: 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 10900 "configure"
+#line 12098 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12103: \"$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*
@@ -10930,12 +12128,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10934: checking for $ac_func" >&5
+echo "configure:12132: 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 10939 "configure"
+#line 12137 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10959,7 +12157,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12161: \"$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
@@ -10985,12 +12183,12 @@ done
 
        
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:10989: checking for LinuxThreads pthread.h" >&5
+echo "configure:12187: 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 10994 "configure"
+#line 12192 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -11020,17 +12218,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11024: checking for $ac_hdr" >&5
+echo "configure:12222: 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 11029 "configure"
+#line 12227 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12232: \"$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*
@@ -11060,17 +12258,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11064: checking for $ac_hdr" >&5
+echo "configure:12262: 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 11069 "configure"
+#line 12267 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12272: \"$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*
@@ -11100,17 +12298,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11104: checking for $ac_hdr" >&5
+echo "configure:12302: 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 11109 "configure"
+#line 12307 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12312: \"$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*
@@ -11169,20 +12367,20 @@ EOF
 
 
                        echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:11173: checking for thread specific errno" >&5
+echo "configure:12371: 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 11179 "configure"
+#line 12377 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_errno_thread_specific=yes
 else
 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
 
                        echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
-echo "configure:11202: checking for thread specific h_errno" >&5
+echo "configure:12400: 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 11208 "configure"
+#line 12406 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 h_errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_h_errno_thread_specific=yes
 else
@@ -11270,17 +12468,17 @@ 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:11274: checking for $ac_hdr" >&5
+echo "configure:12472: 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 11279 "configure"
+#line 12477 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12482: \"$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*
@@ -11308,13 +12506,13 @@ 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:11312: checking if Berkeley DB header compatibility" >&5
+echo "configure:12510: 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 11318 "configure"
+#line 12516 "configure"
 #include "confdefs.h"
 
 #if HAVE_DB_185_H
 
 echo "$ac_t""$ol_cv_header_db1" 1>&6
 
-       if test ol_cv_header_db1=yes ; then
+       if test $ol_cv_header_db1 = yes ; then
                ol_cv_lib_db=no
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
-echo "configure:11355: checking for Berkeley DB link (default)" >&5
+echo "configure:12553: 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
@@ -11361,7 +12559,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11365 "configure"
+#line 12563 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11380,6 +12578,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11390,7 +12606,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -11414,7 +12630,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:11418: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:12634: 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
@@ -11424,7 +12640,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11428 "configure"
+#line 12644 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11443,6 +12659,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11453,7 +12687,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -11477,7 +12711,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:11481: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:12715: 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
@@ -11487,7 +12721,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11491 "configure"
+#line 12725 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11506,6 +12740,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11516,7 +12768,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -11540,7 +12792,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:11544: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:12796: 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
@@ -11550,7 +12802,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11554 "configure"
+#line 12806 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11569,6 +12821,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11579,7 +12849,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -11603,7 +12873,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:11607: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:12877: 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
@@ -11613,7 +12883,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11617 "configure"
+#line 12887 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11632,6 +12902,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11642,7 +12930,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -11677,17 +12965,17 @@ for ac_hdr in db.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11681: checking for $ac_hdr" >&5
+echo "configure:12969: 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 11686 "configure"
+#line 12974 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12979: \"$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*
@@ -11717,7 +13005,7 @@ 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:11721: checking for Berkeley DB link (default)" >&5
+echo "configure:13009: 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
@@ -11727,7 +13015,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11731 "configure"
+#line 13019 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11746,6 +13034,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11756,7 +13062,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -11780,7 +13086,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:11784: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:13090: 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
@@ -11790,7 +13096,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11794 "configure"
+#line 13100 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11809,6 +13115,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11819,7 +13143,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -11843,7 +13167,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:11847: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:13171: 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
@@ -11853,7 +13177,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11857 "configure"
+#line 13181 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11872,6 +13196,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11882,7 +13224,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -11906,7 +13248,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:11910: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:13252: 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
@@ -11916,7 +13258,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11920 "configure"
+#line 13262 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11935,6 +13277,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -11945,7 +13305,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -11969,7 +13329,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:11973: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:13333: 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
@@ -11979,7 +13339,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11983 "configure"
+#line 13343 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11998,6 +13358,24 @@ else
 
 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"
+                               "\texpected: %s\n\tgot: %s\n",
+                               DB_VERSION_STRING, version);
+                       return 1;
+               }
+       }
+#endif
+
 #if DB_VERSION_MAJOR > 2
        db_env_create( NULL, 0 );
 #elif DB_VERSION_MAJOR > 1
@@ -12008,7 +13386,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -12034,7 +13412,7 @@ fi
        if test "$ol_cv_lib_db" != no ; then
                ol_cv_berkeley_db=yes
                echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
-echo "configure:12038: checking for Berkeley DB thread support" >&5
+echo "configure:13416: 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
@@ -12048,7 +13426,7 @@ else
   ol_cv_berkeley_db_thread=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 12052 "configure"
+#line 13430 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -12062,16 +13440,40 @@ else
 main()
 {
        int rc;
-       u_int32_t flags = DB_CREATE | DB_THREAD;
-
+       u_int32_t flags = DB_CREATE |
+#ifdef DB_PRIVATE
+               DB_PRIVATE |
+#endif
+               DB_THREAD;
 
 #if DB_VERSION_MAJOR > 2
        DB_ENV *env = NULL;
 
        rc = db_env_create( &env, 0 );
 
-       if( rc == 0 ) {
-               rc = env->open( env, NULL, NULL, flags, 0 );
+       flags |= DB_INIT_MPOOL;
+#ifdef DB_MPOOL_PRIVATE
+       flags |= DB_MPOOL_PRIVATE;
+#endif
+
+       if( rc ) {
+               printf("BerkeleyDB: %s\n", db_strerror(rc) );
+               return rc;
+       }
+
+#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
+       rc = env->open( env, NULL, flags, 0 );
+#else
+       rc = env->open( env, NULL, NULL, flags, 0 );
+#endif
+
+       if ( rc == 0 ) {
+               rc = env->close( env, 0 );
+       }
+
+       if( rc ) {
+               printf("BerkeleyDB: %s\n", db_strerror(rc) );
+               return rc;
        }
 
 #else
@@ -12083,12 +13485,15 @@ main()
        if( rc == 0 ) {
                db_appexit( &env );
        }
+
+       unlink("__db_mpool.share");
+       unlink("__db_lock.share");
 #endif
 
        return rc;
 }
 EOF
-if { (eval echo configure:12092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_berkeley_db_thread=yes
 else
 
 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:12156: checking for MDBM library" >&5
+echo "configure:13561: 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:12162: checking for mdbm_set_chain" >&5
+echo "configure:13567: 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 12167 "configure"
+#line 13572 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mdbm_set_chain(); below.  */
@@ -12187,7 +13592,7 @@ f = mdbm_set_chain;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13596: \"$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
@@ -12206,7 +13611,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
-echo "configure:12210: checking for mdbm_set_chain in -lmdbm" >&5
+echo "configure:13615: 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
@@ -12214,7 +13619,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12218 "configure"
+#line 13623 "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
@@ -12225,7 +13630,7 @@ int main() {
 mdbm_set_chain()
 ; return 0; }
 EOF
-if { (eval echo configure:12229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13634: \"$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
@@ -12260,17 +13665,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:12264: checking for $ac_hdr" >&5
+echo "configure:13669: 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 12269 "configure"
+#line 13674 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13679: \"$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*
@@ -12297,7 +13702,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12301: checking for db" >&5
+echo "configure:13706: 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:12334: checking for GDBM library" >&5
+echo "configure:13739: 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:12340: checking for gdbm_open" >&5
+echo "configure:13745: 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 12345 "configure"
+#line 13750 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -12365,7 +13770,7 @@ f = gdbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13774: \"$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
@@ -12384,7 +13789,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:12388: checking for gdbm_open in -lgdbm" >&5
+echo "configure:13793: 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
@@ -12392,7 +13797,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12396 "configure"
+#line 13801 "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
@@ -12403,7 +13808,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13812: \"$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
@@ -12438,17 +13843,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:12442: checking for $ac_hdr" >&5
+echo "configure:13847: 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 12447 "configure"
+#line 13852 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13857: \"$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*
@@ -12475,7 +13880,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12479: checking for db" >&5
+echo "configure:13884: 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:12513: checking for NDBM library" >&5
+echo "configure:13918: 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:12519: checking for dbm_open" >&5
+echo "configure:13924: 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 12524 "configure"
+#line 13929 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -12544,7 +13949,7 @@ f = dbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13953: \"$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
@@ -12563,7 +13968,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:12567: checking for dbm_open in -lndbm" >&5
+echo "configure:13972: 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
@@ -12571,7 +13976,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12575 "configure"
+#line 13980 "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
@@ -12582,7 +13987,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13991: \"$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
@@ -12602,7 +14007,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:12606: checking for dbm_open in -ldbm" >&5
+echo "configure:14011: 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
@@ -12610,7 +14015,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12614 "configure"
+#line 14019 "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
@@ -12621,7 +14026,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14030: \"$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
@@ -12658,17 +14063,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:12662: checking for $ac_hdr" >&5
+echo "configure:14067: 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 12667 "configure"
+#line 14072 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14077: \"$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*
@@ -12695,7 +14100,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12699: checking for db" >&5
+echo "configure:14104: checking for db" >&5
 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12748,17 +14153,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:12752: checking for $ac_hdr" >&5
+echo "configure:14157: 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 12757 "configure"
+#line 14162 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14167: \"$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*
@@ -12789,7 +14194,7 @@ done
                have_wrappers=no
        else
                cat > conftest.$ac_ext <<EOF
-#line 12793 "configure"
+#line 14198 "configure"
 #include "confdefs.h"
 
 int allow_severity = 0;
@@ -12799,7 +14204,7 @@ int main() {
 hosts_access()
 ; return 0; }
 EOF
-if { (eval echo configure:12803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   have_wrappers=yes
 else
@@ -12819,7 +14224,7 @@ EOF
                WRAP_LIBS="-lwrap"
 
                                                echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:12823: checking for main in -lnsl" >&5
+echo "configure:14228: 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
@@ -12827,14 +14232,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12831 "configure"
+#line 14236 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:12838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14243: \"$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
 
 if test $ol_enable_syslog != no ; then
        echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:12879: checking for openlog" >&5
+echo "configure:14284: 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 12884 "configure"
+#line 14289 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -12904,7 +14309,7 @@ f = openlog;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14313: \"$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
        ol_enable_syslog=$ac_cv_func_openlog
 fi
 
+ol_link_sql=no
+if test $ol_enable_sql != no ; then
+       echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
+echo "configure:14341: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-liodbc  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 14349 "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 SQLDriverConnect();
+
+int main() {
+SQLDriverConnect()
+; return 0; }
+EOF
+if { (eval echo configure:14360: \"$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_iodbc=yes
+else
+  echo "$ac_t""no" 1>&6
+have_iodbc=no
+fi
+
+       if test $have_iodbc = yes ; then
+               ol_link_sql="-liodbc"
+       else
+               echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
+echo "configure:14385: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lodbc  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 14393 "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 SQLDriverConnect();
+
+int main() {
+SQLDriverConnect()
+; return 0; }
+EOF
+if { (eval echo configure:14404: \"$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_odbc=yes
+else
+  echo "$ac_t""no" 1>&6
+have_odbc=no
+fi
+
+               if test $have_odbc = yes ; then
+                       ol_link_sql="-lodbc"
+               fi
+       fi
+
+       if test $ol_link_sql != no ; then
+               SLAPD_SQL_LIBS="$ol_link_sql"
+
+       elif test $ol_enable_sql != auto ; then
+               { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
+       fi
+fi
+
 ol_link_termcap=no
 for ac_hdr in termcap.h ncurses.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:12938: checking for $ac_hdr" >&5
+echo "configure:14443: 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 12943 "configure"
+#line 14448 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14453: \"$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*
@@ -12973,7 +14478,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:12977: checking for tputs in -ltermcap" >&5
+echo "configure:14482: checking for tputs in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -12981,7 +14486,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12985 "configure"
+#line 14490 "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
@@ -12992,7 +14497,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:12996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14501: \"$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
@@ -13025,7 +14530,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:13029: checking for initscr in -lncurses" >&5
+echo "configure:14534: checking for initscr in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13033,7 +14538,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13037 "configure"
+#line 14542 "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
@@ -13044,7 +14549,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:13048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14553: \"$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
 ol_link_sasl=no
 ol_link_spasswd=no
 if test $ol_with_cyrus_sasl != no ; then
-       ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
-echo "configure:13092: checking for sasl.h" >&5
+       for ac_hdr in sasl.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:14599: 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 13097 "configure"
+#line 14604 "configure"
 #include "confdefs.h"
-#include <sasl.h>
+#include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14609: \"$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*
@@ -13114,15 +14621,20 @@ 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_sasl_h = yes ; then
                echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
-echo "configure:13126: checking for sasl_client_init in -lsasl" >&5
+echo "configure:14638: 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
@@ -13130,7 +14642,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13134 "configure"
+#line 14646 "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
@@ -13141,7 +14653,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:13145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14657: \"$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
@@ -13173,8 +14685,25 @@ EOF
                fi
        fi
 
-       if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
-               { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
+       if test $ol_link_sasl = no ; then
+               if test $ol_with_cyrus_sasl != auto ; then
+                       { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
+               else
+                       echo "configure: warning: Could not locate Cyrus SASL" 1>&2
+                       echo "configure: warning: SASL authentication not supported!" 1>&2
+                       if test $ol_link_tls = no ; then
+                               echo "configure: warning: Strong authentication not supported!" 1>&2
+                       fi
+               fi
+
+       elif test $ol_enable_spasswd != no ; then
+               ol_link_spasswd=yes
+       fi
+
+else
+       echo "configure: warning: SASL authentication not supported!" 1>&2
+       if test $ol_link_tls = no ; then
+               echo "configure: warning: Strong authentication not supported!" 1>&2
        fi
 fi
 
@@ -13205,13 +14734,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:13209: checking fetch(3) library" >&5
+echo "configure:14738: 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 13215 "configure"
+#line 14744 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -13221,7 +14750,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:13225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_lib_fetch=yes
 else
@@ -13259,17 +14788,17 @@ if test $ol_with_readline != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:13263: checking for $ac_hdr" >&5
+echo "configure:14792: 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 13268 "configure"
+#line 14797 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14802: \"$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*
@@ -13300,7 +14829,7 @@ done
                save_LIBS="$LIBS"
                LIBS="$TERMCAP_LIBS $LIBS"
                echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:13304: checking for readline in -lreadline" >&5
+echo "configure:14833: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -13308,7 +14837,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13312 "configure"
+#line 14841 "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
@@ -13319,7 +14848,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:13323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14852: \"$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
 
 if test $ol_enable_crypt != no ; then
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:13365: checking for crypt" >&5
+echo "configure:14894: 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 13370 "configure"
+#line 14899 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -13390,7 +14919,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14923: \"$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
@@ -13409,7 +14938,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:13413: checking for crypt in -lcrypt" >&5
+echo "configure:14942: 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
@@ -13417,7 +14946,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13421 "configure"
+#line 14950 "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
@@ -13428,7 +14957,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:13432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14961: \"$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
 
 if test $ol_enable_proctitle != no ; then
        echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:13475: checking for setproctitle" >&5
+echo "configure:15004: 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 13480 "configure"
+#line 15009 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -13500,7 +15029,7 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15033: \"$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
@@ -13519,7 +15048,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:13523: checking for setproctitle in -lutil" >&5
+echo "configure:15052: 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
@@ -13527,7 +15056,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13531 "configure"
+#line 15060 "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
@@ -13538,7 +15067,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:13542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15071: \"$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
@@ -13574,12 +15103,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:13578: checking for ANSI C header files" >&5
+echo "configure:15107: 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 13583 "configure"
+#line 15112 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -13587,7 +15116,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15120: \"$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*
@@ -13604,7 +15133,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 13608 "configure"
+#line 15137 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -13622,7 +15151,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 13626 "configure"
+#line 15155 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -13643,7 +15172,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 13647 "configure"
+#line 15176 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -13661,7 +15190,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:13665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -13685,12 +15214,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:13689: checking for mode_t" >&5
+echo "configure:15218: 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 13694 "configure"
+#line 15223 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13721,12 +15250,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:13725: checking for off_t" >&5
+echo "configure:15254: 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 13730 "configure"
+#line 15259 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13757,12 +15286,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:13761: checking for pid_t" >&5
+echo "configure:15290: 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 13766 "configure"
+#line 15295 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13793,19 +15322,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:13797: checking for ptrdiff_t" >&5
+echo "configure:15326: 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 13802 "configure"
+#line 15331 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:13809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -13826,12 +15355,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:13830: checking return type of signal handlers" >&5
+echo "configure:15359: 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 13835 "configure"
+#line 15364 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -13848,7 +15377,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:13852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -13867,12 +15396,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:13871: checking for size_t" >&5
+echo "configure:15400: 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 13876 "configure"
+#line 15405 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:13908: checking for ssize_t" >&5
+echo "configure:15437: 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 13913 "configure"
+#line 15442 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13940,12 +15469,12 @@ EOF
 fi
 
 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
-echo "configure:13944: checking for caddr_t" >&5
+echo "configure:15473: 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 13949 "configure"
+#line 15478 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:13981: checking for socklen_t" >&5
+echo "configure:15510: 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 13986 "configure"
+#line 15515 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -13996,7 +15525,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:14000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_socklen_t=yes
 else
@@ -14017,12 +15546,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:14021: checking for member st_blksize in aggregate type struct stat" >&5
+echo "configure:15550: 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 14026 "configure"
+#line 15555 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -14030,7 +15559,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:14034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_struct_member_st_blksize=yes
 else
@@ -14052,12 +15581,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:14056: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:15585: 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 14061 "configure"
+#line 15590 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -14066,7 +15595,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:14070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -14087,12 +15616,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:14091: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:15620: 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 14096 "configure"
+#line 15625 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -14100,7 +15629,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:14104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -14121,12 +15650,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:14125: checking for uid_t in sys/types.h" >&5
+echo "configure:15654: 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 14130 "configure"
+#line 15659 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -14155,19 +15684,19 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:14159: checking for sig_atomic_t" >&5
+echo "configure:15688: 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 14164 "configure"
+#line 15693 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:14171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_sig_atomic_t=yes
 else
@@ -14191,13 +15720,13 @@ EOF
 
 # test for pw_gecos in struct passwd
 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
-echo "configure:14195: checking struct passwd for pw_gecos" >&5
+echo "configure:15724: 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 14201 "configure"
+#line 15730 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -14207,7 +15736,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15740: \"$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:14233: checking struct passwd for pw_passwd" >&5
+echo "configure:15762: 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 14239 "configure"
+#line 15768 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -14245,7 +15774,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_passwd=yes
 else
@@ -14267,7 +15796,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:14271: checking if toupper() requires islower()" >&5
+echo "configure:15800: 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
@@ -14276,7 +15805,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 14280 "configure"
+#line 15809 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -14288,7 +15817,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:14292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_c_upper_lower=no
 else
@@ -14311,12 +15840,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:14315: checking for working const" >&5
+echo "configure:15844: 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 14320 "configure"
+#line 15849 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -14365,7 +15894,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -14386,12 +15915,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:14390: checking if compiler understands volatile" >&5
+echo "configure:15919: 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 14395 "configure"
+#line 15924 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -14400,7 +15929,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:14404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -14430,14 +15959,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:14434: checking whether byte ordering is bigendian" >&5
+echo "configure:15963: 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 14441 "configure"
+#line 15970 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -14448,11 +15977,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15981: \"$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 14456 "configure"
+#line 15985 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -14463,7 +15992,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -14483,7 +16012,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 14487 "configure"
+#line 16016 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -14496,7 +16025,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 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:16029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
 fi
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:14526: checking size of short" >&5 
+echo "configure:16055: 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 14532 "configure"
+#line 16061 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14538,7 +16067,7 @@ int main() {
 switch (0) case 0: case (sizeof (short) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_short=$ac_size
 else
@@ -14561,13 +16090,13 @@ EOF
  
  
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:14565: checking size of int" >&5 
+echo "configure:16094: 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 14571 "configure"
+#line 16100 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14577,7 +16106,7 @@ int main() {
 switch (0) case 0: case (sizeof (int) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_int=$ac_size
 else
@@ -14600,13 +16129,13 @@ EOF
  
  
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:14604: checking size of long" >&5 
+echo "configure:16133: 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 14610 "configure"
+#line 16139 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14616,7 +16145,7 @@ int main() {
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long=$ac_size
 else
@@ -14667,7 +16196,7 @@ EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:14671: checking for 8-bit clean memcmp" >&5
+echo "configure:16200: 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
@@ -14675,7 +16204,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 14679 "configure"
+#line 16208 "configure"
 #include "confdefs.h"
 
 main()
@@ -14685,7 +16214,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:14689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -14703,12 +16232,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:14707: checking for strftime" >&5
+echo "configure:16236: 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 14712 "configure"
+#line 16241 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -14732,7 +16261,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16265: \"$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
@@ -14754,7 +16283,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:14758: checking for strftime in -lintl" >&5
+echo "configure:16287: 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
@@ -14762,7 +16291,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14766 "configure"
+#line 16295 "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
@@ -14773,7 +16302,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:14777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16306: \"$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:14805: checking for inet_aton()" >&5
+echo "configure:16334: 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 14810 "configure"
+#line 16339 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -14828,7 +16357,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:14832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16361: \"$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
@@ -14850,12 +16379,12 @@ EOF
  
 
 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
-echo "configure:14854: checking for _spawnlp" >&5
+echo "configure:16383: 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 14859 "configure"
+#line 16388 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _spawnlp(); below.  */
@@ -14879,7 +16408,7 @@ f = _spawnlp;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16412: \"$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:14907: checking for _snprintf" >&5
+echo "configure:16436: 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 14912 "configure"
+#line 16441 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _snprintf(); below.  */
@@ -14932,7 +16461,7 @@ f = _snprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16465: \"$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:14962: checking for _vsnprintf" >&5
+echo "configure:16491: 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 14967 "configure"
+#line 16496 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _vsnprintf(); below.  */
@@ -14987,7 +16516,7 @@ f = _vsnprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16520: \"$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:15017: checking for vprintf" >&5
+echo "configure:16546: 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 15022 "configure"
+#line 16551 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -15042,7 +16571,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16575: \"$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:15070: checking for _doprnt" >&5
+echo "configure:16599: 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 15075 "configure"
+#line 16604 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -15095,7 +16624,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16628: \"$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
@@ -15124,12 +16653,12 @@ if test $ac_cv_func_vprintf = yes ; then
                for ac_func in vsnprintf vsprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15128: checking for $ac_func" >&5
+echo "configure:16657: 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 15133 "configure"
+#line 16662 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15153,7 +16682,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16686: \"$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
@@ -15185,6 +16714,7 @@ for ac_func in \
        chroot                  \
        endgrent                \
        endpwent                \
+       fcntl                   \
        flock                   \
        getdtablesize   \
        getgrgid                \
@@ -15213,7 +16743,6 @@ for ac_func in \
        sigaction               \
        signal                  \
        sigset                  \
-       snprintf                \
        strdup                  \
        strerror                \
        strpbrk                 \
@@ -15224,6 +16753,7 @@ for ac_func in \
        strtoul                 \
        strspn                  \
        sysconf                 \
+       usleep                  \
        waitpid                 \
        wait4                   \
        write                   \
@@ -15232,12 +16762,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15236: checking for $ac_func" >&5
+echo "configure:16766: 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 15241 "configure"
+#line 16771 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15261,7 +16791,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16795: \"$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
@@ -15289,12 +16819,12 @@ done
 for ac_func in getopt tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15293: checking for $ac_func" >&5
+echo "configure:16823: 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 15298 "configure"
+#line 16828 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15318,7 +16848,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16852: \"$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
 
 # Check Configuration
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:15359: checking declaration of sys_errlist" >&5
+echo "configure:16889: 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 15365 "configure"
+#line 16895 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -15374,7 +16904,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:15378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16908: \"$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
@@ -15397,20 +16927,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:15401: checking existence of sys_errlist" >&5
+echo "configure:16931: 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 15407 "configure"
+#line 16937 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:15414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16944: \"$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
@@ -15444,12 +16974,6 @@ if test "$ol_enable_syslog" = yes ; then
 #define LDAP_SYSLOG 1
 EOF
 
-fi
-if test "$ol_enable_libui" = yes ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_LIBUI 1
-EOF
-
 fi
 if test "$ol_enable_cache" = no ; then
        cat >> confdefs.h <<\EOF
@@ -15475,19 +16999,13 @@ if test "$ol_enable_referrals" != no ; then
 EOF
 
 fi
-if test "$ol_enable_cldap" != no ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_CONNECTIONLESS 1
-EOF
-
-fi
-if test "$ol_enable_unix" != no; then
+if test "$ol_enable_local" != no; then
        cat >> confdefs.h <<\EOF
-#define LDAP_PF_UNIX 1
+#define LDAP_PF_LOCAL 1
 EOF
 
 fi
-if test "$ol_enable_ipv6" != no; then
+if test "$ol_link_ipv6" != no; then
        cat >> confdefs.h <<\EOF
 #define LDAP_PF_INET6 1
 EOF
@@ -15516,12 +17034,6 @@ if test "$ol_link_spasswd" != no ; then
 #define SLAPD_SPASSWD 1
 EOF
 
-fi
-if test "$ol_enable_multimaster" != no ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_MULTIMASTER 1
-EOF
-
 fi
 if test "$ol_enable_phonetic" != no ; then
        cat >> confdefs.h <<\EOF
@@ -15641,6 +17153,24 @@ EOF
        fi
 fi
 
+if test "$ol_enable_sql" != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_SQL 1
+EOF
+
+       BUILD_SLAPD=yes
+       BUILD_SQL=yes
+       if test "$ol_with_sql_module" != static; then
+               cat >> confdefs.h <<\EOF
+#define SLAPD_SQL_DYNAMIC 1
+EOF
+
+               BUILD_SQL=mod
+               BUILD_SQL_DYNAMIC=shared
+               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
+       fi
+fi
+
 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
        $BUILD_SLAPD = yes ; then
        BUILD_SLURPD=yes
   
   
   
+  
+
+
+
 
 
 
@@ -15789,7 +17323,6 @@ libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.
 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk     \
 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \
 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \
-libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk \
 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk       \
 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
@@ -15798,6 +17331,7 @@ servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.i
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
 servers/slapd/back-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/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
@@ -15805,7 +17339,6 @@ tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
-contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
@@ -15871,6 +17404,7 @@ s%@SET_MAKE@%$SET_MAKE%g
 s%@top_builddir@%$top_builddir%g
 s%@ldap_subdir@%$ldap_subdir%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
 s%@RANLIB@%$RANLIB%g
 s%@LN_S@%$LN_S%g
 s%@DLLTOOL@%$DLLTOOL%g
@@ -15897,18 +17431,18 @@ s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
 s%@BUILD_LDAP@%$BUILD_LDAP%g
 s%@BUILD_LDBM@%$BUILD_LDBM%g
 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
-s%@BUILD_QUIPU@%$BUILD_QUIPU%g
 s%@BUILD_SHELL@%$BUILD_SHELL%g
+s%@BUILD_SQL@%$BUILD_SQL%g
 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
+s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
 s%@LDAP_LIBS@%$LDAP_LIBS%g
 s%@LDIF_LIBS@%$LDIF_LIBS%g
 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
-s%@QUIPU_LIBS@%$QUIPU_LIBS%g
 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
 s%@LDBM_LIBS@%$LDBM_LIBS%g
 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
@@ -15926,6 +17460,9 @@ s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
 s%@TLS_LIBS@%$TLS_LIBS%g
 s%@MODULES_LIBS@%$MODULES_LIBS%g
 s%@AUTH_LIBS@%$AUTH_LIBS%g
+s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
+s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
+s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
 
 CEOF
 EOF
@@ -15992,7 +17529,6 @@ libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.
 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk     \
 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk \
 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \
-libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk \
 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk       \
 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
@@ -16001,6 +17537,7 @@ servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.i
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
 servers/slapd/back-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/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
@@ -16008,7 +17545,6 @@ tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
-contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
 "}
 EOF
 cat >> $CONFIG_STATUS <<\EOF