]> git.sur5r.net Git - openldap/commitdiff
Import non-reentrant database "big mutex" code from -devel.
authorKurt Zeilenga <kurt@openldap.org>
Thu, 28 Jan 1999 21:24:43 +0000 (21:24 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 28 Jan 1999 21:24:43 +0000 (21:24 +0000)
configure
configure.in
include/getopt-compat.h
include/ldbm.h
include/portable.h.in
libraries/libldbm/ldbm.c
servers/slapd/back-ldbm/back-ldbm.h
servers/slapd/back-ldbm/dbcache.c
servers/slapd/back-ldbm/init.c

index 711604d7a179f11fc23456dbefbf3f44b9dd5190..eef21dc8ef786f8a785085a5f3a929c0ae395005 100755 (executable)
--- a/configure
+++ b/configure
@@ -4789,43 +4789,64 @@ EOF
                                ol_with_yielding_select=yes
                        fi
 
-                       echo $ac_n "checking for misplaced posix thread in headers""... $ac_c" 1>&6
-echo "configure:4794: checking for misplaced posix thread in headers" >&5
-if eval "test \"`echo '$''{'ol_cv_header_misplaced_pthreads'+set}'`\" = set"; then
+                                               for ac_func in \
+                               thr_setconcurrency \
+                               thr_getconcurrency \
+                       
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:4799: 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 4800 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 4804 "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();
 
-#include <sys/types.h>
-typedef double pthread_t;
-                               
 int main() {
 
-                               pthread_t thread = 0.0;
-                               
+/* 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:4812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  ol_cv_header_misplaced_pthreads=no
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ol_cv_header_misplaced_pthreads=yes
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
-                       
 fi
 
-echo "$ac_t""$ol_cv_header_misplaced_pthreads" 1>&6
+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_cv_header_misplaced_pthreads" = yes ; then
-                               { echo "configure: error: pthread types are misplaced, use --with-threads=posix" 1>&2; exit 1; };
-                       fi
                fi
        fi
 
@@ -4833,17 +4854,17 @@ echo "$ac_t""$ol_cv_header_misplaced_pthreads" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4837: checking for $ac_hdr" >&5
+echo "configure:4858: 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 4842 "configure"
+#line 4863 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4871,7 +4892,7 @@ done
 
        if test $ac_cv_header_lwp_lwp_h = yes ; then
                echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
-echo "configure:4875: checking for lwp_create in -llwp" >&5
+echo "configure:4896: 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
@@ -4879,7 +4900,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4883 "configure"
+#line 4904 "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
@@ -4890,7 +4911,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:4894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4915: \"$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
@@ -4943,17 +4964,17 @@ if test $ol_with_threads = manual ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4947: checking for $ac_hdr" >&5
+echo "configure:4968: 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 4952 "configure"
+#line 4973 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4982,12 +5003,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4986: checking for $ac_func" >&5
+echo "configure:5007: 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 4991 "configure"
+#line 5012 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -5010,7 +5031,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -5036,7 +5057,7 @@ done
 
        
 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:5040: checking for LinuxThreads" >&5
+echo "configure:5061: checking for LinuxThreads" >&5
 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5057,17 +5078,17 @@ echo "$ac_t""$ol_cv_linux_threads" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5061: checking for $ac_hdr" >&5
+echo "configure:5082: 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 5066 "configure"
+#line 5087 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5097,17 +5118,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5101: checking for $ac_hdr" >&5
+echo "configure:5122: 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 5106 "configure"
+#line 5127 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5137,17 +5158,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5141: checking for $ac_hdr" >&5
+echo "configure:5162: 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 5146 "configure"
+#line 5167 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5202,13 +5223,13 @@ EOF
 
 
                                        echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:5206: checking for thread specific errno" >&5
+echo "configure:5227: checking for thread specific errno" >&5
 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 5212 "configure"
+#line 5233 "configure"
 #include "confdefs.h"
 
 #include <errno.h>
@@ -5219,7 +5240,7 @@ int x = errno;
                        
 ; return 0; }
 EOF
-if { (eval echo configure:5223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_errno_thread_specific=yes
 else
@@ -5251,44 +5272,6 @@ if test $ol_link_threads = no ; then
                ol_with_threads=no
        fi
 
-       echo $ac_n "checking for misplaced posix thread in headers""... $ac_c" 1>&6
-echo "configure:5256: checking for misplaced posix thread in headers" >&5
-if eval "test \"`echo '$''{'ol_cv_header_misplaced_pthreads'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-               cat > conftest.$ac_ext <<EOF
-#line 5262 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-typedef double pthread_t;
-                       
-int main() {
-
-                               pthread_t thread = 0.0;
-                       
-; return 0; }
-EOF
-if { (eval echo configure:5274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ol_cv_header_misplaced_pthreads=no
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ol_cv_header_misplaced_pthreads=yes
-fi
-rm -f conftest*
-       
-fi
-
-echo "$ac_t""$ol_cv_header_misplaced_pthreads" 1>&6
-
-       if test "$ol_cv_header_misplaced_pthreads" = yes ; then
-               { echo "configure: error: pthread types are misplaced, use --with-threads=posix" 1>&2; exit 1; };
-       fi
-
        cat >> confdefs.h <<\EOF
 #define NO_THREADS 1
 EOF
@@ -5299,13 +5282,13 @@ fi
 ol_link_ldbm=no 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
        echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
-echo "configure:5303: checking for DB2 library" >&5
+echo "configure:5286: 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:5309: checking for db_open in -ldb" >&5
+echo "configure:5292: 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
@@ -5313,7 +5296,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5317 "configure"
+#line 5300 "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
@@ -5324,7 +5307,7 @@ int main() {
 db_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5311: \"$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
@@ -5355,17 +5338,17 @@ for ac_hdr in db.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5359: checking for $ac_hdr" >&5
+echo "configure:5342: 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 5364 "configure"
+#line 5347 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5393,13 +5376,13 @@ done
 
 if test $ac_cv_header_db_h = yes ; then
        echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
-echo "configure:5397: checking if db.h is DB2" >&5
+echo "configure:5380: 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 5403 "configure"
+#line 5386 "configure"
 #include "confdefs.h"
 
 #                      include <db.h>
@@ -5431,7 +5414,7 @@ fi
 
  
  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
-echo "configure:5435: checking for Berkeley DB2" >&5
+echo "configure:5418: 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
@@ -5477,18 +5460,18 @@ 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:5481: checking for Berkeley DB library" >&5
+echo "configure:5464: 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:5487: checking for dbopen" >&5
+echo "configure:5470: 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 5492 "configure"
+#line 5475 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbopen(); below.  */
@@ -5511,7 +5494,7 @@ dbopen();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbopen=yes"
 else
@@ -5530,7 +5513,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:5534: checking for dbopen in -ldb" >&5
+echo "configure:5517: 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
@@ -5538,7 +5521,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldb  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5542 "configure"
+#line 5525 "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
@@ -5549,7 +5532,7 @@ int main() {
 dbopen()
 ; return 0; }
 EOF
-if { (eval echo configure:5553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5536: \"$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
@@ -5584,17 +5567,17 @@ for ac_hdr in db_185.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5588: checking for $ac_hdr" >&5
+echo "configure:5571: 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 5593 "configure"
+#line 5576 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5630,7 +5613,7 @@ fi
 
  
  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
-echo "configure:5634: checking for Berkeley DB" >&5
+echo "configure:5617: 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
@@ -5683,17 +5666,17 @@ if test $ol_with_ldbm_api = manual ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5687: checking for $ac_hdr" >&5
+echo "configure:5670: 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 5692 "configure"
+#line 5675 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5728,18 +5711,18 @@ fi
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
        echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
-echo "configure:5732: checking for GDBM library" >&5
+echo "configure:5715: checking for GDBM library" >&5
 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
-echo "configure:5738: checking for gdbm_open" >&5
+echo "configure:5721: 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 5743 "configure"
+#line 5726 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -5762,7 +5745,7 @@ gdbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gdbm_open=yes"
 else
@@ -5781,7 +5764,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:5785: checking for gdbm_open in -lgdbm" >&5
+echo "configure:5768: 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
@@ -5789,7 +5772,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5793 "configure"
+#line 5776 "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
@@ -5800,7 +5783,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5787: \"$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
@@ -5835,17 +5818,17 @@ echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5839: checking for $ac_hdr" >&5
+echo "configure:5822: 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 5844 "configure"
+#line 5827 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5872,7 +5855,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:5876: checking for db" >&5
+echo "configure:5859: checking for db" >&5
 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5908,18 +5891,18 @@ if test $ol_with_ldbm_api = auto ; then
        echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
 elif test $ol_with_ldbm_api = ndbm ; then
        echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:5912: checking for NDBM library" >&5
+echo "configure:5895: 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:5918: checking for dbm_open" >&5
+echo "configure:5901: 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 5923 "configure"
+#line 5906 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -5942,7 +5925,7 @@ dbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -5961,7 +5944,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:5965: checking for dbm_open in -lndbm" >&5
+echo "configure:5948: 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
@@ -5969,7 +5952,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5973 "configure"
+#line 5956 "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
@@ -5980,7 +5963,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:5984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5967: \"$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
@@ -6000,7 +5983,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:6004: checking for dbm_open in -ldbm" >&5
+echo "configure:5987: 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
@@ -6008,7 +5991,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6012 "configure"
+#line 5995 "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
@@ -6019,7 +6002,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:6023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6006: \"$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
@@ -6056,17 +6039,17 @@ echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6060: checking for $ac_hdr" >&5
+echo "configure:6043: 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 6065 "configure"
+#line 6048 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6093,7 +6076,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:6097: checking for db" >&5
+echo "configure:6080: checking for db" >&5
 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6140,17 +6123,17 @@ if test $ol_enable_wrappers != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6144: checking for $ac_hdr" >&5
+echo "configure:6127: 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 6149 "configure"
+#line 6132 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6181,7 +6164,7 @@ done
                have_wrappers=no
        else
                echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
-echo "configure:6185: checking for main in -lwrap" >&5
+echo "configure:6168: checking for main in -lwrap" >&5
 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6189,14 +6172,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lwrap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6193 "configure"
+#line 6176 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:6200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6183: \"$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
@@ -6242,17 +6225,17 @@ for ac_hdr in termcap.h ncurses.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6246: checking for $ac_hdr" >&5
+echo "configure:6229: 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 6251 "configure"
+#line 6234 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6281,7 +6264,7 @@ done
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:6285: checking for tputs in -ltermcap" >&5
+echo "configure:6268: 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
@@ -6289,7 +6272,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6293 "configure"
+#line 6276 "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
@@ -6300,7 +6283,7 @@ int main() {
 tputs()
 ; return 0; }
 EOF
-if { (eval echo configure:6304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6287: \"$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
@@ -6333,7 +6316,7 @@ fi
 
 if test $ol_link_termcap = no ; then
        echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:6337: checking for initscr in -lncurses" >&5
+echo "configure:6320: 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
@@ -6341,7 +6324,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6345 "configure"
+#line 6328 "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
@@ -6352,7 +6335,7 @@ int main() {
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:6356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6339: \"$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
@@ -6394,12 +6377,12 @@ fi
 # FreeBSD (and others) have crypt(3) in -lcrypt
 if test $ol_enable_crypt != no ; then
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:6398: checking for crypt" >&5
+echo "configure:6381: 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 6403 "configure"
+#line 6386 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -6422,7 +6405,7 @@ crypt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -6441,7 +6424,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:6445: checking for crypt in -lcrypt" >&5
+echo "configure:6428: 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
@@ -6449,7 +6432,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6453 "configure"
+#line 6436 "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
@@ -6460,7 +6443,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:6464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6447: \"$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
@@ -6504,12 +6487,12 @@ fi
 # FreeBSD (and others) have setproctitle(3) in -lutil
 if test $ol_enable_proctitle != no ; then
        echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:6508: checking for setproctitle" >&5
+echo "configure:6491: 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 6513 "configure"
+#line 6496 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -6532,7 +6515,7 @@ setproctitle();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_setproctitle=yes"
 else
@@ -6551,7 +6534,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:6555: checking for setproctitle in -lutil" >&5
+echo "configure:6538: 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
@@ -6559,7 +6542,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6563 "configure"
+#line 6546 "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
@@ -6570,7 +6553,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:6574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6557: \"$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
@@ -6605,12 +6588,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:6609: checking for ANSI C header files" >&5
+echo "configure:6592: 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 6614 "configure"
+#line 6597 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -6618,7 +6601,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6635,7 +6618,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 6639 "configure"
+#line 6622 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -6653,7 +6636,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 6657 "configure"
+#line 6640 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -6674,7 +6657,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 6678 "configure"
+#line 6661 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -6685,7 +6668,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:6689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -6718,12 +6701,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:6722: checking for $ac_hdr that defines DIR" >&5
+echo "configure:6705: 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 6727 "configure"
+#line 6710 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -6731,7 +6714,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:6735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -6756,7 +6739,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:6760: checking for opendir in -ldir" >&5
+echo "configure:6743: 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
@@ -6764,7 +6747,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6768 "configure"
+#line 6751 "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
@@ -6775,7 +6758,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:6779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6762: \"$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
@@ -6797,7 +6780,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:6801: checking for opendir in -lx" >&5
+echo "configure:6784: 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
@@ -6805,7 +6788,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6809 "configure"
+#line 6792 "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
@@ -6816,7 +6799,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:6820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6803: \"$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
@@ -6839,12 +6822,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:6843: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:6826: 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 6848 "configure"
+#line 6831 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -6860,7 +6843,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -6881,12 +6864,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:6885: checking POSIX termios" >&5
+echo "configure:6868: checking POSIX termios" >&5
 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6890 "configure"
+#line 6873 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -6896,7 +6879,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:6900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   am_cv_sys_posix_termios=yes
 else
@@ -6912,7 +6895,7 @@ echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
 
 
  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:6916: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:6899: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6921,7 +6904,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 6925 "configure"
+#line 6908 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -6941,7 +6924,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 6945 "configure"
+#line 6928 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -7011,17 +6994,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7015: checking for $ac_hdr" >&5
+echo "configure:6998: 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 7020 "configure"
+#line 7003 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7049,12 +7032,12 @@ done
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:7053: checking for uid_t in sys/types.h" >&5
+echo "configure:7036: 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 7058 "configure"
+#line 7041 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -7083,7 +7066,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:7087: checking type of array argument to getgroups" >&5
+echo "configure:7070: 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
@@ -7091,7 +7074,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 7095 "configure"
+#line 7078 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -7116,7 +7099,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7103: \"$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
@@ -7130,7 +7113,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 7134 "configure"
+#line 7117 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -7153,12 +7136,12 @@ cat >> confdefs.h <<EOF
 EOF
 
  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:7157: checking for mode_t" >&5
+echo "configure:7140: 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 7162 "configure"
+#line 7145 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7186,12 +7169,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:7190: checking for off_t" >&5
+echo "configure:7173: 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 7195 "configure"
+#line 7178 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7219,12 +7202,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:7223: checking for pid_t" >&5
+echo "configure:7206: 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 7228 "configure"
+#line 7211 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7252,19 +7235,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:7256: checking for ptrdiff_t" >&5
+echo "configure:7239: checking for ptrdiff_t" >&5
 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7261 "configure"
+#line 7244 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:7268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -7285,12 +7268,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:7289: checking return type of signal handlers" >&5
+echo "configure:7272: 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 7294 "configure"
+#line 7277 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -7307,7 +7290,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:7311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -7326,12 +7309,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:7330: checking for size_t" >&5
+echo "configure:7313: 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 7335 "configure"
+#line 7318 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -7359,12 +7342,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:7363: checking for st_blksize in struct stat" >&5
+echo "configure:7346: 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 7368 "configure"
+#line 7351 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -7372,7 +7355,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:7376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -7393,12 +7376,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:7397: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:7380: 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 7402 "configure"
+#line 7385 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -7407,7 +7390,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:7411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -7428,12 +7411,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:7432: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:7415: 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 7437 "configure"
+#line 7420 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -7441,7 +7424,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:7445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -7464,7 +7447,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:7468: checking if toupper() requires islower()" >&5
+echo "configure:7451: 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
@@ -7473,7 +7456,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 7477 "configure"
+#line 7460 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -7485,7 +7468,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:7489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7472: \"$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
@@ -7508,12 +7491,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:7512: checking for working const" >&5
+echo "configure:7495: 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 7517 "configure"
+#line 7500 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -7562,7 +7545,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:7566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -7590,14 +7573,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:7594: checking whether byte ordering is bigendian" >&5
+echo "configure:7577: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 7601 "configure"
+#line 7584 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -7608,11 +7591,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 7616 "configure"
+#line 7599 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -7623,7 +7606,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -7643,7 +7626,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7647 "configure"
+#line 7630 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -7656,7 +7639,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:7660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -7680,7 +7663,7 @@ EOF
 fi
 
        echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:7684: checking size of short" >&5
+echo "configure:7667: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7688,7 +7671,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7692 "configure"
+#line 7675 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7699,7 +7682,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -7719,7 +7702,7 @@ EOF
 
  
        echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:7723: checking size of int" >&5
+echo "configure:7706: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7727,7 +7710,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7731 "configure"
+#line 7714 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7738,7 +7721,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -7758,7 +7741,7 @@ EOF
 
  
        echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:7762: checking size of long" >&5
+echo "configure:7745: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7766,7 +7749,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7770 "configure"
+#line 7753 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -7777,7 +7760,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:7781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -7799,7 +7782,7 @@ EOF
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:7803: checking for 8-bit clean memcmp" >&5
+echo "configure:7786: 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
@@ -7807,7 +7790,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 7811 "configure"
+#line 7794 "configure"
 #include "confdefs.h"
 
 main()
@@ -7817,7 +7800,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:7821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7804: \"$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
@@ -7835,12 +7818,12 @@ 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 for strftime""... $ac_c" 1>&6
-echo "configure:7839: checking for strftime" >&5
+echo "configure:7822: 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 7844 "configure"
+#line 7827 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -7863,7 +7846,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -7885,7 +7868,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:7889: checking for strftime in -lintl" >&5
+echo "configure:7872: 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
@@ -7893,7 +7876,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7897 "configure"
+#line 7880 "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
@@ -7904,7 +7887,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:7908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7891: \"$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
@@ -7931,12 +7914,12 @@ fi
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:7935: checking for vprintf" >&5
+echo "configure:7918: 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 7940 "configure"
+#line 7923 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -7959,7 +7942,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
@@ -7983,12 +7966,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:7987: checking for _doprnt" >&5
+echo "configure:7970: 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 7992 "configure"
+#line 7975 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -8011,7 +7994,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -8040,12 +8023,12 @@ if test $ac_cv_func_vprintf = yes ; then
                for ac_func in vsnprintf vsprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8044: checking for $ac_func" >&5
+echo "configure:8027: 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 8049 "configure"
+#line 8032 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8068,7 +8051,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8125,12 +8108,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8129: checking for $ac_func" >&5
+echo "configure:8112: 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 8134 "configure"
+#line 8117 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8153,7 +8136,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8181,12 +8164,12 @@ done
 for ac_func in getopt strdup tempnam
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8185: checking for $ac_func" >&5
+echo "configure:8168: 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 8190 "configure"
+#line 8173 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8209,7 +8192,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8239,13 +8222,13 @@ done
 # Check Configuration
 
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:8243: checking declaration of sys_errlist" >&5
+echo "configure:8226: 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 8249 "configure"
+#line 8232 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8255,7 +8238,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:8259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
 else
@@ -8276,20 +8259,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then
 EOF
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:8280: checking existence of sys_errlist" >&5
+echo "configure:8263: 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 8286 "configure"
+#line 8269 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:8293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:8276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ol_cv_have_sys_errlist=yes
 else
index 9936807dfaf4810a51f93945269a8e637a9278f8..74a42b49924477b5f8c78f2891aa0019ea8679fb 100644 (file)
@@ -808,21 +808,11 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                                ol_with_yielding_select=yes
                        fi
 
-                       AC_CACHE_CHECK([for misplaced posix thread in headers],
-                               [ol_cv_header_misplaced_pthreads], [
-                               AC_TRY_COMPILE([
-#include <sys/types.h>
-typedef double pthread_t;
-                               ], [
-                               pthread_t thread = 0.0;
-                               ],
-                               [ol_cv_header_misplaced_pthreads=no],
-                               [ol_cv_header_misplaced_pthreads=yes])
-                       ])
-
-                       if test "$ol_cv_header_misplaced_pthreads" = yes ; then
-                               AC_MSG_ERROR([pthread types are misplaced, use --with-threads=posix]);
-                       fi
+                       dnl Check for setconcurreny functions
+                       AC_CHECK_FUNCS( \
+                               thr_setconcurrency \
+                               thr_getconcurrency \
+                       )
                fi
        fi
 
@@ -905,22 +895,6 @@ if test $ol_link_threads = no ; then
                ol_with_threads=no
        fi
 
-       AC_CACHE_CHECK([for misplaced posix thread in headers],
-               [ol_cv_header_misplaced_pthreads], [
-               AC_TRY_COMPILE([
-#include <sys/types.h>
-typedef double pthread_t;
-                       ], [
-                               pthread_t thread = 0.0;
-                       ],
-                       [ol_cv_header_misplaced_pthreads=no],
-                       [ol_cv_header_misplaced_pthreads=yes])
-       ])
-
-       if test "$ol_cv_header_misplaced_pthreads" = yes ; then
-               AC_MSG_ERROR([pthread types are misplaced, use --with-threads=posix]);
-       fi
-
        AC_DEFINE(NO_THREADS,1)
        LTHREAD_LIBS=""
 fi
index a32e8b5b36618edab4c2bab31a7267a753c31d9f..438eb533880098b86d6c447371b3e033df5a736e 100644 (file)
 
 #include <ldap_cdefs.h>
 
+LDAP_BEGIN_DECL
+
 extern char *optarg;
 extern int optind, opterr, optopt;
 
 LDAP_F int getopt LDAP_P((int, char * const [], const char *));
 
+LDAP_END_DECL
+
 #endif /* _GETOPT_COMPAT_H */
index 0a7edcdf13c36daf838cb13779804ea0bb95e02b..3f55a6ffeaa2ff3127ff5dba79a6422656755138 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef _LDBM_H_
 #define _LDBM_H_
 
+#include <ldap_cdefs.h>
+
 #ifdef LDBM_USE_DBBTREE
 
 /*****************************************************************
@@ -24,7 +26,7 @@
 #include <limits.h>
 #include <fcntl.h>
 
-#ifdef HAVE_DB185_H
+#ifdef HAVE_DB_185_H
 #      include <db_185.h>
 #else
 #      include <db.h>
 #endif
 
 
+LDAP_BEGIN_DECL
+
 typedef DBT    Datum;
 #define dsize  size
 #define dptr   data
 
 typedef DB     *LDBM;
 
+LDAP_END_DECL
+
 #define DB_TYPE                DB_BTREE
 
 /* for ldbm_open */
@@ -78,7 +84,7 @@ typedef DB    *LDBM;
 #include <limits.h>
 #include <fcntl.h>
 
-#ifdef HAVE_DB185_H
+#ifdef HAVE_DB_185_H
 #      include <db_185.h>
 #else
 #      include <db.h>
@@ -88,12 +94,16 @@ typedef DB  *LDBM;
 #      endif
 #endif
 
+LDAP_BEGIN_DECL
+
 typedef DBT    Datum;
 #define dsize  size
 #define dptr   data
 
 typedef DB     *LDBM;
 
+LDAP_END_DECL
+
 #define DB_TYPE                DB_HASH
 
 /* for ldbm_open */
@@ -127,12 +137,16 @@ typedef DB        *LDBM;
 
 #include <gdbm.h>
 
+LDAP_BEGIN_DECL
+
 typedef datum          Datum;
 
 typedef GDBM_FILE      LDBM;
 
 extern gdbm_error      gdbm_errno;
 
+LDAP_END_DECL
+
 /* for ldbm_open */
 #define LDBM_READER    GDBM_READER
 #define LDBM_WRITER    GDBM_WRITER
@@ -162,10 +176,14 @@ extern gdbm_error gdbm_errno;
 #include <fcntl.h>
 #endif
 
+LDAP_BEGIN_DECL
+
 typedef datum  Datum;
 
 typedef DBM    *LDBM;
 
+LDAP_END_DECL
+
 /* for ldbm_open */
 #define LDBM_READER    O_RDONLY
 #define LDBM_WRITER    O_WRONLY
@@ -182,6 +200,9 @@ typedef DBM *LDBM;
 
 #endif
 
+LDAP_BEGIN_DECL
+
+void ldbm_initialize( void );
 int    ldbm_errno( LDBM ldbm );
 LDBM   ldbm_open( char *name, int rw, int mode, int dbcachesize );
 void   ldbm_close( LDBM ldbm );
@@ -204,13 +225,11 @@ int       ldbm_delete( LDBM ldbm, Datum key );
 
 /* initialization of Datum structures */
 #ifdef HAVE_BERKELEY_DB2
-
 #   define ldbm_datum_init(d) ((void)memset(&(d), 0, sizeof(Datum)))
-
 #else
-
 #   define ldbm_datum_init(d) ((void)0)
-
 #endif  /* HAVE_BERKELEY_DB2 */
 
+LDAP_END_DECL
+
 #endif /* _ldbm_h_ */
index aff2ddbee40320eaabafd57e2b7eb275b5cfa929..612775772a17304b6ce9d89197a359c62a7182e5 100644 (file)
 /* Define if you have the tempnam function.  */
 #undef HAVE_TEMPNAM
 
+/* Define if you have the thr_getconcurrency function.  */
+#undef HAVE_THR_GETCONCURRENCY
+
 /* Define if you have the thr_setconcurrency function.  */
 #undef HAVE_THR_SETCONCURRENCY
 
index ca3f15d258437d6548776998aacd84e628e60918..d83bde5f6de1a5c369431a05dab2119c9ff245a4 100644 (file)
@@ -19,6 +19,7 @@
 #include <ac/errno.h>
 
 #include "ldbm.h"
+#include "lthread.h"
 
 #if defined( LDBM_USE_DBHASH ) || defined( LDBM_USE_DBBTREE )
 
  *****************************************************************/
 
 #ifdef HAVE_BERKELEY_DB2
-/*************************************************
- *                                               *
- *  A malloc routine for use with DB_DBT_MALLOC  *
- *                                               *
- *************************************************/
 
 void *
 ldbm_malloc( size_t size )
@@ -41,14 +37,7 @@ ldbm_malloc( size_t size )
        return( calloc( 1, size ));
 }
 
-/*  a dbEnv for BERKELEYv2  */
-#include "lthread.h"
-
-DB_ENV           dbEnv;
-int              dbEnvInit = 0;
-pthread_mutex_t  dbEnvInit_mutex;
-
-void
+static void
 ldbm_db_errcall( const char *prefix, char *message )
 {
 
@@ -56,68 +45,81 @@ ldbm_db_errcall( const char *prefix, char *message )
 
 }
 
-#endif
+/*  a dbEnv for BERKELEYv2  */
+static DB_ENV           ldbm_Env;
 
+/* Berkeley DB 2.x is reentrant */
+#define LDBM_LOCK      ((void)0)
+#define LDBM_UNLOCK    ((void)0)
 
-LDBM
-ldbm_open( char *name, int rw, int mode, int dbcachesize )
+void ldbm_initialize( void )
 {
-       LDBM            ret = NULL;
+       static int initialized = 0;
 
-#ifdef HAVE_BERKELEY_DB2
-       DB_INFO         dbinfo;
+       int     err;
+       int     envFlags;
 
-       /* initialize an environment for the DB application */
-       pthread_mutex_lock( &dbEnvInit_mutex );
+       if(initialized++) return;
 
-       if ( !dbEnvInit ) {
-               char   *dir;
-               char    tmp[BUFSIZ];
-               int     err = 0;
-               int     envFlags = DB_CREATE | DB_THREAD;
+       memset( &ldbm_Env, 0, sizeof( ldbm_Env ));
 
-               strcpy( tmp, name );
-               if ( ( dir = strrchr( tmp, '/' )) ) {
+       ldbm_Env.db_errcall   = ldbm_db_errcall;
+       ldbm_Env.db_errpfx    = "==>";
 
-                       *dir ='\0';
-                       dir = tmp;
+       envFlags = DB_CREATE | DB_THREAD;
 
+       if ( ( err = db_appinit( NULL, NULL, &ldbm_Env, envFlags )) ) {
+               char  error[BUFSIZ];
+
+               if ( err < 0 ) {
+                       sprintf( error, "%ld\n", (long) err );
                } else {
+                       sprintf( error, "%s\n", strerror( err ));
+               }
 
-                       dir = "/";
+               syslog( LOG_INFO,
+                       "ldbm_initialize(): FATAL error in db_appinit() : %s\n",
+                       error );
+               exit( 1 );
+       }
+}
 
-               }
+#else
 
-               memset( &dbEnv, 0, sizeof( dbEnv ));
+/* DB 1.85 is non-reentrant */
+static pthread_mutex_t ldbm_big_mutex;
+#define LDBM_LOCK      (pthread_mutex_lock(&ldbm_big_mutex))
+#define LDBM_UNLOCK    (pthread_mutex_unlock(&ldbm_big_mutex))
 
-               dbEnv.db_errcall   = ldbm_db_errcall;
-               dbEnv.db_errpfx    = "==>";
+void ldbm_initialize( void )
+{
+       static int initialized = 0;
 
-               if ( ( err = db_appinit( NULL, NULL, &dbEnv, envFlags )) ) {
-                       char  error[BUFSIZ];
+       if(initialized++) return;
 
-                       if ( err < 0 ) sprintf( error, "%ld\n", (long) err );
-                       else           sprintf( error, "%s\n", strerror( err ));
+       pthread_mutex_init( &ldbm_big_mutex,  pthread_mutexattr_default );
+}
 
-                       syslog( LOG_INFO,
-                        "ldbm_open(): FATAL error in db_appinit(%s) : %s\n",
-                                                       dir, error );
+#endif
 
-                       exit( 1 );
 
-               }
 
-               dbEnvInit = 1;
+LDBM
+ldbm_open( char *name, int rw, int mode, int dbcachesize )
+{
+       LDBM            ret = NULL;
 
-       }
-       pthread_mutex_unlock( &dbEnvInit_mutex );
+#ifdef HAVE_BERKELEY_DB2
+       DB_INFO dbinfo;
 
        memset( &dbinfo, 0, sizeof( dbinfo ));
        dbinfo.db_cachesize = dbcachesize;
        dbinfo.db_pagesize  = DEFAULT_DB_PAGE_SIZE;
        dbinfo.db_malloc    = ldbm_malloc;
 
-    (void) db_open( name, DB_TYPE, rw, mode, &dbEnv, &dbinfo, &ret );
+       LDBM_LOCK;
+    (void) db_open( name, DB_TYPE, rw, mode, &ldbm_Env, &dbinfo, &ret );
+       LDBM_UNLOCK;
 
 #else
        void            *info;
@@ -136,7 +138,9 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
                info = NULL;
        }
 
+       LDBM_LOCK;
        ret = dbopen( name, rw, mode, DB_TYPE, info );
+       LDBM_UNLOCK;
 
 #endif
 
@@ -146,17 +150,21 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
 void
 ldbm_close( LDBM ldbm )
 {
+       LDBM_LOCK;
 #ifdef HAVE_BERKELEY_DB2
        (*ldbm->close)( ldbm, 0 );
 #else
        (*ldbm->close)( ldbm );
 #endif
+       LDBM_UNLOCK;
 }
 
 void
 ldbm_sync( LDBM ldbm )
 {
+       LDBM_LOCK;
        (*ldbm->sync)( ldbm, 0 );
+       LDBM_UNLOCK;
 }
 
 void
@@ -188,6 +196,8 @@ ldbm_fetch( LDBM ldbm, Datum key )
        Datum   data;
        int     rc;
 
+       LDBM_LOCK;
+
 #ifdef HAVE_BERKELEY_DB2
        ldbm_datum_init( data );
 
@@ -204,6 +214,8 @@ ldbm_fetch( LDBM ldbm, Datum key )
                data.dsize = 0;
        }
 
+       LDBM_UNLOCK;
+
        return( data );
 }
 
@@ -212,6 +224,8 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags )
 {
        int     rc;
 
+       LDBM_LOCK;
+
 #ifdef HAVE_BERKELEY_DB2
        rc = (*ldbm->put)( ldbm, NULL, &key, &data, flags & ~LDBM_SYNC );
        rc = (-1 ) * rc;
@@ -221,6 +235,9 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags )
 
        if ( flags & LDBM_SYNC )
                (*ldbm->sync)( ldbm, 0 );
+
+       LDBM_UNLOCK;
+
        return( rc );
 }
 
@@ -229,6 +246,8 @@ ldbm_delete( LDBM ldbm, Datum key )
 {
        int     rc;
 
+       LDBM_LOCK;
+
 #ifdef HAVE_BERKELEY_DB2
        rc = (*ldbm->del)( ldbm, NULL, &key, 0 );
        rc = (-1 ) * rc;
@@ -236,6 +255,9 @@ ldbm_delete( LDBM ldbm, Datum key )
        rc = (*ldbm->del)( ldbm, &key, 0 );
 #endif
        (*ldbm->sync)( ldbm, 0 );
+
+       LDBM_UNLOCK;
+
        return( rc );
 }
 
@@ -257,6 +279,8 @@ ldbm_firstkey( LDBM ldbm )
 
        key.flags = data.flags = DB_DBT_MALLOC;
 
+       LDBM_LOCK;
+
        /* acquire a cursor for the DB */
 
 #  if defined( DB_VERSION_MAJOR ) && defined( DB_VERSION_MINOR ) && \
@@ -276,6 +300,9 @@ ldbm_firstkey( LDBM ldbm )
                if ( (*dbci->c_get)( dbci, &key, &data, DB_NEXT ) == 0 ) {
                        if ( data.dptr ) free( data.dptr );
 #else
+
+       LDBM_LOCK;
+
        if ( (rc = (*ldbm->seq)( ldbm, &key, &data, R_FIRST )) == 0 ) {
                key = ldbm_datum_dup( ldbm, key );
 #endif
@@ -288,6 +315,8 @@ ldbm_firstkey( LDBM ldbm )
        }
 #endif
 
+       LDBM_UNLOCK;
+
        return( key );
 }
 
@@ -308,9 +337,14 @@ ldbm_nextkey( LDBM ldbm, Datum key )
 
        data.flags = DB_DBT_MALLOC;
 
+       LDBM_LOCK;
+
        if ( (*dbcp->c_get)( dbcp, &key, &data, DB_NEXT ) == 0 ) {
                if ( data.dptr ) free( data.dptr );
 #else
+
+       LDBM_LOCK;
+
        if ( (rc = (*ldbm->seq)( ldbm, &key, &data, R_NEXT )) == 0 ) {
                key = ldbm_datum_dup( ldbm, key );
 #endif
@@ -318,6 +352,9 @@ ldbm_nextkey( LDBM ldbm, Datum key )
                key.dptr = NULL;
                key.dsize = 0;
        }
+
+       LDBM_UNLOCK;
+
 #ifdef HAVE_BERKELEY_DB2
        if ( oldKey ) free( oldKey );
 #endif
@@ -335,6 +372,20 @@ ldbm_errno( LDBM ldbm )
 
 #include <sys/stat.h>
 
+/* GDBM is non-reentrant */
+static pthread_mutex_t ldbm_big_mutex;
+#define LDBM_LOCK      (pthread_mutex_lock(&ldbm_big_mutex))
+#define LDBM_UNLOCK    (pthread_mutex_unlock(&ldbm_big_mutex))
+
+void ldbm_initialize( void )
+{
+       static int initialized = 0;
+
+       if(initialized++) return;
+
+       pthread_mutex_init( &ldbm_big_mutex,  pthread_mutexattr_default );
+}
+
 /*****************************************************************
  *                                                               *
  * use gdbm                                                      *
@@ -347,7 +398,10 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
        LDBM            db;
        struct stat     st;
 
+       LDBM_LOCK;
+
        if ( (db =  gdbm_open( name, 0, rw | GDBM_FAST, mode, 0 )) == NULL ) {
+               LDBM_UNLOCK;
                return( NULL );
        }
        if ( dbcachesize > 0 && stat( name, &st ) == 0 ) {
@@ -355,19 +409,24 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize )
                gdbm_setopt( db, GDBM_CACHESIZE, &dbcachesize, sizeof(int) );
        }
 
+       LDBM_UNLOCK;
        return( db );
 }
 
 void
 ldbm_close( LDBM ldbm )
 {
+       LDBM_LOCK;
        gdbm_close( ldbm );
+       LDBM_UNLOCK;
 }
 
 void
 ldbm_sync( LDBM ldbm )
 {
+       LDBM_LOCK;
        gdbm_sync( ldbm );
+       LDBM_UNLOCK;
 }
 
 void
@@ -397,7 +456,11 @@ ldbm_datum_dup( LDBM ldbm, Datum data )
 Datum
 ldbm_fetch( LDBM ldbm, Datum key )
 {
-       return( gdbm_fetch( ldbm, key ) );
+       Datum d;
+       LDBM_LOCK;
+       d = gdbm_fetch( ldbm, key );
+       LDBM_UNLOCK;
+       return d;
 }
 
 int
@@ -405,9 +468,11 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags )
 {
        int     rc;
 
+       LDBM_LOCK;
        rc = gdbm_store( ldbm, key, data, flags & ~LDBM_SYNC );
        if ( flags & LDBM_SYNC )
                gdbm_sync( ldbm );
+       LDBM_UNLOCK;
        return( rc );
 }
 
@@ -416,31 +481,59 @@ ldbm_delete( LDBM ldbm, Datum key )
 {
        int     rc;
 
+       LDBM_LOCK;
        rc = gdbm_delete( ldbm, key );
        gdbm_sync( ldbm );
+       LDBM_UNLOCK;
        return( rc );
 }
 
 Datum
 ldbm_firstkey( LDBM ldbm )
 {
-       return( gdbm_firstkey( ldbm ) );
+       Datum d;
+       LDBM_LOCK;
+       d = gdbm_firstkey( ldbm );
+       LDBM_UNLOCK;
+       return d;
 }
 
 Datum
 ldbm_nextkey( LDBM ldbm, Datum key )
 {
-       return( gdbm_nextkey( ldbm, key ) );
+       Datum d;
+       LDBM_LOCK;
+       d = gdbm_nextkey( ldbm, key );
+       LDBM_UNLOCK;
+       return d;
 }
 
 int
 ldbm_errno( LDBM ldbm )
 {
-       return( (int) gdbm_errno );
+       int err;
+       LDBM_LOCK;
+       err = gdbm_errno;
+       LDBM_UNLOCK;
+       return( err );
 }
 
 #elif defined( HAVE_NDBM )
 
+/* GDBM is non-reentrant */
+static pthread_mutex_t ldbm_big_mutex;
+#define LDBM_LOCK      (pthread_mutex_lock(&ldbm_big_mutex))
+#define LDBM_UNLOCK    (pthread_mutex_unlock(&ldbm_big_mutex))
+
+void ldbm_initialize( void )
+{
+       static int initialized = 0;
+
+       if(initialized++) return;
+
+       pthread_mutex_init( &ldbm_big_mutex,  pthread_mutexattr_default );
+}
+
 /*****************************************************************
  *                                                               *
  * if no gdbm, fall back to using ndbm, the standard unix thing  *
@@ -451,13 +544,21 @@ ldbm_errno( LDBM ldbm )
 LDBM
 ldbm_open( char *name, int rw, int mode, int dbcachesize )
 {
-       return( dbm_open( name, rw, mode ) );
+       LDBM ldbm;
+
+       LDBM_LOCK;
+       ldbm = dbm_open( name, rw, mode );
+       LDBM_UNLOCK;
+
+       return( ldbm );
 }
 
 void
 ldbm_close( LDBM ldbm )
 {
+       LDBM_LOCK;
        dbm_close( ldbm );
+       LDBM_UNLOCK;
 }
 
 /* ARGSUSED */
@@ -495,37 +596,61 @@ ldbm_datum_dup( LDBM ldbm, Datum data )
 Datum
 ldbm_fetch( LDBM ldbm, Datum key )
 {
-       return( ldbm_datum_dup( ldbm, dbm_fetch( ldbm, key ) ) );
+       Datum d;
+       LDBM_LOCK;
+       d = ldbm_datum_dup( ldbm, dbm_fetch( ldbm, key ) );
+       LDBM_UNLOCK;
+       return d;
 }
 
 int
 ldbm_store( LDBM ldbm, Datum key, Datum data, int flags )
 {
-       return( dbm_store( ldbm, key, data, flags ) );
+       int rc;
+       LDBM_LOCK;
+       rc = dbm_store( ldbm, key, data, flags );
+       LDBM_UNLOCK;
+       return rc;
 }
 
 int
 ldbm_delete( LDBM ldbm, Datum key )
 {
-       return( dbm_delete( ldbm, key ) );
+       int rc;
+       LDBM_LOCK;
+       rc = dbm_delete( ldbm, key );
+       LDBM_UNLOCK;
+       return rc;
 }
 
 Datum
 ldbm_firstkey( LDBM ldbm )
 {
-       return( dbm_firstkey( ldbm ) );
+       Datum d;
+       LDBM_LOCK;
+       d = dbm_firstkey( ldbm );
+       LDBM_UNLOCK;
+       return d;
 }
 
 Datum
 ldbm_nextkey( LDBM ldbm, Datum key )
 {
-       return( dbm_nextkey( ldbm ) );
+       Datum d;
+       LDBM_LOCK;
+       d = dbm_nextkey( ldbm );
+       LDBM_UNLOCK;
+       return d;
 }
 
 int
 ldbm_errno( LDBM ldbm )
 {
-       return( dbm_error( ldbm ) );
+       int err;
+       LDBM_LOCK;
+       err = dbm_error( ldbm );
+       LDBM_UNLOCK;
+       return err;
 }
 
 #endif /* ndbm */
index 5f46374c79f5517c6b65ac908905553dc8b39274..95b1134d002e19d19c8a4ec0f5a79d90e149f9f2 100644 (file)
@@ -71,16 +71,13 @@ struct cache {
 
 /* for the cache of open index files */
 struct dbcache {
-       char            *dbc_name;
        int             dbc_refcnt;
-       time_t          dbc_lastref;
-       pthread_mutex_t dbc_mutex;
-       pthread_cond_t  dbc_cv;
-       int             dbc_readers;
-       long            dbc_blksize;
        int             dbc_maxids;
        int             dbc_maxindirect;
-       LDBM            dbc_db;
+       time_t  dbc_lastref;
+       long    dbc_blksize;
+       char    *dbc_name;
+       LDBM    dbc_db;
 };
 
 /* for the cache of attribute information (which are indexed, etc.) */
index 143ed07e3ee6378fbe279c0304f663dddd07d570..7254c6f4c0e7701364d395a2bbed67141014ce10 100644 (file)
@@ -160,9 +160,7 @@ ldbm_cache_flush_all( Backend *be )
                if ( li->li_dbcache[i].dbc_name != NULL ) {
                        Debug( LDAP_DEBUG_TRACE, "ldbm flushing db (%s)\n",
                            li->li_dbcache[i].dbc_name, 0, 0 );
-                       pthread_mutex_lock( &li->li_dbcache[i].dbc_mutex );
                        ldbm_sync( li->li_dbcache[i].dbc_db );
-                       pthread_mutex_unlock( &li->li_dbcache[i].dbc_mutex );
                }
        }
        pthread_mutex_unlock( &li->li_dbcache_mutex );
@@ -178,24 +176,8 @@ ldbm_cache_fetch(
 
        ldbm_datum_init( data );
 
-       pthread_mutex_lock( &db->dbc_mutex );
-#ifdef reentrant_database
-       /* increment reader count */
-       db->dbc_readers++
-       pthread_mutex_unlock( &db->dbc_mutex );
-#endif
-
        data = ldbm_fetch( db->dbc_db, key );
 
-#ifdef reentrant_database
-       pthread_mutex_lock( &db->dbc_mutex );
-       /* decrement reader count & signal any waiting writers */
-       if ( --db->dbc_readers == 0 ) {
-               pthread_cond_signal( &db->dbc_cv );
-       }
-#endif
-       pthread_mutex_unlock( &db->dbc_mutex );
-
        return( data );
 }
 
@@ -209,14 +191,6 @@ ldbm_cache_store(
 {
        int     rc;
 
-       pthread_mutex_lock( &db->dbc_mutex );
-#ifdef reentrant_database
-       /* wait for reader count to drop to zero */
-       while ( db->dbc_readers > 0 ) {
-               pthread_cond_wait( &db->dbc_cv, &db->dbc_mutex );
-       }
-#endif
-
 #ifdef LDBM_DEBUG
        Statslog( LDAP_DEBUG_STATS,
                "=> ldbm_cache_store(): key.dptr=%s, key.dsize=%d\n",
@@ -237,8 +211,6 @@ ldbm_cache_store(
 
        rc = ldbm_store( db->dbc_db, key, data, flags );
 
-       pthread_mutex_unlock( &db->dbc_mutex );
-
        return( rc );
 }
 
@@ -250,17 +222,7 @@ ldbm_cache_delete(
 {
        int     rc;
 
-       pthread_mutex_lock( &db->dbc_mutex );
-#ifdef reentrant_database
-       /* wait for reader count to drop to zero - then write */
-       while ( db->dbc_readers > 0 ) {
-               pthread_cond_wait( &db->dbc_cv, &db->dbc_mutex );
-       }
-#endif
-
        rc = ldbm_delete( db->dbc_db, key );
 
-       pthread_mutex_unlock( &db->dbc_mutex );
-
        return( rc );
 }
index eccc6d2266ec3ff4e65647457c96f5995ec3e04c..501e451880f9914f62ef92fc86088852e206a1a4 100644 (file)
@@ -19,9 +19,8 @@ ldbm_back_init(
        char            *argv[ 4 ];
        int             i;
 
-#ifdef HAVE_BERKELEY_DB2
-       extern pthread_mutex_t   dbEnvInit_mutex;
-#endif
+       /* initialize the underlying database system */
+       ldbm_initialize();
 
        /* allocate backend-specific stuff */
        li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );
@@ -77,15 +76,6 @@ ldbm_back_init(
        pthread_mutex_init( &li->li_nextid_mutex, pthread_mutexattr_default );
        pthread_mutex_init( &li->li_dbcache_mutex, pthread_mutexattr_default );
        pthread_cond_init( &li->li_dbcache_cv, pthread_condattr_default );
-       for ( i = 0; i < MAXDBCACHE; i++ ) {
-               pthread_mutex_init( &li->li_dbcache[i].dbc_mutex,
-                   pthread_mutexattr_default );
-               pthread_cond_init( &li->li_dbcache[i].dbc_cv,
-                   pthread_condattr_default );
-       }
-#ifdef HAVE_BERKELEY_DB2
-       pthread_mutex_init( &dbEnvInit_mutex, pthread_mutexattr_default );
-#endif
 
        be->be_private = li;
 }