]> git.sur5r.net Git - openldap/blobdiff - configure
Prepare for release
[openldap] / configure
index a7081341932010f85543ebe0525265701fa825d4..abbc879967d78a4d791a7f66bd545b2b064aa15e 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,15 +1,16 @@
 #! /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 "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.
@@ -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-ipv6          enable IPv6 support (auto)"
+  --enable-ipv6          enable IPv6 support [auto]"
 ac_help="$ac_help
-  --enable-local         enable AF_LOCAL (AF_UNIX) socket support (auto)"
+  --enable-local         enable AF_LOCAL (AF_UNIX) socket support [auto]"
 ac_help="$ac_help
-  --enable-x-compile     enable cross compiling (no)"
+  --enable-x-compile     enable cross compiling [no]"
 ac_help="$ac_help
-  --with-cyrus-sasl      with Cyrus SASL support (auto)"
+  --with-cyrus-sasl      with Cyrus SASL support [auto]"
 ac_help="$ac_help
-  --with-fetch           with fetch URL support (auto)"
+  --with-fetch           with fetch URL support [auto]"
 ac_help="$ac_help
-  --with-kerberos        with support (auto)"
+  --with-kerberos        with Kerberos support [auto]"
 ac_help="$ac_help
-  --with-readline        with readline support (auto)"
+  --with-readline        with readline support [auto]"
 ac_help="$ac_help
-  --with-threads         with threads (auto)"
+  --with-threads         with threads [auto]"
 ac_help="$ac_help
-  --with-tls             with TLS/SSL support (auto)"
+  --with-tls             with TLS/SSL support [auto]"
 ac_help="$ac_help
-  --with-yielding-select  with implicitly yielding select (auto)"
+  --with-yielding-select  with implicitly yielding select [auto]"
 ac_help="$ac_help
 SLAPD (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-rlookups    enable reverse lookups (auto)"
+    --enable-aci         enable per-object ACIs [no]"
 ac_help="$ac_help
-    --enable-aci         enable per-object ACIs (no)"
+    --enable-wrappers    enable tcp wrapper support [no]"
 ac_help="$ac_help
-    --enable-wrappers    enable tcp wrapper support (no)"
+    --enable-dynamic     enable linking built binaries with dynamic libs [no]"
 ac_help="$ac_help
-    --enable-dynamic     enable linking built binaries with dynamic libs (no)"
+    --enable-dnssrv      enable dnssrv backend [no]"
 ac_help="$ac_help
-    --enable-dnssrv      enable dnssrv backend (no)"
+    --with-dnssrv-module  module type [static]"
 ac_help="$ac_help
-    --with-dnssrv-module  module type (static)"
+    --enable-ldap        enable ldap backend [no]"
 ac_help="$ac_help
-    --enable-ldap        enable ldap backend (no)"
+    --with-ldap-module   module type [static]"
 ac_help="$ac_help
-    --with-ldap-module   module type (static)"
+    --enable-ldbm        enable ldbm backend [yes]"
 ac_help="$ac_help
-    --enable-ldbm        enable ldbm backend (yes)"
+    --with-ldbm-api       with LDBM API [auto]"
 ac_help="$ac_help
-    --with-ldbm-api       with LDBM API (auto)"
+    --with-ldbm-module   module type [static]"
 ac_help="$ac_help
-    --with-ldbm-module   module type (static)"
+    --with-ldbm-type     use LDBM type [auto]"
 ac_help="$ac_help
-    --with-ldbm-type     use LDBM type (auto)"
+    --enable-passwd      enable passwd backend [no]"
 ac_help="$ac_help
-    --enable-passwd      enable passwd backend (no)"
+    --with-passwd-module  module type [static]"
 ac_help="$ac_help
-    --with-passwd-module  module type (static)"
+    --enable-shell       enable shell backend [no]"
 ac_help="$ac_help
-    --enable-shell       enable shell backend (no)"
+    --with-shell-module          module type [static]"
 ac_help="$ac_help
-    --with-shell-module          module type (static)"
+    --enable-sql         enable sql backend [no]"
 ac_help="$ac_help
-    --enable-sql         enable sql backend (no)"
-ac_help="$ac_help
-    --with-sql-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,7 +1281,7 @@ 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-ipv6
@@ -1624,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
@@ -1681,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
@@ -2138,9 +2115,6 @@ if test $ol_enable_slapd = no ; then
        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
@@ -2190,7 +2164,6 @@ if test $ol_enable_slapd = no ; then
        ol_enable_sql=no
 
        ol_enable_modules=no
-       ol_enable_multimaster=no
        ol_enable_phonetic=no
        ol_enable_rlookups=no
        ol_enable_aci=no
@@ -2260,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
@@ -2273,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
@@ -2349,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:2353: 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
@@ -2401,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:2405: 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
@@ -2433,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.
@@ -2461,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:2465: 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
@@ -2491,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:2495: 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
@@ -2521,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:2525: 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
@@ -2572,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:2576: 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
@@ -2604,7 +2616,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2608: 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.
@@ -2615,12 +2627,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2619 "configure"
+#line 2631 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2624: \"$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
@@ -2646,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:2650: 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:2655: 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
@@ -2660,7 +2672,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+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
@@ -2679,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:2683: 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
@@ -2722,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:2726: 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.
@@ -2746,10 +2758,10 @@ echo "configure:2726: 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:2750: 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:2753: 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
@@ -2784,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:2788: 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
@@ -2800,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:2804: 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
@@ -2836,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:2840: 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
@@ -2891,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 2895 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2896: \"$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"
@@ -2913,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:2917: 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 2922 "configure"
+#line 2934 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2929: \"$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
@@ -2948,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:2952: 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
@@ -2980,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:2984: 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
@@ -3015,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:3019: 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
@@ -3047,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:3051: 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
@@ -3082,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:3086: 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
@@ -3114,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:3118: 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
@@ -3182,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:3186: 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
@@ -3213,7 +3225,7 @@ done
 
 # test for ln hardlink support
 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:3217: checking whether ln works" >&5
+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
@@ -3236,7 +3248,7 @@ else
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3240: 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
@@ -3264,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:3268: 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
@@ -3300,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:3304: 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
@@ -3336,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:3340: 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
@@ -3371,7 +3383,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3375: 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=
@@ -3386,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 3390 "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:3396: \"$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
   :
@@ -3403,13 +3415,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 3407 "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:3413: \"$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
   :
@@ -3420,13 +3432,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 3424 "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:3430: \"$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
   :
@@ -3464,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:3468: checking for AIX" >&5
+echo "configure:3480: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3470 "configure"
+#line 3482 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -3488,7 +3500,7 @@ rm -f conftest*
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:3492: 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
@@ -3510,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:3514: 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 3519 "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:3524: \"$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*
@@ -3559,12 +3571,12 @@ fi
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3563: 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 3568 "configure"
+#line 3580 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3575,7 +3587,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3579: \"$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
@@ -3591,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:3595: 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 3600 "configure"
+#line 3612 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3607: \"$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
@@ -3619,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:3623: 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 3628 "configure"
+#line 3640 "configure"
 #include "confdefs.h"
 
 int main() {
 return __EMX__;
 ; return 0; }
 EOF
-if { (eval echo configure:3635: \"$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
@@ -3650,7 +3662,7 @@ test "$ac_cv_emxos2" = yes && EMXOS2=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3654: 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
@@ -3660,7 +3672,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3664: \"$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) ;;
@@ -3681,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:3685: 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:3691: \"$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) ;;
@@ -3711,7 +3723,7 @@ EOF
 
 
 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
-echo "configure:3715: 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
@@ -3719,7 +3731,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbe -lroot -lnet $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3723 "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
@@ -3730,7 +3742,7 @@ int main() {
 be_app()
 ; return 0; }
 EOF
-if { (eval echo configure:3734: \"$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
@@ -3756,7 +3768,7 @@ fi
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:3760: 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
@@ -3773,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 3777 "configure"
+#line 3789 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -3810,7 +3822,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:3814: \"$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
@@ -3844,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:3848: 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
@@ -3854,7 +3866,7 @@ else
                                cat > conftest.c <<EOF
  noCode;
 EOF
-                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3858: \"$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
@@ -3887,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:3891: 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
@@ -3895,7 +3907,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ls  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3899 "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
@@ -3906,7 +3918,7 @@ int main() {
 afopen()
 ; return 0; }
 EOF
-if { (eval echo configure:3910: \"$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:3941: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 3946 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-char (*f)();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func;
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:3970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-if test $ac_cv_func_getaddrinfo = no ; then
-       if test $ol_enable_ipv6 = yes ; then
-               { echo "configure: error: IPv6 support requires getaddrinfo()" 1>&2; exit 1; }
-       fi
-       ol_enable_ipv6=no
-fi
-
-if test $ol_enable_local != no ; then
-       for ac_hdr in sys/un.h 
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4007: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 4012 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-       if test $ol_enable_local = auto ; then
-               ol_enable_local=$ac_cv_header_sys_un_h
-       elif test $ac_cv_header_sys_un_h = no ; then
-               { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
-       fi
-fi
-
 ol_link_modules=no
 if test $ol_enable_modules != no ; then
        for ac_hdr in ltdl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4057: checking for $ac_hdr" >&5
+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 4062 "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:4067: \"$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*
@@ -4095,7 +3994,7 @@ done
        fi
 
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:4099: 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
@@ -4103,7 +4002,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4107 "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
@@ -4114,7 +4013,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:4118: \"$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
@@ -4156,13 +4055,13 @@ fi
 
 # test for EBCDIC
 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
-echo "configure:4160: 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 4166 "configure"
+#line 4065 "configure"
 #include "confdefs.h"
 
 #if !('M' == 0xd4)
@@ -4171,7 +4070,7 @@ else
 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4175: \"$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*
@@ -4195,12 +4094,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4199: 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 4204 "configure"
+#line 4103 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4208,7 +4107,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4212: \"$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*
@@ -4225,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 4229 "configure"
+#line 4128 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4243,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 4247 "configure"
+#line 4146 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4264,7 +4163,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4268 "configure"
+#line 4167 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #ifndef HAVE_EBCDIC
@@ -4282,7 +4181,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:4286: \"$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
@@ -4316,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:4320: 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 4325 "configure"
+#line 4224 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4329,7 +4228,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4333: \"$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
@@ -4354,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:4358: 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
@@ -4362,7 +4261,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4366 "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
@@ -4373,7 +4272,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure: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
@@ -4395,7 +4294,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4399: 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
@@ -4403,7 +4302,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4407 "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
@@ -4414,7 +4313,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4418: \"$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
@@ -4437,12 +4336,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4441: 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 4446 "configure"
+#line 4345 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -4458,7 +4357,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:4462: \"$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
@@ -4479,12 +4378,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:4483: 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 4488 "configure"
+#line 4387 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -4494,7 +4393,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4498: \"$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
@@ -4510,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:4514: 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
@@ -4519,7 +4418,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 4523 "configure"
+#line 4422 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -4539,7 +4438,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 4543 "configure"
+#line 4442 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -4622,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:4626: 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 4631 "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:4636: \"$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*
@@ -4661,8 +4560,105 @@ done
 
 
 
+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="-ldl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#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 dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+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
+  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 dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-ldl $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+
 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:4666: checking for sigset in -lV3" >&5
+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
@@ -4670,7 +4666,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4674 "configure"
+#line 4670 "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
@@ -4681,7 +4677,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -4711,12 +4707,12 @@ fi
 
 if test $ac_cv_header_winsock_h = yes; then
        echo $ac_n "checking for winsock""... $ac_c" 1>&6
-echo "configure:4715: checking for winsock" >&5
+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 4720 "configure"
+#line 4716 "configure"
 #include "confdefs.h"
 #include <winsock.h>
 int main() {
@@ -4728,7 +4724,7 @@ int main() {
        
 ; return 0; }
 EOF
-if { (eval echo configure:4732: \"$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
@@ -4737,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
@@ -4756,12 +4752,12 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:4760: 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 4765 "configure"
+#line 4761 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -4785,7 +4781,7 @@ f = socket;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4789: \"$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
@@ -4804,7 +4800,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:4808: 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
@@ -4812,14 +4808,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4816 "configure"
+#line 4812 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4823: \"$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
@@ -4847,7 +4843,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:4851: 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
@@ -4855,14 +4851,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4859 "configure"
+#line 4855 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4866: \"$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
@@ -4890,7 +4886,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:4894: 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
@@ -4898,14 +4894,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4902 "configure"
+#line 4898 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4909: \"$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
@@ -4933,7 +4929,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:4937: 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
@@ -4941,14 +4937,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4945 "configure"
+#line 4941 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4952: \"$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
@@ -4976,7 +4972,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:4980: 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
@@ -4984,7 +4980,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4988 "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
@@ -4995,7 +4991,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:4999: \"$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
@@ -5023,7 +5019,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:5027: 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
@@ -5031,14 +5027,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5035 "configure"
+#line 5031 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5042: \"$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
@@ -5070,12 +5066,12 @@ fi
 
 
 echo $ac_n "checking for select""... $ac_c" 1>&6
-echo "configure:5074: 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 5079 "configure"
+#line 5075 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char select(); below.  */
@@ -5099,7 +5095,7 @@ f = select;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5103: \"$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
@@ -5122,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:5126: 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
@@ -5136,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 5140 "configure"
+#line 5136 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -5155,7 +5151,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5159: \"$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
@@ -5200,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:5204: 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 5209 "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:5214: \"$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*
@@ -5240,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:5244: 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 5249 "configure"
+#line 5245 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char regfree(); below.  */
@@ -5269,7 +5265,7 @@ f = regfree;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5273: \"$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
@@ -5292,7 +5288,7 @@ fi
 
 
 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
-echo "configure:5296: 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
@@ -5301,7 +5297,7 @@ else
   ol_cv_c_posix_regex=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 5305 "configure"
+#line 5301 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5327,7 +5323,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:5331: \"$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
@@ -5349,12 +5345,12 @@ fi
 
 ol_link_dnssrv=no
 echo $ac_n "checking for res_query""... $ac_c" 1>&6
-echo "configure:5353: 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 5358 "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.  */
@@ -5378,7 +5374,7 @@ f = res_query;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5382: \"$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
@@ -5398,48 +5394,101 @@ else
 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:5403: checking for res_query in -lbind" >&5
-ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+       echo $ac_n "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
-  ac_save_LIBS="$LIBS"
-LIBS="-lbind  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5411 "configure"
+  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 __res_query();
+char (*f)();
 
 int main() {
-res_query()
+
+/* 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:5422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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_lib_$ac_lib_var=yes"
+  eval "ac_cv_func___res_query=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_func___res_query=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
-  LIBS="-lbind $LIBS"
+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: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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lbind  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#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
+    builtin and then its argument prototype would still apply.  */
+char res_query();
+
+int main() {
+res_query()
+; return 0; }
+EOF
+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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lbind $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
@@ -5450,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:5454: 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
@@ -5458,7 +5507,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5462 "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
@@ -5469,7 +5518,7 @@ int main() {
 __res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5473: \"$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
@@ -5501,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:5505: 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
@@ -5509,7 +5558,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5513 "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
@@ -5520,7 +5569,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5524: \"$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
@@ -5550,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
@@ -5565,29 +5665,236 @@ if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
        { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
 fi
 
+for ac_func in getaddrinfo 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: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 5836 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (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*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+       if test $ol_enable_local = auto ; then
+               ol_enable_local=$ac_cv_header_sys_un_h
+       elif test $ac_cv_header_sys_un_h = no ; then
+               { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
+       fi
+fi
+
 ol_link_kbind=no
 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:5581: 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 5586 "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:5591: \"$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*
@@ -5619,66 +5926,104 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5623: checking for $ac_hdr" >&5
+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 5628 "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:5633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (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*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+               if test $ac_cv_header_heim_err_h = yes ; then
+                       krb5_impl=heimdal
+               else
+                       krb5_impl=mit
+               fi
+
+               if test $krb5_impl = mit; then
+                       echo $ac_n "checking for main in -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_header_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
+  krb5crypto=k5crypto
 else
   echo "$ac_t""no" 1>&6
+krb5crypto=crypto
 fi
-done
 
-               if test $ac_cv_header_heim_err_h = yes ; then
-                       krb5_impl=heimdal
-               else
-                       krb5_impl=mit
-               fi
 
-               if test $krb5_impl = mit; then
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:5667: checking for main in -lkrb5" >&5
+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 5675 "configure"
+#line 6020 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -5694,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
@@ -5703,7 +6048,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:5707: checking for main in -lkrb5" >&5
+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
@@ -5711,14 +6056,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5715 "configure"
+#line 6060 "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: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
@@ -5745,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
@@ -5773,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:5784: 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 5789 "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:5794: \"$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*
@@ -5820,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:5824: 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 5832 "configure"
+#line 6178 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -5860,7 +6206,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:5864: checking for main in -lkrb4" >&5
+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
@@ -5868,14 +6214,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5872 "configure"
+#line 6218 "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: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
@@ -5917,7 +6263,7 @@ EOF
 
 
                        echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:5921: 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
@@ -5925,7 +6271,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 5929 "configure"
+#line 6275 "configure"
 #include "confdefs.h"
 
 #include <kerberosIV/krb.h>
@@ -5938,7 +6284,7 @@ des_debug = 1;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5942: \"$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
@@ -5970,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:5981: 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 5986 "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:5991: \"$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*
@@ -6016,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:6020: 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
@@ -6024,14 +6370,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6028 "configure"
+#line 6374 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:6035: \"$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
@@ -6075,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
@@ -6085,7 +6438,7 @@ 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
@@ -6094,17 +6447,17 @@ if test $ol_with_tls != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6098: 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 6103 "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:6108: \"$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*
@@ -6133,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:6137: 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
@@ -6141,7 +6494,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6145 "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
@@ -6152,7 +6505,7 @@ int main() {
 SSLeay_add_ssl_algorithms()
 ; return 0; }
 EOF
-if { (eval echo configure:6156: \"$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
@@ -6177,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:6181: 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
@@ -6185,7 +6538,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6189 "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
@@ -6196,7 +6549,7 @@ int main() {
 SSL_library_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure: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
@@ -6222,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:6226: 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
@@ -6230,7 +6583,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6234 "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
@@ -6241,7 +6594,7 @@ int main() {
 ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:6245: \"$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
@@ -6311,12 +6664,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6315: 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 6320 "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.  */
@@ -6340,7 +6693,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6344: \"$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
@@ -6369,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:6373: 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 6378 "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:6385: \"$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
@@ -6393,14 +6746,14 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6397 "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:6404: \"$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
@@ -6440,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:6444: 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 6449 "configure"
+#line 6802 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6459,7 +6812,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6463: \"$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
@@ -6471,7 +6824,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6475 "configure"
+#line 6828 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6486,7 +6839,7 @@ struct hostent hent;struct hostent *rhent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6490: \"$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
@@ -6527,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:6531: 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 6536 "configure"
+#line 6889 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6548,7 +6901,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        alen, AF_INET, &hent, buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6552: \"$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
@@ -6560,7 +6913,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6564 "configure"
+#line 6917 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6578,7 +6931,7 @@ struct hostent hent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6582: \"$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
@@ -6640,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:6645: checking for NT Threads" >&5
-if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-               echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
-echo "configure:6651: checking for _beginthread" >&5
+       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 6656 "configure"
+#line 7003 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _beginthread(); below.  */
@@ -6676,7 +7023,7 @@ f = _beginthread;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6680: \"$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
@@ -6690,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
@@ -6736,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:6740: 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 6745 "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:6750: \"$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*
@@ -6775,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:6779: 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 6785 "configure"
+#line 7127 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -6803,7 +7145,7 @@ rm -f conftest*
 
 
        cat > conftest.$ac_ext <<EOF
-#line 6807 "configure"
+#line 7149 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -6856,12 +7198,12 @@ EOF
 
                
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:6860: 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 6865 "configure"
+#line 7207 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -6888,12 +7230,12 @@ EOF
 
                
        echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
-echo "configure:6892: 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 6897 "configure"
+#line 7239 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 #ifdef _POSIX_THREAD_IS_GNU_PTH
@@ -6922,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:6926: 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 6931 "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:6936: \"$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*
@@ -6962,14 +7304,14 @@ done
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
-echo "configure:6966: 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 6973 "configure"
+#line 7315 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -6988,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7029: \"$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
@@ -7037,7 +7404,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7041 "configure"
+#line 7408 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7060,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 );
+       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:7102: \"$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
@@ -7123,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:7127: 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
@@ -7134,7 +7526,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7138 "configure"
+#line 7530 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7153,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7194: \"$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
@@ -7202,7 +7619,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7206 "configure"
+#line 7623 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7225,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 );
+       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:7267: \"$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
@@ -7293,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:7297: 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
@@ -7304,7 +7746,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7308 "configure"
+#line 7750 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7323,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7364: \"$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
@@ -7372,7 +7839,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7376 "configure"
+#line 7843 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7395,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 );
+       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:7437: \"$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
@@ -7463,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:7467: 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
@@ -7474,7 +7966,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7478 "configure"
+#line 7970 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7493,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7534: \"$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
@@ -7542,7 +8059,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7546 "configure"
+#line 8063 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7565,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 );
+       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:7607: \"$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
@@ -7633,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:7637: 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
@@ -7644,7 +8186,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7648 "configure"
+#line 8190 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7663,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7704: \"$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
@@ -7712,7 +8279,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7716 "configure"
+#line 8283 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7735,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 );
+       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:7777: \"$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
@@ -7803,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:7807: 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
@@ -7814,7 +8406,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7818 "configure"
+#line 8410 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7833,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7874: \"$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
@@ -7882,7 +8499,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7886 "configure"
+#line 8503 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7905,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 );
+       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:7947: \"$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
@@ -7974,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:7978: 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
@@ -7985,7 +8627,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7989 "configure"
+#line 8631 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8004,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8045: \"$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
@@ -8053,7 +8720,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8057 "configure"
+#line 8724 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8076,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 );
+       if( status ) return status;
+
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+#else
+               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;
 
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( 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 );
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
-#endif
+               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:8118: \"$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
@@ -8144,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:8148: 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
@@ -8155,7 +8847,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8159 "configure"
+#line 8851 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8174,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8215: \"$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
@@ -8223,7 +8940,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8227 "configure"
+#line 8944 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8246,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 );
+       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:8288: \"$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
@@ -8315,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:8319: 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
@@ -8326,7 +9068,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8330 "configure"
+#line 9072 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8345,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8386: \"$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
@@ -8394,7 +9161,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8398 "configure"
+#line 9165 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8417,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 );
+       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:8459: \"$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
@@ -8486,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:8490: 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
@@ -8497,7 +9289,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8501 "configure"
+#line 9293 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8516,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8557: \"$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
@@ -8565,7 +9382,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8569 "configure"
+#line 9386 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8588,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 );
+       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:8630: \"$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
@@ -8656,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:8660: 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
@@ -8667,7 +9509,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8671 "configure"
+#line 9513 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8686,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8727: \"$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
@@ -8735,7 +9602,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8739 "configure"
+#line 9606 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8758,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 );
+       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:8800: \"$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
@@ -8827,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:8831: 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
@@ -8838,7 +9730,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8842 "configure"
+#line 9734 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8857,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8898: \"$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
@@ -8906,7 +9823,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8910 "configure"
+#line 9827 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8929,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 );
+       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:8971: \"$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
@@ -8998,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:9002: 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
@@ -9009,7 +9951,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9013 "configure"
+#line 9955 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9028,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9069: \"$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
@@ -9077,7 +10044,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9081 "configure"
+#line 10048 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9100,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 );
+       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:9142: \"$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
@@ -9168,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:9172: 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
@@ -9179,7 +10171,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9183 "configure"
+#line 10175 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9198,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9239: \"$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
@@ -9247,7 +10264,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9251 "configure"
+#line 10268 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9270,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 );
+       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:9312: \"$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
@@ -9338,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:9342: 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
@@ -9349,7 +10391,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9353 "configure"
+#line 10395 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9368,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9409: \"$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
@@ -9417,7 +10484,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9421 "configure"
+#line 10488 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9440,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_init(&attr);
+       if( status ) return status;
+
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+#else
+               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;
 
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( 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 );
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
-#endif
+               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:9482: \"$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
@@ -9509,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:9513: 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
@@ -9520,7 +10612,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9524 "configure"
+#line 10616 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9539,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 );
+       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;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9580: \"$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
@@ -9588,7 +10705,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9592 "configure"
+#line 10709 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9611,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 );
+       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:9653: \"$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
@@ -9691,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:9695: 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 9700 "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.  */
@@ -9720,7 +10862,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9724: \"$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
@@ -9748,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:9752: 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
@@ -9756,7 +10898,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9760 "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
@@ -9767,7 +10909,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:9771: \"$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:9803: 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 9808 "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.  */
@@ -9828,7 +10970,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9832: \"$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
@@ -9862,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:9866: 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 9871 "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.  */
@@ -9891,7 +11033,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9895: \"$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
@@ -9917,13 +11059,13 @@ done
 
 
                                                                        echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:9921: 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 9927 "configure"
+#line 11069 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -9935,7 +11077,7 @@ int main() {
 pthread_detach(NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:9939: \"$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
@@ -9967,12 +11109,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9971: 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 9976 "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.  */
@@ -9996,7 +11138,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10000: \"$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
@@ -10025,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:10029: 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 10034 "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.  */
@@ -10054,7 +11196,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10058: \"$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
@@ -10079,7 +11221,7 @@ fi
 done
 
        echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
-echo "configure:10083: 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
@@ -10092,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:10096: 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
@@ -10117,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:10121: 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
@@ -10126,7 +11268,7 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 10130 "configure"
+#line 11272 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -10149,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:10191: \"$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
@@ -10209,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:10213: 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
@@ -10218,7 +11385,7 @@ else
   ol_cv_pthread_select_yields=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10222 "configure"
+#line 11389 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10294,7 +11461,7 @@ int main(argc, argv)
        exit(2);
 }
 EOF
-if { (eval echo configure:10298: \"$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
@@ -10322,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:10342: 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 10347 "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:10352: \"$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*
@@ -10378,12 +11545,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:10382: 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 10387 "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.  */
@@ -10407,7 +11574,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10411: \"$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
@@ -10429,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:10433: 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
@@ -10437,7 +11604,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 10441 "configure"
+#line 11608 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -10446,7 +11613,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:10450: \"$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
@@ -10468,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 \
@@ -10491,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:10495: 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 10500 "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:10505: \"$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*
@@ -10530,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:10534: 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
@@ -10538,7 +11767,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10542 "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
@@ -10549,7 +11778,7 @@ int main() {
 pth_version()
 ; return 0; }
 EOF
-if { (eval echo configure:10553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -10593,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:10597: 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 10602 "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:10607: \"$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*
@@ -10631,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:10635: 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
@@ -10639,7 +11868,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10643 "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
@@ -10650,7 +11879,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:10654: \"$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
@@ -10690,12 +11919,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10694: 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 10699 "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.  */
@@ -10719,7 +11948,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10723: \"$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
@@ -10750,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:10754: 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 10759 "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:10764: \"$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*
@@ -10788,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:10792: 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
@@ -10796,7 +12025,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10800 "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
@@ -10807,7 +12036,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:10811: \"$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
@@ -10860,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:10864: 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 10869 "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:10874: \"$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*
@@ -10899,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:10903: 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 10908 "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.  */
@@ -10928,7 +12157,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10932: \"$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
@@ -10954,12 +12183,12 @@ done
 
        
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:10958: 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 10963 "configure"
+#line 12192 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -10989,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:10993: 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 10998 "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:11003: \"$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*
@@ -11029,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:11033: 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 11038 "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:11043: \"$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*
@@ -11069,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:11073: 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 11078 "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:11083: \"$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*
@@ -11138,20 +12367,20 @@ EOF
 
 
                        echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:11142: 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 11148 "configure"
+#line 12377 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11155: \"$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:11171: 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 11177 "configure"
+#line 12406 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 h_errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11184: \"$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
@@ -11239,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:11243: 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 11248 "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:11253: \"$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*
@@ -11277,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:11281: 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 11287 "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:11324: 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
@@ -11330,7 +12559,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11334 "configure"
+#line 12563 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11349,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
@@ -11359,7 +12606,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11363: \"$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
@@ -11383,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:11387: 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
@@ -11393,7 +12640,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11397 "configure"
+#line 12644 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11412,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
@@ -11422,7 +12687,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11426: \"$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
@@ -11446,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:11450: 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
@@ -11456,7 +12721,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11460 "configure"
+#line 12725 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11475,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
@@ -11485,7 +12768,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11489: \"$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
@@ -11509,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:11513: 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
@@ -11519,7 +12802,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11523 "configure"
+#line 12806 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11538,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
@@ -11548,7 +12849,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11552: \"$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
@@ -11572,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:11576: 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
@@ -11582,7 +12883,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11586 "configure"
+#line 12887 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11601,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
@@ -11611,7 +12930,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11615: \"$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
@@ -11646,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:11650: 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 11655 "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:11660: \"$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*
@@ -11686,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:11690: 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
@@ -11696,7 +13015,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11700 "configure"
+#line 13019 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11715,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
@@ -11725,7 +13062,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11729: \"$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
@@ -11749,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:11753: 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
@@ -11759,7 +13096,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11763 "configure"
+#line 13100 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11778,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
@@ -11788,7 +13143,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11792: \"$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
@@ -11812,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:11816: 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
@@ -11822,7 +13177,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11826 "configure"
+#line 13181 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11841,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
@@ -11851,7 +13224,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11855: \"$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
@@ -11875,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:11879: 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
@@ -11885,7 +13258,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11889 "configure"
+#line 13262 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11904,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
@@ -11914,7 +13305,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11918: \"$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
@@ -11938,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:11942: 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
@@ -11948,7 +13339,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11952 "configure"
+#line 13343 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11967,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
@@ -11977,7 +13386,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11981: \"$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
@@ -12003,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:12007: 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
@@ -12017,7 +13426,7 @@ else
   ol_cv_berkeley_db_thread=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 12021 "configure"
+#line 13430 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -12031,19 +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 ) {
+       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 );
+       rc = env->open( env, NULL, flags, 0 );
 #else
-               rc = env->open( env, NULL, NULL, flags, 0 );
+       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
@@ -12055,19 +13485,15 @@ main()
        if( rc == 0 ) {
                db_appexit( &env );
        }
-#endif
-#if DB_VERSION_MAJOR > 2
-#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
-       env->remove( env, NULL, DB_FORCE);
-#else
-       env->remove( env, NULL, NULL, DB_FORCE);
-#endif
+
+       unlink("__db_mpool.share");
+       unlink("__db_lock.share");
 #endif
 
        return rc;
 }
 EOF
-if { (eval echo configure:12071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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:12135: 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:12141: 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 12146 "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.  */
@@ -12166,7 +13592,7 @@ f = mdbm_set_chain;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12170: \"$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
@@ -12185,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:12189: 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
@@ -12193,7 +13619,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12197 "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
@@ -12204,7 +13630,7 @@ int main() {
 mdbm_set_chain()
 ; return 0; }
 EOF
-if { (eval echo configure:12208: \"$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
@@ -12239,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:12243: 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 12248 "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:12253: \"$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*
@@ -12276,7 +13702,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12280: 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:12313: 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:12319: 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 12324 "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.  */
@@ -12344,7 +13770,7 @@ f = gdbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12348: \"$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
@@ -12363,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:12367: 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
@@ -12371,7 +13797,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12375 "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
@@ -12382,7 +13808,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12386: \"$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
@@ -12417,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:12421: 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 12426 "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:12431: \"$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*
@@ -12454,7 +13880,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12458: 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:12492: 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:12498: 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 12503 "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.  */
@@ -12523,7 +13949,7 @@ f = dbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12527: \"$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
@@ -12542,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:12546: 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
@@ -12550,7 +13976,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12554 "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
@@ -12561,7 +13987,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12565: \"$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
@@ -12581,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:12585: 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
@@ -12589,7 +14015,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12593 "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
@@ -12600,7 +14026,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12604: \"$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
@@ -12637,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:12641: 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 12646 "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:12651: \"$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*
@@ -12674,7 +14100,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12678: 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
@@ -12727,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:12731: 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 12736 "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:12741: \"$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*
@@ -12768,7 +14194,7 @@ done
                have_wrappers=no
        else
                cat > conftest.$ac_ext <<EOF
-#line 12772 "configure"
+#line 14198 "configure"
 #include "confdefs.h"
 
 int allow_severity = 0;
@@ -12778,7 +14204,7 @@ int main() {
 hosts_access()
 ; return 0; }
 EOF
-if { (eval echo configure:12782: \"$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
@@ -12798,7 +14224,7 @@ EOF
                WRAP_LIBS="-lwrap"
 
                                                echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:12802: 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
@@ -12806,14 +14232,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12810 "configure"
+#line 14236 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:12817: \"$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:12858: 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 12863 "configure"
+#line 14289 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -12883,7 +14309,7 @@ f = openlog;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12887: \"$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:12917: 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 12922 "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:12927: \"$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*
@@ -12952,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:12956: 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
@@ -12960,7 +14486,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12964 "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
@@ -12971,7 +14497,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:12975: \"$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
@@ -13004,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:13008: 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
@@ -13012,7 +14538,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13016 "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
@@ -13023,7 +14549,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:13027: \"$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:13071: 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 13076 "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:13081: \"$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*
@@ -13093,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:13105: 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
@@ -13109,7 +14642,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13113 "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
@@ -13120,7 +14653,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:13124: \"$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
@@ -13162,7 +14695,11 @@ EOF
                                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
@@ -13197,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:13201: 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 13207 "configure"
+#line 14744 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -13213,7 +14750,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:13217: \"$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
@@ -13251,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:13255: 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 13260 "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:13265: \"$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*
@@ -13292,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:13296: 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
@@ -13300,7 +14837,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13304 "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
@@ -13311,7 +14848,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:13315: \"$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:13357: 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 13362 "configure"
+#line 14899 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -13382,7 +14919,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13386: \"$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
@@ -13401,7 +14938,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:13405: 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
@@ -13409,7 +14946,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13413 "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
@@ -13420,7 +14957,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:13424: \"$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:13467: 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 13472 "configure"
+#line 15009 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -13492,7 +15029,7 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13496: \"$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
@@ -13511,7 +15048,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:13515: 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
@@ -13519,7 +15056,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13523 "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
@@ -13530,7 +15067,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:13534: \"$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
@@ -13566,12 +15103,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:13570: 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 13575 "configure"
+#line 15112 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -13579,7 +15116,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13583: \"$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*
@@ -13596,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 13600 "configure"
+#line 15137 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -13614,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 13618 "configure"
+#line 15155 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -13635,7 +15172,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 13639 "configure"
+#line 15176 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -13653,7 +15190,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:13657: \"$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
@@ -13677,12 +15214,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:13681: 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 13686 "configure"
+#line 15223 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13713,12 +15250,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:13717: 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 13722 "configure"
+#line 15259 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13749,12 +15286,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:13753: 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 13758 "configure"
+#line 15295 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13785,19 +15322,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:13789: 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 13794 "configure"
+#line 15331 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:13801: \"$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
@@ -13818,12 +15355,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:13822: 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 13827 "configure"
+#line 15364 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -13840,7 +15377,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:13844: \"$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
@@ -13859,12 +15396,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:13863: 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 13868 "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:13900: 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 13905 "configure"
+#line 15442 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13932,12 +15469,12 @@ EOF
 fi
 
 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
-echo "configure:13936: 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 13941 "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:13973: 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 13978 "configure"
+#line 15515 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -13988,7 +15525,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:13992: \"$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
@@ -14009,12 +15546,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:14013: 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 14018 "configure"
+#line 15555 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -14022,7 +15559,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:14026: \"$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
@@ -14044,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:14048: 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 14053 "configure"
+#line 15590 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -14058,7 +15595,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:14062: \"$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
@@ -14079,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:14083: 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 14088 "configure"
+#line 15625 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -14092,7 +15629,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:14096: \"$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
@@ -14113,12 +15650,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:14117: checking for uid_t in sys/types.h" >&5
+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 14122 "configure"
+#line 15659 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -14147,19 +15684,19 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:14151: 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 14156 "configure"
+#line 15693 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:14163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -14183,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:14187: 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 14193 "configure"
+#line 15730 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -14199,7 +15736,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14203: \"$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:14225: 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 14231 "configure"
+#line 15768 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -14237,7 +15774,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14241: \"$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
@@ -14259,7 +15796,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:14263: 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
@@ -14268,7 +15805,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 14272 "configure"
+#line 15809 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -14280,7 +15817,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:14284: \"$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
@@ -14303,12 +15840,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:14307: 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 14312 "configure"
+#line 15849 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -14357,7 +15894,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14361: \"$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
@@ -14378,12 +15915,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:14382: 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 14387 "configure"
+#line 15924 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -14392,7 +15929,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:14396: \"$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
@@ -14422,14 +15959,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:14426: 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 14433 "configure"
+#line 15970 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -14440,11 +15977,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14444: \"$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 14448 "configure"
+#line 15985 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -14455,7 +15992,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14459: \"$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
@@ -14475,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 14479 "configure"
+#line 16016 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -14488,7 +16025,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:14492: \"$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:14518: 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 14524 "configure"
+#line 16061 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14530,7 +16067,7 @@ int main() {
 switch (0) case 0: case (sizeof (short) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14534: \"$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
@@ -14553,13 +16090,13 @@ EOF
  
  
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:14557: 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 14563 "configure"
+#line 16100 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14569,7 +16106,7 @@ int main() {
 switch (0) case 0: case (sizeof (int) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14573: \"$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
@@ -14592,13 +16129,13 @@ EOF
  
  
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:14596: 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 14602 "configure"
+#line 16139 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14608,7 +16145,7 @@ int main() {
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14612: \"$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
@@ -14659,7 +16196,7 @@ EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:14663: 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
@@ -14667,7 +16204,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 14671 "configure"
+#line 16208 "configure"
 #include "confdefs.h"
 
 main()
@@ -14677,7 +16214,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:14681: \"$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
@@ -14695,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:14699: 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 14704 "configure"
+#line 16241 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -14724,7 +16261,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14728: \"$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
@@ -14746,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:14750: 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
@@ -14754,7 +16291,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14758 "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
@@ -14765,7 +16302,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:14769: \"$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:14797: 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 14802 "configure"
+#line 16339 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -14820,7 +16357,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:14824: \"$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
@@ -14842,12 +16379,12 @@ EOF
  
 
 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
-echo "configure:14846: 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 14851 "configure"
+#line 16388 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _spawnlp(); below.  */
@@ -14871,7 +16408,7 @@ f = _spawnlp;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14875: \"$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:14899: 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 14904 "configure"
+#line 16441 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _snprintf(); below.  */
@@ -14924,7 +16461,7 @@ f = _snprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14928: \"$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:14954: 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 14959 "configure"
+#line 16496 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _vsnprintf(); below.  */
@@ -14979,7 +16516,7 @@ f = _vsnprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14983: \"$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:15009: 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 15014 "configure"
+#line 16551 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -15034,7 +16571,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15038: \"$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:15062: 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 15067 "configure"
+#line 16604 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -15087,7 +16624,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15091: \"$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
@@ -15116,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:15120: 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 15125 "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.  */
@@ -15145,7 +16682,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15149: \"$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
@@ -15177,6 +16714,7 @@ for ac_func in \
        chroot                  \
        endgrent                \
        endpwent                \
+       fcntl                   \
        flock                   \
        getdtablesize   \
        getgrgid                \
@@ -15205,7 +16743,6 @@ for ac_func in \
        sigaction               \
        signal                  \
        sigset                  \
-       snprintf                \
        strdup                  \
        strerror                \
        strpbrk                 \
@@ -15216,6 +16753,7 @@ for ac_func in \
        strtoul                 \
        strspn                  \
        sysconf                 \
+       usleep                  \
        waitpid                 \
        wait4                   \
        write                   \
@@ -15224,12 +16762,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15228: 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 15233 "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.  */
@@ -15253,7 +16791,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15257: \"$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
@@ -15281,12 +16819,12 @@ done
 for ac_func in getopt tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15285: 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 15290 "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.  */
@@ -15310,7 +16848,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15314: \"$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:15351: 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 15357 "configure"
+#line 16895 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -15366,7 +16904,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:15370: \"$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
@@ -15389,20 +16927,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:15393: 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 15399 "configure"
+#line 16937 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:15406: \"$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
@@ -15436,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
@@ -15473,7 +17005,7 @@ if test "$ol_enable_local" != no; then
 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
@@ -15502,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
@@ -15634,7 +17160,6 @@ EOF
 
        BUILD_SLAPD=yes
        BUILD_SQL=yes
-       SLAPD_SQL_LIBS=-liodbc
        if test "$ol_with_sql_module" != static; then
                cat >> confdefs.h <<\EOF
 #define SLAPD_SQL_DYNAMIC 1
@@ -15798,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 \
@@ -15815,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
@@ -15881,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
@@ -16005,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 \
@@ -16022,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