]> git.sur5r.net Git - openldap/blobdiff - configure
Add cheap EBADF loop protection.
[openldap] / configure
index 29abe8a63711d4186677091b32ab99766738957b..c5da2bfbedaf83998eb3376fe64fff97805c3248 100755 (executable)
--- a/configure
+++ b/configure
@@ -16,6 +16,8 @@ ac_help="$ac_help
   --with-subdir=DIR change default subdirectory used for installs"
 ac_help="$ac_help
   --enable-debug       enable debugging (yes)"
+ac_help="$ac_help
+  --enable-syslog      enable syslog support (auto)"
 ac_help="$ac_help
   --enable-proctitle   enable proctitle support (yes)"
 ac_help="$ac_help
@@ -55,13 +57,17 @@ ac_help="$ac_help
 ac_help="$ac_help
     --enable-crypt     enable crypt(3) passwords (auto)"
 ac_help="$ac_help
-    --enable-wrappers  enable tcp wrapper support (no)"
+    --enable-modules   enable dynamic module support (no)"
 ac_help="$ac_help
     --enable-phonetic  enable phonetic/soundex (no)"
 ac_help="$ac_help
     --enable-rlookups  enable reverse lookups (auto)"
+ac_help="$ac_help
+    --enable-wrappers  enable tcp wrapper support (no)"
 ac_help="$ac_help
     --enable-bdb2      enable bdb2 backend (no)"
+ac_help="$ac_help
+    --enable-ldap      enable ldap backend (no)"
 ac_help="$ac_help
     --enable-ldbm      enable ldbm backend (yes)"
 ac_help="$ac_help
@@ -532,7 +538,7 @@ echo > confdefs.h
 
 # A filename unique to this package, relative to the directory that
 # configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=include/ldap.h
+ac_unique_file=build/version
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
@@ -572,13 +578,6 @@ for ac_site_file in $CONFIG_SITE; do
   fi
 done
 
-if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
-else
-  echo "creating cache $cache_file"
-  > $cache_file
-fi
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -619,6 +618,12 @@ fi
 ac_config_guess=$ac_aux_dir/config.guess
 ac_config_sub=$ac_aux_dir/config.sub
 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+OL_VERSION=`cat $ac_aux_dir/version`
+if test -z "$OL_VERSION"; then
+       { echo "configure: error: could not determine version" 1>&2; exit 1; }
+fi
+
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
@@ -631,7 +636,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # 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:635: checking for a BSD compatible install" >&5
+echo "configure:640: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -684,7 +689,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:688: checking whether build environment is sane" >&5
+echo "configure:693: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -741,7 +746,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:745: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:750: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -770,7 +775,7 @@ fi
 
 PACKAGE=OpenLDAP
 
-VERSION=2.0-devel
+VERSION=$OL_VERSION
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -780,7 +785,7 @@ fi
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:784: checking for working aclocal" >&5
+echo "configure:789: 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.
@@ -793,7 +798,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:797: checking for working autoconf" >&5
+echo "configure:802: 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.
@@ -806,7 +811,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:810: checking for working automake" >&5
+echo "configure:815: 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.
@@ -819,7 +824,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:823: checking for working autoheader" >&5
+echo "configure:828: 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.
@@ -832,7 +837,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:836: checking for working makeinfo" >&5
+echo "configure:841: 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.
@@ -846,13 +851,28 @@ fi
 
 
 
+cat >> confdefs.h <<EOF
+#define OPENLDAP_PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define OPENLDAP_VERSION "$VERSION"
+EOF
+
+
+
 
 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
-echo "configure:852: checking configure arguments" >&5
+echo "configure:867: checking configure arguments" >&5
 
 
 top_builddir=`pwd`
 
+cat >> confdefs.h <<\EOF
+#define HAVE_MKVERSION 1
+EOF
+
+
 ldap_subdir="openldap"
 
 # Check whether --with-subdir or --without-subdir was given.
@@ -888,7 +908,26 @@ else
        ol_enable_debug="yes"
 fi
 # end --enable-debug
-ol_enable_syslog=no
+# OpenLDAP --enable-syslog
+       # Check whether --enable-syslog or --disable-syslog was given.
+if test "${enable_syslog+set}" = set; then
+  enableval="$enable_syslog"
+  
+       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-syslog" 1>&2; exit 1; }
+       fi
+       ol_enable_syslog="$ol_arg"
+
+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
@@ -1251,10 +1290,10 @@ else
        ol_enable_crypt="auto"
 fi
 # end --enable-crypt
-# OpenLDAP --enable-wrappers
-       # Check whether --enable-wrappers or --disable-wrappers was given.
-if test "${enable_wrappers+set}" = set; then
-  enableval="$enable_wrappers"
+# OpenLDAP --enable-modules
+       # Check whether --enable-modules or --disable-modules was given.
+if test "${enable_modules+set}" = set; then
+  enableval="$enable_modules"
   
        ol_arg=invalid
        for ol_val in auto yes no ; do
@@ -1263,14 +1302,14 @@ if test "${enable_wrappers+set}" = set; then
                fi
        done
        if test "$ol_arg" = "invalid" ; then
-               { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
+               { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
        fi
-       ol_enable_wrappers="$ol_arg"
+       ol_enable_modules="$ol_arg"
 
 else
-       ol_enable_wrappers="no"
+       ol_enable_modules="no"
 fi
-# end --enable-wrappers
+# end --enable-modules
 # OpenLDAP --enable-phonetic
        # Check whether --enable-phonetic or --disable-phonetic was given.
 if test "${enable_phonetic+set}" = set; then
@@ -1311,6 +1350,26 @@ else
        ol_enable_rlookups="auto"
 fi
 # end --enable-rlookups
+# OpenLDAP --enable-wrappers
+       # Check whether --enable-wrappers or --disable-wrappers was given.
+if test "${enable_wrappers+set}" = set; then
+  enableval="$enable_wrappers"
+  
+       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-wrappers" 1>&2; exit 1; }
+       fi
+       ol_enable_wrappers="$ol_arg"
+
+else
+       ol_enable_wrappers="no"
+fi
+# end --enable-wrappers
 
 # OpenLDAP --enable-bdb2
        # Check whether --enable-bdb2 or --disable-bdb2 was given.
@@ -1332,6 +1391,26 @@ else
        ol_enable_bdb2="no"
 fi
 # end --enable-bdb2
+# OpenLDAP --enable-ldap
+       # Check whether --enable-ldap or --disable-ldap was given.
+if test "${enable_ldap+set}" = set; then
+  enableval="$enable_ldap"
+  
+       ol_arg=invalid
+       for ol_val in auto yes no ; do
+               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-ldap" 1>&2; exit 1; }
+       fi
+       ol_enable_ldap="$ol_arg"
+
+else
+       ol_enable_ldap="no"
+fi
+# end --enable-ldap
 # OpenLDAP --enable-ldbm
        # Check whether --enable-ldbm or --disable-ldbm was given.
 if test "${enable_ldbm+set}" = set; then
@@ -1358,7 +1437,7 @@ if test "${with_ldbm_api+set}" = set; then
   withval="$with_ldbm_api"
   
        ol_arg=invalid
-       for ol_val in auto db2 db gdbm ndbm manual ; do
+       for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
                if test "$withval" = "$ol_val" ; then
                        ol_arg="$ol_val"
                fi
@@ -1569,40 +1648,46 @@ fi
 
 if test $ol_enable_slapd = no ; then
                if test $ol_enable_bdb2 = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_bdb2 argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
+       fi
+       if test $ol_enable_ldap = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
        fi
        if test $ol_enable_ldbm = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
        fi
        if test $ol_enable_passwd = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
        fi
        if test $ol_enable_perl = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_perl argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
        fi
        if test $ol_enable_shell = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
        fi
        if test $ol_enable_tcl = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_tcl argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
        fi
        if test $ol_enable_aclgroups = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-aclgroups argument" 1>&2
+       fi
+       if test $ol_enable_modules = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
        fi
        if test $ol_enable_wrappers = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
        fi
        if test $ol_enable_phonetic = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
        fi
        if test $ol_enable_rlookups = yes ; then
-               echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
        fi
        if test $ol_with_ldbm_api != auto ; then
-               echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
        fi
        if test $ol_with_ldbm_type != auto ; then
-               echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
+               echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
        fi
        if test $ol_enable_slurpd = yes ; then
                { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
@@ -1610,34 +1695,41 @@ if test $ol_enable_slapd = no ; then
 
        # force settings to no
        ol_enable_bdb2=no
+       ol_enable_ldap=no
        ol_enable_ldbm=no
        ol_enable_passwd=no
        ol_enable_perl=no
        ol_enable_shell=no
        ol_enable_tcl=no
+
        ol_enable_aclgroups=no
-       ol_enable_wrappers=no
+       ol_enable_modules=no
        ol_enable_phonetic=no
        ol_enable_rlookups=no
+       ol_enable_wrappers=no
+
        ol_with_ldbm_api=no
        ol_with_ldbm_type=no
+
        ol_enable_slurpd=no
 
 elif test $ol_enable_ldbm = no ; then
        
        if test $ol_with_ldbm_api != auto ; then
-               echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
+               echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
        fi
 
        if test $ol_with_ldbm_type != auto ; then
-               echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
+               echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
        fi
 
        if test $ol_enable_bdb2 = yes ; then
                { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
        fi
 
-       if test $ol_enable_passwd = no -a \
+       if test $ol_enable_modules != yes -a \
+               $ol_enable_ldap = no -a \
+               $ol_enable_passwd = no -a \
                $ol_enable_perl = no -a \
                $ol_enable_shell = no -a \
                $ol_enable_tcl = no ; then
@@ -1670,6 +1762,10 @@ else
                $ol_with_ldbm_type = btree ; then
                { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
        fi
+       if test $ol_with_ldbm_api = mdbm -a \
+               $ol_with_ldbm_type = btree ; then
+               { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
+       fi
        if test $ol_with_ldbm_api = ndbm -a \
                $ol_with_ldbm_type = btree ; then
                { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
@@ -1684,6 +1780,40 @@ fi
 
 echo "$ac_t""done" 1>&6
 
+## Initialize vars
+LDAP_LIBS=
+LDBM_LIBS=
+LTHREAD_LIBS=
+LUTIL_LIBS=
+
+LDAPD_LIBS=
+SLAPD_LIBS=
+SLURPD_LIBS=
+
+BUILD_LDAPD=no
+BUILD_SLAPD=no
+BUILD_SLURPD=no
+
+BUILD_BDB2=no
+BUILD_LDAP=no
+BUILD_LDBM=no
+BUILD_PASSWD=no
+BUILD_PERL=no
+BUILD_SHELL=no
+BUILD_TCL=no
+BUILD_THREAD=no
+
+SLAPD_MODULES_LDFLAGS=
+SLAPD_MODULES_CPPFLAGS=
+
+SLAPD_PERL_LDFLAGS=
+SLAPD_PERL_CPPFLAGS=
+
+KRB_LIBS=
+READLINE_LIBS=
+TERMCAP_LIBS=
+TLS_LIBS=
+
 
 # Make sure we can run config.sub.
 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
@@ -1691,7 +1821,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1695: checking host system type" >&5
+echo "configure:1825: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -1712,108 +1842,112 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 
-## Initialize vars
-LDAP_LIBS=
-LDBM_LIBS=
-LTHREAD_LIBS=
-LUTIL_LIBS=
 
-LDAPD_LIBS=
-SLAPD_LIBS=
-SLURPD_LIBS=
 
-BUILD_LDAPD=no
-BUILD_SLAPD=no
-BUILD_SLURPD=no
 
-BUILD_BDB2=no
-BUILD_LDBM=no
-BUILD_PASSWD=no
-BUILD_PERL=no
-BUILD_SHELL=no
-BUILD_TCL=no
-BUILD_THREAD=no
+ol_aix_threads=no
+case "$host" in
+*-*-aix*)
+       if test -z "CC" -a "$ol_host_os" = aix ; then
+               case "$ol_with_threads" in
+               auto | yes |  posix) ol_aix_threads=yes ;;
+               esac
+       fi
+;;
+esac
 
-SLAPD_PERL_LDFLAGS=
-SLAPD_PERL_CPPFLAGS=
+if test -z "${CC}" -a $ol_aix_threads = yes ; then
+       for ac_prog in cc_r xlc_r cc
+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:1866: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # 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_CC="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
 
-KRB_LIBS=
-READLINE_LIBS=
-TERMCAP_LIBS=
-TLS_LIBS=
+test -n "$CC" && break
+done
 
 
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1759: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+       if test "$CC" = cc ; then
+                               if test $ol_with_threads != auto ; then
+                       { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
+               else
+                       echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
+               fi
+               ol_with_threads=no
+
+       elif test "$CC" ; then
+               ol_with_threads=posix
+               ol_cv_pthread_create=yes
+       fi
+fi
+
+if test -z "${CC}"; then
+       for ac_prog in cc
+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:1916: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS=":"
-  for ac_dir in $PATH; do
-    # Account for people who put trailing slashes in PATH elements.
-    case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
-    *)
-      # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
-        if test -f $ac_dir/$ac_prog; then
-         if test $ac_prog = install &&
-            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
-           # AIX install.  It has an incompatible calling convention.
-           :
-         else
-           ac_cv_path_install="$ac_dir/$ac_prog -c"
-           break 2
-         fi
-       fi
-      done
-      ;;
-    esac
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # 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_CC="$ac_prog"
+      break
+    fi
   done
-  IFS="$ac_save_IFS"
-
+  IFS="$ac_save_ifs"
 fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL="$ac_cv_path_install"
-  else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
-    INSTALL="$ac_install_sh"
-  fi
 fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
 
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+test -n "$CC" && break
+done
 
+fi
 
-CC=${CC-"cc"}
 
 # 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:1817: checking for $ac_word" >&5
+echo "configure:1951: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1843,7 +1977,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:1847: checking for $ac_word" >&5
+echo "configure:1981: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1873,7 +2007,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:1877: checking for $ac_word" >&5
+echo "configure:2011: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1924,7 +2058,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:1928: checking for $ac_word" >&5
+echo "configure:2062: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1956,7 +2090,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1960: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2094: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1967,12 +2101,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 1971 "configure"
+#line 2105 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2110: \"$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
@@ -1998,12 +2132,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 $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2002: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2136: checking whether the C compiler ($CC $CFLAGS $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:2007: checking whether we are using GNU C" >&5
+echo "configure:2141: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2012,7 +2146,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2016: \"$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:2150: \"$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
@@ -2031,7 +2165,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:2035: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2169: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2075,7 +2209,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:2079: checking for ld used by GCC" >&5
+echo "configure:2213: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -2093,10 +2227,10 @@ echo "configure:2079: 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:2097: checking for GNU ld" >&5
+echo "configure:2231: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:2100: checking for non-GNU ld" >&5
+echo "configure:2234: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2132,7 +2266,7 @@ 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:2136: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:2270: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2148,7 +2282,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:2152: checking for BSD-compatible nm" >&5
+echo "configure:2286: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2185,7 +2319,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2189: checking whether ln -s works" >&5
+echo "configure:2323: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2221,8 +2355,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2225 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2359 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -2257,7 +2391,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:2261: checking for $ac_word" >&5
+echo "configure:2395: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2288,7 +2422,7 @@ done
 
 # test for ln hardlink support
 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:2292: checking whether ln works" >&5
+echo "configure:2426: checking whether ln works" >&5
 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2311,7 +2445,7 @@ else
 fi
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2315: checking whether ln -s works" >&5
+echo "configure:2449: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2332,10 +2466,14 @@ else
 fi
 
 
-# Extract the first word of "sendmail", so it can be a program name with args.
+if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
+       LN_S="$LN_H"
+fi
+
+# Extract the first word of "sendmail", so it can be a program name with args.
 set dummy sendmail; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2339: checking for $ac_word" >&5
+echo "configure:2477: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2371,7 +2509,7 @@ fi
 # Extract the first word of "vi", so it can be a program name with args.
 set dummy vi; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2375: checking for $ac_word" >&5
+echo "configure:2513: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2407,7 +2545,7 @@ fi
 # Extract the first word of "finger", so it can be a program name with args.
 set dummy finger; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2411: checking for $ac_word" >&5
+echo "configure:2549: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2441,11 +2579,64 @@ else
 fi
 
 
-if test $ol_enable_perl = yes ; then
+ol_link_modules=no
+if test $ol_enable_modules != no ; then
+       # Extract the first word of "glib-config", so it can be a program name with args.
+set dummy glib-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2588: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$GLIBCONFIG" in
+  /*)
+  ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
+  ;;
+  ?:/*)                         
+  ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # 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_GLIBCONFIG="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
+if test -n "$GLIBCONFIG"; then
+  echo "$ac_t""$GLIBCONFIG" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+       if test "no$GLIBCONFIG" = "no" ; then
+               if test $ol_enable_modules = yes ; then
+                       { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
+               fi
+
+       else
+               SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
+               SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
+               SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
+
+                               ol_link_modules=yes
+       fi
+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:2449: checking for $ac_word" >&5
+echo "configure:2640: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2480,15 +2671,20 @@ fi
 
 
        if test "no$PERLBIN" = "no" ; then
-               ol_enable_perl=no
-       fi
+               if test $ol_enable_perl = yes ; then
+                       { echo "configure: error: could not locate perl" 1>&2; exit 1; }
+               fi
+
+       else
+               SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
+               SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
 
-       SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
-       SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e perl_inc`"
+                               ol_link_perl=yes
+       fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2492: checking how to run the C preprocessor" >&5
+echo "configure:2688: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2503,13 +2699,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 2507 "configure"
+#line 2703 "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:2513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2709: \"$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
   :
@@ -2520,13 +2716,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2524 "configure"
+#line 2720 "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:2530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2726: \"$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
   :
@@ -2537,13 +2733,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2541 "configure"
+#line 2737 "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:2547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2743: \"$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
   :
@@ -2581,9 +2777,9 @@ elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
 fi
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2585: checking for AIX" >&5
+echo "configure:2781: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2587 "configure"
+#line 2783 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -2605,7 +2801,7 @@ rm -f conftest*
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:2609: checking for POSIXized ISC" >&5
+echo "configure:2805: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -2627,17 +2823,17 @@ fi
 
 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:2631: checking for minix/config.h" >&5
+echo "configure:2827: checking for minix/config.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2636 "configure"
+#line 2832 "configure"
 #include "confdefs.h"
 #include <minix/config.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2837: \"$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*
@@ -2676,15 +2872,15 @@ fi
 
 
 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
-echo "configure:2680: checking for be_app in -lbe" >&5
+echo "configure:2876: checking for be_app in -lbe" >&5
 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lbe  $LIBS"
+LIBS="-lbe -lroot -lnet $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2688 "configure"
+#line 2884 "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
@@ -2695,7 +2891,7 @@ int main() {
 be_app()
 ; return 0; }
 EOF
-if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2895: \"$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
@@ -2710,19 +2906,20 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIBS="$LIBS -lbe -lroot"
+  LIBS="$LIBS -lbe -lroot -lnet"
 else
   echo "$ac_t""no" 1>&6
+:
 fi
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:2721: checking for Cygwin environment" >&5
+echo "configure:2918: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2726 "configure"
+#line 2923 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2733,7 +2930,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:2737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -2750,19 +2947,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:2754: checking for mingw32 environment" >&5
+echo "configure:2951: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2759 "configure"
+#line 2956 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:2766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -2781,7 +2978,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2785: checking for executable suffix" >&5
+echo "configure:2982: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2791,7 +2988,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:2795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:2992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj) ;;
@@ -2812,13 +3009,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:2816: checking for object suffix" >&5
+echo "configure:3013: checking for object suffix" >&5
 if eval "test \"`echo '$''{'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:2822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -2836,11 +3033,16 @@ OBJEXT=$ac_cv_objext
 ac_objext=$ac_cv_objext
 
 
+cat >> confdefs.h <<EOF
+#define EXEEXT "${EXEEXT}"
+EOF
+
+
 
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:2844: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:3046: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2856,7 +3058,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__
 do
   CC="$ac_save_CC $ac_arg"
   cat > conftest.$ac_ext <<EOF
-#line 2860 "configure"
+#line 3062 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -2893,7 +3095,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:2897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_prog_cc_stdc="$ac_arg"; break
 else
@@ -2921,15 +3123,64 @@ if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
 fi
 
 
+# test for make depend flag
+OL_MKDEP=
+OL_MKDEP_FLAGS=
+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:3134: checking for ${OL_MKDEP} depend flag" >&5
+if eval "test \"`echo '$''{'ol_cv_mkdep'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+                       ol_cv_mkdep=no
+                       for flag in "-M" "-xM"; do
+                               cat > conftest.c <<EOF
+ noCode;
+EOF
+                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3144: \"$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
+                                               ol_cv_mkdep=$flag
+                                               OL_MKDEP_FLAGS="$flag"
+                                               break
+                                       fi
+                               fi
+                       done
+                       rm -f conftest*
+               
+fi
+
+echo "$ac_t""$ol_cv_mkdep" 1>&6
+       else
+               cc_cv_mkdep=yes
+               OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
+       fi
+else
+       cc_cv_mkdep=yes
+       OL_MKDEP="${MKDEP}"
+       OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
+fi
+
+
+
+if test "${ol_cv_mkdep}" = no ; then
+       # this will soon become an error
+       echo "configure: warning: do not know how to generate dependencies" 1>&2
+fi
+
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:2928: checking for socket" >&5
+echo "configure:3179: checking for socket" >&5
 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2933 "configure"
+#line 3184 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -2952,7 +3203,7 @@ socket();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3207: \"$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
@@ -2966,12 +3217,12 @@ fi
 
 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_socket=yes
+  :
 else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:2975: checking for main in -lsocket" >&5
+echo "configure:3226: checking for main in -lsocket" >&5
 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2979,14 +3230,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2983 "configure"
+#line 3234 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3241: \"$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
@@ -3014,7 +3265,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:3018: checking for main in -lnet" >&5
+echo "configure:3269: checking for main in -lnet" >&5
 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3022,14 +3273,61 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3026 "configure"
+#line 3277 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lnet $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
+echo "configure:3312: checking for socket in -lnet" >&5
+ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lnet  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3320 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char socket();
+
+int main() {
+socket()
+; return 0; }
+EOF
+if { (eval echo configure:3331: \"$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
@@ -3057,7 +3355,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:3061: checking for main in -lnsl_s" >&5
+echo "configure:3359: checking for main in -lnsl_s" >&5
 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3065,14 +3363,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3069 "configure"
+#line 3367 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3374: \"$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
@@ -3100,7 +3398,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:3104: checking for main in -lnsl" >&5
+echo "configure:3402: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3108,14 +3406,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3112 "configure"
+#line 3410 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3417: \"$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
@@ -3143,7 +3441,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:3147: checking for socket in -linet" >&5
+echo "configure:3445: checking for socket in -linet" >&5
 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3151,7 +3449,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3155 "configure"
+#line 3453 "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
@@ -3162,7 +3460,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3464: \"$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
@@ -3190,7 +3488,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:3194: checking for main in -lgen" >&5
+echo "configure:3492: checking for main in -lgen" >&5
 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3198,14 +3496,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3202 "configure"
+#line 3500 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3507: \"$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
@@ -3239,12 +3537,12 @@ fi
 for ac_func in res_search
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3243: checking for $ac_func" >&5
+echo "configure:3541: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3248 "configure"
+#line 3546 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3267,7 +3565,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3569: \"$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
@@ -3293,7 +3591,7 @@ done
 
 if test $ac_cv_func_res_search = "no" ; then 
        echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
-echo "configure:3297: checking for res_search in -lbind" >&5
+echo "configure:3595: checking for res_search in -lbind" >&5
 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3301,7 +3599,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3305 "configure"
+#line 3603 "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
@@ -3312,7 +3610,7 @@ int main() {
 res_search()
 ; return 0; }
 EOF
-if { (eval echo configure:3316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3614: \"$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
@@ -3346,7 +3644,7 @@ EOF
 
        else
                echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:3350: checking for res_search in -lresolv" >&5
+echo "configure:3648: checking for res_search in -lresolv" >&5
 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3354,7 +3652,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3358 "configure"
+#line 3656 "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
@@ -3365,7 +3663,7 @@ int main() {
 res_search()
 ; return 0; }
 EOF
-if { (eval echo configure:3369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3667: \"$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
@@ -3402,7 +3700,7 @@ EOF
 fi
 
 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:3406: checking for sigset in -lV3" >&5
+echo "configure:3704: checking for sigset in -lV3" >&5
 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3410,7 +3708,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3414 "configure"
+#line 3712 "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
@@ -3421,7 +3719,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:3425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3723: \"$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
@@ -3449,163 +3747,438 @@ else
 fi
 
 
-# ISODE tests
-ol_link_isode=no
-if test $ol_enable_ldapd != no ; then
-               echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
-echo "configure:3457: checking for main in -lxtpp" >&5
-ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+for ac_hdr in regex.h 
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3755: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3465 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 3760 "configure"
 #include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:3472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_header_$ac_safe=yes"
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-               ol_link_isode=yes
-               cat >> confdefs.h <<\EOF
-#define HAVE_XTPP 1
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
 EOF
-
-               LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
-               
 else
   echo "$ac_t""no" 1>&6
-:
 fi
+done
 
-       echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
-echo "configure:3501: checking for main in -ldsap" >&5
-ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+if test "$ac_cv_header_regex_h" != yes ; then
+       { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
+fi
+echo $ac_n "checking for regfree""... $ac_c" 1>&6
+echo "configure:3795: checking for regfree" >&5
+if eval "test \"`echo '$''{'ac_cv_func_regfree'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldsap -lisode $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3509 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 3800 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char regfree(); 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 regfree();
 
 int main() {
-main()
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_regfree) || defined (__stub___regfree)
+choke me
+#else
+regfree();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:3516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func_regfree=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_func_regfree=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-               ol_link_isode=yes
-               cat >> confdefs.h <<\EOF
-#define HAVE_DSAP 1
-EOF
 
-               LDAPD_LIBS="$LDAPD_LIBS -ldsap"
-               
+if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
 else
   echo "$ac_t""no" 1>&6
-:
+{ echo "configure: error: POSIX regex required." 1>&2; exit 1; }
 fi
 
-       echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
-echo "configure:3545: checking for main in -lisode" >&5
-ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+
+echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
+echo "configure:3846: checking for compatible POSIX regex" >&5
+if eval "test \"`echo '$''{'ol_cv_c_posix_regex'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lisode  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3553 "configure"
+  
+       if test "$cross_compiling" = yes; then
+  ol_cv_c_posix_regex=cross
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3855 "configure"
 #include "confdefs.h"
 
-int main() {
+#include <sys/types.h>
+#include <regex.h>
+static char *pattern, *string;
 main()
-; return 0; }
+{
+       int rc;
+       regex_t re;
+
+       pattern = "^A";
+
+       if(regcomp(&re, pattern, 0)) {
+               return -1;
+       }
+       
+       string = "ALL MATCH";
+       
+       rc = regexec(&re, string, 0, (void*)0, 0);
+
+       regfree(&re);
+
+       return rc;
+}
 EOF
-if { (eval echo configure:3560: \"$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"
+if { (eval echo configure:3881: \"$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
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  rm -fr conftest*
+  ol_cv_c_posix_regex=no
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -fr conftest*
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-               ol_link_isode=yes
-               cat >> confdefs.h <<\EOF
-#define HAVE_ISODE 1
-EOF
 
-               LDAPD_LIBS="$LDAPD_LIBS -lisode"
-               
-else
-  echo "$ac_t""no" 1>&6
-:
 fi
 
+echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
+
+if test "$ol_cv_c_posix_regex" = no ; then
+       { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
 fi
 
-if test $ol_link_isode != no; then
-       echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
-echo "configure:3592: checking for main in -lpp" >&5
-ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo $ac_n "checking for select""... $ac_c" 1>&6
+echo "configure:3902: checking for select" >&5
+if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpp  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3600 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 3907 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char select(); 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 select();
 
 int main() {
-main()
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_select) || defined (__stub___select)
+choke me
+#else
+select();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func_select=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_select=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+{ echo "configure: error: select() required." 1>&2; exit 1; }
+fi
+
+
+echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
+echo "configure:3952: checking types of arguments for select()" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+   if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+     for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
+     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 3966 "configure"
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+          ac_not_found=no ; break 3
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_not_found=yes
+fi
+rm -f conftest*
+      done
+     done
+    done
+   
+fi
+  
+fi
+fi
+ if test "$ac_not_found" = yes; then
+  ac_cv_func_select_arg1=int 
+  ac_cv_func_select_arg234='int *' 
+  ac_cv_func_select_arg5='struct timeval *'
+ fi
+ echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
+ cat >> confdefs.h <<EOF
+#define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
+EOF
+
+ cat >> confdefs.h <<EOF
+#define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
+EOF
+
+ cat >> confdefs.h <<EOF
+#define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
+EOF
+
+
+
+# ISODE tests
+ol_link_isode=no
+if test $ol_enable_ldapd != no ; then
+       echo "configure: warning: ldapd support deprecated.  Manual intervention required." 1>&2
+
+               echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
+echo "configure:4030: checking for main in -lxtpp" >&5
+ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4038 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+               ol_link_isode=yes
+               cat >> confdefs.h <<\EOF
+#define HAVE_XTPP 1
+EOF
+
+               LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
+               
+else
+  echo "$ac_t""no" 1>&6
+:
+fi
+
+       echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
+echo "configure:4074: checking for main in -ldsap" >&5
+ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldsap -lisode $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4082 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+               ol_link_isode=yes
+               cat >> confdefs.h <<\EOF
+#define HAVE_DSAP 1
+EOF
+
+               LDAPD_LIBS="$LDAPD_LIBS -ldsap"
+               
+else
+  echo "$ac_t""no" 1>&6
+:
+fi
+
+       echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
+echo "configure:4118: checking for main in -lisode" >&5
+ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lisode  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4126 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+               ol_link_isode=yes
+               cat >> confdefs.h <<\EOF
+#define HAVE_ISODE 1
+EOF
+
+               LDAPD_LIBS="$LDAPD_LIBS -lisode"
+               
+else
+  echo "$ac_t""no" 1>&6
+:
+fi
+
+fi
+
+if test $ol_link_isode != no; then
+       echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
+echo "configure:4165: checking for main in -lpp" >&5
+ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpp  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4173 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:4180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -3634,7 +4207,7 @@ fi
        # Extract the first word of "pepsy", so it can be a program name with args.
 set dummy pepsy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3638: checking for $ac_word" >&5
+echo "configure:4211: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3675,17 +4248,17 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3679: checking for $ac_hdr" >&5
+echo "configure:4252: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3684 "configure"
+#line 4257 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4262: \"$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*
@@ -3714,7 +4287,7 @@ done
 
        if test $ac_cv_header_kerberosIV_krb_h = yes ; then
                echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:3718: checking for main in -lkrb4" >&5
+echo "configure:4291: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3722,14 +4295,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3726 "configure"
+#line 4299 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4306: \"$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
@@ -3760,7 +4333,7 @@ fi
                        LIBS="$KRB_LIBS $LIBS"
 
                        echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:3764: checking for des_debug in Kerberos libraries" >&5
+echo "configure:4337: checking for des_debug in Kerberos libraries" >&5
 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3768,7 +4341,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="$KRB_LIBS $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 3772 "configure"
+#line 4345 "configure"
 #include "confdefs.h"
 
 #include <kerberosIV/krb.h>
@@ -3781,7 +4354,7 @@ des_debug = 1;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4358: \"$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
@@ -3814,17 +4387,17 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3818: checking for $ac_hdr" >&5
+echo "configure:4391: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3823 "configure"
+#line 4396 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4401: \"$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*
@@ -3853,7 +4426,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:3857: checking for main in -lkrb" >&5
+echo "configure:4430: checking for main in -lkrb" >&5
 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3861,14 +4434,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3865 "configure"
+#line 4438 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4445: \"$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
@@ -3913,17 +4486,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:3917: checking for $ac_hdr" >&5
+echo "configure:4490: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3922 "configure"
+#line 4495 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4500: \"$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*
@@ -3952,7 +4525,7 @@ done
        
        if test $ac_cv_header_ssl_h = yes ; then
                echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
-echo "configure:3956: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
+echo "configure:4529: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3960,7 +4533,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3964 "configure"
+#line 4537 "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
@@ -3971,7 +4544,7 @@ int main() {
 SSLeay_add_ssl_algorithms()
 ; return 0; }
 EOF
-if { (eval echo configure:3975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4548: \"$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
@@ -3996,7 +4569,7 @@ fi
                        
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
-echo "configure:4000: checking for ssl3_accept in -lssl" >&5
+echo "configure:4573: checking for ssl3_accept in -lssl" >&5
 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4004,7 +4577,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4008 "configure"
+#line 4581 "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
@@ -4015,7 +4588,7 @@ int main() {
 ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:4019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4592: \"$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
@@ -4075,12 +4648,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4079: checking for $ac_func" >&5
+echo "configure:4652: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4084 "configure"
+#line 4657 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4103,7 +4676,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4680: \"$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
@@ -4132,19 +4705,19 @@ if test "$ac_cv_func_ctime_r" = no ; then
        ol_cv_func_ctime_r_nargs=0
 else
        echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
-echo "configure:4136: checking number of arguments of ctime_r" >&5
+echo "configure:4709: checking number of arguments of ctime_r" >&5
 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4141 "configure"
+#line 4714 "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:4148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs=3
 else
@@ -4152,14 +4725,14 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 4156 "configure"
+#line 4729 "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:4163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs=2
 else
@@ -4185,12 +4758,12 @@ fi
 
 if test "$ac_cv_func_gethostbyname_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
-echo "configure:4189: checking number of arguments of gethostbyname_r" >&5
+echo "configure:4762: checking number of arguments of gethostbyname_r" >&5
 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4194 "configure"
+#line 4767 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -4204,7 +4777,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:4208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs=5
 else
@@ -4212,7 +4785,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 4216 "configure"
+#line 4789 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -4227,7 +4800,7 @@ struct hostent hent;struct hostent *rhent;
                                &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:4231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs=6
 else
@@ -4255,12 +4828,12 @@ fi
  
 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
-echo "configure:4259: checking number of arguments of gethostbyaddr_r" >&5
+echo "configure:4832: checking number of arguments of gethostbyaddr_r" >&5
 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4264 "configure"
+#line 4837 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -4276,7 +4849,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        alen, AF_INET, &hent, buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:4280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs=7
 else
@@ -4284,7 +4857,7 @@ else
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   cat > conftest.$ac_ext <<EOF
-#line 4288 "configure"
+#line 4861 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -4302,7 +4875,7 @@ struct hostent hent;
                                &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:4306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs=8
 else
@@ -4353,17 +4926,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:4357: checking for $ac_hdr" >&5
+echo "configure:4930: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4362 "configure"
+#line 4935 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4940: \"$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*
@@ -4392,13 +4965,13 @@ done
 
        if test $ac_cv_header_pthread_h = yes ; then
                echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:4396: checking POSIX thread version" >&5
+echo "configure:4969: checking POSIX thread version" >&5
 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 4402 "configure"
+#line 4975 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -4420,7 +4993,7 @@ rm -f conftest*
 
 
        cat > conftest.$ac_ext <<EOF
-#line 4424 "configure"
+#line 4997 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
                ol_with_threads=found
 
                
-echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:4477: checking for LinuxThreads" >&5
-if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
+       echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
+echo "configure:5050: checking for LinuxThreads pthread.h" >&5
+if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-       res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
-       if test "$res" -gt 0 ; then
-               ol_cv_linux_threads=yes
-       else
-               ol_cv_linux_threads=no
-       fi
-
+  cat > conftest.$ac_ext <<EOF
+#line 5055 "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*
 
-echo "$ac_t""$ol_cv_linux_threads" 1>&6
-
+               
+fi
 
-               if test $ol_cv_linux_threads = yes ; then
-                       cat >> confdefs.h <<\EOF
+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 pthread_create""... $ac_c" 1>&6
-echo "configure:4503: checking for pthread_create" >&5
-if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
+                               echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
+echo "configure:5083: checking for pthread_create in default libraries" >&5
+               if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
+  
+               if test "$cross_compiling" = yes; then
+                       ol_cv_pthread_create=yes
+else
   cat > conftest.$ac_ext <<EOF
-#line 4508 "configure"
+#line 5092 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char pthread_create(); 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 pthread_create();
 
-int main() {
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_pthread_create) || defined (__stub___pthread_create)
-choke me
+static void *task(p)
+       void *p;
+{
+       return (void *) (p == NULL);
+}
+
+int main(argc, argv)
+       int argc;
+       char **argv;
+{
+       pthread_t t;
+       int status;
+
+       /* make sure pthread_create() isn't just a stub */
+#if HAVE_PTHREADS_D4
+       status = pthread_create(&t, pthread_attr_default, task, NULL);
 #else
-pthread_create();
+       status = pthread_create(&t, NULL, task, NULL);
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:4531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_pthread_create=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_pthread_create=no"
-fi
-rm -f conftest*
-fi
+       if( status ) return status;
 
-if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  ol_link_threads=yes
-else
-  echo "$ac_t""no" 1>&6
-fi
+       /* make sure pthread_detach() isn't just a stub */
+#if HAVE_PTHREADS_D4
+       status = pthread_detach( &t );
+#else
+       status = pthread_detach( t );
+#endif
 
+       if( status ) return status;
+
+       return status;
+}
 
-               if test $ol_link_threads = no ; then
-                                               echo $ac_n "checking for pthread_create with -mt""... $ac_c" 1>&6
-echo "configure:4553: checking for pthread_create with -mt" >&5
-if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-                                                               save_LIBS="$LIBS"
-                               LIBS="-mt $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 4561 "configure"
-#include "confdefs.h"
-char pthread_create();
-int main() {
-pthread_create();
-; return 0; }
 EOF
-if { (eval echo configure:4568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ol_cv_thread_flag=yes
+if { (eval echo configure:5135: \"$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
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_thread_flag=no
+  rm -fr conftest*
+  ol_cv_pthread_create=no
 fi
-rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
+rm -fr conftest*
 fi
 
-echo "$ac_t""$ol_cv_thread_flag" 1>&6
+fi
 
-                       if test $ol_cv_thread_flag = yes ; then
-                               LTHREAD_LIBS="$LTHREAD_LIBS -mt"
-                               ol_link_threads=posix
-                       fi
-               fi
+               echo "$ac_t""$ol_cv_pthread_create" 1>&6
 
-               if test $ol_link_threads = no ; then
-                                               echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
-echo "configure:4592: checking for pthread_create with -kthread" >&5
-if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
+               if test $ol_cv_pthread_create != no ; then
+                       ol_link_threads=posix
+                       ol_link_pthreads=""
+               fi
+               
+               # Pthread try link: -mt (ol_cv_pthread_mt)
+       if test "$ol_link_threads" = no ; then
+               # try -mt
+               echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
+echo "configure:5160: checking for pthread link with -mt" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-                                                               save_LIBS="$LIBS"
-                               LIBS="-kthread $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 4600 "configure"
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-mt $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5170 "configure"
 #include "confdefs.h"
+
 #include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
 int main() {
 
+       pthread_t t;
+
 #if HAVE_PTHREADS_D4
-       pthread_create(NULL,pthread_attr_default,NULL,NULL);
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
 #else
-       pthread_create(NULL,NULL,NULL,NULL);
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_kthread_flag=yes
+  ol_cv_pthread_mt=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_kthread_flag=no
+  ol_cv_pthread_mt=no
 fi
 rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-echo "$ac_t""$ol_cv_kthread_flag" 1>&6
+echo "$ac_t""$ol_cv_pthread_mt" 1>&6
 
-                       if test $ol_cv_kthread_flag = yes ; then
-                               LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
-                               ol_link_threads=posix
-                       fi
+               if test $ol_cv_pthread_mt = yes ; then
+                       ol_link_pthreads="-mt"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
-echo "configure:4637: checking for pthread_create with -pthread" >&5
-if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
+               # Pthread try link: -kthread (ol_cv_pthread_kthread)
+       if test "$ol_link_threads" = no ; then
+               # try -kthread
+               echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
+echo "configure:5223: checking for pthread link with -kthread" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-                                                               save_LIBS="$LIBS"
-                               LIBS="-pthread $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 4645 "configure"
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-kthread $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5233 "configure"
 #include "confdefs.h"
+
 #include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
 int main() {
 
+       pthread_t t;
+
 #if HAVE_PTHREADS_D4
-       pthread_create(NULL,pthread_attr_default,NULL,NULL);
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
 #else
-       pthread_create(NULL,NULL,NULL,NULL);
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthread_flag=yes
+  ol_cv_pthread_kthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthread_flag=no
+  ol_cv_pthread_kthread=no
 fi
 rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-echo "$ac_t""$ol_cv_pthread_flag" 1>&6
+echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
 
-                       if test $ol_cv_pthread_flag = yes ; then
-                               LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
-                               ol_link_threads=posix
-                       fi
+               if test $ol_cv_pthread_kthread = yes ; then
+                       ol_link_pthreads="-kthread"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
-echo "configure:4682: checking for pthread_create with -pthreads" >&5
-if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
+               # Pthread try link: -pthread (ol_cv_pthread_pthread)
+       if test "$ol_link_threads" = no ; then
+               # try -pthread
+               echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
+echo "configure:5286: checking for pthread link with -pthread" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-                                                               save_LIBS="$LIBS"
-                               LIBS="-pthreads $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 4690 "configure"
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-pthread $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5296 "configure"
 #include "confdefs.h"
+
 #include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
 int main() {
 
+       pthread_t t;
+
 #if HAVE_PTHREADS_D4
-       pthread_create(NULL,pthread_attr_default,NULL,NULL);
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
 #else
-       pthread_create(NULL,NULL,NULL,NULL);
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_pthreads_flag=yes
+  ol_cv_pthread_pthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_pthreads_flag=no
+  ol_cv_pthread_pthread=no
 fi
 rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
+echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
 
-                       if test $ol_cv_pthreads_flag = yes ; then
-                               LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
-                               ol_link_threads=posix
-                       fi
+               if test $ol_cv_pthread_pthread = yes ; then
+                       ol_link_pthreads="-pthread"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
-echo "configure:4727: checking for pthread_create with -thread" >&5
-if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
+               # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
+       if test "$ol_link_threads" = no ; then
+               # try -pthreads
+               echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
+echo "configure:5349: checking for pthread link with -pthreads" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-                                                               save_LIBS="$LIBS"
-                               LIBS="-thread $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 4735 "configure"
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-pthreads $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5359 "configure"
 #include "confdefs.h"
-char pthread_create();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
 int main() {
-pthread_create();
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_thread_flag=yes
+  ol_cv_pthread_pthreads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_thread_flag=no
+  ol_cv_pthread_pthreads=no
 fi
 rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-echo "$ac_t""$ol_cv_thread_flag" 1>&6
+echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
 
-                       if test $ol_cv_thread_flag = yes ; then
-                               LTHREAD_LIBS="$LTHREAD_LIBS -thread"
-                               ol_link_threads=posix
-                       fi
+               if test $ol_cv_pthread_pthreads = yes ; then
+                       ol_link_pthreads="-pthreads"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_mutex_unlock in -lpthread""... $ac_c" 1>&6
-echo "configure:4767: checking for pthread_mutex_unlock in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+               # Pthread try link: -thread (ol_cv_pthread_thread)
+       if test "$ol_link_threads" = no ; then
+               # try -thread
+               echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
+echo "configure:5412: checking for pthread link with -thread" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4775 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-thread $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5422 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_mutex_unlock();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_mutex_unlock()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:4786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_thread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_thread=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
-                               if test $ol_with_yielding_select = auto ; then
-                                       ol_with_yielding_select=yes
-                               fi
-                               
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_thread" 1>&6
+
+               if test $ol_cv_pthread_thread = yes ; then
+                       ol_link_pthreads="-thread"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
-echo "configure:4819: checking for pthread_mutex_lock in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+               # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
+       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:5476: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthread -lmach -lexc $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4827 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5486 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_mutex_lock();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_mutex_lock()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:4838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc"
-                               if test $ol_with_yielding_select = auto ; then
-                                       ol_with_yielding_select=yes
-                               fi
-                               
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
+
+               if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
+                       ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_mutex_trylock in -lpthread""... $ac_c" 1>&6
-echo "configure:4871: checking for pthread_mutex_trylock in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+               # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
+       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:5539: checking for pthread link with -lpthread -lmach -lexc" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthread -lexc $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4879 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lpthread -lmach -lexc $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5549 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_mutex_trylock();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_mutex_trylock()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:4890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_lpthread_lmach_lexc=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_lpthread_lmach_lexc=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
-                               if test $ol_with_yielding_select = auto ; then
-                                       ol_with_yielding_select=yes
-                               fi
-                               
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
+
+               if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
+                       ol_link_pthreads="-lpthread -lmach -lexc"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:4923: checking for pthread_create in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+               # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
+       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:5603: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthread  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4931 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lpthread -Wl,-woff,85 $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5613 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_create();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_create()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:4942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_lib_lpthread_woff=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_lib_lpthread_woff=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
+
+               if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
+                       ol_link_pthreads="-lpthread -Wl,-woff,85"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:4971: checking for pthread_create in -lc_r" >&5
-ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+               # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
+       if test "$ol_link_threads" = no ; then
+               # try -lpthread
+               echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
+echo "configure:5667: checking for pthread link with -lpthread" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lc_r  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4979 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lpthread $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5677 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_create();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_create()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:4990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_lpthread=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_lpthread=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
+
+               if test $ol_cv_pthread_lpthread = yes ; then
+                       ol_link_pthreads="-lpthread"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:5019: checking for pthread_create in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+               # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
+       if test "$ol_link_threads" = no ; then
+               # try -lc_r
+               echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
+echo "configure:5730: checking for pthread link with -lc_r" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthreads  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5027 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lc_r $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5740 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_create();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_create()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_lc_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_lc_r=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
+
+               if test $ol_cv_pthread_lc_r = yes ; then
+                       ol_link_pthreads="-lc_r"
+                       ol_link_threads=posix
                fi
+       fi
 
-                               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
-echo "configure:5067: checking for pthread_join in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+               # Pthread try link: -threads (ol_cv_pthread_threads)
+       if test "$ol_link_threads" = no ; then
+               # try -threads
+               echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
+echo "configure:5794: checking for pthread link with -threads" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthreads -Wl,-woff,85 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5075 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-threads $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5804 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_join();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_join()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_threads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_threads=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
-                               
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_threads" 1>&6
+
+               if test $ol_cv_pthread_threads = yes ; then
+                       ol_link_pthreads="-threads"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               echo $ac_n "checking for pthread_create with -threads""... $ac_c" 1>&6
-echo "configure:5115: checking for pthread_create with -threads" >&5
-if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
+
+               # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
+       if test "$ol_link_threads" = no ; then
+               # try -lpthreads -lmach -lexc -lc_r
+               echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
+echo "configure:5858: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
-                                                               save_LIBS="$LIBS"
-                               LIBS="-threads $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 5123 "configure"
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5868 "configure"
 #include "confdefs.h"
-char pthread_create();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
 int main() {
 
-                                       pthread_create();
-                                       
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ol_cv_thread_flag=yes
+  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_thread_flag=no
+  ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
 fi
 rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
+
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-echo "$ac_t""$ol_cv_thread_flag" 1>&6
+echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
 
-                       if test $ol_cv_thread_flag = yes ; then
-                               LTHREAD_LIBS="$LTHREAD_LIBS -threads"
-                               ol_link_threads=posix
-                       fi
+               if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
+                       ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
-echo "configure:5157: checking for pthread_mutex_unlock in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+               # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
+       if test "$ol_link_threads" = no ; then
+               # try -lpthreads -lmach -lexc
+               echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
+echo "configure:5921: checking for pthread link with -lpthreads -lmach -lexc" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5165 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lpthreads -lmach -lexc $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5931 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_mutex_unlock();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_mutex_unlock()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_lpthreads_lmach_lexc=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
-                               if test $ol_with_yielding_select = auto ; then
-                                       ol_with_yielding_select=yes
-                               fi
-                               
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
+
+               if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
+                       ol_link_pthreads="-lpthreads -lmach -lexc"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_mutex_lock in -lpthreads""... $ac_c" 1>&6
-echo "configure:5209: checking for pthread_mutex_lock in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+               # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
+       if test "$ol_link_threads" = no ; then
+               # try -lpthreads -lexc
+               echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
+echo "configure:5984: checking for pthread link with -lpthreads -lexc" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthreads -lmach -lexc $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5217 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lpthreads -lexc $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 5994 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_mutex_lock();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_mutex_lock()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_lpthreads_lexc=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_lpthreads_lexc=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc"
-                               if test $ol_with_yielding_select = auto ; then
-                                       ol_with_yielding_select=yes
-                               fi
-                               
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
+
+               if test $ol_cv_pthread_lpthreads_lexc = yes ; then
+                       ol_link_pthreads="-lpthreads -lexc"
+                       ol_link_threads=posix
                fi
+       fi
 
-               if test $ol_link_threads = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_mutex_trylock in -lpthreads""... $ac_c" 1>&6
-echo "configure:5261: checking for pthread_mutex_trylock in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+               # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
+       if test "$ol_link_threads" = no ; then
+               # try -lpthreads
+               echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
+echo "configure:6048: checking for pthread link with -lpthreads" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthreads -lexc $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5269 "configure"
+  
+                       # save the flags
+                       ol_LIBS="$LIBS"
+                       LIBS="-lpthreads $LIBS"
+
+                       cat > conftest.$ac_ext <<EOF
+#line 6058 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char pthread_mutex_trylock();
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
 
 int main() {
-pthread_mutex_trylock()
+
+       pthread_t t;
+
+#if HAVE_PTHREADS_D4
+       pthread_create(&t, pthread_attr_default, NULL, NULL);
+       pthread_detach( &t );
+#else
+       pthread_create(&t, NULL, NULL, NULL);
+       pthread_detach( t );
+#endif
+#ifdef HAVE_LINUX_THREADS
+       pthread_kill_other_threads_np();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:5280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_pthread_lib_lpthreads=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_pthread_lib_lpthreads=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-                               ol_link_threads=posix
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
-                               if test $ol_with_yielding_select = auto ; then
-                                       ol_with_yielding_select=yes
-                               fi
-                               
-else
-  echo "$ac_t""no" 1>&6
-:
+               # restore the LIBS
+               LIBS="$ol_LIBS"
+               
 fi
 
-                       LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
+
+               if test $ol_cv_pthread_lib_lpthreads = yes ; then
+                       ol_link_pthreads="-lpthreads"
+                       ol_link_threads=posix
                fi
+       fi
+
 
                if test $ol_link_threads != no ; then
                        cat >> confdefs.h <<\EOF
@@ -5312,6 +6110,8 @@ fi
 EOF
 
 
+                       LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
+
                                                save_CPPFLAGS="$CPPFLAGS"
                        save_LIBS="$LIBS"
                        LIBS="$LTHREAD_LIBS $LIBS"
@@ -5319,12 +6119,12 @@ EOF
                                                                                                for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5323: checking for $ac_func" >&5
+echo "configure:6123: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5328 "configure"
+#line 6128 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5347,7 +6147,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6151: \"$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
@@ -5375,7 +6175,7 @@ done
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no ; then
                                                                echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:5379: checking for sched_yield in -lrt" >&5
+echo "configure:6179: checking for sched_yield in -lrt" >&5
 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5383,7 +6183,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5387 "configure"
+#line 6187 "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
@@ -5394,7 +6194,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:5398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6198: \"$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
@@ -5426,12 +6226,12 @@ fi
                                                                                                for ac_func in thr_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5430: checking for $ac_func" >&5
+echo "configure:6230: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5435 "configure"
+#line 6235 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5454,7 +6254,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6258: \"$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
@@ -5488,12 +6288,12 @@ done
                                                for ac_func in pthread_kill
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5492: checking for $ac_func" >&5
+echo "configure:6292: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5497 "configure"
+#line 6297 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5516,7 +6316,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6320: \"$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
@@ -5542,20 +6342,25 @@ done
 
 
                                                                        echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:5546: checking for pthread_detach with <pthread.h>" >&5
+echo "configure:6346: checking for pthread_detach with <pthread.h>" >&5
 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                                                                cat > conftest.$ac_ext <<EOF
-#line 5552 "configure"
+#line 6352 "configure"
 #include "confdefs.h"
+
 #include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
 int main() {
 pthread_detach(NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:5559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6364: \"$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
@@ -5587,12 +6392,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5591: checking for $ac_func" >&5
+echo "configure:6396: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5596 "configure"
+#line 6401 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5615,7 +6420,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6424: \"$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
@@ -5635,13 +6440,100 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
 EOF
  
 else
-  echo "$ac_t""no" 1>&6
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+                       
+       echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
+echo "configure:6451: checking for pthread_kill_other_threads_np" >&5
+if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6456 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char pthread_kill_other_threads_np(); 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 pthread_kill_other_threads_np();
+
+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_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
+choke me
+#else
+pthread_kill_other_threads_np();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_pthread_kill_other_threads_np=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_pthread_kill_other_threads_np=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
+echo "configure:6499: checking for LinuxThreads implementation" >&5
+if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
+fi
+
+echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
+
+                       
+       
+       
+       echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
+echo "configure:6512: checking for LinuxThreads consistency" >&5
+if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+               if test $ol_cv_header_linux_threads = yes -a \
+                       $ol_cv_sys_linux_threads = yes; then
+                       ol_cv_linux_threads=yes
+               elif test $ol_cv_header_linux_threads = no -a \
+                       $ol_cv_sys_linux_threads = no; then
+                       ol_cv_linux_threads=no
+               else
+                       ol_cv_linux_threads=error
+               fi
+       
 fi
-done
+
+echo "$ac_t""$ol_cv_linux_threads" 1>&6
 
 
+                       if test $ol_cv_linux_threads = error; then
+                               { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
+                       fi
+
                        echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:5645: checking if pthread_create() works" >&5
+echo "configure:6537: checking if pthread_create() works" >&5
                        if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5650,7 +6542,7 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 5654 "configure"
+#line 6546 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -5677,7 +6569,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:5681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6573: \"$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
@@ -5699,7 +6591,7 @@ fi
 
                                                if test $ol_with_yielding_select = auto ; then
                                echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:5703: checking if select yields when using pthreads" >&5
+echo "configure:6595: checking if select yields when using pthreads" >&5
                                if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5709,7 +6601,7 @@ else
                                { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 5713 "configure"
+#line 6605 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5785,7 +6677,7 @@ int main(argc, argv)
        exit(2);
 }
 EOF
-if { (eval echo configure:5789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6681: \"$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
@@ -5825,17 +6717,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:5829: checking for $ac_hdr" >&5
+echo "configure:6721: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5834 "configure"
+#line 6726 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6731: \"$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*
@@ -5865,12 +6757,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:5869: checking for cthread_fork" >&5
+echo "configure:6761: checking for cthread_fork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5874 "configure"
+#line 6766 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -5893,7 +6785,7 @@ cthread_fork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6789: \"$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
@@ -5915,7 +6807,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:5919: checking for cthread_fork with -all_load" >&5
+echo "configure:6811: checking for cthread_fork with -all_load" >&5
 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5923,7 +6815,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 5927 "configure"
+#line 6819 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -5932,7 +6824,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:5936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6828: \"$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
@@ -5977,17 +6869,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:5981: checking for $ac_hdr" >&5
+echo "configure:6873: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5986 "configure"
+#line 6878 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6883: \"$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*
@@ -6015,7 +6907,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:6019: checking for thr_create in -lthread" >&5
+echo "configure:6911: checking for thr_create in -lthread" >&5
 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6023,7 +6915,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6027 "configure"
+#line 6919 "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
@@ -6034,7 +6926,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:6038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6930: \"$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
@@ -6074,12 +6966,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6078: checking for $ac_func" >&5
+echo "configure:6970: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6083 "configure"
+#line 6975 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6102,7 +6994,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6998: \"$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
@@ -6133,17 +7025,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6137: checking for $ac_hdr" >&5
+echo "configure:7029: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6142 "configure"
+#line 7034 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7039: \"$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*
@@ -6171,7 +7063,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:6175: checking for lwp_create in -llwp" >&5
+echo "configure:7067: checking for lwp_create in -llwp" >&5
 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6179,7 +7071,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6183 "configure"
+#line 7075 "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
@@ -6190,7 +7082,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:6194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7086: \"$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
@@ -6243,17 +7135,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:6247: checking for $ac_hdr" >&5
+echo "configure:7139: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6252 "configure"
+#line 7144 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7149: \"$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*
@@ -6282,12 +7174,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6286: checking for $ac_func" >&5
+echo "configure:7178: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6291 "configure"
+#line 7183 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6310,7 +7202,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7206: \"$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
@@ -6335,39 +7227,53 @@ fi
 done
 
        
-echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:6340: checking for LinuxThreads" >&5
-if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
+       echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
+echo "configure:7232: checking for LinuxThreads pthread.h" >&5
+if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-       res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
-       if test "$res" -gt 0 ; then
-               ol_cv_linux_threads=yes
-       else
-               ol_cv_linux_threads=no
-       fi
+  cat > conftest.$ac_ext <<EOF
+#line 7237 "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_linux_threads" 1>&6
+echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
+       if test $ol_cv_header_linux_threads = yes; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_LINUX_THREADS 1
+EOF
+
+       fi
 
 
        for ac_hdr in mach/cthreads.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6361: checking for $ac_hdr" >&5
+echo "configure:7267: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6366 "configure"
+#line 7272 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7277: \"$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*
@@ -6397,17 +7303,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6401: checking for $ac_hdr" >&5
+echo "configure:7307: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6406 "configure"
+#line 7312 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7317: \"$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*
@@ -6437,17 +7343,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6441: checking for $ac_hdr" >&5
+echo "configure:7347: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6446 "configure"
+#line 7352 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7357: \"$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*
@@ -6501,21 +7407,21 @@ EOF
 EOF
 
 
-                                       echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:6506: checking for thread specific errno" >&5
+                       echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
+echo "configure:7412: checking for thread specific errno" >&5
 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 6512 "configure"
+#line 7418 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
-int x = errno;
+errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:6519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7425: \"$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
@@ -6530,7 +7436,37 @@ fi
 
 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
 
-       if test $ol_cv_errno_thread_specific != yes ; then
+                       echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
+echo "configure:7441: checking for thread specific h_errno" >&5
+if eval "test \"`echo '$''{'ol_cv_h_errno_thread_specific'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+               cat > conftest.$ac_ext <<EOF
+#line 7447 "configure"
+#include "confdefs.h"
+#include <netdb.h>
+int main() {
+h_errno = 0;
+; return 0; }
+EOF
+if { (eval echo configure:7454: \"$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
@@ -6565,13 +7501,13 @@ fi
 ol_link_ldbm=no 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
        echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
-echo "configure:6569: checking for DB2 library" >&5
+echo "configure:7505: checking for DB2 library" >&5
 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
-echo "configure:6575: checking for db_open in -ldb" >&5
+echo "configure:7511: checking for db_open in -ldb" >&5
 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6579,7 +7515,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6583 "configure"
+#line 7519 "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
@@ -6590,7 +7526,7 @@ int main() {
 db_open()
 ; return 0; }
 EOF
-if { (eval echo configure:6594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7530: \"$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
@@ -6621,17 +7557,17 @@ for ac_hdr in db.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6625: checking for $ac_hdr" >&5
+echo "configure:7561: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6630 "configure"
+#line 7566 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7571: \"$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*
@@ -6659,13 +7595,13 @@ done
 
 if test $ac_cv_header_db_h = yes ; then
        echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
-echo "configure:6663: checking if db.h is DB2" >&5
+echo "configure:7599: checking if db.h is DB2" >&5
 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 6669 "configure"
+#line 7605 "configure"
 #include "confdefs.h"
 
 #                      include <db.h>
@@ -6697,7 +7633,7 @@ fi
 
  
  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
-echo "configure:6701: checking for Berkeley DB2" >&5
+echo "configure:7637: checking for Berkeley DB2" >&5
 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6748,18 +7684,59 @@ fi
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
        echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
-echo "configure:6752: checking for Berkeley DB library" >&5
+echo "configure:7688: checking for Berkeley DB library" >&5
 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-       ol_LIBS="$LIBS"
+  
+       for ac_hdr in db1/db.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:7697: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 7702 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7707: \"$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
+
+       ol_LIBS="$LIBS"
        echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:6758: checking for dbopen" >&5
+echo "configure:7735: checking for dbopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6763 "configure"
+#line 7740 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -6782,7 +7759,7 @@ dbopen();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -6800,8 +7777,47 @@ if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 
-               echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:6805: checking for dbopen in -ldb" >&5
+               echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
+echo "configure:7782: checking for dbopen in -ldb1" >&5
+ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldb1  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7790 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dbopen();
+
+int main() {
+dbopen()
+; return 0; }
+EOF
+if { (eval echo configure:7801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_cv_lib_db=-ldb1
+else
+  echo "$ac_t""no" 1>&6
+
+                       echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
+echo "configure:7821: checking for dbopen in -ldb" >&5
 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6809,7 +7825,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6813 "configure"
+#line 7829 "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
@@ -6820,7 +7836,7 @@ int main() {
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:6824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7840: \"$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
@@ -6841,6 +7857,9 @@ else
 ol_cv_lib_db=no
 fi
 
+               
+fi
+
        
 fi
 
@@ -6855,17 +7874,17 @@ for ac_hdr in db_185.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6859: checking for $ac_hdr" >&5
+echo "configure:7878: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6864 "configure"
+#line 7883 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7888: \"$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*
@@ -6901,7 +7920,7 @@ fi
 
  
  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
-echo "configure:6905: checking for Berkeley DB" >&5
+echo "configure:7924: checking for Berkeley DB" >&5
 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6954,17 +7973,169 @@ if test $ol_with_ldbm_api = manual ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6958: checking for $ac_hdr" >&5
+echo "configure:7977: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 7982 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7987: \"$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
+
+fi
+
+if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
+       echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
+       ol_with_ldbm_api=none
+fi
+
+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:8022: checking for MDBM library" >&5
+if eval "test \"`echo '$''{'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:8028: checking for mdbm_set_chain" >&5
+if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 8033 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char mdbm_set_chain(); 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 mdbm_set_chain();
+
+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_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
+choke me
+#else
+mdbm_set_chain();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_mdbm_set_chain=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_mdbm_set_chain=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_cv_lib_mdbm=yes
+else
+  echo "$ac_t""no" 1>&6
+
+               echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
+echo "configure:8075: checking for mdbm_set_chain in -lmdbm" >&5
+ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lmdbm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8083 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char mdbm_set_chain();
+
+int main() {
+mdbm_set_chain()
+; return 0; }
+EOF
+if { (eval echo configure:8094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_cv_lib_mdbm=-lmdbm
+else
+  echo "$ac_t""no" 1>&6
+ol_cv_lib_mdbm=no
+fi
+
+       
+fi
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
+
+
+ for ac_hdr in mdbm.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:8129: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6963 "configure"
+#line 8134 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8139: \"$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*
@@ -6986,31 +8157,56 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
 else
-  echo "$ac_t""no" 1>&6
-fi
-done
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+ echo $ac_n "checking for db""... $ac_c" 1>&6
+echo "configure:8166: checking for db" >&5
+if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
+               ol_cv_mdbm=no
+       else
+               ol_cv_mdbm=yes
+       fi
 
 fi
 
-if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
-       echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
-       ol_with_ldbm_api=none
+echo "$ac_t""$ol_cv_mdbm" 1>&6
+ if test $ol_cv_mdbm = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_MDBM 1
+EOF
+
+ fi
+
+
+       if test $ol_cv_mdbm = yes ; then
+               ol_link_ldbm=mdbm
+               ol_with_ldbm_api=mdbm
+               if test $ol_cv_lib_mdbm != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
+               fi
+       fi
 fi
 
 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:7003: checking for GDBM library" >&5
+echo "configure:8199: checking for GDBM library" >&5
 if eval "test \"`echo '$''{'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:7009: checking for gdbm_open" >&5
+echo "configure:8205: checking for gdbm_open" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7014 "configure"
+#line 8210 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -7033,7 +8229,7 @@ gdbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8233: \"$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
@@ -7052,7 +8248,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:7056: checking for gdbm_open in -lgdbm" >&5
+echo "configure:8252: checking for gdbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7060,7 +8256,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7064 "configure"
+#line 8260 "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
@@ -7071,7 +8267,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:7075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7106,17 +8302,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:7110: checking for $ac_hdr" >&5
+echo "configure:8306: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7115 "configure"
+#line 8311 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8316: \"$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*
@@ -7143,7 +8339,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:7147: checking for db" >&5
+echo "configure:8343: checking for db" >&5
 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7179,18 +8375,18 @@ if test $ol_with_ldbm_api = auto ; then
        echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
 elif test $ol_with_ldbm_api = ndbm ; then
        echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:7183: checking for NDBM library" >&5
+echo "configure:8379: checking for NDBM library" >&5
 if eval "test \"`echo '$''{'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:7189: checking for dbm_open" >&5
+echo "configure:8385: checking for dbm_open" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7194 "configure"
+#line 8390 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -7213,7 +8409,7 @@ dbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8413: \"$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
@@ -7232,7 +8428,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:7236: checking for dbm_open in -lndbm" >&5
+echo "configure:8432: checking for dbm_open in -lndbm" >&5
 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7240,7 +8436,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7244 "configure"
+#line 8440 "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
@@ -7251,7 +8447,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:7255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8451: \"$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
@@ -7271,7 +8467,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:7275: checking for dbm_open in -ldbm" >&5
+echo "configure:8471: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7279,7 +8475,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7283 "configure"
+#line 8479 "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
@@ -7290,7 +8486,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:7294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8490: \"$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
@@ -7327,17 +8523,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:7331: checking for $ac_hdr" >&5
+echo "configure:8527: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7336 "configure"
+#line 8532 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8537: \"$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*
@@ -7364,7 +8560,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:7368: checking for db" >&5
+echo "configure:8564: checking for db" >&5
 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7411,17 +8607,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:7415: checking for $ac_hdr" >&5
+echo "configure:8611: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7420 "configure"
+#line 8616 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8621: \"$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*
@@ -7452,7 +8648,7 @@ done
                have_wrappers=no
        else
                echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
-echo "configure:7456: checking for main in -lwrap" >&5
+echo "configure:8652: checking for main in -lwrap" >&5
 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7460,14 +8656,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lwrap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7464 "configure"
+#line 8660 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8667: \"$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
@@ -7496,6 +8692,50 @@ fi
 EOF
 
                SLAPD_LIBS="$SLAPD_LIBS -lwrap"
+
+                                               echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
+echo "configure:8698: checking for main in -lnsl" >&5
+ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lnsl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8706 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:8713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lnsl $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
        else
                echo "configure: warning: could not find -lwrap" 1>&2
                if test $ol_enable_wrappers = yes ; then
@@ -7509,12 +8749,12 @@ fi
 
 if test $ol_enable_syslog != no ; then
        echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:7513: checking for openlog" >&5
+echo "configure:8753: checking for openlog" >&5
 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7518 "configure"
+#line 8758 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -7537,7 +8777,7 @@ openlog();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8781: \"$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
@@ -7567,17 +8807,17 @@ if test $ol_enable_dmalloc != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7571: checking for $ac_hdr" >&5
+echo "configure:8811: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7576 "configure"
+#line 8816 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8821: \"$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*
@@ -7604,7 +8844,7 @@ fi
 done
 
        echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
-echo "configure:7608: checking for dmalloc_shutdown in -ldmalloc" >&5
+echo "configure:8848: checking for dmalloc_shutdown in -ldmalloc" >&5
 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7612,7 +8852,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldmalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7616 "configure"
+#line 8856 "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
@@ -7623,7 +8863,7 @@ int main() {
 dmalloc_shutdown()
 ; return 0; }
 EOF
-if { (eval echo configure:7627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8867: \"$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
@@ -7657,17 +8897,17 @@ if test $ol_enable_tcl != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7661: checking for $ac_hdr" >&5
+echo "configure:8901: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7666 "configure"
+#line 8906 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8911: \"$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*
@@ -7698,7 +8938,7 @@ done
                have_tcl=no
        else
                echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
-echo "configure:7702: checking for main in -ltcl" >&5
+echo "configure:8942: checking for main in -ltcl" >&5
 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7706,14 +8946,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltcl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7710 "configure"
+#line 8950 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8957: \"$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
@@ -7737,7 +8977,7 @@ fi
 
                if test $have_tcl != yes; then
                        echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
-echo "configure:7741: checking for main in -ltcl7.6" >&5
+echo "configure:8981: checking for main in -ltcl7.6" >&5
 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7745,14 +8985,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltcl7.6  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7749 "configure"
+#line 8989 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8996: \"$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
@@ -7777,7 +9017,7 @@ fi
 
                if test $have_tcl != yes; then
                        echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
-echo "configure:7781: checking for main in -ltcl8.0" >&5
+echo "configure:9021: checking for main in -ltcl8.0" >&5
 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7785,14 +9025,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltcl8.0  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7789 "configure"
+#line 9029 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9036: \"$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
@@ -7832,17 +9072,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:7836: checking for $ac_hdr" >&5
+echo "configure:9076: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7841 "configure"
+#line 9081 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9086: \"$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*
@@ -7871,7 +9111,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:7875: checking for tputs in -ltermcap" >&5
+echo "configure:9115: checking for tputs in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7879,7 +9119,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7883 "configure"
+#line 9123 "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
@@ -7890,7 +9130,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:7894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9134: \"$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
@@ -7923,7 +9163,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:7927: checking for initscr in -lncurses" >&5
+echo "configure:9167: checking for initscr in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7931,7 +9171,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7935 "configure"
+#line 9175 "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
@@ -7942,7 +9182,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:7946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9186: \"$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
@@ -7987,17 +9227,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:7991: checking for $ac_hdr" >&5
+echo "configure:9231: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7996 "configure"
+#line 9236 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9241: \"$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*
@@ -8028,7 +9268,7 @@ done
                save_LIBS="$LIBS"
                LIBS="$TERMCAP_LIBS $LIBS"
                echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:8032: checking for readline in -lreadline" >&5
+echo "configure:9272: checking for readline in -lreadline" >&5
 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8036,7 +9276,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lreadline  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8040 "configure"
+#line 9280 "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
@@ -8047,7 +9287,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:8051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9291: \"$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
@@ -8090,12 +9330,12 @@ fi
 # FreeBSD (and others) have crypt(3) in -lcrypt
 if test $ol_enable_crypt != no ; then
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:8094: checking for crypt" >&5
+echo "configure:9334: checking for crypt" >&5
 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8099 "configure"
+#line 9339 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -8118,7 +9358,7 @@ crypt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9362: \"$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
@@ -8137,7 +9377,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:8141: checking for crypt in -lcrypt" >&5
+echo "configure:9381: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8145,7 +9385,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8149 "configure"
+#line 9389 "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
@@ -8156,7 +9396,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:8160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9400: \"$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
@@ -8200,12 +9440,12 @@ fi
 # FreeBSD (and others) have setproctitle(3) in -lutil
 if test $ol_enable_proctitle != no ; then
        echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:8204: checking for setproctitle" >&5
+echo "configure:9444: checking for setproctitle" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8209 "configure"
+#line 9449 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -8228,7 +9468,7 @@ setproctitle();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9472: \"$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
@@ -8247,7 +9487,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:8251: checking for setproctitle in -lutil" >&5
+echo "configure:9491: checking for setproctitle in -lutil" >&5
 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8255,7 +9495,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8259 "configure"
+#line 9499 "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
@@ -8266,7 +9506,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:8270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9510: \"$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
@@ -8300,13 +9540,53 @@ EOF
        fi
 fi
 
+# test for EBCDIC
+echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
+echo "configure:9546: checking for EBCDIC" >&5
+if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cat > conftest.$ac_ext <<EOF
+#line 9552 "configure"
+#include "confdefs.h"
+
+#if !('M' == 0xd4)
+#include <__ASCII__/generate_error.h>
+#endif
+
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:9561: \"$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_cpp_ebcdic=yes
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_cpp_ebcdic=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
+if test $ol_cv_cpp_ebcdic = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_EBCDIC 1
+EOF
+
+fi
+
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:8305: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+echo "configure:9585: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8310 "configure"
+#line 9590 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -8314,24 +9594,24 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
-  ac_cv_header_stdc=yes
+  ol_cv_header_stdc=yes
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_header_stdc=no
+  ol_cv_header_stdc=no
 fi
 rm -f conftest*
 
-if test $ac_cv_header_stdc = yes; then
+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 8335 "configure"
+#line 9615 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -8340,16 +9620,16 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   :
 else
   rm -rf conftest*
-  ac_cv_header_stdc=no
+  ol_cv_header_stdc=no
 fi
 rm -f conftest*
 
 fi
 
-if test $ac_cv_header_stdc = yes; then
+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 8353 "configure"
+#line 9633 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -8358,37 +9638,44 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   :
 else
   rm -rf conftest*
-  ac_cv_header_stdc=no
+  ol_cv_header_stdc=no
 fi
 rm -f conftest*
 
 fi
 
-if test $ac_cv_header_stdc = yes; then
+if test $ol_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 8374 "configure"
+#line 9654 "configure"
 #include "confdefs.h"
 #include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#ifndef HAVE_EBCDIC
+#      define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#      define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+#      define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+               || ('j' <= (c) && (c) <= 'r') \
+               || ('s' <= (c) && (c) <= 'z'))
+#      define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int main () { int i; for (i = 0; i < 256; i++)
 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:8385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -fr conftest*
-  ac_cv_header_stdc=no
+  ol_cv_header_stdc=no
 fi
 rm -fr conftest*
 fi
@@ -8396,17 +9683,18 @@ fi
 fi
 fi
 
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
+echo "$ac_t""$ol_cv_header_stdc" 1>&6
+if test $ol_cv_header_stdc = yes; then
   cat >> confdefs.h <<\EOF
 #define STDC_HEADERS 1
 EOF
 
 fi
+ac_cv_header_stdc=disable
 
 
-if test $ac_cv_header_stdc != yes; then
-       echo "configure: warning: could not Standard C compliant headers" 1>&2
+if test $ol_cv_header_stdc != yes; then
+       echo "configure: warning: could not locate Standard C compliant headers" 1>&2
 fi
 
 ac_header_dirent=no
@@ -8414,12 +9702,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:8418: checking for $ac_hdr that defines DIR" >&5
+echo "configure:9706: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8423 "configure"
+#line 9711 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -8427,7 +9715,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -8452,7 +9740,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:8456: checking for opendir in -ldir" >&5
+echo "configure:9744: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8460,7 +9748,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8464 "configure"
+#line 9752 "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
@@ -8471,7 +9759,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:8475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9763: \"$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
@@ -8493,7 +9781,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:8497: checking for opendir in -lx" >&5
+echo "configure:9785: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8501,7 +9789,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8505 "configure"
+#line 9793 "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
@@ -8512,7 +9800,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:8516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9804: \"$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
@@ -8535,12 +9823,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:8539: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:9827: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8544 "configure"
+#line 9832 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -8556,7 +9844,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:8560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -8577,12 +9865,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:8581: checking POSIX termios" >&5
+echo "configure:9869: checking POSIX termios" >&5
 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8586 "configure"
+#line 9874 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -8592,7 +9880,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:8596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9884: \"$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
@@ -8608,7 +9896,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:8612: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:9900: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8617,7 +9905,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 8621 "configure"
+#line 9909 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -8637,7 +9925,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 8641 "configure"
+#line 9929 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -8674,18 +9962,19 @@ fi
 
 for ac_hdr in \
        arpa/inet.h             \
-       arpa/nameser.h          \
+       arpa/nameser.h  \
+       assert.h                \
        crypt.h                 \
        errno.h                 \
        fcntl.h                 \
        filio.h                 \
        getopt.h                \
+       grp.h                   \
        libutil.h               \
        limits.h                \
        locale.h                \
        malloc.h                \
        memory.h                \
-       regex.h                 \
        psap.h                  \
        pwd.h                   \
        resolv.h                \
@@ -8700,9 +9989,10 @@ for ac_hdr in \
        sys/errno.h             \
        sys/ioctl.h             \
        sys/param.h             \
-       sys/resource.h          \
-       sys/socket.h            \
-       sys/syslog.h            \
+       sys/resource.h  \
+       sys/select.h    \
+       sys/socket.h    \
+       sys/syslog.h    \
        sys/time.h              \
        sys/types.h             \
        syslog.h                \
@@ -8712,17 +10002,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:8716: checking for $ac_hdr" >&5
+echo "configure:10006: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8721 "configure"
+#line 10011 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10016: \"$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*
@@ -8750,12 +10040,12 @@ done
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:8754: checking for uid_t in sys/types.h" >&5
+echo "configure:10044: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8759 "configure"
+#line 10049 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -8784,7 +10074,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:8788: checking type of array argument to getgroups" >&5
+echo "configure:10078: checking type of array argument to getgroups" >&5
 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8792,7 +10082,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8796 "configure"
+#line 10086 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -8817,7 +10107,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:8821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
     ac_cv_type_getgroups=gid_t
 else
@@ -8831,7 +10121,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 8835 "configure"
+#line 10125 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -8853,13 +10143,117 @@ cat >> confdefs.h <<EOF
 #define GETGROUPS_T $ac_cv_type_getgroups
 EOF
 
- echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:8858: checking for mode_t" >&5
+ echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:10148: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10153 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:10161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  ac_cv_header_stdc=yes
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+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 10178 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+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 10196 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 10217 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:10228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo $ac_n "checking for mode_t""... $ac_c" 1>&6
+echo "configure:10252: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8863 "configure"
+#line 10257 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -8887,12 +10281,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:8891: checking for off_t" >&5
+echo "configure:10285: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8896 "configure"
+#line 10290 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -8920,12 +10314,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:8924: checking for pid_t" >&5
+echo "configure:10318: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8929 "configure"
+#line 10323 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -8953,19 +10347,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:8957: checking for ptrdiff_t" >&5
+echo "configure:10351: checking for ptrdiff_t" >&5
 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8962 "configure"
+#line 10356 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:8969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -8986,12 +10380,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:8990: checking return type of signal handlers" >&5
+echo "configure:10384: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8995 "configure"
+#line 10389 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -9008,7 +10402,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:9012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -9027,19 +10421,19 @@ EOF
 
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:9031: checking for sig_atomic_t" >&5
+echo "configure:10425: checking for sig_atomic_t" >&5
 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9036 "configure"
+#line 10430 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:9043: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_sig_atomic_t=yes
 else
@@ -9060,12 +10454,12 @@ EOF
   fi
  
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:9064: checking for size_t" >&5
+echo "configure:10458: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9069 "configure"
+#line 10463 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -9093,12 +10487,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:9097: checking for st_blksize in struct stat" >&5
+echo "configure:10491: checking for st_blksize in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9102 "configure"
+#line 10496 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -9106,7 +10500,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:9110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -9127,12 +10521,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:9131: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:10525: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9136 "configure"
+#line 10530 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -9141,7 +10535,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:9145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -9162,12 +10556,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:9166: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:10560: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9171 "configure"
+#line 10565 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -9175,7 +10569,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:9179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -9195,10 +10589,48 @@ EOF
 
 fi
 
+# test for pw_gecos in struct passwd
+echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
+echo "configure:10595: checking struct passwd for pw_gecos" >&5
+if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       cat > conftest.$ac_ext <<EOF
+#line 10601 "configure"
+#include "confdefs.h"
+#include <pwd.h>
+int main() {
+
+       struct passwd pwd;
+       pwd.pw_gecos = pwd.pw_name;
+
+; return 0; }
+EOF
+if { (eval echo configure:10611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ol_cv_struct_passwd_pw_gecos=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_struct_passwd_pw_gecos=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
+if test $ol_cv_struct_passwd_pw_gecos = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_PW_GECOS 1
+EOF
+
+fi
+
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:9202: checking if toupper() requires islower()" >&5
+echo "configure:10634: checking if toupper() requires islower()" >&5
 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9207,7 +10639,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 9211 "configure"
+#line 10643 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -9219,7 +10651,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:9223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10655: \"$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
@@ -9242,12 +10674,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:9246: checking for working const" >&5
+echo "configure:10678: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9251 "configure"
+#line 10683 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -9296,7 +10728,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -9317,12 +10749,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:9321: checking if compiler understands volatile" >&5
+echo "configure:10753: checking if compiler understands volatile" >&5
 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9326 "configure"
+#line 10758 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -9331,7 +10763,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -9361,14 +10793,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:9365: checking whether byte ordering is bigendian" >&5
+echo "configure:10797: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'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 9372 "configure"
+#line 10804 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -9379,11 +10811,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:9383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10815: \"$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 9387 "configure"
+#line 10819 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -9394,7 +10826,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:9398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -9414,7 +10846,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 9418 "configure"
+#line 10850 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -9427,7 +10859,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:9431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10863: \"$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
@@ -9451,7 +10883,7 @@ EOF
 fi
 
        echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:9455: checking size of short" >&5
+echo "configure:10887: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9459,7 +10891,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 9463 "configure"
+#line 10895 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -9470,7 +10902,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:9474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -9490,7 +10922,7 @@ EOF
 
  
        echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:9494: checking size of int" >&5
+echo "configure:10926: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9498,7 +10930,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 9502 "configure"
+#line 10934 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -9509,7 +10941,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:9513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -9529,7 +10961,7 @@ EOF
 
  
        echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:9533: checking size of long" >&5
+echo "configure:10965: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9537,7 +10969,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 9541 "configure"
+#line 10973 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -9548,7 +10980,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:9552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -9567,10 +10999,14 @@ cat >> confdefs.h <<EOF
 EOF
 
 
+
+       if test "$ac_cv_sizeof_int" -lt 4 ; then
+               echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
+       fi
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:9574: checking for 8-bit clean memcmp" >&5
+echo "configure:11010: checking for 8-bit clean memcmp" >&5
 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9578,7 +11014,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9582 "configure"
+#line 11018 "configure"
 #include "confdefs.h"
 
 main()
@@ -9588,7 +11024,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:9592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11028: \"$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
@@ -9606,12 +11042,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:9610: checking for strftime" >&5
+echo "configure:11046: checking for strftime" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9615 "configure"
+#line 11051 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -9634,7 +11070,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11074: \"$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
@@ -9656,7 +11092,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:9660: checking for strftime in -lintl" >&5
+echo "configure:11096: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9664,7 +11100,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9668 "configure"
+#line 11104 "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
@@ -9675,7 +11111,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:9679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11115: \"$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
 
+
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:9706: checking for vprintf" >&5
+echo "configure:11143: checking for vprintf" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9711 "configure"
+#line 11148 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -9730,7 +11167,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11171: \"$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:9758: checking for _doprnt" >&5
+echo "configure:11195: checking for _doprnt" >&5
 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9763 "configure"
+#line 11200 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -9782,7 +11219,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11223: \"$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
@@ -9811,12 +11248,12 @@ if test $ac_cv_func_vprintf = yes ; then
                for ac_func in vsnprintf vsprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9815: checking for $ac_func" >&5
+echo "configure:11252: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9820 "configure"
+#line 11257 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9839,7 +11276,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9843: \"$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"
 else
 
 for ac_func in \
        bcopy                   \
+       closesocket             \
+       endgrent                \
+       endpwent                \
        flock                   \
-       getdtablesize           \
+       getdtablesize   \
+       getgrgid                \
        gethostname             \
        getpass                 \
        getpwuid                \
-       gettimeofday            \
+       gettimeofday    \
+       initgroups              \
        lockf                   \
        memcpy                  \
        memmove                 \
        mkstemp                 \
-       select                  \
+       recv                    \
+       recvfrom                \
        setpwfile               \
+       setgid                  \
+       setegid                 \
        setsid                  \
+       setuid                  \
+       seteuid                 \
        signal                  \
        sigset                  \
        snprintf                \
-       socket                  \
        strdup                  \
        strerror                \
        strpbrk                 \
@@ -9895,15 +11341,16 @@ for ac_func in \
        strspn                  \
        sysconf                 \
        waitpid                 \
+       wait4                   \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9902: checking for $ac_func" >&5
+echo "configure:11349: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9907 "configure"
+#line 11354 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9926,7 +11373,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11377: \"$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
@@ -9954,12 +11401,12 @@ done
 for ac_func in getopt tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9958: checking for $ac_func" >&5
+echo "configure:11405: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9963 "configure"
+#line 11410 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9982,7 +11429,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11433: \"$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
@@ -10012,13 +11459,13 @@ done
 # Check Configuration
 
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:10016: checking declaration of sys_errlist" >&5
+echo "configure:11463: checking declaration of sys_errlist" >&5
 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 10022 "configure"
+#line 11469 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -10028,7 +11475,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:10032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
 else
@@ -10048,20 +11495,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then
 EOF
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:10052: checking existence of sys_errlist" >&5
+echo "configure:11499: checking existence of sys_errlist" >&5
        if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 10058 "configure"
+#line 11505 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:10065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11512: \"$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
@@ -10164,6 +11611,14 @@ EOF
 
 fi
 
+if test "$ol_link_modules" != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_MODULES 1
+EOF
+
+       BUILD_SLAPD=yes
+fi
+
 if test "$ol_link_bdb2" != no ; then
        cat >> confdefs.h <<\EOF
 #define SLAPD_BDB2 1
@@ -10173,6 +11628,15 @@ EOF
        BUILD_BDB2=yes
 fi
 
+if test "$ol_enable_ldap" != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_LDAP 1
+EOF
+
+       BUILD_SLAPD=yes
+       BUILD_LDAP=yes
+fi
+
 if test "$ol_link_ldbm" != no ; then
        cat >> confdefs.h <<\EOF
 #define SLAPD_LDBM 1
@@ -10191,7 +11655,7 @@ EOF
        BUILD_PASSWD=yes
 fi
 
-if test "$ol_enable_perl" != no ; then
+if test "$ol_link_perl" != no ; then
        cat >> confdefs.h <<\EOF
 #define SLAPD_PERL 1
 EOF
   
   
   
+  
+
+
+
 
 
 
 
 
 trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 2>&1` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
-else
-  if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
-fi
-rm -f confcache
 
 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
 
@@ -10385,6 +11807,7 @@ servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
+servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
@@ -10397,6 +11820,7 @@ tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
+contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
@@ -10447,8 +11871,8 @@ s%@host_alias@%$host_alias%g
 s%@host_cpu@%$host_cpu%g
 s%@host_vendor@%$host_vendor%g
 s%@host_os@%$host_os%g
-s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
+s%@RANLIB@%$RANLIB%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -10458,15 +11882,19 @@ s%@LN_H@%$LN_H%g
 s%@SENDMAIL@%$SENDMAIL%g
 s%@EDITOR@%$EDITOR%g
 s%@FINGER@%$FINGER%g
+s%@GLIBCONFIG@%$GLIBCONFIG%g
 s%@PERLBIN@%$PERLBIN%g
 s%@CPP@%$CPP%g
 s%@EXEEXT@%$EXEEXT%g
 s%@OBJEXT@%$OBJEXT%g
+s%@OL_MKDEP@%$OL_MKDEP%g
+s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
 s%@PEPSY@%$PEPSY%g
 s%@LIBOBJS@%$LIBOBJS%g
 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
 s%@BUILD_BDB2@%$BUILD_BDB2%g
+s%@BUILD_LDAP@%$BUILD_LDAP%g
 s%@BUILD_LDBM@%$BUILD_LDBM%g
 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
 s%@BUILD_PERL@%$BUILD_PERL%g
@@ -10480,6 +11908,8 @@ s%@SLURPD_LIBS@%$SLURPD_LIBS%g
 s%@LDBM_LIBS@%$LDBM_LIBS%g
 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
+s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
+s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
 s%@KRB_LIBS@%$KRB_LIBS%g
@@ -10556,6 +11986,7 @@ servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
+servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
@@ -10568,6 +11999,7 @@ tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
+contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
 "}
 EOF
 cat >> $CONFIG_STATUS <<\EOF