]> git.sur5r.net Git - openldap/blobdiff - configure
Minor fixes for Linux
[openldap] / configure
index 2178735689bbcf2ed59f3877f905d088bb35cd78..931c2eefe9c68ca1f3f329aa44be3de7c82fc189 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,8 +14,6 @@ ac_default_prefix=/usr/local
 ac_default_prefix=/usr/local
 ac_help="$ac_help
   --enable-debug       enable debugging (yes)"
-ac_help="$ac_help
-  --enable-syslog      enable syslog support (no)"
 ac_help="$ac_help
   --enable-libui       enable library user interface (yes)"
 ac_help="$ac_help
@@ -25,49 +23,43 @@ ac_help="$ac_help
 ac_help="$ac_help
   --enable-referrals   enable referrals (yes)"
 ac_help="$ac_help
-  --enable-clapd       enable connectionless ldap (no)"
+  --enable-cldap       enable connectionless ldap (no)"
 ac_help="$ac_help
-  --with-kerberos      use Kerberos (no)"
+  --with-kerberos      use Kerberos (auto)"
 ac_help="$ac_help
-  --with-kerberos-afs  use AFS Kerberos (no)"
+  --with-threads       use threads (auto)"
 ac_help="$ac_help
-  --with-threads       use threads (yes)"
+  --with-preemptive    thread implementation is preemptive (auto)"
 ac_help="$ac_help
   --enable-ldapd       enable building ldapd (no)"
 ac_help="$ac_help
   --enable-slapd       enable building slapd (yes)"
 ac_help="$ac_help
-    --enable-aclgroup  enable ACL group support (yes)"
+    --enable-aclgroup  enable ACL group support (auto)"
 ac_help="$ac_help
-    --enable-crypt     enable crypt(3) passwords (yes)"
+    --enable-crypt     enable crypt(3) passwords (auto)"
 ac_help="$ac_help
-    --enable-md5       enable MD5 passwords (yes)"
+    --enable-md5       enable MD5 passwords (auto)"
 ac_help="$ac_help
-    --enable-sha1      enable SHA1 passwords (yes)"
+    --enable-sha1      enable SHA1 passwords (auto)"
 ac_help="$ac_help
     --enable-wrappers  enable tcp wrapper support (no)"
 ac_help="$ac_help
-    --enable-phonetic  enable phonetic/soundex  (no)"
+    --enable-phonetic  enable phonetic/soundex (no)"
 ac_help="$ac_help
-    --enable-rlookups  enable reverse lookups (yes)"
+    --enable-rlookups  enable reverse lookups (auto)"
 ac_help="$ac_help
     --enable-ldbm      enable ldbm backend (yes)"
 ac_help="$ac_help
-    --enable-passwd    enable passwd backend (yes)"
-ac_help="$ac_help
-    --enable-shell     enable shell backend (yes)"
-ac_help="$ac_help
-    --with-ndbm                use NDB for LDBM backend (any)"
-ac_help="$ac_help
-    --with-gdbm                use GDBM for LDBM backend (any)"
+      --with-ldbm-api  use LDBM API (auto)"
 ac_help="$ac_help
-    --with-dbhash      use Berkeley DB Hash for LDBM backend (any)"
+      --with-ldbm-type use LDBM type (auto)"
 ac_help="$ac_help
-    --with-dbbtree     use Berkeley DB Btrees for LDBM backend (any)"
+    --enable-passwd    enable passwd backend (no)"
 ac_help="$ac_help
-    --with-db2         use Berkeley DB2 API (any)"
+    --enable-shell     enable shell backend (no)"
 ac_help="$ac_help
-  --enable-slurpd      enable building slurpd (yes)"
+  --enable-slurpd      enable building slurpd (auto)"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -594,504 +586,873 @@ 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.
 
-echo $ac_n "checking arguments""... $ac_c" 1>&6
-echo "configure:599: checking arguments" >&5
+echo $ac_n "checking configure arguments""... $ac_c" 1>&6
+echo "configure:591: checking configure arguments" >&5
 
 
-# Check whether --enable-debug or --disable-debug was given.
+# OpenLDAP --enable-debug
+       # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       LDAP_DEBUG=no 
-  else
-    LDAP_DEBUG=yes
-  fi
-else
-  enableval=yes 
-  LDAP_DEBUG=yes
   
-fi
-# Check whether --enable-syslog or --disable-syslog was given.
-if test "${enable_syslog+set}" = set; then
-  enableval="$enable_syslog"
-  test "$enableval" != yes && enableval=no
-  if test "$enableval" != "no" ; then
-    
-       LDAP_CLDAP=yes 
-  else
-    LDAP_CLDAP=no
-  fi
+       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-debug" 1>&2; exit 1; }
+       fi
+       ol_enable_debug="$ol_arg"
+
 else
-  enableval=no 
-  LDAP_CLDAP=no
-  
+       ol_enable_debug="yes"
 fi
-# Check whether --enable-libui or --disable-libui was given.
+# end --enable-debug
+# OpenLDAP --enable-libui
+       # Check whether --enable-libui or --disable-libui was given.
 if test "${enable_libui+set}" = set; then
   enableval="$enable_libui"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       LDAP_LIBUI=no 
-  else
-    LDAP_LIBUI=yes
-  fi
-else
-  enableval=yes 
-  LDAP_LIBUI=yes
   
+       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-libui" 1>&2; exit 1; }
+       fi
+       ol_enable_libui="$ol_arg"
+
+else
+       ol_enable_libui="yes"
 fi
-# Check whether --enable-cache or --disable-cache was given.
+# end --enable-libui
+# OpenLDAP --enable-cache
+       # Check whether --enable-cache or --disable-cache was given.
 if test "${enable_cache+set}" = set; then
   enableval="$enable_cache"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       LDAP_CACHE=no 
-  else
-    LDAP_CACHE=yes
-  fi
-else
-  enableval=yes 
-  LDAP_CACHE=yes
   
+       ol_arg=invalid
+       for ol_val in auto yes no ; do
+               if test "$enableval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
+       fi
+       ol_enable_cache="$ol_arg"
+
+else
+       ol_enable_cache="yes"
 fi
-# Check whether --enable-dns or --disable-dns was given.
+# end --enable-cache
+# OpenLDAP --enable-dns
+       # Check whether --enable-dns or --disable-dns was given.
 if test "${enable_dns+set}" = set; then
   enableval="$enable_dns"
-  test "$enableval" != yes && enableval=no
-  if test "$enableval" != "no" ; then
-    
-       LDAP_DNS=yes 
-  else
-    LDAP_DNS=no
-  fi
-else
-  enableval=no 
-  LDAP_DNS=no
   
+       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-dns" 1>&2; exit 1; }
+       fi
+       ol_enable_dns="$ol_arg"
+
+else
+       ol_enable_dns="no"
 fi
-# Check whether --enable-referrals or --disable-referrals was given.
+# end --enable-dns
+# OpenLDAP --enable-referrals
+       # Check whether --enable-referrals or --disable-referrals was given.
 if test "${enable_referrals+set}" = set; then
   enableval="$enable_referrals"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       LDAP_REFERRALS=no 
-  else
-    LDAP_REFERRALS=yes
-  fi
-else
-  enableval=yes 
-  LDAP_REFERRALS=yes
   
-fi
+       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-referrals" 1>&2; exit 1; }
+       fi
+       ol_enable_referrals="$ol_arg"
 
-# Check whether --enable-cldap or --disable-cldap was given.
+else
+       ol_enable_referrals="yes"
+fi
+# end --enable-referrals
+# OpenLDAP --enable-cldap
+       # Check whether --enable-cldap or --disable-cldap was given.
 if test "${enable_cldap+set}" = set; then
   enableval="$enable_cldap"
-  test "$enableval" != yes && enableval=no
-  if test "$enableval" != "no" ; then
-    
-       LDAP_CLDAP=yes 
-  else
-    LDAP_CLDAP=no
-  fi
-else
-  enableval=no 
-  LDAP_CLDAP=no
   
+       ol_arg=invalid
+       for ol_val in auto yes no ; do
+               if test "$enableval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
+       fi
+       ol_enable_cldap="$ol_arg"
+
+else
+       ol_enable_cldap="no"
 fi
+# end --enable-cldap
 
-# Check whether --with-kerberos or --without-kerberos was given.
+# OpenLDAP --with-kerberos
+       # Check whether --with-kerberos or --without-kerberos was given.
 if test "${with_kerberos+set}" = set; then
   withval="$with_kerberos"
   
-       opt_kerberos=yes
+       ol_arg=invalid
+       for ol_val in auto k5 k4 afs yes no ; do
+               if test "$withval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
+       fi
+       ol_with_kerberos="$ol_arg"
+
 else
-  opt_kerberos=no
+       ol_with_kerberos="auto"
 fi
+# end --with-kerberos
 
-# Check whether --with-kerberos-afs or --without-kerberos-afs was given.
-if test "${with_kerberos_afs+set}" = set; then
-  withval="$with_kerberos_afs"
+# OpenLDAP --with-threads
+       # Check whether --with-threads or --without-threads was given.
+if test "${with_threads+set}" = set; then
+  withval="$with_threads"
   
-       opt_kerberos_afs=yes
+       ol_arg=invalid
+       for ol_val in auto posix mach lwp yes no manual  ; do
+               if test "$withval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
+       fi
+       ol_with_threads="$ol_arg"
+
 else
-  opt_kerberos_afs=no
+       ol_with_threads="auto"
 fi
+# end --with-threads
 
-# Check whether --with-threads or --without-threads was given.
-if test "${with_threads+set}" = set; then
-  withval="$with_threads"
+# OpenLDAP --with-preemptive
+       # Check whether --with-preemptive or --without-preemptive was given.
+if test "${with_preemptive+set}" = set; then
+  withval="$with_preemptive"
   
-       opt_threads=yes
+       ol_arg=invalid
+       for ol_val in auto yes no manual  ; do
+               if test "$withval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $withval for --with-preemptive" 1>&2; exit 1; }
+       fi
+       ol_with_preemptive="$ol_arg"
+
 else
-  opt_threads=no
+       ol_with_preemptive="auto"
 fi
+# end --with-preemptive
 
 
 
-# Check whether --enable-ldapd or --disable-ldapd was given.
+# OpenLDAP --enable-ldapd
+       # Check whether --enable-ldapd or --disable-ldapd was given.
 if test "${enable_ldapd+set}" = set; then
   enableval="$enable_ldapd"
-  test "$enableval" != yes && enableval=no
-  if test "$enableval" != "no" ; then
-    
-       BUILD_LDAPD=yes 
-  else
-    BUILD_LDAPD=no
-  fi
-else
-  enableval=no 
-  BUILD_LDAPD=no
   
+       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-ldapd" 1>&2; exit 1; }
+       fi
+       ol_enable_ldapd="$ol_arg"
+
+else
+       ol_enable_ldapd="no"
 fi
+# end --enable-ldapd
 
-# Check whether --enable-slapd or --disable-slapd was given.
+# OpenLDAP --enable-slapd
+       # Check whether --enable-slapd or --disable-slapd was given.
 if test "${enable_slapd+set}" = set; then
   enableval="$enable_slapd"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       BUILD_SLAPD=no 
-  else
-    BUILD_SLAPD=yes
-  fi
-else
-  enableval=yes 
-  BUILD_SLAPD=yes
   
+       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-slapd" 1>&2; exit 1; }
+       fi
+       ol_enable_slapd="$ol_arg"
+
+else
+       ol_enable_slapd="yes"
 fi
-# Check whether --enable-aclgroup or --disable-aclgroup was given.
+# end --enable-slapd
+# OpenLDAP --enable-aclgroup
+       # Check whether --enable-aclgroup or --disable-aclgroup was given.
 if test "${enable_aclgroup+set}" = set; then
   enableval="$enable_aclgroup"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       SLAPD_ACLGROUP=no 
-  else
-    SLAPD_ALCGROUP=yes
-  fi
-else
-  enableval=yes 
-  SLAPD_ALCGROUP=yes
   
+       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-aclgroup" 1>&2; exit 1; }
+       fi
+       ol_enable_aclgroup="$ol_arg"
+
+else
+       ol_enable_aclgroup="auto"
 fi
-# Check whether --enable-crypt or --disable-crypt was given.
+# end --enable-aclgroup
+# OpenLDAP --enable-crypt
+       # Check whether --enable-crypt or --disable-crypt was given.
 if test "${enable_crypt+set}" = set; then
   enableval="$enable_crypt"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       SLAPD_CRYPT=no 
-  else
-    SLAPD_CRYPT=yes
-  fi
-else
-  enableval=yes 
-  SLAPD_CRYPT=yes
   
+       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-crypt" 1>&2; exit 1; }
+       fi
+       ol_enable_crypt="$ol_arg"
+
+else
+       ol_enable_crypt="auto"
 fi
-# Check whether --enable-md5 or --disable-md5 was given.
+# end --enable-crypt
+# OpenLDAP --enable-md5
+       # Check whether --enable-md5 or --disable-md5 was given.
 if test "${enable_md5+set}" = set; then
   enableval="$enable_md5"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       SLAPD_MD5=no 
-  else
-    SLAPD_MD5=yes
-  fi
-else
-  enableval=yes 
-  SLAPD_MD5=yes
   
+       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-md5" 1>&2; exit 1; }
+       fi
+       ol_enable_md5="$ol_arg"
+
+else
+       ol_enable_md5="auto"
 fi
-# Check whether --enable-sha1 or --disable-sha1 was given.
+# end --enable-md5
+# OpenLDAP --enable-sha1
+       # Check whether --enable-sha1 or --disable-sha1 was given.
 if test "${enable_sha1+set}" = set; then
   enableval="$enable_sha1"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       SLAPD_SHA1=no 
-  else
-    SLAPD_SHA1=yes
-  fi
-else
-  enableval=yes 
-  SLAPD_SHA1=yes
   
+       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-sha1" 1>&2; exit 1; }
+       fi
+       ol_enable_sha1="$ol_arg"
+
+else
+       ol_enable_sha1="auto"
 fi
-# Check whether --enable-wrappers or --disable-wrappers was given.
+# end --enable-sha1
+# OpenLDAP --enable-wrappers
+       # Check whether --enable-wrappers or --disable-wrappers was given.
 if test "${enable_wrappers+set}" = set; then
   enableval="$enable_wrappers"
-  test "$enableval" != yes && enableval=no
-  if test "$enableval" != "no" ; then
-    
-       SLAPD_TCP_WRAPPERS=yes 
-  else
-    SLAPD_TCP_WRAPPERS=no
-  fi
-else
-  enableval=no 
-  SLAPD_TCP_WRAPPERS=no
   
+       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
-# Check whether --enable-phonetic or --disable-phonetic was given.
+# end --enable-wrappers
+# OpenLDAP --enable-phonetic
+       # Check whether --enable-phonetic or --disable-phonetic was given.
 if test "${enable_phonetic+set}" = set; then
   enableval="$enable_phonetic"
-  test "$enableval" != yes && enableval=no
-  if test "$enableval" != "no" ; then
-    
-       SLAPD_PHONETIC=yes 
-  else
-    SLAPD_PHONETIC=no
-  fi
-else
-  enableval=no 
-  SLAPD_PHONETIC=no
   
+       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-phonetic" 1>&2; exit 1; }
+       fi
+       ol_enable_phonetic="$ol_arg"
+
+else
+       ol_enable_phonetic="no"
 fi
-# Check whether --enable-rlookups or --disable-rlookups was given.
+# end --enable-phonetic
+# OpenLDAP --enable-rlookups
+       # Check whether --enable-rlookups or --disable-rlookups was given.
 if test "${enable_rlookups+set}" = set; then
   enableval="$enable_rlookups"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       SLAPD_RLOOKUP=no 
-  else
-    SLAPD_RLOOKUP=yes
-  fi
-else
-  enableval=yes 
-  SLAPD_RLOOKUP=yes
   
+       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-rlookups" 1>&2; exit 1; }
+       fi
+       ol_enable_rlookups="$ol_arg"
+
+else
+       ol_enable_rlookups="auto"
 fi
+# end --enable-rlookups
 
-# Check whether --enable-ldbm or --disable-ldbm was given.
+# OpenLDAP --enable-ldbm
+       # Check whether --enable-ldbm or --disable-ldbm was given.
 if test "${enable_ldbm+set}" = set; then
   enableval="$enable_ldbm"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       SLAPD_LDBM=no 
-  else
-    SLAPD_LDBM=yes
-  fi
-else
-  enableval=yes 
-  SLAPD_LDBM=yes
   
-fi
-# Check whether --enable-passwd or --disable-passwd was given.
-if test "${enable_passwd+set}" = set; then
-  enableval="$enable_passwd"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       SLAPD_PASSWD=no 
-  else
-    SLAPD_PASSWD=yes
-  fi
+       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-ldbm" 1>&2; exit 1; }
+       fi
+       ol_enable_ldbm="$ol_arg"
+
 else
-  enableval=yes 
-  SLAPD_PASSWD=yes
-  
+       ol_enable_ldbm="yes"
 fi
-# Check whether --enable-shell or --disable-shell was given.
-if test "${enable_shell+set}" = set; then
-  enableval="$enable_shell"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       SLAPD_SHELL=no 
-  else
-    SLAPD_SHELL=yes
-  fi
-else
-  enableval=yes 
-  SLAPD_SHELL=yes
+# end --enable-ldbm
+# OpenLDAP --with-ldbm_api
+       # Check whether --with-ldbm_api or --without-ldbm_api was given.
+if test "${with_ldbm_api+set}" = set; then
+  withval="$with_ldbm_api"
   
-fi
+       ol_arg=invalid
+       for ol_val in auto db2 db gdbm ndbm manual ; do
+               if test "$withval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
+       fi
+       ol_with_ldbm_api="$ol_arg"
 
-# Check whether --with-ndbm or --without-ndbm was given.
-if test "${with_ndbm+set}" = set; then
-  withval="$with_ndbm"
-  
-       opt_ndbm=yes
 else
-  opt_ndbm=no
+       ol_with_ldbm_api="auto"
 fi
+# end --with-ldbm_api
 
-# Check whether --with-gdbm or --without-gdbm was given.
-if test "${with_gdbm+set}" = set; then
-  withval="$with_gdbm"
+# OpenLDAP --with-ldbm_type
+       # Check whether --with-ldbm_type or --without-ldbm_type was given.
+if test "${with_ldbm_type+set}" = set; then
+  withval="$with_ldbm_type"
   
-       opt_gdbm=yes
-else
-  opt_gdbm=no
-fi
+       ol_arg=invalid
+       for ol_val in auto btree hash ; do
+               if test "$withval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
+       fi
+       ol_with_ldbm_type="$ol_arg"
 
-# Check whether --with-dbhash or --without-dbhash was given.
-if test "${with_dbhash+set}" = set; then
-  withval="$with_dbhash"
-  
-       opt_dbhash=yes
 else
-  opt_dbhash=no
+       ol_with_ldbm_type="auto"
 fi
+# end --with-ldbm_type
 
-# Check whether --with-dbbtree or --without-dbbtree was given.
-if test "${with_dbbtree+set}" = set; then
-  withval="$with_dbbtree"
+
+# OpenLDAP --enable-passwd
+       # Check whether --enable-passwd or --disable-passwd was given.
+if test "${enable_passwd+set}" = set; then
+  enableval="$enable_passwd"
   
-       opt_dbbtree=yes
+       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-passwd" 1>&2; exit 1; }
+       fi
+       ol_enable_passwd="$ol_arg"
+
 else
-  opt_dbbtree=no
+       ol_enable_passwd="no"
 fi
-
-# Check whether --with-db2 or --without-db2 was given.
-if test "${with_db2+set}" = set; then
-  withval="$with_db2"
+# end --enable-passwd
+# OpenLDAP --enable-shell
+       # Check whether --enable-shell or --disable-shell was given.
+if test "${enable_shell+set}" = set; then
+  enableval="$enable_shell"
   
-       opt_db2=yes
+       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-shell" 1>&2; exit 1; }
+       fi
+       ol_enable_shell="$ol_arg"
+
 else
-  opt_db2=no
+       ol_enable_shell="no"
 fi
+# end --enable-shell
 
-
-# Check whether --enable-slurpd or --disable-slurpd was given.
+# OpenLDAP --enable-slurpd
+       # Check whether --enable-slurpd or --disable-slurpd was given.
 if test "${enable_slurpd+set}" = set; then
   enableval="$enable_slurpd"
-  test "$enableval" != no && enableval=yes
-  if test "$enableval" != "yes" ; then
-    
-       BUILD_SLURPD=no 
-  else
-    BUILD_SLURPD=yes
-  fi
-else
-  enableval=yes 
-  BUILD_SLURPD=yes
   
+       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-slurpd" 1>&2; exit 1; }
+       fi
+       ol_enable_slurpd="$ol_arg"
+
+else
+       ol_enable_slurpd="auto"
 fi
+# end --enable-slurpd
 
-echo "$ac_t""done" 1>&6
+if test $ol_enable_slapd = no ; then
+               if test $ol_enable_ldbm = yes ; then
+               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;
+       fi
+       if test $ol_enable_shell = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2;
+       fi
+       if test $ol_enable_aclgroup = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable_aclgroup argument" 1>&2;
+       fi
+       if test $ol_enable_crypt = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable_crypt argument" 1>&2;
+       fi
+       if test $ol_enable_md5 = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable_md5 argument" 1>&2;
+       fi
+       if test $ol_enable_sha1 = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable_sha1 argument" 1>&2;
+       fi
+       if test $ol_enable_wrappers = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2;
+       fi
+       if test $ol_enable_phonetic = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2;
+       fi
+       if test $ol_enable_rlookups = yes ; then
+               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;
+       fi
+       if test $ol_with_ldbm_type != auto ; then
+               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; };
+       fi
 
-echo $ac_n "checking LDBM preferences""... $ac_c" 1>&6
-echo "configure:986: checking LDBM preferences" >&5
-ldbm_prefer=any
+       # force settings to no
+       ol_enable_ldbm=no
+       ol_enable_shell=no
+       ol_enable_passwd=no
+       ol_enable_aclgroup=no
+       ol_enable_crypt=no
+       ol_enable_md5=no
+       ol_enable_sha1=no
+       ol_enable_wrappers=no
+       ol_enable_phonetic=no
+       ol_enable_rlookups=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;
+       fi
 
-if test "$opt_ndbm" = yes ; then
-       ldbm_prefer=ndbm
-fi
-if test "$opt_gdbm" = yes ; then
-       ldbm_prefer=gdbm
-fi
-if test "$opt_dbhash" = yes ; then
-       ldbm_prefer=dbhash
-fi
-if test "$opt_dbbtree" = yes ; then
-       ldbm_prefer=dbbtree
+       if test $ol_with_ldbm_type != auto ; then
+               echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2;
+       fi
+
+       if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then
+               { echo "configure: error: slapd requires a backend" 1>&2; exit 1; };
+       fi
+
+       ol_with_ldbm_api=no
+       ol_with_ldbm_type=no
+
+else
+       
+       if test $ol_with_ldbm_api = gdbm -a \
+               $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 = ndbm -a \
+               $ol_with_ldbm_type = btree ; then
+               { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; };
+       fi
 fi
-echo "$ac_t""$ldbm_prefer" 1>&6
 
-if test "$BUILD_SLAPD" != "yes" ; then
-       BUILD_SLURPD="no"
-       SLAPD_LDBM="no"
-       SLAPD_PASSWD="no"
-       SLAPD_SHELL="no"
-       ldbm_prefer="none"
+if test $ol_enable_slurpd = yes ; then
+               if test $ol_with_threads = no ; then
+               { echo "configure: error: slurpd requires threads" 1>&2; exit 1; };
+       fi
 fi
 
-## general LDAP arguments
+echo "$ac_t""done" 1>&6
+
+## Initialize vars
 LDAP_DEFS=
 LDAP_LIBS=
 LDBM_DEFS=
 LDBM_LIBS=
+LTHREAD_DEFS=
+LTHREAD_LIBS=
 LUTIL_DEFS=
 LUTIL_LIBS=
 
-if test "$LDAP_DEBUG" = "yes" ; then
-       LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
-fi
-if test "$LDAP_SYSLOG" = "yes" ; then
-       LDAP_DEFS="$LDAP_DEFS -DLDAP_SYSLOG"
-fi
-if test "$LDAP_DNS" = "yes" ; then
-       LDAP_DEFS="$LDAP_DEFS -DLDAP_DNS"
-fi
-if test "$LDAP_REFERRALS" = "yes" ; then
-       LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
-fi
-if test "$LDAP_CACHE" = "no" ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_NOCACHE 1
-EOF
-
-       LDAP_DEFS="$LDAP_DEFS -DNO_CACHE"
-fi
-if test "$LDAP_CLDAP" = "yes" ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_CONNECTIONLESS 1
-EOF
-
-       LDAP_DEFS="$LDAP_DEFS -DCLDAP"
-fi
-
-## ldapd arguments
 LDAPD_DEFS=
 LDAPD_LIBS=
-
-## slapd arguments
 SLAPD_DEFS=
 SLAPD_LIBS=
-if test "$SLAPD_PHONETIC" = "yes" ; then
-       cat >> confdefs.h <<\EOF
-#define SLAPD_PHONETIC 1
-EOF
-
-       SLAPD_DEFS="$SLAPD_DEFS -DSOUNDEX"
-fi
-
-if test "$SLAPD_MD5" = "yes" ; then
-       LUTIL_DEFS="$LUTIL_DEFS -DLDAP_MD5"
-fi
+SLURPD_DEFS=
+SLURPD_LIBS=
 
-if test "$SLAPD_SHA1" = "yes" ; then
-       LUTIL_DEFS="$LUTIL_DEFS -DLDAP_SHA1"
-fi
+BUILD_LDAPD=no
+BUILD_SLAPD=no
+BUILD_SLURPD=no
 
 BUILD_LDBM=no
-if test "$SLAPD_LDBM" = "yes" ; then
-       BUILD_LDBM=yes
-       LDBM_DEFS="$LDBM_DEFS -DLDAP_LDBM"
-fi
-if test "$SLAPD_PASSWD" = "yes" ; then
-       SLAPD_DEFS="$SLAPD_DEFS -DLDAP_PASSWD"
-fi
-if test "$SLAPD_SHELL" = "yes" ; then
-       SLAPD_DEFS="$SLAPD_DEFS -DLDAP_SHELL"
-fi
+BUILD_PASSWD=no
+BUILD_SHELL=no
 
-SLURPD_DEFS=
-SLURPD_LIBS=
+KRB_DEFS=
+KRB_LIBS=
+TERMCAP_DEFS=
+TERMCAP_LIBS=
 
 
-# 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:1088: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1212: 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
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+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:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# 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:1243: 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
+else
+    IFS="${IFS=        }"; ac_save_IFS="$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.
+      for ac_prog in ginstall installbsd 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.
+           # OSF/1 installbsd also uses dspmsg, but is usable.
+           :
+         else
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
+           break 2
+         fi
+       fi
+      done
+      ;;
+    esac
+  done
+  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_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+# 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:1295: 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
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:1322: 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
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+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:1352: 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
+  case "$SENDMAIL" in
+  /*)
+  ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc$ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
+  ;;
+esac
+fi
+SENDMAIL="$ac_cv_path_SENDMAIL"
+if test -n "$SENDMAIL"; then
+  echo "$ac_t""$SENDMAIL" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+# Extract the first word of "vi", so it can be a program name with args.
+set dummy vi; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1384: 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
+  case "$EDITOR" in
+  /*)
+  ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH:/usr/ucb$ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_EDITOR="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
+  ;;
+esac
+fi
+EDITOR="$ac_cv_path_EDITOR"
+if test -n "$EDITOR"; then
+  echo "$ac_t""$EDITOR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+# Extract the first word of "finger", so it can be a program name with args.
+set dummy finger; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1416: 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
+  case "$FINGER" in
+  /*)
+  ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH:/usr/ucb$ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_FINGER="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
+  ;;
+esac
+fi
+FINGER="$ac_cv_path_FINGER"
+if test -n "$FINGER"; then
+  echo "$ac_t""$FINGER" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+# 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:1449: 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="${IFS}:"
   for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
@@ -1113,7 +1474,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:1117: checking for $ac_word" >&5
+echo "configure:1478: 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
@@ -1161,7 +1522,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1165: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1526: 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.
@@ -1171,11 +1532,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 1175 "configure"
+#line 1536 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
@@ -1195,12 +1556,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:1199: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1560: 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:1204: checking whether we are using GNU C" >&5
+echo "configure:1565: 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
@@ -1209,7 +1570,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1213: \"$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:1574: \"$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
@@ -1224,7 +1585,7 @@ if test $ac_cv_prog_gcc = yes; then
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1228: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1589: 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
@@ -1252,7 +1613,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1256: checking how to run the C preprocessor" >&5
+echo "configure:1617: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1267,13 +1628,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 1271 "configure"
+#line 1632 "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:1277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1284,13 +1645,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1288 "configure"
+#line 1649 "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:1294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1314,13 +1675,13 @@ echo "$ac_t""$CPP" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1318: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1679: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 1324 "configure"
+#line 1685 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
@@ -1338,7 +1699,7 @@ rm -f conftest*
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 1342 "configure"
+#line 1703 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
@@ -1360,262 +1721,1772 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
 fi
 
 
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1365: 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
-  rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
-  rm -f conftestdata
-  ac_cv_prog_LN_S="ln -s"
-else
-  ac_cv_prog_LN_S=ln
-fi
-fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
-  echo "$ac_t""yes" 1>&6
+echo $ac_n "checking for AIX""... $ac_c" 1>&6
+echo "configure:1726: checking for AIX" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1728 "configure"
+#include "confdefs.h"
+#ifdef _AIX
+  yes
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define _ALL_SOURCE 1
+EOF
+
 else
+  rm -rf conftest*
   echo "$ac_t""no" 1>&6
 fi
+rm -f conftest*
 
-# 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
-# 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:1396: 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 "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:1750: 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
+  echo "$ac_t""yes" 1>&6
+  ISC=yes # If later tests want to check for ISC.
+  cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+  if test "$GCC" = yes; then
+    CC="$CC -posix"
+  else
+    CC="$CC -Xp"
+  fi
+else
+  echo "$ac_t""no" 1>&6
+  ISC=
+fi
+
+ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
+echo "configure:1772: 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 1777 "configure"
+#include "confdefs.h"
+#include <minix/config.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+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
+  MINIX=yes
+else
+  echo "$ac_t""no" 1>&6
+MINIX=
+fi
+
+if test "$MINIX" = yes; then
+  cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+  cat >> confdefs.h <<\EOF
+#define _POSIX_1_SOURCE 2
+EOF
+
+  cat >> confdefs.h <<\EOF
+#define _MINIX 1
+EOF
+
+fi
+
+
+
+
+echo $ac_n "checking for socket""... $ac_c" 1>&6
+echo "configure:1823: 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 1828 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char socket(); 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 socket();
+
+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_socket) || defined (__stub___socket)
+choke me
+#else
+socket();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_socket=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_socket=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+       
+       echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
+echo "configure:1870: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lsocket  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1878 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:1885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lsocket $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
+echo "configure:1913: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lnet  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1921 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:1928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 main in -lnsl_s""... $ac_c" 1>&6
+echo "configure:1956: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lnsl_s  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1964 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:1971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lnsl_s $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
+echo "configure:1999: 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 2007 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
+
+       echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
+echo "configure:2042: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-linet  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2050 "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:2061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-linet $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+       echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
+echo "configure:2089: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lgen  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2097 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lgen $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+fi
+
+
+echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
+echo "configure:2136: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lV3  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2144 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char sigset();
+
+int main() {
+sigset()
+; return 0; }
+EOF
+if { (eval echo configure:2155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lV3 $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
+       for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2188: 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 2193 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+       if test $ac_cv_header_kerberosIV_krb_h = yes ; then
+               echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
+echo "configure:2227: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2235 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_k5=yes
+else
+  echo "$ac_t""no" 1>&6
+have_k5=no
+fi
+
+
+               if test $have_k5 = yes ; then
+                       ol_with_kerberos=found
+                       ol_link_kerberos=yes
+
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KERBEROS 1
+EOF
+
+
+                       KRB_DEFS="-DKERBEROS"
+                       KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
+               fi
+       fi
+fi
+if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
+       for ac_hdr in krb.h des.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2283: 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 2288 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+       if test $ac_cv_header_krb_h = yes ; then
+               echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
+echo "configure:2322: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lkrb -ldes $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2330 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_k4=yes
+else
+  echo "$ac_t""no" 1>&6
+have_k4=no
+fi
+
+
+               if test $have_k4 = yes ; then
+                       ol_with_kerberos=found
+                       ol_link_kerberos=yes
+
+                       cat >> confdefs.h <<\EOF
+#define HAVE_KERBEROS 1
+EOF
+
+
+                       KRB_DEFS="-DKERBEROS"
+                       KRB_LIBS="-lkrb -ldes"
+               fi
+       fi
+fi
+
+
+ol_link_threads=no
+if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
+       for ac_hdr in pthread.h sched.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2381: 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 2386 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+       if test $ac_cv_header_pthread_h = yes ; then
+               echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
+echo "configure:2420: 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 2426 "configure"
+#include "confdefs.h"
+
+#              include <pthread.h>
+               /* this check could be improved */
+#              ifdef PTHREAD_ONCE_INIT
+                       final
+#              endif
+       
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "final" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_pthread_final=yes
+else
+  rm -rf conftest*
+  ol_pthread_final=no
+fi
+rm -f conftest*
+
+
+       cat > conftest.$ac_ext <<EOF
+#line 2448 "configure"
+#include "confdefs.h"
+
+#              include <pthread.h>
+               /* this check could be improved */
+#              ifdef pthread_once_init
+                       draft4
+#              endif
+       
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "draft4" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_pthread_draft4=yes
+else
+  rm -rf conftest*
+  ol_pthread_draft4=no
+fi
+rm -f conftest*
+
+
+       if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
+               ol_cv_pthread_version=final
+       elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
+               ol_cv_pthread_version=draft4
+       else
+               ol_cv_pthread_version=unknown
+       fi
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_version" 1>&6
+
+
+               if test $ol_cv_pthread_version = final ; then
+                       LTHREAD_DEFS="$LTHREAD_DEFS -DPOSIX_THREADS"
+               elif test $ol_cv_pthread_version = draft4 ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_PTHREADS_D4 1
+EOF
+
+                       LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_MIT_PTHREADS"
+               else
+                       { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
+               fi
+
+               # consider threads found
+               ol_with_threads=found
+
+               
+echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
+echo "configure:2499: checking for LinuxThreads" >&5
+if eval "test \"`echo '$''{'ol_cv_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
+
+fi
+
+echo "$ac_t""$ol_cv_linux_threads" 1>&6
+
+
+               if test $ol_cv_linux_threads = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_LINUX_THREADS 1
+EOF
+
+                       LTHREAD_DEFS="$LTHREAD_DEFS -DLINUX_THREADS"
+               fi
+
+               
+                               echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
+echo "configure:2526: checking for pthread_create" >&5
+if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2531 "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() {
+
+/* 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
+#else
+pthread_create();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 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
+
+
+               if test $ol_link_threads = no ; then
+                                               echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
+echo "configure:2576: checking for pthread_create with -pthread" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+                                                               save_LIBS="$LIBS"
+                               LIBS="-pthread $LIBS"
+                               cat > conftest.$ac_ext <<EOF
+#line 2584 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+int main() {
+
+                                       pthread_create((pthread_t*) 0,
+                                               (pthread_attr_t*) 0, 0, 0);
+                                       
+; return 0; }
+EOF
+if { (eval echo configure:2594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  ol_cv_pthread_flag=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_pthread_flag=no
+fi
+rm -f conftest*
+                                                               LIBS="$save_LIBS"
+                       
+fi
+
+echo "$ac_t""$ol_cv_pthread_flag" 1>&6
+
+                       if test $ol_cv_pthread_flag = yes ; then
+                               LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
+                               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:2619: 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
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpthread  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2627 "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();
+
+int main() {
+pthread_create()
+; return 0; }
+EOF
+if { (eval echo configure:2638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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_threads=posix
+                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+                       LIBS="$save_LIBS"
+               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:2666: 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
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lc_r  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2674 "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();
+
+int main() {
+pthread_create()
+; return 0; }
+EOF
+if { (eval echo configure:2685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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_threads=posix
+                               LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+                       LIBS="$save_LIBS"
+               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:2713: 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
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lpthread if test $with_preemptive = auto ; then
+                                       ol_with_preemptive=yes
+                               fi
+                               -lmach -lexc -lc $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2724 "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();
+
+int main() {
+pthread_create()
+; return 0; }
+EOF
+if { (eval echo configure:2735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
+  
+                               cat >> confdefs.h <<\EOF
+#define HAVE_DCE 1
+EOF
+
+                               ol_link_threads=posix
+                               LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_DCE_THREADS"
+                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+                       LIBS="$save_LIBS"
+               fi
+
+               if test $ol_link_threads != no ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_PTHREADS 1
+EOF
+
+
+                                               save_CPPFLAGS="$CPPFLAGS"
+                       save_LIBS="$LIBS"
+                       CPPFLAGS="$LTHREAD_DEFS $CPPFLAGS"
+                       LIBS="$LTHREAD_LIBS $LIBS"
+
+                                                                                               for ac_func in sched_yield pthread_yield
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2779: 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 2784 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+                       if test $ac_cv_func_sched_yield = no -a \
+                               $ac_cv_func_pthread_yield = no ; then
+
+                               echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
+                               { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; }
+                       fi
+
+                                               for ac_func in pthread_kill
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2842: 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 2847 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+                                               if test $ol_with_preemptive = auto ; then
+                               echo $ac_n "checking for preemptive Pthread implementation""... $ac_c" 1>&6
+echo "configure:2897: checking for preemptive Pthread implementation" >&5
+                               if test "$cross_compiling" = yes; then
+  
+                               { echo "configure: error: crossing compiling: use --with-preemptive=yes|no|manual" 1>&2; exit 1; }
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2903 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+#ifndef NULL
+#define NULL 0
+#endif
+
+int task(arg)
+       int *arg;
+{
+       struct timeval tv;
+
+       tv.tv_sec=4;
+       tv.tv_usec=0;
+       select(0, NULL, NULL, NULL, &tv);
+
+       tv.tv_sec=6;
+       tv.tv_usec=0;
+       select(0, NULL, NULL, NULL, &tv);
+
+       exit(1); /* if we exit here, the select blocked the whole process */
+}
+
+main(argc, argv)
+int argc; char **argv;
+{
+       pthread_t t;
+       pthread_create(&t, NULL, (void *) task, NULL);
+
+#if HAVE_SCHED_YIELD
+       sched_yield();  /* make sure task runs first */
+#else
+#if defined(HAVE_PTHREAD_YIELD)
+       pthread_yield();        /* make sure task runs first */
+#endif
+#endif
+       exit(0);
+}
+                               
+EOF
+if { (eval echo configure:2947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  ol_pthread_preemptive=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_pthread_preemptive=no
+fi
+rm -fr conftest*
+fi
+
+                               echo "$ac_t""$ol_pthread_preemptive" 1>&6
+
+                               if test $ol_pthread_preemptive = yes ; then
+                                       cat >> confdefs.h <<\EOF
+#define HAVE_PREEMPTIVE_PTHREADS 1
+EOF
+
+                                       ol_with_preemptive=yes
+                               fi
+                       fi
+
+                                               CPPFLAGS="$save_CPPFLAGS"
+                       LIBS="$save_LIBS"
+               else
+                       { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
+               fi
+       fi
+
+       if test $ol_with_threads = posix ; then
+               { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
+       fi
+fi
+
+if test $ol_with_threads = auto -o $ol_with_threads = cthreads ; then
+               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:2987: 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
-    IFS="${IFS=        }"; ac_save_IFS="$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.
-      for ac_prog in ginstall installbsd 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.
-           # OSF/1 installbsd also uses dspmsg, but is usable.
-           :
-         else
-           ac_cv_path_install="$ac_dir/$ac_prog -c"
-           break 2
-         fi
+  cat > conftest.$ac_ext <<EOF
+#line 2992 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+       if test $ac_cv_header_lwp_lwp_h = yes ; then
+               echo $ac_n "checking for cthread_fork in -llwp""... $ac_c" 1>&6
+echo "configure:3025: checking for cthread_fork in -llwp" >&5
+ac_lib_var=`echo lwp'_'cthread_fork | 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="-llwp  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3033 "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 cthread_fork();
+
+int main() {
+cthread_fork()
+; return 0; }
+EOF
+if { (eval echo configure:3044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_cthreads=yes
+else
+  echo "$ac_t""no" 1>&6
+have_cthreads=no
+fi
+
+
+               if test $have_cthreads = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_CTHREADS 1
+EOF
+
+                       LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_NEXT_CTHREADS"
+                       LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+               fi
        fi
-      done
-      ;;
-    esac
-  done
-  IFS="$ac_save_IFS"
+fi
 
+if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
+               for ac_hdr in thread.h synch.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3082: 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 3087 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+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
-  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
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+       if test $ac_cv_header_lwp_lwp_h = yes ; then
+               echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
+echo "configure:3120: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lthread  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3128 "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 thr_create();
+
+int main() {
+thr_create()
+; return 0; }
+EOF
+if { (eval echo configure:3139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_lwp=yes
+else
+  echo "$ac_t""no" 1>&6
+have_lwp=no
+fi
+
+
+               if test $have_lwp = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_LWP 1
+EOF
+
+                       cat >> confdefs.h <<\EOF
+#define HAVE_LWP_THR 1
+EOF
+
+                       LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_SUNOS5_LWP"
+                       LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+               fi
+       fi
+
+               for ac_hdr in lwp/lwp.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3179: 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 3184 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+       if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
+               echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
+echo "configure:3217: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-llwp  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3225 "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 lwp_create();
+
+int main() {
+lwp_create()
+; return 0; }
+EOF
+if { (eval echo configure:3236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_lwp=yes
+else
+  echo "$ac_t""no" 1>&6
+have_lwp=no
+fi
+
+
+               if test $have_lwp = yes ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_LWP 1
+EOF
+
+                       LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_SUNOS4_LWP"
+                       LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+
+                       if test $with_preemptive = auto ; then
+                               with_preemptive=yes
+                       fi
+               fi
+       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}'
+if test $ol_with_preemptive = yes ; then
+       LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_PREEMPTIVE"
+fi
 
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+if test $ol_with_threads = manual ; then
+               $ol_link_threads=yes
 
-# 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:1448: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+       echo "configure: warning: thread defines and link options must be set manually" 1>&2
+
+       for ac_hdr in pthread.h sched.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3286: 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
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+  cat > conftest.$ac_ext <<EOF
+#line 3291 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_RANLIB="ranlib"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+  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
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
-  echo "$ac_t""$RANLIB" 1>&6
+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
 
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1475: 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
+       for ac_func in sched_yield pthread_yield
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3325: 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 > conftestmake <<\EOF
-all:
-       @echo 'ac_maketemp="${MAKE}"'
+  cat > conftest.$ac_ext <<EOF
+#line 3330 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
 EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
+if { (eval echo configure:3353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
 else
-  eval ac_cv_prog_make_${ac_make}_set=no
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
 fi
-rm -f conftestmake
+rm -f conftest*
 fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  SET_MAKE=
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
 else
   echo "$ac_t""no" 1>&6
-  SET_MAKE="MAKE=${MAKE-make}"
 fi
+done
 
-
-# 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:1505: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
+       
+echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
+echo "configure:3379: checking for LinuxThreads" >&5
+if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  case "$SENDMAIL" in
-  /*)
-  ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc$ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
-  ;;
-esac
-fi
-SENDMAIL="$ac_cv_path_SENDMAIL"
-if test -n "$SENDMAIL"; then
-  echo "$ac_t""$SENDMAIL" 1>&6
-else
-  echo "$ac_t""no" 1>&6
+  
+       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
+
 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:1537: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
+echo "$ac_t""$ol_cv_linux_threads" 1>&6
+
+
+       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:3400: 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
-  case "$EDITOR" in
-  /*)
-  ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH:/usr/ucb$ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_EDITOR="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
-  ;;
-esac
+  cat > conftest.$ac_ext <<EOF
+#line 3405 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+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
-EDITOR="$ac_cv_path_EDITOR"
-if test -n "$EDITOR"; then
-  echo "$ac_t""$EDITOR" 1>&6
+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
 
-# 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:1569: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
+       for ac_hdr in lwp/lwp.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3440: 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
-  case "$FINGER" in
-  /*)
-  ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
-  ;;
-  *)
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH:/usr/ucb$ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_FINGER="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
-  ;;
-esac
+  cat > conftest.$ac_ext <<EOF
+#line 3445 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+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
-FINGER="$ac_cv_path_FINGER"
-if test -n "$FINGER"; then
-  echo "$ac_t""$FINGER" 1>&6
+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
-
-
-
-LTHREAD_LIBS=
-if test "$opt_thread" = "no" ; then
-       LTHREAD_DEFS="-DNO_THREADS"
-       BUILD_SLURPD=no
-else
-       for ac_hdr in pthread.h sched.h
+done
+
+       for ac_hdr in thread.h synch.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1609: checking for $ac_hdr" >&5
+echo "configure:3480: 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 1614 "configure"
+#line 3485 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1619: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1641,413 +3512,272 @@ else
 fi
 done
 
-
-       if test "$ac_cv_header_pthread_h" = yes ; then
-                               echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:1648: checking POSIX thread version" >&5
-if eval "test \"`echo '$''{'cf_cv_pthread_version'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-                       cat > conftest.$ac_ext <<EOF
-#line 1654 "configure"
-#include "confdefs.h"
-
-#include <pthread.h>
-/* this check could be improved */
-#ifdef PTHREAD_ONCE_INIT
-       final
-#endif
-                       
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "final" >/dev/null 2>&1; then
-  rm -rf conftest*
-  pthread_final=yes
-else
-  rm -rf conftest*
-  pthread_final=no
 fi
-rm -f conftest*
-
-
-                       cat > conftest.$ac_ext <<EOF
-#line 1676 "configure"
-#include "confdefs.h"
 
-#include <pthread.h>
-/* this check could be improved */
-#ifdef pthread_once_init
-       draft4
-#endif
-                       
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "draft4" >/dev/null 2>&1; then
-  rm -rf conftest*
-  pthread_draft4=yes
-else
-  rm -rf conftest*
-  pthread_draft4=no
-fi
-rm -f conftest*
+if test $ol_link_threads = no ; then
+       if test $ol_with_threads = yes ; then
+               { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
+       fi
 
+       if test $ol_with_threads = auto ; then
+               echo "configure: warning: no suitable thread support, disabling threads" 1>&2
+               $ol_with_threads = no
+       fi
 
-                       if test $pthread_final = yes -a $pthread_draft4 = no; then
-                               cf_cv_pthread_version=final
-                       elif test $pthread_final = no -a $pthread_draft4 = yes; then
-                               cf_cv_pthread_version=draft4
-                       else
-                               cf_cv_pthread_version=unknown
-                       fi
-               
+       LTHREAD_DEFS="-DNO_THREADS"
+       LTHREAD_LIBS=""
 fi
 
-echo "$ac_t""$cf_cv_pthread_version" 1>&6
-               
-               if test $cf_cv_pthread_version = final ; then
-                       LTHREAD_DEFS="$LTHREAD_DEFS -DPOSIX_THREADS"
-               elif test $cf_cv_pthread_version = draft4 ; then
-                       LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_MIT_PTHREADS"
-               else
-                       { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
-               fi
-
-               echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:1718: checking for LinuxThreads" >&5
-if eval "test \"`echo '$''{'cf_cv_linux_threads'+set}'`\" = set"; then
+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:3535: 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
-  
-                       res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
-                       if test "$res" -gt 0 ; then
-                               cf_cv_linux_threads=yes
-                       else
-                               cf_cv_linux_threads=no
-                       fi
-               
-fi
-
-echo "$ac_t""$cf_cv_linux_threads" 1>&6
-
-               if test $cf_cv_linux_threads = yes ; then
-                       LTHREAD_DEFS="$LTHREAD_DEFS -DHAVE_LINUX_THREADS"
-               fi
-
-               
-                               echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
-echo "configure:1740: checking for pthread_create" >&5
-if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
+       ol_LIBS="$LIBS"
+       echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
+echo "configure:3541: 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
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1745 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-ldb  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3549 "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();
+char db_open();
 
 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_create) || defined (__stub___pthread_create)
-choke me
-#else
-pthread_create();
-#endif
-
+db_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_func_pthread_create=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_pthread_create=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  pthread_link=yes
+  ol_cv_lib_db2=-ldb
 else
   echo "$ac_t""no" 1>&6
-pthread_link=no
+ol_cv_lib_db2=no
 fi
 
+       LIBS="$ol_LIBS"
 
-               if test $pthread_link = no ; then
-                                               echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
-echo "configure:1791: checking for pthread_create with -pthread" >&5
-if eval "test \"`echo '$''{'cf_cv_pthread_flag'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-                                                               save_LIBS="$LIBS"
-                               LIBS="-pthread $LIBS"
-                               cat > conftest.$ac_ext <<EOF
-#line 1799 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-int main() {
-
-                                       pthread_create((pthread_t*) 0,
-                                               (pthread_attr_t*) 0, 0, 0);
-                                       
-; return 0; }
-EOF
-if { (eval echo configure:1809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  cf_cv_pthread_flag=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_pthread_flag=no
-fi
-rm -f conftest*
-                                                               LIBS="$save_LIBS"
-                       
 fi
 
-echo "$ac_t""$cf_cv_pthread_flag" 1>&6
-
-                       if test $cf_cv_pthread_flag = yes ; then
-                               LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
-                               pthread_link=yes
-                       fi
-               fi
+echo "$ac_t""$ol_cv_lib_db2" 1>&6
 
-               if test $pthread_link = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1834: 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
+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:3591: 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="-lpthread  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1842 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 3596 "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();
-
-int main() {
-pthread_create()
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:1853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+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
-  
-                               pthread_link=yes
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
+    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
 
-                       LIBS="$save_LIBS"
-               fi
-
-               if test $pthread_link = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:1881: 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
+if test $ac_cv_header_db_h = yes ; then
+       echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
+echo "configure:3629: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lc_r  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1889 "configure"
+  
+               cat > conftest.$ac_ext <<EOF
+#line 3635 "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();
 
-int main() {
-pthread_create()
-; return 0; }
+#                      include <db.h>
+                       /* this check could be improved */
+#                      ifdef DB_VERSION_MAJOR
+#                              if DB_VERSION_MAJOR == 2
+                                       __db_version_2
+#                              endif
+#                      endif
+               
 EOF
-if { (eval echo configure:1900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__db_version_2" >/dev/null 2>&1; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_header_db2=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_header_db2=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
-  
-                               pthread_link=yes
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
+
+echo "$ac_t""$ol_cv_header_db2" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+       ol_cv_header_db2=no
 fi
 
-                       LIBS="$save_LIBS"
-               fi
 
-               if test $pthread_link = no ; then
-                                               save_LIBS="$LIBS"
-                       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1928: 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
+ echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
+echo "configure:3667: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthread -lmach -lexc -lc $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1936 "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();
+  
+       if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then
+               ol_cv_berkeley_db2=no
+       else
+               ol_cv_berkeley_db2=yes
+       fi
 
-int main() {
-pthread_create()
-; return 0; }
-EOF
-if { (eval echo configure:1947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
-  
-                               pthread_link=yes
-                               LTHREAD_DEFS="$LTHREAD_DEFS -DDEC_THREADS"
-                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"
-else
-  echo "$ac_t""no" 1>&6
-fi
+echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
+ if test $ol_cv_berkeley_db2 = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_BERKELEY_DB2 1
+EOF
 
-                       LIBS="$save_LIBS"
+ fi
+
+
+       if test $ol_cv_berkeley_db2 = yes ; then
+               ol_link_ldbm=db2
+               ol_with_ldbm_api=db2
+
+               LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2"
+
+               if test $ol_with_ldbm_type = hash ; then
+                       LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
+               else
+                       LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
                fi
 
-       else
-               LTHREAD_DEFS="-DNO_THREADS"
+                                               if test $ol_cv_lib_db2 != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
+               fi
        fi
 fi
 
-# check for strtok_r (and presumely other reentrant functions)
-save_LIBS="$LIBS"
-LIBS="$save_LIBS $LTHREAD_LIBS"
-echo $ac_n "checking for strtok_r in -lpthread""... $ac_c" 1>&6
-echo "configure:1982: checking for strtok_r in -lpthread" >&5
-ac_lib_var=`echo pthread'_'strtok_r | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+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:3709: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lpthread  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1990 "configure"
+       ol_LIBS="$LIBS"
+       echo $ac_n "checking for dbopen""... $ac_c" 1>&6
+echo "configure:3715: 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 3720 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dbopen(); 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 strtok_r();
+char dbopen();
+
+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_dbopen) || defined (__stub___dbopen)
+choke me
+#else
+dbopen();
+#endif
 
-int main() {
-strtok_r()
 ; return 0; }
 EOF
-if { (eval echo configure:2001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func_dbopen=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_dbopen=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 pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lpthread $LIBS"
 
+if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_cv_lib_db=yes
 else
   echo "$ac_t""no" 1>&6
-fi
 
-
-if test $ac_cv_lib_pthread_strtok_r = no ; then
-       LIBS="$save_LIBS $LTHREAD_LIBS"
-       echo $ac_n "checking for strtok_r in -lc_r""... $ac_c" 1>&6
-echo "configure:2032: checking for strtok_r in -lc_r" >&5
-ac_lib_var=`echo c_r'_'strtok_r | sed 'y%./+-%__p_%'`
+               echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
+echo "configure:3762: 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
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lc_r  $LIBS"
+LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+#line 3770 "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 strtok_r();
+char dbopen();
 
 int main() {
-strtok_r()
+dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:2051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2062,66 +3792,55 @@ 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 c_r | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lc_r $LIBS"
-
+  ol_cv_lib_db=-ldb
 else
   echo "$ac_t""no" 1>&6
+ol_cv_lib_db=no
+fi
+
+       
+fi
+
+       LIBS="$ol_LIBS"
+
 fi
 
-       for ac_func in strtok_r sched_yield
+echo "$ac_t""$ol_cv_lib_db" 1>&6
+
+
+for ac_hdr in db_185.h
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2081: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3816: 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 2086 "configure"
+#line 3821 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=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_func_$ac_func=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
   cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+#define $ac_tr_hdr 1
 EOF
  
 else
@@ -2129,58 +3848,96 @@ else
 fi
 done
 
-       if test $ac_cv_lib_c_r_strtok_r = yes ; then
-               LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
-       fi
+if test $ol_cv_header_db2 = yes ; then
+       
+       ol_cv_header_db=$ac_cv_header_db_185_h
 else
-       for ac_func in strtok_r sched_yield
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2140: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+       ol_cv_header_db=$ac_cv_header_db_h
+fi
+
+
+ echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
+echo "configure:3862: 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
-  cat > conftest.$ac_ext <<EOF
-#line 2145 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
+  
+       if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then
+               ol_cv_berkeley_db=no
+       else
+               ol_cv_berkeley_db=yes
+       fi
 
-int main() {
+fi
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
+echo "$ac_t""$ol_cv_berkeley_db" 1>&6
+ if test $ol_cv_berkeley_db = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_BERKELEY_DB 1
+EOF
 
-; return 0; }
+ fi
+
+
+       if test $ol_cv_berkeley_db = yes ; then
+               ol_link_ldbm=db
+               ol_with_ldbm_api=db
+
+               if test $ac_cv_header_db_185_h = yes ; then
+                       LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2_COMPAT185"
+               fi
+
+               if test $ol_with_ldbm_type = hash ; then
+                       LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
+               else
+                       LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
+               fi
+
+                                               if test $ol_cv_lib_db != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
+               fi
+       fi
+fi
+
+if test $ol_with_ldbm_api = manual ; then
+               $ol_link_ldbm=yes
+
+       echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
+
+       for ac_hdr in db.h db_185.h gdbm.h ndbm.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3913: 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 3918 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=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_func_$ac_func=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
   cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+#define $ac_tr_hdr 1
 EOF
  
 else
@@ -2190,83 +3947,86 @@ done
 
 fi
 
-LIBS="$save_LIBS"
-
+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
 
-ldbm_use="none"
-if test "$SLAPD_LDBM" = "yes" ; then
-       if test $ldbm_prefer = any -o $ldbm_prefer = dbbtree \
-                       -o $ldbm_prefer = dbhash ; then
-               echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:2202: checking for dbopen" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
+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:3958: 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:3964: 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 2207 "configure"
+#line 3969 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dbopen(); below.  */
+    which can conflict with char gdbm_open(); 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 dbopen();
+char gdbm_open();
 
 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_dbopen) || defined (__stub___dbopen)
+#if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
 choke me
 #else
-dbopen();
+gdbm_open();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:2230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_func_dbopen=yes"
+  eval "ac_cv_func_gdbm_open=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_dbopen=no"
+  eval "ac_cv_func_gdbm_open=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-                       ldbm_use=$ldbm_prefer
-                       ldbm_prefer=found
+  ol_cv_lib_gdbm=yes
 else
   echo "$ac_t""no" 1>&6
 
-                       echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:2251: checking for dbopen in -ldb" >&5
-ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
+               echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
+echo "configure:4011: 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
 else
   ac_save_LIBS="$LIBS"
-LIBS="-ldb  $LIBS"
+LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2259 "configure"
+#line 4019 "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();
+char gdbm_open();
 
 int main() {
-dbopen()
+gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:2270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2281,139 +4041,172 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-                               ldbm_use=$ldbm_prefer
-                               ldbm_prefer=found
-                               LDBM_LIBS="$LDBM_LIBS -ldb"
-                       
+  ol_cv_lib_gdbm=-lgdbm
 else
   echo "$ac_t""no" 1>&6
+ol_cv_lib_gdbm=no
 fi
-               
+
+       
 fi
 
+       LIBS="$ol_LIBS"
 
-               if test $ldbm_prefer = found ; then
-                       if test $ldbm_use = dbhash ; then
-                               LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
-                       else
-                               LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
-                       fi
-               fi
+fi
+
+echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
 
-               echo $ac_n "checking for db2""... $ac_c" 1>&6
-echo "configure:2307: checking for db2" >&5
-if eval "test \"`echo '$''{'cf_cv_db2'+set}'`\" = set"; then
+
+ for ac_hdr in gdbm.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4065: 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 2313 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 4070 "configure"
 #include "confdefs.h"
-
-#include <db.h>
-/* this check could be improved */
-#ifdef DB_VERSION_MAJOR
-#if DB_VERSION_MAJOR == 2
-       __db_version_2
-#endif
-#endif
-                       
+#include <$ac_hdr>
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "__db_version_2" >/dev/null 2>&1; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  cf_cv_db2=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*
-  cf_cv_db2=no
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+ echo $ac_n "checking for db""... $ac_c" 1>&6
+echo "configure:4102: checking for db" >&5
+if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
+               ol_cv_gdbm=no
+       else
+               ol_cv_gdbm=yes
+       fi
 
 fi
 
-echo "$ac_t""$cf_cv_db2" 1>&6
+echo "$ac_t""$ol_cv_gdbm" 1>&6
+ if test $ol_cv_gdbm = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_GDBM 1
+EOF
+
+ fi
+
+
+       if test $ol_cv_gdbm = yes ; then
+               ol_link_ldbm=gdbm
+               ol_with_ldbm_api=gdbm
+
+               LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_GDBM"
+
+               if test $ol_cv_lib_gdbm != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
+               fi
+       fi
+fi
+
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
+       echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
+echo "configure:4138: 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:4144: 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 4149 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dbm_open(); 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 dbm_open();
+
+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_dbm_open) || defined (__stub___dbm_open)
+choke me
+#else
+dbm_open();
+#endif
 
-               if test $cf_cv_db2 = yes ; then
-                       if test $opt_db2 = yes ; then
-                               LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2"
-                       else
-                               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:2347: 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 2352 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
+if { (eval echo configure:4172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_func_dbm_open=yes"
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "ac_cv_func_dbm_open=no"
 fi
 rm -f conftest*
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = 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
+  ol_cv_lib_ndbm=yes
 else
   echo "$ac_t""no" 1>&6
-fi
-done
-
-                               if test $ac_cv_header_db_185_h = no ; then
-                                       { echo "configure: error: select --with-db2 or install db2 with 1.85 compatibility" 1>&2; exit 1; }
-                               fi
-
-                               LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2_COMPAT185"
-                       fi
-               else
-                       if test $opt_db2 = yes ; then
-                               { echo "configure: error: could not local DB2" 1>&2; exit 1; }
-                       fi
-               fi
-       fi
 
-       if test $ldbm_prefer = any -o $ldbm_prefer = gdbm ; then
-               echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:2398: checking for gdbm_open in -lgdbm" >&5
-ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
+               echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
+echo "configure:4191: 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
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lgdbm  $LIBS"
+LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2406 "configure"
+#line 4199 "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 gdbm_open();
+char dbm_open();
 
 int main() {
-gdbm_open()
+dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2428,20 +4221,12 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-                       ldbm_use=$ldbm_prefer
-                       ldbm_prefer=found
-                       LDBM_LIBS="$LDBM_LIBS -lgdbm"
-                       LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_GDBM"
-               
+  ol_cv_lib_ndbm=-lndbm
 else
   echo "$ac_t""no" 1>&6
-fi
-       fi
-       if test $ldbm_prefer = any -o $ldbm_prefer = ndbm ; then
-               echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:2445: checking for dbm_open in -ldbm" >&5
+
+                       echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
+echo "configure:4230: 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
@@ -2449,7 +4234,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2453 "configure"
+#line 4238 "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
@@ -2460,7 +4245,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:2464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2475,30 +4260,116 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-                       ldbm_use=ndbm
-                       ldbm_prefer=found
-                       LDBM_LIBS="$LDBM_LIBS -ldbm"
-                       LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_NDBM"
-               
+  ol_cv_lib_ndbm=-ldbm
 else
   echo "$ac_t""no" 1>&6
+ol_cv_lib_ndbm=no
+fi
+               
+fi
+
+       
+fi
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
+
+
+ for ac_hdr in ndbm.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4286: 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 4291 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+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
+
+ echo $ac_n "checking for db""... $ac_c" 1>&6
+echo "configure:4323: checking for db" >&5
+if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
+               ol_cv_ndbm=no
+       else
+               ol_cv_ndbm=yes
        fi
 
-       if test $ldbm_prefer != found ; then
-               { echo "configure: error: could not find suitable db for $ldbm_prefer backend" 1>&2; exit 1; }
+fi
+
+echo "$ac_t""$ol_cv_ndbm" 1>&6
+ if test $ol_cv_ndbm = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_NDBM 1
+EOF
+
+ fi
+
+
+       if test $ol_cv_ndbm = yes ; then
+               ol_link_ldbm=ndbm
+               ol_with_ldbm_api=ndbm
+
+               if test $ol_with_ldbm_api = ndbm ; then
+                       echo "configure: warning: Attempting to use NDBM.  Functionality will be limited." 1>&2
+               fi
+
+               LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_NDBM"
+
+               if test $ol_cv_lib_ndbm != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
+               fi
        fi
+fi
 
-       if test $ldbm_use = ndbm ; then
-               echo "configure: warning: LDBM using NDBM" 1>&2
+if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
+       echo "configure: warning: could not find suitable LDBM backend" 1>&2
+       if test $ol_enable_ldbm = yes ; then
+               { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
        fi
+
+       echo "configure: warning: disabling LDBM" 1>&2
+       $ol_enable_ldbm=no
 fi
 
-if test "$SLAPD_TCP_WRAPPERS" = "yes" ; then
+if test $ol_enable_wrappers = yes ; then
        echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
-echo "configure:2502: checking for hosts_access in -lwrap" >&5
+echo "configure:4373: checking for hosts_access in -lwrap" >&5
 ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2506,7 +4377,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lwrap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2510 "configure"
+#line 4381 "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
@@ -2517,7 +4388,7 @@ int main() {
 hosts_access()
 ; return 0; }
 EOF
-if { (eval echo configure:2521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2532,90 +4403,93 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-               SLAPD_DEFS="$SLAPD_DEFS -DTCP_WRAPPERS"
-               SLAPD_LIBS="$SLAPD_LIBS -lwrap"
-       
+  have_wrappers=yes
 else
   echo "$ac_t""no" 1>&6
+have_wrappers=no
 fi
 
-fi
 
-# ud needs termcap (should insert check here)
-LIBTERMCAP="-ltermcap"
+       if test $have_wrappers = yes ; then
+               SLAPD_DEFS="$SLAPD_DEFS -DTCP_WRAPPERS"
+               SLAPD_LIBS="$SLAPD_LIBS -lwrap"
+       else
+               echo "configure: warning: could not find -lwrap" 1>&2
+               if test $ol_enable_wrappers = yes ; then
+                       { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
+               fi
 
+               echo "configure: warning: disabling wrappers support" 1>&2
+               ol_enable_wrappers=no
+       fi
 
-# FreeBSD (and others) have crypt(3) in -lcrypt
-if test "$SLAPD_CRYPT" = "yes" ; then
-       echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:2553: checking for crypt" >&5
-if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
+fi
+
+# ud needs termcap (should insert check here)
+ol_link_termcap=no
+for ac_hdr in termcap.h ncurses.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4435: 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 2558 "configure"
+#line 4440 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char crypt(); 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 crypt();
-
-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_crypt) || defined (__stub___crypt)
-choke me
-#else
-crypt();
-#endif
-
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:2581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  eval "ac_cv_func_crypt=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_func_crypt=no"
+  eval "ac_cv_header_$ac_safe=no"
 fi
 rm -f conftest*
 fi
-
-if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  have_crypt=yes
+    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
 
-               echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:2600: checking for crypt in -lcrypt" >&5
-ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
+
+if test $ol_link_termcap = no ; then
+       echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
+echo "configure:4474: 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
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lcrypt  $LIBS"
+LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2608 "configure"
+#line 4482 "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 crypt();
+char tputs();
 
 int main() {
-crypt()
+tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2630,127 +4504,149 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
-                       have_crypt=yes
+  have_termcap=yes
 else
   echo "$ac_t""no" 1>&6
-have_crypt=no
-fi
-
+have_termcap=no
 fi
 
+       if test $have_termcap = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_TERMCAP 1
+EOF
 
-       if test $have_crypt = yes ; then
-               LUTIL_DEFS="$LUTIL_DEFS -DLDAP_CRYPT"
-       else
-               echo "configure: warning: could not find crypt" 1>&2
+               ol_link_termcap=yes
+               TERMCAP_LIBS=-ltermcap
        fi
 fi
 
-ac_header_dirent=no
-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:2656: checking for $ac_hdr that defines DIR" >&5
-if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+if test $ol_link_termcap = no ; then
+       echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
+echo "configure:4526: 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
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2661 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lncurses  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4534 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <$ac_hdr>
+/* 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 initscr();
+
 int main() {
-DIR *dirp = 0;
+initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:2669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_header_dirent_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_header_dirent_$ac_safe=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
 fi
-if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
- ac_header_dirent=$ac_hdr; break
+  have_ncurses=yes
 else
   echo "$ac_t""no" 1>&6
+have_ncurses=no
 fi
-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:2694: 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
+
+       if test $have_ncurses = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_NCURSES 1
+EOF
+
+               ol_link_termcap=yes
+               TERMCAP_LIBS=-lncurses
+       fi
+fi
+
+if test $ol_link_termcap = no ; then
+       TERMCAP_DEFS="-DNOTERMCAP"
+       TERMCAP_LIBS=
+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:4584: checking for crypt" >&5
+if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldir  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2702 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 4589 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char crypt(); 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 opendir();
+char crypt();
+
+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_crypt) || defined (__stub___crypt)
+choke me
+#else
+crypt();
+#endif
 
-int main() {
-opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func_crypt=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_crypt=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_func_'crypt`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIBS="$LIBS -ldir"
+  have_crypt=yes
 else
   echo "$ac_t""no" 1>&6
-fi
 
-else
-echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2735: checking for opendir in -lx" >&5
-ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+               echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
+echo "configure:4631: 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
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lx  $LIBS"
+LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2743 "configure"
+#line 4639 "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 opendir();
+char crypt();
 
 int main() {
-opendir()
+crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:2754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2765,20 +4661,36 @@ 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 -lx"
+  LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
+                       have_crypt=yes
 else
   echo "$ac_t""no" 1>&6
+have_crypt=no
+fi
+
 fi
 
+
+       if test $have_crypt = yes ; then
+               LUTIL_DEFS="$LUTIL_DEFS -DLDAP_CRYPT"
+       else
+               echo "configure: warning: could not find crypt" 1>&2
+               if test $ol_enable_crypt = yes ; then
+                       { echo "configure: error: could not find crypt" 1>&2; exit 1; }
+               fi
+
+               echo "configure: warning: disabling crypt support" 1>&2
+               ol_enable_crypt=no
+       fi
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2777: checking for ANSI C header files" >&5
+echo "configure:4689: 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 2782 "configure"
+#line 4694 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2786,7 +4698,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2803,7 +4715,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2807 "configure"
+#line 4719 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2821,7 +4733,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2825 "configure"
+#line 4737 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2842,7 +4754,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2846 "configure"
+#line 4758 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2853,7 +4765,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2876,13 +4788,138 @@ EOF
 
 fi
 
+ac_header_dirent=no
+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:4797: 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 4802 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:4810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$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
+ ac_header_dirent=$ac_hdr; break
+else
+  echo "$ac_t""no" 1>&6
+fi
+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:4835: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldir  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4843 "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 opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
+  LIBS="$LIBS -ldir"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:4876: 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
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lx  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4884 "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 opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:4895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
+  LIBS="$LIBS -lx"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2881: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:4918: 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 2886 "configure"
+#line 4923 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -2898,7 +4935,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:2902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2921,6 +4958,7 @@ fi
 for ac_hdr in \
        stddef.h        \
        fcntl.h         \
+       filio.h         \
        limits.h        \
        malloc.h        \
        sgtty.h         \
@@ -2928,23 +4966,23 @@ for ac_hdr in \
        sys/ioctl.h     \
        sys/time.h      \
        syslog.h        \
-       termio.h        \
+       termios.h       \
        unistd.h        \
 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2938: checking for $ac_hdr" >&5
+echo "configure:4976: 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 2943 "configure"
+#line 4981 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2972,12 +5010,12 @@ done
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2976: checking for uid_t in sys/types.h" >&5
+echo "configure:5014: 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 2981 "configure"
+#line 5019 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3006,7 +5044,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:3010: checking type of array argument to getgroups" >&5
+echo "configure:5048: 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
@@ -3014,7 +5052,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 3018 "configure"
+#line 5056 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -3039,7 +5077,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:3043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
     ac_cv_type_getgroups=gid_t
 else
@@ -3053,7 +5091,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 3057 "configure"
+#line 5095 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -3077,12 +5115,12 @@ EOF
 
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3081: checking for mode_t" >&5
+echo "configure:5119: 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 3086 "configure"
+#line 5124 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3110,12 +5148,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3114: checking for off_t" >&5
+echo "configure:5152: 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 3119 "configure"
+#line 5157 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3143,12 +5181,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3147: checking for pid_t" >&5
+echo "configure:5185: 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 3152 "configure"
+#line 5190 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3176,12 +5214,12 @@ EOF
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3180: checking return type of signal handlers" >&5
+echo "configure:5218: 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 3185 "configure"
+#line 5223 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3198,7 +5236,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3217,12 +5255,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3221: checking for size_t" >&5
+echo "configure:5259: 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 3226 "configure"
+#line 5264 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3250,12 +5288,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3254: checking for uid_t in sys/types.h" >&5
+echo "configure:5292: 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 3259 "configure"
+#line 5297 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3284,12 +5322,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:3288: checking for st_blksize in struct stat" >&5
+echo "configure:5326: 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 3293 "configure"
+#line 5331 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3297,7 +5335,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:3301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -3318,12 +5356,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3322: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:5360: 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 3327 "configure"
+#line 5365 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3332,7 +5370,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3353,12 +5391,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3357: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:5395: 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 3362 "configure"
+#line 5400 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3366,7 +5404,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3388,12 +5426,12 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3392: checking for working const" >&5
+echo "configure:5430: 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 3397 "configure"
+#line 5435 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3442,7 +5480,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3463,8 +5501,9 @@ EOF
 fi
 
 
+
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:3468: checking for 8-bit clean memcmp" >&5
+echo "configure:5507: 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
@@ -3472,7 +5511,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3476 "configure"
+#line 5515 "configure"
 #include "confdefs.h"
 
 main()
@@ -3482,7 +5521,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:3486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -3499,54 +5538,13 @@ fi
 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
 
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3504: 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 3509 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:3526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_type_signal=void
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_type_signal=int
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:3545: checking for strftime" >&5
+echo "configure:5543: 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 3550 "configure"
+#line 5548 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -3569,7 +5567,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -3591,7 +5589,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:3595: checking for strftime in -lintl" >&5
+echo "configure:5593: 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
@@ -3599,7 +5597,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3603 "configure"
+#line 5601 "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
@@ -3610,7 +5608,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:3614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3637,12 +5635,12 @@ fi
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:3641: checking for vprintf" >&5
+echo "configure:5639: 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 3646 "configure"
+#line 5644 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -3665,7 +5663,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
@@ -3689,12 +5687,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:3693: checking for _doprnt" >&5
+echo "configure:5691: 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 3698 "configure"
+#line 5696 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -3717,7 +5715,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -3742,7 +5740,7 @@ fi
 fi
 
 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
-echo "configure:3746: checking for wait3 that fills in rusage" >&5
+echo "configure:5744: checking for wait3 that fills in rusage" >&5
 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3750,7 +5748,7 @@ else
   ac_cv_func_wait3_rusage=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3754 "configure"
+#line 5752 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3781,7 +5779,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:3785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_wait3_rusage=yes
 else
@@ -3805,29 +5803,38 @@ fi
 
 
 for ac_func in \
+       bcopy                   \
+       flock                   \
        gethostname             \
        gettimeofday    \
+       getdtablesize   \
+       lockf                   \
+       memcpy                  \
+       memmove                 \
        mktime                  \
        select                  \
+       setpwfile               \
+       setsid                  \
+       signal                  \
+       sigset                  \
        socket                  \
-       strdup                  \
        strerror                \
        strstr                  \
        strrchr                 \
+       strsep                  \
        strtod                  \
        strtol                  \
        strtoul                 \
-       strsep                  \
-       memcpy                  \
+       sysconf                 \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3826: checking for $ac_func" >&5
+echo "configure:5833: 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 3831 "configure"
+#line 5838 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3850,7 +5857,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3878,12 +5885,12 @@ done
 for ac_func in strdup
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3882: checking for $ac_func" >&5
+echo "configure:5889: 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 3887 "configure"
+#line 5894 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3906,7 +5913,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3936,13 +5943,13 @@ done
 # Check Configuration
 
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:3940: checking declaration of sys_errlist" >&5
-if eval "test \"`echo '$''{'cf_cv_dcl_sys_errlist'+set}'`\" = set"; then
+echo "configure:5947: 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 3946 "configure"
+#line 5953 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -3952,66 +5959,130 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:3956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  cf_cv_dcl_sys_errlist=yes
+  ol_cv_dcl_sys_errlist=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_dcl_sys_errlist=no
+  ol_cv_dcl_sys_errlist=no
 fi
 rm -f conftest*
 fi
 
-echo "$ac_t""$cf_cv_dcl_sys_errlist" 1>&6
+echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
 
 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
-if test $cf_cv_dcl_sys_errlist = no ; then
+if test $ol_cv_dcl_sys_errlist = no ; then
        cat >> confdefs.h <<\EOF
 #define DECL_SYS_ERRLIST 1
 EOF
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:3977: checking existence of sys_errlist" >&5
-       if eval "test \"`echo '$''{'cf_cv_have_sys_errlist'+set}'`\" = set"; then
+echo "configure:5984: 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 3983 "configure"
+#line 5990 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:3990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  cf_cv_have_sys_errlist=yes
+  ol_cv_have_sys_errlist=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_have_sys_errlist=no
+  ol_cv_have_sys_errlist=no
 fi
 rm -f conftest*
 fi
 
-       echo "$ac_t""$cf_cv_have_sys_errlist" 1>&6
+       echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
+fi
+
+
+
+if test $ol_enable_debug != no ; then
+       LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
+fi
+if test $ol_enable_libui = yes ; then
+       LDAP_DEFS="$LDAP_DEFS -DLDAP_LIBUI"
+fi
+if test $ol_enable_cache = no ; then
+       LDAP_DEFS="$LDAP_DEFS -DNO_CACHE"
+fi
+if test $ol_enable_dns != no ; then
+       LDAP_DEFS="$LDAP_DEFS -DLDAP_DNS"
+fi
+if test $ol_enable_referrals != no ; then
+       LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
+fi
+if test $ol_enable_cldap != no ; then
+       LDAP_DEFS="$LDAP_DEFS -DCLDAP"
 fi
 
+if test $ol_enable_aclgroup != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_ACLGROUP 1
+EOF
+
+       SLAPD_DEFS="$SLAPD_DEFS -DACLGROUP"
+fi
 
+if test $ol_enable_md5 != no ; then
+       LUTIL_DEFS="$LUTIL_DEFS -DLDAP_MD5"
+fi
 
+if test $ol_enable_sha1 != no ; then
+       LUTIL_DEFS="$LUTIL_DEFS -DLDAP_SHA1"
+fi
 
-  
-  
-  
+if test $ol_enable_phonetic != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_PHONETIC 1
+EOF
+
+       SLAPD_DEFS="$SLAPD_DEFS -DSOUNDEX"
+fi
+
+if test $ol_enable_rlookups != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_RLOOKUPS 1
+EOF
 
+       SLAPD_DEFS="$SLAPD_DEFS -DREVERSE_LOOKUPS"
+fi
 
+if test $ol_link_ldbm != no ; then
+       BUILD_SLAPD=yes
+       BUILD_LDBM=yes
+       LDBM_DEFS="-DLDAP_LDBM $LDBM_DEFS"
+fi
 
+if test $ol_enable_passwd != no ; then
+       BUILD_SLAPD=yes
+       BUILD_PASSWD=yes
+       SLAPD_DEFS="-DLDAP_PASSWD $SLAPD_DEFS"
+fi
 
+if test $ol_enable_shell != no ; then
+       BUILD_SLAPD=yes
+       BUILD_SHELL=yes
+       SLAPD_DEFS="-DLDAP_SHELL $SLAPD_DEFS"
+fi
 
+if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
+       $BUILD_SLAPD = yes ; then
+       BUILD_SLURPD=yes
+fi
 
 
 
@@ -4023,6 +6094,20 @@ fi
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -4196,8 +6281,6 @@ s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@CPP@%$CPP%g
 s%@LN_S@%$LN_S%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
@@ -4206,7 +6289,8 @@ s%@SET_MAKE@%$SET_MAKE%g
 s%@SENDMAIL@%$SENDMAIL%g
 s%@EDITOR@%$EDITOR%g
 s%@FINGER@%$FINGER%g
-s%@LIBTERMCAP@%$LIBTERMCAP%g
+s%@CC@%$CC%g
+s%@CPP@%$CPP%g
 s%@LIBOBJS@%$LIBOBJS%g
 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
@@ -4220,9 +6304,6 @@ s%@LDAPD_DEFS@%$LDAPD_DEFS%g
 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
 s%@SLAPD_DEFS@%$SLAPD_DEFS%g
 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
-s%@SLAPD_LDBM@%$SLAPD_LDBM%g
-s%@SLAPD_PASSWD@%$SLAPD_PASSWD%g
-s%@SLAPD_SHELL@%$SLAPD_SHELL%g
 s%@SLURPD_DEFS@%$SLURPD_DEFS%g
 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
 s%@LDBM_DEFS@%$LDBM_DEFS%g
@@ -4231,6 +6312,10 @@ s%@LTHREAD_DEFS@%$LTHREAD_DEFS%g
 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
 s%@LUTIL_DEFS@%$LUTIL_DEFS%g
 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
+s%@KRB_DEFS@%$KRB_DEFS%g
+s%@KRB_LIBS@%$KRB_LIBS%g
+s%@TERMCAP_DEFS@%$TERMCAP_DEFS%g
+s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
 
 CEOF
 EOF