]> git.sur5r.net Git - openldap/blobdiff - configure
unordered LDIF fix
[openldap] / configure
index ed6818afff9ac1898aff40d6fb5c6fd7190cf426..32e215fffa7ae42a3774dceab7e0ee883679a2ca 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,8 +1,8 @@
 #! /bin/sh
 # $OpenLDAP$
-# from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.2 2002/02/18 20:48:12 kurt Exp  
+# from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.31 2003/02/15 19:17:36 kurt Exp  
 
-# Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
+# Copyright 1998-2003 The OpenLDAP Foundation.  All Rights Reserved.
 # 
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted only as authorized by the OpenLDAP
@@ -10,7 +10,7 @@
 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
 # top-level directory of the distribution.
 
-echo "Copyright 1998-2002 The OpenLDAP Foundation,  All Rights Reserved."
+echo "Copyright 1998-2003 The OpenLDAP Foundation,  All Rights Reserved."
 echo " Restrictions apply, see COPYRIGHT and LICENSE files."
 
 # Guess values for system-dependent variables and create Makefiles.
@@ -32,25 +32,19 @@ ac_help="$ac_help
 ac_help="$ac_help
   --enable-syslog        enable syslog support [auto]"
 ac_help="$ac_help
-  --enable-proctitle     enable proctitle support [yes]"
-ac_help="$ac_help
-  --enable-cache         enable caching (experimental) [no]"
+  --enable-dynamic       enable linking built binaries with dynamic libs [no]"
 ac_help="$ac_help
-  --enable-referrals     enable LDAPv2+ Referrals (experimental) [no]"
-ac_help="$ac_help
-  --enable-kbind         enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
+  --enable-proctitle     enable proctitle support [yes]"
 ac_help="$ac_help
   --enable-ipv6          enable IPv6 support [auto]"
 ac_help="$ac_help
   --enable-local         enable AF_LOCAL (AF_UNIX) socket support [auto]"
-ac_help="$ac_help
-  --enable-rewrite       enable rewrite [no]"
 ac_help="$ac_help
   --enable-x-compile     enable cross compiling [no]"
 ac_help="$ac_help
   --with-cyrus-sasl      with Cyrus SASL support [auto]"
 ac_help="$ac_help
-  --with-fetch           with fetch URL support [auto]"
+  --with-fetch           with fetch(3) URL support [auto]"
 ac_help="$ac_help
   --with-kerberos        with Kerberos support [auto]"
 ac_help="$ac_help
@@ -72,8 +66,6 @@ ac_help="$ac_help
     --enable-cleartext   enable cleartext passwords [yes]"
 ac_help="$ac_help
     --enable-crypt       enable crypt(3) passwords [no]"
-ac_help="$ac_help
-    --enable-dynamic     enable linking built binaries with dynamic libs [no]"
 ac_help="$ac_help
     --enable-kpasswd     enable Kerberos password verification [no]"
 ac_help="$ac_help
@@ -85,7 +77,9 @@ ac_help="$ac_help
 ac_help="$ac_help
     --enable-phonetic    enable phonetic/soundex [no]"
 ac_help="$ac_help
-    --enable-rlookups    enable reverse lookups [no]"
+    --enable-rewrite     enable DN rewriting in back-ldap and back-meta [no]"
+ac_help="$ac_help
+    --enable-rlookups    enable reverse lookups of client hostnames [no]"
 ac_help="$ac_help
     --enable-slp          enable SLPv2 support [no]"
 ac_help="$ac_help
@@ -93,51 +87,51 @@ ac_help="$ac_help
 ac_help="$ac_help
     --enable-bdb         enable Berkeley DB backend [yes]"
 ac_help="$ac_help
-    --with-bdb-module     module type [static]"
+    --with-bdb-module     module type static|dynamic [static]"
 ac_help="$ac_help
     --enable-dnssrv      enable dnssrv backend [no]"
 ac_help="$ac_help
-    --with-dnssrv-module  module type [static]"
+    --with-dnssrv-module  module type static|dynamic [static]"
 ac_help="$ac_help
     --enable-ldap        enable ldap backend [no]"
 ac_help="$ac_help
-    --with-ldap-module   module type [static]"
+    --with-ldap-module   module type static|dynamic [static]"
 ac_help="$ac_help
     --enable-ldbm        enable ldbm backend [no]"
 ac_help="$ac_help
-    --with-ldbm-api       with LDBM API [auto]"
+    --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
 ac_help="$ac_help
-    --with-ldbm-module   module type [static]"
+    --with-ldbm-module   module type static|dynamic [static]"
 ac_help="$ac_help
-    --with-ldbm-type     use LDBM type [auto]"
+    --with-ldbm-type     use LDBM type auto|btree|hash [auto]"
 ac_help="$ac_help
     --enable-meta        enable metadirectory backend [no]"
 ac_help="$ac_help
-    --with-meta-module   module type [static]"
+    --with-meta-module   module type static|dynamic [static]"
 ac_help="$ac_help
     --enable-monitor     enable monitor backend [no]"
 ac_help="$ac_help
-    --with-monitor-module module type [static]"
+    --with-monitor-module module type static|dynamic [static]"
 ac_help="$ac_help
     --enable-null        enable null backend [no]"
 ac_help="$ac_help
-    --with-null-module   module type [static]"
+    --with-null-module   module type static|dynamic [static]"
 ac_help="$ac_help
     --enable-passwd      enable passwd backend [no]"
 ac_help="$ac_help
-    --with-passwd-module  module type [static]"
+    --with-passwd-module  module type static|dynamic [static]"
 ac_help="$ac_help
     --enable-perl        enable perl backend [no]"
 ac_help="$ac_help
-    --with-perl-module   module type [static]"
+    --with-perl-module   module type static|dynamic [static]"
 ac_help="$ac_help
     --enable-shell       enable shell backend [no]"
 ac_help="$ac_help
-    --with-shell-module          module type [static]"
+    --with-shell-module          module type static|dynamic [static]"
 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|dynamic [static]"
 ac_help="$ac_help
 
 SLURPD (Replication Daemon) Options:"
@@ -868,14 +862,19 @@ fi
 
 SHTOOL="$ac_cv_shtool"
 
-TB=`$SHTOOL echo -e %B`
-TN=`$SHTOOL echo -e %b`
+TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
+TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
+
+OPENLDAP_CVS=""
+if test -d $ac_aux_dir/CVS; then
+       OPENLDAP_CVS="(from CVS sources) "
+fi
 
-echo "Configuring $TB$OL_STRING$TN ..."
+echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
 
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:879: checking host system type" >&5
+echo "configure:878: 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.
@@ -916,7 +915,7 @@ host_os=$ac_cv_host_os
 
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:920: checking target system type" >&5
+echo "configure:919: 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.
@@ -956,7 +955,7 @@ target_os=$ac_cv_target_os
 
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:960: checking build system type" >&5
+echo "configure:959: 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.
@@ -1033,7 +1032,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:1037: checking for a BSD compatible install" >&5
+echo "configure:1036: 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
@@ -1090,7 +1089,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:1094: checking whether build environment is sane" >&5
+echo "configure:1093: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -1151,7 +1150,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:1155: checking for $ac_word" >&5
+echo "configure:1154: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1181,7 +1180,7 @@ test -n "$AWK" && break
 done
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1185: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1184: 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
@@ -1221,7 +1220,7 @@ fi
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1225: checking for working aclocal" >&5
+echo "configure:1224: 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.
@@ -1234,7 +1233,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1238: checking for working autoconf" >&5
+echo "configure:1237: 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.
@@ -1247,7 +1246,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1251: checking for working automake" >&5
+echo "configure:1250: 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.
@@ -1260,7 +1259,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1264: checking for working autoheader" >&5
+echo "configure:1263: 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.
@@ -1273,7 +1272,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1277: checking for working makeinfo" >&5
+echo "configure:1276: 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.
@@ -1293,7 +1292,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:1297: checking for $ac_word" >&5
+echo "configure:1296: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1358,10 +1357,12 @@ EOF
 
 OPENLDAP_LIBVERSION=$OL_API_LIB
 
+OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
+
 
 
 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
-echo "configure:1365: checking configure arguments" >&5
+echo "configure:1366: checking configure arguments" >&5
 
 
 top_builddir=`pwd`
@@ -1427,50 +1428,10 @@ else
        ol_enable_syslog="auto"
 fi
 # end --enable-syslog
-# OpenLDAP --enable-proctitle
-       # Check whether --enable-proctitle or --disable-proctitle was given.
-if test "${enable_proctitle+set}" = set; then
-  enableval="$enable_proctitle"
-  
-       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-proctitle" 1>&2; exit 1; }
-       fi
-       ol_enable_proctitle="$ol_arg"
-
-else
-       ol_enable_proctitle="yes"
-fi
-# end --enable-proctitle
-# OpenLDAP --enable-cache
-       # Check whether --enable-cache or --disable-cache was given.
-if test "${enable_cache+set}" = set; then
-  enableval="$enable_cache"
-  
-       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-cache" 1>&2; exit 1; }
-       fi
-       ol_enable_cache="$ol_arg"
-
-else
-       ol_enable_cache="no"
-fi
-# end --enable-cache
-# OpenLDAP --enable-referrals
-       # Check whether --enable-referrals or --disable-referrals was given.
-if test "${enable_referrals+set}" = set; then
-  enableval="$enable_referrals"
+# OpenLDAP --enable-dynamic
+       # Check whether --enable-dynamic or --disable-dynamic was given.
+if test "${enable_dynamic+set}" = set; then
+  enableval="$enable_dynamic"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1479,18 +1440,18 @@ if test "${enable_referrals+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
        fi
-       ol_enable_referrals="$ol_arg"
+       ol_enable_dynamic="$ol_arg"
 
 else
-       ol_enable_referrals="no"
+       ol_enable_dynamic="no"
 fi
-# end --enable-referrals
-# OpenLDAP --enable-kbind
-       # Check whether --enable-kbind or --disable-kbind was given.
-if test "${enable_kbind+set}" = set; then
-  enableval="$enable_kbind"
+# end --enable-dynamic
+# OpenLDAP --enable-proctitle
+       # Check whether --enable-proctitle or --disable-proctitle was given.
+if test "${enable_proctitle+set}" = set; then
+  enableval="$enable_proctitle"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1499,14 +1460,16 @@ if test "${enable_kbind+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
        fi
-       ol_enable_kbind="$ol_arg"
+       ol_enable_proctitle="$ol_arg"
 
 else
-       ol_enable_kbind="no"
+       ol_enable_proctitle="yes"
 fi
-# end --enable-kbind
+# end --enable-proctitle
+ol_enable_referrals=${ol_enable_referrals-no}
+ol_enable_kbind=${ol_enable_kbind-no}
 # OpenLDAP --enable-ipv6
        # Check whether --enable-ipv6 or --disable-ipv6 was given.
 if test "${enable_ipv6+set}" = set; then
@@ -1547,26 +1510,6 @@ else
        ol_enable_local="auto"
 fi
 # end --enable-local
-# OpenLDAP --enable-rewrite
-       # Check whether --enable-rewrite or --disable-rewrite was given.
-if test "${enable_rewrite+set}" = set; then
-  enableval="$enable_rewrite"
-  
-       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-rewrite" 1>&2; exit 1; }
-       fi
-       ol_enable_rewrite="$ol_arg"
-
-else
-       ol_enable_rewrite="no"
-fi
-# end --enable-rewrite
 # OpenLDAP --enable-x_compile
        # Check whether --enable-x_compile or --disable-x_compile was given.
 if test "${enable_x_compile+set}" = set; then
@@ -1824,26 +1767,6 @@ else
        ol_enable_crypt="no"
 fi
 # end --enable-crypt
-# OpenLDAP --enable-dynamic
-       # Check whether --enable-dynamic or --disable-dynamic was given.
-if test "${enable_dynamic+set}" = set; then
-  enableval="$enable_dynamic"
-  
-       ol_arg=invalid
-       for ol_val in auto yes no ; do
-               if test "$enableval" = "$ol_val" ; then
-                       ol_arg="$ol_val"
-               fi
-       done
-       if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
-       fi
-       ol_enable_dynamic="$ol_arg"
-
-else
-       ol_enable_dynamic="no"
-fi
-# end --enable-dynamic
 # OpenLDAP --enable-kpasswd
        # Check whether --enable-kpasswd or --disable-kpasswd was given.
 if test "${enable_kpasswd+set}" = set; then
@@ -1924,6 +1847,7 @@ else
        ol_enable_modules="no"
 fi
 # end --enable-modules
+ol_enable_multimaster=${ol_enable_multimaster-no}
 # OpenLDAP --enable-phonetic
        # Check whether --enable-phonetic or --disable-phonetic was given.
 if test "${enable_phonetic+set}" = set; then
@@ -1944,6 +1868,26 @@ else
        ol_enable_phonetic="no"
 fi
 # end --enable-phonetic
+# OpenLDAP --enable-rewrite
+       # Check whether --enable-rewrite or --disable-rewrite was given.
+if test "${enable_rewrite+set}" = set; then
+  enableval="$enable_rewrite"
+  
+       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-rewrite" 1>&2; exit 1; }
+       fi
+       ol_enable_rewrite="$ol_arg"
+
+else
+       ol_enable_rewrite="no"
+fi
+# end --enable-rewrite
 # OpenLDAP --enable-rlookups
        # Check whether --enable-rlookups or --disable-rlookups was given.
 if test "${enable_rlookups+set}" = set; then
@@ -2618,6 +2562,9 @@ 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
@@ -2690,6 +2637,7 @@ 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
@@ -2826,7 +2774,6 @@ echo "$ac_t""done" 1>&6
 
 LDAP_LIBS=
 LDIF_LIBS=
-LDBM_LIB=
 LDBM_LIBS=
 LTHREAD_LIBS=
 LUTIL_LIBS=
@@ -2865,7 +2812,6 @@ BUILD_SQL_DYNAMIC=static
 
 SLAPD_MODULES_LDFLAGS=
 SLAPD_MODULES_CPPFLAGS=
-SLAPD_MODULES_LIST=
 
 SLAPD_STATIC_BACKENDS=
 SLAPD_DYNAMIC_BACKENDS=
@@ -2902,7 +2848,7 @@ SLAPD_SLP_LIBS=
 # 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:2906: checking for a BSD compatible install" >&5
+echo "configure:2852: 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
@@ -2983,7 +2929,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:2987: checking for $ac_word" >&5
+echo "configure:2933: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3030,12 +2976,12 @@ done
 fi
 
 if test -z "${CC}"; then
-       for ac_prog in cc
+       for ac_prog in cc gcc
 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:3039: checking for $ac_word" >&5
+echo "configure:2985: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3063,16 +3009,21 @@ fi
 
 test -n "$CC" && break
 done
+test -n "$CC" || CC="missing"
 
-fi
 
+       if test "${CC}" = "missing" ; then
+               { echo "configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC." 1>&2; exit 1; }
+       fi
+fi
 
-for ac_prog in ar gar
+if test -z "${AR}"; then
+       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:3076: checking for $ac_word" >&5
+echo "configure:3027: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3100,9 +3051,14 @@ fi
 
 test -n "$AR" && break
 done
-test -n "$AR" || AR="ar"
+test -n "$AR" || AR="missing"
 
 
+       if test "${AR}" = "missing" ; then
+               { echo "configure: error: Unable to locate ar(1) or suitable replacement.  Check PATH or set AR." 1>&2; exit 1; }
+       fi
+fi
+
 
 
 # Find the correct PATH separator.  Usually this is `:', but
@@ -3117,12 +3073,12 @@ if test "X${PATH_SEPARATOR+set}" != Xset; then
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3121: checking for Cygwin environment" >&5
+echo "configure:3077: 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 3126 "configure"
+#line 3082 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3133,7 +3089,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -3149,19 +3105,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:3153: checking for mingw32 environment" >&5
+echo "configure:3109: 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 3158 "configure"
+#line 3114 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3177,19 +3133,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:3181: checking for EMX OS/2 environment" >&5
+echo "configure:3137: 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 3186 "configure"
+#line 3142 "configure"
 #include "confdefs.h"
 
 int main() {
 return __EMX__;
 ; return 0; }
 EOF
-if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_emxos2=yes
 else
@@ -3205,7 +3161,7 @@ echo "$ac_t""$ac_cv_emxos2" 1>&6
 EMXOS2=
 test "$ac_cv_emxos2" = yes && EMXOS2=yes
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3209: checking how to run the C preprocessor" >&5
+echo "configure:3165: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3220,13 +3176,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 3224 "configure"
+#line 3180 "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:3230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3186: \"$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
   :
@@ -3237,13 +3193,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 3241 "configure"
+#line 3197 "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:3247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3203: \"$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
   :
@@ -3254,13 +3210,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 3258 "configure"
+#line 3214 "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:3264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3220: \"$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
   :
@@ -3310,7 +3266,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:3314: checking for $ac_word" >&5
+echo "configure:3270: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3340,7 +3296,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:3344: checking for $ac_word" >&5
+echo "configure:3300: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3391,7 +3347,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:3395: checking for $ac_word" >&5
+echo "configure:3351: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3423,7 +3379,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:3427: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+echo "configure:3383: 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.
@@ -3434,12 +3390,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 3438 "configure"
+#line 3394 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:3443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3399: \"$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
@@ -3465,12 +3421,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:3469: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:3425: 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:3474: checking whether we are using GNU C" >&5
+echo "configure:3430: 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
@@ -3479,7 +3435,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3483: \"$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:3439: \"$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
@@ -3498,7 +3454,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:3502: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:3458: 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
@@ -3541,7 +3497,7 @@ ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:3545: checking for ld used by GCC" >&5
+echo "configure:3501: checking for ld used by GCC" >&5
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -3571,10 +3527,10 @@ echo "configure:3545: 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:3575: checking for GNU ld" >&5
+echo "configure:3531: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:3578: checking for non-GNU ld" >&5
+echo "configure:3534: checking for non-GNU ld" >&5
 fi
 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3609,7 +3565,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:3613: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:3569: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3626,7 +3582,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:3630: checking for $LD option to reload object files" >&5
+echo "configure:3586: checking for $LD option to reload object files" >&5
 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3638,7 +3594,7 @@ reload_flag=$lt_cv_ld_reload_flag
 test -n "$reload_flag" && reload_flag=" $reload_flag"
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:3642: checking for BSD-compatible nm" >&5
+echo "configure:3598: checking for BSD-compatible nm" >&5
 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3675,8 +3631,92 @@ fi
 NM="$lt_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
+echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
+echo "configure:3636: checking for a sed that does not truncate output" >&5
+if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_executable_p="test -f"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+
+  # Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=$TMPDIR/sed$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   { (exit 1); exit 1; }
+}
+  _max=0
+  _count=0
+  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
+  # along with /bin/sed that truncates output.
+  for _sed in $_sed_list /usr/xpg4/bin/sed; do
+    test ! -f ${_sed} && break
+    cat /dev/null > "$tmp/sed.in"
+    _count=0
+    echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
+    # Check for GNU sed and select it if it is found.
+    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
+      lt_cv_path_SED=${_sed}
+      break
+    fi
+    while true; do
+      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
+      mv "$tmp/sed.tmp" "$tmp/sed.in"
+      cp "$tmp/sed.in" "$tmp/sed.nl"
+      echo >>"$tmp/sed.nl"
+      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
+      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
+      # 40000 chars as input seems more than enough
+      test $_count -gt 10 && break
+      _count=`expr $_count + 1`
+      if test $_count -gt $_max; then
+        _max=$_count
+        lt_cv_path_SED=$_sed
+      fi
+    done
+  done
+  rm -rf "$tmp"
+
+fi
+
+if test "X$SED" != "X"; then
+  lt_cv_path_SED=$SED
+else
+  SED=$lt_cv_path_SED
+fi
+echo "$ac_t""$SED" 1>&6
+
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3680: checking whether ln -s works" >&5
+echo "configure:3720: 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
@@ -3696,8 +3736,8 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:3701: checking how to recognise dependant libraries" >&5
+echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
+echo "configure:3741: checking how to recognise dependent libraries" >&5
 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3774,9 +3814,9 @@ hpux10.20*|hpux11*)
   lt_cv_file_magic_test_file=/usr/lib/libc.sl
   ;;
 
-irix5* | irix6*)
+irix5* | irix6* | nonstopux*)
   case $host_os in
-  irix5*)
+  irix5* | nonstopux*)
     # this will be overridden with pass_all, but let us keep it just in case
     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
     ;;
@@ -3798,7 +3838,7 @@ irix5* | irix6*)
 # This must be Linux ELF.
 linux-gnu*)
   case $host_cpu in
-  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
+  alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
     lt_cv_deplibs_check_method=pass_all ;;
   *)
     # glibc up to 2.1.1 does not perform some relocations on ARM
@@ -3869,6 +3909,9 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
     lt_cv_file_magic_test_file=/lib/libc.so
     ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
   esac
   ;;
 esac
@@ -3880,13 +3923,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:3884: checking for object suffix" >&5
+echo "configure:3927: 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:3890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -3907,7 +3950,7 @@ ac_objext=$ac_cv_objext
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3911: checking for executable suffix" >&5
+echo "configure:3954: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3917,7 +3960,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -3948,7 +3991,7 @@ fi
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:3952: checking command to parse $NM output" >&5
+echo "configure:3995: checking command to parse $NM output" >&5
 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3983,9 +4026,12 @@ hpux*) # Its linker distinguishes data from code symbols
   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
   lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
   ;;
-irix*)
+irix* | nonstopux*)
   symcode='[BCDEGRST]'
   ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
 solaris* | sysv5*)
   symcode='[BDT]'
   ;;
@@ -4028,10 +4074,10 @@ void nm_test_func(){}
 int main(){nm_test_var='a';nm_test_func();return(0);}
 EOF
 
-  if { (eval echo configure:4032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:4078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     # Now try to grab the symbols.
     nlist=conftest.nm
-    if { (eval echo configure:4035: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
+    if { (eval echo configure:4081: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
       # Try sorting and uniquifying the output.
       if sort "$nlist" | uniq > "$nlist"T; then
        mv -f "$nlist"T "$nlist"
@@ -4082,7 +4128,7 @@ EOF
          save_CFLAGS="$CFLAGS"
          LIBS="conftstm.$ac_objext"
          CFLAGS="$CFLAGS$no_builtin_flag"
-         if { (eval echo configure:4086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+         if { (eval echo configure:4132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
            pipe_works=yes
          fi
          LIBS="$save_LIBS"
@@ -4131,17 +4177,17 @@ for ac_hdr in dlfcn.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4135: checking for $ac_hdr" >&5
+echo "configure:4181: 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 4140 "configure"
+#line 4186 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4191: \"$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*
@@ -4171,12 +4217,13 @@ done
 
 
 
+
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:4180: checking for ${ac_tool_prefix}file" >&5
+echo "configure:4227: checking for ${ac_tool_prefix}file" >&5
 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4238,7 +4285,7 @@ fi
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
     echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:4242: checking for file" >&5
+echo "configure:4289: checking for file" >&5
 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4309,7 +4356,7 @@ esac
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4313: checking for $ac_word" >&5
+echo "configure:4360: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4341,7 +4388,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4345: checking for $ac_word" >&5
+echo "configure:4392: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4376,7 +4423,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4380: checking for $ac_word" >&5
+echo "configure:4427: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4408,7 +4455,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4412: checking for $ac_word" >&5
+echo "configure:4459: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4457,8 +4504,8 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4461 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:4462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 4508 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:4509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case `/usr/bin/file conftest.$ac_objext` in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -4479,7 +4526,7 @@ case $host in
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:4483: checking whether the C compiler needs -belf" >&5
+echo "configure:4530: 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
@@ -4492,14 +4539,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
 cross_compiling=$ac_cv_prog_cc_cross
 
      cat > conftest.$ac_ext <<EOF
-#line 4496 "configure"
+#line 4543 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4550: \"$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
@@ -4529,7 +4576,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:4533: checking for $ac_word" >&5
+echo "configure:4580: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4561,7 +4608,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:4565: checking for $ac_word" >&5
+echo "configure:4612: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4596,7 +4643,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:4600: checking for $ac_word" >&5
+echo "configure:4647: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4628,7 +4675,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:4632: checking for $ac_word" >&5
+echo "configure:4679: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4663,7 +4710,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:4667: checking for $ac_word" >&5
+echo "configure:4714: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4695,7 +4742,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:4699: checking for $ac_word" >&5
+echo "configure:4746: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4731,12 +4778,12 @@ fi
   # recent cygwin and mingw systems supply a stub DllMain which the user
   # can override, but on older systems we have to supply one
   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
-echo "configure:4735: checking if libtool should supply DllMain function" >&5
+echo "configure:4782: checking if libtool should supply DllMain function" >&5
 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4740 "configure"
+#line 4787 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4744,7 +4791,7 @@ extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
       DllMain (0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_need_dllmain=no
 else
@@ -4765,19 +4812,19 @@ echo "$ac_t""$lt_cv_need_dllmain" 1>&6
     SAVE_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS -mdll"
     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
-echo "configure:4769: checking how to link DLLs" >&5
+echo "configure:4816: checking how to link DLLs" >&5
 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4774 "configure"
+#line 4821 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_dll_switch=-mdll
 else
@@ -4890,8 +4937,10 @@ fi
 set dummy $CC
 compiler="$2"
 
+## FIXME: this should be a separate macro
+##
 echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:4895: checking for objdir" >&5
+echo "configure:4944: checking for objdir" >&5
 rm -f .libs 2>/dev/null
 mkdir .libs 2>/dev/null
 if test -d .libs; then
@@ -4902,8 +4951,12 @@ else
 fi
 rmdir .libs 2>/dev/null
 echo "$ac_t""$objdir" 1>&6
+##
+## END FIXME
 
 
+## FIXME: this should be a separate macro
+##
 # Check whether --with-pic or --without-pic was given.
 if test "${with_pic+set}" = set; then
   withval="$with_pic"
@@ -4918,7 +4971,7 @@ test -z "$pic_mode" && pic_mode=default
 # in isolation, and that seeing it set (from the cache) indicates that
 # the associated values are set (in the cache) correctly too.
 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
-echo "configure:4922: checking for $compiler option to produce PIC" >&5
+echo "configure:4975: checking for $compiler option to produce PIC" >&5
 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4949,7 +5002,7 @@ else
       # like `-m68040'.
       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
       ;;
-    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
     darwin* | rhapsody*)
@@ -4992,7 +5045,7 @@ else
       lt_cv_prog_cc_pic='+Z'
       ;;
 
-    irix5* | irix6*)
+    irix5* | irix6* | nonstopux*)
       lt_cv_prog_cc_wl='-Wl,'
       lt_cv_prog_cc_static='-non_shared'
       # PIC (with -KPIC) is the default.
@@ -5036,11 +5089,7 @@ else
     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
       lt_cv_prog_cc_pic='-KPIC'
       lt_cv_prog_cc_static='-Bstatic'
-      if test "x$host_vendor" = xsni; then
-       lt_cv_prog_cc_wl='-LD'
-      else
-       lt_cv_prog_cc_wl='-Wl,'
-      fi
+      lt_cv_prog_cc_wl='-Wl,'
       ;;
 
     uts4*)
@@ -5070,21 +5119,21 @@ else
 
   # Check to make sure the pic_flag actually works.
   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
-echo "configure:5074: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
+echo "configure:5123: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
       save_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
     cat > conftest.$ac_ext <<EOF
-#line 5081 "configure"
+#line 5130 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
         case $host_os in
       hpux9* | hpux10* | hpux11*)
@@ -5124,6 +5173,8 @@ fi
 
   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
 fi
+##
+## END FIXME
 
 # Check for any special shared library compilation flags.
 if test -n "$lt_cv_prog_cc_shlib"; then
@@ -5135,8 +5186,10 @@ if test -n "$lt_cv_prog_cc_shlib"; then
   fi
 fi
 
+## FIXME: this should be a separate macro
+##
 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
-echo "configure:5140: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
+echo "configure:5193: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5144,14 +5197,14 @@ else
   save_LDFLAGS="$LDFLAGS"
   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
   cat > conftest.$ac_ext <<EOF
-#line 5148 "configure"
+#line 5201 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_prog_cc_static_works=yes
 else
@@ -5174,11 +5227,15 @@ wl="$lt_cv_prog_cc_wl"
 link_static_flag="$lt_cv_prog_cc_static"
 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
 can_build_shared="$lt_cv_prog_cc_can_build_shared"
+##
+## END FIXME
 
 
+## FIXME: this should be a separate macro
+##
 # Check to see if options -o and -c are simultaneously supported by compiler
 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
-echo "configure:5182: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo "configure:5239: checking if $compiler supports -c -o file.$ac_objext" >&5
 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5197,7 +5254,7 @@ chmod -w .
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
 compiler_c_o=no
-if { (eval echo configure:5201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:5258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
   # The compiler can only warn and ignore the option if not recognized
   # So say no if there are warnings
   if test -s out/conftest.err; then
@@ -5226,7 +5283,7 @@ echo "$ac_t""$compiler_c_o" 1>&6
 if test x"$compiler_c_o" = x"yes"; then
   # Check to see if we can write to a .lo
   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
-echo "configure:5230: checking if $compiler supports -c -o file.lo" >&5
+echo "configure:5287: checking if $compiler supports -c -o file.lo" >&5
   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5237,14 +5294,14 @@ else
   save_objext="$ac_objext"
   ac_objext=lo
   cat > conftest.$ac_ext <<EOF
-#line 5241 "configure"
+#line 5298 "configure"
 #include "confdefs.h"
 
 int main() {
 int some_variable = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
       # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings
@@ -5269,13 +5326,17 @@ fi
 else
   compiler_o_lo=no
 fi
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 # Check to see if we can do hard links to lock some files if needed
 hard_links="nottested"
 if test "$compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
-echo "configure:5279: checking if we can lock with hard links" >&5
+echo "configure:5340: checking if we can lock with hard links" >&5
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
@@ -5290,24 +5351,28 @@ echo "configure:5279: checking if we can lock with hard links" >&5
 else
   need_locks=no
 fi
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 if test "$GCC" = yes; then
   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
-echo "configure:5298: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo "configure:5363: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
   echo "int some_variable = 0;" > conftest.$ac_ext
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
   compiler_rtti_exceptions=no
   cat > conftest.$ac_ext <<EOF
-#line 5304 "configure"
+#line 5369 "configure"
 #include "confdefs.h"
 
 int main() {
 int some_variable = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
       # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings
@@ -5331,10 +5396,14 @@ rm -f conftest*
     no_builtin_flag=' -fno-builtin'
   fi
 fi
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 # See if the linker supports building shared libraries.
 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
-echo "configure:5338: checking whether the linker ($LD) supports shared libraries" >&5
+echo "configure:5407: checking whether the linker ($LD) supports shared libraries" >&5
 
 allow_undefined_flag=
 no_undefined_flag=
@@ -5490,7 +5559,7 @@ EOF
     # If the export-symbols file already is a .def file (1st line
     # is EXPORTS), use it as is.
     # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+    archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
        cp $export_symbols $output_objdir/$soname-def;
       else
        echo EXPORTS > $output_objdir/$soname-def;
@@ -5499,6 +5568,7 @@ EOF
         set dummy \$symbol;
         case \$# in
           2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+          4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
           *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
         esac;
         _lt_hint=`expr 1 + \$_lt_hint`;
@@ -5611,10 +5681,12 @@ else
       # need to do runtime linking.
       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
        for ld_flag in $LDFLAGS; do
-         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+         case $ld_flag in
+         *-brtl*)
            aix_use_runtimelinking=yes
            break
-         fi
+         ;;
+         esac
        done
       esac
 
@@ -5728,8 +5800,9 @@ else
     esac
     # FIXME: Relying on posixy $() will cause problems for
     #        cross-compilation, but unfortunately the echo tests do not
-    #        yet detect zsh echo's removal of \ escapes.
-    archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
+    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
+    #       `"' quotes if we put them in here... so don't!
+    archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
     # We need to add '_' to the symbols in $export_symbols first
     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
     hardcode_direct=yes
@@ -5781,13 +5854,14 @@ else
     export_dynamic_flag_spec='${wl}-E'
     ;;
 
-  irix5* | irix6*)
+  irix5* | irix6* | nonstopux*)
     if test "$GCC" = yes; then
       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     else
       archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      hardcode_libdir_flag_spec='-rpath $libdir'
     fi
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     hardcode_libdir_separator=:
     link_all_deplibs=yes
     ;;
@@ -5815,7 +5889,7 @@ else
     hardcode_direct=yes
     hardcode_shlibpath_var=no
     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
       export_dynamic_flag_spec='${wl}-E'
     else
@@ -5825,7 +5899,7 @@ else
        hardcode_libdir_flag_spec='-R$libdir'
         ;;
       *)
-        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
+        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
         ;;
       esac
@@ -5937,13 +6011,23 @@ EOF
     ;;
 
   sysv4)
-    if test "x$host_vendor" = xsno; then
-      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes # is this really true???
-    else
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-    fi
+    case $host_vendor in
+      sni)
+        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+        hardcode_direct=yes # is this really true???
+        ;;
+      siemens)
+        ## LD is ld it makes a PLAMLIB
+        ## CC just makes a GrossModule.
+        archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+        reload_cmds='$CC -r -o $output$reload_objs'
+        hardcode_direct=no
+        ;;
+      motorola)
+        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+        hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+        ;;
+    esac
     runpath_var='LD_RUN_PATH'
     hardcode_shlibpath_var=no
     ;;
@@ -6015,10 +6099,14 @@ EOF
 fi
 echo "$ac_t""$ld_shlibs" 1>&6
 test "$ld_shlibs" = no && can_build_shared=no
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 # Check hardcoding attributes.
 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
-echo "configure:6022: checking how to hardcode library paths into programs" >&5
+echo "configure:6110: checking how to hardcode library paths into programs" >&5
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" || \
    test -n "$runpath_var"; then
@@ -6042,11 +6130,15 @@ else
   hardcode_action=unsupported
 fi
 echo "$ac_t""$hardcode_action" 1>&6
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 striplib=
 old_striplib=
 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
-echo "configure:6050: checking whether stripping libraries is possible" >&5
+echo "configure:6142: checking whether stripping libraries is possible" >&5
 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
@@ -6054,13 +6146,17 @@ if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
 else
   echo "$ac_t""no" 1>&6
 fi
+##
+## END FIXME
 
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
+## FIXME: this should be a separate macro
+##
 # PORTME Fill in your ld.so characteristics
 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
-echo "configure:6064: checking dynamic linker characteristics" >&5
+echo "configure:6160: checking dynamic linker characteristics" >&5
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -6087,6 +6183,9 @@ aix3*)
 
 aix4* | aix5*)
   version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
   if test "$host_cpu" = ia64; then
     # AIX 5 supports IA64
     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
@@ -6125,6 +6224,7 @@ aix4* | aix5*)
     fi
     shlibpath_var=LIBPATH
   fi
+  hardcode_into_libs=yes
   ;;
 
 amigaos*)
@@ -6172,7 +6272,7 @@ cygwin* | mingw* | pw32*)
     ;;
   yes,mingw*)
     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
-    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
+    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
     ;;
   yes,pw32*)
     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
@@ -6255,14 +6355,17 @@ hpux9* | hpux10* | hpux11*)
   postinstall_cmds='chmod 555 $lib'
   ;;
 
-irix5* | irix6*)
-  version_type=irix
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)          version_type=irix ;;
+  esac
   need_lib_prefix=no
   need_version=no
   soname_spec='${libname}${release}.so$major'
   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
   case $host_os in
-  irix5*)
+  irix5* | nonstopux*)
     libsuff= shlibsuff=
     ;;
   *)
@@ -6366,11 +6469,12 @@ os2*)
 osf3* | osf4* | osf5*)
   version_type=osf
   need_version=no
-  soname_spec='${libname}${release}.so'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  hardcode_into_libs=yes
   ;;
 
 sco3.2v5*)
@@ -6413,6 +6517,12 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
   case $host_vendor in
     sni)
       shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
       ;;
     motorola)
       need_lib_prefix=no
@@ -6454,14 +6564,22 @@ sysv4*MP*)
 esac
 echo "$ac_t""$dynamic_linker" 1>&6
 test "$dynamic_linker" = no && can_build_shared=no
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 # Report the final consequences.
 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
-echo "configure:6461: checking if libtool supports shared libraries" >&5
+echo "configure:6575: checking if libtool supports shared libraries" >&5
 echo "$ac_t""$can_build_shared" 1>&6
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
-echo "configure:6465: checking whether to build shared libraries" >&5
+echo "configure:6583: checking whether to build shared libraries" >&5
 test "$can_build_shared" = "no" && enable_shared=no
 
 # On AIX, shared libraries and static libraries use the same namespace, and
@@ -6482,12 +6600,18 @@ aix4*)
   ;;
 esac
 echo "$ac_t""$enable_shared" 1>&6
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
-echo "configure:6488: checking whether to build static libraries" >&5
+echo "configure:6610: checking whether to build static libraries" >&5
 # Make sure either enable_shared or enable_static is yes.
 test "$enable_shared" = yes || enable_static=yes
 echo "$ac_t""$enable_static" 1>&6
+##
+## END FIXME
 
 if test "$hardcode_action" = relink; then
   # Fast installation is not supported
@@ -6525,12 +6649,12 @@ else
 
   *)
     echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:6529: checking for shl_load" >&5
+echo "configure:6653: checking for shl_load" >&5
 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6534 "configure"
+#line 6658 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shl_load(); below.  */
@@ -6554,7 +6678,7 @@ f = shl_load;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shl_load=yes"
 else
@@ -6572,7 +6696,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:6576: checking for shl_load in -ldld" >&5
+echo "configure:6700: checking for shl_load in -ldld" >&5
 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6580,7 +6704,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6584 "configure"
+#line 6708 "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
@@ -6591,7 +6715,7 @@ int main() {
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:6595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6719: \"$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
@@ -6610,12 +6734,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:6614: checking for dlopen" >&5
+echo "configure:6738: 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 6619 "configure"
+#line 6743 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen(); below.  */
@@ -6639,7 +6763,7 @@ f = dlopen;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6767: \"$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
@@ -6657,7 +6781,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6661: checking for dlopen in -ldl" >&5
+echo "configure:6785: 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
@@ -6665,7 +6789,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6669 "configure"
+#line 6793 "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
@@ -6676,7 +6800,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6804: \"$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
@@ -6695,7 +6819,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:6699: checking for dlopen in -lsvld" >&5
+echo "configure:6823: checking for dlopen in -lsvld" >&5
 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6703,7 +6827,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsvld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6707 "configure"
+#line 6831 "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
@@ -6714,7 +6838,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:6718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6842: \"$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
@@ -6733,7 +6857,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:6737: checking for dld_link in -ldld" >&5
+echo "configure:6861: checking for dld_link in -ldld" >&5
 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6741,7 +6865,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6745 "configure"
+#line 6869 "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
@@ -6752,7 +6876,7 @@ int main() {
 dld_link()
 ; return 0; }
 EOF
-if { (eval echo configure:6756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6880: \"$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
@@ -6808,7 +6932,7 @@ fi
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
-echo "configure:6812: checking whether a program can dlopen itself" >&5
+echo "configure:6936: checking whether a program can dlopen itself" >&5
 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6818,7 +6942,7 @@ else
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 6822 "configure"
+#line 6946 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -6879,7 +7003,7 @@ int main ()
     exit (status);
 }
 EOF
-  if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  if { (eval echo configure:7007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -6902,7 +7026,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
     if test "x$lt_cv_dlopen_self" = xyes; then
       LDFLAGS="$LDFLAGS $link_static_flag"
       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
-echo "configure:6906: checking whether a statically linked program can dlopen itself" >&5
+echo "configure:7030: checking whether a statically linked program can dlopen itself" >&5
 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6912,7 +7036,7 @@ else
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 6916 "configure"
+#line 7040 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -6973,7 +7097,7 @@ int main ()
     exit (status);
 }
 EOF
-  if { (eval echo configure:6977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  if { (eval echo configure:7101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -7012,6 +7136,8 @@ echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
 fi
 
 
+## FIXME: this should be a separate macro
+##
 if test "$enable_shared" = yes && test "$GCC" = yes; then
   case $archive_cmds in
   *'~'*)
@@ -7022,14 +7148,14 @@ if test "$enable_shared" = yes && test "$GCC" = yes; then
     # systems, -lgcc has to come before -lc. If gcc already passes -lc
     # to ld, don't add -lc before -lgcc.
     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
-echo "configure:7026: checking whether -lc should be explicitly linked in" >&5
+echo "configure:7152: checking whether -lc should be explicitly linked in" >&5
     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   $rm conftest*
     echo 'static int dummy;' > conftest.$ac_ext
 
-    if { (eval echo configure:7033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+    if { (eval echo configure:7159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
       soname=conftest
       lib=conftest
       libobjs=conftest.$ac_objext
@@ -7042,7 +7168,7 @@ else
       libname=conftest
       save_allow_undefined_flag=$allow_undefined_flag
       allow_undefined_flag=
-      if { (eval echo configure:7046: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
+      if { (eval echo configure:7172: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
       then
        lt_cv_archive_cmds_need_lc=no
       else
@@ -7059,7 +7185,11 @@ fi
   esac
 fi
 need_lc=${lt_cv_archive_cmds_need_lc-yes}
+##
+## END FIXME
 
+## FIXME: this should be a separate macro
+##
 # The second clause should only fire when bootstrapping the
 # libtool distribution, otherwise you forgot to ship ltmain.sh
 # with your package, and you will get complaints that there are
@@ -7082,7 +7212,7 @@ if test -f "$ltmain"; then
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS \
+  for var in echo old_CC old_CFLAGS SED \
     AR AR_FLAGS CC LD LN_S NM SHELL \
     reload_flag reload_cmds wl \
     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
@@ -7144,8 +7274,11 @@ if test -f "$ltmain"; then
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+# A sed that does not truncate output.
+SED=$lt_SED
+
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="sed -e s/^X//"
+Xsed="${SED} -e s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
@@ -7609,6 +7742,8 @@ EOF
     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
   chmod +x "$ofile"
 fi
+##
+## END FIXME
 
 
 
@@ -7624,43 +7759,9 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
-for ac_prog in mawk gawk nawk awk
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7633: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_AWK="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-AWK="$ac_cv_prog_AWK"
-if test -n "$AWK"; then
-  echo "$ac_t""$AWK" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-test -n "$AWK" && break
-done
-
 # test for ln hardlink support
 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:7664: checking whether ln works" >&5
+echo "configure:7765: 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
@@ -7683,7 +7784,7 @@ else
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:7687: checking whether ln -s works" >&5
+echo "configure:7788: 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
@@ -7704,178 +7805,69 @@ else
 fi
 
 
-# Extract the first word of "sendmail", so it can be a program name with args.
-set dummy sendmail; ac_word=$2
+ol_link_perl=no
+if test $ol_enable_perl != no ; then
+       # Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7711: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
+echo "configure:7814: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  case "$SENDMAIL" in
+  case "$PERLBIN" in
   /*)
-  ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
+  ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
   ;;
   ?:/*)
-  ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
+  ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
   ;;
   *)
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
+  ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do 
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
+      ac_cv_path_PERLBIN="$ac_dir/$ac_word"
       break
     fi
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
+  test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
   ;;
 esac
 fi
-SENDMAIL="$ac_cv_path_SENDMAIL"
-if test -n "$SENDMAIL"; then
-  echo "$ac_t""$SENDMAIL" 1>&6
+PERLBIN="$ac_cv_path_PERLBIN"
+if test -n "$PERLBIN"; then
+  echo "$ac_t""$PERLBIN" 1>&6
 else
   echo "$ac_t""no" 1>&6
 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:7747: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$EDITOR" in
-  /*)
-  ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH:/usr/ucb"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_EDITOR="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
-  ;;
-esac
-fi
-EDITOR="$ac_cv_path_EDITOR"
-if test -n "$EDITOR"; then
-  echo "$ac_t""$EDITOR" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-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:7783: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$FINGER" in
-  /*)
-  ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH:/usr/ucb"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_FINGER="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
-  ;;
-esac
-fi
-FINGER="$ac_cv_path_FINGER"
-if test -n "$FINGER"; then
-  echo "$ac_t""$FINGER" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-ol_link_perl=no
-if test $ol_enable_perl != no ; then
-       # Extract the first word of "perl", so it can be a program name with args.
-set dummy perl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7822: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  case "$PERLBIN" in
-  /*)
-  ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_PERLBIN="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
-  ;;
-esac
-fi
-PERLBIN="$ac_cv_path_PERLBIN"
-if test -n "$PERLBIN"; then
-  echo "$ac_t""$PERLBIN" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-       if test "no$PERLBIN" = "no" ; then
-               if test $ol_enable_perl = yes ; then
-                       { echo "configure: error: could not locate perl" 1>&2; exit 1; }
-               fi
-
-       else
-               PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
-               if test x"$ol_with_perl_module" = "xstatic" ; then
-                       SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
-               else
-                       MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
-               fi
-                               ol_link_perl=yes
-       fi
-fi
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:7873: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
+
+       if test "no$PERLBIN" = "no" ; then
+               if test $ol_enable_perl = yes ; then
+                       { echo "configure: error: could not locate perl" 1>&2; exit 1; }
+               fi
+
+       else
+               PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
+               if test x"$ol_with_perl_module" = "xstatic" ; then
+                       SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
+               else
+                       MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
+               fi
+                               ol_link_perl=yes
+       fi
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:7865: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     # This must be in double quotes, not single quotes, because CPP may get
@@ -7884,13 +7876,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 7888 "configure"
+#line 7880 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -7901,13 +7893,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 7905 "configure"
+#line 7897 "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:7911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7903: \"$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
   :
@@ -7918,13 +7910,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 7922 "configure"
+#line 7914 "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:7928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7920: \"$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
   :
@@ -7963,12 +7955,12 @@ fi
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:7967: checking for Cygwin environment" >&5
+echo "configure:7959: 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 7972 "configure"
+#line 7964 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -7979,7 +7971,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:7983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -7995,19 +7987,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:7999: checking for mingw32 environment" >&5
+echo "configure:7991: 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 8004 "configure"
+#line 7996 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:8011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -8026,7 +8018,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:8030: checking for executable suffix" >&5
+echo "configure:8022: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8036,7 +8028,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:8040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -8057,13 +8049,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:8061: checking for object suffix" >&5
+echo "configure:8053: 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:8067: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -8087,7 +8079,7 @@ EOF
 
 
 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
-echo "configure:8091: checking for be_app in -lbe" >&5
+echo "configure:8083: 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
@@ -8095,7 +8087,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbe -lroot -lnet $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8099 "configure"
+#line 8091 "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
@@ -8106,7 +8098,7 @@ int main() {
 be_app()
 ; return 0; }
 EOF
-if { (eval echo configure:8110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8102: \"$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
@@ -8132,7 +8124,7 @@ fi
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:8136: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:8128: 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
@@ -8149,7 +8141,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 8153 "configure"
+#line 8145 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -8186,7 +8178,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:8190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8182: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_prog_cc_stdc="$ac_arg"; break
 else
@@ -8220,7 +8212,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:8224: checking for ${OL_MKDEP} depend flag" >&5
+echo "configure:8216: 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
@@ -8230,7 +8222,7 @@ else
                                cat > conftest.c <<EOF
  noCode;
 EOF
-                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
+                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8226: \"$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
@@ -8263,7 +8255,7 @@ if test "${ol_cv_mkdep}" = no ; then
 fi
 
 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
-echo "configure:8267: checking for afopen in -ls" >&5
+echo "configure:8259: 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
@@ -8271,7 +8263,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ls  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8275 "configure"
+#line 8267 "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
@@ -8282,7 +8274,7 @@ int main() {
 afopen()
 ; return 0; }
 EOF
-if { (eval echo configure:8286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8278: \"$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
@@ -8309,6 +8301,15 @@ else
 fi
 
 
+case "$target" in
+*-ibm-openedition)
+       ac_cv_func_getopt=no
+       cat >> confdefs.h <<\EOF
+#define BOTH_STRINGS_H 1
+EOF
+
+       ;;
+esac
 
 ol_link_modules=no
 if test $ol_enable_modules != no ; then
@@ -8316,17 +8317,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:8320: checking for $ac_hdr" >&5
+echo "configure:8321: 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 8325 "configure"
+#line 8326 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8330: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8331: \"$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*
@@ -8358,7 +8359,7 @@ done
        fi
 
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:8362: checking for lt_dlinit in -lltdl" >&5
+echo "configure:8363: 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
@@ -8366,7 +8367,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8370 "configure"
+#line 8371 "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
@@ -8377,7 +8378,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:8381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8382: \"$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
@@ -8424,13 +8425,13 @@ fi
 
 # test for EBCDIC
 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
-echo "configure:8428: checking for EBCDIC" >&5
+echo "configure:8429: 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 8434 "configure"
+#line 8435 "configure"
 #include "confdefs.h"
 
 #if !('M' == 0xd4)
@@ -8439,7 +8440,7 @@ else
 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8444: \"$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*
@@ -8463,12 +8464,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:8467: checking for ANSI C header files" >&5
+echo "configure:8468: 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 8472 "configure"
+#line 8473 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -8476,7 +8477,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8481: \"$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*
@@ -8493,7 +8494,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 8497 "configure"
+#line 8498 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -8511,7 +8512,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 8515 "configure"
+#line 8516 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -8532,7 +8533,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 8536 "configure"
+#line 8537 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #ifndef HAVE_EBCDIC
@@ -8550,7 +8551,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:8554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -8584,12 +8585,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:8588: checking for $ac_hdr that defines DIR" >&5
+echo "configure:8589: 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 8593 "configure"
+#line 8594 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -8597,7 +8598,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -8622,7 +8623,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:8626: checking for opendir in -ldir" >&5
+echo "configure:8627: 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
@@ -8630,7 +8631,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8634 "configure"
+#line 8635 "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
@@ -8641,7 +8642,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:8645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8646: \"$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
@@ -8663,7 +8664,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:8667: checking for opendir in -lx" >&5
+echo "configure:8668: 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
@@ -8671,7 +8672,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8675 "configure"
+#line 8676 "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
@@ -8682,7 +8683,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:8686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8687: \"$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
@@ -8705,12 +8706,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:8709: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:8710: 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 8714 "configure"
+#line 8715 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -8726,7 +8727,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:8730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -8747,12 +8748,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:8751: checking POSIX termios" >&5
+echo "configure:8752: 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 8756 "configure"
+#line 8757 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -8762,7 +8763,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:8766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8767: \"$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
@@ -8778,7 +8779,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:8782: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:8783: 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
@@ -8787,7 +8788,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 8791 "configure"
+#line 8792 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -8807,7 +8808,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 8811 "configure"
+#line 8812 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -8882,6 +8883,7 @@ for ac_hdr in \
        sys/syslog.h    \
        sys/time.h              \
        sys/types.h             \
+       sys/ucred.h             \
        syslog.h                \
        termios.h               \
        unistd.h                \
@@ -8891,17 +8893,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:8895: checking for $ac_hdr" >&5
+echo "configure:8897: 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 8900 "configure"
+#line 8902 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8907: \"$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*
@@ -8931,12 +8933,12 @@ done
 
 
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:8935: checking for dlopen" >&5
+echo "configure:8937: 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 8940 "configure"
+#line 8942 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen(); below.  */
@@ -8960,7 +8962,7 @@ f = dlopen;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8966: \"$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
@@ -8978,7 +8980,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:8982: checking for dlopen in -ldl" >&5
+echo "configure:8984: 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
@@ -8986,7 +8988,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8990 "configure"
+#line 8992 "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
@@ -8997,7 +8999,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:9001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9003: \"$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
@@ -9028,7 +9030,7 @@ fi
 
 
 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:9032: checking for sigset in -lV3" >&5
+echo "configure:9034: 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
@@ -9036,7 +9038,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9040 "configure"
+#line 9042 "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
@@ -9047,7 +9049,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:9051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9053: \"$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
@@ -9076,12 +9078,12 @@ fi
 
 
 echo $ac_n "checking for winsock""... $ac_c" 1>&6
-echo "configure:9080: checking for winsock" >&5
+echo "configure:9082: checking for winsock" >&5
 save_LIBS="$LIBS"
 for curlib in ws2_32 wsock32; do
        LIBS="$LIBS -l$curlib"
        cat > conftest.$ac_ext <<EOF
-#line 9085 "configure"
+#line 9087 "configure"
 #include "confdefs.h"
 
                        char socket@12();
@@ -9098,7 +9100,7 @@ int main() {
                        
 ; return 0; }
 EOF
-if { (eval echo configure:9102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   have_winsock=yes
 else
@@ -9133,12 +9135,12 @@ echo "$ac_t""$have_winsock" 1>&6
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:9137: checking for socket" >&5
+echo "configure:9139: 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 9142 "configure"
+#line 9144 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -9162,7 +9164,7 @@ f = socket;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9168: \"$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
@@ -9181,7 +9183,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:9185: checking for main in -lsocket" >&5
+echo "configure:9187: 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
@@ -9189,14 +9191,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9193 "configure"
+#line 9195 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9202: \"$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
@@ -9224,7 +9226,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:9228: checking for main in -lnet" >&5
+echo "configure:9230: 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
@@ -9232,14 +9234,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9236 "configure"
+#line 9238 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9245: \"$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
@@ -9267,7 +9269,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:9271: checking for main in -lnsl_s" >&5
+echo "configure:9273: 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
@@ -9275,14 +9277,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9279 "configure"
+#line 9281 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9288: \"$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
@@ -9310,7 +9312,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:9314: checking for main in -lnsl" >&5
+echo "configure:9316: 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
@@ -9318,14 +9320,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9322 "configure"
+#line 9324 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9331: \"$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
@@ -9353,7 +9355,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:9357: checking for socket in -linet" >&5
+echo "configure:9359: 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
@@ -9361,7 +9363,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9365 "configure"
+#line 9367 "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
@@ -9372,7 +9374,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:9376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9378: \"$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
@@ -9400,7 +9402,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:9404: checking for main in -lgen" >&5
+echo "configure:9406: 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
@@ -9408,14 +9410,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9412 "configure"
+#line 9414 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9421: \"$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
@@ -9447,12 +9449,12 @@ fi
 
 
 echo $ac_n "checking for select""... $ac_c" 1>&6
-echo "configure:9451: checking for select" >&5
+echo "configure:9453: 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 9456 "configure"
+#line 9458 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char select(); below.  */
@@ -9476,7 +9478,7 @@ f = select;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9482: \"$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
@@ -9499,7 +9501,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:9503: checking types of arguments for select()" >&5
+echo "configure:9505: 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
@@ -9513,7 +9515,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 9517 "configure"
+#line 9519 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -9532,7 +9534,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
           ac_not_found=no ; break 3
 else
@@ -9577,17 +9579,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:9581: checking for $ac_hdr" >&5
+echo "configure:9583: 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 9586 "configure"
+#line 9588 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9593: \"$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*
@@ -9618,14 +9620,14 @@ if test "$ac_cv_header_regex_h" != yes ; then
 fi
 
 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
-echo "configure:9622: checking for library containing regfree" >&5
+echo "configure:9624: checking for library containing regfree" >&5
 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_regfree="no"
 cat > conftest.$ac_ext <<EOF
-#line 9629 "configure"
+#line 9631 "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
@@ -9636,7 +9638,7 @@ int main() {
 regfree()
 ; return 0; }
 EOF
-if { (eval echo configure:9640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_regfree="none required"
 else
@@ -9647,7 +9649,7 @@ rm -f conftest*
 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9651 "configure"
+#line 9653 "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
@@ -9658,7 +9660,7 @@ int main() {
 regfree()
 ; return 0; }
 EOF
-if { (eval echo configure:9662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_regfree="-l$ac_lib"
 break
@@ -9681,7 +9683,7 @@ fi
 
 
 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
-echo "configure:9685: checking for compatible POSIX regex" >&5
+echo "configure:9687: 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
@@ -9690,7 +9692,7 @@ else
   ol_cv_c_posix_regex=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9694 "configure"
+#line 9696 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -9716,7 +9718,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:9720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9722: \"$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
@@ -9742,17 +9744,17 @@ for ac_hdr in sys/uuid.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9746: checking for $ac_hdr" >&5
+echo "configure:9748: 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 9751 "configure"
+#line 9753 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9758: \"$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*
@@ -9782,14 +9784,14 @@ if test $ac_cv_header_sys_uuid_h = yes ; then
        save_LIBS="$LIBS"
        
 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
-echo "configure:9786: checking for library containing uuid_to_str" >&5
+echo "configure:9788: checking for library containing uuid_to_str" >&5
 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_uuid_to_str="no"
 cat > conftest.$ac_ext <<EOF
-#line 9793 "configure"
+#line 9795 "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
@@ -9800,7 +9802,7 @@ int main() {
 uuid_to_str()
 ; return 0; }
 EOF
-if { (eval echo configure:9804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_uuid_to_str="none required"
 else
@@ -9811,7 +9813,7 @@ rm -f conftest*
 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9815 "configure"
+#line 9817 "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
@@ -9822,7 +9824,7 @@ int main() {
 uuid_to_str()
 ; return 0; }
 EOF
-if { (eval echo configure:9826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_uuid_to_str="-l$ac_lib"
 break
@@ -9857,11 +9859,11 @@ fi
 
 if test $have_uuid = no ; then
        echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
-echo "configure:9861: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
+echo "configure:9863: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
        save_LIBS="$LIBS"
        LIBS="$LIBS -lrpcrt4"
        cat > conftest.$ac_ext <<EOF
-#line 9865 "configure"
+#line 9867 "configure"
 #include "confdefs.h"
 
                char UuidCreate@4();
@@ -9874,7 +9876,7 @@ int main() {
                
 ; return 0; }
 EOF
-if { (eval echo configure:9878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   need_rpcrt=yes
 else
@@ -9893,12 +9895,12 @@ fi
 
 ol_link_dnssrv=no
 echo $ac_n "checking for res_query""... $ac_c" 1>&6
-echo "configure:9897: checking for res_query" >&5
+echo "configure:9899: 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 9902 "configure"
+#line 9904 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char res_query(); below.  */
@@ -9922,7 +9924,7 @@ f = res_query;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9928: \"$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
@@ -9943,12 +9945,12 @@ fi
 
 if test $ac_cv_func_res_query = no ; then 
        echo $ac_n "checking for __res_query""... $ac_c" 1>&6
-echo "configure:9947: checking for __res_query" >&5
+echo "configure:9949: 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 9952 "configure"
+#line 9954 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char __res_query(); below.  */
@@ -9972,7 +9974,7 @@ f = __res_query;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9978: \"$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
@@ -9996,7 +9998,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:10000: checking for res_query in -lbind" >&5
+echo "configure:10002: 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
@@ -10004,7 +10006,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10008 "configure"
+#line 10010 "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
@@ -10015,7 +10017,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:10019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10021: \"$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
@@ -10047,7 +10049,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:10051: checking for __res_query in -lbind" >&5
+echo "configure:10053: 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
@@ -10055,7 +10057,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10059 "configure"
+#line 10061 "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
@@ -10066,7 +10068,7 @@ int main() {
 __res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:10070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10072: \"$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
@@ -10098,7 +10100,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:10102: checking for res_query in -lresolv" >&5
+echo "configure:10104: 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
@@ -10106,7 +10108,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10110 "configure"
+#line 10112 "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
@@ -10117,7 +10119,7 @@ int main() {
 res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:10121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10123: \"$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
@@ -10149,7 +10151,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:10153: checking for __res_query in -lresolv" >&5
+echo "configure:10155: 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
@@ -10157,7 +10159,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10161 "configure"
+#line 10163 "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
@@ -10168,7 +10170,7 @@ int main() {
 __res_query()
 ; return 0; }
 EOF
-if { (eval echo configure:10172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 for ac_func in getaddrinfo gai_strerror inet_ntop 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10220: checking for $ac_func" >&5
+echo "configure:10222: 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 10225 "configure"
+#line 10227 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10245,7 +10247,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10251: \"$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
@@ -10277,13 +10279,13 @@ if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
        fi
 elif test $ol_enable_ipv6 != no ; then
        echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
-echo "configure:10281: checking INET6_ADDRSTRLEN" >&5
+echo "configure:10283: 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 10287 "configure"
+#line 10289 "configure"
 #include "confdefs.h"
 
 #                      include <netinet/in.h>
 
 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
 
-       if test $ol_cv_inet6_addrstrlen = yes ; then
+
+       echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
+echo "configure:10314: checking struct sockaddr_storage" >&5
+if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+               cat > conftest.$ac_ext <<EOF
+#line 10320 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int main() {
+
+                       struct sockaddr_storage ss;
+
+; return 0; }
+EOF
+if { (eval echo configure:10332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_struct_sockaddr_storage=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_struct_sockaddr_storage=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
+
+       if test $ol_cv_inet6_addrstrlen = yes \
+               -a $ol_cv_struct_sockaddr_storage = yes ; then
                ol_link_ipv6=yes
-       elif test $ol_enable_ipv6 = yes ; then
+       elif test $ol_enable_ipv6 = yes \
+                       -a $ol_cv_inet6_addrstrlen = no ; then
                { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
+       elif test $ol_enable_ipv6 = yes \
+                       -a $ol_cv_struct_sockaddr_storage = no ; then
+               { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
        fi
 fi
 
@@ -10318,17 +10359,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:10322: checking for $ac_hdr" >&5
+echo "configure:10363: 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 10327 "configure"
+#line 10368 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10373: \"$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*
@@ -10375,17 +10416,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:10379: checking for $ac_hdr" >&5
+echo "configure:10420: 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 10384 "configure"
+#line 10425 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10430: \"$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*
@@ -10417,17 +10458,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10421: checking for $ac_hdr" >&5
+echo "configure:10462: 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 10426 "configure"
+#line 10467 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10472: \"$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*
@@ -10461,7 +10502,7 @@ done
 
                if test $krb5_impl = mit; then
                        echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
-echo "configure:10465: checking for main in -lk5crypto" >&5
+echo "configure:10506: 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
@@ -10469,14 +10510,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lk5crypto  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10473 "configure"
+#line 10514 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:10480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10521: \"$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
@@ -10499,7 +10540,7 @@ fi
 
 
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:10503: checking for main in -lkrb5" >&5
+echo "configure:10544: 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
@@ -10507,14 +10548,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10511 "configure"
+#line 10552 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:10518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10559: \"$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
@@ -10539,7 +10580,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
-echo "configure:10543: checking for main in -ldes" >&5
+echo "configure:10584: checking for main in -ldes" >&5
 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10547,14 +10588,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldes  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10551 "configure"
+#line 10592 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:10558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10599: \"$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
@@ -10577,7 +10618,7 @@ fi
 
 
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:10581: checking for main in -lkrb5" >&5
+echo "configure:10622: 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
@@ -10585,14 +10626,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10589 "configure"
+#line 10630 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:10596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10637: \"$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
@@ -10655,17 +10696,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:10659: checking for $ac_hdr" >&5
+echo "configure:10700: 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 10664 "configure"
+#line 10705 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10710: \"$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*
@@ -10695,7 +10736,7 @@ 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:10699: checking for main in -lkrb4" >&5
+echo "configure:10740: 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
@@ -10703,14 +10744,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10707 "configure"
+#line 10748 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:10714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10755: \"$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
@@ -10735,7 +10776,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:10739: checking for main in -lkrb4" >&5
+echo "configure:10780: 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
@@ -10743,14 +10784,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10747 "configure"
+#line 10788 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:10754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10795: \"$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
@@ -10792,7 +10833,7 @@ EOF
 
 
                        echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:10796: checking for des_debug in Kerberos libraries" >&5
+echo "configure:10837: 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
@@ -10800,7 +10841,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 10804 "configure"
+#line 10845 "configure"
 #include "confdefs.h"
 
 #include <kerberosIV/krb.h>
@@ -10813,7 +10854,7 @@ des_debug = 1;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10858: \"$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
@@ -10852,17 +10893,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:10856: checking for $ac_hdr" >&5
+echo "configure:10897: 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 10861 "configure"
+#line 10902 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10907: \"$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*
@@ -10891,7 +10932,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:10895: checking for main in -lkrb" >&5
+echo "configure:10936: 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
@@ -10899,14 +10940,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10903 "configure"
+#line 10944 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:10910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10951: \"$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
@@ -10976,17 +11017,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:10980: checking for $ac_hdr" >&5
+echo "configure:11021: 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 10985 "configure"
+#line 11026 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 done
 
        
-       if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
+       if test $ac_cv_header_openssl_ssl_h = yes \
+               -o $ac_cv_header_ssl_h = yes ; then
                echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
-echo "configure:11019: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
+echo "configure:11061: 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
@@ -11023,7 +11065,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11027 "configure"
+#line 11069 "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
@@ -11034,7 +11076,7 @@ int main() {
 SSLeay_add_ssl_algorithms()
 ; return 0; }
 EOF
-if { (eval echo configure:11038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11080: \"$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
@@ -11059,7 +11101,7 @@ fi
                        
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
-echo "configure:11063: checking for SSL_library_init in -lssl" >&5
+echo "configure:11105: 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
@@ -11067,7 +11109,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11071 "configure"
+#line 11113 "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
@@ -11078,7 +11120,7 @@ int main() {
 SSL_library_init()
 ; return 0; }
 EOF
-if { (eval echo configure:11082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11124: \"$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
@@ -11104,7 +11146,7 @@ fi
 
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
-echo "configure:11108: checking for ssl3_accept in -lssl" >&5
+echo "configure:11150: 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
@@ -11112,7 +11154,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11116 "configure"
+#line 11158 "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
@@ -11123,7 +11165,7 @@ int main() {
 ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:11127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11169: \"$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
@@ -11198,26 +11240,27 @@ EOF
 
 fi
 
-for ac_func in \
-       ctime_r                 \
-       gethostbyname_r gethostbyaddr_r \
+ol_link_threads=no
 
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11208: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+       -o $ol_with_threads = nt ; then
+
+       
+       echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
+echo "configure:11251: 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 11213 "configure"
+#line 11256 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char _beginthread(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char $ac_func();
+char _beginthread();
 char (*f)();
 
 int main() {
@@ -11225,597 +11268,303 @@ 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)
+#if defined (__stub__beginthread) || defined (__stub____beginthread)
 choke me
 #else
-f = $ac_func;
+f = _beginthread;
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:11237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+  eval "ac_cv_func__beginthread=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  eval "ac_cv_func__beginthread=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
+  :
 else
   echo "$ac_t""no" 1>&6
 fi
-done
 
 
-if test "$ac_cv_func_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:11266: checking number of arguments of ctime_r" >&5
-if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
+       if test $ac_cv_func__beginthread = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_THREADS 1
+EOF
+
+               ol_cv_nt_threads=yes
+       fi
+
+
+       if test "$ol_cv_nt_threads" = yes ; then
+               ol_link_threads=nt
+               ol_with_threads=found
+               ol_with_yielding_select=yes
+
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_SERVICE_MANAGER 1
+EOF
+
+               cat >> confdefs.h <<\EOF
+#define HAVE_NT_EVENT_LOG 1
+EOF
+
+       fi
+
+       if test $ol_with_threads = nt ; then
+               { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
+       fi
+fi
+
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+       -o $ol_with_threads = posix ; then
+
+       for ac_hdr in pthread.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:11336: 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 11271 "configure"
+#line 11341 "configure"
 #include "confdefs.h"
-#include <time.h>
-int main() {
-time_t ti; char *buffer; ctime_r(&ti,buffer,32);
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:11278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:11346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs3=yes
+  eval "ac_cv_header_$ac_safe=yes"
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs3=no
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
 
+
+       if test $ac_cv_header_pthread_h = yes ; then
+               echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
+echo "configure:11375: 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 11290 "configure"
+#line 11381 "configure"
 #include "confdefs.h"
-#include <time.h>
+
+#              include <pthread.h>
+       
 int main() {
-time_t ti; char *buffer; ctime_r(&ti,buffer);
+
+               int i = PTHREAD_CREATE_JOINABLE;
+       
 ; return 0; }
 EOF
-if { (eval echo configure:11297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs2=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  
+       cat > conftest.$ac_ext <<EOF
+#line 11396 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pthread_detach" >/dev/null 2>&1; then
   rm -rf conftest*
-  ol_cv_func_ctime_r_nargs2=no
+  ol_cv_pthread_version=10
+else
+  rm -rf conftest*
+  ol_cv_pthread_version=8
 fi
 rm -f conftest*
 
-       if test $ol_cv_func_ctime_r_nargs3 = yes -a \
-               $ol_cv_func_ctime_r_nargs2 = no ; then
-
-               ol_cv_func_ctime_r_nargs=3
-
-       elif test $ol_cv_func_ctime_r_nargs3 = no -a \
-               $ol_cv_func_ctime_r_nargs2 = yes ; then
-
-               ol_cv_func_ctime_r_nargs=2
-
-       else
-               ol_cv_func_ctime_r_nargs=0
-       fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
   
-fi
-
-echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
+       cat > conftest.$ac_ext <<EOF
+#line 11416 "configure"
+#include "confdefs.h"
 
-  if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
-       cat >> confdefs.h <<EOF
-#define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
+#              include <pthread.h>
+#              ifdef PTHREAD_CREATE_UNDETACHED
+               draft7
+#              endif
+       
 EOF
-
-  fi
-
-fi
-
-if test "$ac_cv_func_gethostbyname_r" = yes ; then
-       echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
-echo "configure:11337: 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
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "draft7" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_pthread_version=7
 else
-  cat > conftest.$ac_ext <<EOF
-#line 11342 "configure"
+  rm -rf conftest*
+  
+       cat > conftest.$ac_ext <<EOF
+#line 11433 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)
-int main() {
-struct hostent hent; char buffer[BUFSIZE];
-               int bufsize=BUFSIZE;int h_errno;
-               (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
-                       buffer, bufsize, &h_errno);
-; return 0; }
+#include <pthread.h>
 EOF
-if { (eval echo configure:11356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pthread_attr_init" >/dev/null 2>&1; then
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs5=yes
+  ol_cv_pthread_version=6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs5=no
-fi
-rm -f conftest*
-
+  
        cat > conftest.$ac_ext <<EOF
-#line 11368 "configure"
+#line 11445 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)
-int main() {
-struct hostent hent;struct hostent *rhent;
-               char buffer[BUFSIZE];
-               int bufsize=BUFSIZE;int h_errno;
-               (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
-                       &rhent, &h_errno);
-; return 0; }
+
+#              include <pthread.h>
+#ifdef         PTHREAD_MUTEX_INITIALIZER
+               draft5
+#endif
+       
 EOF
-if { (eval echo configure:11383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "draft5" >/dev/null 2>&1; then
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs6=yes
+  ol_cv_pthread_version=5
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_gethostbyname_r_nargs6=no
+  ol_cv_pthread_version=4
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
 fi
 rm -f conftest*
 
-       if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
-               $ol_cv_func_gethostbyname_r_nargs6 = no ; then
-
-               ol_cv_func_gethostbyname_r_nargs=5
-
-       elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
-               $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
+fi
 
-               ol_cv_func_gethostbyname_r_nargs=6
+echo "$ac_t""$ol_cv_pthread_version" 1>&6
 
-       else
-               ol_cv_func_gethostbyname_r_nargs=0
-       fi
-  
-fi
 
-echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
-  if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
-       cat >> confdefs.h <<EOF
-#define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
+               if test $ol_cv_pthread_version != 0 ; then
+                       cat >> confdefs.h <<EOF
+#define HAVE_PTHREADS $ol_cv_pthread_version
 EOF
 
-  fi
+               else
+                       { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
+               fi
 
-else
-       ol_cv_func_gethostbyname_r_nargs=0
-fi
-if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
-       echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
-echo "configure:11424: checking number of arguments of gethostbyaddr_r" >&5
-if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
+               # consider threads found
+               ol_with_threads=found
+
+               
+       echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
+echo "configure:11492: 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 11429 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)
-int main() {
-struct hostent hent; char buffer[BUFSIZE]; 
-           struct in_addr add;
-           size_t alen=sizeof(struct in_addr);
-           int bufsize=BUFSIZE;int h_errno;
-               (void)gethostbyaddr_r( (void *)&(add.s_addr),
-                       alen, AF_INET, &hent, buffer, bufsize, &h_errno);
-; return 0; }
-EOF
-if { (eval echo configure:11445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs7=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs7=no
-fi
-rm -f conftest*
-
-       cat > conftest.$ac_ext <<EOF
-#line 11457 "configure"
+#line 11497 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#define BUFSIZE (sizeof(struct hostent)+10)
-int main() {
-struct hostent hent;
-               struct hostent *rhent; char buffer[BUFSIZE]; 
-               struct in_addr add;
-               size_t alen=sizeof(struct in_addr);
-               int bufsize=BUFSIZE;int h_errno;
-               (void)gethostbyaddr_r( (void *)&(add.s_addr),
-                       alen, AF_INET, &hent, buffer, bufsize, 
-                       &rhent, &h_errno);
-; return 0; }
+#include <pthread.h>
 EOF
-if { (eval echo configure:11475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
   rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs8=yes
+  ol_cv_header_linux_threads=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_func_gethostbyaddr_r_nargs8=no
+  ol_cv_header_linux_threads=no
 fi
 rm -f conftest*
 
-       if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
-               $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
-
-               ol_cv_func_gethostbyaddr_r_nargs=7
-
-       elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
-               $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
-
-               ol_cv_func_gethostbyaddr_r_nargs=8
-
-       else
-               ol_cv_func_gethostbyaddr_r_nargs=0
-       fi
-  
+               
 fi
 
-echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
-  if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
-    cat >> confdefs.h <<EOF
-#define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
+echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
+       if test $ol_cv_header_linux_threads = yes; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_LINUX_THREADS 1
 EOF
 
-  fi
+       fi
 
+               
+       echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
+echo "configure:11524: 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
-       ol_cv_func_gethostbyaddr_r_nargs=0
-fi
+  cat > conftest.$ac_ext <<EOF
+#line 11529 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+#ifdef _POSIX_THREAD_IS_GNU_PTH
+       __gnu_pth__;
+#endif
 
-if test "$ac_cv_func_ctime_r" = yes \
-       -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
-       -a "$ol_cv_func_ctime_r_nargs" -le 3 \
-       -a "$ac_cv_func_gethostbyname_r" = yes \
-       -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
-       -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
-       -a "$ac_cv_func_gethostbyaddr_r" = yes \
-       -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
-       -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
-       ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
 EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__gnu_pth__" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_header_gnu_pth_pthread_h=yes
+else
+  rm -rf conftest*
+  ol_cv_header_gnu_pth_pthread_h=no
+fi
+rm -f conftest*
 
+               
 fi
 
-ol_link_threads=no
+echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
 
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
-       -o $ol_with_threads = nt ; then
 
-       
-       echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
-echo "configure:11538: checking for _beginthread" >&5
-if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
+               if test $ol_cv_header_gnu_pth_pthread_h = no ; then
+                       for ac_hdr in sched.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:11558: 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 11543 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _beginthread(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char _beginthread();
-char (*f)();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub__beginthread) || defined (__stub____beginthread)
-choke me
-#else
-f = _beginthread;
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:11567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func__beginthread=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func__beginthread=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
-       if test $ac_cv_func__beginthread = yes ; then
-               cat >> confdefs.h <<\EOF
-#define HAVE_NT_THREADS 1
-EOF
-
-               ol_cv_nt_threads=yes
-       fi
-
-
-       if test "$ol_cv_nt_threads" = yes ; then
-               ol_link_threads=nt
-               ol_with_threads=found
-               ol_with_yielding_select=yes
-
-               cat >> confdefs.h <<\EOF
-#define HAVE_NT_SERVICE_MANAGER 1
-EOF
-
-               cat >> confdefs.h <<\EOF
-#define HAVE_NT_EVENT_LOG 1
-EOF
-
-       fi
-
-       if test $ol_with_threads = nt ; then
-               { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
-       fi
-fi
-
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
-       -o $ol_with_threads = posix ; then
-
-       for ac_hdr in pthread.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11623: 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 11628 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-       if test $ac_cv_header_pthread_h = yes ; then
-               echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:11662: 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 11668 "configure"
-#include "confdefs.h"
-
-#              include <pthread.h>
-               /* this check could be improved */
-#              ifdef PTHREAD_ONCE_INIT
-                       pthread_version_final;
-#              endif
-       
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pthread_version_final" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ol_pthread_final=yes
-else
-  rm -rf conftest*
-  ol_pthread_final=no
-fi
-rm -f conftest*
-
-
-       cat > conftest.$ac_ext <<EOF
-#line 11690 "configure"
-#include "confdefs.h"
-
-#              include <pthread.h>
-               /* this check could be improved */
-#              ifdef pthread_once_init
-                       pthread_version_draft4;
-#              endif
-       
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pthread_version_draft4" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ol_pthread_draft4=yes
-else
-  rm -rf conftest*
-  ol_pthread_draft4=no
-fi
-rm -f conftest*
-
-
-       if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
-               ol_cv_pthread_version=final
-       elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
-               ol_cv_pthread_version=draft4
-       else
-               ol_cv_pthread_version=unknown
-       fi
-
-fi
-
-echo "$ac_t""$ol_cv_pthread_version" 1>&6
-
-
-               if test $ol_cv_pthread_version = final ; then
-                       cat >> confdefs.h <<\EOF
-#define HAVE_PTHREADS_FINAL 1
-EOF
-
-               elif test $ol_cv_pthread_version = draft4 ; then
-                       cat >> confdefs.h <<\EOF
-#define HAVE_PTHREADS_D4 1
-EOF
-
-               else
-                       { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
-               fi
-
-               # consider threads found
-               ol_with_threads=found
-
-               
-       echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:11743: 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 11748 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ol_cv_header_linux_threads=yes
-else
-  rm -rf conftest*
-  ol_cv_header_linux_threads=no
-fi
-rm -f conftest*
-
-               
-fi
-
-echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
-       if test $ol_cv_header_linux_threads = yes; then
-               cat >> confdefs.h <<\EOF
-#define HAVE_LINUX_THREADS 1
-EOF
-
-       fi
-
-               
-       echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
-echo "configure:11775: 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 11780 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-#ifdef _POSIX_THREAD_IS_GNU_PTH
-       __gnu_pth__;
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "__gnu_pth__" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ol_cv_header_gnu_pth_pthread_h=yes
-else
-  rm -rf conftest*
-  ol_cv_header_gnu_pth_pthread_h=no
-fi
-rm -f conftest*
-
-               
-fi
-
-echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
-
-
-               if test $ol_cv_header_gnu_pth_pthread_h = no ; then
-                       for ac_hdr in sched.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11809: 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 11814 "configure"
+#line 11563 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11568: \"$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*
@@ -11845,17 +11594,20 @@ done
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
-echo "configure:11849: checking for pthread_create in default libraries" >&5
+echo "configure:11598: 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 11856 "configure"
+#line 11605 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -11869,60 +11621,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -11933,7 +11668,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_create=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 11949 "configure"
+#line 11684 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -11966,60 +11704,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #endif
-       }
        if( status ) return status;
-#endif
-
        status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
        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
-
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12031,7 +11752,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11756: \"$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
@@ -12056,7 +11777,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:12060: checking for pthread link with -kthread" >&5
+echo "configure:11781: 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
@@ -12067,10 +11788,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12071 "configure"
+#line 11792 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12084,60 +11808,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12148,7 +11855,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_kthread=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12164 "configure"
+#line 11871 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12181,60 +11891,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12246,7 +11939,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11943: \"$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
@@ -12276,7 +11969,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:12280: checking for pthread link with -pthread" >&5
+echo "configure:11973: 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
@@ -12287,10 +11980,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12291 "configure"
+#line 11984 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12304,60 +12000,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12368,7 +12047,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthread=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12384 "configure"
+#line 12063 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12401,60 +12083,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12466,7 +12131,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12135: \"$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
@@ -12496,7 +12161,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:12500: checking for pthread link with -pthreads" >&5
+echo "configure:12165: 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
@@ -12507,10 +12172,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12511 "configure"
+#line 12176 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12524,60 +12192,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12588,7 +12239,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthreads=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12604 "configure"
+#line 12255 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12621,60 +12275,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12686,7 +12323,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12327: \"$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
@@ -12716,7 +12353,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:12720: checking for pthread link with -mthreads" >&5
+echo "configure:12357: 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
@@ -12727,10 +12364,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12731 "configure"
+#line 12368 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12744,60 +12384,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12808,7 +12431,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_mthreads=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12824 "configure"
+#line 12447 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12841,60 +12467,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -12906,7 +12515,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12519: \"$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
@@ -12936,7 +12545,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:12940: checking for pthread link with -thread" >&5
+echo "configure:12549: 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
@@ -12947,10 +12556,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12951 "configure"
+#line 12560 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -12964,60 +12576,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13028,7 +12623,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_thread=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13044 "configure"
+#line 12639 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13061,60 +12659,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13126,7 +12707,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12711: \"$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
@@ -13157,7 +12738,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:13161: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+echo "configure:12742: 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
@@ -13168,10 +12749,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13172 "configure"
+#line 12753 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13185,60 +12769,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13249,7 +12816,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12820: \"$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
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13265 "configure"
+#line 12832 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13282,60 +12852,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13347,7 +12900,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12904: \"$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
@@ -13377,7 +12930,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:13381: checking for pthread link with -lpthread -lmach -lexc" >&5
+echo "configure:12934: 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
@@ -13388,10 +12941,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13392 "configure"
+#line 12945 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13405,60 +12961,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13469,7 +13008,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13012: \"$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
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13485 "configure"
+#line 13024 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13502,60 +13044,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13567,7 +13092,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13096: \"$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
@@ -13598,7 +13123,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:13602: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+echo "configure:13127: 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
@@ -13609,10 +13134,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13613 "configure"
+#line 13138 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13626,60 +13154,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13690,7 +13201,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13205: \"$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
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13706 "configure"
+#line 13217 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13723,60 +13237,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #endif
-       }
        if( status ) return status;
-#endif
-
        status = pthread_create( &t, &attr, task, NULL );
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
+#endif
        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
-
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13788,7 +13285,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13289: \"$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
@@ -13819,7 +13316,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:13823: checking for pthread link with -lpthread" >&5
+echo "configure:13320: 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
@@ -13830,10 +13327,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13834 "configure"
+#line 13331 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13847,60 +13347,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -13911,7 +13394,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13927 "configure"
+#line 13410 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -13944,60 +13430,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14009,7 +13478,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13482: \"$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
@@ -14039,7 +13508,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:14043: checking for pthread link with -lc_r" >&5
+echo "configure:13512: 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
@@ -14050,10 +13519,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14054 "configure"
+#line 13523 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14067,60 +13539,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14131,7 +13586,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13590: \"$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
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14147 "configure"
+#line 13602 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14164,60 +13622,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14229,7 +13670,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13674: \"$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
@@ -14260,7 +13701,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:14264: checking for pthread link with -threads" >&5
+echo "configure:13705: 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
@@ -14271,10 +13712,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14275 "configure"
+#line 13716 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14288,60 +13732,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14352,7 +13779,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_threads=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14368 "configure"
+#line 13795 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14385,60 +13815,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14450,7 +13863,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13867: \"$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
@@ -14481,7 +13894,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:14485: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+echo "configure:13898: 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
@@ -14492,10 +13905,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14496 "configure"
+#line 13909 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14509,60 +13925,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14573,7 +13972,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13976: \"$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
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14589 "configure"
+#line 13988 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14606,60 +14008,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14671,7 +14056,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14060: \"$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
@@ -14701,7 +14086,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:14705: checking for pthread link with -lpthreads -lmach -lexc" >&5
+echo "configure:14090: 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
@@ -14712,10 +14097,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14716 "configure"
+#line 14101 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14729,60 +14117,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14793,7 +14164,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14168: \"$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
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14809 "configure"
+#line 14180 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14826,60 +14200,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -14891,7 +14248,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14252: \"$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
@@ -14921,7 +14278,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:14925: checking for pthread link with -lpthreads -lexc" >&5
+echo "configure:14282: 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
@@ -14932,10 +14289,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14936 "configure"
+#line 14293 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -14949,60 +14309,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -15013,7 +14356,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:15017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14360: \"$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
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 15029 "configure"
+#line 14372 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -15046,60 +14392,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -15111,7 +14440,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:15115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14444: \"$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
@@ -15142,7 +14471,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:15146: checking for pthread link with -lpthreads" >&5
+echo "configure:14475: 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
@@ -15153,10 +14482,13 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 15157 "configure"
+#line 14486 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -15170,60 +14502,43 @@ static void *task(p)
 int main() {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -15234,7 +14549,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:15238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthreads=yes
 else
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 15250 "configure"
+#line 14565 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -15267,60 +14585,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -15332,7 +14633,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:15336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14637: \"$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
 
 
                if test $ol_link_threads != no ; then
-                       cat >> confdefs.h <<\EOF
-#define HAVE_PTHREADS 1
-EOF
-
-
                        LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
 
                                                save_CPPFLAGS="$CPPFLAGS"
                        save_LIBS="$LIBS"
                        LIBS="$LTHREAD_LIBS $LIBS"
 
-                                                                                               for ac_func in sched_yield pthread_yield
+                                                                                               for ac_func in sched_yield pthread_yield thr_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15378: checking for $ac_func" >&5
+echo "configure:14674: 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 15383 "configure"
+#line 14679 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15403,7 +14699,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14703: \"$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
@@ -15429,9 +14725,10 @@ done
 
 
                        if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no ; then
+                               $ac_cv_func_pthread_yield = no -a \
+                               $ac_cv_func_thr_yield = no ; then
                                                                echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:15435: checking for sched_yield in -lrt" >&5
+echo "configure:14732: 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
@@ -15439,7 +14736,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15443 "configure"
+#line 14740 "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
@@ -15450,7 +14747,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:15454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
                        fi
                        if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no ; then
-                                                                                               for ac_func in thr_yield
+                               $ac_cv_func_pthread_yield = no -a \
+                               "$ac_cv_func_thr_yield" = no ; then
+                               echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
+                       fi
+
+                                               for ac_func in pthread_kill pthread_rwlock_destroy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15486: checking for $ac_func" >&5
+echo "configure:14787: 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 15491 "configure"
+#line 14792 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15511,7 +14812,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14816: \"$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
@@ -15535,78 +14836,15 @@ else
 fi
 done
 
-                       fi
-                       if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no -a \
-                               "$ac_cv_func_thr_yield" = no ; then
-                               echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
-                       fi
 
-                                               for ac_func in pthread_kill pthread_rwlock_destroy
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15549: 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 15554 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-char (*f)();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func;
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:15578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-
-                                                                       echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:15604: checking for pthread_detach with <pthread.h>" >&5
-if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
+                                                                       echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
+echo "configure:14842: 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 15610 "configure"
+#line 14848 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -15618,7 +14856,7 @@ int main() {
 pthread_detach(NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:15622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14860: \"$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
@@ -15650,12 +14888,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15654: checking for $ac_func" >&5
+echo "configure:14892: 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 15659 "configure"
+#line 14897 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15679,7 +14917,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14921: \"$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
@@ -15708,12 +14946,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:15712: checking for $ac_func" >&5
+echo "configure:14950: 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 15717 "configure"
+#line 14955 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15737,7 +14975,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14979: \"$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
@@ -15762,7 +15000,7 @@ fi
 done
 
        echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
-echo "configure:15766: checking for LinuxThreads implementation" >&5
+echo "configure:15004: 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
@@ -15775,7 +15013,7 @@ echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
        
        
        echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
-echo "configure:15779: checking for LinuxThreads consistency" >&5
+echo "configure:15017: checking for LinuxThreads consistency" >&5
 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15800,7 +15038,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:15804: checking if pthread_create() works" >&5
+echo "configure:15042: 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
@@ -15809,10 +15047,13 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 15813 "configure"
+#line 15051 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
+#if HAVE_PTHREADS < 7
+#include <errno.h>
+#endif
 #ifndef NULL
 #define NULL (void*)0
 #endif
@@ -15830,60 +15071,43 @@ int main(argc, argv)
 {
 
        /* pthread test function */
+#ifndef PTHREAD_CREATE_DETACHED
+#define        PTHREAD_CREATE_DETACHED 1
+#endif
        pthread_t t;
        int status;
-       int detach = 1;
+       int detach = PTHREAD_CREATE_DETACHED;
 
-#ifdef HAVE_PTHREADS_FINAL
+#if HAVE_PTHREADS > 4
        /* Final pthreads */
        pthread_attr_t attr;
 
        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);
+#if HAVE_PTHREADS < 7
+       status = pthread_attr_setdetachstate(&attr, &detach);
+       if( status < 0 ) status = errno;
 #else
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
-#endif
-
-#ifdef PTHREAD_CREATE_DETACHED
-       } else {
-               status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+       status = pthread_attr_setdetachstate(&attr, detach);
 #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;
-       }
+#if HAVE_PTHREADS < 7
+       if( status < 0 ) status = errno;
 #endif
-
+       if( status ) return status;
 #else
        /* Draft 4 pthreads */
        status = pthread_create( &t, pthread_attr_default, task, NULL );
-       if( status ) return status;
+       if( status ) return errno;
 
-       if( detach ) {
-               /* give thread a chance to complete */
-               /* it should remain joinable and hence detachable */
-               sleep( 1 );
+       /* give thread a chance to complete */
+       /* it should remain joinable and hence detachable */
+       sleep( 1 );
 
-               status = pthread_detach( &t );
-               if( status ) return status;
-       }
+       status = pthread_detach( &t );
+       if( status ) return errno;
 #endif
 
 #ifdef HAVE_LINUX_THREADS
@@ -15895,7 +15119,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:15899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15123: \"$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
@@ -15917,7 +15141,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:15921: checking if select yields when using pthreads" >&5
+echo "configure:15145: 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
@@ -15926,7 +15150,7 @@ else
   ol_cv_pthread_select_yields=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 15930 "configure"
+#line 15154 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -15985,24 +15209,25 @@ int main(argc, argv)
 #endif
 #endif
 
-#if HAVE_PTHREADS_D4
+#if HAVE_PTHREADS < 6
        pthread_create(&t, pthread_attr_default, task, NULL);
 #else
        pthread_create(&t, NULL, task, NULL);
 #endif
 
-#if HAVE_SCHED_YIELD
-       sched_yield();  /* make sure task runs first */
-#else
-#ifdef HAVE_PTHREAD_YIELD
-       pthread_yield();        /* make sure task runs first */
-#endif
+       /* make sure task runs first */
+#if HAVE_THR_YIELD
+       thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+       sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+       pthread_yield();
 #endif
 
        exit(2);
 }
 EOF
-if { (eval echo configure:16006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15231: \"$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
@@ -16046,17 +15271,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:16050: checking for $ac_hdr" >&5
+echo "configure:15275: 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 16055 "configure"
+#line 15280 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15285: \"$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*
@@ -16086,12 +15311,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:16090: checking for cthread_fork" >&5
+echo "configure:15315: 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 16095 "configure"
+#line 15320 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -16115,7 +15340,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:16119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15344: \"$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
@@ -16137,7 +15362,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:16141: checking for cthread_fork with -all_load" >&5
+echo "configure:15366: 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
@@ -16145,7 +15370,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 16149 "configure"
+#line 15374 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -16154,7 +15379,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:16158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15383: \"$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
@@ -16184,12 +15409,12 @@ echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
                                save_LIBS="$LIBS"
                LIBS="$LIBS -lthreads"
                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:16188: checking for cthread_fork" >&5
+echo "configure:15413: 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 16193 "configure"
+#line 15418 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -16213,7 +15438,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:16217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15442: \"$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
@@ -16263,17 +15488,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:16267: checking for $ac_hdr" >&5
+echo "configure:15492: 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 16272 "configure"
+#line 15497 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15502: \"$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*
@@ -16302,7 +15527,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:16306: checking for pth_version in -lpth" >&5
+echo "configure:15531: 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
@@ -16310,7 +15535,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 16314 "configure"
+#line 15539 "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
@@ -16321,7 +15546,7 @@ int main() {
 pth_version()
 ; return 0; }
 EOF
-if { (eval echo configure:16325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15550: \"$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
@@ -16366,17 +15591,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:16370: checking for $ac_hdr" >&5
+echo "configure:15595: 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 16375 "configure"
+#line 15600 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15605: \"$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*
@@ -16404,7 +15629,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:16408: checking for thr_create in -lthread" >&5
+echo "configure:15633: 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
@@ -16412,7 +15637,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 16416 "configure"
+#line 15641 "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
@@ -16423,7 +15648,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:16427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15652: \"$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
@@ -16463,12 +15688,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16467: checking for $ac_func" >&5
+echo "configure:15692: 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 16472 "configure"
+#line 15697 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -16492,7 +15717,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:16496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15721: \"$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
@@ -16523,17 +15748,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16527: checking for $ac_hdr" >&5
+echo "configure:15752: 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 16532 "configure"
+#line 15757 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15762: \"$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*
@@ -16561,7 +15786,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:16565: checking for lwp_create in -llwp" >&5
+echo "configure:15790: 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
@@ -16569,7 +15794,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 16573 "configure"
+#line 15798 "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
@@ -16580,7 +15805,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:16584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15809: \"$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
@@ -16633,17 +15858,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:16637: checking for $ac_hdr" >&5
+echo "configure:15862: 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 16642 "configure"
+#line 15867 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15872: \"$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*
@@ -16672,12 +15897,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16676: checking for $ac_func" >&5
+echo "configure:15901: 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 16681 "configure"
+#line 15906 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -16701,7 +15926,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:16705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15930: \"$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
@@ -16727,12 +15952,12 @@ done
 
        
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:16731: checking for LinuxThreads pthread.h" >&5
+echo "configure:15956: 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 16736 "configure"
+#line 15961 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -16762,17 +15987,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16766: checking for $ac_hdr" >&5
+echo "configure:15991: 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 16771 "configure"
+#line 15996 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16001: \"$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*
@@ -16802,17 +16027,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16806: checking for $ac_hdr" >&5
+echo "configure:16031: 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 16811 "configure"
+#line 16036 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16041: \"$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*
@@ -16842,17 +16067,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16846: checking for $ac_hdr" >&5
+echo "configure:16071: 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 16851 "configure"
+#line 16076 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16081: \"$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*
 EOF
 
 
-                       echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:16915: 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 16921 "configure"
-#include "confdefs.h"
-#include <errno.h>
-int main() {
-errno = 0;
+                       echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
+echo "configure:16140: 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 16146 "configure"
+#include "confdefs.h"
+#include <errno.h>
+int main() {
+errno = 0;
+; return 0; }
+EOF
+if { (eval echo configure:16153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_errno_thread_specific=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_errno_thread_specific=no
+fi
+rm -f conftest*
+       
+fi
+
+echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
+
+                       echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
+echo "configure:16169: 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 16175 "configure"
+#include "confdefs.h"
+#include <netdb.h>
+int main() {
+h_errno = 0;
+; return 0; }
+EOF
+if { (eval echo configure:16182: \"$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
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_h_errno_thread_specific=no
+fi
+rm -f conftest*
+       
+fi
+
+echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
+
+       if test $ol_cv_errno_thread_specific != yes \
+               -o $ol_cv_h_errno_thread_specific != yes ; then
+               LIBS="$LTHREAD_LIBS $LIBS"
+               LTHREAD_LIBS=""
+       fi
+
+fi  
+
+if test $ol_link_threads = no ; then
+       if test $ol_with_threads = yes ; then
+               { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
+       fi
+
+       if test $ol_with_threads = auto ; then
+               echo "configure: warning: no suitable thread support, disabling threads" 1>&2
+               ol_with_threads=no
+       fi
+
+       cat >> confdefs.h <<\EOF
+#define NO_THREADS 1
+EOF
+
+       LTHREAD_LIBS=""
+fi
+
+if test $ol_link_threads != no ; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
+EOF
+
+fi
+
+for ac_func in \
+       ctime_r                 \
+       gethostbyname_r gethostbyaddr_r \
+
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:16235: 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 16240 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+char (*f)();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:16264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+if test "$ac_cv_func_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:16293: 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 16298 "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:16305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_func_ctime_r_nargs3=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_func_ctime_r_nargs3=no
+fi
+rm -f conftest*
+
+       cat > conftest.$ac_ext <<EOF
+#line 16317 "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:16324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_func_ctime_r_nargs2=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_func_ctime_r_nargs2=no
+fi
+rm -f conftest*
+
+       if test $ol_cv_func_ctime_r_nargs3 = yes -a \
+               $ol_cv_func_ctime_r_nargs2 = no ; then
+
+               ol_cv_func_ctime_r_nargs=3
+
+       elif test $ol_cv_func_ctime_r_nargs3 = no -a \
+               $ol_cv_func_ctime_r_nargs2 = yes ; then
+
+               ol_cv_func_ctime_r_nargs=2
+
+       else
+               ol_cv_func_ctime_r_nargs=0
+       fi
+  
+fi
+
+echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
+
+  if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
+       cat >> confdefs.h <<EOF
+#define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
+EOF
+
+  fi
+
+fi
+
+if test "$ac_cv_func_gethostbyname_r" = yes ; then
+       echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
+echo "configure:16364: 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 16369 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)
+int main() {
+struct hostent hent; char buffer[BUFSIZE];
+               int bufsize=BUFSIZE;int h_errno;
+               (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
+                       buffer, bufsize, &h_errno);
+; return 0; }
+EOF
+if { (eval echo configure:16383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_func_gethostbyname_r_nargs5=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_func_gethostbyname_r_nargs5=no
+fi
+rm -f conftest*
+
+       cat > conftest.$ac_ext <<EOF
+#line 16395 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)
+int main() {
+struct hostent hent;struct hostent *rhent;
+               char buffer[BUFSIZE];
+               int bufsize=BUFSIZE;int h_errno;
+               (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
+                       &rhent, &h_errno);
+; return 0; }
+EOF
+if { (eval echo configure:16410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_func_gethostbyname_r_nargs6=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_func_gethostbyname_r_nargs6=no
+fi
+rm -f conftest*
+
+       if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
+               $ol_cv_func_gethostbyname_r_nargs6 = no ; then
+
+               ol_cv_func_gethostbyname_r_nargs=5
+
+       elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
+               $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
+
+               ol_cv_func_gethostbyname_r_nargs=6
+
+       else
+               ol_cv_func_gethostbyname_r_nargs=0
+       fi
+  
+fi
+
+echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
+  if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
+       cat >> confdefs.h <<EOF
+#define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
+EOF
+
+  fi
+
+else
+       ol_cv_func_gethostbyname_r_nargs=0
+fi
+if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
+       echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
+echo "configure:16451: 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 16456 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)
+int main() {
+struct hostent hent; char buffer[BUFSIZE]; 
+           struct in_addr add;
+           size_t alen=sizeof(struct in_addr);
+           int bufsize=BUFSIZE;int h_errno;
+               (void)gethostbyaddr_r( (void *)&(add.s_addr),
+                       alen, AF_INET, &hent, buffer, bufsize, &h_errno);
+; return 0; }
+EOF
+if { (eval echo configure:16472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_func_gethostbyaddr_r_nargs7=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_func_gethostbyaddr_r_nargs7=no
+fi
+rm -f conftest*
+
+       cat > conftest.$ac_ext <<EOF
+#line 16484 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#define BUFSIZE (sizeof(struct hostent)+10)
+int main() {
+struct hostent hent;
+               struct hostent *rhent; char buffer[BUFSIZE]; 
+               struct in_addr add;
+               size_t alen=sizeof(struct in_addr);
+               int bufsize=BUFSIZE;int h_errno;
+               (void)gethostbyaddr_r( (void *)&(add.s_addr),
+                       alen, AF_INET, &hent, buffer, bufsize, 
+                       &rhent, &h_errno);
+; return 0; }
+EOF
+if { (eval echo configure:16502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_func_gethostbyaddr_r_nargs8=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_func_gethostbyaddr_r_nargs8=no
+fi
+rm -f conftest*
+
+       if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
+               $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
+
+               ol_cv_func_gethostbyaddr_r_nargs=7
+
+       elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
+               $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
+
+               ol_cv_func_gethostbyaddr_r_nargs=8
+
+       else
+               ol_cv_func_gethostbyaddr_r_nargs=0
+       fi
+  
+fi
+
+echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
+  if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
+    cat >> confdefs.h <<EOF
+#define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
+EOF
+
+  fi
+
+else
+       ol_cv_func_gethostbyaddr_r_nargs=0
+fi
+
+ol_link_ldbm=no 
+
+if test $ol_with_ldbm_api = auto \
+       -o $ol_with_ldbm_api = berkeley \
+       -o $ol_with_ldbm_api = bcompat ; then
+
+       if test $ol_with_ldbm_api = bcompat; then \
+               for ac_hdr in db_185.h db.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:16552: 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 16557 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:16562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+if test $ac_cv_header_db_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:16590: 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 16596 "configure"
+#include "confdefs.h"
+
+#if HAVE_DB_185_H
+#      include <db_185.h>
+#else
+#      include <db.h>
+#endif
+
+ /* this check could be improved */
+#ifndef DB_VERSION_MAJOR
+#      define DB_VERSION_MAJOR 1
+#endif
+
+#if DB_VERSION_MAJOR == 1 
+       __db_version_1
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__db_version_1" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_header_db1=yes
+else
+  rm -rf conftest*
+  ol_cv_header_db1=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ol_cv_header_db1" 1>&6
+
+       if test $ol_cv_header_db1 = yes ; then
+               ol_cv_lib_db=no
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
+echo "configure:16633: checking for Berkeley DB link (default)" >&5
+if eval "test \"\${ol_cv_db_none+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 16643 "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:16690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_none=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_none=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_none" 1>&6
+
+       if test $ol_cv_db_none = yes ; then
+               ol_cv_lib_db=yes
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
+echo "configure:16714: checking for Berkeley DB link (-ldb41)" >&5
+if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb41
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 16724 "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:16771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db41=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db41=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db41" 1>&6
+
+       if test $ol_cv_db_db41 = yes ; then
+               ol_cv_lib_db=-ldb41
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
+echo "configure:16795: checking for Berkeley DB link (-ldb-41)" >&5
+if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb-41
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 16805 "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:16852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db_41=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db_41=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db_41" 1>&6
+
+       if test $ol_cv_db_db_41 = yes ; then
+               ol_cv_lib_db=-ldb-41
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
+echo "configure:16876: 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 $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 16886 "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:16933: \"$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 (-ldb-4)""... $ac_c" 1>&6
+echo "configure:16957: checking for Berkeley DB link (-ldb-4)" >&5
+if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb-4
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 16967 "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:17014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db_4=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db_4=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db_4" 1>&6
+
+       if test $ol_cv_db_db_4 = yes ; then
+               ol_cv_lib_db=-ldb-4
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
+echo "configure:17038: checking for Berkeley DB link (-ldb)" >&5
+if eval "test \"\${ol_cv_db_db+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17048 "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:17095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db" 1>&6
+
+       if test $ol_cv_db_db = yes ; then
+               ol_cv_lib_db=-ldb
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
+echo "configure:17119: checking for Berkeley DB link (-ldb3)" >&5
+if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb3
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17129 "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:17176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db3=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db3=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db3" 1>&6
+
+       if test $ol_cv_db_db3 = yes ; then
+               ol_cv_lib_db=-ldb3
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
+echo "configure:17200: checking for Berkeley DB link (-ldb-3)" >&5
+if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb-3
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17210 "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:17257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db_3=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db_3=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db_3" 1>&6
+
+       if test $ol_cv_db_db_3 = yes ; then
+               ol_cv_lib_db=-ldb-3
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
+echo "configure:17281: checking for Berkeley DB link (-ldb2)" >&5
+if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb2
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17291 "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:17338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db2=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db2=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db2" 1>&6
+
+       if test $ol_cv_db_db2 = yes ; then
+               ol_cv_lib_db=-ldb2
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
+echo "configure:17362: checking for Berkeley DB link (-ldb-2)" >&5
+if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb-2
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17372 "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:17419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ol_cv_db_db_2=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_db_db_2=no
+fi
+rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_db_db_2" 1>&6
+
+       if test $ol_cv_db_db_2 = yes ; then
+               ol_cv_lib_db=-ldb-2
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
+echo "configure:17443: checking for Berkeley DB link (-ldb1)" >&5
+if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       ol_DB_LIB=-ldb1
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17453 "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:16928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_errno_thread_specific=yes
+  ol_cv_db_db1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_errno_thread_specific=no
+  ol_cv_db_db1=no
 fi
 rm -f conftest*
-       
+
+       LIBS="$ol_LIBS"
+
 fi
 
-echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
+echo "$ac_t""$ol_cv_db_db1" 1>&6
 
-                       echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
-echo "configure:16944: checking for thread specific h_errno" >&5
-if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
+       if test $ol_cv_db_db1 = yes ; then
+               ol_cv_lib_db=-ldb1
+       fi
+fi
+
+if test $ol_cv_lib_db = no ; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
+echo "configure:17524: checking for Berkeley DB link (-ldb-1)" >&5
+if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-               cat > conftest.$ac_ext <<EOF
-#line 16950 "configure"
+       ol_DB_LIB=-ldb-1
+       ol_LIBS=$LIBS
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 17534 "configure"
 #include "confdefs.h"
-#include <netdb.h>
+
+#ifdef HAVE_DB_185_H
+# include <db_185.h>
+#else
+# include <db.h>
+#endif
+
+#ifndef DB_VERSION_MAJOR
+# define DB_VERSION_MAJOR 1
+#endif
+
+#ifndef NULL
+#define NULL ((void*)0)
+#endif
+
 int main() {
-h_errno = 0;
+
+#if DB_VERSION_MAJOR > 1
+       {
+               char *version;
+               int major, minor, patch;
+
+               version = db_version( &major, &minor, &patch );
+
+               if( major != DB_VERSION_MAJOR ||
+                       minor < DB_VERSION_MINOR )
+               {
+                       printf("Berkeley DB version mismatch\n"
+                               "\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:16957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_h_errno_thread_specific=yes
+  ol_cv_db_db_1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_h_errno_thread_specific=no
+  ol_cv_db_db_1=no
 fi
 rm -f conftest*
-       
-fi
-
-echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
 
-       if test $ol_cv_errno_thread_specific != yes \
-               -o $ol_cv_h_errno_thread_specific != yes ; then
-               LIBS="$LTHREAD_LIBS $LIBS"
-               LTHREAD_LIBS=""
-       fi
+       LIBS="$ol_LIBS"
 
-fi  
+fi
 
-if test $ol_link_threads = no ; then
-       if test $ol_with_threads = yes ; then
-               { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
-       fi
+echo "$ac_t""$ol_cv_db_db_1" 1>&6
 
-       if test $ol_with_threads = auto ; then
-               echo "configure: warning: no suitable thread support, disabling threads" 1>&2
-               ol_with_threads=no
+       if test $ol_cv_db_db_1 = yes ; then
+               ol_cv_lib_db=-ldb-1
        fi
-
-       cat >> confdefs.h <<\EOF
-#define NO_THREADS 1
-EOF
-
-       LTHREAD_LIBS=""
 fi
 
-if test $ol_link_threads != no ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
-EOF
 
+               if test "$ol_cv_lib_db" != no ; then
+                       ol_cv_berkeley_db=yes
+               fi
+       fi
 fi
 
-ol_link_ldbm=no 
-
-if test $ol_with_ldbm_api = auto \
-       -o $ol_with_ldbm_api = berkeley \
-       -o $ol_with_ldbm_api = bcompat ; then
-
-       if test $ol_with_ldbm_api = bcompat; then \
-               for ac_hdr in db_185.h db.h
+       else
+               ol_cv_berkeley_db=no
+for ac_hdr in db.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:17015: checking for $ac_hdr" >&5
+echo "configure:17616: 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 17020 "configure"
+#line 17621 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:17025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:17626: \"$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*
@@ -17047,62 +17648,21 @@ else
 fi
 done
 
-if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
-       echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
-echo "configure:17053: 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 17059 "configure"
-#include "confdefs.h"
-
-#if HAVE_DB_185_H
-#      include <db_185.h>
-#else
-#      include <db.h>
-#endif
-
- /* this check could be improved */
-#ifndef DB_VERSION_MAJOR
-#      define DB_VERSION_MAJOR 1
-#endif
-
-#if DB_VERSION_MAJOR == 1 
-       __db_version_1
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "__db_version_1" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ol_cv_header_db1=yes
-else
-  rm -rf conftest*
-  ol_cv_header_db1=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ol_cv_header_db1" 1>&6
-
-       if test $ol_cv_header_db1 = yes ; then
-               ol_cv_lib_db=no
+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:17096: checking for Berkeley DB link (default)" >&5
+echo "configure:17656: checking for Berkeley DB link (default)" >&5
 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        ol_DB_LIB=
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17106 "configure"
+#line 17666 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17149,7 +17709,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -17172,18 +17732,18 @@ echo "$ac_t""$ol_cv_db_none" 1>&6
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
-echo "configure:17177: checking for Berkeley DB link (-ldb4)" >&5
-if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
+echo "configure:17737: checking for Berkeley DB link (-ldb41)" >&5
+if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb4
+       ol_DB_LIB=-ldb41
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17187 "configure"
+#line 17747 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17230,14 +17790,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db4=yes
+  ol_cv_db_db41=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db4=no
+  ol_cv_db_db41=no
 fi
 rm -f conftest*
 
@@ -17245,26 +17805,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db4" 1>&6
+echo "$ac_t""$ol_cv_db_db41" 1>&6
 
-       if test $ol_cv_db_db4 = yes ; then
-               ol_cv_lib_db=-ldb4
+       if test $ol_cv_db_db41 = yes ; then
+               ol_cv_lib_db=-ldb41
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
-echo "configure:17258: checking for Berkeley DB link (-ldb)" >&5
-if eval "test \"\${ol_cv_db_db+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
+echo "configure:17818: checking for Berkeley DB link (-ldb-41)" >&5
+if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb
+       ol_DB_LIB=-ldb-41
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17268 "configure"
+#line 17828 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17311,14 +17871,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db=yes
+  ol_cv_db_db_41=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db=no
+  ol_cv_db_db_41=no
 fi
 rm -f conftest*
 
@@ -17326,26 +17886,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db" 1>&6
+echo "$ac_t""$ol_cv_db_db_41" 1>&6
 
-       if test $ol_cv_db_db = yes ; then
-               ol_cv_lib_db=-ldb
+       if test $ol_cv_db_db_41 = yes ; then
+               ol_cv_lib_db=-ldb-41
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:17339: checking for Berkeley DB link (-ldb3)" >&5
-if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
+echo "configure:17899: 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=-ldb3
+       ol_DB_LIB=-ldb4
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17349 "configure"
+#line 17909 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17392,14 +17952,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db3=yes
+  ol_cv_db_db4=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db3=no
+  ol_cv_db_db4=no
 fi
 rm -f conftest*
 
@@ -17407,26 +17967,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db3" 1>&6
+echo "$ac_t""$ol_cv_db_db4" 1>&6
 
-       if test $ol_cv_db_db3 = yes ; then
-               ol_cv_lib_db=-ldb3
+       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 (-ldb2)""... $ac_c" 1>&6
-echo "configure:17420: checking for Berkeley DB link (-ldb2)" >&5
-if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
+echo "configure:17980: checking for Berkeley DB link (-ldb-4)" >&5
+if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb2
+       ol_DB_LIB=-ldb-4
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17430 "configure"
+#line 17990 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17473,14 +18033,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db2=yes
+  ol_cv_db_db_4=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db2=no
+  ol_cv_db_db_4=no
 fi
 rm -f conftest*
 
@@ -17488,26 +18048,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db2" 1>&6
+echo "$ac_t""$ol_cv_db_db_4" 1>&6
 
-       if test $ol_cv_db_db2 = yes ; then
-               ol_cv_lib_db=-ldb2
+       if test $ol_cv_db_db_4 = yes ; then
+               ol_cv_lib_db=-ldb-4
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
-echo "configure:17501: checking for Berkeley DB link (-ldb1)" >&5
-if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
+echo "configure:18061: checking for Berkeley DB link (-ldb)" >&5
+if eval "test \"\${ol_cv_db_db+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb1
+       ol_DB_LIB=-ldb
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17511 "configure"
+#line 18071 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17552,94 +18112,43 @@ int main() {
        (void) dbopen( NULL, 0, 0, 0, NULL);
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:17558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ol_cv_db_db1=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_db_db1=no
-fi
-rm -f conftest*
-
-       LIBS="$ol_LIBS"
-
-fi
-
-echo "$ac_t""$ol_cv_db_db1" 1>&6
-
-       if test $ol_cv_db_db1 = yes ; then
-               ol_cv_lib_db=-ldb1
-       fi
-fi
-
-
-               if test "$ol_cv_lib_db" != no ; then
-                       ol_cv_berkeley_db=yes
-               fi
-       fi
-fi
-
-       else
-               ol_cv_berkeley_db=no
-for ac_hdr in db.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:17593: 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 17598 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:17603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:18118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  ol_cv_db_db=yes
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  ol_cv_db_db=no
 fi
 rm -f conftest*
+
+       LIBS="$ol_LIBS"
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
+
+echo "$ac_t""$ol_cv_db_db" 1>&6
+
+       if test $ol_cv_db_db = yes ; then
+               ol_cv_lib_db=-ldb
+       fi
 fi
-done
 
-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:17633: checking for Berkeley DB link (default)" >&5
-if eval "test \"\${ol_cv_db_none+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
+echo "configure:18142: checking for Berkeley DB link (-ldb3)" >&5
+if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=
+       ol_DB_LIB=-ldb3
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17643 "configure"
+#line 18152 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17686,14 +18195,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_none=yes
+  ol_cv_db_db3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_none=no
+  ol_cv_db_db3=no
 fi
 rm -f conftest*
 
@@ -17701,26 +18210,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_none" 1>&6
+echo "$ac_t""$ol_cv_db_db3" 1>&6
 
-       if test $ol_cv_db_none = yes ; then
-               ol_cv_lib_db=yes
+       if test $ol_cv_db_db3 = yes ; then
+               ol_cv_lib_db=-ldb3
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
-echo "configure:17714: checking for Berkeley DB link (-ldb4)" >&5
-if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
+echo "configure:18223: checking for Berkeley DB link (-ldb-3)" >&5
+if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb4
+       ol_DB_LIB=-ldb-3
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17724 "configure"
+#line 18233 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17767,14 +18276,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db4=yes
+  ol_cv_db_db_3=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db4=no
+  ol_cv_db_db_3=no
 fi
 rm -f conftest*
 
@@ -17782,26 +18291,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db4" 1>&6
+echo "$ac_t""$ol_cv_db_db_3" 1>&6
 
-       if test $ol_cv_db_db4 = yes ; then
-               ol_cv_lib_db=-ldb4
+       if test $ol_cv_db_db_3 = yes ; then
+               ol_cv_lib_db=-ldb-3
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
-echo "configure:17795: checking for Berkeley DB link (-ldb)" >&5
-if eval "test \"\${ol_cv_db_db+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
+echo "configure:18304: checking for Berkeley DB link (-ldb2)" >&5
+if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb
+       ol_DB_LIB=-ldb2
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17805 "configure"
+#line 18314 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17848,14 +18357,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db=yes
+  ol_cv_db_db2=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db=no
+  ol_cv_db_db2=no
 fi
 rm -f conftest*
 
@@ -17863,26 +18372,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db" 1>&6
+echo "$ac_t""$ol_cv_db_db2" 1>&6
 
-       if test $ol_cv_db_db = yes ; then
-               ol_cv_lib_db=-ldb
+       if test $ol_cv_db_db2 = yes ; then
+               ol_cv_lib_db=-ldb2
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:17876: checking for Berkeley DB link (-ldb3)" >&5
-if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
+echo "configure:18385: checking for Berkeley DB link (-ldb-2)" >&5
+if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb3
+       ol_DB_LIB=-ldb-2
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17886 "configure"
+#line 18395 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17929,14 +18438,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db3=yes
+  ol_cv_db_db_2=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db3=no
+  ol_cv_db_db_2=no
 fi
 rm -f conftest*
 
@@ -17944,26 +18453,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db3" 1>&6
+echo "$ac_t""$ol_cv_db_db_2" 1>&6
 
-       if test $ol_cv_db_db3 = yes ; then
-               ol_cv_lib_db=-ldb3
+       if test $ol_cv_db_db_2 = yes ; then
+               ol_cv_lib_db=-ldb-2
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
-echo "configure:17957: checking for Berkeley DB link (-ldb2)" >&5
-if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
+echo "configure:18466: checking for Berkeley DB link (-ldb1)" >&5
+if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb2
+       ol_DB_LIB=-ldb1
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17967 "configure"
+#line 18476 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18010,14 +18519,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db2=yes
+  ol_cv_db_db1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db2=no
+  ol_cv_db_db1=no
 fi
 rm -f conftest*
 
@@ -18025,26 +18534,26 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db2" 1>&6
+echo "$ac_t""$ol_cv_db_db1" 1>&6
 
-       if test $ol_cv_db_db2 = yes ; then
-               ol_cv_lib_db=-ldb2
+       if test $ol_cv_db_db1 = yes ; then
+               ol_cv_lib_db=-ldb1
        fi
 fi
 
 if test $ol_cv_lib_db = no ; then
-       echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
-echo "configure:18038: checking for Berkeley DB link (-ldb1)" >&5
-if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
+       echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
+echo "configure:18547: checking for Berkeley DB link (-ldb-1)" >&5
+if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-       ol_DB_LIB=-ldb1
+       ol_DB_LIB=-ldb-1
        ol_LIBS=$LIBS
-       LIBS="$ol_DB_LIB $LIBS"
+       LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18048 "configure"
+#line 18557 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18091,14 +18600,14 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_db_db1=yes
+  ol_cv_db_db_1=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_db_db1=no
+  ol_cv_db_db_1=no
 fi
 rm -f conftest*
 
@@ -18106,10 +18615,10 @@ rm -f conftest*
 
 fi
 
-echo "$ac_t""$ol_cv_db_db1" 1>&6
+echo "$ac_t""$ol_cv_db_db_1" 1>&6
 
-       if test $ol_cv_db_db1 = yes ; then
-               ol_cv_lib_db=-ldb1
+       if test $ol_cv_db_db_1 = yes ; then
+               ol_cv_lib_db=-ldb-1
        fi
 fi
 
        if test "$ol_cv_lib_db" != no ; then
                ol_cv_berkeley_db=yes
                echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
-echo "configure:18121: checking for Berkeley DB thread support" >&5
+echo "configure:18630: checking for Berkeley DB thread support" >&5
 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        ol_LIBS="$LIBS"
+       LIBS="$LTHREAD_LIBS $LIBS"
        if test $ol_cv_lib_db != yes ; then
-               LIBS="$ol_cv_lib_db"
+               LIBS="$ol_cv_lib_db $LIBS"
        fi
 
        if test "$cross_compiling" = yes; then
   ol_cv_berkeley_db_thread=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 18135 "configure"
+#line 18645 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18198,7 +18708,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:18202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:18712: \"$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
 
        LIBS="$ol_LIBS"
 
+fi
+
+echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
+
        if test $ol_cv_berkeley_db_thread != no ; then
                cat >> confdefs.h <<\EOF
 #define HAVE_BERKELEY_DB_THREAD 1
@@ -18220,9 +18734,6 @@ EOF
 
        fi
 
-fi
-
-echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
        fi
 fi
 
@@ -18259,13 +18770,13 @@ if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
        { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
        echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
-echo "configure:18263: checking Berkeley DB version for BDB backend" >&5
+echo "configure:18774: checking Berkeley DB version for BDB backend" >&5
 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 18269 "configure"
+#line 18780 "configure"
 #include "confdefs.h"
 
 #include <db.h>
@@ -18274,9 +18785,12 @@ else
 #ifndef DB_VERSION_MAJOR
 #      define DB_VERSION_MAJOR 1
 #endif
+#ifndef DB_VERSION_MINOR
+#      define DB_VERSION_MINOR 0
+#endif
 
 /* require 4.0 or later */
-#if DB_VERSION_MAJOR >= 4 
+#if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 1)
        __db_version_compat
 #endif
        
 
 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:18316: checking for MDBM library" >&5
+echo "configure:18830: 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:18322: checking for mdbm_set_chain" >&5
+echo "configure:18836: 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 18327 "configure"
+#line 18841 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mdbm_set_chain(); below.  */
@@ -18347,7 +18861,7 @@ f = mdbm_set_chain;
 
 ; return 0; }
 EOF
-if { (eval echo configure:18351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18865: \"$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
@@ -18366,7 +18880,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
-echo "configure:18370: checking for mdbm_set_chain in -lmdbm" >&5
+echo "configure:18884: 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
@@ -18374,7 +18888,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 18378 "configure"
+#line 18892 "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
@@ -18385,7 +18899,7 @@ int main() {
 mdbm_set_chain()
 ; return 0; }
 EOF
-if { (eval echo configure:18389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18903: \"$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
@@ -18420,17 +18934,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:18424: checking for $ac_hdr" >&5
+echo "configure:18938: 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 18429 "configure"
+#line 18943 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:18434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:18948: \"$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*
@@ -18457,7 +18971,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:18461: checking for db" >&5
+echo "configure:18975: 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:18494: checking for GDBM library" >&5
+echo "configure:19008: 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:18500: checking for gdbm_open" >&5
+echo "configure:19014: 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 18505 "configure"
+#line 19019 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -18525,7 +19039,7 @@ f = gdbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:18529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19043: \"$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
@@ -18544,7 +19058,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:18548: checking for gdbm_open in -lgdbm" >&5
+echo "configure:19062: 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
@@ -18552,7 +19066,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 18556 "configure"
+#line 19070 "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
@@ -18563,7 +19077,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:18567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19081: \"$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
@@ -18598,17 +19112,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:18602: checking for $ac_hdr" >&5
+echo "configure:19116: 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 18607 "configure"
+#line 19121 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:18612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:19126: \"$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*
@@ -18635,7 +19149,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:18639: checking for db" >&5
+echo "configure:19153: 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:18673: checking for NDBM library" >&5
+echo "configure:19187: 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:18679: checking for dbm_open" >&5
+echo "configure:19193: 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 18684 "configure"
+#line 19198 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -18704,7 +19218,7 @@ f = dbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:18708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19222: \"$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
@@ -18723,7 +19237,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:18727: checking for dbm_open in -lndbm" >&5
+echo "configure:19241: 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
@@ -18731,7 +19245,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 18735 "configure"
+#line 19249 "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
@@ -18742,7 +19256,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:18746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19260: \"$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
@@ -18762,7 +19276,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:18766: checking for dbm_open in -ldbm" >&5
+echo "configure:19280: 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
@@ -18770,7 +19284,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 18774 "configure"
+#line 19288 "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
@@ -18781,7 +19295,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:18785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19299: \"$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
@@ -18818,17 +19332,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:18822: checking for $ac_hdr" >&5
+echo "configure:19336: 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 18827 "configure"
+#line 19341 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:18832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:19346: \"$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*
@@ -18855,7 +19369,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:18859: checking for db" >&5
+echo "configure:19373: checking for db" >&5
 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18897,14 +19411,17 @@ if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
        ol_enable_ldbm=no
 fi
 
+
 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
        BUILD_LIBS_DYNAMIC=shared
        cat >> confdefs.h <<\EOF
 #define LDAP_LIBS_DYNAMIC 1
 EOF
 
+       LTSTATIC=""
 else
        BUILD_LIBS_DYNAMIC=static
+       LTSTATIC="-static"
 fi
 
 if test $ol_enable_wrappers != no ; then
@@ -18912,17 +19429,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:18916: checking for $ac_hdr" >&5
+echo "configure:19433: 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 18921 "configure"
+#line 19438 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:18926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:19443: \"$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*
@@ -18944,11 +19461,11 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
                echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
-echo "configure:18948: checking for TCP wrappers library" >&5
+echo "configure:19465: checking for TCP wrappers library" >&5
                save_LIBS="$LIBS"
                LIBS="$LIBS -lwrap"
                cat > conftest.$ac_ext <<EOF
-#line 18952 "configure"
+#line 19469 "configure"
 #include "confdefs.h"
 
 #include <tcpd.h>
@@ -18963,7 +19480,7 @@ hosts_access(req)
                
 ; return 0; }
 EOF
-if { (eval echo configure:18967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""-lwrap" 1>&6
                have_wrappers=yes
@@ -18975,7 +19492,7 @@ else
   
                                LIBS="$LIBS -lnsl"
                cat > conftest.$ac_ext <<EOF
-#line 18979 "configure"
+#line 19496 "configure"
 #include "confdefs.h"
 
 #include <tcpd.h>
@@ -18990,7 +19507,7 @@ hosts_access(req)
                
 ; return 0; }
 EOF
-if { (eval echo configure:18994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""-lwrap -lnsl" 1>&6
                have_wrappers=yes
 
 if test $ol_enable_syslog != no ; then
        echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:19034: checking for openlog" >&5
+echo "configure:19551: 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 19039 "configure"
+#line 19556 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -19059,7 +19576,7 @@ f = openlog;
 
 ; return 0; }
 EOF
-if { (eval echo configure:19063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_openlog=yes"
 else
 
 ol_link_sql=no
 if test $ol_enable_sql != no ; then
+       for ac_hdr in sql.h sqlext.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:19612: 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 19617 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:19622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+{ echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
+       
+fi
+done
+
+
        echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
-echo "configure:19092: checking for SQLDriverConnect in -liodbc" >&5
+echo "configure:19652: 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
@@ -19096,7 +19656,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-liodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19100 "configure"
+#line 19660 "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
@@ -19107,7 +19667,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:19111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19671: \"$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
@@ -19132,7 +19692,7 @@ fi
                ol_link_sql="-liodbc"
        else
                echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
-echo "configure:19136: checking for SQLDriverConnect in -lodbc" >&5
+echo "configure:19696: 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
@@ -19140,7 +19700,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19144 "configure"
+#line 19704 "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
@@ -19151,7 +19711,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:19155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19715: \"$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
@@ -19190,17 +19750,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:19194: checking for $ac_hdr" >&5
+echo "configure:19754: 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 19199 "configure"
+#line 19759 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:19204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:19764: \"$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*
@@ -19229,7 +19789,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:19233: checking for tputs in -ltermcap" >&5
+echo "configure:19793: 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
@@ -19237,7 +19797,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19241 "configure"
+#line 19801 "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
@@ -19248,7 +19808,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:19252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19812: \"$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
@@ -19281,7 +19841,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:19285: checking for initscr in -lncurses" >&5
+echo "configure:19845: 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
@@ -19289,7 +19849,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19293 "configure"
+#line 19853 "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
@@ -19300,7 +19860,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:19304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19864: \"$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
@@ -19346,17 +19906,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:19350: checking for $ac_hdr" >&5
+echo "configure:19910: 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 19355 "configure"
+#line 19915 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:19360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:19920: \"$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*
@@ -19385,7 +19945,7 @@ done
 
        if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
                echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
-echo "configure:19389: checking for sasl_client_init in -lsasl2" >&5
+echo "configure:19949: checking for sasl_client_init in -lsasl2" >&5
 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19393,7 +19953,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl2  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19397 "configure"
+#line 19957 "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
@@ -19404,7 +19964,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:19408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19968: \"$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
@@ -19423,7 +19983,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
-echo "configure:19427: checking for sasl_client_init in -lsasl" >&5
+echo "configure:19987: 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
@@ -19431,7 +19991,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19435 "configure"
+#line 19995 "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
@@ -19442,7 +20002,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:19446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
                        fi
                fi
        else
+               echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
+echo "configure:20042: 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 20048 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_SASL_SASL_H
+#include <sasl/sasl.h>
+#else
+#include <sasl.h>
+#endif
+
+/* require 2.1.3 or later */
+#if SASL_VERSION_MAJOR == 1  && SASL_VERSION_MINOR >= 5
+       char *__sasl_compat = "1.5.x okay";
+#elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
+       __sasl_compat "2.2+ or better okay (we guess)";
+#elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
+       && SASL_VERSION_STEP >=3
+       __sasl_compat = "2.1.3+ or better 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
+
                cat >> confdefs.h <<\EOF
 #define HAVE_CYRUS_SASL 1
 EOF
@@ -19485,6 +20091,62 @@ EOF
                if test $ol_enable_spasswd != no ; then
                        ol_link_spasswd=yes
                fi
+
+               ac_save_LIBS="$LIBS"
+               LIBS="$LIBS $ol_link_sasl"
+               echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
+echo "configure:20099: checking for sasl_version" >&5
+if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 20104 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char sasl_version(); 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 sasl_version();
+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_sasl_version) || defined (__stub___sasl_version)
+choke me
+#else
+f = sasl_version;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:20128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_sasl_version=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_sasl_version=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'sasl_version`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  cat >> confdefs.h <<\EOF
+#define HAVE_SASL_VERSION 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+               LIBS="$ac_save_LIBS"
        fi
 
 else
@@ -19521,13 +20183,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:19525: checking fetch(3) library" >&5
+echo "configure:20187: 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 19531 "configure"
+#line 20193 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -19537,7 +20199,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:19541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_lib_fetch=yes
 else
@@ -19575,17 +20237,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:19579: checking for $ac_hdr" >&5
+echo "configure:20241: 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 19584 "configure"
+#line 20246 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:19589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:20251: \"$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*
@@ -19616,7 +20278,7 @@ done
                save_LIBS="$LIBS"
                LIBS="$TERMCAP_LIBS $LIBS"
                echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:19620: checking for readline in -lreadline" >&5
+echo "configure:20282: 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
@@ -19624,7 +20286,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19628 "configure"
+#line 20290 "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
@@ -19635,7 +20297,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:19639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20301: \"$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
+       save_LIBS="$LIBS"
+       LIBS="$TLS_LIBS $LIBS"
+
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:19681: checking for crypt" >&5
+echo "configure:20346: 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 19686 "configure"
+#line 20351 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -19706,7 +20371,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:19710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20375: \"$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
@@ -19724,8 +20389,9 @@ if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 
+               LIBS="$save_LIBS"
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:19729: checking for crypt in -lcrypt" >&5
+echo "configure:20395: 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
@@ -19733,7 +20399,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19737 "configure"
+#line 20403 "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
@@ -19744,7 +20410,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:19748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20414: \"$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
@@ -19769,6 +20435,8 @@ fi
 fi
 
 
+       LIBS="$save_LIBS"
+
        if test $have_crypt = yes ; then
                cat >> confdefs.h <<\EOF
 #define HAVE_CRYPT 1
 
 if test $ol_enable_proctitle != no ; then
        echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:19791: checking for setproctitle" >&5
+echo "configure:20459: 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 19796 "configure"
+#line 20464 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -19816,7 +20484,7 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:19820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20488: \"$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
@@ -19835,7 +20503,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:19839: checking for setproctitle in -lutil" >&5
+echo "configure:20507: 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
@@ -19843,7 +20511,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19847 "configure"
+#line 20515 "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
@@ -19854,7 +20522,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:19858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20526: \"$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
@@ -19894,17 +20562,17 @@ if test $ol_enable_slp != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:19898: checking for $ac_hdr" >&5
+echo "configure:20566: 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 19903 "configure"
+#line 20571 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:19908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:20576: \"$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*
@@ -19933,7 +20601,7 @@ done
 
        if test $ac_cv_header_slp_h = yes ; then
                echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
-echo "configure:19937: checking for SLPOpen in -lslp" >&5
+echo "configure:20605: checking for SLPOpen in -lslp" >&5
 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -19941,7 +20609,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lslp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 19945 "configure"
+#line 20613 "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
@@ -19952,7 +20620,7 @@ int main() {
 SLPOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:19956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20624: \"$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
@@ -19987,12 +20655,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:19991: checking for ANSI C header files" >&5
+echo "configure:20659: 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 19996 "configure"
+#line 20664 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -20000,7 +20668,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:20004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:20672: \"$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*
@@ -20017,7 +20685,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 20021 "configure"
+#line 20689 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -20035,7 +20703,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 20039 "configure"
+#line 20707 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -20056,7 +20724,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 20060 "configure"
+#line 20728 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -20074,7 +20742,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:20078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:20746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -20098,12 +20766,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:20102: checking for mode_t" >&5
+echo "configure:20770: 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 20107 "configure"
+#line 20775 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -20134,12 +20802,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:20138: checking for off_t" >&5
+echo "configure:20806: 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 20143 "configure"
+#line 20811 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -20170,12 +20838,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:20174: checking for pid_t" >&5
+echo "configure:20842: 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 20179 "configure"
+#line 20847 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -20206,19 +20874,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:20210: checking for ptrdiff_t" >&5
+echo "configure:20878: 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 20215 "configure"
+#line 20883 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:20222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -20239,12 +20907,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:20243: checking return type of signal handlers" >&5
+echo "configure:20911: 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 20248 "configure"
+#line 20916 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -20261,7 +20929,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:20265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:20933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -20280,12 +20948,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:20284: checking for size_t" >&5
+echo "configure:20952: 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 20289 "configure"
+#line 20957 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:20321: checking for ssize_t" >&5
+echo "configure:20989: 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 20326 "configure"
+#line 20994 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -20353,12 +21021,12 @@ EOF
 fi
 
 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
-echo "configure:20357: checking for caddr_t" >&5
+echo "configure:21025: 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 20362 "configure"
+#line 21030 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:20394: checking for socklen_t" >&5
+echo "configure:21062: 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 20399 "configure"
+#line 21067 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -20409,7 +21077,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:20413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_socklen_t=yes
 else
@@ -20430,12 +21098,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:20434: checking for member st_blksize in aggregate type struct stat" >&5
+echo "configure:21102: 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 20439 "configure"
+#line 21107 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -20443,7 +21111,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:20447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_struct_member_st_blksize=yes
 else
@@ -20465,12 +21133,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:20469: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:21137: 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 20474 "configure"
+#line 21142 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -20479,7 +21147,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:20483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -20500,12 +21168,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:20504: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:21172: 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 20509 "configure"
+#line 21177 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -20513,7 +21181,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:20517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -20534,12 +21202,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:20538: checking for uid_t in sys/types.h" >&5
+echo "configure:21206: 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 20543 "configure"
+#line 21211 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -20568,19 +21236,19 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:20572: checking for sig_atomic_t" >&5
+echo "configure:21240: 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 20577 "configure"
+#line 21245 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:20584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_sig_atomic_t=yes
 else
@@ -20604,13 +21272,13 @@ EOF
 
 # test for pw_gecos in struct passwd
 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
-echo "configure:20608: checking struct passwd for pw_gecos" >&5
+echo "configure:21276: 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 20614 "configure"
+#line 21282 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -20620,7 +21288,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21292: \"$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:20646: checking struct passwd for pw_passwd" >&5
+echo "configure:21314: 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 20652 "configure"
+#line 21320 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -20658,7 +21326,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_passwd=yes
 else
@@ -20680,7 +21348,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:20684: checking if toupper() requires islower()" >&5
+echo "configure:21352: 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
@@ -20689,7 +21357,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 20693 "configure"
+#line 21361 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -20701,7 +21369,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:20705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:21373: \"$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
@@ -20724,12 +21392,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:20728: checking for working const" >&5
+echo "configure:21396: 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 20733 "configure"
+#line 21401 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -20778,7 +21446,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:20782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -20799,12 +21467,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:20803: checking if compiler understands volatile" >&5
+echo "configure:21471: 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 20808 "configure"
+#line 21476 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -20813,7 +21481,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:20817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -20843,14 +21511,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:20847: checking whether byte ordering is bigendian" >&5
+echo "configure:21515: 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 20854 "configure"
+#line 21522 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -20861,11 +21529,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:20865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21533: \"$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 20869 "configure"
+#line 21537 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -20876,7 +21544,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:20880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -20896,7 +21564,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 20900 "configure"
+#line 21568 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -20909,7 +21577,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:20913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:21581: \"$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:20939: checking size of short" >&5 
+echo "configure:21607: 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 20945 "configure"
+#line 21613 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -20951,7 +21619,7 @@ int main() {
 switch (0) case 0: case (sizeof (short) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:20955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_short=$ac_size
 else
@@ -20974,13 +21642,13 @@ EOF
  
  
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:20978: checking size of int" >&5 
+echo "configure:21646: 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 20984 "configure"
+#line 21652 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -20990,7 +21658,7 @@ int main() {
 switch (0) case 0: case (sizeof (int) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:20994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_int=$ac_size
 else
@@ -21013,13 +21681,13 @@ EOF
  
  
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:21017: checking size of long" >&5 
+echo "configure:21685: 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 21023 "configure"
+#line 21691 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <sys/types.h> 
@@ -21029,7 +21697,7 @@ int main() {
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:21033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:21701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long=$ac_size
 else
@@ -21080,7 +21748,7 @@ EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:21084: checking for 8-bit clean memcmp" >&5
+echo "configure:21752: 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
@@ -21088,7 +21756,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 21092 "configure"
+#line 21760 "configure"
 #include "confdefs.h"
 
 main()
@@ -21098,7 +21766,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:21102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:21770: \"$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
@@ -21116,12 +21784,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:21120: checking for strftime" >&5
+echo "configure:21788: 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 21125 "configure"
+#line 21793 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -21145,7 +21813,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21817: \"$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
@@ -21167,7 +21835,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:21171: checking for strftime in -lintl" >&5
+echo "configure:21839: 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
@@ -21175,7 +21843,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21179 "configure"
+#line 21847 "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
@@ -21186,7 +21854,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:21190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21858: \"$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:21218: checking for inet_aton()" >&5
+echo "configure:21886: 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 21223 "configure"
+#line 21891 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -21241,7 +21909,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:21245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21913: \"$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
@@ -21263,12 +21931,12 @@ EOF
  
 
 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
-echo "configure:21267: checking for _spawnlp" >&5
+echo "configure:21935: 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 21272 "configure"
+#line 21940 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _spawnlp(); below.  */
@@ -21292,7 +21960,7 @@ f = _spawnlp;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21964: \"$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:21320: checking for _snprintf" >&5
+echo "configure:21988: 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 21325 "configure"
+#line 21993 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _snprintf(); below.  */
@@ -21345,7 +22013,7 @@ f = _snprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22017: \"$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:21375: checking for _vsnprintf" >&5
+echo "configure:22043: 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 21380 "configure"
+#line 22048 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _vsnprintf(); below.  */
@@ -21400,7 +22068,7 @@ f = _vsnprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22072: \"$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:21430: checking for vprintf" >&5
+echo "configure:22098: 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 21435 "configure"
+#line 22103 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -21455,7 +22123,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22127: \"$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:21483: checking for _doprnt" >&5
+echo "configure:22151: 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 21488 "configure"
+#line 22156 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -21508,7 +22176,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22180: \"$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
 
 
 if test $ac_cv_func_vprintf = yes ; then
-               for ac_func in vsnprintf vsprintf
+               for ac_func in snprintf vsnprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21541: checking for $ac_func" >&5
+echo "configure:22209: 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 21546 "configure"
+#line 22214 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -21566,7 +22234,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22238: \"$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
@@ -21600,6 +22268,7 @@ for ac_func in \
        endpwent                \
        fcntl                   \
        flock                   \
+       fstat                   \
        getdtablesize   \
        getgrgid                \
        gethostname             \
@@ -21643,16 +22312,17 @@ for ac_func in \
        wait4                   \
        write                   \
        send                    \
+       sendmsg                 \
        sendto                  \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21651: checking for $ac_func" >&5
+echo "configure:22321: 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 21656 "configure"
+#line 22326 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -21676,7 +22346,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22350: \"$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
+for ac_func in getopt getpeereid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:21708: checking for $ac_func" >&5
+echo "configure:22378: 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 21713 "configure"
+#line 22383 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -21733,7 +22403,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22407: \"$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
@@ -21763,16 +22433,33 @@ done
 if test "$ac_cv_func_getopt" != yes; then
        LIBSRCS="$LIBSRCS getopt.c"
 fi
+if test "$ac_cv_func_getpeereid" != yes; then
+       LIBSRCS="$LIBSRCS getpeereid.c"
+fi
+if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
+       if test "$ac_cv_func_snprintf" != yes; then
+               cat >> confdefs.h <<\EOF
+#define snprintf ber_pvt_snprintf
+EOF
+
+       fi
+       if test "$ac_cv_func_vsnprintf" != yes; then
+               cat >> confdefs.h <<\EOF
+#define vsnprintf ber_pvt_vsnprintf
+EOF
+
+       fi
+fi
 
 # Check Configuration
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:21770: checking declaration of sys_errlist" >&5
+echo "configure:22457: 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 21776 "configure"
+#line 22463 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -21785,7 +22472,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:21789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:22476: \"$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
@@ -21808,20 +22495,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:21812: checking existence of sys_errlist" >&5
+echo "configure:22499: 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 21818 "configure"
+#line 22505 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:21825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22512: \"$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
@@ -21855,12 +22542,6 @@ if test "$ol_enable_syslog" = yes ; then
 #define LDAP_SYSLOG 1
 EOF
 
-fi
-if test "$ol_enable_cache" = no ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_NOCACHE 1
-EOF
-
 fi
 if test "$ol_link_kbind" != no ; then
        cat >> confdefs.h <<\EOF
@@ -21915,6 +22596,12 @@ 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
@@ -21958,7 +22645,6 @@ EOF
 
                BUILD_BDB=mod
                BUILD_BDB_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
@@ -21979,7 +22665,6 @@ EOF
 
                BUILD_DNSSRV=mod
                BUILD_DNSSRV_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
@@ -22000,7 +22685,6 @@ EOF
 
                BUILD_LDAP=mod
                BUILD_LDAP_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
@@ -22014,7 +22698,6 @@ EOF
 
        BUILD_SLAPD=yes
        BUILD_LDBM=yes
-       LDBM_LIB="-lldbm"
        if test "$ol_with_ldbm_module" != static ; then
                cat >> confdefs.h <<\EOF
 #define SLAPD_LDBM_DYNAMIC 1
@@ -22022,7 +22705,6 @@ EOF
 
                BUILD_LDBM=mod
                BUILD_LDBM_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
@@ -22042,6 +22724,8 @@ EOF
 
        BUILD_SLAPD=yes
        BUILD_META=yes
+       BUILD_LDAP=yes
+       BUILD_REWRITE=yes
        if test "$ol_with_meta_module" != static ; then
                cat >> confdefs.h <<\EOF
 #define SLAPD_META_DYNAMIC 1
@@ -22049,7 +22733,6 @@ EOF
 
                BUILD_META=mod
                BUILD_META_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
@@ -22070,7 +22753,6 @@ EOF
 
                BUILD_MONITOR=mod
                BUILD_MONITOR_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
@@ -22091,7 +22773,6 @@ EOF
 
                BUILD_NULL=mod
                BUILD_NULL_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-null/back_null.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
@@ -22112,7 +22793,6 @@ EOF
 
                BUILD_PASSWD=mod
                BUILD_PASSWD_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
@@ -22133,7 +22813,6 @@ EOF
 
                BUILD_PERL=mod
                BUILD_PERL_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
@@ -22141,6 +22820,9 @@ EOF
 fi
 
 if test "$ol_enable_shell" != no ; then
+       if test "$ol_link_thread" != no ; then
+               echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
+       fi
        cat >> confdefs.h <<\EOF
 #define SLAPD_SHELL 1
 EOF
@@ -22154,7 +22836,6 @@ EOF
 
                BUILD_SHELL=mod
                BUILD_SHELL_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
@@ -22175,7 +22856,6 @@ EOF
 
                BUILD_SQL=mod
                BUILD_SQL_DYNAMIC=shared
-               SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
                SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
        else
                SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
 if test "$ac_cv_mingw32" = yes ; then
        PLAT=NT
        SLAPD_MODULES_LDFLAGS=
-       SLAPD_MODULES_LIST=
 else
        PLAT=UNIX
 fi
 
+if test -z "$SLAPD_STATIC_BACKENDS"; then
+       SLAPD_NO_STATIC='#'
+else
+       SLAPD_NO_STATIC=
+fi
+
 
 
 
@@ -22266,8 +22951,6 @@ fi
 
 
 
-
-
 
 
 
@@ -22343,10 +23026,6 @@ doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
-clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
-clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
-clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
-clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
 include/Makefile:build/top.mk:include/Makefile.in \
 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk     \
@@ -22440,6 +23119,7 @@ s%@AWK@%$AWK%g
 s%@AMTARFLAGS@%$AMTARFLAGS%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
+s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
 s%@top_builddir@%$top_builddir%g
 s%@ldap_subdir@%$ldap_subdir%g
 s%@CC@%$CC%g
@@ -22456,12 +23136,10 @@ s%@OBJDUMP@%$OBJDUMP%g
 s%@CPP@%$CPP%g
 s%@LIBTOOL@%$LIBTOOL%g
 s%@LN_H@%$LN_H%g
-s%@SENDMAIL@%$SENDMAIL%g
-s%@EDITOR@%$EDITOR%g
-s%@FINGER@%$FINGER%g
 s%@PERLBIN@%$PERLBIN%g
 s%@OL_MKDEP@%$OL_MKDEP%g
 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
+s%@LTSTATIC@%$LTSTATIC%g
 s%@LIBOBJS@%$LIBOBJS%g
 s%@LIBSRCS@%$LIBSRCS%g
 s%@PLAT@%$PLAT%g
@@ -22490,7 +23168,6 @@ s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
-s%@LDBM_LIB@%$LDBM_LIB%g
 s%@LDAP_LIBS@%$LDAP_LIBS%g
 s%@LDIF_LIBS@%$LDIF_LIBS%g
 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
@@ -22501,7 +23178,7 @@ s%@LUTIL_LIBS@%$LUTIL_LIBS%g
 s%@WRAP_LIBS@%$WRAP_LIBS%g
 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
-s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
+s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
@@ -22569,10 +23246,6 @@ doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
-clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
-clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
-clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
-clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
 include/Makefile:build/top.mk:include/Makefile.in \
 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk     \