]> git.sur5r.net Git - openldap/blobdiff - configure
Add LDAPD library checks.
[openldap] / configure
index 55fb33e1a9881a50a207f13de9f01430c8c64de1..3fb750d226b2e3f78458ef23fd99b440a828a8bb 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,56 +14,56 @@ ac_default_prefix=/usr/local
 ac_default_prefix=/usr/local
 ac_help="$ac_help
   --enable-debug       enable debugging (yes)"
+ac_help="$ac_help
+  --enable-proctitle   enable proctitle support (yes)"
 ac_help="$ac_help
   --enable-libui       enable library user interface (yes)"
 ac_help="$ac_help
   --enable-cache       enable caching (yes)"
+ac_help="$ac_help
+  --enable-dns         enable dns support (no)"
 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)"
+  --enable-x-compile   enable cross compiling (no)"
 ac_help="$ac_help
-  --with-kerberos-afs  use AFS Kerberos (no)"
+  --with-kerberos      use Kerberos (auto)"
 ac_help="$ac_help
-  --with-threads       use threads (yes)"
+  --with-threads       use threads (auto)"
+ac_help="$ac_help
+  --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-aclgroups 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)"
+      --with-ldbm-api  use LDBM API (auto)"
 ac_help="$ac_help
-    --with-ndbm                use NDB for LDBM backend (any)"
+      --with-ldbm-type use LDBM type (auto)"
 ac_help="$ac_help
-    --with-gdbm                use GDBM for LDBM backend (any)"
+    --enable-passwd    enable passwd backend (no)"
 ac_help="$ac_help
-    --with-dbhash      use Berkeley DB Hash for LDBM backend (any)"
+    --enable-shell     enable shell backend (no)"
 ac_help="$ac_help
-    --with-dbbtree     use Berkeley DB Btrees for LDBM backend (any)"
-ac_help="$ac_help
-    --with-db2         use Berkeley DB2 API (any)"
-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
@@ -590,745 +590,668 @@ 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:595: checking arguments" >&5
+echo $ac_n "checking configure arguments""... $ac_c" 1>&6
+echo "configure:595: 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
+  
+       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=yes 
-  LDAP_DEBUG=yes
+       ol_enable_debug="yes"
+fi
+# end --enable-debug
+# OpenLDAP --enable-proctitle
+       # Check whether --enable-proctitle or --disable-proctitle was given.
+if test "${enable_proctitle+set}" = set; then
+  enableval="$enable_proctitle"
   
+       ol_arg=invalid
+       for ol_val in auto yes no ; do
+               if test "$enableval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
+       fi
+       ol_enable_proctitle="$ol_arg"
+
+else
+       ol_enable_proctitle="yes"
 fi
-# Check whether --enable-libui or --disable-libui was given.
+# end --enable-proctitle
+# 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
+  
+       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
-  enableval=yes 
-  LDAP_CACHE=yes
+       ol_enable_cache="yes"
+fi
+# 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"
   
+       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
+  
+       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
-  enableval=no 
-  LDAP_CLDAP=no
+       ol_enable_cldap="no"
+fi
+# end --enable-cldap
+# OpenLDAP --enable-x_compile
+       # Check whether --enable-x_compile or --disable-x_compile was given.
+if test "${enable_x_compile+set}" = set; then
+  enableval="$enable_x_compile"
   
+       ol_arg=invalid
+       for ol_val in 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-x_compile" 1>&2; exit 1; }
+       fi
+       ol_enable_x_compile="$ol_arg"
+
+else
+       ol_enable_x_compile="no"
 fi
+# end --enable-x_compile
 
-# 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
   
-fi
-# 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
+       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
-  enableval=yes 
-  SLAPD_ALCGROUP=yes
+       ol_enable_slapd="yes"
+fi
+# end --enable-slapd
+# OpenLDAP --enable-aclgroups
+       # Check whether --enable-aclgroups or --disable-aclgroups was given.
+if test "${enable_aclgroups+set}" = set; then
+  enableval="$enable_aclgroups"
   
+       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-aclgroups" 1>&2; exit 1; }
+       fi
+       ol_enable_aclgroups="$ol_arg"
+
+else
+       ol_enable_aclgroups="auto"
 fi
-# Check whether --enable-crypt or --disable-crypt was given.
+# end --enable-aclgroups
+# 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_aclgroups = yes ; then
+               echo "configure: warning: slapd disabled, ignoring --enable_aclgroups 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:952: 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_aclgroups=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
-fi
-echo "$ac_t""$ldbm_prefer" 1>&6
+       if test $ol_with_ldbm_type != auto ; then
+               echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
+       fi
 
-if test "$BUILD_SLAPD" != "yes" ; then
-       BUILD_SLURPD="no"
-       SLAPD_LDBM="no"
-       SLAPD_PASSWD="no"
-       SLAPD_SHELL="no"
-       ldbm_prefer="none"
-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
 
-## general LDAP arguments
-LDAP_DEFS=
-LDAP_LIBS=
+       ol_with_ldbm_api=no
+       ol_with_ldbm_type=no
 
-if test "$LDAP_DEBUG" = "yes" ; then
-       LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
+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
-if test "$LDAP_REFERRALS" = "yes" ; then
-       cat >> confdefs.h <<\EOF
-#define LDAP_REFERRALS 1
-EOF
 
-       LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
+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
-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
+echo "$ac_t""done" 1>&6
 
-       LDAP_DEFS="$LDAP_DEFS -DCLDAP"
-fi
+## Initialize vars
+LDAP_LIBS=
+LDBM_LIBS=
+LTHREAD_LIBS=
+LUTIL_LIBS=
 
-## ldapd arguments
-LDAPD_DEFS=
 LDAPD_LIBS=
-
-## slapd arguments
-SLAPD_DEFS=
 SLAPD_LIBS=
-LUTIL_DEFS=
-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_LIBS=
 
-if test "$SLAPD_SHA1" = "yes" ; then
-       LUTIL_DEFS="$LUTIL_DEFS -DLDAP_SHA1"
-fi
+BUILD_LDAPD=no
+BUILD_SLAPD=no
+BUILD_SLURPD=no
 
-if test "$SLAPD_LDBM" = "yes" ; then
-       SLAPD_DEFS="$SLAPD_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_LDBM=no
+BUILD_PASSWD=no
+BUILD_SHELL=no
 
-SLURPD_DEFS=
-SLURPD_LIBS=
+KRB_LIBS=
+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:1047: 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:1247: 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.
-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_CC="gcc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-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:1076: 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}:"
-  ac_prog_rejected=no
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
-        ac_prog_rejected=yes
-       continue
-      fi
-      ac_cv_prog_CC="cc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# -gt 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    set dummy "$ac_dir/$ac_word" "$@"
-    shift
-    ac_cv_prog_CC="$@"
-  fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1124: 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.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext <<EOF
-#line 1134 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-if { (eval echo configure:1138: \"$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
-    ac_cv_prog_cc_cross=no
-  else
-    ac_cv_prog_cc_cross=yes
-  fi
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-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:1158: 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:1163: 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
-  cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1172: \"$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
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
-  GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1187: 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
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
-  ac_cv_prog_cc_g=yes
-else
-  ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-O2"
-  fi
-else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1215: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-    # This must be in double quotes, not single quotes, because CPP may get
-  # substituted into the Makefile and "${CC-cc}" will confuse make.
-  CPP="${CC-cc} -E"
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp.
-  cat > conftest.$ac_ext <<EOF
-#line 1230 "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:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -E -traditional-cpp"
-  cat > conftest.$ac_ext <<EOF
-#line 1247 "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:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
-  :
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-  ac_cv_prog_CPP="$CPP"
-fi
-  CPP="$ac_cv_prog_CPP"
-else
-  ac_cv_prog_CPP="$CPP"
-fi
-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:1277: 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 1283 "configure"
-#include "confdefs.h"
-#include <sgtty.h>
-Autoconf TIOCGETP
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "$ac_pattern" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_prog_gcc_traditional=yes
-else
-  rm -rf conftest*
-  ac_cv_prog_gcc_traditional=no
-fi
-rm -f conftest*
-
-
-  if test $ac_cv_prog_gcc_traditional = no; then
-    cat > conftest.$ac_ext <<EOF
-#line 1301 "configure"
-#include "confdefs.h"
-#include <termio.h>
-Autoconf TCGETA
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "$ac_pattern" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_prog_gcc_traditional=yes
-fi
-rm -f conftest*
-
-  fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
-  if test $ac_cv_prog_gcc_traditional = yes; then
-    CC="$CC -traditional"
-  fi
-fi
-
-
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1324: 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"
+  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
@@ -1351,7 +1274,7 @@ fi
 # 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:1355: checking for a BSD compatible install" >&5
+echo "configure:1278: 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
@@ -1403,7 +1326,7 @@ 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:1407: checking for $ac_word" >&5
+echo "configure:1330: 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
@@ -1430,7 +1353,7 @@ else
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1434: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1357: 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
@@ -1460,7 +1383,7 @@ fi
 # Extract the first word of "sendmail", so it can be a program name with args.
 set dummy sendmail; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1464: checking for $ac_word" >&5
+echo "configure:1387: 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
@@ -1492,7 +1415,7 @@ fi
 # Extract the first word of "vi", so it can be a program name with args.
 set dummy vi; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1496: checking for $ac_word" >&5
+echo "configure:1419: 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
@@ -1524,7 +1447,7 @@ fi
 # Extract the first word of "finger", so it can be a program name with args.
 set dummy finger; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1528: checking for $ac_word" >&5
+echo "configure:1451: 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
@@ -1554,29 +1477,2826 @@ else
 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
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1568: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+# 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:1484: 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
-  cat > conftest.$ac_ext <<EOF
-#line 1573 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
+  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
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+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:1513: 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}:"
+  ac_prog_rejected=no
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+       continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1561: 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.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 1571 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:1575: \"$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
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+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:1595: 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:1600: 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
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1609: \"$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
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1624: 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
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+
+if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
+       echo "configure: warning: cross compiling....  go for it" 1>&2
+
+elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
+       echo "configure: warning: programs compiled here do run here..." 1>&2
+       { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
+
+elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
+       echo "configure: warning: programs compiled here do not run here..." 1>&2
+       { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1665: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 1680 "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:1686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 1697 "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:1703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+
+
+echo $ac_n "checking for AIX""... $ac_c" 1>&6
+echo "configure:1728: checking for AIX" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1730 "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*
+
+
+echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:1752: 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:1774: 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 1779 "configure"
+#include "confdefs.h"
+#include <minix/config.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1784: \"$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:1825: 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 1830 "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:1853: \"$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:1872: 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 1880 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:1887: \"$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:1915: 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 1923 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:1930: \"$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:1958: 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 1966 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:1973: \"$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:2001: 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 2009 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2016: \"$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:2044: 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 2052 "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:2063: \"$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:2091: 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 2099 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2106: \"$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
+
+
+# LDAPD tests
+if test $ol_enable_ldapd != no ; then
+               echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
+echo "configure:2140: checking for main in -ldsap" >&5
+ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldsap  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2148 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; 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
+  
+               cat >> confdefs.h <<\EOF
+#define HAVE_DSAP 1
+EOF
+
+               LDAPD_LIBS="$LDAPD_LIBS -ldsap"
+               
+else
+  echo "$ac_t""no" 1>&6
+:
+fi
+
+       echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
+echo "configure:2183: checking for main in -lisode" >&5
+ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lisode  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2191 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2198: \"$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_ISODE 1
+EOF
+
+               LDAPD_LIBS="$LDAPD_LIBS -lisode"
+               
+else
+  echo "$ac_t""no" 1>&6
+:
+fi
+
+       echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
+echo "configure:2226: checking for main in -lxtpp" >&5
+ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lxtpp  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2234 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2241: \"$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_XTPP 1
+EOF
+
+               LDAPD_LIBS="$LDAPD_LIBS -lxtpp"
+               
+else
+  echo "$ac_t""no" 1>&6
+:
+fi
+
+fi
+
+echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
+echo "configure:2271: 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 2279 "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:2290: \"$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:2323: 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 2328 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2333: \"$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:2362: 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 2370 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2377: \"$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_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:2417: 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 2422 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2427: \"$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:2456: 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 2464 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2471: \"$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_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:2514: 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 2519 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2524: \"$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:2553: 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 2559 "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 2581 "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
+                       cat >> confdefs.h <<\EOF
+#define HAVE_PTHREADS_FINAL 1
+EOF
+
+               elif test $ol_cv_pthread_version = draft4 ; then
+                       cat >> confdefs.h <<\EOF
+#define HAVE_PTHREADS_D4 1
+EOF
+
+               else
+                       { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
+               fi
+
+               # consider threads found
+               ol_with_threads=found
+
+               
+echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
+echo "configure:2634: 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
+
+               fi
+
+               
+                               echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
+echo "configure:2660: 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 2665 "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:2688: \"$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:2710: 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 2718 "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:2728: \"$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:2753: 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 2761 "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:2772: \"$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:2800: 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 2808 "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:2819: \"$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:2847: 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 -lmach -lexc -lc $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2855 "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:2866: \"$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_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"
+                               if test $ol_with_preemptive = auto ; then
+                                       ol_with_preemptive=yes
+                               fi
+                               
+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"
+                       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:2912: 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 2917 "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:2940: \"$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 $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
+echo "configure:2968: checking for sched_yield in -lrt" >&5
+ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lrt  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2976 "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 sched_yield();
+
+int main() {
+sched_yield()
+; return 0; }
+EOF
+if { (eval echo configure:2987: \"$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
+  LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
+                                       cat >> confdefs.h <<\EOF
+#define HAVE_SCHED_YIELD 1
+EOF
+
+                                       ac_cv_func_sched_yield=yes
+else
+  echo "$ac_t""no" 1>&6
+ac_cv_func_sched_yield=no
+fi
+
+                       fi
+                       if test $ac_cv_func_sched_yield = no -a \
+                               $ac_cv_func_pthread_yield = no ; then
+                                                               echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
+echo "configure:3017: checking for sched_yield in -lposix4" >&5
+ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lposix4  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3025 "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 sched_yield();
+
+int main() {
+sched_yield()
+; return 0; }
+EOF
+if { (eval echo configure:3036: \"$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
+  LTHREAD_LIBS="$LTHREAD_LIBS -lposix4"
+                                       cat >> confdefs.h <<\EOF
+#define HAVE_SCHED_YIELD 1
+EOF
+
+                                       ac_cv_func_sched_yield=yes
+else
+  echo "$ac_t""no" 1>&6
+ac_cv_func_sched_yield=no
+fi
+
+                       fi
+                       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:3072: 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 3077 "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:3100: \"$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
+
+
+                                               for ac_func in \
+                               pthread_setconcurrency \
+                               thr_setconcurrency \
+                       
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3131: 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 3136 "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:3159: \"$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:3186: 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 3192 "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;
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+       (void) pthread_setconcurrency(2);
+#elif HAVE_THR_SETCONCURRENCY
+       /* Set Solaris LWP concurrency to 2 */
+       thr_setconcurrency(2);
+#endif
+
+       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:3244: \"$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 = mach ; 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:3285: 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 3290 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3295: \"$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_mach_cthreads_h = yes ; then
+               ol_with_threads=found
+
+                               echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
+echo "configure:3325: checking for cthread_fork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3330 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char cthread_fork(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char cthread_fork();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
+choke me
+#else
+cthread_fork();
+#endif
+
+; return 0; }
+EOF
+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_cthread_fork=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_cthread_fork=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_link_threads=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+               if test $ol_link_threads = no ; then
+                                                                       echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
+echo "configure:3375: checking for cthread_fork with -all_load" >&5
+if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+                                                               save_LIBS="$LIBS"
+                               LIBS="-all_load $LIBS"
+                               cat > conftest.$ac_ext <<EOF
+#line 3383 "configure"
+#include "confdefs.h"
+#include <mach/cthreads.h>
+int main() {
+
+                                       cthread_fork((void *)0, (void *)0);
+                                       
+; return 0; }
+EOF
+if { (eval echo configure:3392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  ol_cv_cthread_all_load=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ol_cv_cthread_all_load=no
+fi
+rm -f conftest*
+                                                               LIBS="$save_LIBS"
+                       
+fi
+
+echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
+
+                       if test $ol_cv_cthread_all_load = yes ; then
+                               LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
+                               ol_link_threads=mach
+                       fi
+               fi
+
+               if test $ol_link_threads != no ; then
+                       : check for cthread specific functionality here
+               else
+                       { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
+               fi
+       fi
+
+       if test $ol_with_threads = mach ; then
+               { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
+       fi
+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:3431: 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 3436 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3441: \"$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 thr_create in -lthread""... $ac_c" 1>&6
+echo "configure:3469: 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 3477 "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:3488: \"$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_THR 1
+EOF
+
+                       LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+
+                       if test $ol_with_preemptive = auto ; then
+                               ol_with_preemptive=yes
+                       fi
+               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:3527: 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 3532 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3537: \"$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 lwp_create in -llwp""... $ac_c" 1>&6
+echo "configure:3565: 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 3573 "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:3584: \"$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_LIBS="$LTHREAD_LIBS -llwp"
+
+                       if test $ol_with_preemptive = auto ; then
+                               ol_with_preemptive=no
+                       fi
+               fi
+       fi
+fi
+
+if test $ol_with_preemptive = yes ; then
+       cat >> confdefs.h <<\EOF
+#define PREEMPTIVE_THREADS 1
+EOF
+
+fi
+
+if test $ol_with_threads = manual ; then
+               ol_link_threads=yes
+
+       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:3636: 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 3641 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3646: \"$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
+
+       for ac_func in sched_yield pthread_yield
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3675: 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 3680 "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:3703: \"$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
+
+       
+echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
+echo "configure:3729: 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
+
+
+       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:3750: 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 3755 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3760: \"$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
+
+       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:3790: 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 3795 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3800: \"$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
+
+       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:3830: 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 3835 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3840: \"$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
+
+fi
+
+if test $ol_with_threads = yes ; then
+                                               cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define _THREAD_SAFE 1
+EOF
+
+fi
+
+
+if test $ol_link_threads = no ; then
+       if test $ol_with_threads = yes ; then
+               { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
+       fi
+
+       if test $ol_with_threads = auto ; then
+               echo "configure: warning: no suitable thread support, disabling threads" 1>&2
+               ol_with_threads=no
+       fi
+
+       cat >> confdefs.h <<\EOF
+#define NO_THREADS 1
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define PREEMPTIVE_THREADS 1
+EOF
+
+       LTHREAD_LIBS=""
+fi
+
+ol_link_ldbm=no 
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
+       echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
+echo "configure:3904: checking for DB2 library" >&5
+if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+       ol_LIBS="$LIBS"
+       echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
+echo "configure:3910: 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
+  ac_save_LIBS="$LIBS"
+LIBS="-ldb  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3918 "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 db_open();
+
+int main() {
+db_open()
+; return 0; }
+EOF
+if { (eval echo configure:3929: \"$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_cv_lib_db2=-ldb
+else
+  echo "$ac_t""no" 1>&6
+ol_cv_lib_db2=no
+fi
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_lib_db2" 1>&6
+
+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:3960: 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 3965 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3970: \"$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_db_h = yes ; then
+       echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
+echo "configure:3998: checking if db.h is DB2" >&5
+if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+               cat > conftest.$ac_ext <<EOF
+#line 4004 "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
+               
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "__db_version_2" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ol_cv_header_db2=yes
+else
+  rm -rf conftest*
+  ol_cv_header_db2=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ol_cv_header_db2" 1>&6
+else
+       ol_cv_header_db2=no
+fi
+
+
+ echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
+echo "configure:4036: 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
+  
+       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
+
+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
+
+ fi
+
+
+       if test $ol_cv_berkeley_db2 = yes ; then
+               ol_link_ldbm=db2
+               ol_with_ldbm_api=db2
+
+               if test $ol_with_ldbm_type = hash ; then
+                       cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBHASH 1
+EOF
+
+               else
+                       cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBBTREE 1
+EOF
+
+               fi
+
+                                               if test $ol_cv_lib_db2 != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
+               fi
+       fi
+fi
+
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
+       echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
+echo "configure:4082: checking for Berkeley DB library" >&5
+if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+       ol_LIBS="$LIBS"
+       echo $ac_n "checking for dbopen""... $ac_c" 1>&6
+echo "configure:4088: 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 4093 "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 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
+
+; return 0; }
+EOF
+if { (eval echo configure:4116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_dbopen=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_dbopen=no"
+fi
+rm -f conftest*
+fi
+
+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
+
+               echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
+echo "configure:4135: 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="-ldb  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4143 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dbopen();
+
+int main() {
+dbopen()
+; return 0; }
+EOF
+if { (eval echo configure:4154: \"$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_cv_lib_db=-ldb
+else
+  echo "$ac_t""no" 1>&6
+ol_cv_lib_db=no
+fi
+
+       
+fi
+
+       LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_lib_db" 1>&6
+
+
+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:4189: 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 4194 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4199: \"$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 $ol_cv_header_db2 = yes ; then
+       
+       ol_cv_header_db=$ac_cv_header_db_185_h
+else
+       ol_cv_header_db=$ac_cv_header_db_h
+fi
+
+
+ echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
+echo "configure:4235: 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
+  
+       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
+
+fi
+
+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
+
+ fi
+
+
+       if test $ol_cv_berkeley_db = yes ; then
+               ol_link_ldbm=db
+               ol_with_ldbm_api=db
+
+               if test $ol_with_ldbm_type = hash ; then
+                       cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBHASH 1
+EOF
+
+               else
+                       cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBBTREE 1
+EOF
+
+               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:4288: 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 4293 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4298: \"$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
@@ -1600,160 +4320,266 @@ else
 fi
 done
 
+fi
+
+if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
+       echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
+       ol_with_ldbm_api=none
+fi
 
-       if test "$ac_cv_header_pthread_h" = yes ; then
-                               echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:1607: checking POSIX thread version" >&5
-               if eval "test \"`echo '$''{'cf_cv_pthread_version'+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:4333: 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
-  
-                       cat > conftest.$ac_ext <<EOF
-#line 1613 "configure"
+       ol_LIBS="$LIBS"
+       echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
+echo "configure:4339: 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 4344 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    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 gdbm_open();
 
-#include <pthread.h>
-/* this check could be improved */
-#ifdef PTHREAD_ONCE_INIT
-       final
+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_gdbm_open) || defined (__stub___gdbm_open)
+choke me
+#else
+gdbm_open();
 #endif
-                       
+
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "final" >/dev/null 2>&1; then
+if { (eval echo configure:4367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  pthread_final=yes
+  eval "ac_cv_func_gdbm_open=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  pthread_final=no
+  eval "ac_cv_func_gdbm_open=no"
 fi
 rm -f conftest*
+fi
 
+if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_cv_lib_gdbm=yes
+else
+  echo "$ac_t""no" 1>&6
 
-                       cat > conftest.$ac_ext <<EOF
-#line 1635 "configure"
+               echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
+echo "configure:4386: 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="-lgdbm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4394 "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();
 
-#include <pthread.h>
-/* this check could be improved */
-#ifdef pthread_once_init
-       draft4
-#endif
-                       
+int main() {
+gdbm_open()
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "draft4" >/dev/null 2>&1; then
+if { (eval echo configure:4405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  pthread_draft4=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  pthread_draft4=no
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_cv_lib_gdbm=-lgdbm
+else
+  echo "$ac_t""no" 1>&6
+ol_cv_lib_gdbm=no
+fi
 
+       
+fi
+
+       LIBS="$ol_LIBS"
 
-                       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
-               
 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_t""$ol_cv_lib_gdbm" 1>&6
+
+
+ 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:4440: 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 4445 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4450: \"$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:4477: 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
-               LTHREAD_DEFS="-DNO_THREADS"
+               ol_cv_gdbm=yes
        fi
+
 fi
 
+echo "$ac_t""$ol_cv_gdbm" 1>&6
+ if test $ol_cv_gdbm = yes ; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_GDBM 1
+EOF
 
-ldbm_use="none"
-LDBM_DEFS=
-LDBM_LIBS=
+ fi
 
-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:1689: checking for dbopen" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
+
+       if test $ol_cv_gdbm = yes ; then
+               ol_link_ldbm=gdbm
+               ol_with_ldbm_api=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:4511: 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:4517: 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 1694 "configure"
+#line 4522 "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 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 dbopen();
+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_dbopen) || defined (__stub___dbopen)
+#if defined (__stub_dbm_open) || defined (__stub___dbm_open)
 choke me
 #else
-dbopen();
+dbm_open();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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_func_dbopen=yes"
+  eval "ac_cv_func_dbm_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_dbm_open=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-                       ldbm_use=$ldbm_prefer
-                       ldbm_prefer=found
+  ol_cv_lib_ndbm=yes
 else
   echo "$ac_t""no" 1>&6
 
-                       echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:1738: checking for dbopen in -ldb" >&5
-ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
+               echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
+echo "configure:4564: 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="-ldb  $LIBS"
+LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1746 "configure"
+#line 4572 "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 dbm_open();
 
 int main() {
-dbopen()
+dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4583: \"$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
@@ -1768,79 +4594,78 @@ 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_ndbm=-lndbm
 else
   echo "$ac_t""no" 1>&6
-fi
-               
-fi
-
-
-               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
 
-               echo $ac_n "checking for db2""... $ac_c" 1>&6
-echo "configure:1794: checking for db2" >&5
-               if eval "test \"`echo '$''{'cf_cv_db2'+set}'`\" = set"; then
+                       echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
+echo "configure:4603: 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
 else
-  
-                       cat > conftest.$ac_ext <<EOF
-#line 1800 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-ldbm  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4611 "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 dbm_open();
 
-#include <db.h>
-/* this check could be improved */
-#ifdef DB_VERSION_MAJOR
-#if DB_VERSION_MAJOR == 2
-       __db_version_2
-#endif
-#endif
-                       
+int main() {
+dbm_open()
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "__db_version_2" >/dev/null 2>&1; then
+if { (eval echo configure:4622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  cf_cv_db2=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  cf_cv_db2=no
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
 
 fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  ol_cv_lib_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
 
-               echo "$ac_t""$cf_cv_db2" 1>&6
 
-               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
+ 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:1834: checking for $ac_hdr" >&5
+echo "configure:4659: 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 1839 "configure"
+#line 4664 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1866,88 +4691,179 @@ else
 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
+ echo $ac_n "checking for db""... $ac_c" 1>&6
+echo "configure:4696: 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
 
-                               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
+
+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
+
+               if test $ol_cv_lib_ndbm != yes ; then
+                       LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
                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:1885: checking for gdbm_open in -lgdbm" >&5
-ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
+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 $ol_enable_wrappers = yes ; then
+       echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
+echo "configure:4744: 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
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lgdbm  $LIBS"
+LIBS="-lwrap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1893 "configure"
+#line 4752 "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 hosts_access();
 
 int main() {
-gdbm_open()
+hosts_access()
 ; return 0; }
 EOF
-if { (eval echo configure:1904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4763: \"$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_wrappers=yes
+else
+  echo "$ac_t""no" 1>&6
+have_wrappers=no
+fi
+
+
+       if test $have_wrappers = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_TCPD 1
+EOF
+
+               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
+
+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:4809: 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 4814 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4819: \"$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
-  
-                       ldbm_use=$ldbm_prefer
-                       ldbm_prefer=found
-                       LDBM_LIBS="$LDBM_LIBS -lgdbm"
-                       LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_GDBM"
-               
+    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
-       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:1932: checking for dbm_open in -ldbm" >&5
-ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
+done
+
+
+if test $ol_link_termcap = no ; then
+       echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
+echo "configure:4848: 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="-ldbm  $LIBS"
+LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1940 "configure"
+#line 4856 "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 dbm_open();
+char tputs();
 
 int main() {
-dbm_open()
+tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:1951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4867: \"$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
@@ -1962,49 +4878,44 @@ 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"
-               
+  have_termcap=yes
 else
   echo "$ac_t""no" 1>&6
+have_termcap=no
 fi
-       fi
 
-       if test $ldbm_prefer != found ; then
-               { echo "configure: error: could not find suitable db for $ldbm_prefer backend" 1>&2; exit 1; }
-       fi
+       if test $have_termcap = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_TERMCAP 1
+EOF
 
-       if test $ldbm_use = ndbm ; then
-               echo "configure: warning: LDBM using NDBM" 1>&2
+               ol_link_termcap=yes
+               TERMCAP_LIBS=-ltermcap
        fi
 fi
 
-if test "$SLAPD_TCP_WRAPPERS" = "yes" ; then
-       echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
-echo "configure:1989: checking for hosts_access in -lwrap" >&5
-ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
+if test $ol_link_termcap = no ; then
+       echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
+echo "configure:4900: 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
   ac_save_LIBS="$LIBS"
-LIBS="-lwrap  $LIBS"
+LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1997 "configure"
+#line 4908 "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 hosts_access();
+char initscr();
 
 int main() {
-hosts_access()
+initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:2008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4919: \"$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
@@ -2019,29 +4930,39 @@ 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_ncurses=yes
 else
   echo "$ac_t""no" 1>&6
+have_ncurses=no
 fi
 
+       if test $have_ncurses = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_NCURSES 1
+EOF
+
+               ol_link_termcap=yes
+               TERMCAP_LIBS=-lncurses
+       fi
 fi
 
-# ud needs termcap (should insert check here)
-LIBTERMCAP="-ltermcap"
+if test $ol_link_termcap = no ; then
+       cat >> confdefs.h <<\EOF
+#define NO_TERMCAP 1
+EOF
 
+       TERMCAP_LIBS=
+fi
 
 # FreeBSD (and others) have crypt(3) in -lcrypt
-if test "$SLAPD_CRYPT" = "yes" ; then
+if test $ol_enable_crypt != no ; then
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:2040: checking for crypt" >&5
+echo "configure:4961: checking for crypt" >&5
 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2045 "configure"
+#line 4966 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -2064,7 +4985,7 @@ crypt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -2083,7 +5004,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:2087: checking for crypt in -lcrypt" >&5
+echo "configure:5008: 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
@@ -2091,7 +5012,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2095 "configure"
+#line 5016 "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
@@ -2102,7 +5023,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:2106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5027: \"$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
 
 
        if test $have_crypt = yes ; then
-               LUTIL_DEFS="$LUTIL_DEFS -DLDAP_CRYPT"
+               cat >> confdefs.h <<\EOF
+#define HAVE_CRYPT 1
+EOF
+
        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
 
-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:2143: checking for $ac_hdr that defines DIR" >&5
-if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+# FreeBSD (and others) have setproctitle(3) in -lutil
+if test $ol_enable_proctitle != no ; then
+       echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
+echo "configure:5071: checking for setproctitle" >&5
+if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2148 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <$ac_hdr>
-int main() {
-DIR *dirp = 0;
-; return 0; }
-EOF
-if { (eval echo configure:2156: \"$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:2181: 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 2189 "configure"
+#line 5076 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char setproctitle(); 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 setproctitle();
 
 int main() {
-opendir()
+
+/* 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_setproctitle) || defined (__stub___setproctitle)
+choke me
+#else
+setproctitle();
+#endif
+
 ; return 0; }
 EOF
-if { (eval echo configure:2200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5099: \"$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_setproctitle=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_setproctitle=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_'setproctitle`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  LIBS="$LIBS -ldir"
+  have_setproctitle=yes
 else
   echo "$ac_t""no" 1>&6
-fi
 
-else
-echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2222: checking for opendir in -lx" >&5
-ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+               echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
+echo "configure:5118: checking for setproctitle in -lutil" >&5
+ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lx  $LIBS"
+LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2230 "configure"
+#line 5126 "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 setproctitle();
 
 int main() {
-opendir()
+setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:2241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5137: \"$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
@@ -2252,20 +5148,32 @@ 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"
+  have_setproctitle=yes
+                       LUTIL_LIBS="$LUTIL_LIBS -lutil"
 else
   echo "$ac_t""no" 1>&6
+have_setproctitle=no
+                       LIBOBJS="$LIBOBJS setproctitle.o"
+fi
+
 fi
 
+
+       if test $have_setproctitle = yes ; then
+               cat >> confdefs.h <<\EOF
+#define HAVE_SETPROCTITLE 1
+EOF
+
+       fi
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2264: checking for ANSI C header files" >&5
+echo "configure:5172: 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 2269 "configure"
+#line 5177 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2273,7 +5181,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2290,7 +5198,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 2294 "configure"
+#line 5202 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2308,7 +5216,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 2312 "configure"
+#line 5220 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2328,48 +5236,178 @@ if test $ac_cv_header_stdc = yes; then
 if test "$cross_compiling" = yes; then
   :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2333 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 5241 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:5252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+
+if test $ac_cv_header_stdc != yes; then
+       echo "configure: warning: could not locate Standard C headers" 1>&2
+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:5285: 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 5290 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:5298: \"$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:5323: 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 5331 "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:5342: \"$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:5364: 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 5372 "configure"
 #include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+/* 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:2344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
-  :
+if { (eval echo configure:5383: \"$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 -fr conftest*
-  ac_cv_header_stdc=no
-fi
-rm -fr conftest*
+  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
 
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2368: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:5406: 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 2373 "configure"
+#line 5411 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -2385,7 +5423,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:2389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2406,32 +5444,44 @@ EOF
 fi
 
 for ac_hdr in \
-       stddef.h        \
-       fcntl.h         \
-       limits.h        \
-       malloc.h        \
-       sgtty.h         \
-       sys/file.h      \
-       sys/ioctl.h     \
-       sys/time.h      \
-       syslog.h        \
-       termio.h        \
-       unistd.h        \
+       stdarg.h                \
+       stddef.h                \
+       errno.h                 \
+       fcntl.h                 \
+       filio.h                 \
+       getopt.h                \
+       libutil.h               \
+       limits.h                \
+       malloc.h                \
+       regex.h                 \
+       sgtty.h                 \
+       sys/file.h              \
+       sys/filio.h             \
+       sys/errno.h             \
+       sys/ioctl.h             \
+       sys/param.h             \
+       sys/socket.h    \
+       sys/syslog.h    \
+       sys/time.h              \
+       sys/types.h             \
+       syslog.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:2425: checking for $ac_hdr" >&5
+echo "configure:5475: 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 2430 "configure"
+#line 5480 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2459,12 +5509,12 @@ done
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2463: checking for uid_t in sys/types.h" >&5
+echo "configure:5513: 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 2468 "configure"
+#line 5518 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -2493,7 +5543,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:2497: checking type of array argument to getgroups" >&5
+echo "configure:5547: 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
@@ -2501,7 +5551,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 2505 "configure"
+#line 5555 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -2526,7 +5576,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5580: \"$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
@@ -2540,7 +5590,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 2544 "configure"
+#line 5594 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -2564,12 +5614,12 @@ EOF
 
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:2568: checking for mode_t" >&5
+echo "configure:5618: 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 2573 "configure"
+#line 5623 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2597,12 +5647,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2601: checking for off_t" >&5
+echo "configure:5651: 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 2606 "configure"
+#line 5656 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2630,12 +5680,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2634: checking for pid_t" >&5
+echo "configure:5684: 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 2639 "configure"
+#line 5689 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2663,12 +5713,12 @@ EOF
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2667: checking return type of signal handlers" >&5
+echo "configure:5717: 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 2672 "configure"
+#line 5722 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2685,7 +5735,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2704,12 +5754,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2708: checking for size_t" >&5
+echo "configure:5758: 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 2713 "configure"
+#line 5763 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2737,12 +5787,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2741: checking for uid_t in sys/types.h" >&5
+echo "configure:5791: 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 2746 "configure"
+#line 5796 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -2771,12 +5821,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:2775: checking for st_blksize in struct stat" >&5
+echo "configure:5825: 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 2780 "configure"
+#line 5830 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -2784,7 +5834,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:2788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -2805,12 +5855,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2809: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:5859: 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 2814 "configure"
+#line 5864 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2819,7 +5869,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2840,12 +5890,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:2844: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:5894: 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 2849 "configure"
+#line 5899 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -2853,7 +5903,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:2857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -2874,13 +5924,58 @@ EOF
 fi
 
 
+
+echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
+echo "configure:5930: checking if toupper() requires islower()" >&5
+if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       if test "$cross_compiling" = yes; then
+  ol_cv_c_upper_lower=safe
+else
+  cat > conftest.$ac_ext <<EOF
+#line 5939 "configure"
+#include "confdefs.h"
+
+#include <ctype.h>
+main()
+{
+       if ('C' == toupper('C'))
+               exit(0);
+       else
+               exit(1);
+}
+EOF
+if { (eval echo configure:5951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  ol_cv_c_upper_lower=no
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ol_cv_c_upper_lower=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
+if test $ol_cv_c_upper_lower != no ; then
+       cat >> confdefs.h <<\EOF
+#define C_UPPER_LOWER 1
+EOF
+
+fi
+
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2879: checking for working const" >&5
+echo "configure:5974: 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 2884 "configure"
+#line 5979 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2929,7 +6024,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:2933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2950,8 +6045,9 @@ EOF
 fi
 
 
+
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2955: checking for 8-bit clean memcmp" >&5
+echo "configure:6051: 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
@@ -2959,7 +6055,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 2963 "configure"
+#line 6059 "configure"
 #include "confdefs.h"
 
 main()
@@ -2969,7 +6065,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6069: \"$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
@@ -2986,54 +6082,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:2991: 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 2996 "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:3013: \"$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:3032: checking for strftime" >&5
+echo "configure:6087: 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 3037 "configure"
+#line 6092 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -3056,7 +6111,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -3078,7 +6133,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:3082: checking for strftime in -lintl" >&5
+echo "configure:6137: 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
@@ -3086,7 +6141,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3090 "configure"
+#line 6145 "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
@@ -3097,7 +6152,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:3101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6156: \"$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
@@ -3124,12 +6179,12 @@ fi
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:3128: checking for vprintf" >&5
+echo "configure:6183: 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 3133 "configure"
+#line 6188 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -3152,7 +6207,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
@@ -3176,12 +6231,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:3180: checking for _doprnt" >&5
+echo "configure:6235: 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 3185 "configure"
+#line 6240 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -3204,7 +6259,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -3228,8 +6283,67 @@ fi
 
 fi
 
+
+if test $ac_cv_func_vprintf = yes ; then
+               for ac_func in vsnprintf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6292: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 6297 "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:6320: \"$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
+
+fi
+
 echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
-echo "configure:3233: checking for wait3 that fills in rusage" >&5
+echo "configure:6347: 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
@@ -3237,7 +6351,7 @@ else
   ac_cv_func_wait3_rusage=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3241 "configure"
+#line 6355 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3268,7 +6382,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:3272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6386: \"$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
@@ -3292,28 +6406,43 @@ fi
 
 
 for ac_func in \
+       bcopy                   \
+       getopt                  \
+       flock                   \
        gethostname             \
        gettimeofday    \
+       getdtablesize   \
+       lockf                   \
+       memcpy                  \
+       memmove                 \
+       mkstemp                 \
        mktime                  \
        select                  \
+       setpwfile               \
+       setsid                  \
+       signal                  \
+       sigset                  \
+       snprintf                \
        socket                  \
-       strdup                  \
        strerror                \
        strstr                  \
        strrchr                 \
+       strsep                  \
        strtod                  \
        strtol                  \
        strtoul                 \
-       memcpy                  \
+       sysconf                 \
+       tempnam                 \
+       waitpid                 \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3312: checking for $ac_func" >&5
+echo "configure:6441: 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 3317 "configure"
+#line 6446 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3336,7 +6465,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3361,15 +6490,15 @@ fi
 done
 
 
-for ac_func in strdup
+for ac_func in getopt strdup tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3368: checking for $ac_func" >&5
+echo "configure:6497: 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 3373 "configure"
+#line 6502 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3392,7 +6521,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3422,13 +6551,13 @@ done
 # Check Configuration
 
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:3426: checking declaration of sys_errlist" >&5
-if eval "test \"`echo '$''{'cf_cv_dcl_sys_errlist'+set}'`\" = set"; then
+echo "configure:6555: 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 3432 "configure"
+#line 6561 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -3438,66 +6567,180 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:3442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6571: \"$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:3463: checking existence of sys_errlist" >&5
-       if eval "test \"`echo '$''{'cf_cv_have_sys_errlist'+set}'`\" = set"; then
+echo "configure:6592: 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 3469 "configure"
+#line 6598 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:3476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6605: \"$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
+       cat >> confdefs.h <<\EOF
+#define LDAP_DEBUG 1
+EOF
 
+fi
+if test $ol_enable_libui = yes ; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_LIBUI 1
+EOF
 
-  
-  
-  
+fi
+if test $ol_enable_cache = no ; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_NOCACHE 1
+EOF
+
+fi
+if test $ol_enable_dns != no ; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_DNS 1
+EOF
+
+fi
+if test $ol_enable_proctitle != no ; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_PROCTITLE 1
+EOF
+
+fi
+if test $ol_enable_referrals != no ; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_REFERRALS 1
+EOF
+
+fi
+if test $ol_enable_cldap != no ; then
+       cat >> confdefs.h <<\EOF
+#define LDAP_CONNECTIONLESS 1
+EOF
+
+fi
+
+if test $ol_enable_aclgroups != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_ACLGROUPS 1
+EOF
+
+fi
+if test $ol_enable_crypt != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_CRYPT 1
+EOF
+
+fi
+if test $ol_enable_md5 != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_MD5 1
+EOF
+
+fi
+if test $ol_enable_sha1 != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_SHA1 1
+EOF
+
+fi
+if test $ol_enable_phonetic != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_PHONETIC 1
+EOF
+
+fi
+if test $ol_enable_rlookups != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_RLOOKUPS 1
+EOF
+
+fi
+
+if test $ol_link_ldbm != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_LDBM 1
+EOF
+
+       BUILD_SLAPD=yes
+       BUILD_LDBM=yes
+fi
+
+if test $ol_enable_passwd != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_PASSWD 1
+EOF
+
+       BUILD_SLAPD=yes
+       BUILD_PASSWD=yes
+fi
+
+if test $ol_enable_shell != no ; then
+       cat >> confdefs.h <<\EOF
+#define SLAPD_SHELL 1
+EOF
+
+       BUILD_SLAPD=yes
+       BUILD_SHELL=yes
+fi
+
+if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
+       $BUILD_SLAPD = yes ; then
+       BUILD_SLURPD=yes
+fi
+
+if test $ol_enable_ldapd != no ; then
+       BUILD_LDAPD=yes
+fi
 
 
 
 
+  
+  
+  
+
 
 
 
@@ -3679,8 +6922,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
@@ -3689,28 +6930,24 @@ 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
-s%@SLAPD_LDBM@%$SLAPD_LDBM%g
-s%@SLAPD_PASSWD@%$SLAPD_PASSWD%g
-s%@SLAPD_SHELL@%$SLAPD_SHELL%g
+s%@BUILD_LDBM@%$BUILD_LDBM%g
+s%@BUILD_PASSWD@%$BUILD_PASSWD%g
+s%@BUILD_SHELL@%$BUILD_SHELL%g
 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
-s%@LDAP_DEFS@%$LDAP_DEFS%g
 s%@LDAP_LIBS@%$LDAP_LIBS%g
-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%@SLURPD_DEFS@%$SLURPD_DEFS%g
 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
-s%@LDBM_DEFS@%$LDBM_DEFS%g
 s%@LDBM_LIBS@%$LDBM_LIBS%g
-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_LIBS@%$KRB_LIBS%g
+s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
 
 CEOF
 EOF
@@ -3958,7 +7195,10 @@ cat >> $CONFIG_STATUS <<EOF
 
 EOF
 cat >> $CONFIG_STATUS <<\EOF
+
 date > stamp-h
+echo Please \"make depend\" to build dependencies
+
 exit 0
 EOF
 chmod +x $CONFIG_STATUS