]> git.sur5r.net Git - openldap/blobdiff - configure
rebuild
[openldap] / configure
index 90ca4d2a609b945b1ea117a305c4527b25dcce0e..482e4e313a40a10433514f4a6db758f9ef5e3a3c 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,15 +1,16 @@
 #! /bin/sh
 # $OpenLDAP$
-# from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.20 2000/10/30 17:46:17 kurt Exp  
+# from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.42 2002/09/20 17:09:47 kurt Exp  
 
-# Copyright 1998-2000 The OpenLDAP Foundation.  All Rights Reserved.
+# Copyright 1998-2002 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-2002 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 (no)"
+  --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
@@ -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,13 +2233,17 @@ 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
-       ol_with_kerberos=yes
+
 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
-       if test $ol_with_kerberos != no -a $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;
+               ol_with_kerberos=no
        fi
-       ol_with_kerberos=no
 fi
 
 if test $ol_enable_spasswd = yes ; then
@@ -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
@@ -3940,17 +3952,17 @@ if test $ol_enable_modules != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3944: 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 3949 "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:3954: \"$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*
@@ -3982,7 +3994,7 @@ done
        fi
 
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:3986: 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
@@ -3990,7 +4002,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3994 "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
@@ -4001,7 +4013,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:4005: \"$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
@@ -4043,13 +4055,13 @@ fi
 
 # test for EBCDIC
 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
-echo "configure:4047: 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 4053 "configure"
+#line 4065 "configure"
 #include "confdefs.h"
 
 #if !('M' == 0xd4)
@@ -4058,7 +4070,7 @@ else
 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4062: \"$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*
@@ -4082,12 +4094,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4086: 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 4091 "configure"
+#line 4103 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4095,7 +4107,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4099: \"$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*
@@ -4112,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 4116 "configure"
+#line 4128 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4130,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 4134 "configure"
+#line 4146 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4151,7 +4163,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4155 "configure"
+#line 4167 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #ifndef HAVE_EBCDIC
@@ -4169,7 +4181,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:4173: \"$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
@@ -4203,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:4207: 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 4212 "configure"
+#line 4224 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4216,7 +4228,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4220: \"$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
@@ -4241,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:4245: 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
@@ -4249,7 +4261,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4253 "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
@@ -4260,7 +4272,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4264: \"$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
@@ -4282,7 +4294,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4286: 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
@@ -4290,7 +4302,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4294 "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
@@ -4301,7 +4313,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4305: \"$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
@@ -4324,12 +4336,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4328: 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 4333 "configure"
+#line 4345 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -4345,7 +4357,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:4349: \"$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
@@ -4366,12 +4378,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:4370: 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 4375 "configure"
+#line 4387 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -4381,7 +4393,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4385: \"$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
@@ -4397,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:4401: 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
@@ -4406,7 +4418,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 4410 "configure"
+#line 4422 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -4426,7 +4438,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 4430 "configure"
+#line 4442 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -4509,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:4513: 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 4518 "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:4523: \"$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*
@@ -4548,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:4553: 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
@@ -4557,7 +4666,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4561 "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
@@ -4568,7 +4677,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:4572: \"$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
@@ -4598,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:4602: 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 4607 "configure"
+#line 4716 "configure"
 #include "confdefs.h"
 #include <winsock.h>
 int main() {
@@ -4615,7 +4724,7 @@ int main() {
        
 ; return 0; }
 EOF
-if { (eval echo configure:4619: \"$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
@@ -4624,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
@@ -4643,12 +4752,12 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:4647: 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 4652 "configure"
+#line 4761 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -4672,7 +4781,7 @@ f = socket;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4676: \"$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
@@ -4691,7 +4800,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:4695: 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
@@ -4699,14 +4808,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4703 "configure"
+#line 4812 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4710: \"$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
@@ -4734,7 +4843,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:4738: 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
@@ -4742,14 +4851,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4746 "configure"
+#line 4855 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4753: \"$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
@@ -4777,7 +4886,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:4781: 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
@@ -4785,14 +4894,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4789 "configure"
+#line 4898 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4796: \"$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
@@ -4820,7 +4929,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:4824: 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
@@ -4828,14 +4937,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4832 "configure"
+#line 4941 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4839: \"$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
@@ -4863,7 +4972,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:4867: 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
@@ -4871,7 +4980,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4875 "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
@@ -4882,7 +4991,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:4886: \"$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
@@ -4910,7 +5019,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:4914: 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
@@ -4918,14 +5027,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4922 "configure"
+#line 5031 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4929: \"$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
@@ -4957,12 +5066,12 @@ fi
 
 
 echo $ac_n "checking for select""... $ac_c" 1>&6
-echo "configure:4961: 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 4966 "configure"
+#line 5075 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char select(); below.  */
@@ -4986,7 +5095,7 @@ f = select;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4990: \"$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
@@ -5009,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:5013: 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
@@ -5023,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 5027 "configure"
+#line 5136 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -5042,7 +5151,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5046: \"$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
@@ -5087,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:5091: 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 5096 "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:5101: \"$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*
@@ -5127,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:5131: 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 5136 "configure"
+#line 5245 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char regfree(); below.  */
@@ -5156,7 +5265,7 @@ f = regfree;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5160: \"$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
@@ -5179,7 +5288,7 @@ fi
 
 
 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
-echo "configure:5183: 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
@@ -5188,7 +5297,7 @@ else
   ol_cv_c_posix_regex=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 5192 "configure"
+#line 5301 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5214,7 +5323,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:5218: \"$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
@@ -5236,12 +5345,12 @@ fi
 
 ol_link_dnssrv=no
 echo $ac_n "checking for res_query""... $ac_c" 1>&6
-echo "configure:5240: 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 5245 "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.  */
@@ -5265,7 +5374,7 @@ f = res_query;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5269: \"$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
@@ -5284,9 +5393,62 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+if test $ac_cv_func_res_query = no ; then 
+       echo $ac_n "checking for __res_query""... $ac_c" 1>&6
+echo "configure:5399: checking for __res_query" >&5
+if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5404 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char __res_query(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char __res_query();
+char (*f)();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub___res_query) || defined (__stub_____res_query)
+choke me
+#else
+f = __res_query;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:5428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func___res_query=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func___res_query=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       ac_cv_func_res_query=$ac_cv_func___res_query
+fi
+
 if test $ac_cv_func_res_query = no ; then 
        echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
-echo "configure:5290: checking for res_query in -lbind" >&5
+echo "configure:5452: checking for res_query in -lbind" >&5
 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5294,7 +5456,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5298 "configure"
+#line 5460 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5305,7 +5467,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5337,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:5341: 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
@@ -5345,7 +5507,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5349 "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
@@ -5356,7 +5518,7 @@ int main() {
 __res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5360: \"$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
@@ -5388,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:5392: 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
@@ -5396,7 +5558,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5400 "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
@@ -5407,7 +5569,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure: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
@@ -5437,93 +5599,81 @@ fi
        ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
 fi
 
-if test "$ac_cv_func_res_query" = yes ; then
-       cat >> confdefs.h <<\EOF
-#define HAVE_RES_QUERY 1
-EOF
-
-
-       if test $ol_enable_dnssrv != no ; then
-               ol_link_dnssrv=yes
-       fi
-fi
-
-if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
-       { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
-fi
-
-for ac_func in getaddrinfo 
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5459: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+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
-  cat > conftest.$ac_ext <<EOF
-#line 5464 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lresolv  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5613 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char $ac_func();
-char (*f)();
+char __res_query();
 
 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
-
+__res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:5488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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_func_$ac_func=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+    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_func 1
+#define $ac_tr_lib 1
 EOF
+
+  LIBS="-lresolv $LIBS"
+
 else
   echo "$ac_t""no" 1>&6
 fi
-done
 
+       ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
+fi
 
-ol_link_ipv6=no
-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; }
+if test "$ac_cv_func_res_query" = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_RES_QUERY 1
+EOF
+
+
+       if test $ol_enable_dnssrv != no ; then
+               ol_link_dnssrv=yes
        fi
-else
-       for ac_func in gai_strerror 
+fi
+
+if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
+       { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
+fi
+
+for ac_func in getaddrinfo gai_strerror inet_ntop 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5522: checking for $ac_func" >&5
+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 5527 "configure"
+#line 5677 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5547,7 +5697,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -5572,14 +5722,20 @@ fi
 done
 
 
+ol_link_ipv6=no
+if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
+       if test $ol_enable_ipv6 = yes ; then
+               { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
+       fi
+elif test $ol_enable_ipv6 != no ; then
        echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
-echo "configure:5577: checking INET6_ADDRSTRLEN" >&5
+echo "configure:5733: 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 5583 "configure"
+#line 5739 "configure"
 #include "confdefs.h"
 
 #                      include <netinet/in.h>
@@ -5614,17 +5770,17 @@ if test $ol_enable_local != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5618: checking for $ac_hdr" >&5
+echo "configure:5774: 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 5623 "configure"
+#line 5779 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5784: \"$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*
@@ -5671,17 +5827,17 @@ if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5675: checking for $ac_hdr" >&5
+echo "configure:5831: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5680 "configure"
+#line 5836 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5713,17 +5869,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5717: checking for $ac_hdr" >&5
+echo "configure:5873: 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 5722 "configure"
+#line 5878 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5883: \"$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*
@@ -5756,23 +5912,23 @@ done
                fi
 
                if test $krb5_impl = mit; then
-                       echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:5761: checking for main in -lkrb5" >&5
-ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
+                       echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
+echo "configure:5917: 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="-lkrb5 -lcrypto -lcom_err $LIBS"
+LIBS="-lk5crypto  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5769 "configure"
+#line 5925 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5932: \"$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
@@ -5787,32 +5943,30 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_krb5=yes
-                               KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
+  krb5crypto=k5crypto
 else
   echo "$ac_t""no" 1>&6
-have_krb5=no
+krb5crypto=crypto
 fi
 
 
-               elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:5801: checking for main in -lkrb5" >&5
+echo "configure:5955: checking for main in -lkrb5" >&5
 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
+LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5809 "configure"
+#line 5963 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5970: \"$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
@@ -5828,20 +5982,61 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   have_krb5=yes
-                               KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
+                               KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
 else
   echo "$ac_t""no" 1>&6
 have_krb5=no
 fi
 
 
-                       cat >> confdefs.h <<\EOF
-#define HAVE_HEIMDAL_KERBEROS 1
-EOF
+               elif test $krb5_impl = heimdal; then
+                       echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
+echo "configure:5995: checking for main in -lkrb5" >&5
+ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6003 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:6010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_krb5=yes
+                               KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
+else
+  echo "$ac_t""no" 1>&6
+have_krb5=no
+fi
+
+
+                       cat >> confdefs.h <<\EOF
+#define HAVE_HEIMDAL_KERBEROS 1
+EOF
+
 
                else
                        have_krb5=no
-                       echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
+                       echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
                fi
 
                if test $have_krb5 = yes ; then
@@ -5874,17 +6069,17 @@ if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5878: checking for $ac_hdr" >&5
+echo "configure:6073: 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 5883 "configure"
+#line 6078 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6083: \"$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*
@@ -5914,22 +6109,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:5918: checking for main in -lkrb4" >&5
+echo "configure:6113: 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 5926 "configure"
+#line 6121 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6128: \"$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
@@ -5954,7 +6149,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:5958: checking for main in -lkrb4" >&5
+echo "configure:6153: 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
@@ -5962,14 +6157,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5966 "configure"
+#line 6161 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:5973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6168: \"$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
@@ -6011,7 +6206,7 @@ EOF
 
 
                        echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:6015: checking for des_debug in Kerberos libraries" >&5
+echo "configure:6210: 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
@@ -6019,7 +6214,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 6023 "configure"
+#line 6218 "configure"
 #include "confdefs.h"
 
 #include <kerberosIV/krb.h>
@@ -6032,7 +6227,7 @@ des_debug = 1;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6231: \"$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
@@ -6071,17 +6266,17 @@ if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6075: checking for $ac_hdr" >&5
+echo "configure:6270: 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 6080 "configure"
+#line 6275 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6280: \"$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*
@@ -6110,7 +6305,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:6114: checking for main in -lkrb" >&5
+echo "configure:6309: 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
@@ -6118,14 +6313,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6122 "configure"
+#line 6317 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:6129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6324: \"$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
@@ -6195,17 +6390,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:6199: checking for $ac_hdr" >&5
+echo "configure:6394: 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 6204 "configure"
+#line 6399 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6404: \"$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*
@@ -6234,7 +6429,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:6238: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
+echo "configure:6433: 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
@@ -6242,7 +6437,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6246 "configure"
+#line 6441 "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
@@ -6253,7 +6448,7 @@ int main() {
 SSLeay_add_ssl_algorithms()
 ; return 0; }
 EOF
-if { (eval echo configure:6257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6452: \"$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
@@ -6278,7 +6473,7 @@ fi
                        
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
-echo "configure:6282: checking for SSL_library_init in -lssl" >&5
+echo "configure:6477: 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
@@ -6286,7 +6481,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6290 "configure"
+#line 6485 "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
@@ -6297,7 +6492,7 @@ int main() {
 SSL_library_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6496: \"$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
@@ -6323,7 +6518,7 @@ fi
 
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
-echo "configure:6327: checking for ssl3_accept in -lssl" >&5
+echo "configure:6522: 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
@@ -6331,7 +6526,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6335 "configure"
+#line 6530 "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
@@ -6342,7 +6537,7 @@ int main() {
 ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:6346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6541: \"$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
@@ -6412,12 +6607,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6416: checking for $ac_func" >&5
+echo "configure:6611: 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 6421 "configure"
+#line 6616 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6441,7 +6636,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6640: \"$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
@@ -6470,19 +6665,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:6474: checking number of arguments of ctime_r" >&5
+echo "configure:6669: 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 6479 "configure"
+#line 6674 "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:6486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs3=yes
 else
@@ -6494,14 +6689,14 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6498 "configure"
+#line 6693 "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:6505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs2=yes
 else
@@ -6541,12 +6736,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:6545: checking number of arguments of gethostbyname_r" >&5
+echo "configure:6740: 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 6550 "configure"
+#line 6745 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6560,7 +6755,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs5=yes
 else
@@ -6572,7 +6767,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6576 "configure"
+#line 6771 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6587,7 +6782,7 @@ struct hostent hent;struct hostent *rhent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs6=yes
 else
@@ -6628,12 +6823,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:6632: checking number of arguments of gethostbyaddr_r" >&5
+echo "configure:6827: 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 6637 "configure"
+#line 6832 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6649,7 +6844,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        alen, AF_INET, &hent, buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs7=yes
 else
@@ -6661,7 +6856,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 6665 "configure"
+#line 6860 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -6679,7 +6874,7 @@ struct hostent hent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:6683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs8=yes
 else
@@ -6741,19 +6936,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:6746: 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:6752: checking for _beginthread" >&5
+       echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
+echo "configure:6941: 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 6757 "configure"
+#line 6946 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _beginthread(); below.  */
@@ -6777,7 +6966,7 @@ f = _beginthread;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6970: \"$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
@@ -6791,18 +6980,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
@@ -6837,17 +7021,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:6841: checking for $ac_hdr" >&5
+echo "configure:7025: 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 6846 "configure"
+#line 7030 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7035: \"$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*
@@ -6876,13 +7060,13 @@ done
 
        if test $ac_cv_header_pthread_h = yes ; then
                echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:6880: checking POSIX thread version" >&5
+echo "configure:7064: 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 6886 "configure"
+#line 7070 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -6904,7 +7088,7 @@ rm -f conftest*
 
 
        cat > conftest.$ac_ext <<EOF
-#line 6908 "configure"
+#line 7092 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -6957,12 +7141,12 @@ EOF
 
                
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:6961: checking for LinuxThreads pthread.h" >&5
+echo "configure:7145: 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 6966 "configure"
+#line 7150 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -6989,12 +7173,12 @@ EOF
 
                
        echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
-echo "configure:6993: checking for GNU Pth pthread.h" >&5
+echo "configure:7177: 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 6998 "configure"
+#line 7182 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 #ifdef _POSIX_THREAD_IS_GNU_PTH
@@ -7023,17 +7207,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:7027: checking for $ac_hdr" >&5
+echo "configure:7211: 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 7032 "configure"
+#line 7216 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7221: \"$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*
@@ -7063,14 +7247,14 @@ done
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
-echo "configure:7067: checking for pthread_create in default libraries" >&5
+echo "configure:7251: 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 7074 "configure"
+#line 7258 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7089,44 +7273,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:7130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_create=yes
 else
@@ -7138,7 +7347,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7142 "configure"
+#line 7351 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7161,45 +7370,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:7203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ol_cv_pthread_create=yes
 else
@@ -7224,7 +7458,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:7228: checking for pthread link with -kthread" >&5
+echo "configure:7462: 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
@@ -7235,7 +7469,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7239 "configure"
+#line 7473 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7254,44 +7488,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:7295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_kthread=yes
 else
@@ -7303,7 +7562,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7307 "configure"
+#line 7566 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7326,45 +7585,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:7368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7652: \"$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
@@ -7394,7 +7678,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:7398: checking for pthread link with -pthread" >&5
+echo "configure:7682: 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
@@ -7405,7 +7689,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7409 "configure"
+#line 7693 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7424,44 +7708,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:7465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthread=yes
 else
@@ -7473,7 +7782,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7477 "configure"
+#line 7786 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7496,45 +7805,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:7538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7872: \"$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
@@ -7564,7 +7898,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:7568: checking for pthread link with -pthreads" >&5
+echo "configure:7902: 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
@@ -7575,7 +7909,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7579 "configure"
+#line 7913 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7594,44 +7928,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:7635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthreads=yes
 else
@@ -7643,7 +8002,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7647 "configure"
+#line 8006 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7666,45 +8025,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:7708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8092: \"$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
@@ -7734,7 +8118,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:7738: checking for pthread link with -mthreads" >&5
+echo "configure:8122: 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
@@ -7745,7 +8129,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7749 "configure"
+#line 8133 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7764,44 +8148,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:7805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_mthreads=yes
 else
@@ -7813,7 +8222,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7817 "configure"
+#line 8226 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7836,45 +8245,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:7878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8312: \"$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
@@ -7904,7 +8338,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:7908: checking for pthread link with -thread" >&5
+echo "configure:8342: 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
@@ -7915,7 +8349,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 7919 "configure"
+#line 8353 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -7934,44 +8368,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:7975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_thread=yes
 else
@@ -7983,7 +8442,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 7987 "configure"
+#line 8446 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8006,45 +8465,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:8048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8532: \"$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
@@ -8075,7 +8559,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:8079: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+echo "configure:8563: 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
@@ -8086,7 +8570,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8090 "configure"
+#line 8574 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8105,44 +8589,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
-#endif
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #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 );
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
 #endif
 
-#ifdef HAVE_LINUX_THREADS
-       pthread_kill_other_threads_np();
+       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
 
-       exit( status );
+#else
+       /* 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
+
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8655: \"$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
@@ -8154,7 +8663,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8158 "configure"
+#line 8667 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8177,45 +8686,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:8219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8753: \"$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
@@ -8245,7 +8779,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:8249: checking for pthread link with -lpthread -lmach -lexc" >&5
+echo "configure:8783: 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
@@ -8256,7 +8790,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8260 "configure"
+#line 8794 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8275,44 +8809,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:8316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8875: \"$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
@@ -8324,7 +8883,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8328 "configure"
+#line 8887 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8347,45 +8906,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:8389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8973: \"$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
@@ -8416,7 +9000,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:8420: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+echo "configure:9004: 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
@@ -8427,7 +9011,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8431 "configure"
+#line 9015 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8446,44 +9030,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -8495,7 +9104,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8499 "configure"
+#line 9108 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8518,45 +9127,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:8560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9194: \"$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
@@ -8587,7 +9221,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:8591: checking for pthread link with -lpthread" >&5
+echo "configure:9225: 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
@@ -8598,7 +9232,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8602 "configure"
+#line 9236 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8617,44 +9251,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread=yes
 else
@@ -8666,7 +9325,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8670 "configure"
+#line 9329 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8689,45 +9348,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:8731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9415: \"$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
@@ -8757,7 +9441,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:8761: checking for pthread link with -lc_r" >&5
+echo "configure:9445: 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
@@ -8768,7 +9452,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8772 "configure"
+#line 9456 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8787,44 +9471,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9537: \"$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
@@ -8836,7 +9545,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 8840 "configure"
+#line 9549 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8859,45 +9568,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:8901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9635: \"$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
@@ -8928,7 +9662,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:8932: checking for pthread link with -threads" >&5
+echo "configure:9666: 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
@@ -8939,7 +9673,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 8943 "configure"
+#line 9677 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -8958,44 +9692,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:8999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_threads=yes
 else
@@ -9007,7 +9766,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9011 "configure"
+#line 9770 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9030,45 +9789,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
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9856: \"$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
@@ -9099,7 +9883,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:9103: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+echo "configure:9887: 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
@@ -9110,7 +9894,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9114 "configure"
+#line 9898 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9129,44 +9913,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
 #endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9979: \"$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
@@ -9178,7 +9987,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9182 "configure"
+#line 9991 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9201,45 +10010,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:9243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10077: \"$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
@@ -9269,7 +10103,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:9273: checking for pthread link with -lpthreads -lmach -lexc" >&5
+echo "configure:10107: 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
@@ -9280,7 +10114,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9284 "configure"
+#line 10118 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9299,44 +10133,69 @@ int main() {
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10199: \"$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
@@ -9348,7 +10207,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9352 "configure"
+#line 10211 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9371,45 +10230,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
-#else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
 #endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10297: \"$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
@@ -9439,7 +10323,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:9443: checking for pthread link with -lpthreads -lexc" >&5
+echo "configure:10327: 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
@@ -9450,7 +10334,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9454 "configure"
+#line 10338 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9469,44 +10353,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:9510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10419: \"$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
@@ -9518,7 +10427,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9522 "configure"
+#line 10431 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9541,45 +10450,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+#endif
+       }
+       if( status ) return status;
 #endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10517: \"$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
@@ -9610,7 +10544,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:9614: checking for pthread link with -lpthreads" >&5
+echo "configure:10548: 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
@@ -9621,7 +10555,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 9625 "configure"
+#line 10559 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9640,44 +10574,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:9681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10640: \"$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
@@ -9689,7 +10648,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 9693 "configure"
+#line 10652 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -9712,45 +10671,70 @@ int main(argc, argv)
        /* pthread test function */
        pthread_t t;
        int status;
-#if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
-       /* This system (e.g. AIX) defaults detached; must override */
+       int detach = 1;
+
+#ifdef HAVE_PTHREADS_FINAL
+       /* Final pthreads */
        pthread_attr_t attr;
 
        status = pthread_attr_init(&attr);
-       if( status ) exit( status );
-
-       status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
-       if( status ) exit( status );
+       if( status ) return status;
 
-#define        ATTR    &attr
+#if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
+       if( !detach ) {
+#if defined( PTHREAD_CREATE_JOINABLE )
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 #else
-#if HAVE_PTHREADS_D4
-#define        ATTR    pthread_attr_default
-#else
-#define        ATTR    NULL
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PTHREAD_CREATE_DETACHED
+       } else {
+               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 #endif
+       }
+       if( status ) return status;
+#endif
+
+       status = pthread_create( &t, &attr, task, NULL );
+       if( status ) return status;
+
+#if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( t );
+               if( status ) return status;
+       }
 #endif
-       /* make sure pthread_create() isn't just a stub */
-       status = pthread_create(&t, ATTR, task, NULL);
-       if( status ) exit( status );
 
-       /* make sure pthread_detach() isn't just a stub */
-#if HAVE_PTHREADS_D4
-       status = pthread_detach( &t );
 #else
-       status = pthread_detach( t );
+       /* Draft 4 pthreads */
+       status = pthread_create( &t, pthread_attr_default, task, NULL );
+       if( status ) return status;
+
+       if( detach ) {
+               /* give thread a chance to complete */
+               /* it should remain joinable and hence detachable */
+               sleep( 1 );
+
+               status = pthread_detach( &t );
+               if( status ) return status;
+       }
 #endif
 
 #ifdef HAVE_LINUX_THREADS
        pthread_kill_other_threads_np();
 #endif
 
-       exit( status );
+       return 0;
 
 }
 
 EOF
-if { (eval echo configure:9754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10738: \"$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
@@ -9792,12 +10776,12 @@ EOF
                                                                                                for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9796: checking for $ac_func" >&5
+echo "configure:10780: 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 9801 "configure"
+#line 10785 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9821,7 +10805,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10809: \"$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
@@ -9849,7 +10833,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:9853: checking for sched_yield in -lrt" >&5
+echo "configure:10837: 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
@@ -9857,7 +10841,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9861 "configure"
+#line 10845 "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
@@ -9868,7 +10852,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:9872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10856: \"$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:9904: checking for $ac_func" >&5
+echo "configure:10888: 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 9909 "configure"
+#line 10893 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9929,7 +10913,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10917: \"$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
@@ -9963,12 +10947,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:9967: checking for $ac_func" >&5
+echo "configure:10951: 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 9972 "configure"
+#line 10956 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9992,7 +10976,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10980: \"$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
@@ -10018,13 +11002,13 @@ done
 
 
                                                                        echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:10022: checking for pthread_detach with <pthread.h>" >&5
+echo "configure:11006: 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 10028 "configure"
+#line 11012 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -10036,7 +11020,7 @@ int main() {
 pthread_detach(NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:10040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11024: \"$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
@@ -10068,12 +11052,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10072: checking for $ac_func" >&5
+echo "configure:11056: 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 10077 "configure"
+#line 11061 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10097,7 +11081,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11085: \"$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
@@ -10126,12 +11110,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:10130: checking for $ac_func" >&5
+echo "configure:11114: 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 10135 "configure"
+#line 11119 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10155,7 +11139,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11143: \"$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
@@ -10180,7 +11164,7 @@ fi
 done
 
        echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
-echo "configure:10184: checking for LinuxThreads implementation" >&5
+echo "configure:11168: 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
@@ -10193,7 +11177,7 @@ echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
        
        
        echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
-echo "configure:10197: checking for LinuxThreads consistency" >&5
+echo "configure:11181: checking for LinuxThreads consistency" >&5
 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10218,7 +11202,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:10222: checking if pthread_create() works" >&5
+echo "configure:11206: 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
@@ -10227,7 +11211,7 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 10231 "configure"
+#line 11215 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -10250,45 +11234,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:10292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11301: \"$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
@@ -10310,7 +11319,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:10314: checking if select yields when using pthreads" >&5
+echo "configure:11323: 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
@@ -10319,7 +11328,7 @@ else
   ol_cv_pthread_select_yields=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10323 "configure"
+#line 11332 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10395,7 +11404,7 @@ int main(argc, argv)
        exit(2);
 }
 EOF
-if { (eval echo configure:10399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11408: \"$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
@@ -10423,7 +11432,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 cthreads.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10443: checking for $ac_hdr" >&5
+echo "configure:11452: 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 10448 "configure"
+#line 11457 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11462: \"$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*
@@ -10479,12 +11488,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:10483: checking for cthread_fork" >&5
+echo "configure:11492: 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 10488 "configure"
+#line 11497 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -10508,7 +11517,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11521: \"$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
@@ -10530,7 +11539,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:10534: checking for cthread_fork with -all_load" >&5
+echo "configure:11543: 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
@@ -10538,7 +11547,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 10542 "configure"
+#line 11551 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -10547,7 +11556,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:10551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11560: \"$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
@@ -10566,23 +11575,87 @@ echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
                        if test $ol_cv_cthread_all_load = yes ; then
                                LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
                                ol_link_threads=mach
+                               ol_with_threads=found
                        fi
                fi
 
-               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:11590: 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 11595 "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:11619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_cthread_fork=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_cthread_fork=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_link_threads=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+               LIBS="$save_LIBS"
 
+               if test $ol_link_threads = yes ; then
+                       LTHREAD_LIBS="-lthreads"
+                       ol_link_threads=mach
+                       ol_with_threads=found
                else
                        { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
                fi
-       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 \
@@ -10592,17 +11665,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:10596: checking for $ac_hdr" >&5
+echo "configure:11669: 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 10601 "configure"
+#line 11674 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11679: \"$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 +11704,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:10635: checking for pth_version in -lpth" >&5
+echo "configure:11708: 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
@@ -10639,7 +11712,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10643 "configure"
+#line 11716 "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 +11723,7 @@ int main() {
 pth_version()
 ; 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:11727: \"$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
@@ -10679,6 +11752,7 @@ EOF
 
                        LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
                        ol_link_threads=pth
+                       ol_with_threads=found
 
                        if test $ol_with_yielding_select = auto ; then
                                ol_with_yielding_select=yes
@@ -10694,17 +11768,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:10698: checking for $ac_hdr" >&5
+echo "configure:11772: 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 10703 "configure"
+#line 11777 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11782: \"$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*
@@ -10732,7 +11806,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:10736: checking for thr_create in -lthread" >&5
+echo "configure:11810: 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
@@ -10740,7 +11814,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10744 "configure"
+#line 11818 "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
@@ -10751,7 +11825,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:10755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11829: \"$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
@@ -10791,12 +11865,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10795: checking for $ac_func" >&5
+echo "configure:11869: 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 10800 "configure"
+#line 11874 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10820,7 +11894,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11898: \"$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
@@ -10851,17 +11925,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10855: checking for $ac_hdr" >&5
+echo "configure:11929: 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 10860 "configure"
+#line 11934 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11939: \"$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*
@@ -10889,7 +11963,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:10893: checking for lwp_create in -llwp" >&5
+echo "configure:11967: 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
@@ -10897,7 +11971,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10901 "configure"
+#line 11975 "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
@@ -10908,7 +11982,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:10912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11986: \"$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
@@ -10961,17 +12035,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:10965: checking for $ac_hdr" >&5
+echo "configure:12039: 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 10970 "configure"
+#line 12044 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12049: \"$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*
@@ -11000,12 +12074,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11004: checking for $ac_func" >&5
+echo "configure:12078: 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 11009 "configure"
+#line 12083 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -11029,7 +12103,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:11033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12107: \"$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
@@ -11055,12 +12129,12 @@ done
 
        
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:11059: checking for LinuxThreads pthread.h" >&5
+echo "configure:12133: 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 11064 "configure"
+#line 12138 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -11090,17 +12164,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11094: checking for $ac_hdr" >&5
+echo "configure:12168: 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 11099 "configure"
+#line 12173 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12178: \"$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*
@@ -11130,17 +12204,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11134: checking for $ac_hdr" >&5
+echo "configure:12208: 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 11139 "configure"
+#line 12213 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12218: \"$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*
@@ -11170,17 +12244,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11174: checking for $ac_hdr" >&5
+echo "configure:12248: 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 11179 "configure"
+#line 12253 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12258: \"$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*
@@ -11239,20 +12313,20 @@ EOF
 
 
                        echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:11243: checking for thread specific errno" >&5
+echo "configure:12317: 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 11249 "configure"
+#line 12323 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12330: \"$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:11272: checking for thread specific h_errno" >&5
+echo "configure:12346: 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 11278 "configure"
+#line 12352 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 h_errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:11285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12359: \"$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
@@ -11340,17 +12414,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:11344: checking for $ac_hdr" >&5
+echo "configure:12418: 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 11349 "configure"
+#line 12423 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12428: \"$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*
@@ -11378,13 +12452,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:11382: checking if Berkeley DB header compatibility" >&5
+echo "configure:12456: 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 11388 "configure"
+#line 12462 "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:11425: checking for Berkeley DB link (default)" >&5
+echo "configure:12499: 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
@@ -11431,7 +12505,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11435 "configure"
+#line 12509 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11450,6 +12524,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
@@ -11460,7 +12552,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -11484,7 +12576,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:11488: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:12580: 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
@@ -11494,7 +12586,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11498 "configure"
+#line 12590 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11513,6 +12605,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
@@ -11523,7 +12633,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -11545,9 +12655,90 @@ echo "$ac_t""$ol_cv_db_db" 1>&6
        fi
 fi
 
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
+echo "configure:12661: checking for Berkeley DB link (-ldb4)" >&5
+if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb4
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 12671 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
+int main() {
+
+#if DB_VERSION_MAJOR > 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
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:12718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db4=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db4=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db4" 1>&6
+
+       if test $ol_cv_db_db4 = yes ; then
+               ol_cv_lib_db=-ldb4
+       fi
+fi
+
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:11551: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:12742: 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
@@ -11557,7 +12748,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11561 "configure"
+#line 12752 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11576,6 +12767,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
@@ -11586,7 +12795,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -11610,7 +12819,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:11614: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:12823: 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
@@ -11620,7 +12829,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11624 "configure"
+#line 12833 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11639,6 +12848,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
@@ -11649,7 +12876,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -11673,7 +12900,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:11677: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:12904: 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
@@ -11683,7 +12910,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11687 "configure"
+#line 12914 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11702,6 +12929,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
@@ -11712,7 +12957,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -11747,17 +12992,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:11751: checking for $ac_hdr" >&5
+echo "configure:12996: 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 11756 "configure"
+#line 13001 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13006: \"$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*
@@ -11787,7 +13032,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:11791: checking for Berkeley DB link (default)" >&5
+echo "configure:13036: 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
@@ -11797,7 +13042,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11801 "configure"
+#line 13046 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11816,6 +13061,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
@@ -11826,7 +13089,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -11850,7 +13113,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:11854: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:13117: 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
@@ -11860,7 +13123,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11864 "configure"
+#line 13127 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11879,6 +13142,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
@@ -11889,7 +13170,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -11911,9 +13192,90 @@ echo "$ac_t""$ol_cv_db_db" 1>&6
        fi
 fi
 
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
+echo "configure:13198: checking for Berkeley DB link (-ldb4)" >&5
+if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb4
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 13208 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
+int main() {
+
+#if DB_VERSION_MAJOR > 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
+       db_appexit( NULL );
+#else
+       (void) dbopen( NULL, 0, 0, 0, NULL);
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:13255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db4=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db4=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db4" 1>&6
+
+       if test $ol_cv_db_db4 = yes ; then
+               ol_cv_lib_db=-ldb4
+       fi
+fi
+
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:11917: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:13279: 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
@@ -11923,7 +13285,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11927 "configure"
+#line 13289 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -11942,6 +13304,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
@@ -11952,7 +13332,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -11976,7 +13356,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:11980: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:13360: 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
@@ -11986,7 +13366,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 11990 "configure"
+#line 13370 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -12005,6 +13385,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
@@ -12015,7 +13413,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -12039,7 +13437,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:12043: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:13441: 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
@@ -12049,7 +13447,7 @@ else
        LIBS="$ol_DB_LIB $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 12053 "configure"
+#line 13451 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -12068,6 +13466,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
@@ -12078,7 +13494,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -12104,7 +13520,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:12108: checking for Berkeley DB thread support" >&5
+echo "configure:13524: 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
@@ -12118,7 +13534,7 @@ else
   ol_cv_berkeley_db_thread=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 12122 "configure"
+#line 13538 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -12132,19 +13548,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
@@ -12156,19 +13593,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:12172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13605: \"$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:12236: checking for MDBM library" >&5
+echo "configure:13669: 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:12242: checking for mdbm_set_chain" >&5
+echo "configure:13675: 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 12247 "configure"
+#line 13680 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mdbm_set_chain(); below.  */
@@ -12267,7 +13700,7 @@ f = mdbm_set_chain;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13704: \"$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
@@ -12286,7 +13719,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
-echo "configure:12290: checking for mdbm_set_chain in -lmdbm" >&5
+echo "configure:13723: 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
@@ -12294,7 +13727,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12298 "configure"
+#line 13731 "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
@@ -12305,7 +13738,7 @@ int main() {
 mdbm_set_chain()
 ; return 0; }
 EOF
-if { (eval echo configure:12309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13742: \"$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
@@ -12340,17 +13773,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:12344: checking for $ac_hdr" >&5
+echo "configure:13777: 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 12349 "configure"
+#line 13782 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13787: \"$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*
@@ -12377,7 +13810,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12381: checking for db" >&5
+echo "configure:13814: 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:12414: checking for GDBM library" >&5
+echo "configure:13847: 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:12420: checking for gdbm_open" >&5
+echo "configure:13853: 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 12425 "configure"
+#line 13858 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -12445,7 +13878,7 @@ f = gdbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13882: \"$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
@@ -12464,7 +13897,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:12468: checking for gdbm_open in -lgdbm" >&5
+echo "configure:13901: 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
@@ -12472,7 +13905,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12476 "configure"
+#line 13909 "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
@@ -12483,7 +13916,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13920: \"$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
@@ -12518,17 +13951,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:12522: checking for $ac_hdr" >&5
+echo "configure:13955: 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 12527 "configure"
+#line 13960 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13965: \"$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*
@@ -12555,7 +13988,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12559: checking for db" >&5
+echo "configure:13992: 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:12593: checking for NDBM library" >&5
+echo "configure:14026: 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:12599: checking for dbm_open" >&5
+echo "configure:14032: 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 12604 "configure"
+#line 14037 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -12624,7 +14057,7 @@ f = dbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14061: \"$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
@@ -12643,7 +14076,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:12647: checking for dbm_open in -lndbm" >&5
+echo "configure:14080: 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
@@ -12651,7 +14084,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12655 "configure"
+#line 14088 "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
@@ -12662,7 +14095,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14099: \"$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
@@ -12682,7 +14115,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:12686: checking for dbm_open in -ldbm" >&5
+echo "configure:14119: 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
@@ -12690,7 +14123,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12694 "configure"
+#line 14127 "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
@@ -12701,7 +14134,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14138: \"$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
@@ -12738,17 +14171,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:12742: checking for $ac_hdr" >&5
+echo "configure:14175: 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 12747 "configure"
+#line 14180 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14185: \"$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*
@@ -12775,7 +14208,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:12779: checking for db" >&5
+echo "configure:14212: checking for db" >&5
 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12828,17 +14261,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:12832: checking for $ac_hdr" >&5
+echo "configure:14265: 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 12837 "configure"
+#line 14270 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14275: \"$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*
@@ -12869,7 +14302,7 @@ done
                have_wrappers=no
        else
                cat > conftest.$ac_ext <<EOF
-#line 12873 "configure"
+#line 14306 "configure"
 #include "confdefs.h"
 
 int allow_severity = 0;
@@ -12879,7 +14312,7 @@ int main() {
 hosts_access()
 ; return 0; }
 EOF
-if { (eval echo configure:12883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   have_wrappers=yes
 else
@@ -12899,7 +14332,7 @@ EOF
                WRAP_LIBS="-lwrap"
 
                                                echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:12903: checking for main in -lnsl" >&5
+echo "configure:14336: 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
@@ -12907,14 +14340,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 12911 "configure"
+#line 14344 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:12918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14351: \"$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:12959: checking for openlog" >&5
+echo "configure:14392: 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 12964 "configure"
+#line 14397 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -12984,7 +14417,7 @@ f = openlog;
 
 ; return 0; }
 EOF
-if { (eval echo configure:12988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14421: \"$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
@@ -13012,7 +14445,7 @@ 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:13016: checking for SQLDriverConnect in -liodbc" >&5
+echo "configure:14449: 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
@@ -13020,7 +14453,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-liodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13024 "configure"
+#line 14457 "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
@@ -13031,7 +14464,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:13035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14468: \"$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
@@ -13056,7 +14489,7 @@ fi
                ol_link_sql="-liodbc"
        else
                echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
-echo "configure:13060: checking for SQLDriverConnect in -lodbc" >&5
+echo "configure:14493: 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
@@ -13064,7 +14497,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13068 "configure"
+#line 14501 "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
@@ -13075,7 +14508,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:13079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14512: \"$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
@@ -13114,17 +14547,17 @@ for ac_hdr in termcap.h ncurses.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:13118: checking for $ac_hdr" >&5
+echo "configure:14551: 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 13123 "configure"
+#line 14556 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14561: \"$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*
@@ -13153,7 +14586,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:13157: checking for tputs in -ltermcap" >&5
+echo "configure:14590: 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
@@ -13161,7 +14594,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13165 "configure"
+#line 14598 "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
@@ -13172,7 +14605,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:13176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13205,7 +14638,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:13209: checking for initscr in -lncurses" >&5
+echo "configure:14642: 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
@@ -13213,7 +14646,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13217 "configure"
+#line 14650 "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
@@ -13224,7 +14657,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:13228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14661: \"$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
@@ -13270,17 +14703,17 @@ if test $ol_with_cyrus_sasl != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:13274: checking for $ac_hdr" >&5
+echo "configure:14707: 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 13279 "configure"
+#line 14712 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14717: \"$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*
@@ -13309,7 +14742,7 @@ 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:13313: checking for sasl_client_init in -lsasl" >&5
+echo "configure:14746: 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
@@ -13317,7 +14750,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13321 "configure"
+#line 14754 "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
@@ -13328,7 +14761,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:13332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14765: \"$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
 #define HAVE_CYRUS_SASL 1
 EOF
 
+                       echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
+echo "configure:14794: checking Cyrus SASL library version" >&5
+if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cat > conftest.$ac_ext <<EOF
+#line 14800 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_SASL_SASL_H
+#include <sasl/sasl.h>
+#else
+#include <sasl.h>
+#endif
+
+/* require 1.5.x, unable to use 2.x */
+#if SASL_VERSION_MAJOR == 1  && SASL_VERSION_MINOR >= 5
+       char *__sasl_compat = "1.5.x okay";
+#endif
+       
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__sasl_compat" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_sasl_compat=yes
+else
+  rm -rf conftest*
+  ol_cv_sasl_compat=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ol_cv_sasl_compat" 1>&6
+
+                       if test $ol_cv_sasl_compat = no ; then
+                               ol_link_sasl=no
+                               { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
+                       fi
                        ol_link_sasl=yes
                fi
        fi
@@ -13409,13 +14882,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:13413: checking fetch(3) library" >&5
+echo "configure:14886: 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 13419 "configure"
+#line 14892 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -13425,7 +14898,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:13429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_lib_fetch=yes
 else
@@ -13463,17 +14936,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:13467: checking for $ac_hdr" >&5
+echo "configure:14940: 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 13472 "configure"
+#line 14945 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:14950: \"$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*
@@ -13504,7 +14977,7 @@ done
                save_LIBS="$LIBS"
                LIBS="$TERMCAP_LIBS $LIBS"
                echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:13508: checking for readline in -lreadline" >&5
+echo "configure:14981: 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
@@ -13512,7 +14985,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13516 "configure"
+#line 14989 "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
@@ -13523,7 +14996,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:13527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15000: \"$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:13569: checking for crypt" >&5
+echo "configure:15042: 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 13574 "configure"
+#line 15047 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -13594,7 +15067,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13598: \"$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_func_crypt=yes"
 else
@@ -13613,7 +15086,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:13617: checking for crypt in -lcrypt" >&5
+echo "configure:15090: 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
@@ -13621,7 +15094,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13625 "configure"
+#line 15098 "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
@@ -13632,7 +15105,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:13636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15109: \"$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:13679: checking for setproctitle" >&5
+echo "configure:15152: 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 13684 "configure"
+#line 15157 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -13704,7 +15177,7 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:13708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15181: \"$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
@@ -13723,7 +15196,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:13727: checking for setproctitle in -lutil" >&5
+echo "configure:15200: 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
@@ -13731,7 +15204,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 13735 "configure"
+#line 15208 "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
@@ -13742,7 +15215,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:13746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15219: \"$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
@@ -13778,12 +15251,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:13782: checking for ANSI C header files" >&5
+echo "configure:15255: 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 13787 "configure"
+#line 15260 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -13791,7 +15264,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:13795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15268: \"$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*
@@ -13808,7 +15281,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 13812 "configure"
+#line 15285 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -13826,7 +15299,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 13830 "configure"
+#line 15303 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -13847,7 +15320,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 13851 "configure"
+#line 15324 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -13865,7 +15338,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:13869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -13889,12 +15362,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:13893: checking for mode_t" >&5
+echo "configure:15366: 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 13898 "configure"
+#line 15371 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13925,12 +15398,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:13929: checking for off_t" >&5
+echo "configure:15402: 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 13934 "configure"
+#line 15407 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13961,12 +15434,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:13965: checking for pid_t" >&5
+echo "configure:15438: 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 13970 "configure"
+#line 15443 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -13997,19 +15470,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:14001: checking for ptrdiff_t" >&5
+echo "configure:15474: 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 14006 "configure"
+#line 15479 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:14013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -14030,12 +15503,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:14034: checking return type of signal handlers" >&5
+echo "configure:15507: 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 14039 "configure"
+#line 15512 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -14052,7 +15525,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:14056: \"$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*
   ac_cv_type_signal=void
 else
@@ -14071,12 +15544,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:14075: checking for size_t" >&5
+echo "configure:15548: 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 14080 "configure"
+#line 15553 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:14112: checking for ssize_t" >&5
+echo "configure:15585: 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 14117 "configure"
+#line 15590 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -14144,12 +15617,12 @@ EOF
 fi
 
 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
-echo "configure:14148: checking for caddr_t" >&5
+echo "configure:15621: 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 14153 "configure"
+#line 15626 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:14185: checking for socklen_t" >&5
+echo "configure:15658: 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 14190 "configure"
+#line 15663 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -14200,7 +15673,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:14204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_socklen_t=yes
 else
@@ -14221,12 +15694,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:14225: checking for member st_blksize in aggregate type struct stat" >&5
+echo "configure:15698: 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 14230 "configure"
+#line 15703 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -14234,7 +15707,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:14238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_struct_member_st_blksize=yes
 else
@@ -14256,12 +15729,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:14260: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:15733: 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 14265 "configure"
+#line 15738 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -14270,7 +15743,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:14274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -14291,12 +15764,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:14295: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:15768: 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 14300 "configure"
+#line 15773 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -14304,7 +15777,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:14308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -14325,12 +15798,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:14329: checking for uid_t in sys/types.h" >&5
+echo "configure:15802: 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 14334 "configure"
+#line 15807 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -14359,19 +15832,19 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:14363: checking for sig_atomic_t" >&5
+echo "configure:15836: 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 14368 "configure"
+#line 15841 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:14375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_sig_atomic_t=yes
 else
@@ -14395,13 +15868,13 @@ EOF
 
 # test for pw_gecos in struct passwd
 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
-echo "configure:14399: checking struct passwd for pw_gecos" >&5
+echo "configure:15872: 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 14405 "configure"
+#line 15878 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -14411,7 +15884,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15888: \"$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:14437: checking struct passwd for pw_passwd" >&5
+echo "configure:15910: 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 14443 "configure"
+#line 15916 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -14449,7 +15922,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_passwd=yes
 else
@@ -14471,7 +15944,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:14475: checking if toupper() requires islower()" >&5
+echo "configure:15948: 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
@@ -14480,7 +15953,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 14484 "configure"
+#line 15957 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -14492,7 +15965,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:14496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15969: \"$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
@@ -14515,12 +15988,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:14519: checking for working const" >&5
+echo "configure:15992: 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 14524 "configure"
+#line 15997 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -14569,7 +16042,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -14590,12 +16063,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:14594: checking if compiler understands volatile" >&5
+echo "configure:16067: 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 14599 "configure"
+#line 16072 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -14604,7 +16077,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:14608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -14634,14 +16107,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:14638: checking whether byte ordering is bigendian" >&5
+echo "configure:16111: 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 14645 "configure"
+#line 16118 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -14652,11 +16125,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16129: \"$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 14660 "configure"
+#line 16133 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -14667,7 +16140,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:14671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -14687,7 +16160,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 14691 "configure"
+#line 16164 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -14700,7 +16173,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:14704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16177: \"$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:14730: checking size of short" >&5 
+echo "configure:16203: 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 14736 "configure"
+#line 16209 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14742,7 +16215,7 @@ int main() {
 switch (0) case 0: case (sizeof (short) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_short=$ac_size
 else
@@ -14765,13 +16238,13 @@ EOF
  
  
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:14769: checking size of int" >&5 
+echo "configure:16242: 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 14775 "configure"
+#line 16248 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14781,7 +16254,7 @@ int main() {
 switch (0) case 0: case (sizeof (int) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_int=$ac_size
 else
@@ -14804,13 +16277,13 @@ EOF
  
  
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:14808: checking size of long" >&5 
+echo "configure:16281: 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 14814 "configure"
+#line 16287 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -14820,7 +16293,7 @@ int main() {
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:14824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long=$ac_size
 else
@@ -14871,7 +16344,7 @@ EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:14875: checking for 8-bit clean memcmp" >&5
+echo "configure:16348: 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
@@ -14879,7 +16352,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 14883 "configure"
+#line 16356 "configure"
 #include "confdefs.h"
 
 main()
@@ -14889,7 +16362,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:14893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16366: \"$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
@@ -14907,12 +16380,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:14911: checking for strftime" >&5
+echo "configure:16384: 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 14916 "configure"
+#line 16389 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -14936,7 +16409,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:14940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16413: \"$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
@@ -14958,7 +16431,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:14962: checking for strftime in -lintl" >&5
+echo "configure:16435: 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
@@ -14966,7 +16439,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 14970 "configure"
+#line 16443 "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
@@ -14977,7 +16450,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:14981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16454: \"$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:15009: checking for inet_aton()" >&5
+echo "configure:16482: 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 15014 "configure"
+#line 16487 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -15032,7 +16505,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:15036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16509: \"$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
@@ -15054,12 +16527,12 @@ EOF
  
 
 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
-echo "configure:15058: checking for _spawnlp" >&5
+echo "configure:16531: 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 15063 "configure"
+#line 16536 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _spawnlp(); below.  */
@@ -15083,7 +16556,7 @@ f = _spawnlp;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16560: \"$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:15111: checking for _snprintf" >&5
+echo "configure:16584: 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 15116 "configure"
+#line 16589 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _snprintf(); below.  */
@@ -15136,7 +16609,7 @@ f = _snprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16613: \"$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:15166: checking for _vsnprintf" >&5
+echo "configure:16639: 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 15171 "configure"
+#line 16644 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _vsnprintf(); below.  */
@@ -15191,7 +16664,7 @@ f = _vsnprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16668: \"$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:15221: checking for vprintf" >&5
+echo "configure:16694: 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 15226 "configure"
+#line 16699 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -15246,7 +16719,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16723: \"$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:15274: checking for _doprnt" >&5
+echo "configure:16747: 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 15279 "configure"
+#line 16752 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -15299,7 +16772,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16776: \"$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
@@ -15328,12 +16801,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:15332: checking for $ac_func" >&5
+echo "configure:16805: 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 15337 "configure"
+#line 16810 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15357,7 +16830,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16834: \"$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
@@ -15389,6 +16862,7 @@ for ac_func in \
        chroot                  \
        endgrent                \
        endpwent                \
+       fcntl                   \
        flock                   \
        getdtablesize   \
        getgrgid                \
@@ -15417,7 +16891,6 @@ for ac_func in \
        sigaction               \
        signal                  \
        sigset                  \
-       snprintf                \
        strdup                  \
        strerror                \
        strpbrk                 \
@@ -15428,6 +16901,7 @@ for ac_func in \
        strtoul                 \
        strspn                  \
        sysconf                 \
+       usleep                  \
        waitpid                 \
        wait4                   \
        write                   \
@@ -15436,12 +16910,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15440: checking for $ac_func" >&5
+echo "configure:16914: 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 15445 "configure"
+#line 16919 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15465,7 +16939,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16943: \"$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
 done
 
 
-for ac_func in getopt tempnam
+for ac_func in getopt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15497: checking for $ac_func" >&5
+echo "configure:16971: 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 15502 "configure"
+#line 16976 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15522,7 +16996,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17000: \"$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
@@ -15553,19 +17027,15 @@ if test "$ac_cv_func_getopt" != yes; then
     LIBSRCS="$LIBSRCS getopt.c"
 fi
 
-if test "$ac_cv_func_tempnam" != yes; then
-    LIBSRCS="$LIBSRCS tempnam.c"
-fi
-
 # Check Configuration
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:15563: checking declaration of sys_errlist" >&5
+echo "configure:17033: 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 15569 "configure"
+#line 17039 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -15578,7 +17048,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:15582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:17052: \"$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
@@ -15601,20 +17071,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:15605: checking existence of sys_errlist" >&5
+echo "configure:17075: 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 15611 "configure"
+#line 17081 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:15618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17088: \"$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
@@ -15648,12 +17118,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
@@ -15714,12 +17178,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
@@ -16009,7 +17467,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 \
@@ -16091,6 +17548,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
@@ -16215,7 +17673,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 \